From db13aac8ebb035422074533a84a2c087feb4487a Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Thu, 20 Nov 2025 18:57:57 +0100 Subject: [PATCH 01/39] Extend ROS2 support Step 2: Fine grained ServerSynchronization Introduced a fine grained ServerSynchronization mechanism, where each synchonization participant is treated independently and interacts with the synchronization of the carla-server individually. If a client is disconnected (or dies) the synchronization state of all participants registered via that client are dropped, i.e. the server will continue running in case the participants of that client were the only ones demanding synchronous mode. The synchronization interface provides means of a time window, up to which the server is allowed to run. Like this, every client can prevent the carla-server to run too fast depending on their individual speed. There is no sync-master anymore. Every client decides for its own if it requires synchronization or not. Drawback of this change: some existing code might have to be changed (see removal of synchronous_master in generate_traffic.py). --- CHANGELOG.md | 3 +- .../source/carla/rpc/RpcServerInterface.h | 21 ++ LibCarla/source/carla/rpc/Server.h | 13 +- .../carla/rpc/ServerSynchronizationTypes.h | 33 +++ PythonAPI/examples/generate_traffic.py | 35 +-- .../Carla/Source/Carla/Game/CarlaEngine.cpp | 32 ++- .../Carla/Source/Carla/Game/CarlaEngine.h | 2 - .../Carla/Source/Carla/Server/CarlaServer.cpp | 247 +++++++++++++++++- .../Carla/Source/Carla/Server/CarlaServer.h | 25 ++ .../Carla/Server/ServerSynchronization.h | 244 +++++++++++++++++ Util/BuildTools/Setup.sh | 2 +- 11 files changed, 615 insertions(+), 42 deletions(-) create mode 100644 LibCarla/source/carla/rpc/ServerSynchronizationTypes.h create mode 100644 Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/ServerSynchronization.h diff --git a/CHANGELOG.md b/CHANGELOG.md index f7aedb14146..68f74d2fced 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ * Introduced geom::AngularVelocity, geom::Velocity, geom::Acceleration, geom::Quaternion types * Fixed geom::Rotation::RotateVector() rotation directions of pitch and roll * Prepare server for multistream support and ROS2 client calls - * Improved V2X sensor capabilities: send complex custom user-defined data, support V2I sensors not attached to a vehicle + * Introduced fine grained ServerSynchronization mechanism: each client decides for its own if it requires synchronization or not and provides its own synchronization window. + Be aware: some existing code using master/slave sync mechanism might need rework. See also generate_traffic.py. ## CARLA 0.9.16 diff --git a/LibCarla/source/carla/rpc/RpcServerInterface.h b/LibCarla/source/carla/rpc/RpcServerInterface.h index 55a1daa87c7..120dd3949b8 100644 --- a/LibCarla/source/carla/rpc/RpcServerInterface.h +++ b/LibCarla/source/carla/rpc/RpcServerInterface.h @@ -14,6 +14,7 @@ #include "carla/rpc/MapInfo.h" #include "carla/rpc/MapLayer.h" #include "carla/rpc/Response.h" +#include "carla/rpc/ServerSynchronizationTypes.h" #include "carla/rpc/Transform.h" #include "carla/rpc/VehicleTelemetryData.h" #include "carla/streaming/detail/Dispatcher.h" @@ -80,6 +81,26 @@ class RpcServerInterface { /** * @} */ + + /** + * @brief synchronization calls + * @{ + */ + virtual Response call_tick( + synchronization_client_id_type const &client_id = ALL_CLIENTS, + synchronization_participant_id_type const &participant_id = ALL_PARTICIPANTS) = 0; + virtual Response call_register_synchronization_participant( + synchronization_client_id_type const &client_id, + synchronization_participant_id_type const &participant_id_hint = ALL_PARTICIPANTS) = 0; + virtual Response call_deregister_synchronization_participant( + synchronization_client_id_type const &client_id, synchronization_participant_id_type const &participant_id) = 0; + virtual Response call_update_synchronization_window( + synchronization_client_id_type const &client_id, synchronization_participant_id_type const &participant_id, + synchronization_target_game_time const &target_game_time = NO_SYNC_TARGET_GAME_TIME) = 0; + virtual carla::rpc::Response > > call_get_synchronization_window_status() = 0; + /** + * @} + */ }; } // namespace rpc diff --git a/LibCarla/source/carla/rpc/Server.h b/LibCarla/source/carla/rpc/Server.h index 38dad188769..4e7d82e07f7 100644 --- a/LibCarla/source/carla/rpc/Server.h +++ b/LibCarla/source/carla/rpc/Server.h @@ -15,6 +15,7 @@ #include #include +#include #include @@ -65,6 +66,14 @@ namespace rpc { _server.stop(); } + void BindOnClientConnected(::rpc::server::callback_type callback) { + _server.set_on_connection(callback); + } + + void BindOnClientDisconnected(::rpc::server::callback_type callback) { + _server.set_on_disconnection(callback); + } + private: boost::asio::io_context _sync_io_context; @@ -108,7 +117,9 @@ namespace detail { template static auto WrapSyncCall(boost::asio::io_context &io, FuncT &&functor) { return [&io, functor=std::forward(functor)](Metadata metadata, Args... args) -> R { - auto task = std::packaged_task([functor=std::move(functor), args...]() { + auto const session_id = ::rpc::this_session().id(); + auto task = std::packaged_task([session_id, functor=std::move(functor), args...]() { + ::rpc::this_session().set_id(session_id); return functor(args...); }); if (metadata.IsResponseIgnored()) { diff --git a/LibCarla/source/carla/rpc/ServerSynchronizationTypes.h b/LibCarla/source/carla/rpc/ServerSynchronizationTypes.h new file mode 100644 index 00000000000..e010dfcb8be --- /dev/null +++ b/LibCarla/source/carla/rpc/ServerSynchronizationTypes.h @@ -0,0 +1,33 @@ +// Copyright (c) 2024 Computer Vision Center (CVC) at the Universitat Autonoma +// de Barcelona (UAB). +// +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +namespace carla { +namespace rpc { + +using synchronization_client_id_type = std::string; +static const carla::rpc::synchronization_client_id_type ALL_CLIENTS{}; + +using synchronization_participant_id_type = uint32_t; +static constexpr carla::rpc::synchronization_participant_id_type ALL_PARTICIPANTS{0}; + +using synchronization_target_game_time = double; +static constexpr synchronization_target_game_time NO_SYNC_TARGET_GAME_TIME{0.}; +static constexpr synchronization_target_game_time BLOCKING_TARGET_GAME_TIME{1e-6}; + +struct synchronization_window_participant_state { + synchronization_client_id_type client_id; + synchronization_participant_id_type participant_id; + synchronization_target_game_time target_game_time; +}; + + + +} // namespace rpc +} // namespace carla diff --git a/PythonAPI/examples/generate_traffic.py b/PythonAPI/examples/generate_traffic.py index 9158583003b..3acbc14189f 100755 --- a/PythonAPI/examples/generate_traffic.py +++ b/PythonAPI/examples/generate_traffic.py @@ -148,9 +148,9 @@ def main(): all_id = [] client = carla.Client(args.host, args.port) client.set_timeout(10.0) - synchronous_master = False random.seed(args.seed if args.seed is not None else int(time.time())) + original_world_settings = None try: world = client.get_world() @@ -164,15 +164,14 @@ def main(): if args.seed is not None: traffic_manager.set_random_device_seed(args.seed) - settings = world.get_settings() + original_world_settings = world.get_settings() + print("current_world_settings {}".format(original_world_settings)) + settings = original_world_settings if not args.asynch: traffic_manager.set_synchronous_mode(True) if not settings.synchronous_mode: - synchronous_master = True settings.synchronous_mode = True settings.fixed_delta_seconds = 0.05 - else: - synchronous_master = False else: print("You are currently in asynchronous mode. If this is a traffic simulation, \ you could experience some issues. If it's not working correctly, switch to synchronous \ @@ -180,7 +179,9 @@ def main(): if args.no_rendering: settings.no_rendering_mode = True + print("apply_world_settings {}".format(settings)) world.apply_settings(settings) + print("settings applied") blueprints = get_actor_blueprints(world, args.filterv, args.generationv) if not blueprints: @@ -229,7 +230,7 @@ def main(): batch.append(SpawnActor(blueprint, transform) .then(SetAutopilot(FutureActor, True, traffic_manager.get_port()))) - for response in client.apply_batch_sync(batch, synchronous_master): + for response in client.apply_batch_sync(batch, do_tick=True): if response.error: logging.error(response.error) else: @@ -281,7 +282,7 @@ def main(): print("Walker has no speed") walker_speed.append(0.0) batch.append(SpawnActor(walker_bp, spawn_point)) - results = client.apply_batch_sync(batch, True) + results = client.apply_batch_sync(batch, do_tick=True) walker_speed2 = [] for i in range(len(results)): if results[i].error: @@ -295,7 +296,7 @@ def main(): walker_controller_bp = world.get_blueprint_library().find('controller.ai.walker') for i in range(len(walkers_list)): batch.append(SpawnActor(walker_controller_bp, carla.Transform(), walkers_list[i]["id"])) - results = client.apply_batch_sync(batch, True) + results = client.apply_batch_sync(batch, do_tick=True) for i in range(len(results)): if results[i].error: logging.error(results[i].error) @@ -308,7 +309,7 @@ def main(): all_actors = world.get_actors(all_id) # wait for a tick to ensure client receives the last transform of the walkers we have just created - if args.asynch or not synchronous_master: + if args.asynch: world.wait_for_tick() else: world.tick() @@ -330,18 +331,22 @@ def main(): traffic_manager.global_percentage_speed_difference(30.0) while True: - if not args.asynch and synchronous_master: + if not args.asynch: world.tick() else: world.wait_for_tick() finally: - if not args.asynch and synchronous_master: - settings = world.get_settings() - settings.synchronous_mode = False - settings.no_rendering_mode = False - settings.fixed_delta_seconds = None + if not args.asynch: + if original_world_settings: + settings= original_world_settings + else: + settings = world.get_settings() + settings.synchronous_mode = False + settings.no_rendering_mode = False + settings.fixed_delta_seconds = None + print("restore world_settings {}".format(settings)) world.apply_settings(settings) print('\ndestroying %d vehicles' % len(vehicles_list)) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp index 8b404c8bd17..738b5372473 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp @@ -202,7 +202,7 @@ void FCarlaEngine::NotifyInitGame(const UCarlaSettings &Settings) Secondary = std::make_shared(PrimaryIP, PrimaryPort, CommandExecutor); Secondary->Connect(); // set this server in synchronous mode - bSynchronousMode = true; + Server.EnableSynchronousMode(); } else { @@ -281,21 +281,24 @@ void FCarlaEngine::OnPreTick(UWorld *, ELevelTick TickType, float DeltaSeconds) if (bIsPrimaryServer) { - if (CurrentEpisode && !bSynchronousMode && SecondaryServer->HasClientsConnected()) - { - // set synchronous mode - CurrentSettings.bSynchronousMode = true; - CurrentSettings.FixedDeltaSeconds = 1 / 20.0f; - OnEpisodeSettingsChanged(CurrentSettings); - CurrentEpisode->ApplySettings(CurrentSettings); - } - // process RPC commands do { Server.RunSome(1u); } - while (bSynchronousMode && !Server.TickCueReceived()); + while (Server.IsSynchronousModeActive() && !Server.TickCueReceived()); + + if ( (CurrentEpisode && !Server.IsSynchronousModeActive() && SecondaryServer->HasClientsConnected()) + || ( Server.IsSynchronousModeActive() && (!CurrentSettings.FixedDeltaSeconds || !CurrentSettings.bSynchronousMode) ) ) + { + // ensure the delta seconds are also considered in this run + DeltaSeconds = Server.GetTickDeltaSeconds(); + + CurrentSettings.bSynchronousMode = true; + CurrentSettings.FixedDeltaSeconds = DeltaSeconds; + OnEpisodeSettingsChanged(CurrentSettings); + CurrentEpisode->ApplySettings(CurrentSettings); + } } else { @@ -382,7 +385,12 @@ void FCarlaEngine::OnEpisodeSettingsChanged(const FEpisodeSettings &Settings) { CurrentSettings = FEpisodeSettings(Settings); - bSynchronousMode = Settings.bSynchronousMode; + if (Settings.bSynchronousMode && !Server.IsSynchronousModeActive()) { + Server.EnableSynchronousMode(); + } + else if (!Settings.bSynchronousMode && Server.IsSynchronousModeActive()) { + Server.DisableSynchronousMode(); + } if (GEngine && GEngine->GameViewport) { diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.h index f36f430debc..24638f98956 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.h @@ -105,8 +105,6 @@ class FCarlaEngine : private NonCopyable bool bIsRunning = false; - bool bSynchronousMode = false; - bool bMapChanged = false; FCarlaServer Server; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp index ed992d16874..3d4b4f0313b 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp @@ -5,9 +5,11 @@ // For a copy, see . #include "Carla.h" +#include "rpc/this_session.h" #include "Carla/Server/CarlaServer.h" #include "Carla/Server/CarlaServerResponse.h" #include "Carla/Game/CarlaHUD.h" +#include "Carla/Server/ServerSynchronization.h" #include "Carla/Traffic/TrafficLightGroup.h" #include "EngineUtils.h" #include "Components/SkeletalMeshComponent.h" @@ -122,6 +124,24 @@ class FCarlaServer::FPimpl: public carla::rpc::RpcServerInterface SecondaryServer = std::make_shared(SecondaryPort); SecondaryServer->SetCallbacks(); BindActions(); + + auto const RegisterResponse = ServerSync.RegisterSynchronizationParticipant(SynchronizationClientId()); + if ( RegisterResponse ) { + ServerSynchronizationParticipantId = RegisterResponse.Get(); + UE_LOG( + LogCarlaServer, + Verbose, + TEXT("Server registered for sync (session_id=%s, sync_id=%d)"), + UTF8_TO_TCHAR(SynchronizationClientId().c_str()), + ServerSynchronizationParticipantId); + } + else { + UE_LOG( + LogCarlaServer, + Error, + TEXT("Server registered for sync (session_id=%s) failed)"), + UTF8_TO_TCHAR(SynchronizationClientId().c_str())); + } } std::shared_ptr GetSecondaryServer() { @@ -210,7 +230,56 @@ class FCarlaServer::FPimpl: public carla::rpc::RpcServerInterface void NotifyEndEpisode(); - std::atomic_size_t TickCuesReceived { 0u }; + ServerSynchronization ServerSync; + + + /** + * @brief synchronization calls + * @{ + */ + carla::rpc::Response call_tick( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const &participant_id) override; + carla::rpc::Response call_register_synchronization_participant( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const &participant_id_hint = carla::rpc::ALL_PARTICIPANTS) override; + carla::rpc::Response call_deregister_synchronization_participant( + carla::rpc::synchronization_client_id_type const &client_id, carla::rpc::synchronization_participant_id_type const &participant_id) override; + carla::rpc::Response call_update_synchronization_window( + carla::rpc::synchronization_client_id_type const &client_id, carla::rpc::synchronization_participant_id_type const &participant_id, + carla::rpc::synchronization_target_game_time const &target_game_time = carla::rpc::NO_SYNC_TARGET_GAME_TIME) override; + carla::rpc::Response > > call_get_synchronization_window_status() override; + /** + * @} + */ + void OnClientDisconnected(std::shared_ptr server_session); + void OnClientConnected(std::shared_ptr server_session); + bool IsNextGameTickAllowed(); + + void EnableSynchronousMode(); + void DisableSynchronousMode(); + carla::rpc::synchronization_client_id_type SynchronizationClientId() const { return "CarlaServer"; } + carla::rpc::synchronization_participant_id_type TickParticipantId() { + ::rpc::session_id_t RpcSessionId = ::rpc::this_session().id(); + carla::rpc::synchronization_participant_id_type SynchronizationParticipantId = ServerSynchronizationParticipantId; + auto TickParticipantIdIter = TickSynchronizationParticipantMap.find(RpcSessionId); + if ( TickParticipantIdIter!=TickSynchronizationParticipantMap.end()) { + SynchronizationParticipantId = TickParticipantIdIter->second; + } + return SynchronizationParticipantId; + } + + + carla::rpc::synchronization_participant_id_type ServerSynchronizationParticipantId{0}; + std::map<::rpc::session_id_t, carla::rpc::synchronization_participant_id_type> TickSynchronizationParticipantMap; + + double GetTickDeltaSeconds() { + double FixedDeltaSeconds = 1./20.; + if ((Episode != nullptr) && Episode->GetSettings().FixedDeltaSeconds.IsSet()) { + FixedDeltaSeconds = Episode->GetSettings().FixedDeltaSeconds.GetValue(); + } + return FixedDeltaSeconds; + } private: @@ -302,6 +371,9 @@ void FCarlaServer::FPimpl::BindActions() namespace cr = carla::rpc; namespace cg = carla::geom; + Server.BindOnClientConnected(std::bind(&FCarlaServer::FPimpl::OnClientConnected, this, std::placeholders::_1)); + Server.BindOnClientDisconnected(std::bind(&FCarlaServer::FPimpl::OnClientDisconnected, this, std::placeholders::_1)); + /// Looks for a Traffic Manager running on port BIND_SYNC(is_traffic_manager_running) << [this] (uint16_t port) ->R { @@ -353,9 +425,14 @@ void FCarlaServer::FPimpl::BindActions() BIND_SYNC(tick_cue) << [this]() -> R { TRACE_CPUPROFILER_EVENT_SCOPE(TickCueReceived); - auto Current = FCarlaEngine::GetFrameCounter(); - (void)TickCuesReceived.fetch_add(1, std::memory_order_release); - return Current + 1; + UE_LOG( + LogCarlaServer, + Verbose, + TEXT("Tick received (session_id=%s, sync_id=%d, rpc_sid=%li)"), + UTF8_TO_TCHAR(SynchronizationClientId().c_str()), + TickParticipantId(), + ::rpc::this_session().id()); + return call_tick(SynchronizationClientId(), TickParticipantId()); }; // ~~ Load new episode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -3587,6 +3664,109 @@ void FCarlaServer::FPimpl::NotifyEndEpisode() Episode = nullptr; } + +carla::rpc::Response FCarlaServer::FPimpl::call_tick( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const&participant_id) +{ + REQUIRE_CARLA_EPISODE(); + auto Current = FCarlaEngine::GetFrameCounter(); + auto const TargetGameTime = Episode->GetElapsedGameTime() + GetTickDeltaSeconds(); + (void) call_update_synchronization_window(client_id, participant_id, TargetGameTime); + return Current + 1; +} + +carla::rpc::Response FCarlaServer::FPimpl::call_register_synchronization_participant( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const&participant_id_hint) +{ + return ServerSync.RegisterSynchronizationParticipant(client_id, participant_id_hint); +} + +carla::rpc::Response FCarlaServer::FPimpl::call_deregister_synchronization_participant( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const &participant_id) +{ + return ServerSync.DeregisterSynchronizationParticipant(client_id, participant_id); +} + +carla::rpc::Response FCarlaServer::FPimpl::call_update_synchronization_window( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const&participant_id, + carla::rpc::synchronization_target_game_time const &target_game_time) +{ + return ServerSync.UpdateSynchronizationWindow(client_id, participant_id, target_game_time); +} + +carla::rpc::Response > > FCarlaServer::FPimpl::call_get_synchronization_window_status() { + return ServerSync.GetSynchronizationWindowParticipantStates(); +} + +void FCarlaServer::FPimpl::OnClientConnected(std::shared_ptr server_session) { + auto const RegisterResponse = ServerSync.RegisterSynchronizationParticipant(SynchronizationClientId()); + if ( RegisterResponse ) { + TickSynchronizationParticipantMap.insert({::rpc::this_session().id(), RegisterResponse.Get()}); + UE_LOG( + LogCarlaServer, + Verbose, + TEXT("Client connected (session_id=%s, sync_id=%d, rpc_sid=%li)"), + UTF8_TO_TCHAR(SynchronizationClientId().c_str()), + RegisterResponse.Get(), + ::rpc::this_session().id()); + } + else { + UE_LOG( + LogCarlaServer, + Error, + TEXT("Client connected (session_id=%s, rpc_sid=%li) registering for sync failed."), + UTF8_TO_TCHAR(SynchronizationClientId().c_str()), + ::rpc::this_session().id()); + } +} + +void FCarlaServer::FPimpl::OnClientDisconnected(std::shared_ptr server_session) { + UE_LOG( + LogCarlaServer, + Verbose, + TEXT("Client disconnected (session_id=%s, sync_id=%d, rpc_sid=%li)"), + UTF8_TO_TCHAR(SynchronizationClientId().c_str()), + TickParticipantId(), + ::rpc::this_session().id()); + ServerSync.DeregisterSynchronizationParticipant(SynchronizationClientId(), TickParticipantId()); + TickSynchronizationParticipantMap.erase(::rpc::this_session().id()); +} + +bool FCarlaServer::FPimpl::IsNextGameTickAllowed() { + if (Episode == nullptr) { + return false; + } + auto const ElapsedGameTime = Episode->GetElapsedGameTime(); + auto TargetGameTime = ServerSync.GetTargetSynchronizationTime(ElapsedGameTime , GetTickDeltaSeconds()); + return TargetGameTime > ElapsedGameTime; +} + +void FCarlaServer::FPimpl::EnableSynchronousMode() { + UE_LOG( + LogCarlaServer, + Verbose, + TEXT("EnableSynchronousMode (session_id=%s, sync_id=%d, rpc_sid=%li)"), + UTF8_TO_TCHAR(SynchronizationClientId().c_str()), + TickParticipantId(), + ::rpc::this_session().id()) + ServerSync.EnableSynchronousMode(SynchronizationClientId(), TickParticipantId()); +} + +void FCarlaServer::FPimpl::DisableSynchronousMode() { + UE_LOG( + LogCarlaServer, + Verbose, + TEXT("DisableSynchronousMode (session_id=%s, sync_id=%d, rpc_sid=%li)"), + UTF8_TO_TCHAR(SynchronizationClientId().c_str()), + TickParticipantId(), + ::rpc::this_session().id()); + ServerSync.DisableSynchronousMode(SynchronizationClientId(), TickParticipantId()); +} + // ============================================================================= // -- Undef helper macros ------------------------------------------------------ // ============================================================================= @@ -3598,6 +3778,7 @@ void FCarlaServer::FPimpl::NotifyEndEpisode() #undef RESPOND_ERROR #undef CARLA_ENSURE_GAME_THREAD + // ============================================================================= // -- FCarlaServer ------------------------------------------------------- // ============================================================================= @@ -3680,18 +3861,30 @@ void FCarlaServer::SetROS2TopicVisibilityDefaultEnabled(bool _topic_visibility_d Pimpl->StreamingServer.SetROS2TopicVisibilityDefaultEnabled(_topic_visibility_default_enabled); } +void FCarlaServer::EnableSynchronousMode() { + Pimpl->EnableSynchronousMode(); +} + +void FCarlaServer::DisableSynchronousMode() { + Pimpl->DisableSynchronousMode(); +} + +bool FCarlaServer::IsSynchronousModeActive() { + return Pimpl->ServerSync.IsSynchronousModeActive(); +} + +double FCarlaServer::GetTickDeltaSeconds() { + return Pimpl->GetTickDeltaSeconds(); +} + void FCarlaServer::Tick() { - (void)Pimpl->TickCuesReceived.fetch_add(1, std::memory_order_release); + (void)Pimpl->call_tick(Pimpl->SynchronizationClientId(), Pimpl->ServerSynchronizationParticipantId); } bool FCarlaServer::TickCueReceived() { - auto k = Pimpl->TickCuesReceived.fetch_sub(1, std::memory_order_acquire); - bool flag = (k > 0); - if (!flag) - (void)Pimpl->TickCuesReceived.fetch_add(1, std::memory_order_release); - return flag; + return Pimpl->IsNextGameTickAllowed(); } void FCarlaServer::Stop() @@ -3794,3 +3987,37 @@ carla::rpc::Response FCarlaServer::call_get_te return Pimpl->call_get_telemetry_data(ActorId); } + +carla::rpc::Response FCarlaServer::call_tick( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const&synchronization_participant) +{ + return Pimpl->call_tick(client_id, synchronization_participant); +} + +carla::rpc::Response FCarlaServer::call_register_synchronization_participant( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const &participant_id_hint) +{ + return Pimpl->call_register_synchronization_participant(client_id, participant_id_hint); +} + +carla::rpc::Response FCarlaServer::call_deregister_synchronization_participant( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const&synchronization_participant) +{ + return Pimpl->call_deregister_synchronization_participant(client_id, synchronization_participant); +} + +carla::rpc::Response FCarlaServer::call_update_synchronization_window( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const&synchronization_participant, + carla::rpc::synchronization_target_game_time const &target_game_time) +{ + return Pimpl->call_update_synchronization_window(client_id, synchronization_participant, target_game_time); +} + +carla::rpc::Response > > FCarlaServer::call_get_synchronization_window_status() { + return Pimpl->call_get_synchronization_window_status(); +} + diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h index 864466e31fc..4588aa84b02 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h @@ -44,6 +44,11 @@ class FCarlaServer: public carla::rpc::RpcServerInterface void SetROS2TopicVisibilityDefaultEnabled(bool _topic_visibility_default_enabled); + void EnableSynchronousMode(); + void DisableSynchronousMode(); + bool IsSynchronousModeActive(); + + double GetTickDeltaSeconds(); void Tick(); bool TickCueReceived(); @@ -112,6 +117,26 @@ class FCarlaServer: public carla::rpc::RpcServerInterface /** * @} */ + + /** + * @brief synchronization calls + * @{ + */ + carla::rpc::Response call_tick( + carla::rpc::synchronization_client_id_type const &client_id = carla::rpc::ALL_CLIENTS, + carla::rpc::synchronization_participant_id_type const &participant_id = carla::rpc::ALL_PARTICIPANTS) override; + carla::rpc::Response call_register_synchronization_participant( + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const &participant_id_hint = carla::rpc::ALL_PARTICIPANTS) override; + carla::rpc::Response call_deregister_synchronization_participant( + carla::rpc::synchronization_client_id_type const &client_id, carla::rpc::synchronization_participant_id_type const &participant_id) override; + carla::rpc::Response call_update_synchronization_window( + carla::rpc::synchronization_client_id_type const &client_id, carla::rpc::synchronization_participant_id_type const &participant_id, + carla::rpc::synchronization_target_game_time const &target_game_time = carla::rpc::NO_SYNC_TARGET_GAME_TIME) override; + carla::rpc::Response > > call_get_synchronization_window_status() override; + /** + * @} + */ private: class FPimpl; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/ServerSynchronization.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/ServerSynchronization.h new file mode 100644 index 00000000000..568902c384c --- /dev/null +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/ServerSynchronization.h @@ -0,0 +1,244 @@ +// Copyright (c) 2024 Computer Vision Center (CVC) at the Universitat Autonoma +// de Barcelona (UAB). +// +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include +#include "carla/rpc/ServerSynchronizationTypes.h" +#include "carla/rpc/Response.h" +#include "carla/Logging.h" +#include "Carla/Game/CarlaEngine.h" + +/// The interface to the CARLA server required from TCP and ROS2 client side. +/// The parts only required from TPC client side are handled by lambdas directly. +class ServerSynchronization { +public: + ServerSynchronization() = default; + virtual ~ServerSynchronization() = default; + + + /** @brief Register a synchronization participant + * + * After the first synchronization participant is registered, the server runs in synchronous mode. + */ + carla::rpc::Response RegisterSynchronizationParticipant( + carla::rpc::synchronization_client_id_type const &ClientId, + carla::rpc::synchronization_participant_id_type const &ParticipantIdHint = carla::rpc::ALL_PARTICIPANTS) { + + std::lock_guard SyncLock(SynchronizationMutex); + + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::RegisterSynchronizationParticipant[%s:%u] hint"), UTF8_TO_TCHAR(ClientId.c_str()), ParticipantIdHint); + auto MaxIdIter = ParticipantIdMaxMap.find(ClientId); + if ( MaxIdIter==ParticipantIdMaxMap.end()) { + auto InsertResult = ParticipantIdMaxMap.insert( {ClientId, carla::rpc::ALL_PARTICIPANTS}); + MaxIdIter = InsertResult.first; + } + auto ParticipantId = ParticipantIdHint; + if ( ParticipantId==carla::rpc::ALL_PARTICIPANTS ) { + ParticipantId = ++(MaxIdIter->second); + } + + auto InsertResultIter = SynchronizationWindowMap.insert( { ClientId, {ParticipantId, carla::rpc::NO_SYNC_TARGET_GAME_TIME}}); + if ( InsertResultIter == SynchronizationWindowMap.end() ) { + // collision + UE_LOG(LogCarla, Error, TEXT("ServerSynchronization::RegisterSynchronizationParticipant[%s:%u] failed unexpectedly because of id clash"), UTF8_TO_TCHAR(ClientId.c_str()), ParticipantId); + LogSynchronizationMap("Register failed"); + return carla::rpc::ResponseError("ServerSynchronization::RegisterSynchronizationParticipant failed unexpectedly because of id clash\n"); + } + if (ParticipantId > MaxIdIter->second) { + MaxIdIter->second = ParticipantId; + } + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::RegisterSynchronizationParticipant[%s:%u]"), UTF8_TO_TCHAR(ClientId.c_str()), ParticipantId); + LogSynchronizationMap("Register end"); + SyncStateChanged=true; + return ParticipantId; + } + + bool DeregisterSynchronizationParticipant(carla::rpc::synchronization_client_id_type const &ClientId, + carla::rpc::synchronization_participant_id_type const &ParticipantId) { + + std::lock_guard SyncLock(SynchronizationMutex); + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::DeregisterSynchronizationParticipant[%s:%u]"), UTF8_TO_TCHAR(ClientId.c_str()), ParticipantId); + LogSynchronizationMap("Deregister start"); + auto const SynchronizationParticipantEqualRange = SynchronizationWindowMap.equal_range(ClientId); + for (auto SynchronizationWindowIter=SynchronizationParticipantEqualRange.first; + SynchronizationWindowIter != SynchronizationParticipantEqualRange.second; + /* no iterator update here to support erase */) { + if (SynchronizationWindowIter->second.ParticipantId == ParticipantId ) { + SynchronizationWindowIter = SynchronizationWindowMap.erase(SynchronizationWindowIter); + } + else { + SynchronizationWindowIter++; + } + } + LogSynchronizationMap("Deregister end"); + SyncStateChanged=true; + return true; + } + + void DisconnectClient(carla::rpc::synchronization_client_id_type const &ClientId) { + + std::lock_guard SyncLock(SynchronizationMutex); + + LogSynchronizationMap("Disconnect client start"); + auto ErasedEntries = SynchronizationWindowMap.erase(ClientId); + if ( ErasedEntries > 0u ) { + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::DisconnectClient[%s:ALL]"), UTF8_TO_TCHAR(ClientId.c_str())); + } + else { + UE_LOG(LogCarla, Warning, TEXT("ServerSynchronization::DisconnectClient[%s:ALL] client id not found"), UTF8_TO_TCHAR(ClientId.c_str())); + LogSynchronizationMap("Disconnect client not found"); + } + SyncStateChanged=true; + LogSynchronizationMap("Disconnect client end"); + } + + void EnableSynchronousMode(carla::rpc::synchronization_client_id_type const &ClientId, + carla::rpc::synchronization_participant_id_type const &ParticipantId = carla::rpc::ALL_PARTICIPANTS) { + + std::lock_guard SyncLock(SynchronizationMutex); + + for(auto &SynchronizationWindow: SynchronizationWindowMap) { + if ( (ClientId == SynchronizationWindow.first) && + (( ParticipantId == carla::rpc::ALL_PARTICIPANTS ) || ( SynchronizationWindow.second.ParticipantId == ParticipantId )) && + (SynchronizationWindow.second.TargetGameTime <= carla::rpc::NO_SYNC_TARGET_GAME_TIME)) { + SynchronizationWindow.second.TargetGameTime = carla::rpc::BLOCKING_TARGET_GAME_TIME; + SyncStateChanged=true; + } + } + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::EnableSynchronousMode[%s:%d]"), UTF8_TO_TCHAR(ClientId.c_str()), ParticipantId); + } + + void DisableSynchronousMode(carla::rpc::synchronization_client_id_type const &ClientId, + carla::rpc::synchronization_participant_id_type const &ParticipantId = carla::rpc::ALL_PARTICIPANTS) { + + std::lock_guard SyncLock(SynchronizationMutex); + + for(auto &SynchronizationWindow: SynchronizationWindowMap) { + if ( (ClientId == SynchronizationWindow.first) && + (( ParticipantId == carla::rpc::ALL_PARTICIPANTS ) || ( SynchronizationWindow.second.ParticipantId == ParticipantId )) && + (SynchronizationWindow.second.TargetGameTime > carla::rpc::NO_SYNC_TARGET_GAME_TIME)) { + SynchronizationWindow.second.TargetGameTime = carla::rpc::NO_SYNC_TARGET_GAME_TIME; + SyncStateChanged=true; + } + } + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::DisableSynchronousMode[%s:%d]"), UTF8_TO_TCHAR(ClientId.c_str()), ParticipantId); + } + + bool IsSynchronousModeActive() const { + + std::lock_guard SyncLock(SynchronizationMutex); + + for(auto const &SynchronizationWindow: SynchronizationWindowMap) { + if ( SynchronizationWindow.second.TargetGameTime > carla::rpc::NO_SYNC_TARGET_GAME_TIME) { + return true; + } + } + return false; + } + + carla::rpc::synchronization_target_game_time GetTargetSynchronizationTime(double const CurrentGameTime, double const RequestedDltaTime) const { + + std::lock_guard SyncLock(SynchronizationMutex); + + static int LogOncePerFrameCouter = 0; + bool LogOutput = false; + if (LogOncePerFrameCouter < FCarlaEngine::GetFrameCounter()) { + LogOutput = true; + LogOncePerFrameCouter = FCarlaEngine::GetFrameCounter(); + } + + carla::rpc::synchronization_target_game_time TargetGameTime = CurrentGameTime+RequestedDltaTime; + for(auto const &SynchronizationWindow: SynchronizationWindowMap) { + if ( (SynchronizationWindow.second.TargetGameTime > carla::rpc::NO_SYNC_TARGET_GAME_TIME) && (SynchronizationWindow.second.TargetGameTime < TargetGameTime) ) { + if (LogOutput) { + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::GetTargetSynchronizationTime[%s:%u] = %f"), UTF8_TO_TCHAR(SynchronizationWindow.first.c_str()), SynchronizationWindow.second.ParticipantId, SynchronizationWindow.second.TargetGameTime); + } + TargetGameTime = SynchronizationWindow.second.TargetGameTime; + } + } + if (LogOutput) { + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::GetTargetSynchronizationTime[ALL:ALL] = %f"), TargetGameTime); + } + return TargetGameTime; + } + + carla::rpc::Response UpdateSynchronizationWindow( + carla::rpc::synchronization_client_id_type const &ClientId, + carla::rpc::synchronization_participant_id_type const &ParticipantId, + carla::rpc::synchronization_target_game_time const &TargetGameTime) { + + std::lock_guard SyncLock(SynchronizationMutex); + + if ( ClientId != carla::rpc::ALL_CLIENTS ) { + auto const SynchronizationParticipantEqualRange = SynchronizationWindowMap.equal_range(ClientId); + bool ParticipantFound = false; + for (auto SynchronizationWindowIter=SynchronizationParticipantEqualRange.first; + SynchronizationWindowIter != SynchronizationParticipantEqualRange.second; + SynchronizationWindowIter++) { + if (SynchronizationWindowIter->second.ParticipantId == ParticipantId ) { + ParticipantFound=true; + SynchronizationWindowIter->second.TargetGameTime = TargetGameTime; + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::UpdateSynchronizationWindow[%s:%u] = %f"), UTF8_TO_TCHAR(ClientId.c_str()), ParticipantId, TargetGameTime); + } + } + if ( !ParticipantFound ) { + UE_LOG(LogCarla, Error, TEXT("ServerSynchronization::UpdateSynchronizationWindow[%s:%u] = %f failed."), UTF8_TO_TCHAR(ClientId.c_str()), ParticipantId, TargetGameTime); + LogSynchronizationMap("Update failed"); + return carla::rpc::ResponseError("ServerSynchronization::UpdateSynchronizationWindow did not find requested SynchronizationParticipant\n"); + } + } + else { + for (auto &SynchronizationWindow: SynchronizationWindowMap) { + if (SynchronizationWindow.second.TargetGameTime > carla::rpc::NO_SYNC_TARGET_GAME_TIME) { + SynchronizationWindow.second.TargetGameTime = TargetGameTime; + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::UpdateSynchronizationWindow[%s:%u] = %f FORCE"), UTF8_TO_TCHAR(SynchronizationWindow.first.c_str()), SynchronizationWindow.second.ParticipantId, TargetGameTime); + } + } + } + SyncStateChanged=true; + return true; + } + + void LogSynchronizationMap(std::string const &Reason) { + for (auto &SynchronizationWindow: SynchronizationWindowMap) { + UE_LOG(LogCarla, Verbose, TEXT("ServerSynchronization::LogSynchronizationMap[%s:%u] = %f (%s)"), UTF8_TO_TCHAR(SynchronizationWindow.first.c_str()), SynchronizationWindow.second.ParticipantId, SynchronizationWindow.second.TargetGameTime, *FString(Reason.c_str())); + } + } + + /** + * @brief Get the synchronization window participant states and a flag if they have changed since last call. + */ + std::pair > GetSynchronizationWindowParticipantStates() { + std::vector SynchronizationWindowParticipantStates; + SynchronizationWindowParticipantStates.reserve(SynchronizationWindowMap.size()); + for (auto &SynchronizationWindow: SynchronizationWindowMap) { + carla::rpc::synchronization_window_participant_state ParticipantState { + SynchronizationWindow.first, + SynchronizationWindow.second.ParticipantId, + SynchronizationWindow.second.TargetGameTime + }; + SynchronizationWindowParticipantStates.push_back(ParticipantState); + } + auto ResultChanged = SyncStateChanged; + SyncStateChanged = false; + return std::make_pair(ResultChanged, SynchronizationWindowParticipantStates); + } + +private: + mutable std::mutex SynchronizationMutex{}; + + struct SynchonizationWindow{ + carla::rpc::synchronization_participant_id_type ParticipantId; + carla::rpc::synchronization_target_game_time TargetGameTime{carla::rpc::NO_SYNC_TARGET_GAME_TIME}; + }; + + std::map ParticipantIdMaxMap; + std::multimap SynchronizationWindowMap; + bool SyncStateChanged {false}; + +}; diff --git a/Util/BuildTools/Setup.sh b/Util/BuildTools/Setup.sh index 9f93676bda4..cc4786b6ae2 100755 --- a/Util/BuildTools/Setup.sh +++ b/Util/BuildTools/Setup.sh @@ -217,7 +217,7 @@ unset BOOST_BASENAME # -- Get rpclib and compile it with libc++ and libstdc++ ----------------------- # ============================================================================== -RPCLIB_PATCH=v2.2.1_c5 +RPCLIB_PATCH=carla-callbacks RPCLIB_BASENAME=rpclib-${RPCLIB_PATCH}-${CXX_TAG} RPCLIB_LIBCXX_INCLUDE=${PWD}/${RPCLIB_BASENAME}-libcxx-install/include From 3f80b69c5f127d6081bd31eb9a799334aa41d759 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Sun, 30 Nov 2025 00:18:41 +0100 Subject: [PATCH 02/39] Fix Windows build and smoke tests Update RPC lib version for windows build Ensure tick calls are ignored if sync mode is not active. And prevent client changes of fixed_delta_seconds triggering warning message. --- CHANGELOG.md | 1 + LibCarla/source/carla/client/World.cpp | 5 ++- .../source/carla/rpc/RpcServerInterface.h | 5 +-- .../carla/rpc/ServerSynchronizationTypes.h | 5 ++- PythonAPI/test/smoke/__init__.py | 4 ++- .../Carla/Source/Carla/Server/CarlaServer.cpp | 34 +++++++++++++------ .../Carla/Source/Carla/Server/CarlaServer.h | 5 +-- Util/InstallersWin/install_rpclib.bat | 2 +- 8 files changed, 42 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68f74d2fced..17b59846374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Introduced geom::AngularVelocity, geom::Velocity, geom::Acceleration, geom::Quaternion types * Fixed geom::Rotation::RotateVector() rotation directions of pitch and roll * Prepare server for multistream support and ROS2 client calls + * Improved V2X sensor capabilities: send complex custom user-defined data, support V2I sensors not attached to a vehicle * Introduced fine grained ServerSynchronization mechanism: each client decides for its own if it requires synchronization or not and provides its own synchronization window. Be aware: some existing code using master/slave sync mechanism might need rework. See also generate_traffic.py. diff --git a/LibCarla/source/carla/client/World.cpp b/LibCarla/source/carla/client/World.cpp index 5b2f8d69917..8c21d573743 100644 --- a/LibCarla/source/carla/client/World.cpp +++ b/LibCarla/source/carla/client/World.cpp @@ -75,7 +75,10 @@ namespace client { if (tics_correct >= 2) return id; - Tick(local_timeout); + if (settings.synchronous_mode) { + // tick if synchronous mode is active + Tick(local_timeout); + } } log_warning("World::ApplySettings: After", number_of_attemps, " attemps, the settings were not correctly set. Please check that everything is consistent."); diff --git a/LibCarla/source/carla/rpc/RpcServerInterface.h b/LibCarla/source/carla/rpc/RpcServerInterface.h index 120dd3949b8..e4be9944755 100644 --- a/LibCarla/source/carla/rpc/RpcServerInterface.h +++ b/LibCarla/source/carla/rpc/RpcServerInterface.h @@ -87,8 +87,9 @@ class RpcServerInterface { * @{ */ virtual Response call_tick( - synchronization_client_id_type const &client_id = ALL_CLIENTS, - synchronization_participant_id_type const &participant_id = ALL_PARTICIPANTS) = 0; + synchronization_client_id_type const &client_id, + synchronization_participant_id_type const &participant_id, + carla::rpc::SynchronizationTickMode synchronization_tick_mode) = 0; virtual Response call_register_synchronization_participant( synchronization_client_id_type const &client_id, synchronization_participant_id_type const &participant_id_hint = ALL_PARTICIPANTS) = 0; diff --git a/LibCarla/source/carla/rpc/ServerSynchronizationTypes.h b/LibCarla/source/carla/rpc/ServerSynchronizationTypes.h index e010dfcb8be..2461d8955a1 100644 --- a/LibCarla/source/carla/rpc/ServerSynchronizationTypes.h +++ b/LibCarla/source/carla/rpc/ServerSynchronizationTypes.h @@ -27,7 +27,10 @@ struct synchronization_window_participant_state { synchronization_target_game_time target_game_time; }; - +enum class SynchronizationTickMode { + FORCE_ENABLE_SYNC, + TICK_ONLY_IF_SYNC_ENABLED +}; } // namespace rpc } // namespace carla diff --git a/PythonAPI/test/smoke/__init__.py b/PythonAPI/test/smoke/__init__.py index 33e43e9d172..126388b982d 100644 --- a/PythonAPI/test/smoke/__init__.py +++ b/PythonAPI/test/smoke/__init__.py @@ -48,6 +48,8 @@ def setUp(self): def tearDown(self): self.world.apply_settings(self.settings) - self.world.tick() + if self.settings.synchronous_mode: + # tick if synchronous mode is active + self.world.tick() self.settings = None super(SyncSmokeTest, self).tearDown() diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp index 3d4b4f0313b..a9bde486a10 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp @@ -239,7 +239,8 @@ class FCarlaServer::FPimpl: public carla::rpc::RpcServerInterface */ carla::rpc::Response call_tick( carla::rpc::synchronization_client_id_type const &client_id, - carla::rpc::synchronization_participant_id_type const &participant_id) override; + carla::rpc::synchronization_participant_id_type const &participant_id, + carla::rpc::SynchronizationTickMode synchronization_tick_mode) override; carla::rpc::Response call_register_synchronization_participant( carla::rpc::synchronization_client_id_type const &client_id, carla::rpc::synchronization_participant_id_type const &participant_id_hint = carla::rpc::ALL_PARTICIPANTS) override; @@ -424,6 +425,7 @@ void FCarlaServer::FPimpl::BindActions() BIND_SYNC(tick_cue) << [this]() -> R { + REQUIRE_CARLA_EPISODE(); TRACE_CPUPROFILER_EVENT_SCOPE(TickCueReceived); UE_LOG( LogCarlaServer, @@ -432,7 +434,7 @@ void FCarlaServer::FPimpl::BindActions() UTF8_TO_TCHAR(SynchronizationClientId().c_str()), TickParticipantId(), ::rpc::this_session().id()); - return call_tick(SynchronizationClientId(), TickParticipantId()); + return call_tick(SynchronizationClientId(), TickParticipantId(), carla::rpc::SynchronizationTickMode::TICK_ONLY_IF_SYNC_ENABLED); }; // ~~ Load new episode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -3667,12 +3669,20 @@ void FCarlaServer::FPimpl::NotifyEndEpisode() carla::rpc::Response FCarlaServer::FPimpl::call_tick( carla::rpc::synchronization_client_id_type const &client_id, - carla::rpc::synchronization_participant_id_type const&participant_id) + carla::rpc::synchronization_participant_id_type const&participant_id, + carla::rpc::SynchronizationTickMode synchronization_tick_mode) { - REQUIRE_CARLA_EPISODE(); auto Current = FCarlaEngine::GetFrameCounter(); - auto const TargetGameTime = Episode->GetElapsedGameTime() + GetTickDeltaSeconds(); - (void) call_update_synchronization_window(client_id, participant_id, TargetGameTime); + + if ( (synchronization_tick_mode == carla::rpc::SynchronizationTickMode::FORCE_ENABLE_SYNC) + || ServerSync.IsSynchronousModeActive() ) { + auto const TargetGameTime = Episode->GetElapsedGameTime() + GetTickDeltaSeconds(); + ServerSync.UpdateSynchronizationWindow(client_id, participant_id, TargetGameTime); + } + else { + UE_LOG(LogCarla, Warning, TEXT("CarlaServer::call_tick[%s:%d] received, but synchronous mode not running. Tick is ignored."), + UTF8_TO_TCHAR(client_id.c_str()), participant_id); + } return Current + 1; } @@ -3879,9 +3889,11 @@ double FCarlaServer::GetTickDeltaSeconds() { void FCarlaServer::Tick() { - (void)Pimpl->call_tick(Pimpl->SynchronizationClientId(), Pimpl->ServerSynchronizationParticipantId); + (void)Pimpl->call_tick(Pimpl->SynchronizationClientId(), + Pimpl->ServerSynchronizationParticipantId, + carla::rpc::SynchronizationTickMode::TICK_ONLY_IF_SYNC_ENABLED); } - + bool FCarlaServer::TickCueReceived() { return Pimpl->IsNextGameTickAllowed(); @@ -3987,12 +3999,12 @@ carla::rpc::Response FCarlaServer::call_get_te return Pimpl->call_get_telemetry_data(ActorId); } - carla::rpc::Response FCarlaServer::call_tick( carla::rpc::synchronization_client_id_type const &client_id, - carla::rpc::synchronization_participant_id_type const&synchronization_participant) + carla::rpc::synchronization_participant_id_type const&synchronization_participant, + carla::rpc::SynchronizationTickMode synchronization_tick_mode) { - return Pimpl->call_tick(client_id, synchronization_participant); + return Pimpl->call_tick(client_id, synchronization_participant, synchronization_tick_mode); } carla::rpc::Response FCarlaServer::call_register_synchronization_participant( diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h index 4588aa84b02..9e9d0328443 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h @@ -123,8 +123,9 @@ class FCarlaServer: public carla::rpc::RpcServerInterface * @{ */ carla::rpc::Response call_tick( - carla::rpc::synchronization_client_id_type const &client_id = carla::rpc::ALL_CLIENTS, - carla::rpc::synchronization_participant_id_type const &participant_id = carla::rpc::ALL_PARTICIPANTS) override; + carla::rpc::synchronization_client_id_type const &client_id, + carla::rpc::synchronization_participant_id_type const &participant_id, + carla::rpc::SynchronizationTickMode synchronization_tick_mode) override; carla::rpc::Response call_register_synchronization_participant( carla::rpc::synchronization_client_id_type const &client_id, carla::rpc::synchronization_participant_id_type const &participant_id_hint = carla::rpc::ALL_PARTICIPANTS) override; diff --git a/Util/InstallersWin/install_rpclib.bat b/Util/InstallersWin/install_rpclib.bat index 93eca230491..a863c28b52f 100644 --- a/Util/InstallersWin/install_rpclib.bat +++ b/Util/InstallersWin/install_rpclib.bat @@ -40,7 +40,7 @@ rem If not set set the build dir to the current dir if "%BUILD_DIR%" == "" set BUILD_DIR=%~dp0 if not "%BUILD_DIR:~-1%"=="\" set BUILD_DIR=%BUILD_DIR%\ -set RPC_VERSION=v2.2.1_c5 +set RPC_VERSION=carla-callbacks set RPC_SRC=rpclib-src set RPC_SRC_DIR=%BUILD_DIR%%RPC_SRC%\ set RPC_INSTALL=rpclib-install From 8606f3c37304c8124d0f7b387d42254f2c8f8c25 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Mon, 1 Dec 2025 09:56:23 +0100 Subject: [PATCH 03/39] Client needs to wait for next tick on non synchronous mode --- LibCarla/source/carla/client/World.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LibCarla/source/carla/client/World.cpp b/LibCarla/source/carla/client/World.cpp index 8c21d573743..a66a1b53f14 100644 --- a/LibCarla/source/carla/client/World.cpp +++ b/LibCarla/source/carla/client/World.cpp @@ -79,6 +79,10 @@ namespace client { // tick if synchronous mode is active Tick(local_timeout); } + else { + WaitForTick(local_timeout); + } + } log_warning("World::ApplySettings: After", number_of_attemps, " attemps, the settings were not correctly set. Please check that everything is consistent."); From 3de7c09c517be1e8c5b081171365aea1c6fb9000 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Fri, 21 Nov 2025 15:09:04 +0100 Subject: [PATCH 04/39] Extend ROS2 support Step 3: Rework ROS2 handling This commit is extending the built-in ROS2 support of CARLA: - the internal interface is simplified and object oriented to allow easier ROS2 extensions in future and reduce code duplication - the sensor/actor stream existing for the TCP counterparts are used in a shared manner, which results in lower processing overhead and requires little individual code changes for ROS2 within UE-sensors - enable Boost and Asio exceptions for FastDDS to ensure properly - additional service interfaces are provided to control CARLA directly from ROS2 (Map, Blueprint and Episode handling, Spawn/DestroyObject) - convenient interfaces previously available via carla_ros_bridge are provided (e.g. pseudo sensors, object messages, traffic light/sign, actor/sensor lists) - new interfaces like e.g. CarlaVehicleTelemetryData, V2X, SynchronizationWindow,... - get detailed vehicle meshes as exact ground truth for e.g. LiDAR perception - Vehicle publisher implements a variety of individual publishers to mimick also old ROS-bridge convenient publisher: + CarlaVehicleInfo + CarlaVehicleControlStatus + Speed + Odometry + Object + ObjectWithCovariance + VehicleTelemetryData - Vehicle subscribers: + VehicleControlSubscriber + AckermannControlSubscriber, + SetTransformSubscriber - use of c++17 to support std::sample() usage - Dynamic switching on ROS visibility is possible for all actors now - Default startup behavior is selectable by ROS2TopicVisibility parameter in DefaultGame.ini: If true, then all and every topic that is currently offered by the implementation is visible from the beginning. If false, then only the sensors/actors created via the Client- or ROS-Interface are visible by defaults. Others can be activated via EnableForRos() calls (this allows for disabling interfaces e.g. for leaderboard) - ensure multiple service calls at once are working: + qos history kind eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS + qos reliablility kind eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS + qos durability kind eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS for reader, writer, topic - add set_transform() call to RGB Cameras - add odometry publisher to walkers - filter out invalid bounding boxes observed on a few traffic signs using bounding box transmission within object data --- CHANGELOG.md | 3 +- LibCarla/cmake/fast_dds/CMakeLists.txt | 117 +- LibCarla/cmake/server/CMakeLists.txt | 3 +- LibCarla/source/carla/Buffer.cpp | 1 + LibCarla/source/carla/Buffer.h | 2 +- LibCarla/source/carla/ros2/ROS2.cpp | 779 +++-- LibCarla/source/carla/ros2/ROS2.h | 273 +- LibCarla/source/carla/ros2/ROS2CallbackData.h | 52 - LibCarla/source/carla/ros2/ROS2NameRecord.cpp | 47 + LibCarla/source/carla/ros2/ROS2NameRecord.h | 41 + .../source/carla/ros2/ROS2NameRegistry.cpp | 320 ++ LibCarla/source/carla/ros2/ROS2NameRegistry.h | 121 + LibCarla/source/carla/ros2/ROS2QoS.h | 74 + LibCarla/source/carla/ros2/ROS2Session.cpp | 34 + LibCarla/source/carla/ros2/ROS2Session.h | 36 + LibCarla/source/carla/ros2/fastdds/README.md | 20 + .../ackermann_msgs/msg/AckermannDrive.cxx} | 50 +- .../ackermann_msgs/msg/AckermannDrive.h | 264 ++ .../msg/AckermannDrivePubSubTypes.cxx} | 32 +- .../msg/AckermannDrivePubSubTypes.h | 91 + .../msg/AckermannDriveStamped.cxx} | 37 +- .../msg/AckermannDriveStamped.h | 221 ++ .../msg/AckermannDriveStampedPubSubTypes.cxx} | 32 +- .../msg/AckermannDriveStampedPubSubTypes.h | 92 + .../builtin_interfaces/msg/Time.cxx} | 49 +- .../fastdds/builtin_interfaces/msg/Time.h | 207 ++ .../msg/TimePubSubTypes.cxx} | 27 +- .../builtin_interfaces/msg/TimePubSubTypes.h | 91 + .../ros2/impl/DdsDomainParticipantImpl.cpp | 52 + .../ros2/impl/DdsDomainParticipantImpl.h | 30 + .../carla/ros2/impl/DdsPublisherImpl.h | 186 + .../ros2/fastdds/carla/ros2/impl/DdsQoS.h | 68 + .../fastdds/carla/ros2/impl/DdsReturnCode.h | 48 + .../fastdds/carla/ros2/impl/DdsServiceImpl.h | 215 ++ .../carla/ros2/impl/DdsSubscriberImpl.h | 170 + .../carla_msgs/msg/CarlaActorBlueprint.cxx | 312 ++ .../carla_msgs/msg/CarlaActorBlueprint.h | 269 ++ .../msg/CarlaActorBlueprintPubSubTypes.cxx | 176 + .../msg/CarlaActorBlueprintPubSubTypes.h | 107 + .../fastdds/carla_msgs/msg/CarlaActorInfo.cxx | 528 +++ .../fastdds/carla_msgs/msg/CarlaActorInfo.h | 386 +++ .../msg/CarlaActorInfoPubSubTypes.cxx | 176 + .../msg/CarlaActorInfoPubSubTypes.h | 107 + .../fastdds/carla_msgs/msg/CarlaActorList.cxx | 198 ++ .../fastdds/carla_msgs/msg/CarlaActorList.h | 217 ++ .../msg/CarlaActorListPubSubTypes.cxx | 176 + .../msg/CarlaActorListPubSubTypes.h | 107 + .../carla_msgs/msg/CarlaBoundingBox.cxx | 238 ++ .../fastdds/carla_msgs/msg/CarlaBoundingBox.h | 243 ++ .../msg/CarlaBoundingBoxPubSubTypes.cxx | 176 + .../msg/CarlaBoundingBoxPubSubTypes.h | 107 + .../carla_msgs/msg/CarlaCollisionEvent.cxx} | 60 +- .../carla_msgs/msg}/CarlaCollisionEvent.h | 26 +- .../msg/CarlaCollisionEventPubSubTypes.cxx} | 26 +- .../msg}/CarlaCollisionEventPubSubTypes.h | 8 +- .../fastdds/carla_msgs/msg/CarlaControl.cxx | 187 + .../carla_msgs/msg/CarlaControl.h} | 119 +- .../msg/CarlaControlPubSubTypes.cxx | 182 + .../carla_msgs/msg/CarlaControlPubSubTypes.h | 113 + .../msg/CarlaEgoVehicleControl.cxx} | 145 +- .../carla_msgs/msg}/CarlaEgoVehicleControl.h | 67 +- .../CarlaEgoVehicleControlPubSubTypes.cxx} | 28 +- .../msg}/CarlaEgoVehicleControlPubSubTypes.h | 18 +- .../carla_msgs/msg/CarlaEgoVehicleInfo.cxx | 871 +++++ .../carla_msgs/msg/CarlaEgoVehicleInfo.h | 542 +++ .../msg/CarlaEgoVehicleInfoPubSubTypes.cxx | 176 + .../msg/CarlaEgoVehicleInfoPubSubTypes.h | 107 + .../msg/CarlaEgoVehicleInfoWheel.cxx | 448 +++ .../carla_msgs/msg/CarlaEgoVehicleInfoWheel.h | 337 ++ .../CarlaEgoVehicleInfoWheelPubSubTypes.cxx | 176 + .../msg/CarlaEgoVehicleInfoWheelPubSubTypes.h | 107 + .../carla_msgs/msg/CarlaEgoVehicleStatus.cxx | 471 +++ .../carla_msgs/msg/CarlaEgoVehicleStatus.h | 368 ++ .../msg/CarlaEgoVehicleStatusPubSubTypes.cxx | 181 + .../msg/CarlaEgoVehicleStatusPubSubTypes.h} | 35 +- .../msg/CarlaEgoVehicleTelemetryData.cxx | 551 +++ .../msg/CarlaEgoVehicleTelemetryData.h} | 280 +- ...arlaEgoVehicleTelemetryDataPubSubTypes.cxx | 176 + .../CarlaEgoVehicleTelemetryDataPubSubTypes.h | 107 + .../msg/CarlaEgoVehicleTelemetryDataWheel.cxx | 615 ++++ .../msg/CarlaEgoVehicleTelemetryDataWheel.h | 410 +++ ...goVehicleTelemetryDataWheelPubSubTypes.cxx | 176 + ...aEgoVehicleTelemetryDataWheelPubSubTypes.h | 107 + .../carla_msgs/msg/CarlaEpisodeSettings.cxx | 615 ++++ .../carla_msgs/msg/CarlaEpisodeSettings.h | 410 +++ .../msg/CarlaEpisodeSettingsPubSubTypes.cxx | 176 + .../msg/CarlaEpisodeSettingsPubSubTypes.h | 107 + .../carla_msgs/msg/CarlaLaneInvasion.cxx} | 4 +- .../carla_msgs/msg/CarlaLaneInvasion.h | 225 ++ .../carla_msgs/msg/CarlaLaneInvasionEvent.cxx | 255 ++ .../carla_msgs/msg/CarlaLaneInvasionEvent.h} | 92 +- .../msg/CarlaLaneInvasionEventPubSubTypes.cxx | 182 + .../msg/CarlaLaneInvasionEventPubSubTypes.h | 113 + .../msg/CarlaLaneInvasionPubSubTypes.cxx} | 4 +- .../msg/CarlaLaneInvasionPubSubTypes.h | 92 + .../fastdds/carla_msgs/msg/CarlaStatus.cxx | 384 +++ .../carla_msgs/msg/CarlaStatus.h} | 230 +- .../msg/CarlaStatusPubSubTypes.cxx} | 74 +- .../carla_msgs/msg/CarlaStatusPubSubTypes.h} | 28 +- .../msg/CarlaSynchronizationWindow.cxx | 183 + .../msg/CarlaSynchronizationWindow.h | 210 ++ ...aSynchronizationWindowParticipantState.cxx | 278 ++ ...rlaSynchronizationWindowParticipantState.h | 256 ++ ...ationWindowParticipantStatePubSubTypes.cxx | 176 + ...izationWindowParticipantStatePubSubTypes.h | 107 + .../CarlaSynchronizationWindowPubSubTypes.cxx | 176 + .../CarlaSynchronizationWindowPubSubTypes.h | 107 + .../carla_msgs/msg/CarlaTrafficLightInfo.cxx | 281 ++ .../carla_msgs/msg/CarlaTrafficLightInfo.h} | 187 +- .../msg/CarlaTrafficLightInfoList.cxx | 198 ++ .../msg/CarlaTrafficLightInfoList.h | 217 ++ .../CarlaTrafficLightInfoListPubSubTypes.cxx | 176 + .../CarlaTrafficLightInfoListPubSubTypes.h | 107 + .../msg/CarlaTrafficLightInfoPubSubTypes.cxx | 176 + .../msg/CarlaTrafficLightInfoPubSubTypes.h | 107 + .../msg/CarlaTrafficLightStatus.cxx | 282 ++ .../carla_msgs/msg/CarlaTrafficLightStatus.h} | 176 +- .../msg/CarlaTrafficLightStatusList.cxx | 198 ++ .../msg/CarlaTrafficLightStatusList.h | 217 ++ ...CarlaTrafficLightStatusListPubSubTypes.cxx | 176 + .../CarlaTrafficLightStatusListPubSubTypes.h | 107 + .../CarlaTrafficLightStatusPubSubTypes.cxx | 184 + .../msg/CarlaTrafficLightStatusPubSubTypes.h | 115 + .../carla_msgs/msg/CarlaV2XByteArray.cxx | 242 ++ .../carla_msgs/msg/CarlaV2XByteArray.h} | 143 +- .../msg/CarlaV2XByteArrayPubSubTypes.cxx | 177 + .../msg/CarlaV2XByteArrayPubSubTypes.h | 108 + .../fastdds/carla_msgs/msg/CarlaV2XCustom.cxx | 240 ++ .../fastdds/carla_msgs/msg/CarlaV2XCustom.h | 243 ++ .../carla_msgs/msg/CarlaV2XCustomData.cxx | 233 ++ .../carla_msgs/msg/CarlaV2XCustomData.h | 237 ++ .../carla_msgs/msg/CarlaV2XCustomDataList.cxx | 198 ++ .../carla_msgs/msg/CarlaV2XCustomDataList.h | 217 ++ .../msg/CarlaV2XCustomDataListPubSubTypes.cxx | 176 + .../msg/CarlaV2XCustomDataListPubSubTypes.h | 107 + .../msg/CarlaV2XCustomDataPubSubTypes.cxx | 176 + .../msg/CarlaV2XCustomDataPubSubTypes.h | 107 + .../carla_msgs/msg/CarlaV2XCustomMessage.cxx | 238 ++ .../carla_msgs/msg/CarlaV2XCustomMessage.h | 244 ++ .../msg/CarlaV2XCustomMessagePubSubTypes.cxx | 176 + .../msg/CarlaV2XCustomMessagePubSubTypes.h | 107 + .../msg/CarlaV2XCustomPubSubTypes.cxx | 176 + .../msg/CarlaV2XCustomPubSubTypes.h | 107 + .../fastdds/carla_msgs/msg/CarlaV2XData.cxx | 233 ++ .../carla_msgs/msg/CarlaV2XData.h} | 144 +- .../carla_msgs/msg/CarlaV2XDataList.cxx | 198 ++ .../carla_msgs/msg/CarlaV2XDataList.h} | 95 +- .../msg/CarlaV2XDataListPubSubTypes.cxx | 176 + .../msg/CarlaV2XDataListPubSubTypes.h} | 32 +- .../msg/CarlaV2XDataPubSubTypes.cxx | 176 + .../carla_msgs/msg/CarlaV2XDataPubSubTypes.h} | 27 +- .../carla_msgs/msg/CarlaWalkerControl.cxx | 324 ++ .../carla_msgs/msg/CarlaWalkerControl.h} | 164 +- .../msg/CarlaWalkerControlPubSubTypes.cxx | 176 + .../msg/CarlaWalkerControlPubSubTypes.h} | 32 +- .../carla_msgs/msg/CarlaWeatherParameters.cxx | 529 +++ .../carla_msgs/msg/CarlaWeatherParameters.h | 370 ++ .../msg/CarlaWeatherParametersPubSubTypes.cxx | 176 + .../msg/CarlaWeatherParametersPubSubTypes.h | 107 + .../fastdds/carla_msgs/msg/CarlaWorldInfo.cxx | 242 ++ .../fastdds/carla_msgs/msg/CarlaWorldInfo.h | 242 ++ .../msg/CarlaWorldInfoPubSubTypes.cxx | 176 + .../msg/CarlaWorldInfoPubSubTypes.h | 107 + .../fastdds/carla_msgs/srv/DestroyObject.cxx | 329 ++ .../fastdds/carla_msgs/srv/DestroyObject.h | 351 ++ .../srv/DestroyObjectPubSubTypes.cxx | 316 ++ .../carla_msgs/srv/DestroyObjectPubSubTypes.h | 171 + .../carla_msgs/srv/GetAvailableMaps.cxx | 344 ++ .../fastdds/carla_msgs/srv/GetAvailableMaps.h | 357 ++ .../srv/GetAvailableMapsPubSubTypes.cxx | 316 ++ .../srv/GetAvailableMapsPubSubTypes.h | 171 + .../fastdds/carla_msgs/srv/GetBlueprints.cxx | 351 ++ .../fastdds/carla_msgs/srv/GetBlueprints.h | 364 ++ .../srv/GetBlueprintsPubSubTypes.cxx | 316 ++ .../carla_msgs/srv/GetBlueprintsPubSubTypes.h | 171 + .../ros2/fastdds/carla_msgs/srv/LoadMap.cxx | 479 +++ .../ros2/fastdds/carla_msgs/srv/LoadMap.h | 430 +++ .../carla_msgs/srv/LoadMapPubSubTypes.cxx | 330 ++ .../carla_msgs/srv/LoadMapPubSubTypes.h | 185 + .../carla_msgs/srv/SetEpisodeSettings.cxx | 336 ++ .../carla_msgs/srv/SetEpisodeSettings.h | 358 ++ .../srv/SetEpisodeSettingsPubSubTypes.cxx | 316 ++ .../srv/SetEpisodeSettingsPubSubTypes.h | 171 + .../fastdds/carla_msgs/srv/SpawnObject.cxx | 522 +++ .../ros2/fastdds/carla_msgs/srv/SpawnObject.h | 451 +++ .../carla_msgs/srv/SpawnObjectPubSubTypes.cxx | 316 ++ .../carla_msgs/srv/SpawnObjectPubSubTypes.h | 171 + .../derived_object_msgs/msg/Object.cxx | 703 ++++ .../fastdds/derived_object_msgs/msg/Object.h | 450 +++ .../derived_object_msgs/msg/ObjectArray.cxx | 250 ++ .../derived_object_msgs/msg/ObjectArray.h | 220 ++ .../msg/ObjectArrayPubSubTypes.cxx | 176 + .../msg/ObjectArrayPubSubTypes.h | 91 + .../msg/ObjectPubSubTypes.cxx | 193 ++ .../msg/ObjectPubSubTypes.h | 92 + .../msg/ObjectWithCovariance.cxx | 703 ++++ .../msg/ObjectWithCovariance.h | 488 +++ .../msg/ObjectWithCovarianceArray.cxx | 250 ++ .../msg/ObjectWithCovarianceArray.h} | 115 +- .../ObjectWithCovarianceArrayPubSubTypes.cxx | 176 + .../ObjectWithCovarianceArrayPubSubTypes.h | 107 + .../msg/ObjectWithCovariancePubSubTypes.cxx | 193 ++ .../msg/ObjectWithCovariancePubSubTypes.h | 124 + .../msg/SolidPrimitiveWithCovariance.cxx | 320 ++ .../msg/SolidPrimitiveWithCovariance.h | 276 ++ ...olidPrimitiveWithCovariancePubSubTypes.cxx | 191 + .../SolidPrimitiveWithCovariancePubSubTypes.h | 122 + .../fastdds/diagnostic_msgs/msg/KeyValue.cxx | 242 ++ .../fastdds/diagnostic_msgs/msg/KeyValue.h | 218 ++ .../msg/KeyValuePubSubTypes.cxx | 176 + .../diagnostic_msgs/msg/KeyValuePubSubTypes.h | 91 + .../msg/AccelerationConfidence.cxx | 189 + .../msg/AccelerationConfidence.h | 217 ++ .../msg/AccelerationConfidencePubSubTypes.cxx | 184 + .../msg/AccelerationConfidencePubSubTypes.h | 115 + .../msg/AccelerationControl.cxx | 255 ++ .../msg/AccelerationControl.h | 246 ++ .../msg/AccelerationControlPubSubTypes.cxx | 187 + .../msg/AccelerationControlPubSubTypes.h | 118 + .../etsi_its_cam_msgs/msg/Altitude.cxx | 238 ++ .../fastdds/etsi_its_cam_msgs/msg/Altitude.h | 244 ++ .../msg/AltitudeConfidence.cxx | 200 ++ .../msg/AltitudeConfidence.h | 228 ++ .../msg/AltitudeConfidencePubSubTypes.cxx | 195 ++ .../msg/AltitudeConfidencePubSubTypes.h | 126 + .../msg/AltitudePubSubTypes.cxx | 176 + .../msg/AltitudePubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/AltitudeValue.cxx | 189 + .../etsi_its_cam_msgs/msg/AltitudeValue.h | 217 ++ .../msg/AltitudeValuePubSubTypes.cxx | 184 + .../msg/AltitudeValuePubSubTypes.h | 115 + .../etsi_its_cam_msgs/msg/BasicContainer.cxx | 238 ++ .../etsi_its_cam_msgs/msg/BasicContainer.h | 244 ++ .../msg/BasicContainerPubSubTypes.cxx | 176 + .../msg/BasicContainerPubSubTypes.h | 107 + .../BasicVehicleContainerHighFrequency.cxx | 1211 +++++++ .../msg/BasicVehicleContainerHighFrequency.h | 762 ++++ ...hicleContainerHighFrequencyPubSubTypes.cxx | 176 + ...VehicleContainerHighFrequencyPubSubTypes.h | 107 + .../msg/BasicVehicleContainerLowFrequency.cxx | 286 ++ .../msg/BasicVehicleContainerLowFrequency.h | 271 ++ ...ehicleContainerLowFrequencyPubSubTypes.cxx | 176 + ...cVehicleContainerLowFrequencyPubSubTypes.h | 107 + .../fastdds/etsi_its_cam_msgs/msg/CAM.cxx | 238 ++ .../ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h | 244 ++ .../etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx} | 78 +- .../etsi_its_cam_msgs/msg/CAMPubSubTypes.h} | 28 +- .../etsi_its_cam_msgs/msg/CamParameters.cxx | 420 +++ .../etsi_its_cam_msgs/msg/CamParameters.h | 338 ++ .../msg/CamParametersPubSubTypes.cxx | 176 + .../msg/CamParametersPubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/CauseCode.cxx | 238 ++ .../fastdds/etsi_its_cam_msgs/msg/CauseCode.h | 244 ++ .../msg/CauseCodePubSubTypes.cxx | 176 + .../msg/CauseCodePubSubTypes.h} | 39 +- .../etsi_its_cam_msgs/msg/CauseCodeType.cxx | 213 ++ .../etsi_its_cam_msgs/msg/CauseCodeType.h | 241 ++ .../msg/CauseCodeTypePubSubTypes.cxx | 208 ++ .../msg/CauseCodeTypePubSubTypes.h | 139 + .../msg/CenDsrcTollingZone.cxx | 329 ++ .../msg/CenDsrcTollingZone.h | 291 ++ .../msg/CenDsrcTollingZoneID.cxx | 190 + .../msg/CenDsrcTollingZoneID.h | 217 ++ .../msg/CenDsrcTollingZoneIDPubSubTypes.cxx | 176 + .../msg/CenDsrcTollingZoneIDPubSubTypes.h | 107 + .../msg/CenDsrcTollingZonePubSubTypes.cxx | 176 + .../msg/CenDsrcTollingZonePubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/ClosedLanes.cxx | 415 +++ .../etsi_its_cam_msgs/msg/ClosedLanes.h | 330 ++ .../msg/ClosedLanesPubSubTypes.cxx | 176 + .../msg/ClosedLanesPubSubTypes.h} | 32 +- .../etsi_its_cam_msgs/msg/CoopAwareness.cxx | 238 ++ .../etsi_its_cam_msgs/msg/CoopAwareness.h | 244 ++ .../msg/CoopAwarenessPubSubTypes.cxx | 176 + .../msg/CoopAwarenessPubSubTypes.h} | 29 +- .../etsi_its_cam_msgs/msg/Curvature.cxx | 238 ++ .../fastdds/etsi_its_cam_msgs/msg/Curvature.h | 244 ++ .../msg/CurvatureCalculationMode.cxx | 187 + .../msg/CurvatureCalculationMode.h | 215 ++ .../CurvatureCalculationModePubSubTypes.cxx | 182 + .../msg/CurvatureCalculationModePubSubTypes.h | 113 + .../msg/CurvatureConfidence.cxx | 192 ++ .../msg/CurvatureConfidence.h | 220 ++ .../msg/CurvatureConfidencePubSubTypes.cxx | 187 + .../msg/CurvatureConfidencePubSubTypes.h | 118 + .../msg/CurvaturePubSubTypes.cxx | 176 + .../msg/CurvaturePubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/CurvatureValue.cxx | 188 + .../etsi_its_cam_msgs/msg/CurvatureValue.h | 216 ++ .../msg/CurvatureValuePubSubTypes.cxx | 183 + .../msg/CurvatureValuePubSubTypes.h | 114 + .../msg/DangerousGoodsBasic.cxx | 204 ++ .../msg/DangerousGoodsBasic.h | 232 ++ .../msg/DangerousGoodsBasicPubSubTypes.cxx | 199 ++ .../msg/DangerousGoodsBasicPubSubTypes.h | 130 + .../msg/DangerousGoodsContainer.cxx | 190 + .../msg/DangerousGoodsContainer.h | 217 ++ .../DangerousGoodsContainerPubSubTypes.cxx | 176 + .../msg/DangerousGoodsContainerPubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/DeltaAltitude.cxx | 189 + .../etsi_its_cam_msgs/msg/DeltaAltitude.h | 217 ++ .../msg/DeltaAltitudePubSubTypes.cxx | 184 + .../msg/DeltaAltitudePubSubTypes.h | 115 + .../etsi_its_cam_msgs/msg/DeltaLatitude.cxx | 189 + .../etsi_its_cam_msgs/msg/DeltaLatitude.h | 217 ++ .../msg/DeltaLatitudePubSubTypes.cxx | 184 + .../msg/DeltaLatitudePubSubTypes.h | 115 + .../etsi_its_cam_msgs/msg/DeltaLongitude.cxx | 189 + .../etsi_its_cam_msgs/msg/DeltaLongitude.h | 217 ++ .../msg/DeltaLongitudePubSubTypes.cxx | 184 + .../msg/DeltaLongitudePubSubTypes.h | 115 + .../msg/DeltaReferencePosition.cxx | 286 ++ .../msg/DeltaReferencePosition.h | 271 ++ .../msg/DeltaReferencePositionPubSubTypes.cxx | 176 + .../msg/DeltaReferencePositionPubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/DriveDirection.cxx | 187 + .../etsi_its_cam_msgs/msg/DriveDirection.h | 215 ++ .../msg/DriveDirectionPubSubTypes.cxx | 182 + .../msg/DriveDirectionPubSubTypes.h | 113 + .../msg/DrivingLaneStatus.cxx | 249 ++ .../etsi_its_cam_msgs/msg/DrivingLaneStatus.h | 240 ++ .../msg/DrivingLaneStatusPubSubTypes.cxx | 181 + .../msg/DrivingLaneStatusPubSubTypes.h} | 35 +- .../msg/EmbarkationStatus.cxx | 183 + .../etsi_its_cam_msgs/msg/EmbarkationStatus.h | 210 ++ .../msg/EmbarkationStatusPubSubTypes.cxx | 176 + .../msg/EmbarkationStatusPubSubTypes.h | 107 + .../msg/EmergencyContainer.cxx | 372 ++ .../msg/EmergencyContainer.h | 311 ++ .../msg/EmergencyContainerPubSubTypes.cxx | 176 + .../msg/EmergencyContainerPubSubTypes.h | 107 + .../msg/EmergencyPriority.cxx | 250 ++ .../etsi_its_cam_msgs/msg/EmergencyPriority.h | 241 ++ .../msg/EmergencyPriorityPubSubTypes.cxx | 182 + .../msg/EmergencyPriorityPubSubTypes.h | 113 + .../etsi_its_cam_msgs/msg/ExteriorLights.cxx | 256 ++ .../etsi_its_cam_msgs/msg/ExteriorLights.h | 247 ++ .../msg/ExteriorLightsPubSubTypes.cxx | 188 + .../msg/ExteriorLightsPubSubTypes.h} | 43 +- .../msg/GenerationDeltaTime.cxx | 187 + .../msg/GenerationDeltaTime.h | 215 ++ .../msg/GenerationDeltaTimePubSubTypes.cxx | 182 + .../msg/GenerationDeltaTimePubSubTypes.h | 113 + .../msg/HardShoulderStatus.cxx | 187 + .../msg/HardShoulderStatus.h | 215 ++ .../msg/HardShoulderStatusPubSubTypes.cxx | 182 + .../msg/HardShoulderStatusPubSubTypes.h | 113 + .../fastdds/etsi_its_cam_msgs/msg/Heading.cxx | 238 ++ .../fastdds/etsi_its_cam_msgs/msg/Heading.h | 244 ++ .../msg/HeadingConfidence.cxx | 190 + .../etsi_its_cam_msgs/msg/HeadingConfidence.h | 218 ++ .../msg/HeadingConfidencePubSubTypes.cxx | 185 + .../msg/HeadingConfidencePubSubTypes.h | 116 + .../msg/HeadingPubSubTypes.cxx | 176 + .../msg/HeadingPubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/HeadingValue.cxx | 191 + .../etsi_its_cam_msgs/msg/HeadingValue.h | 219 ++ .../msg/HeadingValuePubSubTypes.cxx | 186 + .../msg/HeadingValuePubSubTypes.h | 117 + .../msg/HighFrequencyContainer.cxx | 284 ++ .../msg/HighFrequencyContainer.h | 268 ++ .../msg/HighFrequencyContainerPubSubTypes.cxx | 181 + .../msg/HighFrequencyContainerPubSubTypes.h | 112 + .../etsi_its_cam_msgs/msg/ItsPduHeader.cxx | 294 ++ .../etsi_its_cam_msgs/msg/ItsPduHeader.h | 276 ++ .../msg/ItsPduHeaderPubSubTypes.cxx | 196 ++ .../msg/ItsPduHeaderPubSubTypes.h | 127 + .../etsi_its_cam_msgs/msg/LanePosition.cxx | 190 + .../etsi_its_cam_msgs/msg/LanePosition.h | 218 ++ .../msg/LanePositionPubSubTypes.cxx | 185 + .../msg/LanePositionPubSubTypes.h | 116 + .../msg/LateralAcceleration.cxx | 238 ++ .../msg/LateralAcceleration.h | 244 ++ .../msg/LateralAccelerationPubSubTypes.cxx | 176 + .../msg/LateralAccelerationPubSubTypes.h | 107 + .../msg/LateralAccelerationValue.cxx | 189 + .../msg/LateralAccelerationValue.h | 217 ++ .../LateralAccelerationValuePubSubTypes.cxx | 184 + .../msg/LateralAccelerationValuePubSubTypes.h | 115 + .../etsi_its_cam_msgs/msg/Latitude.cxx | 189 + .../fastdds/etsi_its_cam_msgs/msg/Latitude.h | 217 ++ .../msg/LatitudePubSubTypes.cxx | 184 + .../msg/LatitudePubSubTypes.h | 115 + .../msg/LightBarSirenInUse.cxx | 250 ++ .../msg/LightBarSirenInUse.h | 241 ++ .../msg/LightBarSirenInUsePubSubTypes.cxx | 182 + .../msg/LightBarSirenInUsePubSubTypes.h | 113 + .../etsi_its_cam_msgs/msg/Longitude.cxx | 189 + .../fastdds/etsi_its_cam_msgs/msg/Longitude.h | 217 ++ .../msg/LongitudePubSubTypes.cxx | 184 + .../msg/LongitudePubSubTypes.h | 115 + .../msg/LongitudinalAcceleration.cxx | 238 ++ .../msg/LongitudinalAcceleration.h | 244 ++ .../LongitudinalAccelerationPubSubTypes.cxx | 176 + .../msg/LongitudinalAccelerationPubSubTypes.h | 107 + .../msg/LongitudinalAccelerationValue.cxx | 189 + .../msg/LongitudinalAccelerationValue.h | 217 ++ ...ngitudinalAccelerationValuePubSubTypes.cxx | 184 + ...LongitudinalAccelerationValuePubSubTypes.h | 115 + .../msg/LowFrequencyContainer.cxx | 234 ++ .../msg/LowFrequencyContainer.h | 240 ++ .../msg/LowFrequencyContainerPubSubTypes.cxx | 178 + .../msg/LowFrequencyContainerPubSubTypes.h | 110 + .../etsi_its_cam_msgs/msg/PathDeltaTime.cxx | 187 + .../etsi_its_cam_msgs/msg/PathDeltaTime.h | 215 ++ .../msg/PathDeltaTimePubSubTypes.cxx | 182 + .../msg/PathDeltaTimePubSubTypes.h | 113 + .../etsi_its_cam_msgs/msg/PathHistory.cxx | 201 ++ .../etsi_its_cam_msgs/msg/PathHistory.h | 221 ++ .../msg/PathHistoryPubSubTypes.cxx | 181 + .../msg/PathHistoryPubSubTypes.h} | 37 +- .../etsi_its_cam_msgs/msg/PathPoint.cxx | 281 ++ .../fastdds/etsi_its_cam_msgs/msg/PathPoint.h | 264 ++ .../msg/PathPointPubSubTypes.cxx | 176 + .../msg/PathPointPubSubTypes.h | 107 + .../msg/PerformanceClass.cxx | 189 + .../etsi_its_cam_msgs/msg/PerformanceClass.h} | 131 +- .../msg/PerformanceClassPubSubTypes.cxx | 184 + .../msg/PerformanceClassPubSubTypes.h | 115 + .../msg/PosConfidenceEllipse.cxx | 286 ++ .../msg/PosConfidenceEllipse.h | 270 ++ .../msg/PosConfidenceEllipsePubSubTypes.cxx | 176 + .../msg/PosConfidenceEllipsePubSubTypes.h | 107 + .../msg/ProtectedCommunicationZone.cxx | 559 +++ .../msg/ProtectedCommunicationZone.h | 412 +++ .../ProtectedCommunicationZonePubSubTypes.cxx | 176 + .../ProtectedCommunicationZonePubSubTypes.h | 107 + .../msg/ProtectedCommunicationZonesRSU.cxx | 201 ++ .../msg/ProtectedCommunicationZonesRSU.h | 221 ++ ...tectedCommunicationZonesRSUPubSubTypes.cxx | 181 + ...rotectedCommunicationZonesRSUPubSubTypes.h | 112 + .../etsi_its_cam_msgs/msg/ProtectedZoneID.cxx | 186 + .../etsi_its_cam_msgs/msg/ProtectedZoneID.h | 214 ++ .../msg/ProtectedZoneIDPubSubTypes.cxx | 181 + .../msg/ProtectedZoneIDPubSubTypes.h | 112 + .../msg/ProtectedZoneRadius.cxx | 187 + .../msg/ProtectedZoneRadius.h | 215 ++ .../msg/ProtectedZoneRadiusPubSubTypes.cxx | 182 + .../msg/ProtectedZoneRadiusPubSubTypes.h | 113 + .../msg/ProtectedZoneType.cxx | 186 + .../etsi_its_cam_msgs/msg/ProtectedZoneType.h | 214 ++ .../msg/ProtectedZoneTypePubSubTypes.cxx | 181 + .../msg/ProtectedZoneTypePubSubTypes.h | 112 + .../etsi_its_cam_msgs/msg/PtActivation.cxx | 238 ++ .../etsi_its_cam_msgs/msg/PtActivation.h | 244 ++ .../msg/PtActivationData.cxx | 202 ++ .../etsi_its_cam_msgs/msg/PtActivationData.h | 220 ++ .../msg/PtActivationDataPubSubTypes.cxx | 181 + .../msg/PtActivationDataPubSubTypes.h | 112 + .../msg/PtActivationPubSubTypes.cxx | 176 + .../msg/PtActivationPubSubTypes.h | 107 + .../msg/PtActivationType.cxx | 189 + .../etsi_its_cam_msgs/msg/PtActivationType.h | 217 ++ .../msg/PtActivationTypePubSubTypes.cxx | 184 + .../msg/PtActivationTypePubSubTypes.h | 115 + .../msg/PublicTransportContainer.cxx | 281 ++ .../msg/PublicTransportContainer.h | 264 ++ .../PublicTransportContainerPubSubTypes.cxx | 176 + .../msg/PublicTransportContainerPubSubTypes.h | 107 + .../msg/RSUContainerHighFrequency.cxx | 233 ++ .../msg/RSUContainerHighFrequency.h | 237 ++ .../RSUContainerHighFrequencyPubSubTypes.cxx | 176 + .../RSUContainerHighFrequencyPubSubTypes.h | 107 + .../msg/ReferencePosition.cxx | 334 ++ .../etsi_its_cam_msgs/msg/ReferencePosition.h | 298 ++ .../msg/ReferencePositionPubSubTypes.cxx | 176 + .../msg/ReferencePositionPubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/RescueContainer.cxx | 190 + .../etsi_its_cam_msgs/msg/RescueContainer.h | 217 ++ .../msg/RescueContainerPubSubTypes.cxx | 176 + .../msg/RescueContainerPubSubTypes.h | 107 + .../msg/RoadWorksContainerBasic.cxx | 372 ++ .../msg/RoadWorksContainerBasic.h | 311 ++ .../RoadWorksContainerBasicPubSubTypes.cxx | 176 + .../msg/RoadWorksContainerBasicPubSubTypes.h | 107 + .../msg/RoadworksSubCauseCode.cxx | 193 ++ .../msg/RoadworksSubCauseCode.h | 221 ++ .../msg/RoadworksSubCauseCodePubSubTypes.cxx | 188 + .../msg/RoadworksSubCauseCodePubSubTypes.h | 119 + .../msg/SafetyCarContainer.cxx | 463 +++ .../msg/SafetyCarContainer.h | 358 ++ .../msg/SafetyCarContainerPubSubTypes.cxx | 176 + .../msg/SafetyCarContainerPubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/SemiAxisLength.cxx | 189 + .../etsi_its_cam_msgs/msg/SemiAxisLength.h | 217 ++ .../msg/SemiAxisLengthPubSubTypes.cxx | 184 + .../msg/SemiAxisLengthPubSubTypes.h | 115 + .../msg/SpecialTransportContainer.cxx | 238 ++ .../msg/SpecialTransportContainer.h | 244 ++ .../SpecialTransportContainerPubSubTypes.cxx | 176 + .../SpecialTransportContainerPubSubTypes.h | 107 + .../msg/SpecialTransportType.cxx | 252 ++ .../msg/SpecialTransportType.h | 243 ++ .../msg/SpecialTransportTypePubSubTypes.cxx | 184 + .../msg/SpecialTransportTypePubSubTypes.h | 115 + .../msg/SpecialVehicleContainer.cxx | 529 +++ .../msg/SpecialVehicleContainer.h | 408 +++ .../SpecialVehicleContainerPubSubTypes.cxx | 186 + .../msg/SpecialVehicleContainerPubSubTypes.h | 117 + .../fastdds/etsi_its_cam_msgs/msg/Speed.cxx | 238 ++ .../fastdds/etsi_its_cam_msgs/msg/Speed.h | 244 ++ .../etsi_its_cam_msgs/msg/SpeedConfidence.cxx | 190 + .../etsi_its_cam_msgs/msg/SpeedConfidence.h | 218 ++ .../msg/SpeedConfidencePubSubTypes.cxx | 185 + .../msg/SpeedConfidencePubSubTypes.h | 116 + .../etsi_its_cam_msgs/msg/SpeedLimit.cxx | 187 + .../etsi_its_cam_msgs/msg/SpeedLimit.h | 215 ++ .../msg/SpeedLimitPubSubTypes.cxx | 182 + .../msg/SpeedLimitPubSubTypes.h} | 45 +- .../msg/SpeedPubSubTypes.cxx | 176 + .../etsi_its_cam_msgs/msg/SpeedPubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/SpeedValue.cxx | 189 + .../etsi_its_cam_msgs/msg/SpeedValue.h | 217 ++ .../msg/SpeedValuePubSubTypes.cxx | 184 + .../msg/SpeedValuePubSubTypes.h | 115 + .../etsi_its_cam_msgs/msg/StationID.cxx | 186 + .../fastdds/etsi_its_cam_msgs/msg/StationID.h | 214 ++ .../msg/StationIDPubSubTypes.cxx | 181 + .../msg/StationIDPubSubTypes.h | 112 + .../etsi_its_cam_msgs/msg/StationType.cxx | 199 ++ .../etsi_its_cam_msgs/msg/StationType.h | 227 ++ .../msg/StationTypePubSubTypes.cxx | 194 ++ .../msg/StationTypePubSubTypes.h | 125 + .../msg/SteeringWheelAngle.cxx | 238 ++ .../msg/SteeringWheelAngle.h | 244 ++ .../msg/SteeringWheelAngleConfidence.cxx | 189 + .../msg/SteeringWheelAngleConfidence.h | 217 ++ ...teeringWheelAngleConfidencePubSubTypes.cxx | 184 + .../SteeringWheelAngleConfidencePubSubTypes.h | 115 + .../msg/SteeringWheelAnglePubSubTypes.cxx | 176 + .../msg/SteeringWheelAnglePubSubTypes.h | 107 + .../msg/SteeringWheelAngleValue.cxx | 190 + .../msg/SteeringWheelAngleValue.h | 218 ++ .../SteeringWheelAngleValuePubSubTypes.cxx | 185 + .../msg/SteeringWheelAngleValuePubSubTypes.h | 116 + .../msg/SubCauseCodeType.cxx | 186 + .../etsi_its_cam_msgs/msg/SubCauseCodeType.h | 214 ++ .../msg/SubCauseCodeTypePubSubTypes.cxx | 181 + .../msg/SubCauseCodeTypePubSubTypes.h | 112 + .../etsi_its_cam_msgs/msg/TimestampIts.cxx | 188 + .../etsi_its_cam_msgs/msg/TimestampIts.h | 216 ++ .../msg/TimestampItsPubSubTypes.cxx | 183 + .../msg/TimestampItsPubSubTypes.h | 114 + .../etsi_its_cam_msgs/msg/TrafficRule.cxx | 188 + .../etsi_its_cam_msgs/msg/TrafficRule.h | 216 ++ .../msg/TrafficRulePubSubTypes.cxx | 183 + .../msg/TrafficRulePubSubTypes.h | 114 + .../etsi_its_cam_msgs/msg/VehicleLength.cxx | 238 ++ .../etsi_its_cam_msgs/msg/VehicleLength.h | 244 ++ .../msg/VehicleLengthConfidenceIndication.cxx | 189 + .../msg/VehicleLengthConfidenceIndication.h | 217 ++ ...eLengthConfidenceIndicationPubSubTypes.cxx | 184 + ...cleLengthConfidenceIndicationPubSubTypes.h | 115 + .../msg/VehicleLengthPubSubTypes.cxx | 176 + .../msg/VehicleLengthPubSubTypes.h | 107 + .../msg/VehicleLengthValue.cxx | 189 + .../msg/VehicleLengthValue.h | 217 ++ .../msg/VehicleLengthValuePubSubTypes.cxx | 184 + .../msg/VehicleLengthValuePubSubTypes.h | 115 + .../etsi_its_cam_msgs/msg/VehicleRole.cxx | 200 ++ .../etsi_its_cam_msgs/msg/VehicleRole.h | 228 ++ .../msg/VehicleRolePubSubTypes.cxx | 195 ++ .../msg/VehicleRolePubSubTypes.h | 126 + .../etsi_its_cam_msgs/msg/VehicleWidth.cxx | 189 + .../etsi_its_cam_msgs/msg/VehicleWidth.h | 217 ++ .../msg/VehicleWidthPubSubTypes.cxx | 184 + .../msg/VehicleWidthPubSubTypes.h | 115 + .../msg/VerticalAcceleration.cxx | 238 ++ .../msg/VerticalAcceleration.h | 244 ++ .../msg/VerticalAccelerationPubSubTypes.cxx | 176 + .../msg/VerticalAccelerationPubSubTypes.h | 107 + .../msg/VerticalAccelerationValue.cxx | 189 + .../msg/VerticalAccelerationValue.h | 217 ++ .../VerticalAccelerationValuePubSubTypes.cxx | 184 + .../VerticalAccelerationValuePubSubTypes.h | 115 + .../fastdds/etsi_its_cam_msgs/msg/YawRate.cxx | 238 ++ .../fastdds/etsi_its_cam_msgs/msg/YawRate.h | 244 ++ .../msg/YawRateConfidence.cxx | 193 ++ .../etsi_its_cam_msgs/msg/YawRateConfidence.h | 221 ++ .../msg/YawRateConfidencePubSubTypes.cxx | 188 + .../msg/YawRateConfidencePubSubTypes.h | 119 + .../msg/YawRatePubSubTypes.cxx | 176 + .../msg/YawRatePubSubTypes.h | 107 + .../etsi_its_cam_msgs/msg/YawRateValue.cxx | 190 + .../etsi_its_cam_msgs/msg/YawRateValue.h | 218 ++ .../msg/YawRateValuePubSubTypes.cxx | 185 + .../msg/YawRateValuePubSubTypes.h | 116 + .../source/carla/ros2/fastdds/fastcdr/Cdr.h | 3065 +++++++++++++++++ .../ros2/fastdds/geometry_msgs/msg/Accel.cxx | 238 ++ .../geometry_msgs/msg/Accel.h} | 147 +- .../geometry_msgs/msg/AccelPubSubTypes.cxx | 176 + .../geometry_msgs/msg/AccelPubSubTypes.h} | 36 +- .../geometry_msgs/msg/AccelWithCovariance.cxx | 247 ++ .../geometry_msgs/msg/AccelWithCovariance.h | 244 ++ .../msg/AccelWithCovariancePubSubTypes.cxx | 177 + .../msg/AccelWithCovariancePubSubTypes.h | 108 + .../geometry_msgs/msg/Point.cxx} | 57 +- .../geometry_msgs/msg}/Point.h | 23 +- .../geometry_msgs/msg/Point32.cxx} | 57 +- .../geometry_msgs/msg}/Point32.h | 23 +- .../geometry_msgs/msg/Point32PubSubTypes.cxx} | 26 +- .../geometry_msgs/msg}/Point32PubSubTypes.h | 43 +- .../geometry_msgs/msg/PointPubSubTypes.cxx} | 26 +- .../geometry_msgs/msg}/PointPubSubTypes.h | 45 +- .../fastdds/geometry_msgs/msg/Polygon.cxx | 198 ++ .../geometry_msgs/msg/Polygon.h} | 115 +- .../geometry_msgs/msg/PolygonPubSubTypes.cxx | 176 + .../geometry_msgs/msg/PolygonPubSubTypes.h} | 28 +- .../geometry_msgs/msg/Pose.cxx} | 47 +- .../geometry_msgs/msg}/Pose.h | 25 +- .../geometry_msgs/msg/PosePubSubTypes.cxx} | 26 +- .../geometry_msgs/msg/PosePubSubTypes.h} | 30 +- .../geometry_msgs/msg/PoseWithCovariance.cxx} | 65 +- .../geometry_msgs/msg}/PoseWithCovariance.h | 34 +- .../msg/PoseWithCovariancePubSubTypes.cxx} | 26 +- .../msg/PoseWithCovariancePubSubTypes.h | 108 + .../geometry_msgs/msg/Quaternion.cxx} | 65 +- .../fastdds/geometry_msgs/msg/Quaternion.h | 270 ++ .../msg/QuaternionPubSubTypes.cxx} | 26 +- .../msg}/QuaternionPubSubTypes.h | 45 +- .../geometry_msgs/msg/Transform.cxx} | 0 .../fastdds/geometry_msgs/msg/Transform.h | 223 ++ .../msg/TransformPubSubTypes.cxx} | 0 .../geometry_msgs/msg/TransformPubSubTypes.h | 124 + .../geometry_msgs/msg/TransformStamped.cxx} | 0 .../geometry_msgs/msg/TransformStamped.h | 247 ++ .../msg/TransformStampedPubSubTypes.cxx} | 0 .../msg/TransformStampedPubSubTypes.h | 95 + .../geometry_msgs/msg/Twist.cxx} | 45 +- .../ros2/fastdds/geometry_msgs/msg/Twist.h | 243 ++ .../geometry_msgs/msg/TwistPubSubTypes.cxx} | 26 +- .../geometry_msgs/msg/TwistPubSubTypes.h | 107 + .../msg/TwistWithCovariance.cxx} | 63 +- .../geometry_msgs/msg}/TwistWithCovariance.h | 34 +- .../msg/TwistWithCovariancePubSubTypes.cxx} | 26 +- .../msg/TwistWithCovariancePubSubTypes.h | 108 + .../geometry_msgs/msg/Vector3.cxx} | 56 +- .../geometry_msgs/msg}/Vector3.h | 22 +- .../geometry_msgs/msg/Vector3PubSubTypes.cxx} | 26 +- .../geometry_msgs/msg}/Vector3PubSubTypes.h | 45 +- .../nav_msgs/msg/Odometry.cxx} | 0 .../ros2/fastdds/nav_msgs/msg/Odometry.h | 272 ++ .../nav_msgs/msg/OdometryPubSubTypes.cxx} | 0 .../nav_msgs/msg/OdometryPubSubTypes.h | 94 + .../rosgraph_msgs/msg/Clock.cxx} | 0 .../ros2/fastdds/rosgraph_msgs/msg/Clock.h | 198 ++ .../rosgraph_msgs/msg/ClockPubSubTypes.cxx} | 0 .../rosgraph_msgs/msg/ClockPubSubTypes.h | 90 + .../sensor_msgs/msg/CameraInfo.cxx} | 8 +- .../ros2/fastdds/sensor_msgs/msg/CameraInfo.h | 419 +++ .../msg/CameraInfoPubSubTypes.cxx} | 0 .../sensor_msgs/msg/CameraInfoPubSubTypes.h | 93 + .../ros2/fastdds/sensor_msgs/msg/Image.cc | 397 +++ .../ros2/fastdds/sensor_msgs/msg/Image.h | 335 ++ .../sensor_msgs/msg/ImagePubSubTypes.cc | 135 + .../sensor_msgs/msg/ImagePubSubTypes.h | 96 + .../sensor_msgs/msg/Imu.cxx} | 0 .../carla/ros2/fastdds/sensor_msgs/msg/Imu.h | 352 ++ .../sensor_msgs/msg/ImuPubSubTypes.cxx} | 0 .../fastdds/sensor_msgs/msg/ImuPubSubTypes.h | 96 + .../sensor_msgs/msg/NavSatFix.cxx} | 0 .../ros2/fastdds/sensor_msgs/msg/NavSatFix.h | 329 ++ .../sensor_msgs/msg/NavSatFixPubSubTypes.cxx} | 0 .../sensor_msgs/msg/NavSatFixPubSubTypes.h | 95 + .../sensor_msgs/msg/NavSatStatus.cxx} | 0 .../fastdds/sensor_msgs/msg/NavSatStatus.h | 217 ++ .../msg/NavSatStatusPubSubTypes.cxx} | 0 .../sensor_msgs/msg/NavSatStatusPubSubTypes.h | 119 + .../fastdds/sensor_msgs/msg/PointCloud2.cc | 487 +++ .../fastdds/sensor_msgs/msg/PointCloud2.h | 372 ++ .../sensor_msgs/msg/PointCloud2PubSubTypes.cc | 150 + .../sensor_msgs/msg/PointCloud2PubSubTypes.h | 99 + .../sensor_msgs/msg/PointField.cxx} | 0 .../ros2/fastdds/sensor_msgs/msg/PointField.h | 261 ++ .../msg/PointFieldPubSubTypes.cxx} | 0 .../sensor_msgs/msg/PointFieldPubSubTypes.h | 90 + .../sensor_msgs/msg/RegionOfInterest.cxx} | 0 .../sensor_msgs/msg/RegionOfInterest.h | 266 ++ .../msg/RegionOfInterestPubSubTypes.cxx} | 0 .../msg/RegionOfInterestPubSubTypes.h | 122 + .../fastdds/shape_msgs/msg/SolidPrimitive.cxx | 309 ++ .../fastdds/shape_msgs/msg/SolidPrimitive.h | 255 ++ .../msg/SolidPrimitivePubSubTypes.cxx | 193 ++ .../msg/SolidPrimitivePubSubTypes.h | 92 + .../carla/ros2/fastdds/std_msgs/msg/Bool.cxx | 183 + .../Float32.h => fastdds/std_msgs/msg/Bool.h} | 90 +- .../fastdds/std_msgs/msg/BoolPubSubTypes.cxx | 176 + .../fastdds/std_msgs/msg/BoolPubSubTypes.h | 107 + .../std_msgs/msg/Float32.cxx} | 0 .../carla/ros2/fastdds/std_msgs/msg/Float32.h | 190 + .../std_msgs/msg/Float32PubSubTypes.cxx} | 0 .../fastdds/std_msgs/msg/Float32PubSubTypes.h | 118 + .../std_msgs/msg/Header.cxx} | 49 +- .../carla/ros2/fastdds/std_msgs/msg/Header.h | 220 ++ .../std_msgs/msg/HeaderPubSubTypes.cxx} | 30 +- .../fastdds/std_msgs/msg/HeaderPubSubTypes.h | 91 + .../std_msgs/msg/String.cxx} | 0 .../carla/ros2/fastdds/std_msgs/msg/String.h | 196 ++ .../std_msgs/msg/StringPubSubTypes.cxx} | 0 .../fastdds/std_msgs/msg/StringPubSubTypes.h | 91 + .../tf2_msgs/msg/TF2Error.cxx} | 0 .../ros2/fastdds/tf2_msgs/msg/TF2Error.h | 222 ++ .../tf2_msgs/msg/TF2ErrorPubSubTypes.cxx} | 0 .../tf2_msgs/msg/TF2ErrorPubSubTypes.h | 90 + .../tf2_msgs/msg/TFMessage.cxx} | 0 .../ros2/fastdds/tf2_msgs/msg/TFMessage.h | 198 ++ .../tf2_msgs/msg/TFMessagePubSubTypes.cxx} | 0 .../tf2_msgs/msg/TFMessagePubSubTypes.h | 93 + .../carla/ros2/publishers/BasePublisher.h | 44 - .../publishers/CarlaActorListPublisher.cpp | 35 + .../ros2/publishers/CarlaActorListPublisher.h | 41 + .../ros2/publishers/CarlaCameraPublisher.cpp | 63 - .../ros2/publishers/CarlaCameraPublisher.h | 64 - .../ros2/publishers/CarlaClockPublisher.cpp | 18 - .../ros2/publishers/CarlaClockPublisher.h | 42 - .../publishers/CarlaCollisionPublisher.cpp | 26 - .../ros2/publishers/CarlaCollisionPublisher.h | 45 - .../ros2/publishers/CarlaDVSPublisher.cpp | 57 - .../carla/ros2/publishers/CarlaDVSPublisher.h | 83 - .../publishers/CarlaDepthCameraPublisher.h | 15 - .../ros2/publishers/CarlaGNSSPublisher.cpp | 24 - .../ros2/publishers/CarlaGNSSPublisher.h | 44 - .../ros2/publishers/CarlaIMUPublisher.cpp | 49 - .../carla/ros2/publishers/CarlaIMUPublisher.h | 44 - .../ros2/publishers/CarlaISCameraPublisher.h | 15 - .../ros2/publishers/CarlaLidarPublisher.cpp | 61 - .../ros2/publishers/CarlaLidarPublisher.h | 27 - .../publishers/CarlaNormalsCameraPublisher.h | 15 - .../CarlaOpticalFlowCameraPublisher.h | 15 - .../publishers/CarlaPointCloudPublisher.cpp | 32 - .../publishers/CarlaPointCloudPublisher.h | 53 - .../ros2/publishers/CarlaRGBCameraPublisher.h | 24 - .../ros2/publishers/CarlaRadarPublisher.cpp | 92 - .../ros2/publishers/CarlaRadarPublisher.h | 27 - .../ros2/publishers/CarlaSSCameraPublisher.h | 15 - .../publishers/CarlaSemanticLidarPublisher.h | 27 - .../ros2/publishers/CarlaStatusPublisher.cpp | 37 + .../ros2/publishers/CarlaStatusPublisher.h | 40 + .../publishers/CarlaTransformPublisher.cpp | 88 - .../ros2/publishers/CarlaTransformPublisher.h | 50 - .../carla/ros2/publishers/ClockPublisher.cpp | 33 + .../carla/ros2/publishers/ClockPublisher.h | 44 + .../carla/ros2/publishers/MapPublisher.cpp | 33 + .../carla/ros2/publishers/MapPublisher.h | 42 + .../carla/ros2/publishers/ObjectPublisher.cpp | 39 + .../carla/ros2/publishers/ObjectPublisher.h | 45 + .../ObjectWithCovariancePublisher.cpp | 39 + .../ObjectWithCovariancePublisher.h | 45 + .../ros2/publishers/ObjectsPublisher.cpp | 41 + .../carla/ros2/publishers/ObjectsPublisher.h | 44 + .../ObjectsWithCovariancePublisher.cpp | 41 + .../ObjectsWithCovariancePublisher.h | 44 + .../carla/ros2/publishers/PublisherBase.h | 77 + .../ros2/publishers/PublisherBaseSensor.h | 36 + .../ros2/publishers/PublisherBaseTransform.h | 76 + .../carla/ros2/publishers/PublisherImpl.h | 139 - .../ros2/publishers/PublisherInterface.h | 54 + .../ros2/publishers/TrafficLightPublisher.cpp | 76 + .../ros2/publishers/TrafficLightPublisher.h | 60 + .../publishers/TrafficLightsPublisher.cpp | 73 + .../ros2/publishers/TrafficLightsPublisher.h | 48 + .../ros2/publishers/TrafficSignPublisher.cpp | 40 + .../ros2/publishers/TrafficSignPublisher.h | 46 + .../ros2/publishers/TransformPublisher.cpp | 44 + .../ros2/publishers/TransformPublisher.h | 42 + .../ros2/publishers/UeCollisionPublisher.cpp | 42 + .../ros2/publishers/UeCollisionPublisher.h | 52 + .../ros2/publishers/UeDVSCameraPublisher.cpp | 123 + .../ros2/publishers/UeDVSCameraPublisher.h | 71 + .../publishers/UeDepthCameraPublisher.cpp | 17 + .../ros2/publishers/UeDepthCameraPublisher.h | 21 + .../carla/ros2/publishers/UeGNSSPublisher.cpp | 39 + .../carla/ros2/publishers/UeGNSSPublisher.h | 53 + .../carla/ros2/publishers/UeIMUPublisher.cpp | 67 + .../carla/ros2/publishers/UeIMUPublisher.h | 51 + .../ros2/publishers/UeISCameraPublisher.cpp | 17 + .../ros2/publishers/UeISCameraPublisher.h | 22 + .../ros2/publishers/UeLidarPublisher.cpp | 56 + .../carla/ros2/publishers/UeLidarPublisher.h | 29 + .../publishers/UeNormalsCameraPublisher.cpp | 17 + .../publishers/UeNormalsCameraPublisher.h | 24 + .../UeOpticalFlowCameraPublisher.cpp | 110 + .../publishers/UeOpticalFlowCameraPublisher.h | 25 + .../ros2/publishers/UePublisherBaseCamera.cc | 96 + .../ros2/publishers/UePublisherBaseCamera.h | 210 ++ .../publishers/UePublisherBasePointCloud.cc | 55 + .../publishers/UePublisherBasePointCloud.h | 74 + .../ros2/publishers/UePublisherBaseSensor.h | 49 + .../ros2/publishers/UeRGBCameraPublisher.cpp | 39 + .../ros2/publishers/UeRGBCameraPublisher.h | 38 + .../ros2/publishers/UeRadarPublisher.cpp | 84 + .../carla/ros2/publishers/UeRadarPublisher.h | 51 + .../ros2/publishers/UeSSCameraPublisher.cpp | 17 + .../ros2/publishers/UeSSCameraPublisher.h | 21 + ...isher.cpp => UeSemanticLidarPublisher.cpp} | 45 +- .../publishers/UeSemanticLidarPublisher.h | 28 + .../ros2/publishers/UeV2XCustomPublisher.cpp | 64 + .../ros2/publishers/UeV2XCustomPublisher.h | 65 + .../carla/ros2/publishers/UeV2XPublisher.cpp | 158 + .../carla/ros2/publishers/UeV2XPublisher.h | 58 + .../ros2/publishers/UeWorldPublisher.cpp | 445 +++ .../carla/ros2/publishers/UeWorldPublisher.h | 216 ++ .../ros2/publishers/VehiclePublisher.cpp | 161 + .../carla/ros2/publishers/VehiclePublisher.h | 74 + .../carla/ros2/publishers/WalkerPublisher.cpp | 55 + .../carla/ros2/publishers/WalkerPublisher.h | 53 + .../ros2/services/DestroyObjectService.cpp | 34 + .../ros2/services/DestroyObjectService.h | 43 + .../ros2/services/GetAvailableMapsService.cpp | 40 + .../ros2/services/GetAvailableMapsService.h | 43 + .../ros2/services/GetBlueprintsService.cpp | 57 + .../ros2/services/GetBlueprintsService.h | 43 + .../carla/ros2/services/LoadMapService.cpp | 78 + .../carla/ros2/services/LoadMapService.h | 43 + .../source/carla/ros2/services/ServiceBase.h | 41 + .../carla/ros2/services/ServiceInterface.h | 44 + .../services/SetEpisodeSettingsService.cpp | 44 + .../ros2/services/SetEpisodeSettingsService.h | 43 + .../ros2/services/SpawnObjectService.cpp | 128 + .../carla/ros2/services/SpawnObjectService.h | 43 + .../AckermannControlSubscriber.cpp | 35 +- .../subscribers/AckermannControlSubscriber.h | 54 +- .../ActorSetTransformSubscriber.cpp | 34 + .../subscribers/ActorSetTransformSubscriber.h | 41 + .../carla/ros2/subscribers/BaseSubscriber.h | 49 - .../subscribers/CarlaControlSubscriber.cpp | 47 + .../ros2/subscribers/CarlaControlSubscriber.h | 46 + .../CarlaEgoVehicleControlSubscriber.cpp | 30 - .../CarlaEgoVehicleControlSubscriber.h | 42 - .../CarlaSynchronizationWindowSubscriber.cpp | 44 + .../CarlaSynchronizationWindowSubscriber.h | 49 + .../carla/ros2/subscribers/SubscriberBase.h | 87 + .../SubscriberBaseSynchronizationClient.h | 85 + .../carla/ros2/subscribers/SubscriberImpl.h | 149 - .../ros2/subscribers/SubscriberImplBase.h | 165 + .../subscribers/UeV2XCustomSubscriber.cpp | 35 + .../ros2/subscribers/UeV2XCustomSubscriber.h | 41 + .../subscribers/VehicleControlSubscriber.cpp | 29 + .../subscribers/VehicleControlSubscriber.h | 41 + .../subscribers/WalkerControlSubscriber.cpp | 29 + .../subscribers/WalkerControlSubscriber.h | 41 + .../carla/ros2/types/AcceleratedMovement.h | 109 + .../source/carla/ros2/types/Acceleration.h | 48 + .../source/carla/ros2/types/AckermannDrive.h | 294 -- .../ros2/types/AckermannDrivePubSubTypes.h | 146 - .../source/carla/ros2/types/ActorDefinition.h | 47 + .../carla/ros2/types/ActorNameDefinition.cpp | 33 + .../carla/ros2/types/ActorNameDefinition.h | 62 + .../source/carla/ros2/types/AngularVelocity.h | 68 + LibCarla/source/carla/ros2/types/CameraInfo.h | 451 --- .../ros2/types/CoordinateSystemTransform.h | 59 + .../source/carla/ros2/types/EpisodeSettings.h | 72 + .../carla/ros2/types/Float32PubSubTypes.h | 139 - LibCarla/source/carla/ros2/types/Image.cpp | 423 --- LibCarla/source/carla/ros2/types/Imu.h | 373 -- LibCarla/source/carla/ros2/types/NavSatFix.h | 351 -- .../ros2/types/NavSatStatusPubSubTypes.h | 138 - LibCarla/source/carla/ros2/types/Object.h | 223 ++ .../source/carla/ros2/types/PointCloud2.cpp | 507 --- LibCarla/source/carla/ros2/types/Polygon.h | 66 + .../source/carla/ros2/types/PosePubSubTypes.h | 142 - .../types/PoseWithCovariancePubSubTypes.h | 142 - .../carla/ros2/types/PublisherSensorType.h | 89 + LibCarla/source/carla/ros2/types/Quaternion.h | 334 +- .../carla/ros2/types/RegionOfInterest.h | 286 -- .../ros2/types/RegionOfInterestPubSubTypes.h | 143 - .../carla/ros2/types/SensorActorDefinition.h | 42 + LibCarla/source/carla/ros2/types/Speed.h | 65 + LibCarla/source/carla/ros2/types/Timestamp.h | 56 + .../ros2/types/TrafficLightActorDefinition.h | 44 + .../ros2/types/TrafficSignActorDefinition.h | 28 + LibCarla/source/carla/ros2/types/Transform.h | 384 +-- .../carla/ros2/types/TransformPubSubTypes.h | 143 - LibCarla/source/carla/ros2/types/Twist.h | 302 +- .../carla/ros2/types/TwistPubSubTypes.h | 142 - .../types/TwistWithCovariancePubSubTypes.h | 142 - .../ros2/types/VehicleAckermannControl.h | 61 + .../carla/ros2/types/VehicleActorDefinition.h | 50 + .../source/carla/ros2/types/VehicleControl.h | 70 + .../carla/ros2/types/WalkerActorDefinition.h | 32 + .../source/carla/ros2/types/WalkerControl.h | 60 + LibCarla/source/carla/sensor/RawData.h | 9 - LibCarla/source/carla/sensor/data/ImageTmpl.h | 8 - LibCarla/source/carla/sensor/data/LidarData.h | 5 - LibCarla/source/carla/sensor/data/RadarData.h | 5 - .../carla/sensor/data/SemanticLidarData.h | 5 - .../sensor/data/SerializerVectorAllocator.h | 160 + .../carla/sensor/s11n/LidarSerializer.h | 7 + .../sensor/s11n/SemanticLidarSerializer.h | 7 + LibCarla/source/carla/streaming/Server.h | 4 +- .../source/carla/streaming/detail/Message.h | 14 + .../carla/streaming/detail/MultiStreamState.h | 5 +- .../streaming/detail/tcp/ServerSession.cpp | 4 +- .../source/carla/streaming/low_level/Server.h | 4 +- PythonAPI/carla/setup.py | 2 +- Unreal/CarlaUE4/Config/DefaultGame.ini | 2 + .../Source/Carla/Actor/ActorDispatcher.cpp | 251 +- .../Source/Carla/Actor/ActorROS2Handler.cpp | 49 - .../Source/Carla/Actor/ActorROS2Handler.h | 26 - .../Plugins/Carla/Source/Carla/Carla.Build.cs | 25 +- .../Carla/Source/Carla/Game/CarlaEngine.cpp | 97 +- .../Carla/Source/Carla/Game/CarlaEngine.h | 11 - .../Carla/Source/Carla/Game/CarlaEpisode.cpp | 9 + .../Carla/Source/Carla/Game/CarlaEpisode.h | 6 - .../Source/Carla/Sensor/CollisionSensor.cpp | 18 - .../Carla/Source/Carla/Sensor/DVSCamera.cpp | 35 +- .../Carla/Source/Carla/Sensor/GnssSensor.cpp | 12 - .../Carla/Source/Carla/Sensor/HSSLidar.cpp | 14 - .../Carla/Sensor/InertialMeasurementUnit.cpp | 13 - .../Carla/Sensor/ObstacleDetectionSensor.cpp | 16 - .../Carla/Source/Carla/Sensor/PixelReader.h | 16 - .../Carla/Source/Carla/Sensor/Radar.cpp | 13 - .../Source/Carla/Sensor/RayCastLidar.cpp | 14 - .../Carla/Sensor/RayCastSemanticLidar.cpp | 13 - .../Carla/Source/Carla/Server/CarlaServer.cpp | 25 +- .../Carla/Source/Carla/Server/CarlaServer.h | 2 +- Util/BuildTools/BuildLibCarla.sh | 4 +- Util/BuildTools/BuildUE4Plugins.sh | 2 +- Util/BuildTools/Setup.sh | 24 +- Util/BuildTools/Vars.mk | 2 +- 920 files changed, 136919 insertions(+), 9453 deletions(-) delete mode 100644 LibCarla/source/carla/ros2/ROS2CallbackData.h create mode 100644 LibCarla/source/carla/ros2/ROS2NameRecord.cpp create mode 100644 LibCarla/source/carla/ros2/ROS2NameRecord.h create mode 100644 LibCarla/source/carla/ros2/ROS2NameRegistry.cpp create mode 100644 LibCarla/source/carla/ros2/ROS2NameRegistry.h create mode 100644 LibCarla/source/carla/ros2/ROS2QoS.h create mode 100644 LibCarla/source/carla/ros2/ROS2Session.cpp create mode 100644 LibCarla/source/carla/ros2/ROS2Session.h create mode 100644 LibCarla/source/carla/ros2/fastdds/README.md rename LibCarla/source/carla/ros2/{types/AckermannDrive.cpp => fastdds/ackermann_msgs/msg/AckermannDrive.cxx} (87%) create mode 100644 LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.h rename LibCarla/source/carla/ros2/{types/AckermannDrivePubSubTypes.cpp => fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.cxx} (85%) create mode 100644 LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.h rename LibCarla/source/carla/ros2/{types/AckermannDriveStamped.cpp => fastdds/ackermann_msgs/msg/AckermannDriveStamped.cxx} (85%) create mode 100644 LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.h rename LibCarla/source/carla/ros2/{types/AckermannDriveStampedPubSubTypes.cpp => fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.cxx} (85%) create mode 100644 LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h rename LibCarla/source/carla/ros2/{types/Time.cpp => fastdds/builtin_interfaces/msg/Time.cxx} (88%) create mode 100644 LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.h rename LibCarla/source/carla/ros2/{types/TimePubSubTypes.cpp => fastdds/builtin_interfaces/msg/TimePubSubTypes.cxx} (90%) create mode 100644 LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsDomainParticipantImpl.cpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsDomainParticipantImpl.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsReturnCode.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsSubscriberImpl.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.h rename LibCarla/source/carla/ros2/{types/CarlaCollisionEvent.cpp => fastdds/carla_msgs/msg/CarlaCollisionEvent.cxx} (86%) rename LibCarla/source/carla/ros2/{types => fastdds/carla_msgs/msg}/CarlaCollisionEvent.h (95%) rename LibCarla/source/carla/ros2/{types/CarlaCollisionEventPubSubTypes.cpp => fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.cxx} (89%) rename LibCarla/source/carla/ros2/{types => fastdds/carla_msgs/msg}/CarlaCollisionEventPubSubTypes.h (97%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.cxx rename LibCarla/source/carla/ros2/{types/Clock.h => fastdds/carla_msgs/msg/CarlaControl.h} (60%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.h rename LibCarla/source/carla/ros2/{types/CarlaEgoVehicleControl.cpp => fastdds/carla_msgs/msg/CarlaEgoVehicleControl.cxx} (77%) rename LibCarla/source/carla/ros2/{types => fastdds/carla_msgs/msg}/CarlaEgoVehicleControl.h (86%) rename LibCarla/source/carla/ros2/{types/CarlaEgoVehicleControlPubSubTypes.cpp => fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.cxx} (88%) rename LibCarla/source/carla/ros2/{types => fastdds/carla_msgs/msg}/CarlaEgoVehicleControlPubSubTypes.h (85%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/AckermannDriveStampedPubSubTypes.h => fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h} (77%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx rename LibCarla/source/carla/ros2/{types/PointCloud2.h => fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h} (50%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h rename LibCarla/source/carla/ros2/{types/CarlaLineInvasion.cpp => fastdds/carla_msgs/msg/CarlaLaneInvasion.cxx} (99%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.cxx rename LibCarla/source/carla/ros2/{types/CarlaLineInvasion.h => fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.h} (74%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.h rename LibCarla/source/carla/ros2/{types/CarlaLineInvasionPubSubTypes.cpp => fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.cxx} (98%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.cxx rename LibCarla/source/carla/ros2/{types/Image.h => fastdds/carla_msgs/msg/CarlaStatus.h} (52%) rename LibCarla/source/carla/ros2/{types/PointCloud2PubSubTypes.cpp => fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.cxx} (69%) rename LibCarla/source/carla/ros2/{types/PointFieldPubSubTypes.h => fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.h} (79%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.cxx rename LibCarla/source/carla/ros2/{types/PointField.h => fastdds/carla_msgs/msg/CarlaTrafficLightInfo.h} (50%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.cxx rename LibCarla/source/carla/ros2/{types/Odometry.h => fastdds/carla_msgs/msg/CarlaTrafficLightStatus.h} (52%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.cxx rename LibCarla/source/carla/ros2/{types/TF2Error.h => fastdds/carla_msgs/msg/CarlaV2XByteArray.h} (55%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.cxx rename LibCarla/source/carla/ros2/{types/NavSatStatus.h => fastdds/carla_msgs/msg/CarlaV2XData.h} (55%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.cxx rename LibCarla/source/carla/ros2/{types/String.h => fastdds/carla_msgs/msg/CarlaV2XDataList.h} (65%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/TransformStampedPubSubTypes.h => fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.h} (78%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/HeaderPubSubTypes.h => fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.h} (78%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.cxx rename LibCarla/source/carla/ros2/{types/TransformStamped.h => fastdds/carla_msgs/msg/CarlaWalkerControl.h} (56%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/OdometryPubSubTypes.h => fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.h} (77%) create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.cxx rename LibCarla/source/carla/ros2/{types/AckermannDriveStamped.h => fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.h} (60%) create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.h create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h rename LibCarla/source/carla/ros2/{types/ImagePubSubTypes.cpp => fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx} (71%) rename LibCarla/source/carla/ros2/{types/ClockPubSubTypes.h => fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.h} (80%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/TFMessagePubSubTypes.h => fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.h} (77%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/PointCloud2PubSubTypes.h => fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.h} (79%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/StringPubSubTypes.h => fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.h} (78%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/CarlaLineInvasionPubSubTypes.h => fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.h} (77%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/NavSatFixPubSubTypes.h => fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.h} (76%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/ImuPubSubTypes.h => fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.h} (77%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.cxx rename LibCarla/source/carla/ros2/{types/Time.h => fastdds/etsi_its_cam_msgs/msg/PerformanceClass.h} (59%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/CameraInfoPubSubTypes.h => fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.h} (75%) create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.h create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/fastcdr/Cdr.h create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.cxx rename LibCarla/source/carla/ros2/{types/Header.h => fastdds/geometry_msgs/msg/Accel.h} (56%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/ImagePubSubTypes.h => fastdds/geometry_msgs/msg/AccelPubSubTypes.h} (78%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.h create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.h rename LibCarla/source/carla/ros2/{types/Point.cpp => fastdds/geometry_msgs/msg/Point.cxx} (86%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/Point.h (94%) rename LibCarla/source/carla/ros2/{types/Point32.cpp => fastdds/geometry_msgs/msg/Point32.cxx} (86%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/Point32.h (94%) rename LibCarla/source/carla/ros2/{types/Point32PubSubTypes.cpp => fastdds/geometry_msgs/msg/Point32PubSubTypes.cxx} (89%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/Point32PubSubTypes.h (76%) rename LibCarla/source/carla/ros2/{types/PointPubSubTypes.cpp => fastdds/geometry_msgs/msg/PointPubSubTypes.cxx} (89%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/PointPubSubTypes.h (75%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.cxx rename LibCarla/source/carla/ros2/{types/TFMessage.h => fastdds/geometry_msgs/msg/Polygon.h} (60%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.cxx rename LibCarla/source/carla/ros2/{types/TF2ErrorPubSubTypes.h => fastdds/geometry_msgs/msg/PolygonPubSubTypes.h} (80%) rename LibCarla/source/carla/ros2/{types/Pose.cpp => fastdds/geometry_msgs/msg/Pose.cxx} (89%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/Pose.h (94%) rename LibCarla/source/carla/ros2/{types/PosePubSubTypes.cpp => fastdds/geometry_msgs/msg/PosePubSubTypes.cxx} (89%) rename LibCarla/source/carla/ros2/{types/TimePubSubTypes.h => fastdds/geometry_msgs/msg/PosePubSubTypes.h} (80%) rename LibCarla/source/carla/ros2/{types/PoseWithCovariance.cpp => fastdds/geometry_msgs/msg/PoseWithCovariance.cxx} (78%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/PoseWithCovariance.h (88%) rename LibCarla/source/carla/ros2/{types/PoseWithCovariancePubSubTypes.cpp => fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.cxx} (89%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.h rename LibCarla/source/carla/ros2/{types/Quaternion.cpp => fastdds/geometry_msgs/msg/Quaternion.cxx} (85%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.h rename LibCarla/source/carla/ros2/{types/QuaternionPubSubTypes.cpp => fastdds/geometry_msgs/msg/QuaternionPubSubTypes.cxx} (89%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/QuaternionPubSubTypes.h (76%) rename LibCarla/source/carla/ros2/{types/Transform.cpp => fastdds/geometry_msgs/msg/Transform.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.h rename LibCarla/source/carla/ros2/{types/TransformPubSubTypes.cpp => fastdds/geometry_msgs/msg/TransformPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.h rename LibCarla/source/carla/ros2/{types/TransformStamped.cpp => fastdds/geometry_msgs/msg/TransformStamped.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.h rename LibCarla/source/carla/ros2/{types/TransformStampedPubSubTypes.cpp => fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.h rename LibCarla/source/carla/ros2/{types/Twist.cpp => fastdds/geometry_msgs/msg/Twist.cxx} (89%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.h rename LibCarla/source/carla/ros2/{types/TwistPubSubTypes.cpp => fastdds/geometry_msgs/msg/TwistPubSubTypes.cxx} (89%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.h rename LibCarla/source/carla/ros2/{types/TwistWithCovariance.cpp => fastdds/geometry_msgs/msg/TwistWithCovariance.cxx} (80%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/TwistWithCovariance.h (88%) rename LibCarla/source/carla/ros2/{types/TwistWithCovariancePubSubTypes.cpp => fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.cxx} (89%) create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.h rename LibCarla/source/carla/ros2/{types/Vector3.cpp => fastdds/geometry_msgs/msg/Vector3.cxx} (86%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/Vector3.h (94%) rename LibCarla/source/carla/ros2/{types/Vector3PubSubTypes.cpp => fastdds/geometry_msgs/msg/Vector3PubSubTypes.cxx} (89%) rename LibCarla/source/carla/ros2/{types => fastdds/geometry_msgs/msg}/Vector3PubSubTypes.h (76%) rename LibCarla/source/carla/ros2/{types/Odometry.cpp => fastdds/nav_msgs/msg/Odometry.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.h rename LibCarla/source/carla/ros2/{types/OdometryPubSubTypes.cpp => fastdds/nav_msgs/msg/OdometryPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.h rename LibCarla/source/carla/ros2/{types/Clock.cpp => fastdds/rosgraph_msgs/msg/Clock.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.h rename LibCarla/source/carla/ros2/{types/ClockPubSubTypes.cpp => fastdds/rosgraph_msgs/msg/ClockPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.h rename LibCarla/source/carla/ros2/{types/CameraInfo.cpp => fastdds/sensor_msgs/msg/CameraInfo.cxx} (98%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.h rename LibCarla/source/carla/ros2/{types/CameraInfoPubSubTypes.cpp => fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.cc create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.h create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.cc create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.h rename LibCarla/source/carla/ros2/{types/Imu.cpp => fastdds/sensor_msgs/msg/Imu.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.h rename LibCarla/source/carla/ros2/{types/ImuPubSubTypes.cpp => fastdds/sensor_msgs/msg/ImuPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.h rename LibCarla/source/carla/ros2/{types/NavSatFix.cpp => fastdds/sensor_msgs/msg/NavSatFix.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.h rename LibCarla/source/carla/ros2/{types/NavSatFixPubSubTypes.cpp => fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.h rename LibCarla/source/carla/ros2/{types/NavSatStatus.cpp => fastdds/sensor_msgs/msg/NavSatStatus.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.h rename LibCarla/source/carla/ros2/{types/NavSatStatusPubSubTypes.cpp => fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cc create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.h create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cc create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.h rename LibCarla/source/carla/ros2/{types/PointField.cpp => fastdds/sensor_msgs/msg/PointField.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.h rename LibCarla/source/carla/ros2/{types/PointFieldPubSubTypes.cpp => fastdds/sensor_msgs/msg/PointFieldPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.h rename LibCarla/source/carla/ros2/{types/RegionOfInterest.cpp => fastdds/sensor_msgs/msg/RegionOfInterest.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.h rename LibCarla/source/carla/ros2/{types/RegionOfInterestPubSubTypes.cpp => fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.h create mode 100644 LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.cxx rename LibCarla/source/carla/ros2/{types/Float32.h => fastdds/std_msgs/msg/Bool.h} (69%) create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.h rename LibCarla/source/carla/ros2/{types/Float32.cpp => fastdds/std_msgs/msg/Float32.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.h rename LibCarla/source/carla/ros2/{types/Float32PubSubTypes.cpp => fastdds/std_msgs/msg/Float32PubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.h rename LibCarla/source/carla/ros2/{types/Header.cpp => fastdds/std_msgs/msg/Header.cxx} (87%) create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.h rename LibCarla/source/carla/ros2/{types/HeaderPubSubTypes.cpp => fastdds/std_msgs/msg/HeaderPubSubTypes.cxx} (90%) create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.h rename LibCarla/source/carla/ros2/{types/String.cpp => fastdds/std_msgs/msg/String.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.h rename LibCarla/source/carla/ros2/{types/StringPubSubTypes.cpp => fastdds/std_msgs/msg/StringPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.h rename LibCarla/source/carla/ros2/{types/TF2Error.cpp => fastdds/tf2_msgs/msg/TF2Error.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.h rename LibCarla/source/carla/ros2/{types/TF2ErrorPubSubTypes.cpp => fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.h rename LibCarla/source/carla/ros2/{types/TFMessage.cpp => fastdds/tf2_msgs/msg/TFMessage.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.h rename LibCarla/source/carla/ros2/{types/TFMessagePubSubTypes.cpp => fastdds/tf2_msgs/msg/TFMessagePubSubTypes.cxx} (100%) create mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.h delete mode 100644 LibCarla/source/carla/ros2/publishers/BasePublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaCameraPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaCameraPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaClockPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaClockPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaCollisionPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaCollisionPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaDVSPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaDVSPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaDepthCameraPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaGNSSPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaGNSSPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaIMUPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaIMUPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaISCameraPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaLidarPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaLidarPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaNormalsCameraPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaOpticalFlowCameraPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaPointCloudPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaPointCloudPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaRGBCameraPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaRadarPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaRadarPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaSSCameraPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaSemanticLidarPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.h delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaTransformPublisher.cpp delete mode 100644 LibCarla/source/carla/ros2/publishers/CarlaTransformPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/ClockPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/ClockPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/MapPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/MapPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/ObjectPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/ObjectPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/PublisherBase.h create mode 100644 LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h create mode 100644 LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h delete mode 100644 LibCarla/source/carla/ros2/publishers/PublisherImpl.h create mode 100644 LibCarla/source/carla/ros2/publishers/PublisherInterface.h create mode 100644 LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/TransformPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeDepthCameraPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeDepthCameraPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeIMUPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeISCameraPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeISCameraPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeLidarPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeLidarPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeNormalsCameraPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeNormalsCameraPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeOpticalFlowCameraPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeOpticalFlowCameraPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc create mode 100644 LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h create mode 100644 LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.cc create mode 100644 LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.h create mode 100644 LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeRadarPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeRadarPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeSSCameraPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeSSCameraPublisher.h rename LibCarla/source/carla/ros2/publishers/{CarlaSemanticLidarPublisher.cpp => UeSemanticLidarPublisher.cpp} (51%) create mode 100644 LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeV2XPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeV2XPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/VehiclePublisher.h create mode 100644 LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/WalkerPublisher.h create mode 100644 LibCarla/source/carla/ros2/services/DestroyObjectService.cpp create mode 100644 LibCarla/source/carla/ros2/services/DestroyObjectService.h create mode 100644 LibCarla/source/carla/ros2/services/GetAvailableMapsService.cpp create mode 100644 LibCarla/source/carla/ros2/services/GetAvailableMapsService.h create mode 100644 LibCarla/source/carla/ros2/services/GetBlueprintsService.cpp create mode 100644 LibCarla/source/carla/ros2/services/GetBlueprintsService.h create mode 100644 LibCarla/source/carla/ros2/services/LoadMapService.cpp create mode 100644 LibCarla/source/carla/ros2/services/LoadMapService.h create mode 100644 LibCarla/source/carla/ros2/services/ServiceBase.h create mode 100644 LibCarla/source/carla/ros2/services/ServiceInterface.h create mode 100644 LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp create mode 100644 LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.h create mode 100644 LibCarla/source/carla/ros2/services/SpawnObjectService.cpp create mode 100644 LibCarla/source/carla/ros2/services/SpawnObjectService.h create mode 100644 LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.cpp create mode 100644 LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.h delete mode 100644 LibCarla/source/carla/ros2/subscribers/BaseSubscriber.h create mode 100644 LibCarla/source/carla/ros2/subscribers/CarlaControlSubscriber.cpp create mode 100644 LibCarla/source/carla/ros2/subscribers/CarlaControlSubscriber.h delete mode 100644 LibCarla/source/carla/ros2/subscribers/CarlaEgoVehicleControlSubscriber.cpp delete mode 100644 LibCarla/source/carla/ros2/subscribers/CarlaEgoVehicleControlSubscriber.h create mode 100644 LibCarla/source/carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.cpp create mode 100644 LibCarla/source/carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.h create mode 100644 LibCarla/source/carla/ros2/subscribers/SubscriberBase.h create mode 100644 LibCarla/source/carla/ros2/subscribers/SubscriberBaseSynchronizationClient.h delete mode 100644 LibCarla/source/carla/ros2/subscribers/SubscriberImpl.h create mode 100644 LibCarla/source/carla/ros2/subscribers/SubscriberImplBase.h create mode 100644 LibCarla/source/carla/ros2/subscribers/UeV2XCustomSubscriber.cpp create mode 100644 LibCarla/source/carla/ros2/subscribers/UeV2XCustomSubscriber.h create mode 100644 LibCarla/source/carla/ros2/subscribers/VehicleControlSubscriber.cpp create mode 100644 LibCarla/source/carla/ros2/subscribers/VehicleControlSubscriber.h create mode 100644 LibCarla/source/carla/ros2/subscribers/WalkerControlSubscriber.cpp create mode 100644 LibCarla/source/carla/ros2/subscribers/WalkerControlSubscriber.h create mode 100644 LibCarla/source/carla/ros2/types/AcceleratedMovement.h create mode 100644 LibCarla/source/carla/ros2/types/Acceleration.h delete mode 100644 LibCarla/source/carla/ros2/types/AckermannDrive.h delete mode 100644 LibCarla/source/carla/ros2/types/AckermannDrivePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/types/ActorDefinition.h create mode 100644 LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp create mode 100644 LibCarla/source/carla/ros2/types/ActorNameDefinition.h create mode 100644 LibCarla/source/carla/ros2/types/AngularVelocity.h delete mode 100644 LibCarla/source/carla/ros2/types/CameraInfo.h create mode 100644 LibCarla/source/carla/ros2/types/CoordinateSystemTransform.h create mode 100644 LibCarla/source/carla/ros2/types/EpisodeSettings.h delete mode 100644 LibCarla/source/carla/ros2/types/Float32PubSubTypes.h delete mode 100644 LibCarla/source/carla/ros2/types/Image.cpp delete mode 100644 LibCarla/source/carla/ros2/types/Imu.h delete mode 100644 LibCarla/source/carla/ros2/types/NavSatFix.h delete mode 100644 LibCarla/source/carla/ros2/types/NavSatStatusPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/types/Object.h delete mode 100644 LibCarla/source/carla/ros2/types/PointCloud2.cpp create mode 100644 LibCarla/source/carla/ros2/types/Polygon.h delete mode 100644 LibCarla/source/carla/ros2/types/PosePubSubTypes.h delete mode 100644 LibCarla/source/carla/ros2/types/PoseWithCovariancePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/types/PublisherSensorType.h delete mode 100644 LibCarla/source/carla/ros2/types/RegionOfInterest.h delete mode 100644 LibCarla/source/carla/ros2/types/RegionOfInterestPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/types/SensorActorDefinition.h create mode 100644 LibCarla/source/carla/ros2/types/Speed.h create mode 100644 LibCarla/source/carla/ros2/types/Timestamp.h create mode 100644 LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h create mode 100644 LibCarla/source/carla/ros2/types/TrafficSignActorDefinition.h delete mode 100644 LibCarla/source/carla/ros2/types/TransformPubSubTypes.h delete mode 100644 LibCarla/source/carla/ros2/types/TwistPubSubTypes.h delete mode 100644 LibCarla/source/carla/ros2/types/TwistWithCovariancePubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/types/VehicleAckermannControl.h create mode 100644 LibCarla/source/carla/ros2/types/VehicleActorDefinition.h create mode 100644 LibCarla/source/carla/ros2/types/VehicleControl.h create mode 100644 LibCarla/source/carla/ros2/types/WalkerActorDefinition.h create mode 100644 LibCarla/source/carla/ros2/types/WalkerControl.h create mode 100644 LibCarla/source/carla/sensor/data/SerializerVectorAllocator.h delete mode 100644 Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.cpp delete mode 100644 Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.h diff --git a/CHANGELOG.md b/CHANGELOG.md index 17b59846374..58bc63c896f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ * Improved V2X sensor capabilities: send complex custom user-defined data, support V2I sensors not attached to a vehicle * Introduced fine grained ServerSynchronization mechanism: each client decides for its own if it requires synchronization or not and provides its own synchronization window. Be aware: some existing code using master/slave sync mechanism might need rework. See also generate_traffic.py. - + * ROS2Native: Extended functionality and performance of ROS2 support + ## CARLA 0.9.16 * Added NVIDIA Cosmos Transfer1 integration diff --git a/LibCarla/cmake/fast_dds/CMakeLists.txt b/LibCarla/cmake/fast_dds/CMakeLists.txt index 366549eefaf..79d44a7d13f 100644 --- a/LibCarla/cmake/fast_dds/CMakeLists.txt +++ b/LibCarla/cmake/fast_dds/CMakeLists.txt @@ -1,60 +1,97 @@ cmake_minimum_required(VERSION 3.5.1) project(libcarla_fastdds) -# Install headers. - -file(GLOB libcarla_carla_fastdds_headers - "${libcarla_source_path}/carla/ros2/*.h" - "${libcarla_source_path}/carla/ros2/publishers/*.h" - "${libcarla_source_path}/carla/ros2/subscribers/*.h" - "${libcarla_source_path}/carla/ros2/listeners/*.h" - "${libcarla_source_path}/carla/ros2/types/*.h" +# Install the required public interface headers +foreach(dir "" "types/" ) + file(GLOB libcarla_carla_ros2_public_headers + "${libcarla_source_path}/carla/ros2/${dir}*.h" ) -install(FILES ${libcarla_carla_fastdds_headers} DESTINATION include/carla/ros2) - + install(FILES ${libcarla_carla_ros2_public_headers} DESTINATION include/carla/ros2/${dir}) +endforeach() + +file(GLOB subdirs RELATIVE "${libcarla_source_path}/carla/ros2/fastdds" "${libcarla_source_path}/carla/ros2/fastdds/*") +foreach(typedir "msg" "srv") + foreach(dir ${subdirs}) + if(IS_DIRECTORY "${libcarla_source_path}/carla/ros2/fastdds/${dir}/${typedir}") + file(GLOB libcarla_carla_ros2_types_${dir}_headers + "${libcarla_source_path}/carla/ros2/fastdds/${dir}/${typedir}/*.h" + "${libcarla_source_path}/carla/ros2/fastdds/${dir}/${typedir}/*.hpp" + "${libcarla_source_path}/carla/ros2/fastdds/${dir}/${typedir}/*.ipp" + ) + install(FILES ${libcarla_carla_ros2_types_${dir}_headers} DESTINATION include/carla/ros2/ros_types/${dir}/${typedir}/) + endif() + endforeach() +endforeach() + +# Install dependencies for UE4 build file(GLOB fast_dds_dependencies "${FASTDDS_LIB_PATH}/*.a") install(FILES ${fast_dds_dependencies} DESTINATION lib) - - -file(GLOB libcarla_fastdds_sources - "${libcarla_source_path}/carla/ros2/*.cpp" - "${libcarla_source_path}/carla/ros2/publishers/*.cpp" - "${libcarla_source_path}/carla/ros2/subscribers/*.cpp" - "${libcarla_source_path}/carla/ros2/listeners/*.cpp" - "${libcarla_source_path}/carla/ros2/types/*.cpp") +file(GLOB fast_dds_include_dirs "${FASTDDS_INCLUDE_PATH}/*") +foreach(fast_dds_include_dir ${fast_dds_include_dirs}) + install(DIRECTORY "${fast_dds_include_dir}" DESTINATION include) +endforeach() + +# Collect the sources +foreach(ros2_dir + "/" + "fastdds/carla/ros2/impl/" + "publishers/" + "services/" + "subscribers/" + "types/") + + file(GLOB sources "${libcarla_source_path}/carla/ros2/${ros2_dir}*.cpp") + list(APPEND libcarla_fastdds_sources ${sources}) +endforeach() + +file(GLOB msg_sources "${libcarla_source_path}/carla/ros2/fastdds/*/msg/*.cxx") +list(APPEND libcarla_fastdds_sources ${msg_sources}) + +file(GLOB srv_sources "${libcarla_source_path}/carla/ros2/fastdds/*/srv/*.cxx") +list(APPEND libcarla_fastdds_sources ${srv_sources}) # ============================================================================== # Create targets for debug and release in the same build type. # ============================================================================== +set(libcarla_fastdds_include_directories + # first the fastdds local folder allowing potential overrides of header files + "${libcarla_source_path}/carla/ros2/fastdds" + "${BOOST_INCLUDE_PATH}" + "${RPCLIB_INCLUDE_PATH}" + "${FASTDDS_INCLUDE_PATH}" + "${libcarla_source_path}/carla/ros2" +) if (LIBCARLA_BUILD_RELEASE) - add_library(carla_fastdds STATIC ${libcarla_fastdds_sources}) - - target_compile_options(carla_fastdds PRIVATE -fexceptions) - + add_library(carla_fastdds STATIC + ${libcarla_fastdds_sources} + ) target_include_directories(carla_fastdds SYSTEM PRIVATE - "${BOOST_INCLUDE_PATH}" - "${RPCLIB_INCLUDE_PATH}") - - target_include_directories(carla_fastdds PRIVATE "${FASTDDS_INCLUDE_PATH}") - target_include_directories(carla_fastdds PRIVATE "${libcarla_source_path}/carla/ros2") - target_link_libraries(carla_fastdds fastrtps fastcdr "${FAST_DDS_LIBRARIES}") + ${libcarla_fastdds_include_directories} + ) + target_link_directories(carla_fastdds PRIVATE + ${FASTDDS_LIB_PATH} + ) install(TARGETS carla_fastdds DESTINATION lib) - set_target_properties(carla_fastdds PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}") - + if(NOT WIN32) + set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE) + endif() + set_target_properties(carla_fastdds PROPERTIES COMPILE_FLAGS + "-fexceptions ${CMAKE_CXX_FLAGS_RELEASE}") + target_compile_definitions(carla_fastdds PUBLIC + WITH_ROS2 CARLA_SERVER_BUILD) endif() if (LIBCARLA_BUILD_DEBUG) - - add_library(carla_fastdds_debug STATIC ${libcarla_fastdds_sources}) - - target_compile_options(carla_fastdds_debug PRIVATE -fexceptions) - + add_library(carla_fastdds_debug STATIC + ${libcarla_fastdds_sources} + ) target_include_directories(carla_fastdds_debug SYSTEM PRIVATE - "${BOOST_INCLUDE_PATH}" - "${RPCLIB_INCLUDE_PATH}") + "${libcarla_fastdds_include_directories}" + ) install(TARGETS carla_fastdds_debug DESTINATION lib) - set_target_properties(carla_fastdds_debug PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}") - target_compile_definitions(carla_fastdds_debug PUBLIC -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING) - + set_target_properties(carla_fastdds_debug PROPERTIES COMPILE_FLAGS + "-fexceptions ${CMAKE_CXX_FLAGS_DEBUG}") + target_compile_definitions(carla_fastdds_debug PUBLIC + WITH_ROS2 CARLA_SERVER_BUILD BOOST_ASIO_ENABLE_BUFFER_DEBUGGING) endif() diff --git a/LibCarla/cmake/server/CMakeLists.txt b/LibCarla/cmake/server/CMakeLists.txt index ee8e2c4edfd..72fb893e2c6 100644 --- a/LibCarla/cmake/server/CMakeLists.txt +++ b/LibCarla/cmake/server/CMakeLists.txt @@ -23,8 +23,7 @@ foreach(dir "" "rpc/" "sensor/" "sensor/data/" "sensor/s11n/" "streaming/" "streaming/detail/" "streaming/detail/tcp/" "streaming/low_level/" - "multigpu/" - "ros2/") + "multigpu/") file(GLOB headers "${libcarla_source_path}/carla/${dir}*.h") install(FILES ${headers} DESTINATION include/carla/${dir}) diff --git a/LibCarla/source/carla/Buffer.cpp b/LibCarla/source/carla/Buffer.cpp index acb79114029..4dedc2badad 100644 --- a/LibCarla/source/carla/Buffer.cpp +++ b/LibCarla/source/carla/Buffer.cpp @@ -7,6 +7,7 @@ namespace carla { void Buffer::ReuseThisBuffer() { auto pool = _parent_pool.lock(); if (pool != nullptr) { + log_debug("Buffer[", static_cast(_data.get()), ":", _size, "]::ReuseThisBuffer() returning buffer to pool:", pool.get()); pool->Push(std::move(*this)); } } diff --git a/LibCarla/source/carla/Buffer.h b/LibCarla/source/carla/Buffer.h index 015ac51139f..ed6baf750d1 100644 --- a/LibCarla/source/carla/Buffer.h +++ b/LibCarla/source/carla/Buffer.h @@ -251,9 +251,9 @@ namespace carla { /// allocated. void reset(size_type size) { if (_capacity < size) { - log_debug("allocating buffer of", size, "bytes"); _data = std::make_unique(size); _capacity = size; + log_debug("Buffer[", static_cast(_data.get()), ":", size, "]::reset() Allocated buffer data (old size: ", _size, ")"); } _size = size; } diff --git a/LibCarla/source/carla/ros2/ROS2.cpp b/LibCarla/source/carla/ros2/ROS2.cpp index b4dd6d3df54..7c25f959cf6 100644 --- a/LibCarla/source/carla/ros2/ROS2.cpp +++ b/LibCarla/source/carla/ros2/ROS2.cpp @@ -9,446 +9,501 @@ #include "carla/Logging.h" #include "carla/geom/GeoLocation.h" #include "carla/geom/Vector3D.h" +#include "carla/ros2/ROS2NameRegistry.h" +#include "carla/ros2/ROS2Session.h" +#include "carla/sensor/SensorRegistry.h" #include "carla/sensor/data/DVSEvent.h" +#include "carla/sensor/data/Image.h" #include "carla/sensor/data/LidarData.h" -#include "carla/sensor/data/SemanticLidarData.h" #include "carla/sensor/data/RadarData.h" -#include "carla/sensor/data/Image.h" -#include "carla/sensor/s11n/ImageSerializer.h" +#include "carla/sensor/data/SemanticLidarData.h" #include "carla/sensor/s11n/SensorHeaderSerializer.h" -#include "publishers/CarlaCameraPublisher.h" -#include "publishers/CarlaClockPublisher.h" -#include "publishers/CarlaCollisionPublisher.h" -#include "publishers/CarlaDepthCameraPublisher.h" -#include "publishers/CarlaDVSPublisher.h" -#include "publishers/CarlaGNSSPublisher.h" -#include "publishers/CarlaIMUPublisher.h" -#include "publishers/CarlaISCameraPublisher.h" -#include "publishers/CarlaLidarPublisher.h" -#include "publishers/CarlaNormalsCameraPublisher.h" -#include "publishers/CarlaOpticalFlowCameraPublisher.h" -#include "publishers/CarlaRadarPublisher.h" -#include "publishers/CarlaRGBCameraPublisher.h" -#include "publishers/CarlaSemanticLidarPublisher.h" -#include "publishers/CarlaSSCameraPublisher.h" -#include "publishers/CarlaTransformPublisher.h" - -#include "subscribers/AckermannControlSubscriber.h" -#include "subscribers/CarlaEgoVehicleControlSubscriber.h" +#include "carla/ros2/publishers/CarlaActorListPublisher.h" +#include "carla/ros2/publishers/TransformPublisher.h" +#include "carla/ros2/publishers/UeCollisionPublisher.h" +#include "carla/ros2/publishers/UeDVSCameraPublisher.h" +#include "carla/ros2/publishers/UeDepthCameraPublisher.h" +#include "carla/ros2/publishers/UeGNSSPublisher.h" +#include "carla/ros2/publishers/UeIMUPublisher.h" +#include "carla/ros2/publishers/UeISCameraPublisher.h" +#include "carla/ros2/publishers/UeLidarPublisher.h" +#include "carla/ros2/publishers/UeNormalsCameraPublisher.h" +#include "carla/ros2/publishers/UeOpticalFlowCameraPublisher.h" +#include "carla/ros2/publishers/UeRGBCameraPublisher.h" +#include "carla/ros2/publishers/UeRadarPublisher.h" +#include "carla/ros2/publishers/UeSSCameraPublisher.h" +#include "carla/ros2/publishers/UeSemanticLidarPublisher.h" +#include "carla/ros2/publishers/UeWorldPublisher.h" +#include "carla/ros2/publishers/UeV2XPublisher.h" +#include "carla/ros2/publishers/UeV2XCustomPublisher.h" +#include "carla/ros2/publishers/VehiclePublisher.h" + +#include "carla/ros2/services/DestroyObjectService.h" +#include "carla/ros2/services/GetAvailableMapsService.h" +#include "carla/ros2/services/GetBlueprintsService.h" +#include "carla/ros2/services/LoadMapService.h" +#include "carla/ros2/services/SetEpisodeSettingsService.h" +#include "carla/ros2/services/SpawnObjectService.h" + +#include "carla/ros2/subscribers/AckermannControlSubscriber.h" +#include "carla/ros2/subscribers/VehicleControlSubscriber.h" + +#include "carla/ros2/types/Acceleration.h" +#include "carla/ros2/types/AngularVelocity.h" +#include "carla/ros2/types/Quaternion.h" +#include "carla/ros2/types/Speed.h" +#include "carla/ros2/types/VehicleAckermannControl.h" +#include "carla/ros2/types/VehicleControl.h" #include namespace carla { namespace ros2 { -// static fields -std::shared_ptr ROS2::_instance; - -// list of sensors (should be equal to the list of SensorsRegistry -enum ESensors { - CollisionSensor, - DepthCamera, - NormalsCamera, - DVSCamera, - GnssSensor, - InertialMeasurementUnit, - LaneInvasionSensor, - ObstacleDetectionSensor, - OpticalFlowCamera, - Radar, - RayCastSemanticLidar, - RayCastLidar, - RssSensor, - SceneCaptureCamera, - SemanticSegmentationCamera, - InstanceSegmentationCamera, - WorldObserver, - CameraGBufferUint8, - CameraGBufferFloat, - HSSLidar -}; - -void ROS2::Enable(bool enable) { - _clock_publisher = std::make_shared(); - - _enabled = enable; -} - -void ROS2::SetFrame(uint64_t frame) { - _frame = frame; - - for (auto& element : _subscribers) { - auto actor = element.first; - auto subscriber = element.second; - auto callback = _actor_callbacks.find(actor)->second; - - subscriber->ProcessMessages(callback); +// singleton handling +std::shared_ptr ROS2::GetInstance() { + static std::shared_ptr _instance{nullptr}; + if (_instance == nullptr) { + _instance = std::shared_ptr(new ROS2()); } + return _instance; } -void ROS2::SetTimestamp(double timestamp) { - double integral; - const double fractional = modf(timestamp, &integral); - const double multiplier = 1000000000.0; - _seconds = static_cast(integral); - _nanoseconds = static_cast(fractional * multiplier); - - _clock_publisher->Write(_seconds, _nanoseconds); - _clock_publisher->Publish(); +void ROS2::Enable(carla::rpc::RpcServerInterface *carla_server, + carla::streaming::detail::stream_id_type const world_observer_stream_id, + TopicVisibilityDefaultMode topic_visibility_default_mode) { + _enabled = true; + _topic_visibility_default_mode = topic_visibility_default_mode; + _carla_server = carla_server; + _name_registry = std::make_shared(); + _dispatcher = _carla_server->GetDispatcher(); + _domain_participant_impl = std::make_shared(); + // take basic actor role definition as this is acting as naming parent of others with /carla/world + auto world_observer_actor_definition = carla::ros2::types::ActorNameDefinition::CreateFromRoleName("/", true); + _world_observer_sensor_actor_definition = std::make_shared( + *world_observer_actor_definition, + carla::ros2::types::PublisherSensorType::WorldObserver, + world_observer_stream_id); + log_info("ROS2 enabled"); } -void ROS2::RegisterActor(void *actor, std::string ros_name, std::string frame_id, bool publish_tf) { - _registered_actors.insert({actor, ros_name}); - _frame_ids.insert({actor, frame_id}); - _tfs.insert({actor, publish_tf}); -} +void ROS2::NotifyInitGame() { + log_info("ROS2 NotifyInitGame"); -void ROS2::UnregisterActor(void *actor) { - _registered_actors.erase(actor); - _frame_ids.erase(actor); - _actor_parent_map.erase(actor); - _tfs.erase(actor); -} + _carla_sensor_actor_list_publisher = std::make_shared("sensor_list"); + _carla_sensor_actor_list_publisher->Init(_domain_participant_impl); -void ROS2::RegisterActorParent(void *actor, void *parent) { - _actor_parent_map.insert({actor, parent}); + // The world is crucial and has to be instanciated immediately + if (AddSensorUe(_world_observer_sensor_actor_definition)) { + ProcessDataFromUeSensorPreAction(); + } + if (_world_publisher != nullptr) { + _transform_publisher = _world_publisher->GetTransformPublisher(); + } } -void ROS2::RegisterSensor(void *actor, std::string ros_name, std::string frame_id, bool publish_tf) { - RegisterActor(actor, ros_name, frame_id, publish_tf); +void ROS2::NotifyBeginEpisode() { + log_info("ROS2 NotifyBeginEpisode"); + + auto spawn_object_service = std::make_shared( + *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("spawn_object")); + spawn_object_service->Init(_domain_participant_impl); + _services.push_back(spawn_object_service); + + auto destroy_object_service = std::make_shared( + *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("destroy_object")); + destroy_object_service->Init(_domain_participant_impl); + _services.push_back(destroy_object_service); + + auto get_blueprints_service = std::make_shared( + *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("get_blueprints")); + get_blueprints_service->Init(_domain_participant_impl); + _services.push_back(get_blueprints_service); + + auto get_available_maps_service = std::make_shared( + *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("get_available_maps")); + get_available_maps_service->Init(_domain_participant_impl); + _services.push_back(get_available_maps_service); + + auto load_map_service = std::make_shared( + *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("load_map")); + load_map_service->Init(_domain_participant_impl); + _services.push_back(load_map_service); + + auto set_epsisode_settings_service = std::make_shared( + *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("set_episode_settings")); + set_epsisode_settings_service->Init(_domain_participant_impl); + _services.push_back(set_epsisode_settings_service); } -void ROS2::UnregisterSensor(void *actor) { - UnregisterActor(actor); - _publishers.erase(actor); +void ROS2::NotifyEndEpisode() { + log_info("ROS2 NotifyEndEpisode"); + _services.clear(); + _ue_sensors.clear(); + _name_registry->Clear(); } -void ROS2::RegisterVehicle(void *actor, std::string ros_name, std::string frame_id, ActorCallback callback) { - RegisterActor(actor, ros_name, frame_id); - - // Register actor callback - _actor_callbacks.insert({actor, std::move(callback)}); - - // Register subscribers - auto base_topic_name = GetActorBaseTopicName(actor); - - auto _vehicle_control_subscriber = std::make_shared(actor, base_topic_name, frame_id); - _subscribers.insert({actor, _vehicle_control_subscriber}); - - auto _ackermann_control_subscriber = std::make_shared(actor, base_topic_name, frame_id); - _subscribers.insert({actor, _ackermann_control_subscriber}); - +void ROS2::NotifyEndGame() { + log_info("ROS2 NotifyEndGame"); + NotifyEndEpisode(); + _world_publisher.reset(); + _transform_publisher.reset(); + _carla_sensor_actor_list_publisher.reset(); } -void ROS2::UnregisterVehicle(void *actor) { - UnregisterActor(actor); - _actor_callbacks.erase(actor); - _subscribers.erase(actor); +void ROS2::Disable() { + NotifyEndEpisode(); + NotifyEndGame(); + _carla_sensor_actor_list_publisher.reset(); + _world_observer_sensor_actor_definition.reset(); + _dispatcher.reset(); + _domain_participant_impl.reset(); + _name_registry.reset(); + _enabled = false; + log_info("ROS2 disabled"); } -std::string ROS2::GetActorRosName(void *actor) { - auto it = _registered_actors.find(actor); - return it != _registered_actors.end() ? it->second : ""; +void ROS2::AddVehicleUe(std::shared_ptr vehicle_actor_definition, + carla::ros2::types::VehicleControlCallback vehicle_control_callback, + carla::ros2::types::VehicleAckermannControlCallback vehicle_ackermann_control_callback, + carla::ros2::types::ActorSetTransformCallback vehicle_set_transform_callback) { + log_debug("ROS2::AddVehicleUe(", std::to_string(*vehicle_actor_definition), ")"); + _world_publisher->AddVehicleUe(vehicle_actor_definition, vehicle_control_callback, + vehicle_ackermann_control_callback, vehicle_set_transform_callback); } -std::string ROS2::GetActorBaseTopicName(void *actor) { - auto it = _actor_parent_map.find(actor); - if (it != _actor_parent_map.end()) { - return GetActorBaseTopicName(it->second) + "/" + GetActorRosName(actor); - } else { - return "rt/carla/" + GetActorRosName(actor); - } +void ROS2::AddWalkerUe(std::shared_ptr walker_actor_definition, + carla::ros2::types::WalkerControlCallback walker_control_callback) { + log_debug("ROS2::AddWalkerUe(", std::to_string(*walker_actor_definition), ")"); + _world_publisher->AddWalkerUe(walker_actor_definition, walker_control_callback); } -std::string ROS2::GetFrameId(void *actor) { - auto it = _frame_ids.find(actor); - return it != _frame_ids.end() ? it->second : ""; +void ROS2::AddTrafficLightUe( + std::shared_ptr traffic_light_actor_definition) { + log_debug("ROS2::AddTrafficLightUe(", std::to_string(*traffic_light_actor_definition), ")"); + _world_publisher->AddTrafficLightUe(traffic_light_actor_definition); } -std::string ROS2::GetParentFrameId(void *actor) { - auto it = _actor_parent_map.find(actor); - if (it != _actor_parent_map.end()) { - return GetFrameId(it->second); - } else { - return "map"; - } +void ROS2::AddTrafficSignUe( + std::shared_ptr traffic_sign_actor_definition) { + log_debug("ROS2::AddTrafficSignUe(", std::to_string(*traffic_sign_actor_definition), ")"); + _world_publisher->AddTrafficSignUe(traffic_sign_actor_definition); } -std::shared_ptr ROS2::GetOrCreateTransformPublisher(void *actor) { - - auto it = _tfs.find(actor); - if (it == _tfs.end() || it->second == false) { +ROS2::UeSensor* ROS2::AddSensorUeInternal(std::shared_ptr sensor_actor_definition) { + auto insert_result = _ue_sensors.insert({sensor_actor_definition->stream_id, UeSensor(sensor_actor_definition)}); + if (!insert_result.second) { + log_warning("ROS2::AddSensorUe(", std::to_string(*sensor_actor_definition), + "): Sensor already_registered. Ignoring"); return nullptr; } - - // Check if the transform publisher is already created - auto itp = _tf_publishers.find(actor); - if (itp != _tf_publishers.end()) { - return itp->second; + _ue_sensors_changed = true; + return &insert_result.first->second; +} + +bool ROS2::AddSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback) { + auto ue_sensor = AddSensorUeInternal(sensor_actor_definition); + if ( ue_sensor != nullptr ) { + ue_sensor->actor_set_transform_callback = actor_set_transform_callback; + return true; } - - auto tf_publisher = std::make_shared(); - _tf_publishers.insert({actor, tf_publisher}); - return tf_publisher; + return false; } -std::shared_ptr ROS2::GetOrCreateSensor(int type, void* actor) { - - // Check if the sensor publisher is already created - auto it = _publishers.find(actor); - if (it != _publishers.end()) { - return it->second; +bool ROS2::AddV2XCustomSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback) { + auto ue_sensor = AddSensorUeInternal(sensor_actor_definition); + if ( ue_sensor != nullptr ) { + ue_sensor->v2x_custom_send_callback = v2x_custom_send_callback; + return true; } + return false; +} - auto create_and_register = [&](auto publisher) { - _publishers.insert({actor, publisher}); - return publisher; - }; - - std::string topic_name = GetActorBaseTopicName(actor); - std::string frame_id = GetFrameId(actor); - - switch(type) { - case ESensors::CollisionSensor: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::DepthCamera: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::NormalsCamera: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::DVSCamera: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::GnssSensor: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::InertialMeasurementUnit: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::OpticalFlowCamera: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::Radar: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::RayCastSemanticLidar: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::RayCastLidar: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::SceneCaptureCamera: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::SemanticSegmentationCamera: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::InstanceSegmentationCamera: - return create_and_register(std::make_shared(topic_name, frame_id)); - case ESensors::LaneInvasionSensor: - case ESensors::ObstacleDetectionSensor: - case ESensors::RssSensor: - case ESensors::WorldObserver: - case ESensors::CameraGBufferUint8: - case ESensors::CameraGBufferFloat: - return nullptr; - case ESensors::HSSLidar: - return create_and_register(std::make_shared(topic_name, frame_id)); +void ROS2::AttachActors(ActorId const child, ActorId const parent) { + log_debug("ROS2::AttachActors[", child, "]: parent=", parent); + _name_registry->AttachActors(child, parent); + for (auto iter = _ue_sensors.begin(); iter != _ue_sensors.end(); ++iter) { + if (iter->second.sensor_actor_definition->id == child) { + UeSensor &sensor = iter->second; + if (sensor.publisher) { + log_error("ROS2::AttachActors[", std::to_string(*sensor.sensor_actor_definition), + "]: Sensor attached to parent ", parent, + ". Sensor has already a running publisher with base topic name ", sensor.publisher->get_topic_name(), + " has to be destroyed due to re-attachment"); + sensor.publisher.reset(); + } + _ue_sensors_changed = true; + break; + } } } -void ROS2::ProcessDataFromCamera( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - const carla::SharedBufferView buffer, - void *actor) { - - auto base_publisher = GetOrCreateSensor(sensor_type, actor); - auto sensor_publisher = std::dynamic_pointer_cast(base_publisher); - auto transform_publisher = GetOrCreateTransformPublisher(actor); - - const carla::sensor::s11n::ImageSerializer::ImageHeader *header = - reinterpret_cast(buffer->data()); - if (!header) - return; - - sensor_publisher->WriteCameraInfo(_seconds, _nanoseconds, 0, 0, header->height, header->width, header->fov_angle, true); - sensor_publisher->WriteImage(_seconds, _nanoseconds, header->height, header->width, (const uint8_t*) (buffer->data() + carla::sensor::s11n::ImageSerializer::header_offset)); - sensor_publisher->Publish(); - - if (transform_publisher) { - transform_publisher->Write(_seconds, _nanoseconds, GetParentFrameId(actor), GetFrameId(actor), sensor_transform); - transform_publisher->Publish(); +void ROS2::CreateSensorUePublisher(UeSensor &sensor) { + // Create the respective sensor publisher + switch (sensor.sensor_actor_definition->sensor_type) { + case types::PublisherSensorType::CollisionSensor: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::DepthCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::NormalsCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::DVSCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::GnssSensor: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::InertialMeasurementUnit: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::OpticalFlowCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::Radar: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::RayCastSemanticLidar: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::RayCastLidar: + case types::PublisherSensorType::HSSLidar: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::SceneCaptureCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher, sensor.actor_set_transform_callback)); + } break; + case types::PublisherSensorType::SemanticSegmentationCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::InstanceSegmentationCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::WorldObserver: + { + _world_publisher = + std::make_shared(*_carla_server, _name_registry, sensor.sensor_actor_definition); + sensor.publisher = std::static_pointer_cast(_world_publisher); + } break; + case types::PublisherSensorType::V2X: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::V2XCustom: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, sensor.v2x_custom_send_callback, _transform_publisher)); + } break; + case types::PublisherSensorType::RssSensor: + // no server side interface to be implemented: maybe move client based implementation from client to the sensor + // folder for those? in each case should be implemented in a form that the actual calcuations are only performed + // if anyone listening to the topic + case types::PublisherSensorType::CameraGBufferUint8: + case types::PublisherSensorType::CameraGBufferFloat: + case types::PublisherSensorType::LaneInvasionSensor: + case types::PublisherSensorType::ObstacleDetectionSensor: + default: { + sensor.publisher_expected = false; + log_error("ROS2::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + "]: Not a UE sensor or no publisher implemented yet"); + } + } + if (sensor.publisher != nullptr) { + if (!sensor.publisher->Init(_domain_participant_impl)) { + log_error("ROS2::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + "]: Failed to init publisher"); + } else { + log_debug("ROS2::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + "]: Publisher initialized"); + } } } -void ROS2::ProcessDataFromGNSS( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - const carla::geom::GeoLocation &data, - void *actor) { - - auto base_publisher = GetOrCreateSensor(ESensors::GnssSensor, actor); - auto sensor_publisher = std::dynamic_pointer_cast(base_publisher); - auto transform_publisher = GetOrCreateTransformPublisher(actor); - - sensor_publisher->Write(_seconds, _nanoseconds, data); - sensor_publisher->Publish(); - - if (transform_publisher) { - transform_publisher->Write(_seconds, _nanoseconds, GetParentFrameId(actor), GetFrameId(actor), sensor_transform); - transform_publisher->Publish(); +void ROS2::RemoveActor(ActorId const actor) { + for (auto iter = _ue_sensors.begin(); iter != _ue_sensors.end(); /*no update of iter*/) { + if (iter->second.sensor_actor_definition->id == actor) { + log_debug("ROS2::RemoveSensorUe(", std::to_string(*iter->second.sensor_actor_definition), ")"); + iter = _ue_sensors.erase(iter); + _ue_sensors_changed = true; + } else { + ++iter; + } } + _world_publisher->RemoveActor(actor); } -void ROS2::ProcessDataFromIMU( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - carla::geom::Vector3D accelerometer, - carla::geom::Vector3D gyroscope, - float compass, - void *actor) { - - auto base_publisher = GetOrCreateSensor(ESensors::InertialMeasurementUnit, actor); - auto sensor_publisher = std::dynamic_pointer_cast(base_publisher); - auto transform_publisher = GetOrCreateTransformPublisher(actor); - - sensor_publisher->Write(_seconds, _nanoseconds, accelerometer, gyroscope, compass); - sensor_publisher->Publish(); - - if (transform_publisher) { - transform_publisher->Write(_seconds, _nanoseconds, GetParentFrameId(actor), GetFrameId(actor), sensor_transform); - transform_publisher->Publish(); +void ROS2::ProcessMessages() { + for (auto service : _services) { + service->CheckRequest(); } + _world_publisher->ProcessMessages(); } -void ROS2::ProcessDataFromDVS( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - const carla::SharedBufferView buffer, - void *actor) { - - auto base_publisher = GetOrCreateSensor(ESensors::DVSCamera, actor); - auto sensor_publisher = std::dynamic_pointer_cast(base_publisher); - auto transform_publisher = GetOrCreateTransformPublisher(actor); - - const carla::sensor::s11n::ImageSerializer::ImageHeader *header = - reinterpret_cast(buffer->data()); - if (!header) - return; - - const size_t elements = (buffer->size() - carla::sensor::s11n::ImageSerializer::header_offset) / sizeof(carla::sensor::data::DVSEvent); - const size_t im_width = header->width; - const size_t im_height = header->height; - - sensor_publisher->WriteCameraInfo(_seconds, _nanoseconds, 0, 0, im_height, im_width, header->fov_angle, true); - sensor_publisher->WriteImage(_seconds, _nanoseconds, elements, header->height, header->width, (const uint8_t*) (buffer->data() + carla::sensor::s11n::ImageSerializer::header_offset)); - sensor_publisher->WritePointCloud(_seconds, _nanoseconds, 1, elements, (uint8_t*) (buffer->data() + carla::sensor::s11n::ImageSerializer::header_offset)); - sensor_publisher->Publish(); - - if (transform_publisher) { - transform_publisher->Write(_seconds, _nanoseconds, GetParentFrameId(actor), GetFrameId(actor), sensor_transform); - transform_publisher->Publish(); +void ROS2::ProcessDataFromUeSensorPreAction() { + for (auto &ue_sensor : _ue_sensors) { + if (ue_sensor.second.publisher_expected && (ue_sensor.second.publisher == nullptr)) { + CreateSensorUePublisher(ue_sensor.second); + } + if (ue_sensor.second.publisher != nullptr) { + if (ue_sensor.second.publisher->SubscribersConnected() && ue_sensor.second.session == nullptr) { + ue_sensor.second.session = std::make_shared(ue_sensor.first); + log_debug("ROS2::ProcessDataFromUeSensorPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition), + "]: Registering session"); + _dispatcher->RegisterSession(ue_sensor.second.session); + } else if (!ue_sensor.second.publisher->SubscribersConnected() && ue_sensor.second.session != nullptr) { + log_debug("ROS2::ProcessDataFromUeSensorPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition), + "]: Deregistering session"); + _dispatcher->DeregisterSession(ue_sensor.second.session); + ue_sensor.second.session.reset(); + } + } } -} -void ROS2::ProcessDataFromLidar( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - carla::sensor::data::LidarData &data, - void *actor) { - - auto base_publisher = GetOrCreateSensor(ESensors::RayCastLidar, actor); - auto sensor_publisher = std::dynamic_pointer_cast(base_publisher); - auto transform_publisher = GetOrCreateTransformPublisher(actor); - - // The lidar returns a flat list of floats rather than structured detection points. - // Each lidar detection consists of 4 floats: x, y, z, and intensity. - // Divide the total number of floats by 4 to get the number of lidar detections. - size_t width = data._points.size() / 4; - size_t height = 1; - sensor_publisher->WritePointCloud(_seconds, _nanoseconds, height, width, (uint8_t*)data._points.data()); - sensor_publisher->Publish(); - - if (transform_publisher) { - transform_publisher->Write(_seconds, _nanoseconds, GetParentFrameId(actor), GetFrameId(actor), sensor_transform); - transform_publisher->Publish(); + for (auto &ue_sensor : _ue_sensors) { + if ( (ue_sensor.second.publisher != nullptr) ) { + ue_sensor.second.publisher->UpdateSensorDataPreAction(); + } } -} -void ROS2::ProcessDataFromSemanticLidar( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - carla::sensor::data::SemanticLidarData &data, - void *actor) { - auto base_publisher = GetOrCreateSensor(ESensors::RayCastSemanticLidar, actor); - auto sensor_publisher = std::dynamic_pointer_cast(base_publisher); - auto transform_publisher = GetOrCreateTransformPublisher(actor); + if (_ue_sensors_changed) { + _ue_sensors_changed = false; + carla_msgs::msg::CarlaActorList actor_list; + for (auto &ue_sensor : _ue_sensors) { + actor_list.actors().push_back(ue_sensor.second.sensor_actor_definition->carla_actor_info(_name_registry)); + } + _carla_sensor_actor_list_publisher->UpdateCarlaActorList(actor_list); + _carla_sensor_actor_list_publisher->Publish(); + } - size_t width = data._ser_points.size(); - size_t height = 1; - sensor_publisher->WritePointCloud(_seconds, _nanoseconds, height, width, (uint8_t*)data._ser_points.data()); - sensor_publisher->Publish(); - if (transform_publisher) { - transform_publisher->Write(_seconds, _nanoseconds, GetParentFrameId(actor), GetFrameId(actor), sensor_transform); - transform_publisher->Publish(); - } + _world_publisher->UpdateSensorDataPreAction(); } -void ROS2::ProcessDataFromRadar( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - const carla::sensor::data::RadarData &data, - void *actor) { - - auto base_publisher = GetOrCreateSensor(ESensors::Radar, actor); - auto sensor_publisher = std::dynamic_pointer_cast(base_publisher); - auto transform_publisher = GetOrCreateTransformPublisher(actor); - size_t width = data.GetDetectionCount(); - size_t height = 1; - sensor_publisher->WritePointCloud(_seconds, _nanoseconds, height, width, (uint8_t*)data._detections.data()); - sensor_publisher->Publish(); +void ROS2::ProcessDataFromUeSensor(carla::streaming::detail::stream_id_type const stream_id, + std::shared_ptr message) { + auto ue_sensor = _ue_sensors.find(stream_id); + if (ue_sensor != _ue_sensors.end()) { + auto const &sensor_actor_definition = ue_sensor->second.sensor_actor_definition; + + auto buffer_list_view = message->GetBufferViewSequence(); + // currently we only support sensor header + data buffer + DEBUG_ASSERT_EQ(buffer_list_view.size(), 2u); + carla::SharedBufferView sensor_header_view = *buffer_list_view.begin(); + + auto sensor_header = std::shared_ptr( + sensor_header_view, reinterpret_cast( + sensor_header_view.get()->data())); + + if (ue_sensor->second.publisher) { + if ( ue_sensor->second.publisher->is_enabled_for_ros() ) { + auto data_view_iter = buffer_list_view.begin(); + data_view_iter++; + if (data_view_iter != buffer_list_view.end()) { + ue_sensor->second.publisher->UpdateTransform(sensor_header); + ue_sensor->second.publisher->UpdateSensorData(sensor_header, *data_view_iter); + ue_sensor->second.publisher->Publish(); + } + log_debug("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", + std::to_string(*sensor_actor_definition), " Processed."); + + } else { + log_debug("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", + std::to_string(*sensor_actor_definition), std::to_string(*ue_sensor->second.publisher->_actor_name_definition), " not enabled for ROS. Dropping data."); + } + } else { + log_error("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", + std::to_string(*sensor_actor_definition), " not registered. Dropping data."); + } - if (transform_publisher) { - transform_publisher->Write(_seconds, _nanoseconds, GetParentFrameId(actor), GetFrameId(actor), sensor_transform); - transform_publisher->Publish(); + } else { + log_error("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", std::to_string(stream_id), + " not registered. Dropping data."); } } -void ROS2::ProcessDataFromObstacleDetection( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - AActor *first_ctor, - AActor *second_actor, - float distance, - void *actor) { - log_info("Sensor ObstacleDetector to ROS data: frame.", _frame, "sensor.", sensor_type, "distance.", distance); +void ROS2::ProcessDataFromUeSensorPostAction() { + for (auto &ue_sensor : _ue_sensors) { + if ( (ue_sensor.second.publisher != nullptr) ) { + ue_sensor.second.publisher->UpdateSensorDataPostAction(); + } + } + _world_publisher->UpdateSensorDataPostAction(); } -void ROS2::ProcessDataFromCollisionSensor( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - uint32_t other_actor, - carla::geom::Vector3D impulse, - void* actor) { - - auto base_publisher = GetOrCreateSensor(ESensors::CollisionSensor, actor); - auto sensor_publisher = std::dynamic_pointer_cast(base_publisher); - auto transform_publisher = GetOrCreateTransformPublisher(actor); - sensor_publisher->Write(_seconds, _nanoseconds, other_actor, impulse); - sensor_publisher->Publish(); +void ROS2::EnableForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id) { + auto ue_sensor = _ue_sensors.find(stream_actor_id.stream_id); + if (ue_sensor != _ue_sensors.end()) { + if ( !ue_sensor->second.publisher->is_enabled_for_ros(stream_actor_id.actor_id) ) { + log_debug("Enable Sensor for ROS: ", + std::to_string(*ue_sensor->second.publisher->_actor_name_definition)); + ue_sensor->second.publisher->enable_for_ros(stream_actor_id.actor_id); + } + } +} - if (transform_publisher) { - transform_publisher->Write(_seconds, _nanoseconds, GetParentFrameId(actor), GetFrameId(actor), sensor_transform); - transform_publisher->Publish(); +void ROS2::DisableForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id) { + auto ue_sensor = _ue_sensors.find(stream_actor_id.stream_id); + if (ue_sensor != _ue_sensors.end()) { + if ( ue_sensor->second.publisher->is_enabled_for_ros(stream_actor_id.actor_id) ) { + log_debug("Disable Sensor for ROS: ", + std::to_string(*ue_sensor->second.publisher->_actor_name_definition)); + ue_sensor->second.publisher->disable_for_ros(stream_actor_id.actor_id); + } } } -void ROS2::Shutdown() { - _publishers.clear(); - _subscribers.clear(); +bool ROS2::IsEnabledForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id) { + auto ue_sensor = _ue_sensors.find(stream_actor_id.stream_id); + if (ue_sensor != _ue_sensors.end()) { + return ue_sensor->second.publisher->is_enabled_for_ros(stream_actor_id.actor_id); + } + return false; +} - _tf_publishers.clear(); - _clock_publisher.reset(); +uint64_t ROS2::CurrentFrame() const { + return (_world_publisher != nullptr) ? _world_publisher->CurrentFrame() : 0u; +} - _enabled = false; +carla::ros2::types::Timestamp const &ROS2::CurrentTimestamp() const { + static carla::ros2::types::Timestamp const dummy; + return (_world_publisher != nullptr) ? _world_publisher->CurrentTimestamp() : dummy; } -} // namespace ros2 -} // namespace carla +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2.h b/LibCarla/source/carla/ros2/ROS2.h index 20bcce853ac..82a4da16af8 100644 --- a/LibCarla/source/carla/ros2/ROS2.h +++ b/LibCarla/source/carla/ros2/ROS2.h @@ -6,162 +6,139 @@ #pragma once -#include "carla/Buffer.h" #include "carla/BufferView.h" -#include "carla/geom/Transform.h" -#include "carla/ros2/ROS2CallbackData.h" -#include "carla/streaming/detail/Types.h" - -#include -#include +#include "carla/ros2/ROS2NameRegistry.h" +#include "carla/ros2/ROS2Session.h" +#include "carla/ros2/types/SensorActorDefinition.h" +#include "carla/ros2/types/TrafficLightActorDefinition.h" +#include "carla/ros2/types/TrafficSignActorDefinition.h" +#include "carla/ros2/types/VehicleActorDefinition.h" +#include "carla/ros2/types/WalkerActorDefinition.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla/streaming/detail/Message.h" + +#include #include -#include +#include -// forward declarations -class AActor; namespace carla { - namespace geom { - class GeoLocation; - class Vector3D; +namespace ros2 { + +class DdsDomainParticipantImpl; +class UePublisherBaseSensor; +class TransformPublisher; +class CarlaActorListPublisher; +class UeWorldPublisher; +class ServiceInterface; + +class ROS2 { +public: + // deleting copy constructor for singleton + ROS2(const ROS2& obj) = delete; + ~ROS2() = default; + + static std::shared_ptr GetInstance(); + + // starting/stopping + enum class TopicVisibilityDefaultMode { + eOn, + eOff + }; + void Enable(carla::rpc::RpcServerInterface* carla_server, + carla::streaming::detail::stream_id_type const world_observer_stream_id, + TopicVisibilityDefaultMode topic_visibility_default_mode); + bool IsEnabled() const { + return _enabled; } - namespace sensor { - namespace data { - struct DVSEvent; - class LidarData; - class SemanticLidarData; - class RadarData; - } + TopicVisibilityDefaultMode VisibilityDefaultMode() const { + return _topic_visibility_default_mode; + } + void NotifyInitGame(); + void NotifyBeginEpisode(); + void NotifyEndEpisode(); + void NotifyEndGame(); + void Disable(); + + void AttachActors(ActorId const child, ActorId const parent); + + void AddVehicleUe(std::shared_ptr vehicle_actor_definition, + carla::ros2::types::VehicleControlCallback vehicle_control_callback, + carla::ros2::types::VehicleAckermannControlCallback vehicle_ackermann_control_callback, + carla::ros2::types::ActorSetTransformCallback vehicle_set_transform_callback); + void AddWalkerUe(std::shared_ptr walker_actor_definition, + carla::ros2::types::WalkerControlCallback walker_control_callback); + void AddTrafficLightUe( + std::shared_ptr traffic_light_actor_definition); + void AddTrafficSignUe(std::shared_ptr traffic_sign_actor_definition); + bool AddSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback = nullptr); + bool AddV2XCustomSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback); + + void RemoveActor(ActorId const actor); + + /** + * Implement actions before sensor data processing + */ + void ProcessDataFromUeSensorPreAction(); + void ProcessDataFromUeSensor(carla::streaming::detail::stream_id_type const stream_id, + std::shared_ptr message); + /** + * Implement actions after sensor data processing + */ + void ProcessDataFromUeSensorPostAction(); + + void EnableForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id); + void DisableForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id); + bool IsEnabledForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id); + + /** + * Process incoming messages + */ + void ProcessMessages(); + + uint64_t CurrentFrame() const; + carla::ros2::types::Timestamp const& CurrentTimestamp() const; + + std::shared_ptr GetNameRegistry() { + return _name_registry; } -} -namespace carla { -namespace ros2 { - class BasePublisher; - class BaseSubscriber; - - class CarlaTransformPublisher; - class CarlaClockPublisher; - -class ROS2 -{ - public: - - // deleting copy constructor for singleton - ROS2(const ROS2& obj) = delete; - static std::shared_ptr GetInstance() { - if (!_instance) - _instance = std::shared_ptr(new ROS2); - return _instance; - } - - // General - void Enable(bool enable); - void Shutdown(); - - bool IsEnabled() { return _enabled; } - - void SetFrame(uint64_t frame); - void SetTimestamp(double timestamp); - - std::string GetActorRosName(void *actor); - std::string GetActorBaseTopicName(void *actor); - - std::string GetFrameId(void *actor); - std::string GetParentFrameId(void *actor); - - // Registration - void RegisterActor(void *actor, std::string ros_name, std::string frame_id, bool publish_tf=true); - void UnregisterActor(void *actor); - - void RegisterActorParent(void *actor, void *parent); - - void RegisterSensor(void *actor, std::string ros_name, std::string frame_id, bool publish_tf); - void UnregisterSensor(void *actor); - - void RegisterVehicle(void *actor, std::string ros_name, std::string frame_id, ActorCallback callback); - void UnregisterVehicle(void *actor); - - // Receiving data to publish - void ProcessDataFromCamera( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - const carla::SharedBufferView buffer, - void *actor = nullptr); - void ProcessDataFromGNSS( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - const carla::geom::GeoLocation &data, - void *actor = nullptr); - void ProcessDataFromIMU( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - carla::geom::Vector3D accelerometer, - carla::geom::Vector3D gyroscope, - float compass, - void *actor = nullptr); - void ProcessDataFromDVS( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - const carla::SharedBufferView buffer, - void *actor = nullptr); - void ProcessDataFromLidar( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - carla::sensor::data::LidarData &data, - void *actor = nullptr); - void ProcessDataFromSemanticLidar( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - carla::sensor::data::SemanticLidarData &data, - void *actor = nullptr); - void ProcessDataFromRadar( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - const carla::sensor::data::RadarData &data, - void *actor = nullptr); - void ProcessDataFromObstacleDetection( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - AActor *first_actor, - AActor *second_actor, - float distance, - void *actor = nullptr); - void ProcessDataFromCollisionSensor( - uint64_t sensor_type, - const carla::geom::Transform sensor_transform, - uint32_t other_actor, - carla::geom::Vector3D impulse, - void* actor); - - private: - std::shared_ptr GetOrCreateTransformPublisher(void *actor); - std::shared_ptr GetOrCreateSensor(int type, void* actor); +private: + bool _enabled{false}; + TopicVisibilityDefaultMode _topic_visibility_default_mode{TopicVisibilityDefaultMode::eOn}; + carla::rpc::RpcServerInterface* _carla_server{nullptr}; + std::shared_ptr _name_registry{nullptr}; + std::shared_ptr _dispatcher; + std::shared_ptr _domain_participant_impl; + std::shared_ptr _world_observer_sensor_actor_definition; + + struct UeSensor { + UeSensor(std::shared_ptr sensor_actor_definition_) + : sensor_actor_definition(sensor_actor_definition_) {} + std::shared_ptr sensor_actor_definition; + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback{nullptr}; + bool publisher_expected{true}; + std::shared_ptr publisher; + std::shared_ptr session; + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback{nullptr}; + }; + std::unordered_map _ue_sensors; + bool _ue_sensors_changed{false}; + std::shared_ptr _transform_publisher; + + std::shared_ptr _world_publisher; + + std::list> _services; + + std::shared_ptr _carla_sensor_actor_list_publisher; + + UeSensor* AddSensorUeInternal(std::shared_ptr sensor_actor_definition); + void CreateSensorUePublisher(UeSensor& sensor); // sigleton - ROS2() {}; - - static std::shared_ptr _instance; - - bool _enabled { false }; - uint64_t _frame { 0 }; - int32_t _seconds { 0 }; - uint32_t _nanoseconds { 0 }; - - std::shared_ptr _clock_publisher; - - // actor->parent relationship - std::unordered_map _actor_parent_map; - - std::unordered_map _registered_actors; - std::unordered_map _frame_ids; - - std::unordered_map> _publishers; - std::unordered_multimap> _subscribers; - std::unordered_map _actor_callbacks; - - std::unordered_map _tfs; - std::unordered_map> _tf_publishers; + ROS2(){}; }; -} // namespace ros2 -} // namespace carla +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2CallbackData.h b/LibCarla/source/carla/ros2/ROS2CallbackData.h deleted file mode 100644 index b857b68bce6..00000000000 --- a/LibCarla/source/carla/ros2/ROS2CallbackData.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma -// de Barcelona (UAB). -// -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4583) -#pragma warning(disable:4582) -#include -#pragma warning(pop) -#else -#include -#endif - -namespace carla { -namespace ros2 { - - struct VehicleControl - { - float throttle; - float steer; - float brake; - bool hand_brake; - bool reverse; - int32_t gear; - bool manual_gear_shift; - }; - - struct AckermannControl - { - float steer; - float steer_speed; - float speed; - float acceleration; - float jerk; - }; - - using ROS2CallbackData = boost::variant2::variant< - VehicleControl, - AckermannControl - >; - - using ActorCallback = std::function; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2NameRecord.cpp b/LibCarla/source/carla/ros2/ROS2NameRecord.cpp new file mode 100644 index 00000000000..d1a5f459faa --- /dev/null +++ b/LibCarla/source/carla/ros2/ROS2NameRecord.cpp @@ -0,0 +1,47 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/ROS2NameRecord.h" + +#include "carla/ros2/ROS2.h" +#include "carla/ros2/types/SensorActorDefinition.h" +#include "carla/ros2/types/TrafficLightActorDefinition.h" +#include "carla/ros2/types/TrafficSignActorDefinition.h" +#include "carla/ros2/types/VehicleActorDefinition.h" +#include "carla/ros2/types/WalkerActorDefinition.h" + +namespace carla { +namespace ros2 { + +ROS2NameRecord::ROS2NameRecord(std::shared_ptr actor_name_definition) + : _actor_name_definition(actor_name_definition) { + ROS2::GetInstance()->GetNameRegistry()->RegisterRecord(this); +} + +ROS2NameRecord::~ROS2NameRecord() { + ROS2::GetInstance()->GetNameRegistry()->UnregisterRecord(this); +} + +std::string ROS2NameRecord::get_topic_name(std::string postfix) const { + auto topic_name = ROS2::GetInstance()->GetNameRegistry()->TopicName(this); + if (!postfix.empty()) { + topic_name += "/" + postfix; + } + return topic_name; +} + +std::string ROS2NameRecord::frame_id() const { + return ROS2::GetInstance()->GetNameRegistry()->FrameId(this); +} + +std::string ROS2NameRecord::parent_frame_id() const { + return ROS2::GetInstance()->GetNameRegistry()->ParentFrameId(this); +} + +carla::streaming::detail::actor_id_type ROS2NameRecord::get_actor_id() const { + return _actor_name_definition->id; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2NameRecord.h b/LibCarla/source/carla/ros2/ROS2NameRecord.h new file mode 100644 index 00000000000..c8718899433 --- /dev/null +++ b/LibCarla/source/carla/ros2/ROS2NameRecord.h @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/ros2/types/ActorNameDefinition.h" + +namespace carla { +namespace ros2 { + +class DdsDomainParticipantImpl; + +/** + * @brief class to manage the most topic/frame handling in the sense of parent/child role_name, duplicates, etc. + */ +class ROS2NameRecord { +public: + ROS2NameRecord(std::shared_ptr actor_name_definition); + ~ROS2NameRecord(); + + ROS2NameRecord(const ROS2NameRecord&) = delete; + ROS2NameRecord& operator=(const ROS2NameRecord&) = delete; + ROS2NameRecord(ROS2NameRecord&&) = default; + ROS2NameRecord& operator=(ROS2NameRecord&&) = default; + + std::string frame_id() const; + + std::string parent_frame_id() const; + + std::string get_topic_name(std::string postfix = "") const; + + carla::streaming::detail::actor_id_type get_actor_id() const; + + std::shared_ptr _actor_name_definition; +}; + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp b/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp new file mode 100644 index 00000000000..6b1724126d3 --- /dev/null +++ b/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp @@ -0,0 +1,320 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include + +#include "carla/ros2/ROS2NameRecord.h" +#include "carla/ros2/ROS2NameRegistry.h" +#include "carla/ros2/types/SensorActorDefinition.h" +#include "carla/ros2/types/TrafficLightActorDefinition.h" +#include "carla/ros2/types/TrafficSignActorDefinition.h" +#include "carla/ros2/types/VehicleActorDefinition.h" +#include "carla/ros2/types/WalkerActorDefinition.h" + +namespace carla { +namespace ros2 { + +const ROS2NameRegistry::TopicAndFrame g_empty_topic_and_frame; + +void ROS2NameRegistry::Clear() { + std::lock_guard lock(access_mutex); + record_set.clear(); + parent_map.clear(); + topic_and_frame_map.clear(); +} + +void ROS2NameRegistry::RegisterRecord(ROS2NameRecord const* record) { + std::lock_guard lock(access_mutex); + record_set.insert(record); +} + +void ROS2NameRegistry::UnregisterRecord(ROS2NameRecord const* record) { + std::lock_guard lock(access_mutex); + auto const actor_id = record->_actor_name_definition->id; + record_set.erase(record); + + for (auto iter = parent_map.begin(); iter != parent_map.end(); /*no update of iter*/) { + if (iter->first == actor_id) { + // erase this actor from the map + iter = parent_map.erase(iter); + } else if (iter->second == actor_id) { + // if this actor was the parent of another one, erase this dependency + auto const child = iter->first; + iter = parent_map.erase(iter); + // and update child data + UpdateTopicAndFrameLocked(child); + } else { + ++iter; + } + } + + for (auto iter = topic_and_frame_map.begin(); iter != topic_and_frame_map.end(); /*no update of iter*/) { + if (iter->first._record == record) { + iter = topic_and_frame_map.erase(iter); + } else { + ++iter; + } + } +} + +void ROS2NameRegistry::AttachActors(ActorId const child_id, ActorId const parent_id) { + std::lock_guard lock(access_mutex); + log_debug("ROS2NameRegistry::AttachActors[", child_id, "]: parent=", parent_id); + auto insert_result = parent_map.insert({child_id, parent_id}); + if (!insert_result.second) { + // update parent entry + insert_result.first->second = parent_id; + } + // enforce an update the topic and frames of the child + UpdateTopicAndFrameLocked(child_id); +} + +std::string ROS2NameRegistry::TopicPrefix(ActorId const actor_id) { + std::lock_guard lock(access_mutex); + std::string result_topic_name = ""; + for (auto& record : record_set) { + auto const actor_definition = record->_actor_name_definition; + if (actor_definition->id == actor_id) { + auto const topic_name = GetTopicAndFrameLocked(KeyType(record))._topic_name; + if (result_topic_name.empty()) { + result_topic_name = topic_name; + } else { + auto iter_a = result_topic_name.begin(); + auto iter_b = topic_name.begin(); + while (iter_a != result_topic_name.end() && iter_b != topic_name.end() && (*iter_a == *iter_b)) { + iter_a++; + iter_b++; + } + if (iter_a == result_topic_name.end()) { + // result_topic_name is already shortest common prefix + } else if (iter_b == topic_name.end()) { + // topic_name is new shortest common prefix + result_topic_name = topic_name; + } else { + result_topic_name = {result_topic_name.begin(), iter_a}; + } + } + } + } + return result_topic_name; +} + +ROS2NameRegistry::TopicAndFrame const& ROS2NameRegistry::GetTopicAndFrameLocked(ROS2NameRecord const* record) { + return GetTopicAndFrameLocked(KeyType(record)); +} + +ROS2NameRegistry::TopicAndFrame const& ROS2NameRegistry::GetParentTopicAndFrameLocked( + ROS2NameRecord const* child_record) { + ActorId const child_id = child_record->_actor_name_definition->id; + // multiple parent entries are not allowed + auto find_result = parent_map.find(child_id); + if (find_result != parent_map.end()) { + auto const parent_actor_id = find_result->second; + std::map::iterator parent_iter = topic_and_frame_map.end(); + for (auto iter = topic_and_frame_map.begin(); iter != topic_and_frame_map.end(); ++iter) { + if (iter->first._actor_id == parent_actor_id) { + if (parent_iter != topic_and_frame_map.end()) { + log_error("ROS2NameRegistry::GetParentTopicAndFrameLocked: multiple parent candidates for child ", + std::to_string(*child_record->_actor_name_definition), " found. ", " Potential Parents ", + std::to_string(*iter->first._record->_actor_name_definition), + std::to_string(*parent_iter->first._record->_actor_name_definition), + " This is not an expected configuration. Cannot decide. Ignore parent"); + return g_empty_topic_and_frame; + } else { + parent_iter = iter; + } + } + } + if (parent_iter != topic_and_frame_map.end()) { + return parent_iter->second; + } else { + // create the parent topic and frame + ROS2NameRecord const* parent_record = nullptr; + for (auto& record : record_set) { + if (record->_actor_name_definition->id == parent_actor_id) { + if (parent_record != nullptr) { + log_error("ROS2NameRegistry::GetParentTopicAndFrameLocked: multiple parent candidates for child ", + std::to_string(*child_record->_actor_name_definition), " found. ", " Potential Parents ", + std::to_string(*record->_actor_name_definition), + std::to_string(*parent_record->_actor_name_definition), + " This is not an expected configuration. Cannot decide. Ignore parent"); + return g_empty_topic_and_frame; + } else { + parent_record = record; + } + } + } + if (parent_record != nullptr) { + KeyType const key(parent_record); + return CreateTopicAndFrameLocked(key)->second; + } else { + log_error("ROS2NameRegistry::GetParentTopicAndFrameLocked: no parent candidate found for child ", + std::to_string(*child_record->_actor_name_definition), " found. ", + " This is not an expected configuration. Cannot decide. Ignore parent_id=", parent_actor_id); + return g_empty_topic_and_frame; + } + } + } + return g_empty_topic_and_frame; +} + +ROS2NameRegistry::TopicAndFrame const& ROS2NameRegistry::GetTopicAndFrameLocked(ROS2NameRegistry::KeyType const& key) { + auto find_result = topic_and_frame_map.find(key); + if (find_result != topic_and_frame_map.end()) { + return find_result->second; + } else { + return CreateTopicAndFrameLocked(key)->second; + } +} + +void ROS2NameRegistry::UpdateTopicAndFrameLocked(carla::streaming::detail::actor_id_type actor_id) { + // update all of this + for (auto& record : record_set) { + auto const actor_definition = record->_actor_name_definition; + if (actor_definition->id == actor_id) { + KeyType const key(record); + (void)CreateTopicAndFrameLocked(key); + } + } +} + +std::string number_to_three_letter_string(uint32_t number) { + auto number_string = std::to_string(number); + if (number_string.length() < 3u) { + number_string.insert(number_string.begin(), 3u - number_string.length(), '0'); + } + return number_string; +} + +std::map::iterator +ROS2NameRegistry::CreateTopicAndFrameLocked(ROS2NameRegistry::KeyType const& key) { + auto const actor_definition = key._record->_actor_name_definition; + + TopicAndFrame parent_topic_and_frame; + auto parent_iter = parent_map.find(key._actor_id); + if (parent_iter != parent_map.end()) { + // get the data, if not availble, update also the parent + parent_topic_and_frame = GetParentTopicAndFrameLocked(key._record); + } + + ROS2NameRegistry::TopicAndFrame topic_and_frame("rt/carla"); + // first bring in the parent hierarchy if present + if (!parent_topic_and_frame._topic_name.empty()) { + if (parent_topic_and_frame._topic_name.find("rt/carla") == 0) { + topic_and_frame._topic_name = parent_topic_and_frame._topic_name; + } else { + topic_and_frame._topic_name += "/" + parent_topic_and_frame._topic_name; + } + } + if (!parent_topic_and_frame._frame_id.empty()) { + topic_and_frame._frame_id = parent_topic_and_frame._frame_id; + } + + // let us query the type of actor we have + auto vehicle_actor_definition = + std::dynamic_pointer_cast(actor_definition); + auto walker_actor_definition = std::dynamic_pointer_cast(actor_definition); + auto sensor_actor_definition = std::dynamic_pointer_cast(actor_definition); + auto traffic_light_actor_definition = + std::dynamic_pointer_cast(actor_definition); + auto traffic_sign_actor_definition = + std::dynamic_pointer_cast(actor_definition); + + // prefix with generic type prefix + std::string type; + if (vehicle_actor_definition != nullptr) { + type = ""; //"vehicles"; // maybe not a good idea to break the interface of existing ROS-clients + } else if (walker_actor_definition != nullptr) { + type = ""; //"walkers"; // maybe not a good idea to break the interface of existing ROS-clients + } else if (traffic_light_actor_definition != nullptr) { + type = "traffic_lights"; + } else if (traffic_sign_actor_definition != nullptr) { + type = "traffic_signs"; + } else if ((sensor_actor_definition != nullptr)&&(sensor_actor_definition->stream_id!=1)) { + type = ""; // "sensors"; // maybe not a good idea to break the interface of existing ROS-clients + } else { + type = ""; //"world"; // maybe not a good idea to break the interface of existing ROS-clients + } + // add type + topic_and_frame = ExpandTopicName(topic_and_frame, type); + + std::string individual_name; + if (sensor_actor_definition != nullptr) { + // on sensors we use the sensor name as additions type prefix + auto pos = actor_definition->ros_name.find_last_of('.'); + if (pos != std::string::npos) { + topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name.substr(pos + 1u)); + } else { + topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name); + } + // and use stream id as individualization + auto const stream_id_string = "/stream_" + number_to_three_letter_string(sensor_actor_definition->stream_id); + if (IsTopicNameAvailable(topic_and_frame, stream_id_string)) { + individual_name = stream_id_string; + } + } + + // the role name overrules other individualization + if (!actor_definition->role_name.empty()) { + if (IsTopicNameAvailable(topic_and_frame, actor_definition->role_name)) { + individual_name = actor_definition->role_name; + } + } + // no valid individualization yet, use actor id + if (individual_name.empty()) { + auto const actor_id_string = "actor_" + number_to_three_letter_string(actor_definition->id); + if (IsTopicNameAvailable(topic_and_frame, actor_id_string)) { + individual_name = actor_id_string; + } + } + // if also this doesn't help, we try with a random number using the actor_id as initialization + if (individual_name.empty()) { + std::srand(actor_definition->id); + individual_name = "randomid_" + number_to_three_letter_string(uint32_t(std::rand())); + } + topic_and_frame = ExpandTopicName(topic_and_frame, individual_name); + + auto insert_result = topic_and_frame_map.insert({key, topic_and_frame}); + if (!insert_result.second) { + // enforce update if already there + insert_result.first->second = topic_and_frame; + } + + return insert_result.first; +} + +ROS2NameRegistry::TopicAndFrame ROS2NameRegistry::ExpandTopicName(TopicAndFrame const& topic_and_frame, + std::string const& postfix) { + auto postfix_adapted = postfix; + while (postfix_adapted.front() == '/') { + postfix_adapted.erase(postfix_adapted.begin()); + } + if (postfix_adapted.empty()) { + return topic_and_frame; + } + TopicAndFrame expanded_topic_and_frame = topic_and_frame; + if (expanded_topic_and_frame._frame_id.back() != '/') { + expanded_topic_and_frame._frame_id.push_back('/'); + } + if (expanded_topic_and_frame._frame_id.front() == '/') { + expanded_topic_and_frame._frame_id.erase(0u, 1u); + } + if (expanded_topic_and_frame._topic_name.back() != '/') { + expanded_topic_and_frame._topic_name.push_back('/'); + } + expanded_topic_and_frame._frame_id += postfix_adapted; + expanded_topic_and_frame._topic_name += postfix_adapted; + return expanded_topic_and_frame; +} + +bool ROS2NameRegistry::IsTopicNameAvailable(TopicAndFrame const& topic_and_frame, std::string const& individual_name) { + auto topic_name_check = ExpandTopicName(topic_and_frame, individual_name)._topic_name; + auto iter = + std::find_if(topic_and_frame_map.begin(), topic_and_frame_map.end(), + [topic_name_check](auto const& element) { return element.second._topic_name == topic_name_check; }); + return iter == topic_and_frame_map.end(); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2NameRegistry.h b/LibCarla/source/carla/ros2/ROS2NameRegistry.h new file mode 100644 index 00000000000..8f7aa053dee --- /dev/null +++ b/LibCarla/source/carla/ros2/ROS2NameRegistry.h @@ -0,0 +1,121 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include +#include +#include + +#include "carla/ros2/ROS2NameRecord.h" + +namespace carla { +namespace ros2 { + +/** + * @brief Registry to manage topic/frame handling in the sense of parent/child role_name, duplicates, etc. + * Calls to this object are thread-safe + */ +class ROS2NameRegistry { +public: + ROS2NameRegistry() = default; + ~ROS2NameRegistry() = default; + + void Clear(); + + // registering and unregistering records + void RegisterRecord(ROS2NameRecord const* record); + void UnregisterRecord(ROS2NameRecord const* record); + + // attaching actors to each other + void AttachActors(carla::streaming::detail::actor_id_type const child, carla::streaming::detail::actor_id_type const parent); + + struct TopicAndFrame { + TopicAndFrame(std::string topic_name = "", std::string frame_id = "") + : _topic_name(topic_name), _frame_id(frame_id) {} + std::string _topic_name = ""; + std::string _frame_id = ""; + }; + + carla::streaming::detail::actor_id_type ParentActorId(carla::streaming::detail::actor_id_type const child_id) const { + std::lock_guard lock(access_mutex); + carla::streaming::detail::actor_id_type parent_actor_id = 0; + auto find_result = parent_map.find(child_id); + if (find_result != parent_map.end()) { + parent_actor_id = find_result->second; + } + return parent_actor_id; + } + + /*! + @brief returns the shortest common prefix of all registered topic names for this actor_id + */ + std::string TopicPrefix(carla::streaming::detail::actor_id_type const actor_id); + + std::string FrameId(ROS2NameRecord const* record) { + std::lock_guard lock(access_mutex); + return GetTopicAndFrameLocked(record)._frame_id; + } + std::string TopicName(ROS2NameRecord const* record) { + std::lock_guard lock(access_mutex); + return GetTopicAndFrameLocked(record)._topic_name; + } + + std::string ParentFrameId(ROS2NameRecord const* record) { + std::lock_guard lock(access_mutex); + auto parent_frame_id = GetParentTopicAndFrameLocked(record)._frame_id; + if (parent_frame_id.empty()) { + parent_frame_id = "map"; + } else if (parent_frame_id.find("rt/carla") == 0) { + // fully qualified parent + return parent_frame_id.substr(8); + } + return parent_frame_id; + } + std::string ParentTopicName(ROS2NameRecord const* record) { + std::lock_guard lock(access_mutex); + return GetParentTopicAndFrameLocked(record)._topic_name; + } + +private: + ROS2NameRegistry(const ROS2NameRegistry&) = delete; + ROS2NameRegistry& operator=(const ROS2NameRegistry&) = delete; + ROS2NameRegistry(ROS2NameRegistry&&) = delete; + ROS2NameRegistry& operator=(ROS2NameRegistry&&) = delete; + + bool IsTopicNameAvailable(TopicAndFrame const& topic_and_frame, std::string const& individual_name); + TopicAndFrame ExpandTopicName(TopicAndFrame const& topic_and_frame, std::string const& postfix); + + struct KeyType { + explicit KeyType(ROS2NameRecord const* record) : _record(record), _actor_id(record->_actor_name_definition->id) {} + + bool operator<(const KeyType& other) const { + if (_actor_id == other._actor_id) { + return _record < other._record; + } else { + return _actor_id < other._actor_id; + } + } + + ROS2NameRecord const* const _record; + carla::streaming::detail::actor_id_type _actor_id; + }; + + // locked operations + TopicAndFrame const& GetTopicAndFrameLocked(ROS2NameRecord const* record); + TopicAndFrame const& GetParentTopicAndFrameLocked(ROS2NameRecord const* record); + + TopicAndFrame const& GetTopicAndFrameLocked(KeyType const& key); + void UpdateTopicAndFrameLocked(carla::streaming::detail::actor_id_type actor_id); + std::map::iterator CreateTopicAndFrameLocked(KeyType const& key); + + mutable std::mutex access_mutex; + std::set record_set; + std::map parent_map; + std::map topic_and_frame_map; +}; + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2QoS.h b/LibCarla/source/carla/ros2/ROS2QoS.h new file mode 100644 index 00000000000..e3ab7436418 --- /dev/null +++ b/LibCarla/source/carla/ros2/ROS2QoS.h @@ -0,0 +1,74 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +namespace carla { +namespace ros2 { + +/* + * Struct providing the most prominent ROS2 ROS2QoS parameters + * Default values are selected to be the default used by the ROS2. + * + * Reliability::RELIABLE + * Durability::VOLATILE + * History::KEEP_LAST, depth: 10u + */ +struct ROS2QoS { + ROS2QoS &keep_last(size_t depth) { + _history = History::KEEP_LAST; + _history_depth = int32_t(depth); + return *this; + } + + ROS2QoS &keep_all() { + _history = History::KEEP_ALL; + return *this; + } + + ROS2QoS &reliable() { + _reliability = Reliability::RELIABLE; + return *this; + } + + ROS2QoS &best_effort() { + _reliability = Reliability::BEST_EFFORT; + return *this; + } + + ROS2QoS &durability_volatile() { + _durability = Durability::VOLATILE; + return *this; + } + + ROS2QoS &transient_local() { + _durability = Durability::TRANSIENT_LOCAL; + return *this; + } + + enum class Reliability { SYSTEM_DEFAULT, BEST_EFFORT, RELIABLE } _reliability; + + enum class Durability { SYSTEM_DEFAULT, TRANSIENT_LOCAL, VOLATILE } _durability; + + enum class History { SYSTEM_DEFAULT, KEEP_LAST, KEEP_ALL } _history; + + int32_t _history_depth; +}; + +static constexpr ROS2QoS DEFAULT_ROS2_QOS{ ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::VOLATILE, + ROS2QoS::History::KEEP_LAST, 10}; + +static constexpr ROS2QoS DEFAULT_SENSOR_DATA_QOS{ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::VOLATILE, + ROS2QoS::History::KEEP_LAST, 10}; + +static constexpr ROS2QoS DEFAULT_SUBSCRIBER_QOS{ROS2QoS::Reliability::BEST_EFFORT, ROS2QoS::Durability::VOLATILE, + ROS2QoS::History::KEEP_LAST, 10}; + +static constexpr ROS2QoS DEFAULT_PUBLISHER_QOS{ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::TRANSIENT_LOCAL, + ROS2QoS::History::KEEP_LAST, 10}; + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2Session.cpp b/LibCarla/source/carla/ros2/ROS2Session.cpp new file mode 100644 index 00000000000..f52cdbe9d23 --- /dev/null +++ b/LibCarla/source/carla/ros2/ROS2Session.cpp @@ -0,0 +1,34 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma +// de Barcelona (UAB). +// +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/ROS2Session.h" +#include "carla/ros2/ROS2.h" + +namespace carla { +namespace ros2 { + +/// Writes a message to the ROS2 publisher. +void ROS2Session::WriteMessage(std::shared_ptr message) { + auto ROS2 = carla::ros2::ROS2::GetInstance(); + ROS2->ProcessDataFromUeSensor(_stream_id, message); +} + +void ROS2Session::EnableForROS(carla::streaming::detail::actor_id_type actor_id) { + auto ROS2 = carla::ros2::ROS2::GetInstance(); + ROS2->EnableForROS({_stream_id, actor_id}); +} + +void ROS2Session::DisableForROS(carla::streaming::detail::actor_id_type actor_id) { + auto ROS2 = carla::ros2::ROS2::GetInstance(); + ROS2->DisableForROS({_stream_id, actor_id}); +} + +bool ROS2Session::IsEnabledForROS(carla::streaming::detail::actor_id_type actor_id) { + auto ROS2 = carla::ros2::ROS2::GetInstance(); + return ROS2->IsEnabledForROS({_stream_id, actor_id}); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2Session.h b/LibCarla/source/carla/ros2/ROS2Session.h new file mode 100644 index 00000000000..693ab9ff804 --- /dev/null +++ b/LibCarla/source/carla/ros2/ROS2Session.h @@ -0,0 +1,36 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma +// de Barcelona (UAB). +// +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/streaming/detail/Session.h" + +namespace carla { +namespace ros2 { + +/// A ROS2 streaming session to be able to (re-)use the standard server tcp buffers to receive the data +// to be published via ROS2 +class ROS2Session : public carla::streaming::detail::Session { +public: + ROS2Session(carla::streaming::detail::stream_id_type stream_id) : carla::streaming::detail::Session(stream_id) {} + + /// Writes a message to the ROS2 publisher. + void WriteMessage(std::shared_ptr message) override; + + /// Post a job to close the session. + virtual void Close() override { + // ROS2 session is closed in case there are no subscribers anymore + // this is handled directly within ROS2 class + // nothing to be done here + } + + void EnableForROS(carla::streaming::detail::actor_id_type actor_id) override; + void DisableForROS(carla::streaming::detail::actor_id_type actor_id)override; + bool IsEnabledForROS(carla::streaming::detail::actor_id_type actor_id) override; +}; + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/fastdds/README.md b/LibCarla/source/carla/ros2/fastdds/README.md new file mode 100644 index 00000000000..2c44c1746aa --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/README.md @@ -0,0 +1,20 @@ +To update the types within this folder one has to: + + + * Checkout the github.com/carla-simulator/ros-carla-msgs repository + ```git clone https://github.com/carla-simulator/ros-carla-msgs``` + * install ROS2 on the system and all message dependencies of the carla_msgs (see ros-carla-msgs docu) + * in case the carla msg files are changed: + - build the ROS2 package of the carla_msgs + - copy the idl files from the build folder into the respective carla_msgs folder + - revert the removal of "#pragma once" line within the overridden idls + - add "#pragma once" directive to newly created idls + * To have all relevant files beeing placed in the correct subfolders by the code generator it is best practice to copy the carla_msgs folder + in parallel to the other folders of your ROS2 system first and execute the generator from the respective ROS2 folder e.g. + ``` + sudo cp -r carla_msgs /opt/ros//share + Fast-DDS-GEN/scripts/fastddsgen -d /output-code -I /opt/ros//share/ -typeros2 carla_msgs/msg/*.idl + ``` + In case you get errors in some of the idl files: add "#pragma once" directive to those idls to ensure they are only included once by the generator. + * In some cases you will have to rename variables because of name clashes within different sub-namespaces which the fastddsgen generator is not able to + distiguish. Easiest workaround for variables is placing a "_" in front of the name, so the output will be the same as expected. On class files append e.g. "BLABLA" and later perform a search and replace. Alternatively wait until the generator is fixed and works properly diff --git a/LibCarla/source/carla/ros2/types/AckermannDrive.cpp b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.cxx similarity index 87% rename from LibCarla/source/carla/ros2/types/AckermannDrive.cpp rename to LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.cxx index 7e8c0871dd3..8688c1a6e49 100644 --- a/LibCarla/source/carla/ros2/types/AckermannDrive.cpp +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.cxx @@ -34,20 +34,17 @@ using namespace eprosima::fastcdr::exception; #include -#define ackermann_msgs_msg_AckermannDrive_max_cdr_typesize 20ULL; -#define ackermann_msgs_msg_AckermannDrive_max_key_cdr_typesize 0ULL; - ackermann_msgs::msg::AckermannDrive::AckermannDrive() { - // float m_steering_angle + // m_steering_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2654635 m_steering_angle = 0.0; - // float m_steering_angle_velocity + // m_steering_angle_velocity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@737a135b m_steering_angle_velocity = 0.0; - // float m_speed + // m_speed com.eprosima.idl.parser.typecode.PrimitiveTypeCode@687ef2e0 m_speed = 0.0; - // float m_acceleration + // m_acceleration com.eprosima.idl.parser.typecode.PrimitiveTypeCode@15dcfae7 m_acceleration = 0.0; - // float m_jerk + // m_jerk com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3da05287 m_jerk = 0.0; } @@ -58,7 +55,6 @@ ackermann_msgs::msg::AckermannDrive::~AckermannDrive() - } ackermann_msgs::msg::AckermannDrive::AckermannDrive( @@ -72,7 +68,7 @@ ackermann_msgs::msg::AckermannDrive::AckermannDrive( } ackermann_msgs::msg::AckermannDrive::AckermannDrive( - AckermannDrive&& x) noexcept + AckermannDrive&& x) { m_steering_angle = x.m_steering_angle; m_steering_angle_velocity = x.m_steering_angle_velocity; @@ -95,7 +91,7 @@ ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDrive::operat } ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDrive::operator =( - AckermannDrive&& x) noexcept + AckermannDrive&& x) { m_steering_angle = x.m_steering_angle; @@ -123,8 +119,26 @@ bool ackermann_msgs::msg::AckermannDrive::operator !=( size_t ackermann_msgs::msg::AckermannDrive::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return ackermann_msgs_msg_AckermannDrive_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; } size_t ackermann_msgs::msg::AckermannDrive::getCdrSerializedSize( @@ -318,12 +332,14 @@ float& ackermann_msgs::msg::AckermannDrive::jerk() } - size_t ackermann_msgs::msg::AckermannDrive::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return ackermann_msgs_msg_AckermannDrive_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool ackermann_msgs::msg::AckermannDrive::isKeyDefined() @@ -335,7 +351,7 @@ void ackermann_msgs::msg::AckermannDrive::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } - diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.h b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.h new file mode 100644 index 00000000000..9d0e123cf05 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.h @@ -0,0 +1,264 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AckermannDrive.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ +#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(AckermannDrive_SOURCE) +#define AckermannDrive_DllAPI __declspec(dllexport) +#else +#define AckermannDrive_DllAPI __declspec(dllimport) +#endif // AckermannDrive_SOURCE +#else +#define AckermannDrive_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define AckermannDrive_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace ackermann_msgs { +namespace msg { +/*! + * @brief This class represents the structure AckermannDrive defined by the user in the IDL file. + * @ingroup ACKERMANNDRIVE + */ +class AckermannDrive { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AckermannDrive(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AckermannDrive(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. + */ + eProsima_user_DllExport AckermannDrive(const AckermannDrive& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. + */ + eProsima_user_DllExport AckermannDrive(AckermannDrive&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. + */ + eProsima_user_DllExport AckermannDrive& operator=(const AckermannDrive& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. + */ + eProsima_user_DllExport AckermannDrive& operator=(AckermannDrive&& x); + + /*! + * @brief Comparison operator. + * @param x ackermann_msgs::msg::AckermannDrive object to compare. + */ + eProsima_user_DllExport bool operator==(const AckermannDrive& x) const; + + /*! + * @brief Comparison operator. + * @param x ackermann_msgs::msg::AckermannDrive object to compare. + */ + eProsima_user_DllExport bool operator!=(const AckermannDrive& x) const; + + /*! + * @brief This function sets a value in member steering_angle + * @param _steering_angle New value for member steering_angle + */ + eProsima_user_DllExport void steering_angle(float _steering_angle); + + /*! + * @brief This function returns the value of member steering_angle + * @return Value of member steering_angle + */ + eProsima_user_DllExport float steering_angle() const; + + /*! + * @brief This function returns a reference to member steering_angle + * @return Reference to member steering_angle + */ + eProsima_user_DllExport float& steering_angle(); + + /*! + * @brief This function sets a value in member steering_angle_velocity + * @param _steering_angle_velocity New value for member steering_angle_velocity + */ + eProsima_user_DllExport void steering_angle_velocity(float _steering_angle_velocity); + + /*! + * @brief This function returns the value of member steering_angle_velocity + * @return Value of member steering_angle_velocity + */ + eProsima_user_DllExport float steering_angle_velocity() const; + + /*! + * @brief This function returns a reference to member steering_angle_velocity + * @return Reference to member steering_angle_velocity + */ + eProsima_user_DllExport float& steering_angle_velocity(); + + /*! + * @brief This function sets a value in member speed + * @param _speed New value for member speed + */ + eProsima_user_DllExport void speed(float _speed); + + /*! + * @brief This function returns the value of member speed + * @return Value of member speed + */ + eProsima_user_DllExport float speed() const; + + /*! + * @brief This function returns a reference to member speed + * @return Reference to member speed + */ + eProsima_user_DllExport float& speed(); + + /*! + * @brief This function sets a value in member acceleration + * @param _acceleration New value for member acceleration + */ + eProsima_user_DllExport void acceleration(float _acceleration); + + /*! + * @brief This function returns the value of member acceleration + * @return Value of member acceleration + */ + eProsima_user_DllExport float acceleration() const; + + /*! + * @brief This function returns a reference to member acceleration + * @return Reference to member acceleration + */ + eProsima_user_DllExport float& acceleration(); + + /*! + * @brief This function sets a value in member jerk + * @param _jerk New value for member jerk + */ + eProsima_user_DllExport void jerk(float _jerk); + + /*! + * @brief This function returns the value of member jerk + * @return Value of member jerk + */ + eProsima_user_DllExport float jerk() const; + + /*! + * @brief This function returns a reference to member jerk + * @return Reference to member jerk + */ + eProsima_user_DllExport float& jerk(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const ackermann_msgs::msg::AckermannDrive& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + float m_steering_angle; + float m_steering_angle_velocity; + float m_speed; + float m_acceleration; + float m_jerk; +}; +} // namespace msg +} // namespace ackermann_msgs + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/AckermannDrivePubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.cxx similarity index 85% rename from LibCarla/source/carla/ros2/types/AckermannDrivePubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.cxx index 37ff8e081ec..1938057b3ab 100644 --- a/LibCarla/source/carla/ros2/types/AckermannDrivePubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.cxx @@ -62,15 +62,15 @@ namespace ackermann_msgs { // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); try { - // Serialize encapsulation - ser.serialize_encapsulation(); // Serialize the object. p_type->serialize(ser); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) { return false; } @@ -84,25 +84,25 @@ namespace ackermann_msgs { SerializedPayload_t* payload, void* data) { - try - { - // Convert DATA to pointer of your type - AckermannDrive* p_type = static_cast(data); + //Convert DATA to pointer of your type + AckermannDrive* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) { return false; } @@ -173,6 +173,4 @@ namespace ackermann_msgs { } //End of namespace msg - } //End of namespace ackermann_msgs - diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.h new file mode 100644 index 00000000000..24182acab85 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.h @@ -0,0 +1,91 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AckermannDrivePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ + +#include +#include + +#include "AckermannDrive.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated AckermannDrive is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace ackermann_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type AckermannDrive defined by the user in the IDL file. + * @ingroup ACKERMANNDRIVE + */ +class AckermannDrivePubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef AckermannDrive type; + + eProsima_user_DllExport AckermannDrivePubSubType(); + + eProsima_user_DllExport virtual ~AckermannDrivePubSubType(); + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + new (memory) AckermannDrive(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace ackermann_msgs + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/AckermannDriveStamped.cpp b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.cxx similarity index 85% rename from LibCarla/source/carla/ros2/types/AckermannDriveStamped.cpp rename to LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.cxx index 3d86e6193f4..d1d2fce8634 100644 --- a/LibCarla/source/carla/ros2/types/AckermannDriveStamped.cpp +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.cxx @@ -34,20 +34,11 @@ using namespace eprosima::fastcdr::exception; #include -#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; -#define ackermann_msgs_msg_AckermannDriveStamped_max_cdr_typesize 288ULL; -#define ackermann_msgs_msg_AckermannDrive_max_cdr_typesize 20ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; -#define ackermann_msgs_msg_AckermannDriveStamped_max_key_cdr_typesize 0ULL; -#define ackermann_msgs_msg_AckermannDrive_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - ackermann_msgs::msg::AckermannDriveStamped::AckermannDriveStamped() { - // std_msgs::msg::Header m_header + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@176b3f44 - // ackermann_msgs::msg::AckermannDrive m_drive + // m_drive com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6ee6f53 } @@ -55,7 +46,6 @@ ackermann_msgs::msg::AckermannDriveStamped::AckermannDriveStamped() ackermann_msgs::msg::AckermannDriveStamped::~AckermannDriveStamped() { - } ackermann_msgs::msg::AckermannDriveStamped::AckermannDriveStamped( @@ -66,7 +56,7 @@ ackermann_msgs::msg::AckermannDriveStamped::AckermannDriveStamped( } ackermann_msgs::msg::AckermannDriveStamped::AckermannDriveStamped( - AckermannDriveStamped&& x) noexcept + AckermannDriveStamped&& x) { m_header = std::move(x.m_header); m_drive = std::move(x.m_drive); @@ -83,7 +73,7 @@ ackermann_msgs::msg::AckermannDriveStamped& ackermann_msgs::msg::AckermannDriveS } ackermann_msgs::msg::AckermannDriveStamped& ackermann_msgs::msg::AckermannDriveStamped::operator =( - AckermannDriveStamped&& x) noexcept + AckermannDriveStamped&& x) { m_header = std::move(x.m_header); @@ -108,8 +98,13 @@ bool ackermann_msgs::msg::AckermannDriveStamped::operator !=( size_t ackermann_msgs::msg::AckermannDriveStamped::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return ackermann_msgs_msg_AckermannDriveStamped_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += ackermann_msgs::msg::AckermannDrive::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; } size_t ackermann_msgs::msg::AckermannDriveStamped::getCdrSerializedSize( @@ -218,12 +213,14 @@ ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDriveStamped: return m_drive; } - size_t ackermann_msgs::msg::AckermannDriveStamped::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return ackermann_msgs_msg_AckermannDriveStamped_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool ackermann_msgs::msg::AckermannDriveStamped::isKeyDefined() @@ -235,7 +232,7 @@ void ackermann_msgs::msg::AckermannDriveStamped::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } - diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.h b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.h new file mode 100644 index 00000000000..472e5779790 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.h @@ -0,0 +1,221 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AckermannDriveStamped.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ +#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ + +#include "AckermannDrive.h" +#include "std_msgs/msg/Header.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(AckermannDriveStamped_SOURCE) +#define AckermannDriveStamped_DllAPI __declspec(dllexport) +#else +#define AckermannDriveStamped_DllAPI __declspec(dllimport) +#endif // AckermannDriveStamped_SOURCE +#else +#define AckermannDriveStamped_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define AckermannDriveStamped_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace ackermann_msgs { +namespace msg { +/*! + * @brief This class represents the structure AckermannDriveStamped defined by the user in the IDL file. + * @ingroup ACKERMANNDRIVESTAMPED + */ +class AckermannDriveStamped { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AckermannDriveStamped(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AckermannDriveStamped(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + */ + eProsima_user_DllExport AckermannDriveStamped(const AckermannDriveStamped& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + */ + eProsima_user_DllExport AckermannDriveStamped(AckermannDriveStamped&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + */ + eProsima_user_DllExport AckermannDriveStamped& operator=(const AckermannDriveStamped& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + */ + eProsima_user_DllExport AckermannDriveStamped& operator=(AckermannDriveStamped&& x); + + /*! + * @brief Comparison operator. + * @param x ackermann_msgs::msg::AckermannDriveStamped object to compare. + */ + eProsima_user_DllExport bool operator==(const AckermannDriveStamped& x) const; + + /*! + * @brief Comparison operator. + * @param x ackermann_msgs::msg::AckermannDriveStamped object to compare. + */ + eProsima_user_DllExport bool operator!=(const AckermannDriveStamped& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function copies the value in member drive + * @param _drive New value to be copied in member drive + */ + eProsima_user_DllExport void drive(const ackermann_msgs::msg::AckermannDrive& _drive); + + /*! + * @brief This function moves the value in member drive + * @param _drive New value to be moved in member drive + */ + eProsima_user_DllExport void drive(ackermann_msgs::msg::AckermannDrive&& _drive); + + /*! + * @brief This function returns a constant reference to member drive + * @return Constant reference to member drive + */ + eProsima_user_DllExport const ackermann_msgs::msg::AckermannDrive& drive() const; + + /*! + * @brief This function returns a reference to member drive + * @return Reference to member drive + */ + eProsima_user_DllExport ackermann_msgs::msg::AckermannDrive& drive(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const ackermann_msgs::msg::AckermannDriveStamped& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + ackermann_msgs::msg::AckermannDrive m_drive; +}; +} // namespace msg +} // namespace ackermann_msgs + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/AckermannDriveStampedPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.cxx similarity index 85% rename from LibCarla/source/carla/ros2/types/AckermannDriveStampedPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.cxx index edba64f67ec..5427bc5febf 100644 --- a/LibCarla/source/carla/ros2/types/AckermannDriveStampedPubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.cxx @@ -62,15 +62,15 @@ namespace ackermann_msgs { // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); try { - // Serialize encapsulation - ser.serialize_encapsulation(); // Serialize the object. p_type->serialize(ser); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) { return false; } @@ -84,25 +84,25 @@ namespace ackermann_msgs { SerializedPayload_t* payload, void* data) { - try - { - // Convert DATA to pointer of your type - AckermannDriveStamped* p_type = static_cast(data); + //Convert DATA to pointer of your type + AckermannDriveStamped* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) { return false; } @@ -173,6 +173,4 @@ namespace ackermann_msgs { } //End of namespace msg - } //End of namespace ackermann_msgs - diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h new file mode 100644 index 00000000000..86aedb8db10 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h @@ -0,0 +1,92 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AckermannDriveStampedPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ + +#include +#include + +#include "AckermannDriveStamped.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated AckermannDriveStamped is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace ackermann_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type AckermannDriveStamped defined by the user in the IDL file. + * @ingroup ACKERMANNDRIVESTAMPED + */ +class AckermannDriveStampedPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef AckermannDriveStamped type; + + eProsima_user_DllExport AckermannDriveStampedPubSubType(); + + eProsima_user_DllExport virtual ~AckermannDriveStampedPubSubType(); + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace ackermann_msgs + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Time.cpp b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.cxx similarity index 88% rename from LibCarla/source/carla/ros2/types/Time.cpp rename to LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.cxx index 95f2e7b95ce..3191854d26b 100644 --- a/LibCarla/source/carla/ros2/types/Time.cpp +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.cxx @@ -34,19 +34,18 @@ using namespace eprosima::fastcdr::exception; #include -#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; -#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; - builtin_interfaces::msg::Time::Time() { - // long m_sec + // m_sec com.eprosima.idl.parser.typecode.PrimitiveTypeCode@d23e042 m_sec = 0; - // unsigned long m_nanosec + // m_nanosec com.eprosima.idl.parser.typecode.PrimitiveTypeCode@46d59067 m_nanosec = 0; + } builtin_interfaces::msg::Time::~Time() { + } builtin_interfaces::msg::Time::Time( @@ -57,7 +56,7 @@ builtin_interfaces::msg::Time::Time( } builtin_interfaces::msg::Time::Time( - Time&& x) noexcept + Time&& x) { m_sec = x.m_sec; m_nanosec = x.m_nanosec; @@ -66,6 +65,7 @@ builtin_interfaces::msg::Time::Time( builtin_interfaces::msg::Time& builtin_interfaces::msg::Time::operator =( const Time& x) { + m_sec = x.m_sec; m_nanosec = x.m_nanosec; @@ -73,8 +73,9 @@ builtin_interfaces::msg::Time& builtin_interfaces::msg::Time::operator =( } builtin_interfaces::msg::Time& builtin_interfaces::msg::Time::operator =( - Time&& x) noexcept + Time&& x) { + m_sec = x.m_sec; m_nanosec = x.m_nanosec; @@ -84,6 +85,7 @@ builtin_interfaces::msg::Time& builtin_interfaces::msg::Time::operator =( bool builtin_interfaces::msg::Time::operator ==( const Time& x) const { + return (m_sec == x.m_sec && m_nanosec == x.m_nanosec); } @@ -96,8 +98,17 @@ bool builtin_interfaces::msg::Time::operator !=( size_t builtin_interfaces::msg::Time::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return builtin_interfaces_msg_Time_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; } size_t builtin_interfaces::msg::Time::getCdrSerializedSize( @@ -106,22 +117,31 @@ size_t builtin_interfaces::msg::Time::getCdrSerializedSize( { (void)data; size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + return current_alignment - initial_alignment; } void builtin_interfaces::msg::Time::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_sec; scdr << m_nanosec; + } void builtin_interfaces::msg::Time::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_sec; dcdr >> m_nanosec; } @@ -182,11 +202,15 @@ uint32_t& builtin_interfaces::msg::Time::nanosec() return m_nanosec; } + size_t builtin_interfaces::msg::Time::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return builtin_interfaces_msg_Time_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool builtin_interfaces::msg::Time::isKeyDefined() @@ -198,4 +222,7 @@ void builtin_interfaces::msg::Time::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.h b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.h new file mode 100644 index 00000000000..ae55bc39467 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.h @@ -0,0 +1,207 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Time.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Time_SOURCE) +#define Time_DllAPI __declspec(dllexport) +#else +#define Time_DllAPI __declspec(dllimport) +#endif // Time_SOURCE +#else +#define Time_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Time_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace builtin_interfaces { +namespace msg { +/*! + * @brief This class represents the structure Time defined by the user in the IDL file. + * @ingroup TIME + */ +class Time { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Time(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Time(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + */ + eProsima_user_DllExport Time(const Time& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + */ + eProsima_user_DllExport Time(Time&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + */ + eProsima_user_DllExport Time& operator=(const Time& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + */ + eProsima_user_DllExport Time& operator=(Time&& x); + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::Time object to compare. + */ + eProsima_user_DllExport bool operator==(const Time& x) const; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::Time object to compare. + */ + eProsima_user_DllExport bool operator!=(const Time& x) const; + + /*! + * @brief This function sets a value in member sec + * @param _sec New value for member sec + */ + eProsima_user_DllExport void sec(int32_t _sec); + + /*! + * @brief This function returns the value of member sec + * @return Value of member sec + */ + eProsima_user_DllExport int32_t sec() const; + + /*! + * @brief This function returns a reference to member sec + * @return Reference to member sec + */ + eProsima_user_DllExport int32_t& sec(); + + /*! + * @brief This function sets a value in member nanosec + * @param _nanosec New value for member nanosec + */ + eProsima_user_DllExport void nanosec(uint32_t _nanosec); + + /*! + * @brief This function returns the value of member nanosec + * @return Value of member nanosec + */ + eProsima_user_DllExport uint32_t nanosec() const; + + /*! + * @brief This function returns a reference to member nanosec + * @return Reference to member nanosec + */ + eProsima_user_DllExport uint32_t& nanosec(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const builtin_interfaces::msg::Time& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + int32_t m_sec; + uint32_t m_nanosec; +}; +} // namespace msg +} // namespace builtin_interfaces + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/TimePubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.cxx similarity index 90% rename from LibCarla/source/carla/ros2/types/TimePubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.cxx index 8bb4969d9ad..ca1c7915dda 100644 --- a/LibCarla/source/carla/ros2/types/TimePubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -63,7 +64,17 @@ namespace builtin_interfaces { payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Serialize encapsulation ser.serialize_encapsulation(); - p_type->serialize(ser); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + // Get the serialized length payload->length = static_cast(ser.getSerializedDataLength()); return true; @@ -86,8 +97,15 @@ namespace builtin_interfaces { deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Deserialize the object. - p_type->deserialize(deser); + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } return true; } @@ -151,5 +169,8 @@ namespace builtin_interfaces { } return true; } + + } //End of namespace msg + } //End of namespace builtin_interfaces diff --git a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.h new file mode 100644 index 00000000000..919dd66069d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.h @@ -0,0 +1,91 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ + +#include +#include + +#include "Time.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace builtin_interfaces { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type Time defined by the user in the IDL file. + * @ingroup TIME + */ +class TimePubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef Time type; + + eProsima_user_DllExport TimePubSubType(); + + eProsima_user_DllExport virtual ~TimePubSubType(); + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + new (memory) Time(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace builtin_interfaces + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsDomainParticipantImpl.cpp b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsDomainParticipantImpl.cpp new file mode 100644 index 00000000000..a767ea0ed0d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsDomainParticipantImpl.cpp @@ -0,0 +1,52 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/impl/DdsDomainParticipantImpl.h" + +#include +#include + +#include +#include + +#include "carla/Logging.h" + +namespace carla { +namespace ros2 { + +DdsDomainParticipantImpl::DdsDomainParticipantImpl() { + _factory = eprosima::fastdds::dds::DomainParticipantFactory::get_shared_instance(); + if (_factory == nullptr) { + carla::log_error("DdsDomainParticipantImpl(): Failed to acquire DomainParticipantFactory"); + return; + } + + const char *ros_domain_id_env = std::getenv("ROS_DOMAIN_ID"); + unsigned int ros_domain_id = 0; + if ( ros_domain_id_env != nullptr ) { + try { + ros_domain_id = (unsigned int)(std::atoi(ros_domain_id_env)); + } catch (...) { + ros_domain_id = 0; + } + } + auto pqos = eprosima::fastdds::dds::PARTICIPANT_QOS_DEFAULT; + pqos.name("carla-server"); + _participant = _factory->create_participant(ros_domain_id, pqos); + if (_participant == nullptr) { + carla::log_error("DdsDomainParticipantImpl(): Failed to create DomainParticipant"); + } + carla::log_debug("DdsDomainParticipantImpl::Constructor()"); +} + +DdsDomainParticipantImpl::~DdsDomainParticipantImpl() { + carla::log_debug("DdsDomainParticipantImpl::Destructor()"); + if ((_participant != nullptr) && (_factory != nullptr)) { + _factory->delete_participant(_participant); + _participant=nullptr; + } +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsDomainParticipantImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsDomainParticipantImpl.h new file mode 100644 index 00000000000..b30522ca649 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsDomainParticipantImpl.h @@ -0,0 +1,30 @@ + +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +namespace carla { +namespace ros2 { + +class DdsDomainParticipantImpl { +public: + DdsDomainParticipantImpl(); + ~DdsDomainParticipantImpl(); + + eprosima::fastdds::dds::DomainParticipant* GetDomainParticipant() { + return _participant; + } + +private: + eprosima::fastdds::dds::DomainParticipant* _participant{nullptr}; + // keep also a copy of the factory that the underlying DDS is keeping their stuff up + std::shared_ptr _factory; +}; + +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h new file mode 100644 index 00000000000..f22b5aff74a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h @@ -0,0 +1,186 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "builtin_interfaces/msg/Time.h" +#include "carla/ros2/impl/DdsDomainParticipantImpl.h" +#include "carla/ros2/impl/DdsQoS.h" +#include "carla/ros2/impl/DdsReturnCode.h" +#include "carla/ros2/publishers/PublisherInterface.h" + +namespace carla { +namespace ros2 { + +template +class DdsPublisherImpl : public PublisherInterface, eprosima::fastdds::dds::DataWriterListener { +public: + DdsPublisherImpl() = default; + + virtual ~DdsPublisherImpl() { + carla::log_debug("DdsPublisherImpl[", _topic != nullptr ? _topic->get_name() : "nulltopic", "]::Destructor()"); + if (_datawriter) { + _publisher->delete_datawriter(_datawriter); + _datawriter = nullptr; + } + + if (_publisher) { + _participant->delete_publisher(_publisher); + _publisher = nullptr; + } + + if (_topic) { + _participant->delete_topic(_topic); + _topic = nullptr; + } + } + + /** + * Initialize with PREALLOCATED_WITH_REALLOC_MEMORY_MODE memory policy. + * Use this initialization mode when dealing with larger sequence data types + * See //https://github.com/eProsima/Fast-DDS/issues/2330 for details + */ + bool InitHistoryPreallocatedWithReallocMemoryMode(std::shared_ptr domain_participant, + std::string topic_name, ROS2QoS qos) { + auto pubqos = PublisherQos(qos); + auto wqos = DataWriterQos(qos); + auto tqos = TopicQos(qos); + wqos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; + return InitInternal(domain_participant, topic_name, tqos, pubqos, wqos); + } + + bool Init(std::shared_ptr domain_participant, std::string topic_name, ROS2QoS qos) { + auto pubqos = PublisherQos(qos); + auto wqos = DataWriterQos(qos); + auto tqos = TopicQos(qos); + return InitInternal(domain_participant, topic_name, tqos, pubqos, wqos); + } + + bool Publish() override { + if ( !SubscribersConnected() ) { + carla::log_debug("DdsPublisherImpl[", _topic->get_name(), "]::Publish() No subscribers connected, skipping publish"); + return true; + } + if (_message_updated) { + carla::log_debug("DdsPublisherImpl[", _topic->get_name(), "]::Publishing() updated message"); + eprosima::fastrtps::rtps::InstanceHandle_t instance_handle; + auto rcode = _datawriter->write(&_message, instance_handle); + if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { + _message_updated = false; + } else { + carla::log_error("DdsPublisherImpl[", _topic->get_name(), "]::Publish() Failed to write data; Error ", + std::to_string(rcode)); + } + carla::log_debug("DdsPublisherImpl[", _topic->get_name(), "]::Publishing() done"); + } + return !_message_updated; + } + + /** + * Mark the message as updated. This is required to ensure the Publish() call sends the message actually out. + */ + void SetMessageUpdated() { + _message_updated = true; + } + + /** + * If the last message was sent out or the message has never been set to updated, this returns \c true + * indicating the publisher to be able to overwrite the message. + */ + bool WasMessagePublished() { + return !_message_updated; + } + + /** + * Initialize the message header. This function is only valid if the message type provided supports a header! + * Implicitly calls SetMessageUpdated() to mark the message to be updated, so that it is published by Publish(). + */ + void SetMessageHeader(const builtin_interfaces::msg::Time& stamp, const std::string& frame_id) { + _message.header().stamp(stamp); + _message.header().frame_id(frame_id); + SetMessageUpdated(); + } + + /** + * Access the message data + */ + MESSAGE_TYPE& Message() { + return _message; + } + + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override { + return _matched > 0; + } + +private: + bool InitInternal(std::shared_ptr domain_participant, std::string topic_name, + eprosima::fastdds::dds::TopicQos const& tqos, eprosima::fastdds::dds::PublisherQos const& pubqos, + eprosima::fastdds::dds::DataWriterQos const& wqos) { + carla::log_debug("DdsPublisherImpl[", topic_name, "]::Init()"); + + if (_type == nullptr) { + carla::log_error("DdsPublisherImpl::Init() Invalid TypeSupport"); + return false; + } + + _participant = domain_participant->GetDomainParticipant(); + if (_participant == nullptr) { + carla::log_error("DdsPublisherImpl[", _type->getName(), "]::Init() Invalid Participant"); + return false; + } + + _type.register_type(_participant); + + _publisher = _participant->create_publisher(pubqos); + if (_publisher == nullptr) { + carla::log_error("DdsPublisherImpl[", _type->getName(), "]::Init() Failed to create Publisher"); + return false; + } + + _topic = _participant->create_topic(topic_name, _type->getName(), tqos); + if (_topic == nullptr) { + carla::log_error("DdsPublisherImpl[", _type->getName(), "]::Init() Failed to create Topic for ", topic_name); + return false; + } + + eprosima::fastdds::dds::DataWriterListener* listener = + static_cast(this); + _datawriter = _publisher->create_datawriter(_topic, wqos, listener); + if (_datawriter == nullptr) { + carla::log_error("DdsPublisherImpl[", _topic->get_name(), "]::Init() Failed to create DataWriter"); + return false; + } + return true; + } + + void on_publication_matched(eprosima::fastdds::dds::DataWriter*, + const eprosima::fastdds::dds::PublicationMatchedStatus& info) override { + _matched = info.current_count; + carla::log_debug("DdsPublisherImpl[", _topic->get_name(), "]::on_publication_matched(): ", _matched); + } + + eprosima::fastdds::dds::DomainParticipant* _participant{nullptr}; + eprosima::fastdds::dds::Publisher* _publisher{nullptr}; + eprosima::fastdds::dds::Topic* _topic{nullptr}; + eprosima::fastdds::dds::DataWriter* _datawriter{nullptr}; + eprosima::fastdds::dds::TypeSupport _type{new MESSAGE_PUB_TYPE()}; + MESSAGE_TYPE _message{}; + int _matched{0}; + bool _message_updated{false}; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h new file mode 100644 index 00000000000..4d39c51089e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h @@ -0,0 +1,68 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include +#include +#include +#include +#include "carla/ros2/ROS2QoS.h" + +namespace carla { +namespace ros2 { + +template +FAST_DDS_QOS_TYPE FastDdsQos(ROS2QoS const &qos) { + FAST_DDS_QOS_TYPE fast_dds_qos = fast_dds_default_qos; + + if (qos._reliability == ROS2QoS::Reliability::BEST_EFFORT) { + fast_dds_qos.reliability().kind = eprosima::fastdds::dds::ReliabilityQosPolicyKind::BEST_EFFORT_RELIABILITY_QOS; + } else if (qos._reliability == ROS2QoS::Reliability::RELIABLE) { + fast_dds_qos.reliability().kind = eprosima::fastdds::dds::ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS; + } + + if (qos._durability == ROS2QoS::Durability::VOLATILE) { + fast_dds_qos.durability().kind = eprosima::fastdds::dds::DurabilityQosPolicyKind::VOLATILE_DURABILITY_QOS; + } else if (qos._durability == ROS2QoS::Durability::TRANSIENT_LOCAL) { + fast_dds_qos.durability().kind = eprosima::fastdds::dds::DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS; + } + + if (qos._history == ROS2QoS::History::KEEP_LAST) { + fast_dds_qos.history().kind = eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS; + fast_dds_qos.history().depth = qos._history_depth; + } else if (qos._history == ROS2QoS::History::KEEP_ALL) { + fast_dds_qos.history().kind = eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_ALL_HISTORY_QOS; + fast_dds_qos.history().depth = qos._history_depth; + } + return fast_dds_qos; +} + +inline eprosima::fastdds::dds::TopicQos TopicQos(ROS2QoS const &qos) { + return FastDdsQos(qos); +} + +inline eprosima::fastdds::dds::DataWriterQos DataWriterQos(ROS2QoS const &qos) { + return FastDdsQos(qos); +} + +inline eprosima::fastdds::dds::DataReaderQos DataReaderQos(ROS2QoS const &qos) { + return FastDdsQos(qos); +} + +inline eprosima::fastdds::dds::PublisherQos PublisherQos(ROS2QoS const &qos) { + (void)qos; + eprosima::fastdds::dds::PublisherQos pubqos = eprosima::fastdds::dds::PUBLISHER_QOS_DEFAULT; + return pubqos; +} + +inline eprosima::fastdds::dds::SubscriberQos SubscriberQos(ROS2QoS const &qos) { + (void)qos; + eprosima::fastdds::dds::SubscriberQos subqos = eprosima::fastdds::dds::SUBSCRIBER_QOS_DEFAULT; + return subqos; +} + +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsReturnCode.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsReturnCode.h new file mode 100644 index 00000000000..295785c7934 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsReturnCode.h @@ -0,0 +1,48 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include + +namespace std { + +inline std::string to_string(eprosima::fastrtps::types::ReturnCode_t rcode) { + switch (rcode()) { + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK: + return "RETCODE_OK"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_ERROR: + return "RETCODE_ERROR"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_UNSUPPORTED: + return "RETCODE_UNSUPPORTED"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_BAD_PARAMETER: + return "RETCODE_BAD_PARAMETER"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_PRECONDITION_NOT_MET: + return "RETCODE_PRECONDITION_NOT_MET"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OUT_OF_RESOURCES: + return "RETCODE_OUT_OF_RESOURCES"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_NOT_ENABLED: + return "RETCODE_NOT_ENABLED"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_IMMUTABLE_POLICY: + return "RETCODE_IMMUTABLE_POLICY"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_INCONSISTENT_POLICY: + return "RETCODE_INCONSISTENT_POLICY"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_ALREADY_DELETED: + return "RETCODE_ALREADY_DELETED"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_TIMEOUT: + return "RETCODE_TIMEOUT"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_NO_DATA: + return "RETCODE_NO_DATA"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_ILLEGAL_OPERATION: + return "RETCODE_ILLEGAL_OPERATION"; + case eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_NOT_ALLOWED_BY_SECURITY: + return "RETCODE_NOT_ALLOWED_BY_SECURITY"; + default: + return "UNKNOWN"; + } +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h new file mode 100644 index 00000000000..c675cfae23d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h @@ -0,0 +1,215 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "carla/Logging.h" +#include "carla/ros2/impl/DdsDomainParticipantImpl.h" +#include "carla/ros2/impl/DdsQoS.h" +#include "carla/ros2/impl/DdsReturnCode.h" +#include "carla/ros2/services/ServiceInterface.h" + +namespace carla { +namespace ros2 { + +template +class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::DataReaderListener { +public: + DdsServiceImpl() = default; + + virtual ~DdsServiceImpl() { + carla::log_debug("DdsServiceImpl[", _request_topic != nullptr ? _request_topic->get_name() : "nulltopic", + "]::Destructor()"); + + if (_datawriter) { + _publisher->delete_datawriter(_datawriter); + _datawriter = nullptr; + } + + if (_publisher) { + _participant->delete_publisher(_publisher); + _publisher = nullptr; + } + + if (_response_topic) { + _participant->delete_topic(_response_topic); + _response_topic = nullptr; + } + + if (_datareader) { + _subscriber->delete_datareader(_datareader); + _datareader = nullptr; + } + + if (_subscriber) { + _participant->delete_subscriber(_subscriber); + _subscriber = nullptr; + } + + if (_request_topic) { + _participant->delete_topic(_request_topic); + _request_topic = nullptr; + } + } + + bool Init(std::shared_ptr domain_participant, std::string topic_name) { + carla::log_debug("DdsServiceImpl[", topic_name, "]::Init()"); + + _participant = domain_participant->GetDomainParticipant(); + if (_participant == nullptr) { + carla::log_error("DdsServiceImpl[", topic_name, "]::Init(): Invalid Participant"); + return false; + } + + auto request_name = topic_name + "Request"; + request_name.replace(0u, 2u, "rq"); + if (_request_type == nullptr) { + carla::log_error("DdsServiceImpl[", topic_name, "]::Init(): Invalid Request TypeSupport"); + return false; + } + _request_type.register_type(_participant); + auto topic_qos = eprosima::fastdds::dds::TOPIC_QOS_DEFAULT; + topic_qos.history().kind = eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS; + topic_qos.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; + _request_topic = + _participant->create_topic(request_name, _request_type->getName(), topic_qos); + if (_request_topic == nullptr) { + carla::log_error("DdsServiceImpl[", topic_name, "]::Init(): Failed to create Request Topic"); + return false; + } + auto subscriber_qos= eprosima::fastdds::dds::SUBSCRIBER_QOS_DEFAULT; + _subscriber = _participant->create_subscriber(subscriber_qos); + if (_subscriber == nullptr) { + carla::log_error("DdsServiceImpl[", topic_name, "]::Init(): Failed to create Subscriber"); + return false; + } + eprosima::fastdds::dds::DataReaderListener* reader_listener = + static_cast(this); + auto datareader_qos = eprosima::fastdds::dds::DATAREADER_QOS_DEFAULT; + datareader_qos.history().kind = eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS; + datareader_qos.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; + _datareader = + _subscriber->create_datareader(_request_topic, datareader_qos, reader_listener); + if (_datareader == nullptr) { + carla::log_error("DdsServiceImpl[", topic_name, "]::Init(): Failed to create DataReader"); + return false; + } + + auto response_name = topic_name + "Reply"; + response_name.replace(0u, 2u, "rr"); + if (_resonse_type == nullptr) { + carla::log_error("DdsServiceImpl[", topic_name, "]::Init(): Invalid Response TypeSupport"); + return false; + } + _resonse_type.register_type(_participant); + _response_topic = + _participant->create_topic(response_name, _resonse_type->getName(), topic_qos); + if (_response_topic == nullptr) { + carla::log_error("DdsServiceImpl[", topic_name, "]::Init(): Failed to create Response Topic"); + return false; + } + auto publisher_qos = eprosima::fastdds::dds::PUBLISHER_QOS_DEFAULT; + _publisher = _participant->create_publisher(publisher_qos); + if (_publisher == nullptr) { + carla::log_error("DdsServiceImpl[", _response_topic->get_name(), "]::Init() Failed to create Publisher"); + return false; + } + + auto writer_qos = eprosima::fastdds::dds::DATAWRITER_QOS_DEFAULT; + writer_qos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; + writer_qos.history().kind = eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS; + writer_qos.durability().kind = eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS; + writer_qos.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; + _datawriter = _publisher->create_datawriter(_response_topic, writer_qos); + if (_datawriter == nullptr) { + carla::log_error("DdsServiceImpl[", _response_topic->get_name(), "]::Init() Failed to create DataWriter"); + return false; + } + + return true; + } + + using ServiceCallbackType = std::function; + void SetServiceCallback(ServiceCallbackType callback) { + _callback = callback; + } + + void on_data_available(eprosima::fastdds::dds::DataReader* reader) override { + eprosima::fastdds::dds::SampleInfo info; + REQUEST_TYPE request; + auto rcode = reader->take_next_sample(&request, &info); + if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { + if (eprosima::fastdds::dds::InstanceStateKind::ALIVE_INSTANCE_STATE == info.instance_state) { + carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::on_data_available(): Incoming request "); + _incoming_requests.push_back({request, info.sample_identity}); + } else { + carla::log_error("DdsServiceImpl[", _request_topic->get_name(), + "]::on_data_available(): Error not a request instance"); + } + } else { + carla::log_error("DdsServiceImpl[", _request_topic->get_name(), "]::on_data_available(): Error ", + std::to_string(rcode)); + } + } + + void CheckRequest() override { + if (!_callback) { + carla::log_warning("DdsServiceImpl[", _request_topic->get_name(), "]::CheckRequest(): No callback defined yet"); + return; + } + while (!_incoming_requests.empty()) { + carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::CheckRequest(): New Request"); + auto const incoming_request = _incoming_requests.front(); + RESPONSE_TYPE response = _callback(incoming_request._request); + carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), "]::CheckRequest(): Callback returned"); + + eprosima::fastrtps::rtps::WriteParams write_params; + write_params.related_sample_identity() = incoming_request._request_identity; + auto rcode = _datawriter->write(reinterpret_cast(&response), write_params); + if (rcode != bool(eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK)) { + // strange: getting error while the result is actually sent out + carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), + "]::CheckRequest() Failed to write data; Error ", std::to_string(rcode)); + } + carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), "]::CheckRequest() Response sent"); + + _incoming_requests.pop_front(); + } + } + +private: + eprosima::fastdds::dds::DomainParticipant* _participant{nullptr}; + + eprosima::fastdds::dds::TypeSupport _request_type{new REQUEST_PUB_TYPE()}; + eprosima::fastdds::dds::Topic* _request_topic{nullptr}; + eprosima::fastdds::dds::Subscriber* _subscriber{nullptr}; + eprosima::fastdds::dds::DataReader* _datareader{nullptr}; + + eprosima::fastdds::dds::TypeSupport _resonse_type{new RESPONSE_PUB_TYPE()}; + eprosima::fastdds::dds::Topic* _response_topic{nullptr}; + eprosima::fastdds::dds::Publisher* _publisher{nullptr}; + eprosima::fastdds::dds::DataWriter* _datawriter{nullptr}; + + ServiceCallbackType _callback{nullptr}; + + struct IncomingRequest { + REQUEST_TYPE _request{}; + eprosima::fastrtps::rtps::SampleIdentity _request_identity; + }; + std::deque _incoming_requests; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsSubscriberImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsSubscriberImpl.h new file mode 100644 index 00000000000..76585a492a6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsSubscriberImpl.h @@ -0,0 +1,170 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "carla/Logging.h" +#include "carla/ros2/impl/DdsDomainParticipantImpl.h" +#include "carla/ros2/impl/DdsQoS.h" +#include "carla/ros2/impl/DdsReturnCode.h" +#include "carla/ros2/subscribers/SubscriberImplBase.h" + +namespace carla { +namespace ros2 { + +template +class DdsSubscriberImpl : public SubscriberImplBase, public eprosima::fastdds::dds::DataReaderListener { +public: + using SubscriberImplBase::AddPublisher; + using SubscriberImplBase::NumberPublishersConnected; + using SubscriberImplBase::RemovePublisher; + using SubscriberImplBase::HasPublishersConnected; + using SubscriberImplBase::AddMessage; + + DdsSubscriberImpl(SubscriberBase& parent) : SubscriberImplBase(parent) {} + + virtual ~DdsSubscriberImpl() { + carla::log_debug("DdsSubscriberImpl[", _topic->get_name(), "]::Destructor()"); + + if (_datareader) { + _subscriber->delete_datareader(_datareader); + _datareader = nullptr; + } + + if (_subscriber) { + _participant->delete_subscriber(_subscriber); + _subscriber = nullptr; + } + + if (_topic) { + _participant->delete_topic(_topic); + _topic = nullptr; + } + } + + bool Init(std::shared_ptr domain_participant, std::string topic_name, ROS2QoS qos) { + auto subqos = SubscriberQos(qos); + auto rqos = DataReaderQos(qos); + auto tqos = TopicQos(qos); + return InitInternal(domain_participant, topic_name, tqos, subqos, rqos); + } + + void on_subscription_matched(eprosima::fastdds::dds::DataReader* reader, + const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override { + auto const publisher_guid = GetPublisherGuid(info.last_publication_handle); + bool had_connected_publisher = HasPublishersConnected(); + + if (info.current_count_change < 0) { + RemovePublisher(publisher_guid); + carla::log_debug("DdsSubscriberImpl[", _topic->get_name(), "]::on_subscription_matched(", publisher_guid, + ") publisher disconnected. Connected publisher remaining: ", NumberPublishersConnected()); + } else { + AddPublisher(publisher_guid); + carla::log_debug("DdsSubscriberImpl[", _topic->get_name(), "]::on_subscription_matched(", publisher_guid, + ") publisher connected. Connected publisher: ", NumberPublishersConnected()); + } + + if (info.current_count != NumberPublishersConnected()) { + carla::log_error("DdsSubscriberImpl[", _topic->get_name(), "]::on_subscription_matched(", publisher_guid, + "): current_count=", info.current_count, + ", but publisher list not yet empty. Connected publisher: ", NumberPublishersConnected()); + } + carla::log_debug("DdsSubscriberImpl[", _topic->get_name(), "]::on_subscription_matched(", publisher_guid, + "): interface has" + " total_count=", + info.total_count, " total_count_change=", info.total_count_change, + " current_count=", info.current_count, " current_count_change=", info.current_count_change, + " handle-id=", info.last_publication_handle, " matched subscriptions and currently ", + NumberPublishersConnected(), " publisher connected."); + } + + void on_data_available(eprosima::fastdds::dds::DataReader* reader) override { + eprosima::fastdds::dds::SampleInfo info; + MESSAGE_TYPE message; + auto rcode = reader->take_next_sample(&message, &info); + auto const publisher_guid = GetPublisherGuid(info.publication_handle); + if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { + AddMessage(publisher_guid, message); + carla::log_debug("DdsSubscriberImpl[", _topic->get_name(), "]::on_data_available(): from client ", publisher_guid, + "and handle: ", info.publication_handle); + } else { + carla::log_error("DdsSubscriberImpl[", _topic->get_name(), "]::on_data_available(): Error ", + std::to_string(rcode)); + } + } + + bool InitInternal(std::shared_ptr domain_participant, std::string topic_name, + eprosima::fastdds::dds::TopicQos const& tqos, eprosima::fastdds::dds::SubscriberQos const& subqos, + eprosima::fastdds::dds::DataReaderQos const& rqos) { + carla::log_debug("DdsSubscriberImpl[", topic_name, "]::Init()"); + + _participant = domain_participant->GetDomainParticipant(); + if (_participant == nullptr) { + carla::log_error("DdsSubscriberImpl[", topic_name, "]::Init(): Invalid Participant"); + return false; + } + + if (_type == nullptr) { + carla::log_error("DdsSubscriberImpl[", topic_name, "]::Init(): Invalid TypeSupport"); + return false; + } + + _type.register_type(_participant); + + _subscriber = _participant->create_subscriber(subqos); + if (_subscriber == nullptr) { + carla::log_error("DdsSubscriberImpl[", topic_name, "]::Init(): Failed to create Subscriber"); + return false; + } + + _topic = _participant->create_topic(topic_name, _type->getName(), tqos); + if (_topic == nullptr) { + carla::log_error("DdsSubscriberImpl[", topic_name, "]::Init(): Failed to create Topic"); + return false; + } + + eprosima::fastdds::dds::DataReaderListener* listener = + static_cast(this); + _datareader = _subscriber->create_datareader(_topic, rqos, listener); + if (_datareader == nullptr) { + carla::log_error("DdsSubscriberImpl[", topic_name, "]::Init(): Failed to create DataReader"); + return false; + } + return true; + } + + std::string GetPublisherGuid( + eprosima::fastdds::dds::InstanceHandle_t const& instance_handle) { + auto insert_result = _instance_handles.insert({instance_handle, ""}); + if ( insert_result.second ) { + // only perform the conversion from GUID to string once when inserted first time + eprosima::fastrtps::rtps::GUID_t guid(insert_result.first->first); + std::stringstream namestream; + namestream << guid; + insert_result.first->second = namestream.str(); + } + return insert_result.first->second; + } + + eprosima::fastdds::dds::DomainParticipant* _participant{nullptr}; + eprosima::fastdds::dds::Subscriber* _subscriber{nullptr}; + eprosima::fastdds::dds::Topic* _topic{nullptr}; + eprosima::fastdds::dds::DataReader* _datareader{nullptr}; + eprosima::fastdds::dds::TypeSupport _type{new MESSAGE_PUB_TYPE()}; + + std::map _instance_handles; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.cxx new file mode 100644 index 00000000000..e6d497ed577 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.cxx @@ -0,0 +1,312 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorBlueprint.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaActorBlueprint.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaActorBlueprint::CarlaActorBlueprint() +{ + // m_id com.eprosima.idl.parser.typecode.StringTypeCode@2b4a2ec7 + m_id =""; + // m_tags com.eprosima.idl.parser.typecode.SequenceTypeCode@564718df + + // m_attributes com.eprosima.idl.parser.typecode.SequenceTypeCode@51b7e5df + + +} + +carla_msgs::msg::CarlaActorBlueprint::~CarlaActorBlueprint() +{ + + +} + +carla_msgs::msg::CarlaActorBlueprint::CarlaActorBlueprint( + const CarlaActorBlueprint& x) +{ + m_id = x.m_id; + m_tags = x.m_tags; + m_attributes = x.m_attributes; +} + +carla_msgs::msg::CarlaActorBlueprint::CarlaActorBlueprint( + CarlaActorBlueprint&& x) +{ + m_id = std::move(x.m_id); + m_tags = std::move(x.m_tags); + m_attributes = std::move(x.m_attributes); +} + +carla_msgs::msg::CarlaActorBlueprint& carla_msgs::msg::CarlaActorBlueprint::operator =( + const CarlaActorBlueprint& x) +{ + + m_id = x.m_id; + m_tags = x.m_tags; + m_attributes = x.m_attributes; + + return *this; +} + +carla_msgs::msg::CarlaActorBlueprint& carla_msgs::msg::CarlaActorBlueprint::operator =( + CarlaActorBlueprint&& x) +{ + + m_id = std::move(x.m_id); + m_tags = std::move(x.m_tags); + m_attributes = std::move(x.m_attributes); + + return *this; +} + +bool carla_msgs::msg::CarlaActorBlueprint::operator ==( + const CarlaActorBlueprint& x) const +{ + + return (m_id == x.m_id && m_tags == x.m_tags && m_attributes == x.m_attributes); +} + +bool carla_msgs::msg::CarlaActorBlueprint::operator !=( + const CarlaActorBlueprint& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaActorBlueprint::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += diagnostic_msgs::msg::KeyValue::getMaxCdrSerializedSize(current_alignment);} + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaActorBlueprint::getCdrSerializedSize( + const carla_msgs::msg::CarlaActorBlueprint& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.id().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.tags().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + + data.tags().at(a).size() + 1; + } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.attributes().size(); ++a) + { + current_alignment += diagnostic_msgs::msg::KeyValue::getCdrSerializedSize(data.attributes().at(a), current_alignment);} + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaActorBlueprint::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_id; + scdr << m_tags;scdr << m_attributes; + +} + +void carla_msgs::msg::CarlaActorBlueprint::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_id; + dcdr >> m_tags; + dcdr >> m_attributes; +} + +/*! + * @brief This function copies the value in member id + * @param _id New value to be copied in member id + */ +void carla_msgs::msg::CarlaActorBlueprint::id( + const std::string& _id) +{ + m_id = _id; +} + +/*! + * @brief This function moves the value in member id + * @param _id New value to be moved in member id + */ +void carla_msgs::msg::CarlaActorBlueprint::id( + std::string&& _id) +{ + m_id = std::move(_id); +} + +/*! + * @brief This function returns a constant reference to member id + * @return Constant reference to member id + */ +const std::string& carla_msgs::msg::CarlaActorBlueprint::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +std::string& carla_msgs::msg::CarlaActorBlueprint::id() +{ + return m_id; +} +/*! + * @brief This function copies the value in member tags + * @param _tags New value to be copied in member tags + */ +void carla_msgs::msg::CarlaActorBlueprint::tags( + const std::vector& _tags) +{ + m_tags = _tags; +} + +/*! + * @brief This function moves the value in member tags + * @param _tags New value to be moved in member tags + */ +void carla_msgs::msg::CarlaActorBlueprint::tags( + std::vector&& _tags) +{ + m_tags = std::move(_tags); +} + +/*! + * @brief This function returns a constant reference to member tags + * @return Constant reference to member tags + */ +const std::vector& carla_msgs::msg::CarlaActorBlueprint::tags() const +{ + return m_tags; +} + +/*! + * @brief This function returns a reference to member tags + * @return Reference to member tags + */ +std::vector& carla_msgs::msg::CarlaActorBlueprint::tags() +{ + return m_tags; +} +/*! + * @brief This function copies the value in member attributes + * @param _attributes New value to be copied in member attributes + */ +void carla_msgs::msg::CarlaActorBlueprint::attributes( + const std::vector& _attributes) +{ + m_attributes = _attributes; +} + +/*! + * @brief This function moves the value in member attributes + * @param _attributes New value to be moved in member attributes + */ +void carla_msgs::msg::CarlaActorBlueprint::attributes( + std::vector&& _attributes) +{ + m_attributes = std::move(_attributes); +} + +/*! + * @brief This function returns a constant reference to member attributes + * @return Constant reference to member attributes + */ +const std::vector& carla_msgs::msg::CarlaActorBlueprint::attributes() const +{ + return m_attributes; +} + +/*! + * @brief This function returns a reference to member attributes + * @return Reference to member attributes + */ +std::vector& carla_msgs::msg::CarlaActorBlueprint::attributes() +{ + return m_attributes; +} + +size_t carla_msgs::msg::CarlaActorBlueprint::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaActorBlueprint::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaActorBlueprint::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.h new file mode 100644 index 00000000000..64f09476123 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.h @@ -0,0 +1,269 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorBlueprint.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_H_ + +#include "diagnostic_msgs/msg/KeyValue.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaActorBlueprint_SOURCE) +#define CarlaActorBlueprint_DllAPI __declspec( dllexport ) +#else +#define CarlaActorBlueprint_DllAPI __declspec( dllimport ) +#endif // CarlaActorBlueprint_SOURCE +#else +#define CarlaActorBlueprint_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaActorBlueprint_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaActorBlueprint defined by the user in the IDL file. + * @ingroup CARLAACTORBLUEPRINT + */ + class CarlaActorBlueprint + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaActorBlueprint(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaActorBlueprint(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. + */ + eProsima_user_DllExport CarlaActorBlueprint( + const CarlaActorBlueprint& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. + */ + eProsima_user_DllExport CarlaActorBlueprint( + CarlaActorBlueprint&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. + */ + eProsima_user_DllExport CarlaActorBlueprint& operator =( + const CarlaActorBlueprint& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. + */ + eProsima_user_DllExport CarlaActorBlueprint& operator =( + CarlaActorBlueprint&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorBlueprint object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaActorBlueprint& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorBlueprint object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaActorBlueprint& x) const; + + /*! + * @brief This function copies the value in member id + * @param _id New value to be copied in member id + */ + eProsima_user_DllExport void id( + const std::string& _id); + + /*! + * @brief This function moves the value in member id + * @param _id New value to be moved in member id + */ + eProsima_user_DllExport void id( + std::string&& _id); + + /*! + * @brief This function returns a constant reference to member id + * @return Constant reference to member id + */ + eProsima_user_DllExport const std::string& id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport std::string& id(); + /*! + * @brief This function copies the value in member tags + * @param _tags New value to be copied in member tags + */ + eProsima_user_DllExport void tags( + const std::vector& _tags); + + /*! + * @brief This function moves the value in member tags + * @param _tags New value to be moved in member tags + */ + eProsima_user_DllExport void tags( + std::vector&& _tags); + + /*! + * @brief This function returns a constant reference to member tags + * @return Constant reference to member tags + */ + eProsima_user_DllExport const std::vector& tags() const; + + /*! + * @brief This function returns a reference to member tags + * @return Reference to member tags + */ + eProsima_user_DllExport std::vector& tags(); + /*! + * @brief This function copies the value in member attributes + * @param _attributes New value to be copied in member attributes + */ + eProsima_user_DllExport void attributes( + const std::vector& _attributes); + + /*! + * @brief This function moves the value in member attributes + * @param _attributes New value to be moved in member attributes + */ + eProsima_user_DllExport void attributes( + std::vector&& _attributes); + + /*! + * @brief This function returns a constant reference to member attributes + * @return Constant reference to member attributes + */ + eProsima_user_DllExport const std::vector& attributes() const; + + /*! + * @brief This function returns a reference to member attributes + * @return Reference to member attributes + */ + eProsima_user_DllExport std::vector& attributes(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaActorBlueprint& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::string m_id; + std::vector m_tags; + std::vector m_attributes; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.cxx new file mode 100644 index 00000000000..cf6a7ea9199 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorBlueprintPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaActorBlueprintPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaActorBlueprintPubSubType::CarlaActorBlueprintPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaActorBlueprint_"); + auto type_size = CarlaActorBlueprint::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaActorBlueprint::isKeyDefined(); + size_t keyLength = CarlaActorBlueprint::getKeyMaxCdrSerializedSize() > 16 ? + CarlaActorBlueprint::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaActorBlueprintPubSubType::~CarlaActorBlueprintPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaActorBlueprintPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaActorBlueprint* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaActorBlueprintPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaActorBlueprint* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaActorBlueprintPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaActorBlueprintPubSubType::createData() + { + return reinterpret_cast(new CarlaActorBlueprint()); + } + + void CarlaActorBlueprintPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaActorBlueprintPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaActorBlueprint* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaActorBlueprint::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaActorBlueprint::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h new file mode 100644 index 00000000000..9d5a2a9f4cc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorBlueprintPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaActorBlueprint.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaActorBlueprint is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaActorBlueprint defined by the user in the IDL file. + * @ingroup CARLAACTORBLUEPRINT + */ + class CarlaActorBlueprintPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaActorBlueprint type; + + eProsima_user_DllExport CarlaActorBlueprintPubSubType(); + + eProsima_user_DllExport virtual ~CarlaActorBlueprintPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx new file mode 100644 index 00000000000..7295748ccc0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx @@ -0,0 +1,528 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorInfo.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaActorInfo.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaActorInfo::CarlaActorInfo() +{ + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@17c1bced + m_id = 0; + // m_parent_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2d9d4f9d + m_parent_id = 0; + // m_type com.eprosima.idl.parser.typecode.StringTypeCode@4034c28c + m_type =""; + // m_rosname com.eprosima.idl.parser.typecode.StringTypeCode@e50a6f6 + m_rosname =""; + // m_rolename com.eprosima.idl.parser.typecode.StringTypeCode@358c99f5 + m_rolename =""; + // m_object_type com.eprosima.idl.parser.typecode.StringTypeCode@3ee0fea4 + m_object_type =""; + // m_base_type com.eprosima.idl.parser.typecode.StringTypeCode@48524010 + m_base_type =""; + // m_topic_prefix com.eprosima.idl.parser.typecode.StringTypeCode@4b168fa9 + m_topic_prefix =""; + +} + +carla_msgs::msg::CarlaActorInfo::~CarlaActorInfo() +{ + + + + + + + +} + +carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( + const CarlaActorInfo& x) +{ + m_id = x.m_id; + m_parent_id = x.m_parent_id; + m_type = x.m_type; + m_rosname = x.m_rosname; + m_rolename = x.m_rolename; + m_object_type = x.m_object_type; + m_base_type = x.m_base_type; + m_topic_prefix = x.m_topic_prefix; +} + +carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( + CarlaActorInfo&& x) +{ + m_id = x.m_id; + m_parent_id = x.m_parent_id; + m_type = std::move(x.m_type); + m_rosname = std::move(x.m_rosname); + m_rolename = std::move(x.m_rolename); + m_object_type = std::move(x.m_object_type); + m_base_type = std::move(x.m_base_type); + m_topic_prefix = std::move(x.m_topic_prefix); +} + +carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( + const CarlaActorInfo& x) +{ + + m_id = x.m_id; + m_parent_id = x.m_parent_id; + m_type = x.m_type; + m_rosname = x.m_rosname; + m_rolename = x.m_rolename; + m_object_type = x.m_object_type; + m_base_type = x.m_base_type; + m_topic_prefix = x.m_topic_prefix; + + return *this; +} + +carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( + CarlaActorInfo&& x) +{ + + m_id = x.m_id; + m_parent_id = x.m_parent_id; + m_type = std::move(x.m_type); + m_rosname = std::move(x.m_rosname); + m_rolename = std::move(x.m_rolename); + m_object_type = std::move(x.m_object_type); + m_base_type = std::move(x.m_base_type); + m_topic_prefix = std::move(x.m_topic_prefix); + + return *this; +} + +bool carla_msgs::msg::CarlaActorInfo::operator ==( + const CarlaActorInfo& x) const +{ + + return (m_id == x.m_id && m_parent_id == x.m_parent_id && m_type == x.m_type && m_rosname == x.m_rosname && m_rolename == x.m_rolename && m_object_type == x.m_object_type && m_base_type == x.m_base_type && m_topic_prefix == x.m_topic_prefix); +} + +bool carla_msgs::msg::CarlaActorInfo::operator !=( + const CarlaActorInfo& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaActorInfo::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaActorInfo::getCdrSerializedSize( + const carla_msgs::msg::CarlaActorInfo& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.rosname().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.rolename().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.object_type().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.base_type().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.topic_prefix().size() + 1; + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaActorInfo::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_id; + scdr << m_parent_id; + scdr << m_type; + scdr << m_rosname; + scdr << m_rolename; + scdr << m_object_type; + scdr << m_base_type; + scdr << m_topic_prefix; + +} + +void carla_msgs::msg::CarlaActorInfo::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_id; + dcdr >> m_parent_id; + dcdr >> m_type; + dcdr >> m_rosname; + dcdr >> m_rolename; + dcdr >> m_object_type; + dcdr >> m_base_type; + dcdr >> m_topic_prefix; +} + +/*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ +void carla_msgs::msg::CarlaActorInfo::id( + uint32_t _id) +{ + m_id = _id; +} + +/*! + * @brief This function returns the value of member id + * @return Value of member id + */ +uint32_t carla_msgs::msg::CarlaActorInfo::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +uint32_t& carla_msgs::msg::CarlaActorInfo::id() +{ + return m_id; +} + +/*! + * @brief This function sets a value in member parent_id + * @param _parent_id New value for member parent_id + */ +void carla_msgs::msg::CarlaActorInfo::parent_id( + uint32_t _parent_id) +{ + m_parent_id = _parent_id; +} + +/*! + * @brief This function returns the value of member parent_id + * @return Value of member parent_id + */ +uint32_t carla_msgs::msg::CarlaActorInfo::parent_id() const +{ + return m_parent_id; +} + +/*! + * @brief This function returns a reference to member parent_id + * @return Reference to member parent_id + */ +uint32_t& carla_msgs::msg::CarlaActorInfo::parent_id() +{ + return m_parent_id; +} + +/*! + * @brief This function copies the value in member type + * @param _type New value to be copied in member type + */ +void carla_msgs::msg::CarlaActorInfo::type( + const std::string& _type) +{ + m_type = _type; +} + +/*! + * @brief This function moves the value in member type + * @param _type New value to be moved in member type + */ +void carla_msgs::msg::CarlaActorInfo::type( + std::string&& _type) +{ + m_type = std::move(_type); +} + +/*! + * @brief This function returns a constant reference to member type + * @return Constant reference to member type + */ +const std::string& carla_msgs::msg::CarlaActorInfo::type() const +{ + return m_type; +} + +/*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ +std::string& carla_msgs::msg::CarlaActorInfo::type() +{ + return m_type; +} +/*! + * @brief This function copies the value in member rosname + * @param _rosname New value to be copied in member rosname + */ +void carla_msgs::msg::CarlaActorInfo::rosname( + const std::string& _rosname) +{ + m_rosname = _rosname; +} + +/*! + * @brief This function moves the value in member rosname + * @param _rosname New value to be moved in member rosname + */ +void carla_msgs::msg::CarlaActorInfo::rosname( + std::string&& _rosname) +{ + m_rosname = std::move(_rosname); +} + +/*! + * @brief This function returns a constant reference to member rosname + * @return Constant reference to member rosname + */ +const std::string& carla_msgs::msg::CarlaActorInfo::rosname() const +{ + return m_rosname; +} + +/*! + * @brief This function returns a reference to member rosname + * @return Reference to member rosname + */ +std::string& carla_msgs::msg::CarlaActorInfo::rosname() +{ + return m_rosname; +} +/*! + * @brief This function copies the value in member rolename + * @param _rolename New value to be copied in member rolename + */ +void carla_msgs::msg::CarlaActorInfo::rolename( + const std::string& _rolename) +{ + m_rolename = _rolename; +} + +/*! + * @brief This function moves the value in member rolename + * @param _rolename New value to be moved in member rolename + */ +void carla_msgs::msg::CarlaActorInfo::rolename( + std::string&& _rolename) +{ + m_rolename = std::move(_rolename); +} + +/*! + * @brief This function returns a constant reference to member rolename + * @return Constant reference to member rolename + */ +const std::string& carla_msgs::msg::CarlaActorInfo::rolename() const +{ + return m_rolename; +} + +/*! + * @brief This function returns a reference to member rolename + * @return Reference to member rolename + */ +std::string& carla_msgs::msg::CarlaActorInfo::rolename() +{ + return m_rolename; +} +/*! + * @brief This function copies the value in member object_type + * @param _object_type New value to be copied in member object_type + */ +void carla_msgs::msg::CarlaActorInfo::object_type( + const std::string& _object_type) +{ + m_object_type = _object_type; +} + +/*! + * @brief This function moves the value in member object_type + * @param _object_type New value to be moved in member object_type + */ +void carla_msgs::msg::CarlaActorInfo::object_type( + std::string&& _object_type) +{ + m_object_type = std::move(_object_type); +} + +/*! + * @brief This function returns a constant reference to member object_type + * @return Constant reference to member object_type + */ +const std::string& carla_msgs::msg::CarlaActorInfo::object_type() const +{ + return m_object_type; +} + +/*! + * @brief This function returns a reference to member object_type + * @return Reference to member object_type + */ +std::string& carla_msgs::msg::CarlaActorInfo::object_type() +{ + return m_object_type; +} +/*! + * @brief This function copies the value in member base_type + * @param _base_type New value to be copied in member base_type + */ +void carla_msgs::msg::CarlaActorInfo::base_type( + const std::string& _base_type) +{ + m_base_type = _base_type; +} + +/*! + * @brief This function moves the value in member base_type + * @param _base_type New value to be moved in member base_type + */ +void carla_msgs::msg::CarlaActorInfo::base_type( + std::string&& _base_type) +{ + m_base_type = std::move(_base_type); +} + +/*! + * @brief This function returns a constant reference to member base_type + * @return Constant reference to member base_type + */ +const std::string& carla_msgs::msg::CarlaActorInfo::base_type() const +{ + return m_base_type; +} + +/*! + * @brief This function returns a reference to member base_type + * @return Reference to member base_type + */ +std::string& carla_msgs::msg::CarlaActorInfo::base_type() +{ + return m_base_type; +} +/*! + * @brief This function copies the value in member topic_prefix + * @param _topic_prefix New value to be copied in member topic_prefix + */ +void carla_msgs::msg::CarlaActorInfo::topic_prefix( + const std::string& _topic_prefix) +{ + m_topic_prefix = _topic_prefix; +} + +/*! + * @brief This function moves the value in member topic_prefix + * @param _topic_prefix New value to be moved in member topic_prefix + */ +void carla_msgs::msg::CarlaActorInfo::topic_prefix( + std::string&& _topic_prefix) +{ + m_topic_prefix = std::move(_topic_prefix); +} + +/*! + * @brief This function returns a constant reference to member topic_prefix + * @return Constant reference to member topic_prefix + */ +const std::string& carla_msgs::msg::CarlaActorInfo::topic_prefix() const +{ + return m_topic_prefix; +} + +/*! + * @brief This function returns a reference to member topic_prefix + * @return Reference to member topic_prefix + */ +std::string& carla_msgs::msg::CarlaActorInfo::topic_prefix() +{ + return m_topic_prefix; +} + +size_t carla_msgs::msg::CarlaActorInfo::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaActorInfo::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaActorInfo::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h new file mode 100644 index 00000000000..ec666938ae6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h @@ -0,0 +1,386 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorInfo.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaActorInfo_SOURCE) +#define CarlaActorInfo_DllAPI __declspec( dllexport ) +#else +#define CarlaActorInfo_DllAPI __declspec( dllimport ) +#endif // CarlaActorInfo_SOURCE +#else +#define CarlaActorInfo_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaActorInfo_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaActorInfo defined by the user in the IDL file. + * @ingroup CARLAACTORINFO + */ + class CarlaActorInfo + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaActorInfo(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaActorInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. + */ + eProsima_user_DllExport CarlaActorInfo( + const CarlaActorInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. + */ + eProsima_user_DllExport CarlaActorInfo( + CarlaActorInfo&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. + */ + eProsima_user_DllExport CarlaActorInfo& operator =( + const CarlaActorInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. + */ + eProsima_user_DllExport CarlaActorInfo& operator =( + CarlaActorInfo&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaActorInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaActorInfo& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + /*! + * @brief This function sets a value in member parent_id + * @param _parent_id New value for member parent_id + */ + eProsima_user_DllExport void parent_id( + uint32_t _parent_id); + + /*! + * @brief This function returns the value of member parent_id + * @return Value of member parent_id + */ + eProsima_user_DllExport uint32_t parent_id() const; + + /*! + * @brief This function returns a reference to member parent_id + * @return Reference to member parent_id + */ + eProsima_user_DllExport uint32_t& parent_id(); + + /*! + * @brief This function copies the value in member type + * @param _type New value to be copied in member type + */ + eProsima_user_DllExport void type( + const std::string& _type); + + /*! + * @brief This function moves the value in member type + * @param _type New value to be moved in member type + */ + eProsima_user_DllExport void type( + std::string&& _type); + + /*! + * @brief This function returns a constant reference to member type + * @return Constant reference to member type + */ + eProsima_user_DllExport const std::string& type() const; + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport std::string& type(); + /*! + * @brief This function copies the value in member rosname + * @param _rosname New value to be copied in member rosname + */ + eProsima_user_DllExport void rosname( + const std::string& _rosname); + + /*! + * @brief This function moves the value in member rosname + * @param _rosname New value to be moved in member rosname + */ + eProsima_user_DllExport void rosname( + std::string&& _rosname); + + /*! + * @brief This function returns a constant reference to member rosname + * @return Constant reference to member rosname + */ + eProsima_user_DllExport const std::string& rosname() const; + + /*! + * @brief This function returns a reference to member rosname + * @return Reference to member rosname + */ + eProsima_user_DllExport std::string& rosname(); + /*! + * @brief This function copies the value in member rolename + * @param _rolename New value to be copied in member rolename + */ + eProsima_user_DllExport void rolename( + const std::string& _rolename); + + /*! + * @brief This function moves the value in member rolename + * @param _rolename New value to be moved in member rolename + */ + eProsima_user_DllExport void rolename( + std::string&& _rolename); + + /*! + * @brief This function returns a constant reference to member rolename + * @return Constant reference to member rolename + */ + eProsima_user_DllExport const std::string& rolename() const; + + /*! + * @brief This function returns a reference to member rolename + * @return Reference to member rolename + */ + eProsima_user_DllExport std::string& rolename(); + /*! + * @brief This function copies the value in member object_type + * @param _object_type New value to be copied in member object_type + */ + eProsima_user_DllExport void object_type( + const std::string& _object_type); + + /*! + * @brief This function moves the value in member object_type + * @param _object_type New value to be moved in member object_type + */ + eProsima_user_DllExport void object_type( + std::string&& _object_type); + + /*! + * @brief This function returns a constant reference to member object_type + * @return Constant reference to member object_type + */ + eProsima_user_DllExport const std::string& object_type() const; + + /*! + * @brief This function returns a reference to member object_type + * @return Reference to member object_type + */ + eProsima_user_DllExport std::string& object_type(); + /*! + * @brief This function copies the value in member base_type + * @param _base_type New value to be copied in member base_type + */ + eProsima_user_DllExport void base_type( + const std::string& _base_type); + + /*! + * @brief This function moves the value in member base_type + * @param _base_type New value to be moved in member base_type + */ + eProsima_user_DllExport void base_type( + std::string&& _base_type); + + /*! + * @brief This function returns a constant reference to member base_type + * @return Constant reference to member base_type + */ + eProsima_user_DllExport const std::string& base_type() const; + + /*! + * @brief This function returns a reference to member base_type + * @return Reference to member base_type + */ + eProsima_user_DllExport std::string& base_type(); + /*! + * @brief This function copies the value in member topic_prefix + * @param _topic_prefix New value to be copied in member topic_prefix + */ + eProsima_user_DllExport void topic_prefix( + const std::string& _topic_prefix); + + /*! + * @brief This function moves the value in member topic_prefix + * @param _topic_prefix New value to be moved in member topic_prefix + */ + eProsima_user_DllExport void topic_prefix( + std::string&& _topic_prefix); + + /*! + * @brief This function returns a constant reference to member topic_prefix + * @return Constant reference to member topic_prefix + */ + eProsima_user_DllExport const std::string& topic_prefix() const; + + /*! + * @brief This function returns a reference to member topic_prefix + * @return Reference to member topic_prefix + */ + eProsima_user_DllExport std::string& topic_prefix(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaActorInfo& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint32_t m_id; + uint32_t m_parent_id; + std::string m_type; + std::string m_rosname; + std::string m_rolename; + std::string m_object_type; + std::string m_base_type; + std::string m_topic_prefix; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx new file mode 100644 index 00000000000..f3432ecb2df --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorInfoPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaActorInfoPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaActorInfoPubSubType::CarlaActorInfoPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaActorInfo_"); + auto type_size = CarlaActorInfo::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaActorInfo::isKeyDefined(); + size_t keyLength = CarlaActorInfo::getKeyMaxCdrSerializedSize() > 16 ? + CarlaActorInfo::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaActorInfoPubSubType::~CarlaActorInfoPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaActorInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaActorInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaActorInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaActorInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaActorInfoPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaActorInfoPubSubType::createData() + { + return reinterpret_cast(new CarlaActorInfo()); + } + + void CarlaActorInfoPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaActorInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaActorInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaActorInfo::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaActorInfo::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h new file mode 100644 index 00000000000..860bfc85ae4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorInfoPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaActorInfo.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaActorInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaActorInfo defined by the user in the IDL file. + * @ingroup CARLAACTORINFO + */ + class CarlaActorInfoPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaActorInfo type; + + eProsima_user_DllExport CarlaActorInfoPubSubType(); + + eProsima_user_DllExport virtual ~CarlaActorInfoPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.cxx new file mode 100644 index 00000000000..b917f5d934a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.cxx @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorList.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaActorList.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaActorList::CarlaActorList() +{ + // m_actors com.eprosima.idl.parser.typecode.SequenceTypeCode@79ca92b9 + + +} + +carla_msgs::msg::CarlaActorList::~CarlaActorList() +{ +} + +carla_msgs::msg::CarlaActorList::CarlaActorList( + const CarlaActorList& x) +{ + m_actors = x.m_actors; +} + +carla_msgs::msg::CarlaActorList::CarlaActorList( + CarlaActorList&& x) +{ + m_actors = std::move(x.m_actors); +} + +carla_msgs::msg::CarlaActorList& carla_msgs::msg::CarlaActorList::operator =( + const CarlaActorList& x) +{ + + m_actors = x.m_actors; + + return *this; +} + +carla_msgs::msg::CarlaActorList& carla_msgs::msg::CarlaActorList::operator =( + CarlaActorList&& x) +{ + + m_actors = std::move(x.m_actors); + + return *this; +} + +bool carla_msgs::msg::CarlaActorList::operator ==( + const CarlaActorList& x) const +{ + + return (m_actors == x.m_actors); +} + +bool carla_msgs::msg::CarlaActorList::operator !=( + const CarlaActorList& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaActorList::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaActorInfo::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaActorList::getCdrSerializedSize( + const carla_msgs::msg::CarlaActorList& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.actors().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaActorInfo::getCdrSerializedSize(data.actors().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaActorList::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_actors; +} + +void carla_msgs::msg::CarlaActorList::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_actors;} + +/*! + * @brief This function copies the value in member actors + * @param _actors New value to be copied in member actors + */ +void carla_msgs::msg::CarlaActorList::actors( + const std::vector& _actors) +{ + m_actors = _actors; +} + +/*! + * @brief This function moves the value in member actors + * @param _actors New value to be moved in member actors + */ +void carla_msgs::msg::CarlaActorList::actors( + std::vector&& _actors) +{ + m_actors = std::move(_actors); +} + +/*! + * @brief This function returns a constant reference to member actors + * @return Constant reference to member actors + */ +const std::vector& carla_msgs::msg::CarlaActorList::actors() const +{ + return m_actors; +} + +/*! + * @brief This function returns a reference to member actors + * @return Reference to member actors + */ +std::vector& carla_msgs::msg::CarlaActorList::actors() +{ + return m_actors; +} + +size_t carla_msgs::msg::CarlaActorList::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaActorList::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaActorList::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.h new file mode 100644 index 00000000000..d240a40de87 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorList.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_H_ + +#include "carla_msgs/msg/CarlaActorInfo.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaActorList_SOURCE) +#define CarlaActorList_DllAPI __declspec( dllexport ) +#else +#define CarlaActorList_DllAPI __declspec( dllimport ) +#endif // CarlaActorList_SOURCE +#else +#define CarlaActorList_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaActorList_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaActorList defined by the user in the IDL file. + * @ingroup CARLAACTORLIST + */ + class CarlaActorList + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaActorList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaActorList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. + */ + eProsima_user_DllExport CarlaActorList( + const CarlaActorList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. + */ + eProsima_user_DllExport CarlaActorList( + CarlaActorList&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. + */ + eProsima_user_DllExport CarlaActorList& operator =( + const CarlaActorList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. + */ + eProsima_user_DllExport CarlaActorList& operator =( + CarlaActorList&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaActorList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaActorList& x) const; + + /*! + * @brief This function copies the value in member actors + * @param _actors New value to be copied in member actors + */ + eProsima_user_DllExport void actors( + const std::vector& _actors); + + /*! + * @brief This function moves the value in member actors + * @param _actors New value to be moved in member actors + */ + eProsima_user_DllExport void actors( + std::vector&& _actors); + + /*! + * @brief This function returns a constant reference to member actors + * @return Constant reference to member actors + */ + eProsima_user_DllExport const std::vector& actors() const; + + /*! + * @brief This function returns a reference to member actors + * @return Reference to member actors + */ + eProsima_user_DllExport std::vector& actors(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaActorList& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_actors; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.cxx new file mode 100644 index 00000000000..60c088ed9e4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorListPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaActorListPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaActorListPubSubType::CarlaActorListPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaActorList_"); + auto type_size = CarlaActorList::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaActorList::isKeyDefined(); + size_t keyLength = CarlaActorList::getKeyMaxCdrSerializedSize() > 16 ? + CarlaActorList::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaActorListPubSubType::~CarlaActorListPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaActorListPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaActorList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaActorListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaActorList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaActorListPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaActorListPubSubType::createData() + { + return reinterpret_cast(new CarlaActorList()); + } + + void CarlaActorListPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaActorListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaActorList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaActorList::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaActorList::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.h new file mode 100644 index 00000000000..bbaa66ed618 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorListPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaActorList.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaActorList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaActorList defined by the user in the IDL file. + * @ingroup CARLAACTORLIST + */ + class CarlaActorListPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaActorList type; + + eProsima_user_DllExport CarlaActorListPubSubType(); + + eProsima_user_DllExport virtual ~CarlaActorListPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.cxx new file mode 100644 index 00000000000..7d5e150fb58 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaBoundingBox.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaBoundingBox.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaBoundingBox::CarlaBoundingBox() +{ + // m_center com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4a94ee4 + + // m_size com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4a94ee4 + + +} + +carla_msgs::msg::CarlaBoundingBox::~CarlaBoundingBox() +{ + +} + +carla_msgs::msg::CarlaBoundingBox::CarlaBoundingBox( + const CarlaBoundingBox& x) +{ + m_center = x.m_center; + m_size = x.m_size; +} + +carla_msgs::msg::CarlaBoundingBox::CarlaBoundingBox( + CarlaBoundingBox&& x) +{ + m_center = std::move(x.m_center); + m_size = std::move(x.m_size); +} + +carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaBoundingBox::operator =( + const CarlaBoundingBox& x) +{ + + m_center = x.m_center; + m_size = x.m_size; + + return *this; +} + +carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaBoundingBox::operator =( + CarlaBoundingBox&& x) +{ + + m_center = std::move(x.m_center); + m_size = std::move(x.m_size); + + return *this; +} + +bool carla_msgs::msg::CarlaBoundingBox::operator ==( + const CarlaBoundingBox& x) const +{ + + return (m_center == x.m_center && m_size == x.m_size); +} + +bool carla_msgs::msg::CarlaBoundingBox::operator !=( + const CarlaBoundingBox& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaBoundingBox::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaBoundingBox::getCdrSerializedSize( + const carla_msgs::msg::CarlaBoundingBox& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.center(), current_alignment); + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.size(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaBoundingBox::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_center; + scdr << m_size; + +} + +void carla_msgs::msg::CarlaBoundingBox::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_center; + dcdr >> m_size; +} + +/*! + * @brief This function copies the value in member center + * @param _center New value to be copied in member center + */ +void carla_msgs::msg::CarlaBoundingBox::center( + const geometry_msgs::msg::Vector3& _center) +{ + m_center = _center; +} + +/*! + * @brief This function moves the value in member center + * @param _center New value to be moved in member center + */ +void carla_msgs::msg::CarlaBoundingBox::center( + geometry_msgs::msg::Vector3&& _center) +{ + m_center = std::move(_center); +} + +/*! + * @brief This function returns a constant reference to member center + * @return Constant reference to member center + */ +const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::center() const +{ + return m_center; +} + +/*! + * @brief This function returns a reference to member center + * @return Reference to member center + */ +geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::center() +{ + return m_center; +} +/*! + * @brief This function copies the value in member size + * @param _size New value to be copied in member size + */ +void carla_msgs::msg::CarlaBoundingBox::size( + const geometry_msgs::msg::Vector3& _size) +{ + m_size = _size; +} + +/*! + * @brief This function moves the value in member size + * @param _size New value to be moved in member size + */ +void carla_msgs::msg::CarlaBoundingBox::size( + geometry_msgs::msg::Vector3&& _size) +{ + m_size = std::move(_size); +} + +/*! + * @brief This function returns a constant reference to member size + * @return Constant reference to member size + */ +const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::size() const +{ + return m_size; +} + +/*! + * @brief This function returns a reference to member size + * @return Reference to member size + */ +geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::size() +{ + return m_size; +} + +size_t carla_msgs::msg::CarlaBoundingBox::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaBoundingBox::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaBoundingBox::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.h new file mode 100644 index 00000000000..5ab9197c590 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaBoundingBox.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_H_ + +#include "geometry_msgs/msg/Vector3.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaBoundingBox_SOURCE) +#define CarlaBoundingBox_DllAPI __declspec( dllexport ) +#else +#define CarlaBoundingBox_DllAPI __declspec( dllimport ) +#endif // CarlaBoundingBox_SOURCE +#else +#define CarlaBoundingBox_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaBoundingBox_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaBoundingBox defined by the user in the IDL file. + * @ingroup CARLABOUNDINGBOX + */ + class CarlaBoundingBox + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaBoundingBox(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaBoundingBox(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. + */ + eProsima_user_DllExport CarlaBoundingBox( + const CarlaBoundingBox& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. + */ + eProsima_user_DllExport CarlaBoundingBox( + CarlaBoundingBox&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. + */ + eProsima_user_DllExport CarlaBoundingBox& operator =( + const CarlaBoundingBox& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. + */ + eProsima_user_DllExport CarlaBoundingBox& operator =( + CarlaBoundingBox&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaBoundingBox object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaBoundingBox& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaBoundingBox object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaBoundingBox& x) const; + + /*! + * @brief This function copies the value in member center + * @param _center New value to be copied in member center + */ + eProsima_user_DllExport void center( + const geometry_msgs::msg::Vector3& _center); + + /*! + * @brief This function moves the value in member center + * @param _center New value to be moved in member center + */ + eProsima_user_DllExport void center( + geometry_msgs::msg::Vector3&& _center); + + /*! + * @brief This function returns a constant reference to member center + * @return Constant reference to member center + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& center() const; + + /*! + * @brief This function returns a reference to member center + * @return Reference to member center + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& center(); + /*! + * @brief This function copies the value in member size + * @param _size New value to be copied in member size + */ + eProsima_user_DllExport void size( + const geometry_msgs::msg::Vector3& _size); + + /*! + * @brief This function moves the value in member size + * @param _size New value to be moved in member size + */ + eProsima_user_DllExport void size( + geometry_msgs::msg::Vector3&& _size); + + /*! + * @brief This function returns a constant reference to member size + * @return Constant reference to member size + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& size() const; + + /*! + * @brief This function returns a reference to member size + * @return Reference to member size + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& size(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaBoundingBox& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + geometry_msgs::msg::Vector3 m_center; + geometry_msgs::msg::Vector3 m_size; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.cxx new file mode 100644 index 00000000000..835b49206f3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaBoundingBoxPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaBoundingBoxPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaBoundingBoxPubSubType::CarlaBoundingBoxPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaBoundingBox_"); + auto type_size = CarlaBoundingBox::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaBoundingBox::isKeyDefined(); + size_t keyLength = CarlaBoundingBox::getKeyMaxCdrSerializedSize() > 16 ? + CarlaBoundingBox::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaBoundingBoxPubSubType::~CarlaBoundingBoxPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaBoundingBoxPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaBoundingBox* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaBoundingBoxPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaBoundingBox* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaBoundingBoxPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaBoundingBoxPubSubType::createData() + { + return reinterpret_cast(new CarlaBoundingBox()); + } + + void CarlaBoundingBoxPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaBoundingBoxPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaBoundingBox* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaBoundingBox::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaBoundingBox::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.h new file mode 100644 index 00000000000..6be65c2a042 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaBoundingBoxPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaBoundingBox.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaBoundingBox is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaBoundingBox defined by the user in the IDL file. + * @ingroup CARLABOUNDINGBOX + */ + class CarlaBoundingBoxPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaBoundingBox type; + + eProsima_user_DllExport CarlaBoundingBoxPubSubType(); + + eProsima_user_DllExport virtual ~CarlaBoundingBoxPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaBoundingBox(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/CarlaCollisionEvent.cpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.cxx similarity index 86% rename from LibCarla/source/carla/ros2/types/CarlaCollisionEvent.cpp rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.cxx index 4d01b7d78f8..6a71c72d358 100644 --- a/LibCarla/source/carla/ros2/types/CarlaCollisionEvent.cpp +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.cxx @@ -13,7 +13,7 @@ // limitations under the License. /*! - * @file CarlaCarlaCollisionEvent.cpp + * @file CarlaCollisionEvent.cpp * This source file contains the definition of the described types in the IDL file. * * This file was generated by the tool gen. @@ -34,25 +34,21 @@ using namespace eprosima::fastcdr::exception; #include -#define carla_msgs_msg_geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define carla_msgs_msg_std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define carla_msgs_msg_CarlaCollisionEvent_max_cdr_typesize 296ULL; -#define carla_msgs_msg_std_msgs_msg_Time_max_cdr_typesize 8ULL; -#define carla_msgs_msg_geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; -#define carla_msgs_msg_std_msgs_msg_Header_max_key_cdr_typesize 0ULL; -#define carla_msgs_msg_CarlaCollisionEvent_max_key_cdr_typesize 0ULL; -#define carla_msgs_msg_std_msgs_msg_Time_max_key_cdr_typesize 0ULL; - carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent() { - // std_msgs::msg::Header m_header - // unsigned long m_other_actor_id + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@31f9b85e + + // m_other_actor_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@424e1977 m_other_actor_id = 0; - // geometry_msgs::msg::Vector3 m_normal_impulse + // m_normal_impulse com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@10d68fcd + + } carla_msgs::msg::CarlaCollisionEvent::~CarlaCollisionEvent() { + + } carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent( @@ -64,7 +60,7 @@ carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent( } carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent( - CarlaCollisionEvent&& x) noexcept + CarlaCollisionEvent&& x) { m_header = std::move(x.m_header); m_other_actor_id = x.m_other_actor_id; @@ -74,6 +70,7 @@ carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent( carla_msgs::msg::CarlaCollisionEvent& carla_msgs::msg::CarlaCollisionEvent::operator =( const CarlaCollisionEvent& x) { + m_header = x.m_header; m_other_actor_id = x.m_other_actor_id; m_normal_impulse = x.m_normal_impulse; @@ -82,8 +79,9 @@ carla_msgs::msg::CarlaCollisionEvent& carla_msgs::msg::CarlaCollisionEvent::oper } carla_msgs::msg::CarlaCollisionEvent& carla_msgs::msg::CarlaCollisionEvent::operator =( - CarlaCollisionEvent&& x) noexcept + CarlaCollisionEvent&& x) { + m_header = std::move(x.m_header); m_other_actor_id = x.m_other_actor_id; m_normal_impulse = std::move(x.m_normal_impulse); @@ -94,6 +92,7 @@ carla_msgs::msg::CarlaCollisionEvent& carla_msgs::msg::CarlaCollisionEvent::oper bool carla_msgs::msg::CarlaCollisionEvent::operator ==( const CarlaCollisionEvent& x) const { + return (m_header == x.m_header && m_other_actor_id == x.m_other_actor_id && m_normal_impulse == x.m_normal_impulse); } @@ -106,8 +105,16 @@ bool carla_msgs::msg::CarlaCollisionEvent::operator !=( size_t carla_msgs::msg::CarlaCollisionEvent::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return carla_msgs_msg_CarlaCollisionEvent_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; } size_t carla_msgs::msg::CarlaCollisionEvent::getCdrSerializedSize( @@ -116,23 +123,31 @@ size_t carla_msgs::msg::CarlaCollisionEvent::getCdrSerializedSize( { (void)data; size_t initial_alignment = current_alignment; + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.normal_impulse(), current_alignment); + return current_alignment - initial_alignment; } void carla_msgs::msg::CarlaCollisionEvent::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_header; scdr << m_other_actor_id; scdr << m_normal_impulse; + } void carla_msgs::msg::CarlaCollisionEvent::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_header; dcdr >> m_other_actor_id; dcdr >> m_normal_impulse; @@ -175,7 +190,6 @@ std_msgs::msg::Header& carla_msgs::msg::CarlaCollisionEvent::header() { return m_header; } - /*! * @brief This function sets a value in member other_actor_id * @param _other_actor_id New value for member other_actor_id @@ -245,8 +259,11 @@ geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaCollisionEvent::normal_impuls size_t carla_msgs::msg::CarlaCollisionEvent::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return carla_msgs_msg_CarlaCollisionEvent_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool carla_msgs::msg::CarlaCollisionEvent::isKeyDefined() @@ -258,4 +275,7 @@ void carla_msgs::msg::CarlaCollisionEvent::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/types/CarlaCollisionEvent.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.h similarity index 95% rename from LibCarla/source/carla/ros2/types/CarlaCollisionEvent.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.h index 6aacc077a70..70b1234f7ce 100644 --- a/LibCarla/source/carla/ros2/types/CarlaCollisionEvent.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.h @@ -22,10 +22,8 @@ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_H_ -#include "Vector3.h" -#include "Header.h" - -#include +#include "geometry_msgs/msg/Vector3.h" +#include "std_msgs/msg/Header.h" #include #include @@ -97,7 +95,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. */ eProsima_user_DllExport CarlaCollisionEvent( - CarlaCollisionEvent&& x) noexcept; + CarlaCollisionEvent&& x); /*! * @brief Copy assignment. @@ -111,7 +109,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. */ eProsima_user_DllExport CarlaCollisionEvent& operator =( - CarlaCollisionEvent&& x) noexcept; + CarlaCollisionEvent&& x); /*! * @brief Comparison operator. @@ -198,11 +196,11 @@ namespace carla_msgs { eProsima_user_DllExport geometry_msgs::msg::Vector3& normal_impulse(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -216,6 +214,7 @@ namespace carla_msgs { const carla_msgs::msg::CarlaCollisionEvent& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -230,6 +229,8 @@ namespace carla_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -252,6 +253,7 @@ namespace carla_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + std_msgs::msg::Header m_header; uint32_t m_other_actor_id; geometry_msgs::msg::Vector3 m_normal_impulse; @@ -259,4 +261,4 @@ namespace carla_msgs { } // namespace msg } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/CarlaCollisionEventPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/CarlaCollisionEventPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.cxx index c1822eb2b68..3b3d04904d3 100644 --- a/LibCarla/source/carla/ros2/types/CarlaCollisionEventPubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -83,21 +84,21 @@ namespace carla_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - CarlaCollisionEvent* p_type = static_cast(data); + //Convert DATA to pointer of your type + CarlaCollisionEvent* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -168,5 +169,8 @@ namespace carla_msgs { } return true; } + + } //End of namespace msg + } //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/types/CarlaCollisionEventPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.h similarity index 97% rename from LibCarla/source/carla/ros2/types/CarlaCollisionEventPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.h index d532d8e851e..7bce83aedc7 100644 --- a/LibCarla/source/carla/ros2/types/CarlaCollisionEventPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.h @@ -27,8 +27,6 @@ #include #include "CarlaCollisionEvent.h" -#include "Vector3PubSubTypes.h" -#include "HeaderPubSubTypes.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ @@ -39,7 +37,6 @@ namespace carla_msgs { namespace msg { - /*! * @brief This class represents the TopicDataType of the type CarlaCollisionEvent defined by the user in the IDL file. * @ingroup CARLACOLLISIONEVENT @@ -52,7 +49,7 @@ namespace carla_msgs eProsima_user_DllExport CarlaCollisionEventPubSubType(); - eProsima_user_DllExport virtual ~CarlaCollisionEventPubSubType() override; + eProsima_user_DllExport virtual ~CarlaCollisionEventPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -103,9 +100,8 @@ namespace carla_msgs MD5 m_md5; unsigned char* m_keyBuffer; - }; } } -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.cxx new file mode 100644 index 00000000000..f3be268c5ef --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaControl.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaControl.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +carla_msgs::msg::CarlaControl::CarlaControl() +{ + // m_command com.eprosima.idl.parser.typecode.PrimitiveTypeCode@11c9af63 + m_command = 0; + +} + +carla_msgs::msg::CarlaControl::~CarlaControl() +{ +} + +carla_msgs::msg::CarlaControl::CarlaControl( + const CarlaControl& x) +{ + m_command = x.m_command; +} + +carla_msgs::msg::CarlaControl::CarlaControl( + CarlaControl&& x) +{ + m_command = x.m_command; +} + +carla_msgs::msg::CarlaControl& carla_msgs::msg::CarlaControl::operator =( + const CarlaControl& x) +{ + + m_command = x.m_command; + + return *this; +} + +carla_msgs::msg::CarlaControl& carla_msgs::msg::CarlaControl::operator =( + CarlaControl&& x) +{ + + m_command = x.m_command; + + return *this; +} + +bool carla_msgs::msg::CarlaControl::operator ==( + const CarlaControl& x) const +{ + + return (m_command == x.m_command); +} + +bool carla_msgs::msg::CarlaControl::operator !=( + const CarlaControl& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaControl::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaControl::getCdrSerializedSize( + const carla_msgs::msg::CarlaControl& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaControl::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_command; + +} + +void carla_msgs::msg::CarlaControl::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_command; +} + +/*! + * @brief This function sets a value in member command + * @param _command New value for member command + */ +void carla_msgs::msg::CarlaControl::command( + int8_t _command) +{ + m_command = _command; +} + +/*! + * @brief This function returns the value of member command + * @return Value of member command + */ +int8_t carla_msgs::msg::CarlaControl::command() const +{ + return m_command; +} + +/*! + * @brief This function returns a reference to member command + * @return Reference to member command + */ +int8_t& carla_msgs::msg::CarlaControl::command() +{ + return m_command; +} + + +size_t carla_msgs::msg::CarlaControl::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaControl::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaControl::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/Clock.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.h similarity index 60% rename from LibCarla/source/carla/ros2/types/Clock.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.h index 862b8193f49..807600956f5 100644 --- a/LibCarla/source/carla/ros2/types/Clock.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.h @@ -13,18 +13,15 @@ // limitations under the License. /*! - * @file Clock.h + * @file CarlaControl.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ -#define _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_H_ -#include "Time.h" - -#include #include #include @@ -45,16 +42,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CLOCK_SOURCE) -#define CLOCK_DllAPI __declspec( dllexport ) +#if defined(CarlaControl_SOURCE) +#define CarlaControl_DllAPI __declspec( dllexport ) #else -#define CLOCK_DllAPI __declspec( dllimport ) -#endif // CLOCK_SOURCE +#define CarlaControl_DllAPI __declspec( dllimport ) +#endif // CarlaControl_SOURCE #else -#define CLOCK_DllAPI +#define CarlaControl_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CLOCK_DllAPI +#define CarlaControl_DllAPI #endif // _WIN32 namespace eprosima { @@ -63,100 +60,100 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace rosgraph { + +namespace carla_msgs { namespace msg { + namespace CarlaControl_Constants { + const int8_t PLAY = 0; + const int8_t PAUSE = 1; + const int8_t STEP_ONCE = 2; + } // namespace CarlaControl_Constants /*! - * @brief This class represents the structure Clock defined by the user in the IDL file. - * @ingroup Clock + * @brief This class represents the structure CarlaControl defined by the user in the IDL file. + * @ingroup CARLACONTROL */ - class Clock + class CarlaControl { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport Clock(); + eProsima_user_DllExport CarlaControl(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Clock(); + eProsima_user_DllExport ~CarlaControl(); /*! * @brief Copy constructor. - * @param x Reference to the object rosgraph::msg::Clock that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. */ - eProsima_user_DllExport Clock( - const Clock& x); + eProsima_user_DllExport CarlaControl( + const CarlaControl& x); /*! * @brief Move constructor. - * @param x Reference to the object rosgraph::msg::Clock that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. */ - eProsima_user_DllExport Clock( - Clock&& x) noexcept; + eProsima_user_DllExport CarlaControl( + CarlaControl&& x); /*! * @brief Copy assignment. - * @param x Reference to the object rosgraph::msg::Clock that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. */ - eProsima_user_DllExport Clock& operator =( - const Clock& x); + eProsima_user_DllExport CarlaControl& operator =( + const CarlaControl& x); /*! * @brief Move assignment. - * @param x Reference to the object rosgraph::msg::Clock that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. */ - eProsima_user_DllExport Clock& operator =( - Clock&& x) noexcept; + eProsima_user_DllExport CarlaControl& operator =( + CarlaControl&& x); /*! * @brief Comparison operator. - * @param x rosgraph::msg::Clock object to compare. + * @param x carla_msgs::msg::CarlaControl object to compare. */ eProsima_user_DllExport bool operator ==( - const Clock& x) const; + const CarlaControl& x) const; /*! * @brief Comparison operator. - * @param x rosgraph::msg::Clock object to compare. + * @param x carla_msgs::msg::CarlaControl object to compare. */ eProsima_user_DllExport bool operator !=( - const Clock& x) const; + const CarlaControl& x) const; /*! - * @brief This function copies the value in member clock - * @param _clock New value to be copied in member clock + * @brief This function sets a value in member command + * @param _command New value for member command */ - eProsima_user_DllExport void clock( - const builtin_interfaces::msg::Time& _clock); + eProsima_user_DllExport void command( + int8_t _command); /*! - * @brief This function moves the value in member clock - * @param _clock New value to be moved in member clock + * @brief This function returns the value of member command + * @return Value of member command */ - eProsima_user_DllExport void clock( - builtin_interfaces::msg::Time&& _clock); + eProsima_user_DllExport int8_t command() const; /*! - * @brief This function returns a constant reference to member clock - * @return Constant reference to member clock + * @brief This function returns a reference to member command + * @return Reference to member command */ - eProsima_user_DllExport const builtin_interfaces::msg::Time& clock() const; + eProsima_user_DllExport int8_t& command(); - /*! - * @brief This function returns a reference to member clock - * @return Reference to member clock - */ - eProsima_user_DllExport builtin_interfaces::msg::Time& clock(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -167,9 +164,10 @@ namespace rosgraph { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const rosgraph::msg::Clock& data, + const carla_msgs::msg::CarlaControl& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -184,6 +182,8 @@ namespace rosgraph { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -206,9 +206,10 @@ namespace rosgraph { eprosima::fastcdr::Cdr& cdr) const; private: - builtin_interfaces::msg::Time m_clock; + + int8_t m_command; }; } // namespace msg -} // namespace rosgraph +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.cxx new file mode 100644 index 00000000000..952965abb37 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaControlPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaControlPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + namespace CarlaControl_Constants { + + + + + } //End of namespace CarlaControl_Constants + CarlaControlPubSubType::CarlaControlPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaControl_"); + auto type_size = CarlaControl::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaControl::isKeyDefined(); + size_t keyLength = CarlaControl::getKeyMaxCdrSerializedSize() > 16 ? + CarlaControl::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaControlPubSubType::~CarlaControlPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaControlPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaControlPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaControlPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaControlPubSubType::createData() + { + return reinterpret_cast(new CarlaControl()); + } + + void CarlaControlPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaControlPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaControl::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaControl::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.h new file mode 100644 index 00000000000..a26ea9f1605 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaControlPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaControl.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + namespace CarlaControl_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type CarlaControl defined by the user in the IDL file. + * @ingroup CARLACONTROL + */ + class CarlaControlPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaControl type; + + eProsima_user_DllExport CarlaControlPubSubType(); + + eProsima_user_DllExport virtual ~CarlaControlPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaControl(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/CarlaEgoVehicleControl.cpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.cxx similarity index 77% rename from LibCarla/source/carla/ros2/types/CarlaEgoVehicleControl.cpp rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.cxx index 2c1eb165ef5..2e5cf67562d 100644 --- a/LibCarla/source/carla/ros2/types/CarlaEgoVehicleControl.cpp +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.cxx @@ -13,7 +13,7 @@ // limitations under the License. /*! - * @file CarlaEgoCarlaEgoVehicleControl.cpp + * @file CarlaEgoVehicleControl.cpp * This source file contains the definition of the described types in the IDL file. * * This file was generated by the tool gen. @@ -34,36 +34,39 @@ using namespace eprosima::fastcdr::exception; #include -#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define carla_msgs_msg_CarlaEgoVehicleControl_max_cdr_typesize 289ULL; -#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; -#define carla_msgs_msg_CarlaEgoVehicleControl_max_key_cdr_typesize 0ULL; - carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl() { - // std_msgs::msg::Header m_header + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@550dbc7a - // float m_throttle + // m_throttle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7bab3f1a m_throttle = 0.0; - // float m_steer + // m_steer com.eprosima.idl.parser.typecode.PrimitiveTypeCode@437da279 m_steer = 0.0; - // float m_brake + // m_brake com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23c30a20 m_brake = 0.0; - // boolean m_hand_brake + // m_hand_brake com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e1a0406 m_hand_brake = false; - // boolean m_reverse + // m_reverse com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3cebbb30 m_reverse = false; - // long m_gear + // m_gear com.eprosima.idl.parser.typecode.PrimitiveTypeCode@67f639d3 m_gear = 0; - // boolean m_manual_gear_shift + // m_manual_gear_shift com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6253c26 m_manual_gear_shift = false; + // m_control_priority com.eprosima.idl.parser.typecode.PrimitiveTypeCode@49049a04 + m_control_priority = 4; } carla_msgs::msg::CarlaEgoVehicleControl::~CarlaEgoVehicleControl() { + + + + + + + + } carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl( @@ -77,10 +80,11 @@ carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl( m_reverse = x.m_reverse; m_gear = x.m_gear; m_manual_gear_shift = x.m_manual_gear_shift; + m_control_priority = x.m_control_priority; } carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl( - CarlaEgoVehicleControl&& x) noexcept + CarlaEgoVehicleControl&& x) { m_header = std::move(x.m_header); m_throttle = x.m_throttle; @@ -90,11 +94,13 @@ carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl( m_reverse = x.m_reverse; m_gear = x.m_gear; m_manual_gear_shift = x.m_manual_gear_shift; + m_control_priority = x.m_control_priority; } carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl::operator =( const CarlaEgoVehicleControl& x) { + m_header = x.m_header; m_throttle = x.m_throttle; m_steer = x.m_steer; @@ -103,13 +109,15 @@ carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl m_reverse = x.m_reverse; m_gear = x.m_gear; m_manual_gear_shift = x.m_manual_gear_shift; + m_control_priority = x.m_control_priority; return *this; } carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl::operator =( - CarlaEgoVehicleControl&& x) noexcept + CarlaEgoVehicleControl&& x) { + m_header = std::move(x.m_header); m_throttle = x.m_throttle; m_steer = x.m_steer; @@ -118,6 +126,7 @@ carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl m_reverse = x.m_reverse; m_gear = x.m_gear; m_manual_gear_shift = x.m_manual_gear_shift; + m_control_priority = x.m_control_priority; return *this; } @@ -125,7 +134,8 @@ carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl bool carla_msgs::msg::CarlaEgoVehicleControl::operator ==( const CarlaEgoVehicleControl& x) const { - return (m_header == x.m_header && m_throttle == x.m_throttle && m_steer == x.m_steer && m_brake == x.m_brake && m_hand_brake == x.m_hand_brake && m_reverse == x.m_reverse && m_gear == x.m_gear && m_manual_gear_shift == x.m_manual_gear_shift); + + return (m_header == x.m_header && m_throttle == x.m_throttle && m_steer == x.m_steer && m_brake == x.m_brake && m_hand_brake == x.m_hand_brake && m_reverse == x.m_reverse && m_gear == x.m_gear && m_manual_gear_shift == x.m_manual_gear_shift && m_control_priority == x.m_control_priority); } bool carla_msgs::msg::CarlaEgoVehicleControl::operator !=( @@ -137,29 +147,79 @@ bool carla_msgs::msg::CarlaEgoVehicleControl::operator !=( size_t carla_msgs::msg::CarlaEgoVehicleControl::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return carla_msgs_msg_CarlaEgoVehicleControl_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; } size_t carla_msgs::msg::CarlaEgoVehicleControl::getCdrSerializedSize( const carla_msgs::msg::CarlaEgoVehicleControl& data, size_t current_alignment) { + (void)data; size_t initial_alignment = current_alignment; + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; } void carla_msgs::msg::CarlaEgoVehicleControl::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_header; scdr << m_throttle; scdr << m_steer; @@ -168,11 +228,14 @@ void carla_msgs::msg::CarlaEgoVehicleControl::serialize( scdr << m_reverse; scdr << m_gear; scdr << m_manual_gear_shift; + scdr << m_control_priority; + } void carla_msgs::msg::CarlaEgoVehicleControl::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_header; dcdr >> m_throttle; dcdr >> m_steer; @@ -181,6 +244,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::deserialize( dcdr >> m_reverse; dcdr >> m_gear; dcdr >> m_manual_gear_shift; + dcdr >> m_control_priority; } /*! @@ -416,11 +480,43 @@ bool& carla_msgs::msg::CarlaEgoVehicleControl::manual_gear_shift() return m_manual_gear_shift; } +/*! + * @brief This function sets a value in member control_priority + * @param _control_priority New value for member control_priority + */ +void carla_msgs::msg::CarlaEgoVehicleControl::control_priority( + uint8_t _control_priority) +{ + m_control_priority = _control_priority; +} + +/*! + * @brief This function returns the value of member control_priority + * @return Value of member control_priority + */ +uint8_t carla_msgs::msg::CarlaEgoVehicleControl::control_priority() const +{ + return m_control_priority; +} + +/*! + * @brief This function returns a reference to member control_priority + * @return Reference to member control_priority + */ +uint8_t& carla_msgs::msg::CarlaEgoVehicleControl::control_priority() +{ + return m_control_priority; +} + + size_t carla_msgs::msg::CarlaEgoVehicleControl::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return carla_msgs_msg_CarlaEgoVehicleControl_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool carla_msgs::msg::CarlaEgoVehicleControl::isKeyDefined() @@ -432,4 +528,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/types/CarlaEgoVehicleControl.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.h similarity index 86% rename from LibCarla/source/carla/ros2/types/CarlaEgoVehicleControl.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.h index f941d5dcb41..3590c6e70f3 100644 --- a/LibCarla/source/carla/ros2/types/CarlaEgoVehicleControl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.h @@ -13,18 +13,16 @@ // limitations under the License. /*! - * @file CarlaEgoCarlaEgoVehicleControl.h + * @file CarlaEgoVehicleControl.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOCarlaEgoVehicleControl_H_ -#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOCarlaEgoVehicleControl_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_H_ -#include "Header.h" - -#include +#include "std_msgs/msg/Header.h" #include #include @@ -45,16 +43,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaEgoCarlaEgoVehicleControl_SOURCE) -#define CarlaEgoCarlaEgoVehicleControl_DllAPI __declspec( dllexport ) +#if defined(CarlaEgoVehicleControl_SOURCE) +#define CarlaEgoVehicleControl_DllAPI __declspec( dllexport ) #else -#define CarlaEgoCarlaEgoVehicleControl_DllAPI __declspec( dllimport ) -#endif // CarlaEgoCarlaEgoVehicleControl_SOURCE +#define CarlaEgoVehicleControl_DllAPI __declspec( dllimport ) +#endif // CarlaEgoVehicleControl_SOURCE #else -#define CarlaEgoCarlaEgoVehicleControl_DllAPI +#define CarlaEgoVehicleControl_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaEgoCarlaEgoVehicleControl_DllAPI +#define CarlaEgoVehicleControl_DllAPI #endif // _WIN32 namespace eprosima { @@ -63,11 +61,12 @@ class Cdr; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { namespace msg { /*! * @brief This class represents the structure CarlaEgoVehicleControl defined by the user in the IDL file. - * @ingroup CarlaEgoVehicleControl + * @ingroup CARLAEGOVEHICLECONTROL */ class CarlaEgoVehicleControl { @@ -95,7 +94,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. */ eProsima_user_DllExport CarlaEgoVehicleControl( - CarlaEgoVehicleControl&& x) noexcept; + CarlaEgoVehicleControl&& x); /*! * @brief Copy assignment. @@ -109,7 +108,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. */ eProsima_user_DllExport CarlaEgoVehicleControl& operator =( - CarlaEgoVehicleControl&& x) noexcept; + CarlaEgoVehicleControl&& x); /*! * @brief Comparison operator. @@ -284,11 +283,31 @@ namespace carla_msgs { eProsima_user_DllExport bool& manual_gear_shift(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function sets a value in member control_priority + * @param _control_priority New value for member control_priority + */ + eProsima_user_DllExport void control_priority( + uint8_t _control_priority); + + /*! + * @brief This function returns the value of member control_priority + * @return Value of member control_priority + */ + eProsima_user_DllExport uint8_t control_priority() const; + + /*! + * @brief This function returns a reference to member control_priority + * @return Reference to member control_priority + */ + eProsima_user_DllExport uint8_t& control_priority(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -302,6 +321,7 @@ namespace carla_msgs { const carla_msgs::msg::CarlaEgoVehicleControl& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -316,6 +336,8 @@ namespace carla_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -338,6 +360,7 @@ namespace carla_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + std_msgs::msg::Header m_header; float m_throttle; float m_steer; @@ -346,9 +369,9 @@ namespace carla_msgs { bool m_reverse; int32_t m_gear; bool m_manual_gear_shift; - + uint8_t m_control_priority; }; } // namespace msg } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOCarlaEgoVehicleControl_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/CarlaEgoVehicleControlPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.cxx similarity index 88% rename from LibCarla/source/carla/ros2/types/CarlaEgoVehicleControlPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.cxx index c5ff5216967..848b04376a9 100644 --- a/LibCarla/source/carla/ros2/types/CarlaEgoVehicleControlPubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.cxx @@ -13,12 +13,13 @@ // limitations under the License. /*! - * @file CarlaEgoCarlaEgoVehicleControlPubSubTypes.cpp + * @file CarlaEgoVehicleControlPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * * This file was generated by the tool fastcdrgen. */ + #include #include @@ -83,21 +84,21 @@ namespace carla_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - CarlaEgoVehicleControl* p_type = static_cast(data); + //Convert DATA to pointer of your type + CarlaEgoVehicleControl* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -168,5 +169,8 @@ namespace carla_msgs { } return true; } + + } //End of namespace msg + } //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/types/CarlaEgoVehicleControlPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.h similarity index 85% rename from LibCarla/source/carla/ros2/types/CarlaEgoVehicleControlPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.h index 4d064e66a79..1ccae436e6e 100644 --- a/LibCarla/source/carla/ros2/types/CarlaEgoVehicleControlPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.h @@ -13,25 +13,24 @@ // limitations under the License. /*! - * @file CarlaEgoCarlaEgoVehicleControlPubSubTypes.h + * @file CarlaEgoVehicleControlPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOCarlaEgoVehicleControl_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOCarlaEgoVehicleControl_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_PUBSUBTYPES_H_ #include #include #include "CarlaEgoVehicleControl.h" -#include "HeaderPubSubTypes.h" - #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated CarlaEgoCarlaEgoVehicleControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CarlaEgoVehicleControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace carla_msgs @@ -40,7 +39,7 @@ namespace carla_msgs { /*! * @brief This class represents the TopicDataType of the type CarlaEgoVehicleControl defined by the user in the IDL file. - * @ingroup CarlaEgoVehicleControl + * @ingroup CARLAEGOVEHICLECONTROL */ class CarlaEgoVehicleControlPubSubType : public eprosima::fastdds::dds::TopicDataType { @@ -50,7 +49,7 @@ namespace carla_msgs eProsima_user_DllExport CarlaEgoVehicleControlPubSubType(); - eProsima_user_DllExport virtual ~CarlaEgoVehicleControlPubSubType() override; + eProsima_user_DllExport virtual ~CarlaEgoVehicleControlPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -98,10 +97,11 @@ namespace carla_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOCarlaEgoVehicleControl_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx new file mode 100644 index 00000000000..98eb3216e4c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx @@ -0,0 +1,871 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfo.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaEgoVehicleInfo.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo() +{ + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2d52216b + m_id = 0; + // m_type com.eprosima.idl.parser.typecode.StringTypeCode@242b836 + m_type =""; + // m_rolename com.eprosima.idl.parser.typecode.StringTypeCode@3f6f6701 + m_rolename =""; + // m_wheels com.eprosima.idl.parser.typecode.SequenceTypeCode@3527942a + + // m_max_rpm com.eprosima.idl.parser.typecode.PrimitiveTypeCode@942a29c + m_max_rpm = 0.0; + // m_moi com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1ed6388a + m_moi = 0.0; + // m_damping_rate_full_throttle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5a45133e + m_damping_rate_full_throttle = 0.0; + // m_damping_rate_zero_throttle_clutch_engaged com.eprosima.idl.parser.typecode.PrimitiveTypeCode@534a5a98 + m_damping_rate_zero_throttle_clutch_engaged = 0.0; + // m_damping_rate_zero_throttle_clutch_disengaged com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f80542f + m_damping_rate_zero_throttle_clutch_disengaged = 0.0; + // m_use_gear_autobox com.eprosima.idl.parser.typecode.PrimitiveTypeCode@60bd273d + m_use_gear_autobox = false; + // m_gear_switch_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@121314f7 + m_gear_switch_time = 0.0; + // m_clutch_strength com.eprosima.idl.parser.typecode.PrimitiveTypeCode@130c12b7 + m_clutch_strength = 0.0; + // m_mass com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e600dd5 + m_mass = 0.0; + // m_drag_coefficient com.eprosima.idl.parser.typecode.PrimitiveTypeCode@576d5deb + m_drag_coefficient = 0.0; + // m_center_of_mass com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5d534f5d + + // m_shape com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2e3967ea + + +} + +carla_msgs::msg::CarlaEgoVehicleInfo::~CarlaEgoVehicleInfo() +{ + + + + + + + + + + + + + + + +} + +carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( + const CarlaEgoVehicleInfo& x) +{ + m_id = x.m_id; + m_type = x.m_type; + m_rolename = x.m_rolename; + m_wheels = x.m_wheels; + m_max_rpm = x.m_max_rpm; + m_moi = x.m_moi; + m_damping_rate_full_throttle = x.m_damping_rate_full_throttle; + m_damping_rate_zero_throttle_clutch_engaged = x.m_damping_rate_zero_throttle_clutch_engaged; + m_damping_rate_zero_throttle_clutch_disengaged = x.m_damping_rate_zero_throttle_clutch_disengaged; + m_use_gear_autobox = x.m_use_gear_autobox; + m_gear_switch_time = x.m_gear_switch_time; + m_clutch_strength = x.m_clutch_strength; + m_mass = x.m_mass; + m_drag_coefficient = x.m_drag_coefficient; + m_center_of_mass = x.m_center_of_mass; + m_shape = x.m_shape; +} + +carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( + CarlaEgoVehicleInfo&& x) +{ + m_id = x.m_id; + m_type = std::move(x.m_type); + m_rolename = std::move(x.m_rolename); + m_wheels = std::move(x.m_wheels); + m_max_rpm = x.m_max_rpm; + m_moi = x.m_moi; + m_damping_rate_full_throttle = x.m_damping_rate_full_throttle; + m_damping_rate_zero_throttle_clutch_engaged = x.m_damping_rate_zero_throttle_clutch_engaged; + m_damping_rate_zero_throttle_clutch_disengaged = x.m_damping_rate_zero_throttle_clutch_disengaged; + m_use_gear_autobox = x.m_use_gear_autobox; + m_gear_switch_time = x.m_gear_switch_time; + m_clutch_strength = x.m_clutch_strength; + m_mass = x.m_mass; + m_drag_coefficient = x.m_drag_coefficient; + m_center_of_mass = std::move(x.m_center_of_mass); + m_shape = std::move(x.m_shape); +} + +carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::operator =( + const CarlaEgoVehicleInfo& x) +{ + + m_id = x.m_id; + m_type = x.m_type; + m_rolename = x.m_rolename; + m_wheels = x.m_wheels; + m_max_rpm = x.m_max_rpm; + m_moi = x.m_moi; + m_damping_rate_full_throttle = x.m_damping_rate_full_throttle; + m_damping_rate_zero_throttle_clutch_engaged = x.m_damping_rate_zero_throttle_clutch_engaged; + m_damping_rate_zero_throttle_clutch_disengaged = x.m_damping_rate_zero_throttle_clutch_disengaged; + m_use_gear_autobox = x.m_use_gear_autobox; + m_gear_switch_time = x.m_gear_switch_time; + m_clutch_strength = x.m_clutch_strength; + m_mass = x.m_mass; + m_drag_coefficient = x.m_drag_coefficient; + m_center_of_mass = x.m_center_of_mass; + m_shape = x.m_shape; + + return *this; +} + +carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::operator =( + CarlaEgoVehicleInfo&& x) +{ + + m_id = x.m_id; + m_type = std::move(x.m_type); + m_rolename = std::move(x.m_rolename); + m_wheels = std::move(x.m_wheels); + m_max_rpm = x.m_max_rpm; + m_moi = x.m_moi; + m_damping_rate_full_throttle = x.m_damping_rate_full_throttle; + m_damping_rate_zero_throttle_clutch_engaged = x.m_damping_rate_zero_throttle_clutch_engaged; + m_damping_rate_zero_throttle_clutch_disengaged = x.m_damping_rate_zero_throttle_clutch_disengaged; + m_use_gear_autobox = x.m_use_gear_autobox; + m_gear_switch_time = x.m_gear_switch_time; + m_clutch_strength = x.m_clutch_strength; + m_mass = x.m_mass; + m_drag_coefficient = x.m_drag_coefficient; + m_center_of_mass = std::move(x.m_center_of_mass); + m_shape = std::move(x.m_shape); + + return *this; +} + +bool carla_msgs::msg::CarlaEgoVehicleInfo::operator ==( + const CarlaEgoVehicleInfo& x) const +{ + + return (m_id == x.m_id && m_type == x.m_type && m_rolename == x.m_rolename && m_wheels == x.m_wheels && m_max_rpm == x.m_max_rpm && m_moi == x.m_moi && m_damping_rate_full_throttle == x.m_damping_rate_full_throttle && m_damping_rate_zero_throttle_clutch_engaged == x.m_damping_rate_zero_throttle_clutch_engaged && m_damping_rate_zero_throttle_clutch_disengaged == x.m_damping_rate_zero_throttle_clutch_disengaged && m_use_gear_autobox == x.m_use_gear_autobox && m_gear_switch_time == x.m_gear_switch_time && m_clutch_strength == x.m_clutch_strength && m_mass == x.m_mass && m_drag_coefficient == x.m_drag_coefficient && m_center_of_mass == x.m_center_of_mass && m_shape == x.m_shape); +} + +bool carla_msgs::msg::CarlaEgoVehicleInfo::operator !=( + const CarlaEgoVehicleInfo& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaEgoVehicleInfo::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaEgoVehicleInfoWheel::getMaxCdrSerializedSize(current_alignment);} + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + current_alignment += shape_msgs::msg::SolidPrimitive::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaEgoVehicleInfo::getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleInfo& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.rolename().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.wheels().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaEgoVehicleInfoWheel::getCdrSerializedSize(data.wheels().at(a), current_alignment);} + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.center_of_mass(), current_alignment); + current_alignment += shape_msgs::msg::SolidPrimitive::getCdrSerializedSize(data.shape(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaEgoVehicleInfo::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_id; + scdr << m_type; + scdr << m_rolename; + scdr << m_wheels; + scdr << m_max_rpm; + scdr << m_moi; + scdr << m_damping_rate_full_throttle; + scdr << m_damping_rate_zero_throttle_clutch_engaged; + scdr << m_damping_rate_zero_throttle_clutch_disengaged; + scdr << m_use_gear_autobox; + scdr << m_gear_switch_time; + scdr << m_clutch_strength; + scdr << m_mass; + scdr << m_drag_coefficient; + scdr << m_center_of_mass; + scdr << m_shape; + +} + +void carla_msgs::msg::CarlaEgoVehicleInfo::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_id; + dcdr >> m_type; + dcdr >> m_rolename; + dcdr >> m_wheels; + dcdr >> m_max_rpm; + dcdr >> m_moi; + dcdr >> m_damping_rate_full_throttle; + dcdr >> m_damping_rate_zero_throttle_clutch_engaged; + dcdr >> m_damping_rate_zero_throttle_clutch_disengaged; + dcdr >> m_use_gear_autobox; + dcdr >> m_gear_switch_time; + dcdr >> m_clutch_strength; + dcdr >> m_mass; + dcdr >> m_drag_coefficient; + dcdr >> m_center_of_mass; + dcdr >> m_shape; +} + +/*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::id( + uint32_t _id) +{ + m_id = _id; +} + +/*! + * @brief This function returns the value of member id + * @return Value of member id + */ +uint32_t carla_msgs::msg::CarlaEgoVehicleInfo::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +uint32_t& carla_msgs::msg::CarlaEgoVehicleInfo::id() +{ + return m_id; +} + +/*! + * @brief This function copies the value in member type + * @param _type New value to be copied in member type + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::type( + const std::string& _type) +{ + m_type = _type; +} + +/*! + * @brief This function moves the value in member type + * @param _type New value to be moved in member type + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::type( + std::string&& _type) +{ + m_type = std::move(_type); +} + +/*! + * @brief This function returns a constant reference to member type + * @return Constant reference to member type + */ +const std::string& carla_msgs::msg::CarlaEgoVehicleInfo::type() const +{ + return m_type; +} + +/*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ +std::string& carla_msgs::msg::CarlaEgoVehicleInfo::type() +{ + return m_type; +} +/*! + * @brief This function copies the value in member rolename + * @param _rolename New value to be copied in member rolename + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::rolename( + const std::string& _rolename) +{ + m_rolename = _rolename; +} + +/*! + * @brief This function moves the value in member rolename + * @param _rolename New value to be moved in member rolename + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::rolename( + std::string&& _rolename) +{ + m_rolename = std::move(_rolename); +} + +/*! + * @brief This function returns a constant reference to member rolename + * @return Constant reference to member rolename + */ +const std::string& carla_msgs::msg::CarlaEgoVehicleInfo::rolename() const +{ + return m_rolename; +} + +/*! + * @brief This function returns a reference to member rolename + * @return Reference to member rolename + */ +std::string& carla_msgs::msg::CarlaEgoVehicleInfo::rolename() +{ + return m_rolename; +} +/*! + * @brief This function copies the value in member wheels + * @param _wheels New value to be copied in member wheels + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::wheels( + const std::vector& _wheels) +{ + m_wheels = _wheels; +} + +/*! + * @brief This function moves the value in member wheels + * @param _wheels New value to be moved in member wheels + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::wheels( + std::vector&& _wheels) +{ + m_wheels = std::move(_wheels); +} + +/*! + * @brief This function returns a constant reference to member wheels + * @return Constant reference to member wheels + */ +const std::vector& carla_msgs::msg::CarlaEgoVehicleInfo::wheels() const +{ + return m_wheels; +} + +/*! + * @brief This function returns a reference to member wheels + * @return Reference to member wheels + */ +std::vector& carla_msgs::msg::CarlaEgoVehicleInfo::wheels() +{ + return m_wheels; +} +/*! + * @brief This function sets a value in member max_rpm + * @param _max_rpm New value for member max_rpm + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::max_rpm( + float _max_rpm) +{ + m_max_rpm = _max_rpm; +} + +/*! + * @brief This function returns the value of member max_rpm + * @return Value of member max_rpm + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::max_rpm() const +{ + return m_max_rpm; +} + +/*! + * @brief This function returns a reference to member max_rpm + * @return Reference to member max_rpm + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::max_rpm() +{ + return m_max_rpm; +} + +/*! + * @brief This function sets a value in member moi + * @param _moi New value for member moi + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::moi( + float _moi) +{ + m_moi = _moi; +} + +/*! + * @brief This function returns the value of member moi + * @return Value of member moi + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::moi() const +{ + return m_moi; +} + +/*! + * @brief This function returns a reference to member moi + * @return Reference to member moi + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::moi() +{ + return m_moi; +} + +/*! + * @brief This function sets a value in member damping_rate_full_throttle + * @param _damping_rate_full_throttle New value for member damping_rate_full_throttle + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_full_throttle( + float _damping_rate_full_throttle) +{ + m_damping_rate_full_throttle = _damping_rate_full_throttle; +} + +/*! + * @brief This function returns the value of member damping_rate_full_throttle + * @return Value of member damping_rate_full_throttle + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_full_throttle() const +{ + return m_damping_rate_full_throttle; +} + +/*! + * @brief This function returns a reference to member damping_rate_full_throttle + * @return Reference to member damping_rate_full_throttle + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_full_throttle() +{ + return m_damping_rate_full_throttle; +} + +/*! + * @brief This function sets a value in member damping_rate_zero_throttle_clutch_engaged + * @param _damping_rate_zero_throttle_clutch_engaged New value for member damping_rate_zero_throttle_clutch_engaged + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged( + float _damping_rate_zero_throttle_clutch_engaged) +{ + m_damping_rate_zero_throttle_clutch_engaged = _damping_rate_zero_throttle_clutch_engaged; +} + +/*! + * @brief This function returns the value of member damping_rate_zero_throttle_clutch_engaged + * @return Value of member damping_rate_zero_throttle_clutch_engaged + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged() const +{ + return m_damping_rate_zero_throttle_clutch_engaged; +} + +/*! + * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_engaged + * @return Reference to member damping_rate_zero_throttle_clutch_engaged + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged() +{ + return m_damping_rate_zero_throttle_clutch_engaged; +} + +/*! + * @brief This function sets a value in member damping_rate_zero_throttle_clutch_disengaged + * @param _damping_rate_zero_throttle_clutch_disengaged New value for member damping_rate_zero_throttle_clutch_disengaged + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged( + float _damping_rate_zero_throttle_clutch_disengaged) +{ + m_damping_rate_zero_throttle_clutch_disengaged = _damping_rate_zero_throttle_clutch_disengaged; +} + +/*! + * @brief This function returns the value of member damping_rate_zero_throttle_clutch_disengaged + * @return Value of member damping_rate_zero_throttle_clutch_disengaged + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged() const +{ + return m_damping_rate_zero_throttle_clutch_disengaged; +} + +/*! + * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_disengaged + * @return Reference to member damping_rate_zero_throttle_clutch_disengaged + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged() +{ + return m_damping_rate_zero_throttle_clutch_disengaged; +} + +/*! + * @brief This function sets a value in member use_gear_autobox + * @param _use_gear_autobox New value for member use_gear_autobox + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::use_gear_autobox( + bool _use_gear_autobox) +{ + m_use_gear_autobox = _use_gear_autobox; +} + +/*! + * @brief This function returns the value of member use_gear_autobox + * @return Value of member use_gear_autobox + */ +bool carla_msgs::msg::CarlaEgoVehicleInfo::use_gear_autobox() const +{ + return m_use_gear_autobox; +} + +/*! + * @brief This function returns a reference to member use_gear_autobox + * @return Reference to member use_gear_autobox + */ +bool& carla_msgs::msg::CarlaEgoVehicleInfo::use_gear_autobox() +{ + return m_use_gear_autobox; +} + +/*! + * @brief This function sets a value in member gear_switch_time + * @param _gear_switch_time New value for member gear_switch_time + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::gear_switch_time( + float _gear_switch_time) +{ + m_gear_switch_time = _gear_switch_time; +} + +/*! + * @brief This function returns the value of member gear_switch_time + * @return Value of member gear_switch_time + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::gear_switch_time() const +{ + return m_gear_switch_time; +} + +/*! + * @brief This function returns a reference to member gear_switch_time + * @return Reference to member gear_switch_time + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::gear_switch_time() +{ + return m_gear_switch_time; +} + +/*! + * @brief This function sets a value in member clutch_strength + * @param _clutch_strength New value for member clutch_strength + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::clutch_strength( + float _clutch_strength) +{ + m_clutch_strength = _clutch_strength; +} + +/*! + * @brief This function returns the value of member clutch_strength + * @return Value of member clutch_strength + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::clutch_strength() const +{ + return m_clutch_strength; +} + +/*! + * @brief This function returns a reference to member clutch_strength + * @return Reference to member clutch_strength + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::clutch_strength() +{ + return m_clutch_strength; +} + +/*! + * @brief This function sets a value in member mass + * @param _mass New value for member mass + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::mass( + float _mass) +{ + m_mass = _mass; +} + +/*! + * @brief This function returns the value of member mass + * @return Value of member mass + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::mass() const +{ + return m_mass; +} + +/*! + * @brief This function returns a reference to member mass + * @return Reference to member mass + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::mass() +{ + return m_mass; +} + +/*! + * @brief This function sets a value in member drag_coefficient + * @param _drag_coefficient New value for member drag_coefficient + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::drag_coefficient( + float _drag_coefficient) +{ + m_drag_coefficient = _drag_coefficient; +} + +/*! + * @brief This function returns the value of member drag_coefficient + * @return Value of member drag_coefficient + */ +float carla_msgs::msg::CarlaEgoVehicleInfo::drag_coefficient() const +{ + return m_drag_coefficient; +} + +/*! + * @brief This function returns a reference to member drag_coefficient + * @return Reference to member drag_coefficient + */ +float& carla_msgs::msg::CarlaEgoVehicleInfo::drag_coefficient() +{ + return m_drag_coefficient; +} + +/*! + * @brief This function copies the value in member center_of_mass + * @param _center_of_mass New value to be copied in member center_of_mass + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass( + const geometry_msgs::msg::Vector3& _center_of_mass) +{ + m_center_of_mass = _center_of_mass; +} + +/*! + * @brief This function moves the value in member center_of_mass + * @param _center_of_mass New value to be moved in member center_of_mass + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass( + geometry_msgs::msg::Vector3&& _center_of_mass) +{ + m_center_of_mass = std::move(_center_of_mass); +} + +/*! + * @brief This function returns a constant reference to member center_of_mass + * @return Constant reference to member center_of_mass + */ +const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass() const +{ + return m_center_of_mass; +} + +/*! + * @brief This function returns a reference to member center_of_mass + * @return Reference to member center_of_mass + */ +geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass() +{ + return m_center_of_mass; +} +/*! + * @brief This function copies the value in member shape + * @param _shape New value to be copied in member shape + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::shape( + const shape_msgs::msg::SolidPrimitive& _shape) +{ + m_shape = _shape; +} + +/*! + * @brief This function moves the value in member shape + * @param _shape New value to be moved in member shape + */ +void carla_msgs::msg::CarlaEgoVehicleInfo::shape( + shape_msgs::msg::SolidPrimitive&& _shape) +{ + m_shape = std::move(_shape); +} + +/*! + * @brief This function returns a constant reference to member shape + * @return Constant reference to member shape + */ +const shape_msgs::msg::SolidPrimitive& carla_msgs::msg::CarlaEgoVehicleInfo::shape() const +{ + return m_shape; +} + +/*! + * @brief This function returns a reference to member shape + * @return Reference to member shape + */ +shape_msgs::msg::SolidPrimitive& carla_msgs::msg::CarlaEgoVehicleInfo::shape() +{ + return m_shape; +} + +size_t carla_msgs::msg::CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaEgoVehicleInfo::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaEgoVehicleInfo::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h new file mode 100644 index 00000000000..923e20609b7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h @@ -0,0 +1,542 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfo.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_H_ + +#include "carla_msgs/msg/CarlaEgoVehicleInfoWheel.h" +#include "shape_msgs/msg/SolidPrimitive.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaEgoVehicleInfo_SOURCE) +#define CarlaEgoVehicleInfo_DllAPI __declspec( dllexport ) +#else +#define CarlaEgoVehicleInfo_DllAPI __declspec( dllimport ) +#endif // CarlaEgoVehicleInfo_SOURCE +#else +#define CarlaEgoVehicleInfo_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaEgoVehicleInfo_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaEgoVehicleInfo defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLEINFO + */ + class CarlaEgoVehicleInfo + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo( + const CarlaEgoVehicleInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo( + CarlaEgoVehicleInfo&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo& operator =( + const CarlaEgoVehicleInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo& operator =( + CarlaEgoVehicleInfo&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleInfo& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + /*! + * @brief This function copies the value in member type + * @param _type New value to be copied in member type + */ + eProsima_user_DllExport void type( + const std::string& _type); + + /*! + * @brief This function moves the value in member type + * @param _type New value to be moved in member type + */ + eProsima_user_DllExport void type( + std::string&& _type); + + /*! + * @brief This function returns a constant reference to member type + * @return Constant reference to member type + */ + eProsima_user_DllExport const std::string& type() const; + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport std::string& type(); + /*! + * @brief This function copies the value in member rolename + * @param _rolename New value to be copied in member rolename + */ + eProsima_user_DllExport void rolename( + const std::string& _rolename); + + /*! + * @brief This function moves the value in member rolename + * @param _rolename New value to be moved in member rolename + */ + eProsima_user_DllExport void rolename( + std::string&& _rolename); + + /*! + * @brief This function returns a constant reference to member rolename + * @return Constant reference to member rolename + */ + eProsima_user_DllExport const std::string& rolename() const; + + /*! + * @brief This function returns a reference to member rolename + * @return Reference to member rolename + */ + eProsima_user_DllExport std::string& rolename(); + /*! + * @brief This function copies the value in member wheels + * @param _wheels New value to be copied in member wheels + */ + eProsima_user_DllExport void wheels( + const std::vector& _wheels); + + /*! + * @brief This function moves the value in member wheels + * @param _wheels New value to be moved in member wheels + */ + eProsima_user_DllExport void wheels( + std::vector&& _wheels); + + /*! + * @brief This function returns a constant reference to member wheels + * @return Constant reference to member wheels + */ + eProsima_user_DllExport const std::vector& wheels() const; + + /*! + * @brief This function returns a reference to member wheels + * @return Reference to member wheels + */ + eProsima_user_DllExport std::vector& wheels(); + /*! + * @brief This function sets a value in member max_rpm + * @param _max_rpm New value for member max_rpm + */ + eProsima_user_DllExport void max_rpm( + float _max_rpm); + + /*! + * @brief This function returns the value of member max_rpm + * @return Value of member max_rpm + */ + eProsima_user_DllExport float max_rpm() const; + + /*! + * @brief This function returns a reference to member max_rpm + * @return Reference to member max_rpm + */ + eProsima_user_DllExport float& max_rpm(); + + /*! + * @brief This function sets a value in member moi + * @param _moi New value for member moi + */ + eProsima_user_DllExport void moi( + float _moi); + + /*! + * @brief This function returns the value of member moi + * @return Value of member moi + */ + eProsima_user_DllExport float moi() const; + + /*! + * @brief This function returns a reference to member moi + * @return Reference to member moi + */ + eProsima_user_DllExport float& moi(); + + /*! + * @brief This function sets a value in member damping_rate_full_throttle + * @param _damping_rate_full_throttle New value for member damping_rate_full_throttle + */ + eProsima_user_DllExport void damping_rate_full_throttle( + float _damping_rate_full_throttle); + + /*! + * @brief This function returns the value of member damping_rate_full_throttle + * @return Value of member damping_rate_full_throttle + */ + eProsima_user_DllExport float damping_rate_full_throttle() const; + + /*! + * @brief This function returns a reference to member damping_rate_full_throttle + * @return Reference to member damping_rate_full_throttle + */ + eProsima_user_DllExport float& damping_rate_full_throttle(); + + /*! + * @brief This function sets a value in member damping_rate_zero_throttle_clutch_engaged + * @param _damping_rate_zero_throttle_clutch_engaged New value for member damping_rate_zero_throttle_clutch_engaged + */ + eProsima_user_DllExport void damping_rate_zero_throttle_clutch_engaged( + float _damping_rate_zero_throttle_clutch_engaged); + + /*! + * @brief This function returns the value of member damping_rate_zero_throttle_clutch_engaged + * @return Value of member damping_rate_zero_throttle_clutch_engaged + */ + eProsima_user_DllExport float damping_rate_zero_throttle_clutch_engaged() const; + + /*! + * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_engaged + * @return Reference to member damping_rate_zero_throttle_clutch_engaged + */ + eProsima_user_DllExport float& damping_rate_zero_throttle_clutch_engaged(); + + /*! + * @brief This function sets a value in member damping_rate_zero_throttle_clutch_disengaged + * @param _damping_rate_zero_throttle_clutch_disengaged New value for member damping_rate_zero_throttle_clutch_disengaged + */ + eProsima_user_DllExport void damping_rate_zero_throttle_clutch_disengaged( + float _damping_rate_zero_throttle_clutch_disengaged); + + /*! + * @brief This function returns the value of member damping_rate_zero_throttle_clutch_disengaged + * @return Value of member damping_rate_zero_throttle_clutch_disengaged + */ + eProsima_user_DllExport float damping_rate_zero_throttle_clutch_disengaged() const; + + /*! + * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_disengaged + * @return Reference to member damping_rate_zero_throttle_clutch_disengaged + */ + eProsima_user_DllExport float& damping_rate_zero_throttle_clutch_disengaged(); + + /*! + * @brief This function sets a value in member use_gear_autobox + * @param _use_gear_autobox New value for member use_gear_autobox + */ + eProsima_user_DllExport void use_gear_autobox( + bool _use_gear_autobox); + + /*! + * @brief This function returns the value of member use_gear_autobox + * @return Value of member use_gear_autobox + */ + eProsima_user_DllExport bool use_gear_autobox() const; + + /*! + * @brief This function returns a reference to member use_gear_autobox + * @return Reference to member use_gear_autobox + */ + eProsima_user_DllExport bool& use_gear_autobox(); + + /*! + * @brief This function sets a value in member gear_switch_time + * @param _gear_switch_time New value for member gear_switch_time + */ + eProsima_user_DllExport void gear_switch_time( + float _gear_switch_time); + + /*! + * @brief This function returns the value of member gear_switch_time + * @return Value of member gear_switch_time + */ + eProsima_user_DllExport float gear_switch_time() const; + + /*! + * @brief This function returns a reference to member gear_switch_time + * @return Reference to member gear_switch_time + */ + eProsima_user_DllExport float& gear_switch_time(); + + /*! + * @brief This function sets a value in member clutch_strength + * @param _clutch_strength New value for member clutch_strength + */ + eProsima_user_DllExport void clutch_strength( + float _clutch_strength); + + /*! + * @brief This function returns the value of member clutch_strength + * @return Value of member clutch_strength + */ + eProsima_user_DllExport float clutch_strength() const; + + /*! + * @brief This function returns a reference to member clutch_strength + * @return Reference to member clutch_strength + */ + eProsima_user_DllExport float& clutch_strength(); + + /*! + * @brief This function sets a value in member mass + * @param _mass New value for member mass + */ + eProsima_user_DllExport void mass( + float _mass); + + /*! + * @brief This function returns the value of member mass + * @return Value of member mass + */ + eProsima_user_DllExport float mass() const; + + /*! + * @brief This function returns a reference to member mass + * @return Reference to member mass + */ + eProsima_user_DllExport float& mass(); + + /*! + * @brief This function sets a value in member drag_coefficient + * @param _drag_coefficient New value for member drag_coefficient + */ + eProsima_user_DllExport void drag_coefficient( + float _drag_coefficient); + + /*! + * @brief This function returns the value of member drag_coefficient + * @return Value of member drag_coefficient + */ + eProsima_user_DllExport float drag_coefficient() const; + + /*! + * @brief This function returns a reference to member drag_coefficient + * @return Reference to member drag_coefficient + */ + eProsima_user_DllExport float& drag_coefficient(); + + /*! + * @brief This function copies the value in member center_of_mass + * @param _center_of_mass New value to be copied in member center_of_mass + */ + eProsima_user_DllExport void center_of_mass( + const geometry_msgs::msg::Vector3& _center_of_mass); + + /*! + * @brief This function moves the value in member center_of_mass + * @param _center_of_mass New value to be moved in member center_of_mass + */ + eProsima_user_DllExport void center_of_mass( + geometry_msgs::msg::Vector3&& _center_of_mass); + + /*! + * @brief This function returns a constant reference to member center_of_mass + * @return Constant reference to member center_of_mass + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& center_of_mass() const; + + /*! + * @brief This function returns a reference to member center_of_mass + * @return Reference to member center_of_mass + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& center_of_mass(); + /*! + * @brief This function copies the value in member shape + * @param _shape New value to be copied in member shape + */ + eProsima_user_DllExport void shape( + const shape_msgs::msg::SolidPrimitive& _shape); + + /*! + * @brief This function moves the value in member shape + * @param _shape New value to be moved in member shape + */ + eProsima_user_DllExport void shape( + shape_msgs::msg::SolidPrimitive&& _shape); + + /*! + * @brief This function returns a constant reference to member shape + * @return Constant reference to member shape + */ + eProsima_user_DllExport const shape_msgs::msg::SolidPrimitive& shape() const; + + /*! + * @brief This function returns a reference to member shape + * @return Reference to member shape + */ + eProsima_user_DllExport shape_msgs::msg::SolidPrimitive& shape(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleInfo& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint32_t m_id; + std::string m_type; + std::string m_rolename; + std::vector m_wheels; + float m_max_rpm; + float m_moi; + float m_damping_rate_full_throttle; + float m_damping_rate_zero_throttle_clutch_engaged; + float m_damping_rate_zero_throttle_clutch_disengaged; + bool m_use_gear_autobox; + float m_gear_switch_time; + float m_clutch_strength; + float m_mass; + float m_drag_coefficient; + geometry_msgs::msg::Vector3 m_center_of_mass; + shape_msgs::msg::SolidPrimitive m_shape; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.cxx new file mode 100644 index 00000000000..f3713cf0d7d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaEgoVehicleInfoPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaEgoVehicleInfoPubSubType::CarlaEgoVehicleInfoPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaEgoVehicleInfo_"); + auto type_size = CarlaEgoVehicleInfo::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaEgoVehicleInfo::isKeyDefined(); + size_t keyLength = CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize() > 16 ? + CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaEgoVehicleInfoPubSubType::~CarlaEgoVehicleInfoPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaEgoVehicleInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaEgoVehicleInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaEgoVehicleInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaEgoVehicleInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaEgoVehicleInfoPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaEgoVehicleInfoPubSubType::createData() + { + return reinterpret_cast(new CarlaEgoVehicleInfo()); + } + + void CarlaEgoVehicleInfoPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaEgoVehicleInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaEgoVehicleInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h new file mode 100644 index 00000000000..2e57c5de0e1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaEgoVehicleInfo.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaEgoVehicleInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleInfo defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLEINFO + */ + class CarlaEgoVehicleInfoPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaEgoVehicleInfo type; + + eProsima_user_DllExport CarlaEgoVehicleInfoPubSubType(); + + eProsima_user_DllExport virtual ~CarlaEgoVehicleInfoPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.cxx new file mode 100644 index 00000000000..15372480fde --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.cxx @@ -0,0 +1,448 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoWheel.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaEgoVehicleInfoWheel.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel() +{ + // m_tire_friction com.eprosima.idl.parser.typecode.PrimitiveTypeCode@368247b9 + m_tire_friction = 0.0; + // m_damping_rate com.eprosima.idl.parser.typecode.PrimitiveTypeCode@55a147cc + m_damping_rate = 0.0; + // m_max_steer_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71ba6d4e + m_max_steer_angle = 0.0; + // m_radius com.eprosima.idl.parser.typecode.PrimitiveTypeCode@738dc9b + m_radius = 0.0; + // m_max_brake_torque com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3c77d488 + m_max_brake_torque = 0.0; + // m_max_handbrake_torque com.eprosima.idl.parser.typecode.PrimitiveTypeCode@63376bed + m_max_handbrake_torque = 0.0; + // m_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4145bad8 + + +} + +carla_msgs::msg::CarlaEgoVehicleInfoWheel::~CarlaEgoVehicleInfoWheel() +{ + + + + + + +} + +carla_msgs::msg::CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel( + const CarlaEgoVehicleInfoWheel& x) +{ + m_tire_friction = x.m_tire_friction; + m_damping_rate = x.m_damping_rate; + m_max_steer_angle = x.m_max_steer_angle; + m_radius = x.m_radius; + m_max_brake_torque = x.m_max_brake_torque; + m_max_handbrake_torque = x.m_max_handbrake_torque; + m_position = x.m_position; +} + +carla_msgs::msg::CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel( + CarlaEgoVehicleInfoWheel&& x) +{ + m_tire_friction = x.m_tire_friction; + m_damping_rate = x.m_damping_rate; + m_max_steer_angle = x.m_max_steer_angle; + m_radius = x.m_radius; + m_max_brake_torque = x.m_max_brake_torque; + m_max_handbrake_torque = x.m_max_handbrake_torque; + m_position = std::move(x.m_position); +} + +carla_msgs::msg::CarlaEgoVehicleInfoWheel& carla_msgs::msg::CarlaEgoVehicleInfoWheel::operator =( + const CarlaEgoVehicleInfoWheel& x) +{ + + m_tire_friction = x.m_tire_friction; + m_damping_rate = x.m_damping_rate; + m_max_steer_angle = x.m_max_steer_angle; + m_radius = x.m_radius; + m_max_brake_torque = x.m_max_brake_torque; + m_max_handbrake_torque = x.m_max_handbrake_torque; + m_position = x.m_position; + + return *this; +} + +carla_msgs::msg::CarlaEgoVehicleInfoWheel& carla_msgs::msg::CarlaEgoVehicleInfoWheel::operator =( + CarlaEgoVehicleInfoWheel&& x) +{ + + m_tire_friction = x.m_tire_friction; + m_damping_rate = x.m_damping_rate; + m_max_steer_angle = x.m_max_steer_angle; + m_radius = x.m_radius; + m_max_brake_torque = x.m_max_brake_torque; + m_max_handbrake_torque = x.m_max_handbrake_torque; + m_position = std::move(x.m_position); + + return *this; +} + +bool carla_msgs::msg::CarlaEgoVehicleInfoWheel::operator ==( + const CarlaEgoVehicleInfoWheel& x) const +{ + + return (m_tire_friction == x.m_tire_friction && m_damping_rate == x.m_damping_rate && m_max_steer_angle == x.m_max_steer_angle && m_radius == x.m_radius && m_max_brake_torque == x.m_max_brake_torque && m_max_handbrake_torque == x.m_max_handbrake_torque && m_position == x.m_position); +} + +bool carla_msgs::msg::CarlaEgoVehicleInfoWheel::operator !=( + const CarlaEgoVehicleInfoWheel& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaEgoVehicleInfoWheel::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaEgoVehicleInfoWheel::getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleInfoWheel& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.position(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_tire_friction; + scdr << m_damping_rate; + scdr << m_max_steer_angle; + scdr << m_radius; + scdr << m_max_brake_torque; + scdr << m_max_handbrake_torque; + scdr << m_position; + +} + +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_tire_friction; + dcdr >> m_damping_rate; + dcdr >> m_max_steer_angle; + dcdr >> m_radius; + dcdr >> m_max_brake_torque; + dcdr >> m_max_handbrake_torque; + dcdr >> m_position; +} + +/*! + * @brief This function sets a value in member tire_friction + * @param _tire_friction New value for member tire_friction + */ +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::tire_friction( + float _tire_friction) +{ + m_tire_friction = _tire_friction; +} + +/*! + * @brief This function returns the value of member tire_friction + * @return Value of member tire_friction + */ +float carla_msgs::msg::CarlaEgoVehicleInfoWheel::tire_friction() const +{ + return m_tire_friction; +} + +/*! + * @brief This function returns a reference to member tire_friction + * @return Reference to member tire_friction + */ +float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::tire_friction() +{ + return m_tire_friction; +} + +/*! + * @brief This function sets a value in member damping_rate + * @param _damping_rate New value for member damping_rate + */ +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::damping_rate( + float _damping_rate) +{ + m_damping_rate = _damping_rate; +} + +/*! + * @brief This function returns the value of member damping_rate + * @return Value of member damping_rate + */ +float carla_msgs::msg::CarlaEgoVehicleInfoWheel::damping_rate() const +{ + return m_damping_rate; +} + +/*! + * @brief This function returns a reference to member damping_rate + * @return Reference to member damping_rate + */ +float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::damping_rate() +{ + return m_damping_rate; +} + +/*! + * @brief This function sets a value in member max_steer_angle + * @param _max_steer_angle New value for member max_steer_angle + */ +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_steer_angle( + float _max_steer_angle) +{ + m_max_steer_angle = _max_steer_angle; +} + +/*! + * @brief This function returns the value of member max_steer_angle + * @return Value of member max_steer_angle + */ +float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_steer_angle() const +{ + return m_max_steer_angle; +} + +/*! + * @brief This function returns a reference to member max_steer_angle + * @return Reference to member max_steer_angle + */ +float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_steer_angle() +{ + return m_max_steer_angle; +} + +/*! + * @brief This function sets a value in member radius + * @param _radius New value for member radius + */ +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::radius( + float _radius) +{ + m_radius = _radius; +} + +/*! + * @brief This function returns the value of member radius + * @return Value of member radius + */ +float carla_msgs::msg::CarlaEgoVehicleInfoWheel::radius() const +{ + return m_radius; +} + +/*! + * @brief This function returns a reference to member radius + * @return Reference to member radius + */ +float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::radius() +{ + return m_radius; +} + +/*! + * @brief This function sets a value in member max_brake_torque + * @param _max_brake_torque New value for member max_brake_torque + */ +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_brake_torque( + float _max_brake_torque) +{ + m_max_brake_torque = _max_brake_torque; +} + +/*! + * @brief This function returns the value of member max_brake_torque + * @return Value of member max_brake_torque + */ +float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_brake_torque() const +{ + return m_max_brake_torque; +} + +/*! + * @brief This function returns a reference to member max_brake_torque + * @return Reference to member max_brake_torque + */ +float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_brake_torque() +{ + return m_max_brake_torque; +} + +/*! + * @brief This function sets a value in member max_handbrake_torque + * @param _max_handbrake_torque New value for member max_handbrake_torque + */ +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_handbrake_torque( + float _max_handbrake_torque) +{ + m_max_handbrake_torque = _max_handbrake_torque; +} + +/*! + * @brief This function returns the value of member max_handbrake_torque + * @return Value of member max_handbrake_torque + */ +float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_handbrake_torque() const +{ + return m_max_handbrake_torque; +} + +/*! + * @brief This function returns a reference to member max_handbrake_torque + * @return Reference to member max_handbrake_torque + */ +float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_handbrake_torque() +{ + return m_max_handbrake_torque; +} + +/*! + * @brief This function copies the value in member position + * @param _position New value to be copied in member position + */ +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::position( + const geometry_msgs::msg::Vector3& _position) +{ + m_position = _position; +} + +/*! + * @brief This function moves the value in member position + * @param _position New value to be moved in member position + */ +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::position( + geometry_msgs::msg::Vector3&& _position) +{ + m_position = std::move(_position); +} + +/*! + * @brief This function returns a constant reference to member position + * @return Constant reference to member position + */ +const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfoWheel::position() const +{ + return m_position; +} + +/*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ +geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfoWheel::position() +{ + return m_position; +} + +size_t carla_msgs::msg::CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaEgoVehicleInfoWheel::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaEgoVehicleInfoWheel::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.h new file mode 100644 index 00000000000..d589d2a4112 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.h @@ -0,0 +1,337 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoWheel.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_H_ + +#include "geometry_msgs/msg/Vector3.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaEgoVehicleInfoWheel_SOURCE) +#define CarlaEgoVehicleInfoWheel_DllAPI __declspec( dllexport ) +#else +#define CarlaEgoVehicleInfoWheel_DllAPI __declspec( dllimport ) +#endif // CarlaEgoVehicleInfoWheel_SOURCE +#else +#define CarlaEgoVehicleInfoWheel_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaEgoVehicleInfoWheel_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaEgoVehicleInfoWheel defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLEINFOWHEEL + */ + class CarlaEgoVehicleInfoWheel + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleInfoWheel(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel( + const CarlaEgoVehicleInfoWheel& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel( + CarlaEgoVehicleInfoWheel&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel& operator =( + const CarlaEgoVehicleInfoWheel& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel& operator =( + CarlaEgoVehicleInfoWheel&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleInfoWheel object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleInfoWheel& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleInfoWheel object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleInfoWheel& x) const; + + /*! + * @brief This function sets a value in member tire_friction + * @param _tire_friction New value for member tire_friction + */ + eProsima_user_DllExport void tire_friction( + float _tire_friction); + + /*! + * @brief This function returns the value of member tire_friction + * @return Value of member tire_friction + */ + eProsima_user_DllExport float tire_friction() const; + + /*! + * @brief This function returns a reference to member tire_friction + * @return Reference to member tire_friction + */ + eProsima_user_DllExport float& tire_friction(); + + /*! + * @brief This function sets a value in member damping_rate + * @param _damping_rate New value for member damping_rate + */ + eProsima_user_DllExport void damping_rate( + float _damping_rate); + + /*! + * @brief This function returns the value of member damping_rate + * @return Value of member damping_rate + */ + eProsima_user_DllExport float damping_rate() const; + + /*! + * @brief This function returns a reference to member damping_rate + * @return Reference to member damping_rate + */ + eProsima_user_DllExport float& damping_rate(); + + /*! + * @brief This function sets a value in member max_steer_angle + * @param _max_steer_angle New value for member max_steer_angle + */ + eProsima_user_DllExport void max_steer_angle( + float _max_steer_angle); + + /*! + * @brief This function returns the value of member max_steer_angle + * @return Value of member max_steer_angle + */ + eProsima_user_DllExport float max_steer_angle() const; + + /*! + * @brief This function returns a reference to member max_steer_angle + * @return Reference to member max_steer_angle + */ + eProsima_user_DllExport float& max_steer_angle(); + + /*! + * @brief This function sets a value in member radius + * @param _radius New value for member radius + */ + eProsima_user_DllExport void radius( + float _radius); + + /*! + * @brief This function returns the value of member radius + * @return Value of member radius + */ + eProsima_user_DllExport float radius() const; + + /*! + * @brief This function returns a reference to member radius + * @return Reference to member radius + */ + eProsima_user_DllExport float& radius(); + + /*! + * @brief This function sets a value in member max_brake_torque + * @param _max_brake_torque New value for member max_brake_torque + */ + eProsima_user_DllExport void max_brake_torque( + float _max_brake_torque); + + /*! + * @brief This function returns the value of member max_brake_torque + * @return Value of member max_brake_torque + */ + eProsima_user_DllExport float max_brake_torque() const; + + /*! + * @brief This function returns a reference to member max_brake_torque + * @return Reference to member max_brake_torque + */ + eProsima_user_DllExport float& max_brake_torque(); + + /*! + * @brief This function sets a value in member max_handbrake_torque + * @param _max_handbrake_torque New value for member max_handbrake_torque + */ + eProsima_user_DllExport void max_handbrake_torque( + float _max_handbrake_torque); + + /*! + * @brief This function returns the value of member max_handbrake_torque + * @return Value of member max_handbrake_torque + */ + eProsima_user_DllExport float max_handbrake_torque() const; + + /*! + * @brief This function returns a reference to member max_handbrake_torque + * @return Reference to member max_handbrake_torque + */ + eProsima_user_DllExport float& max_handbrake_torque(); + + /*! + * @brief This function copies the value in member position + * @param _position New value to be copied in member position + */ + eProsima_user_DllExport void position( + const geometry_msgs::msg::Vector3& _position); + + /*! + * @brief This function moves the value in member position + * @param _position New value to be moved in member position + */ + eProsima_user_DllExport void position( + geometry_msgs::msg::Vector3&& _position); + + /*! + * @brief This function returns a constant reference to member position + * @return Constant reference to member position + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& position() const; + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& position(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleInfoWheel& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + float m_tire_friction; + float m_damping_rate; + float m_max_steer_angle; + float m_radius; + float m_max_brake_torque; + float m_max_handbrake_torque; + geometry_msgs::msg::Vector3 m_position; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.cxx new file mode 100644 index 00000000000..977bb4ffb1f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoWheelPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaEgoVehicleInfoWheelPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaEgoVehicleInfoWheelPubSubType::CarlaEgoVehicleInfoWheelPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaEgoVehicleInfoWheel_"); + auto type_size = CarlaEgoVehicleInfoWheel::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaEgoVehicleInfoWheel::isKeyDefined(); + size_t keyLength = CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize() > 16 ? + CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaEgoVehicleInfoWheelPubSubType::~CarlaEgoVehicleInfoWheelPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaEgoVehicleInfoWheelPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaEgoVehicleInfoWheel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaEgoVehicleInfoWheelPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaEgoVehicleInfoWheel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaEgoVehicleInfoWheelPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaEgoVehicleInfoWheelPubSubType::createData() + { + return reinterpret_cast(new CarlaEgoVehicleInfoWheel()); + } + + void CarlaEgoVehicleInfoWheelPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaEgoVehicleInfoWheelPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaEgoVehicleInfoWheel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.h new file mode 100644 index 00000000000..7538ebc2f1b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoWheelPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaEgoVehicleInfoWheel.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaEgoVehicleInfoWheel is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleInfoWheel defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLEINFOWHEEL + */ + class CarlaEgoVehicleInfoWheelPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaEgoVehicleInfoWheel type; + + eProsima_user_DllExport CarlaEgoVehicleInfoWheelPubSubType(); + + eProsima_user_DllExport virtual ~CarlaEgoVehicleInfoWheelPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaEgoVehicleInfoWheel(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.cxx new file mode 100644 index 00000000000..4af4ff867f9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.cxx @@ -0,0 +1,471 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleStatus.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaEgoVehicleStatus.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +carla_msgs::msg::CarlaEgoVehicleStatus::CarlaEgoVehicleStatus() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2cf3d63b + + // m_velocity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7674f035 + m_velocity = 0.0; + // m_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@69e153c5 + + // m_orientation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@173ed316 + + // m_active_control_type com.eprosima.idl.parser.typecode.PrimitiveTypeCode@25ce9dc4 + m_active_control_type = 0; + // m_last_applied_vehicle_control com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@74ea2410 + + // m_last_applied_ackermann_control com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@17f62e33 + + +} + +carla_msgs::msg::CarlaEgoVehicleStatus::~CarlaEgoVehicleStatus() +{ + + + + + + +} + +carla_msgs::msg::CarlaEgoVehicleStatus::CarlaEgoVehicleStatus( + const CarlaEgoVehicleStatus& x) +{ + m_header = x.m_header; + m_velocity = x.m_velocity; + m_acceleration = x.m_acceleration; + m_orientation = x.m_orientation; + m_active_control_type = x.m_active_control_type; + m_last_applied_vehicle_control = x.m_last_applied_vehicle_control; + m_last_applied_ackermann_control = x.m_last_applied_ackermann_control; +} + +carla_msgs::msg::CarlaEgoVehicleStatus::CarlaEgoVehicleStatus( + CarlaEgoVehicleStatus&& x) +{ + m_header = std::move(x.m_header); + m_velocity = x.m_velocity; + m_acceleration = std::move(x.m_acceleration); + m_orientation = std::move(x.m_orientation); + m_active_control_type = x.m_active_control_type; + m_last_applied_vehicle_control = std::move(x.m_last_applied_vehicle_control); + m_last_applied_ackermann_control = std::move(x.m_last_applied_ackermann_control); +} + +carla_msgs::msg::CarlaEgoVehicleStatus& carla_msgs::msg::CarlaEgoVehicleStatus::operator =( + const CarlaEgoVehicleStatus& x) +{ + + m_header = x.m_header; + m_velocity = x.m_velocity; + m_acceleration = x.m_acceleration; + m_orientation = x.m_orientation; + m_active_control_type = x.m_active_control_type; + m_last_applied_vehicle_control = x.m_last_applied_vehicle_control; + m_last_applied_ackermann_control = x.m_last_applied_ackermann_control; + + return *this; +} + +carla_msgs::msg::CarlaEgoVehicleStatus& carla_msgs::msg::CarlaEgoVehicleStatus::operator =( + CarlaEgoVehicleStatus&& x) +{ + + m_header = std::move(x.m_header); + m_velocity = x.m_velocity; + m_acceleration = std::move(x.m_acceleration); + m_orientation = std::move(x.m_orientation); + m_active_control_type = x.m_active_control_type; + m_last_applied_vehicle_control = std::move(x.m_last_applied_vehicle_control); + m_last_applied_ackermann_control = std::move(x.m_last_applied_ackermann_control); + + return *this; +} + +bool carla_msgs::msg::CarlaEgoVehicleStatus::operator ==( + const CarlaEgoVehicleStatus& x) const +{ + + return (m_header == x.m_header && m_velocity == x.m_velocity && m_acceleration == x.m_acceleration && m_orientation == x.m_orientation && m_active_control_type == x.m_active_control_type && m_last_applied_vehicle_control == x.m_last_applied_vehicle_control && m_last_applied_ackermann_control == x.m_last_applied_ackermann_control); +} + +bool carla_msgs::msg::CarlaEgoVehicleStatus::operator !=( + const CarlaEgoVehicleStatus& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaEgoVehicleStatus::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Accel::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Quaternion::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += carla_msgs::msg::CarlaEgoVehicleControl::getMaxCdrSerializedSize(current_alignment); + current_alignment += ackermann_msgs::msg::AckermannDriveStamped::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaEgoVehicleStatus::getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleStatus& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Accel::getCdrSerializedSize(data.acceleration(), current_alignment); + current_alignment += geometry_msgs::msg::Quaternion::getCdrSerializedSize(data.orientation(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += carla_msgs::msg::CarlaEgoVehicleControl::getCdrSerializedSize(data.last_applied_vehicle_control(), current_alignment); + current_alignment += ackermann_msgs::msg::AckermannDriveStamped::getCdrSerializedSize(data.last_applied_ackermann_control(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaEgoVehicleStatus::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_velocity; + scdr << m_acceleration; + scdr << m_orientation; + scdr << m_active_control_type; + scdr << m_last_applied_vehicle_control; + scdr << m_last_applied_ackermann_control; + +} + +void carla_msgs::msg::CarlaEgoVehicleStatus::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_velocity; + dcdr >> m_acceleration; + dcdr >> m_orientation; + dcdr >> m_active_control_type; + dcdr >> m_last_applied_vehicle_control; + dcdr >> m_last_applied_ackermann_control; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleStatus::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleStatus::header() +{ + return m_header; +} +/*! + * @brief This function sets a value in member velocity + * @param _velocity New value for member velocity + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::velocity( + float _velocity) +{ + m_velocity = _velocity; +} + +/*! + * @brief This function returns the value of member velocity + * @return Value of member velocity + */ +float carla_msgs::msg::CarlaEgoVehicleStatus::velocity() const +{ + return m_velocity; +} + +/*! + * @brief This function returns a reference to member velocity + * @return Reference to member velocity + */ +float& carla_msgs::msg::CarlaEgoVehicleStatus::velocity() +{ + return m_velocity; +} + +/*! + * @brief This function copies the value in member acceleration + * @param _acceleration New value to be copied in member acceleration + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::acceleration( + const geometry_msgs::msg::Accel& _acceleration) +{ + m_acceleration = _acceleration; +} + +/*! + * @brief This function moves the value in member acceleration + * @param _acceleration New value to be moved in member acceleration + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::acceleration( + geometry_msgs::msg::Accel&& _acceleration) +{ + m_acceleration = std::move(_acceleration); +} + +/*! + * @brief This function returns a constant reference to member acceleration + * @return Constant reference to member acceleration + */ +const geometry_msgs::msg::Accel& carla_msgs::msg::CarlaEgoVehicleStatus::acceleration() const +{ + return m_acceleration; +} + +/*! + * @brief This function returns a reference to member acceleration + * @return Reference to member acceleration + */ +geometry_msgs::msg::Accel& carla_msgs::msg::CarlaEgoVehicleStatus::acceleration() +{ + return m_acceleration; +} +/*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::orientation( + const geometry_msgs::msg::Quaternion& _orientation) +{ + m_orientation = _orientation; +} + +/*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::orientation( + geometry_msgs::msg::Quaternion&& _orientation) +{ + m_orientation = std::move(_orientation); +} + +/*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ +const geometry_msgs::msg::Quaternion& carla_msgs::msg::CarlaEgoVehicleStatus::orientation() const +{ + return m_orientation; +} + +/*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ +geometry_msgs::msg::Quaternion& carla_msgs::msg::CarlaEgoVehicleStatus::orientation() +{ + return m_orientation; +} +/*! + * @brief This function sets a value in member active_control_type + * @param _active_control_type New value for member active_control_type + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::active_control_type( + uint8_t _active_control_type) +{ + m_active_control_type = _active_control_type; +} + +/*! + * @brief This function returns the value of member active_control_type + * @return Value of member active_control_type + */ +uint8_t carla_msgs::msg::CarlaEgoVehicleStatus::active_control_type() const +{ + return m_active_control_type; +} + +/*! + * @brief This function returns a reference to member active_control_type + * @return Reference to member active_control_type + */ +uint8_t& carla_msgs::msg::CarlaEgoVehicleStatus::active_control_type() +{ + return m_active_control_type; +} + +/*! + * @brief This function copies the value in member last_applied_vehicle_control + * @param _last_applied_vehicle_control New value to be copied in member last_applied_vehicle_control + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control( + const carla_msgs::msg::CarlaEgoVehicleControl& _last_applied_vehicle_control) +{ + m_last_applied_vehicle_control = _last_applied_vehicle_control; +} + +/*! + * @brief This function moves the value in member last_applied_vehicle_control + * @param _last_applied_vehicle_control New value to be moved in member last_applied_vehicle_control + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control( + carla_msgs::msg::CarlaEgoVehicleControl&& _last_applied_vehicle_control) +{ + m_last_applied_vehicle_control = std::move(_last_applied_vehicle_control); +} + +/*! + * @brief This function returns a constant reference to member last_applied_vehicle_control + * @return Constant reference to member last_applied_vehicle_control + */ +const carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control() const +{ + return m_last_applied_vehicle_control; +} + +/*! + * @brief This function returns a reference to member last_applied_vehicle_control + * @return Reference to member last_applied_vehicle_control + */ +carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control() +{ + return m_last_applied_vehicle_control; +} +/*! + * @brief This function copies the value in member last_applied_ackermann_control + * @param _last_applied_ackermann_control New value to be copied in member last_applied_ackermann_control + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control( + const ackermann_msgs::msg::AckermannDriveStamped& _last_applied_ackermann_control) +{ + m_last_applied_ackermann_control = _last_applied_ackermann_control; +} + +/*! + * @brief This function moves the value in member last_applied_ackermann_control + * @param _last_applied_ackermann_control New value to be moved in member last_applied_ackermann_control + */ +void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control( + ackermann_msgs::msg::AckermannDriveStamped&& _last_applied_ackermann_control) +{ + m_last_applied_ackermann_control = std::move(_last_applied_ackermann_control); +} + +/*! + * @brief This function returns a constant reference to member last_applied_ackermann_control + * @return Constant reference to member last_applied_ackermann_control + */ +const ackermann_msgs::msg::AckermannDriveStamped& carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control() const +{ + return m_last_applied_ackermann_control; +} + +/*! + * @brief This function returns a reference to member last_applied_ackermann_control + * @return Reference to member last_applied_ackermann_control + */ +ackermann_msgs::msg::AckermannDriveStamped& carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control() +{ + return m_last_applied_ackermann_control; +} + +size_t carla_msgs::msg::CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaEgoVehicleStatus::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaEgoVehicleStatus::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.h new file mode 100644 index 00000000000..385f5096c68 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.h @@ -0,0 +1,368 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleStatus.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_H_ + +#include "geometry_msgs/msg/Quaternion.h" +#include "carla_msgs/msg/CarlaEgoVehicleControl.h" +#include "geometry_msgs/msg/Accel.h" +#include "ackermann_msgs/msg/AckermannDriveStamped.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaEgoVehicleStatus_SOURCE) +#define CarlaEgoVehicleStatus_DllAPI __declspec( dllexport ) +#else +#define CarlaEgoVehicleStatus_DllAPI __declspec( dllimport ) +#endif // CarlaEgoVehicleStatus_SOURCE +#else +#define CarlaEgoVehicleStatus_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaEgoVehicleStatus_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + namespace CarlaEgoVehicleStatus_Constants { + const uint8_t VEHICLE_CONTROL = 0; + const uint8_t ACKERMANN_CONTROL = 1; + } // namespace CarlaEgoVehicleStatus_Constants + /*! + * @brief This class represents the structure CarlaEgoVehicleStatus defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLESTATUS + */ + class CarlaEgoVehicleStatus + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus( + const CarlaEgoVehicleStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus( + CarlaEgoVehicleStatus&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus& operator =( + const CarlaEgoVehicleStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus& operator =( + CarlaEgoVehicleStatus&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleStatus& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function sets a value in member velocity + * @param _velocity New value for member velocity + */ + eProsima_user_DllExport void velocity( + float _velocity); + + /*! + * @brief This function returns the value of member velocity + * @return Value of member velocity + */ + eProsima_user_DllExport float velocity() const; + + /*! + * @brief This function returns a reference to member velocity + * @return Reference to member velocity + */ + eProsima_user_DllExport float& velocity(); + + /*! + * @brief This function copies the value in member acceleration + * @param _acceleration New value to be copied in member acceleration + */ + eProsima_user_DllExport void acceleration( + const geometry_msgs::msg::Accel& _acceleration); + + /*! + * @brief This function moves the value in member acceleration + * @param _acceleration New value to be moved in member acceleration + */ + eProsima_user_DllExport void acceleration( + geometry_msgs::msg::Accel&& _acceleration); + + /*! + * @brief This function returns a constant reference to member acceleration + * @return Constant reference to member acceleration + */ + eProsima_user_DllExport const geometry_msgs::msg::Accel& acceleration() const; + + /*! + * @brief This function returns a reference to member acceleration + * @return Reference to member acceleration + */ + eProsima_user_DllExport geometry_msgs::msg::Accel& acceleration(); + /*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ + eProsima_user_DllExport void orientation( + const geometry_msgs::msg::Quaternion& _orientation); + + /*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ + eProsima_user_DllExport void orientation( + geometry_msgs::msg::Quaternion&& _orientation); + + /*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ + eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; + + /*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ + eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); + /*! + * @brief This function sets a value in member active_control_type + * @param _active_control_type New value for member active_control_type + */ + eProsima_user_DllExport void active_control_type( + uint8_t _active_control_type); + + /*! + * @brief This function returns the value of member active_control_type + * @return Value of member active_control_type + */ + eProsima_user_DllExport uint8_t active_control_type() const; + + /*! + * @brief This function returns a reference to member active_control_type + * @return Reference to member active_control_type + */ + eProsima_user_DllExport uint8_t& active_control_type(); + + /*! + * @brief This function copies the value in member last_applied_vehicle_control + * @param _last_applied_vehicle_control New value to be copied in member last_applied_vehicle_control + */ + eProsima_user_DllExport void last_applied_vehicle_control( + const carla_msgs::msg::CarlaEgoVehicleControl& _last_applied_vehicle_control); + + /*! + * @brief This function moves the value in member last_applied_vehicle_control + * @param _last_applied_vehicle_control New value to be moved in member last_applied_vehicle_control + */ + eProsima_user_DllExport void last_applied_vehicle_control( + carla_msgs::msg::CarlaEgoVehicleControl&& _last_applied_vehicle_control); + + /*! + * @brief This function returns a constant reference to member last_applied_vehicle_control + * @return Constant reference to member last_applied_vehicle_control + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaEgoVehicleControl& last_applied_vehicle_control() const; + + /*! + * @brief This function returns a reference to member last_applied_vehicle_control + * @return Reference to member last_applied_vehicle_control + */ + eProsima_user_DllExport carla_msgs::msg::CarlaEgoVehicleControl& last_applied_vehicle_control(); + /*! + * @brief This function copies the value in member last_applied_ackermann_control + * @param _last_applied_ackermann_control New value to be copied in member last_applied_ackermann_control + */ + eProsima_user_DllExport void last_applied_ackermann_control( + const ackermann_msgs::msg::AckermannDriveStamped& _last_applied_ackermann_control); + + /*! + * @brief This function moves the value in member last_applied_ackermann_control + * @param _last_applied_ackermann_control New value to be moved in member last_applied_ackermann_control + */ + eProsima_user_DllExport void last_applied_ackermann_control( + ackermann_msgs::msg::AckermannDriveStamped&& _last_applied_ackermann_control); + + /*! + * @brief This function returns a constant reference to member last_applied_ackermann_control + * @return Constant reference to member last_applied_ackermann_control + */ + eProsima_user_DllExport const ackermann_msgs::msg::AckermannDriveStamped& last_applied_ackermann_control() const; + + /*! + * @brief This function returns a reference to member last_applied_ackermann_control + * @return Reference to member last_applied_ackermann_control + */ + eProsima_user_DllExport ackermann_msgs::msg::AckermannDriveStamped& last_applied_ackermann_control(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleStatus& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std_msgs::msg::Header m_header; + float m_velocity; + geometry_msgs::msg::Accel m_acceleration; + geometry_msgs::msg::Quaternion m_orientation; + uint8_t m_active_control_type; + carla_msgs::msg::CarlaEgoVehicleControl m_last_applied_vehicle_control; + ackermann_msgs::msg::AckermannDriveStamped m_last_applied_ackermann_control; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.cxx new file mode 100644 index 00000000000..38b6d501450 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleStatusPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaEgoVehicleStatusPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + namespace CarlaEgoVehicleStatus_Constants { + + + + } //End of namespace CarlaEgoVehicleStatus_Constants + CarlaEgoVehicleStatusPubSubType::CarlaEgoVehicleStatusPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaEgoVehicleStatus_"); + auto type_size = CarlaEgoVehicleStatus::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaEgoVehicleStatus::isKeyDefined(); + size_t keyLength = CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize() > 16 ? + CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaEgoVehicleStatusPubSubType::~CarlaEgoVehicleStatusPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaEgoVehicleStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaEgoVehicleStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaEgoVehicleStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaEgoVehicleStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaEgoVehicleStatusPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaEgoVehicleStatusPubSubType::createData() + { + return reinterpret_cast(new CarlaEgoVehicleStatus()); + } + + void CarlaEgoVehicleStatusPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaEgoVehicleStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaEgoVehicleStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/types/AckermannDriveStampedPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h similarity index 77% rename from LibCarla/source/carla/ros2/types/AckermannDriveStampedPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h index 84240bc7cbd..f78f6a26419 100644 --- a/LibCarla/source/carla/ros2/types/AckermannDriveStampedPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h @@ -13,47 +13,48 @@ // limitations under the License. /*! - * @file AckermannDriveStampedPubSubTypes.h + * @file CarlaEgoVehicleStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_PUBSUBTYPES_H_ #include #include -#include "AckermannDriveStamped.h" - -#include "AckermannDrivePubSubTypes.h" -#include "HeaderPubSubTypes.h" +#include "CarlaEgoVehicleStatus.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated AckermannDriveStamped is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CarlaEgoVehicleStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace ackermann_msgs +namespace carla_msgs { namespace msg { + namespace CarlaEgoVehicleStatus_Constants + { + + } /*! - * @brief This class represents the TopicDataType of the type AckermannDriveStamped defined by the user in the IDL file. - * @ingroup AckermannDriveStamped + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleStatus defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLESTATUS */ - class AckermannDriveStampedPubSubType : public eprosima::fastdds::dds::TopicDataType + class CarlaEgoVehicleStatusPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef AckermannDriveStamped type; + typedef CarlaEgoVehicleStatus type; - eProsima_user_DllExport AckermannDriveStampedPubSubType(); + eProsima_user_DllExport CarlaEgoVehicleStatusPubSubType(); - eProsima_user_DllExport virtual ~AckermannDriveStampedPubSubType() override; + eProsima_user_DllExport virtual ~CarlaEgoVehicleStatusPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -104,10 +105,8 @@ namespace ackermann_msgs MD5 m_md5; unsigned char* m_keyBuffer; - }; } } -#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ - +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx new file mode 100644 index 00000000000..f1074ccd7aa --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx @@ -0,0 +1,551 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryData.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaEgoVehicleTelemetryData.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@14fc5f04 + + // m_speed com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e2829c7 + m_speed = 0.0; + // m_steer com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3feb2dda + m_steer = 0.0; + // m_throttle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6a8658ff + m_throttle = 0.0; + // m_brake com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1c742ed4 + m_brake = 0.0; + // m_engine_rpm com.eprosima.idl.parser.typecode.PrimitiveTypeCode@333d4a8c + m_engine_rpm = 0.0; + // m_gear com.eprosima.idl.parser.typecode.PrimitiveTypeCode@55de24cc + m_gear = 0; + // m_drag com.eprosima.idl.parser.typecode.PrimitiveTypeCode@dc7df28 + m_drag = 0.0; + // m_wheels com.eprosima.idl.parser.typecode.SequenceTypeCode@30f842ca + + +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryData::~CarlaEgoVehicleTelemetryData() +{ + + + + + + + + +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( + const CarlaEgoVehicleTelemetryData& x) +{ + m_header = x.m_header; + m_speed = x.m_speed; + m_steer = x.m_steer; + m_throttle = x.m_throttle; + m_brake = x.m_brake; + m_engine_rpm = x.m_engine_rpm; + m_gear = x.m_gear; + m_drag = x.m_drag; + m_wheels = x.m_wheels; +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( + CarlaEgoVehicleTelemetryData&& x) +{ + m_header = std::move(x.m_header); + m_speed = x.m_speed; + m_steer = x.m_steer; + m_throttle = x.m_throttle; + m_brake = x.m_brake; + m_engine_rpm = x.m_engine_rpm; + m_gear = x.m_gear; + m_drag = x.m_drag; + m_wheels = std::move(x.m_wheels); +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator =( + const CarlaEgoVehicleTelemetryData& x) +{ + + m_header = x.m_header; + m_speed = x.m_speed; + m_steer = x.m_steer; + m_throttle = x.m_throttle; + m_brake = x.m_brake; + m_engine_rpm = x.m_engine_rpm; + m_gear = x.m_gear; + m_drag = x.m_drag; + m_wheels = x.m_wheels; + + return *this; +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator =( + CarlaEgoVehicleTelemetryData&& x) +{ + + m_header = std::move(x.m_header); + m_speed = x.m_speed; + m_steer = x.m_steer; + m_throttle = x.m_throttle; + m_brake = x.m_brake; + m_engine_rpm = x.m_engine_rpm; + m_gear = x.m_gear; + m_drag = x.m_drag; + m_wheels = std::move(x.m_wheels); + + return *this; +} + +bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator ==( + const CarlaEgoVehicleTelemetryData& x) const +{ + + return (m_header == x.m_header && m_speed == x.m_speed && m_steer == x.m_steer && m_throttle == x.m_throttle && m_brake == x.m_brake && m_engine_rpm == x.m_engine_rpm && m_gear == x.m_gear && m_drag == x.m_drag && m_wheels == x.m_wheels); +} + +bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator !=( + const CarlaEgoVehicleTelemetryData& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getMaxCdrSerializedSize(current_alignment);} + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleTelemetryData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.wheels().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getCdrSerializedSize(data.wheels().at(a), current_alignment);} + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_speed; + scdr << m_steer; + scdr << m_throttle; + scdr << m_brake; + scdr << m_engine_rpm; + scdr << m_gear; + scdr << m_drag; + scdr << m_wheels; + +} + +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_speed; + dcdr >> m_steer; + dcdr >> m_throttle; + dcdr >> m_brake; + dcdr >> m_engine_rpm; + dcdr >> m_gear; + dcdr >> m_drag; + dcdr >> m_wheels; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleTelemetryData::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleTelemetryData::header() +{ + return m_header; +} +/*! + * @brief This function sets a value in member speed + * @param _speed New value for member speed + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::speed( + float _speed) +{ + m_speed = _speed; +} + +/*! + * @brief This function returns the value of member speed + * @return Value of member speed + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryData::speed() const +{ + return m_speed; +} + +/*! + * @brief This function returns a reference to member speed + * @return Reference to member speed + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::speed() +{ + return m_speed; +} + +/*! + * @brief This function sets a value in member steer + * @param _steer New value for member steer + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::steer( + float _steer) +{ + m_steer = _steer; +} + +/*! + * @brief This function returns the value of member steer + * @return Value of member steer + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryData::steer() const +{ + return m_steer; +} + +/*! + * @brief This function returns a reference to member steer + * @return Reference to member steer + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::steer() +{ + return m_steer; +} + +/*! + * @brief This function sets a value in member throttle + * @param _throttle New value for member throttle + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::throttle( + float _throttle) +{ + m_throttle = _throttle; +} + +/*! + * @brief This function returns the value of member throttle + * @return Value of member throttle + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryData::throttle() const +{ + return m_throttle; +} + +/*! + * @brief This function returns a reference to member throttle + * @return Reference to member throttle + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::throttle() +{ + return m_throttle; +} + +/*! + * @brief This function sets a value in member brake + * @param _brake New value for member brake + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::brake( + float _brake) +{ + m_brake = _brake; +} + +/*! + * @brief This function returns the value of member brake + * @return Value of member brake + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryData::brake() const +{ + return m_brake; +} + +/*! + * @brief This function returns a reference to member brake + * @return Reference to member brake + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::brake() +{ + return m_brake; +} + +/*! + * @brief This function sets a value in member engine_rpm + * @param _engine_rpm New value for member engine_rpm + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::engine_rpm( + float _engine_rpm) +{ + m_engine_rpm = _engine_rpm; +} + +/*! + * @brief This function returns the value of member engine_rpm + * @return Value of member engine_rpm + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryData::engine_rpm() const +{ + return m_engine_rpm; +} + +/*! + * @brief This function returns a reference to member engine_rpm + * @return Reference to member engine_rpm + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::engine_rpm() +{ + return m_engine_rpm; +} + +/*! + * @brief This function sets a value in member gear + * @param _gear New value for member gear + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::gear( + int32_t _gear) +{ + m_gear = _gear; +} + +/*! + * @brief This function returns the value of member gear + * @return Value of member gear + */ +int32_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::gear() const +{ + return m_gear; +} + +/*! + * @brief This function returns a reference to member gear + * @return Reference to member gear + */ +int32_t& carla_msgs::msg::CarlaEgoVehicleTelemetryData::gear() +{ + return m_gear; +} + +/*! + * @brief This function sets a value in member drag + * @param _drag New value for member drag + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::drag( + float _drag) +{ + m_drag = _drag; +} + +/*! + * @brief This function returns the value of member drag + * @return Value of member drag + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryData::drag() const +{ + return m_drag; +} + +/*! + * @brief This function returns a reference to member drag + * @return Reference to member drag + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::drag() +{ + return m_drag; +} + +/*! + * @brief This function copies the value in member wheels + * @param _wheels New value to be copied in member wheels + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels( + const std::vector& _wheels) +{ + m_wheels = _wheels; +} + +/*! + * @brief This function moves the value in member wheels + * @param _wheels New value to be moved in member wheels + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels( + std::vector&& _wheels) +{ + m_wheels = std::move(_wheels); +} + +/*! + * @brief This function returns a constant reference to member wheels + * @return Constant reference to member wheels + */ +const std::vector& carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels() const +{ + return m_wheels; +} + +/*! + * @brief This function returns a reference to member wheels + * @return Reference to member wheels + */ +std::vector& carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels() +{ + return m_wheels; +} + +size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/PointCloud2.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h similarity index 50% rename from LibCarla/source/carla/ros2/types/PointCloud2.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h index 8a4734a917b..38ffe70e338 100644 --- a/LibCarla/source/carla/ros2/types/PointCloud2.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h @@ -13,19 +13,17 @@ // limitations under the License. /*! - * @file PointCloud2.h + * @file CarlaEgoVehicleTelemetryData.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ -#include "Header.h" -#include "PointField.h" - -#include +#include "std_msgs/msg/Header.h" +#include "carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h" #include #include @@ -46,16 +44,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PointCloud2_SOURCE) -#define PointCloud2_DllAPI __declspec( dllexport ) +#if defined(CarlaEgoVehicleTelemetryData_SOURCE) +#define CarlaEgoVehicleTelemetryData_DllAPI __declspec( dllexport ) #else -#define PointCloud2_DllAPI __declspec( dllimport ) -#endif // PointCloud2_SOURCE +#define CarlaEgoVehicleTelemetryData_DllAPI __declspec( dllimport ) +#endif // CarlaEgoVehicleTelemetryData_SOURCE #else -#define PointCloud2_DllAPI +#define CarlaEgoVehicleTelemetryData_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PointCloud2_DllAPI +#define CarlaEgoVehicleTelemetryData_DllAPI #endif // _WIN32 namespace eprosima { @@ -64,67 +62,68 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace sensor_msgs { + +namespace carla_msgs { namespace msg { /*! - * @brief This class represents the structure PointCloud2 defined by the user in the IDL file. - * @ingroup POINTCLOUD2 + * @brief This class represents the structure CarlaEgoVehicleTelemetryData defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLETELEMETRYDATA */ - class PointCloud2 + class CarlaEgoVehicleTelemetryData { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport PointCloud2(); + eProsima_user_DllExport CarlaEgoVehicleTelemetryData(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~PointCloud2(); + eProsima_user_DllExport ~CarlaEgoVehicleTelemetryData(); /*! * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. */ - eProsima_user_DllExport PointCloud2( - const PointCloud2& x); + eProsima_user_DllExport CarlaEgoVehicleTelemetryData( + const CarlaEgoVehicleTelemetryData& x); /*! * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. */ - eProsima_user_DllExport PointCloud2( - PointCloud2&& x) noexcept; + eProsima_user_DllExport CarlaEgoVehicleTelemetryData( + CarlaEgoVehicleTelemetryData&& x); /*! * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. */ - eProsima_user_DllExport PointCloud2& operator =( - const PointCloud2& x); + eProsima_user_DllExport CarlaEgoVehicleTelemetryData& operator =( + const CarlaEgoVehicleTelemetryData& x); /*! * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. */ - eProsima_user_DllExport PointCloud2& operator =( - PointCloud2&& x) noexcept; + eProsima_user_DllExport CarlaEgoVehicleTelemetryData& operator =( + CarlaEgoVehicleTelemetryData&& x); /*! * @brief Comparison operator. - * @param x sensor_msgs::msg::PointCloud2 object to compare. + * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryData object to compare. */ eProsima_user_DllExport bool operator ==( - const PointCloud2& x) const; + const CarlaEgoVehicleTelemetryData& x) const; /*! * @brief Comparison operator. - * @param x sensor_msgs::msg::PointCloud2 object to compare. + * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryData object to compare. */ eProsima_user_DllExport bool operator !=( - const PointCloud2& x) const; + const CarlaEgoVehicleTelemetryData& x) const; /*! * @brief This function copies the value in member header @@ -152,175 +151,170 @@ namespace sensor_msgs { */ eProsima_user_DllExport std_msgs::msg::Header& header(); /*! - * @brief This function sets a value in member height - * @param _height New value for member height + * @brief This function sets a value in member speed + * @param _speed New value for member speed */ - eProsima_user_DllExport void height( - uint32_t _height); + eProsima_user_DllExport void speed( + float _speed); /*! - * @brief This function returns the value of member height - * @return Value of member height + * @brief This function returns the value of member speed + * @return Value of member speed */ - eProsima_user_DllExport uint32_t height() const; + eProsima_user_DllExport float speed() const; /*! - * @brief This function returns a reference to member height - * @return Reference to member height + * @brief This function returns a reference to member speed + * @return Reference to member speed */ - eProsima_user_DllExport uint32_t& height(); + eProsima_user_DllExport float& speed(); /*! - * @brief This function sets a value in member width - * @param _width New value for member width + * @brief This function sets a value in member steer + * @param _steer New value for member steer */ - eProsima_user_DllExport void width( - uint32_t _width); + eProsima_user_DllExport void steer( + float _steer); /*! - * @brief This function returns the value of member width - * @return Value of member width + * @brief This function returns the value of member steer + * @return Value of member steer */ - eProsima_user_DllExport uint32_t width() const; + eProsima_user_DllExport float steer() const; /*! - * @brief This function returns a reference to member width - * @return Reference to member width + * @brief This function returns a reference to member steer + * @return Reference to member steer */ - eProsima_user_DllExport uint32_t& width(); + eProsima_user_DllExport float& steer(); /*! - * @brief This function copies the value in member fields - * @param _fields New value to be copied in member fields + * @brief This function sets a value in member throttle + * @param _throttle New value for member throttle */ - eProsima_user_DllExport void fields( - const std::vector& _fields); + eProsima_user_DllExport void throttle( + float _throttle); /*! - * @brief This function moves the value in member fields - * @param _fields New value to be moved in member fields + * @brief This function returns the value of member throttle + * @return Value of member throttle */ - eProsima_user_DllExport void fields( - std::vector&& _fields); + eProsima_user_DllExport float throttle() const; /*! - * @brief This function returns a constant reference to member fields - * @return Constant reference to member fields + * @brief This function returns a reference to member throttle + * @return Reference to member throttle */ - eProsima_user_DllExport const std::vector& fields() const; + eProsima_user_DllExport float& throttle(); /*! - * @brief This function returns a reference to member fields - * @return Reference to member fields - */ - eProsima_user_DllExport std::vector& fields(); - /*! - * @brief This function sets a value in member is_bigendian - * @param _is_bigendian New value for member is_bigendian + * @brief This function sets a value in member brake + * @param _brake New value for member brake */ - eProsima_user_DllExport void is_bigendian( - bool _is_bigendian); + eProsima_user_DllExport void brake( + float _brake); /*! - * @brief This function returns the value of member is_bigendian - * @return Value of member is_bigendian + * @brief This function returns the value of member brake + * @return Value of member brake */ - eProsima_user_DllExport bool is_bigendian() const; + eProsima_user_DllExport float brake() const; /*! - * @brief This function returns a reference to member is_bigendian - * @return Reference to member is_bigendian + * @brief This function returns a reference to member brake + * @return Reference to member brake */ - eProsima_user_DllExport bool& is_bigendian(); + eProsima_user_DllExport float& brake(); /*! - * @brief This function sets a value in member point_step - * @param _point_step New value for member point_step + * @brief This function sets a value in member engine_rpm + * @param _engine_rpm New value for member engine_rpm */ - eProsima_user_DllExport void point_step( - uint32_t _point_step); + eProsima_user_DllExport void engine_rpm( + float _engine_rpm); /*! - * @brief This function returns the value of member point_step - * @return Value of member point_step + * @brief This function returns the value of member engine_rpm + * @return Value of member engine_rpm */ - eProsima_user_DllExport uint32_t point_step() const; + eProsima_user_DllExport float engine_rpm() const; /*! - * @brief This function returns a reference to member point_step - * @return Reference to member point_step + * @brief This function returns a reference to member engine_rpm + * @return Reference to member engine_rpm */ - eProsima_user_DllExport uint32_t& point_step(); + eProsima_user_DllExport float& engine_rpm(); /*! - * @brief This function sets a value in member row_step - * @param _row_step New value for member row_step + * @brief This function sets a value in member gear + * @param _gear New value for member gear */ - eProsima_user_DllExport void row_step( - uint32_t _row_step); + eProsima_user_DllExport void gear( + int32_t _gear); /*! - * @brief This function returns the value of member row_step - * @return Value of member row_step + * @brief This function returns the value of member gear + * @return Value of member gear */ - eProsima_user_DllExport uint32_t row_step() const; + eProsima_user_DllExport int32_t gear() const; /*! - * @brief This function returns a reference to member row_step - * @return Reference to member row_step + * @brief This function returns a reference to member gear + * @return Reference to member gear */ - eProsima_user_DllExport uint32_t& row_step(); + eProsima_user_DllExport int32_t& gear(); /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data + * @brief This function sets a value in member drag + * @param _drag New value for member drag */ - eProsima_user_DllExport void data( - const std::vector& _data); + eProsima_user_DllExport void drag( + float _drag); /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data + * @brief This function returns the value of member drag + * @return Value of member drag */ - eProsima_user_DllExport void data( - std::vector&& _data); + eProsima_user_DllExport float drag() const; /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data + * @brief This function returns a reference to member drag + * @return Reference to member drag */ - eProsima_user_DllExport const std::vector& data() const; + eProsima_user_DllExport float& drag(); /*! - * @brief This function returns a reference to member data - * @return Reference to member data + * @brief This function copies the value in member wheels + * @param _wheels New value to be copied in member wheels */ - eProsima_user_DllExport std::vector& data(); + eProsima_user_DllExport void wheels( + const std::vector& _wheels); + /*! - * @brief This function sets a value in member is_dense - * @param _is_dense New value for member is_dense + * @brief This function moves the value in member wheels + * @param _wheels New value to be moved in member wheels */ - eProsima_user_DllExport void is_dense( - bool _is_dense); + eProsima_user_DllExport void wheels( + std::vector&& _wheels); /*! - * @brief This function returns the value of member is_dense - * @return Value of member is_dense + * @brief This function returns a constant reference to member wheels + * @return Constant reference to member wheels */ - eProsima_user_DllExport bool is_dense() const; + eProsima_user_DllExport const std::vector& wheels() const; /*! - * @brief This function returns a reference to member is_dense - * @return Reference to member is_dense + * @brief This function returns a reference to member wheels + * @return Reference to member wheels */ - eProsima_user_DllExport bool& is_dense(); + eProsima_user_DllExport std::vector& wheels(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -331,9 +325,10 @@ namespace sensor_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const sensor_msgs::msg::PointCloud2& data, + const carla_msgs::msg::CarlaEgoVehicleTelemetryData& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -348,6 +343,8 @@ namespace sensor_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -370,17 +367,18 @@ namespace sensor_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + std_msgs::msg::Header m_header; - uint32_t m_height; - uint32_t m_width; - std::vector m_fields; - bool m_is_bigendian; - uint32_t m_point_step; - uint32_t m_row_step; - std::vector m_data; - bool m_is_dense; + float m_speed; + float m_steer; + float m_throttle; + float m_brake; + float m_engine_rpm; + int32_t m_gear; + float m_drag; + std::vector m_wheels; }; } // namespace msg -} // namespace sensor_msgs +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx new file mode 100644 index 00000000000..4b80b9a7c91 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaEgoVehicleTelemetryDataPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaEgoVehicleTelemetryDataPubSubType::CarlaEgoVehicleTelemetryDataPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaEgoVehicleTelemetryData_"); + auto type_size = CarlaEgoVehicleTelemetryData::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaEgoVehicleTelemetryData::isKeyDefined(); + size_t keyLength = CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize() > 16 ? + CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaEgoVehicleTelemetryDataPubSubType::~CarlaEgoVehicleTelemetryDataPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaEgoVehicleTelemetryDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaEgoVehicleTelemetryData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaEgoVehicleTelemetryDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaEgoVehicleTelemetryData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaEgoVehicleTelemetryDataPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaEgoVehicleTelemetryDataPubSubType::createData() + { + return reinterpret_cast(new CarlaEgoVehicleTelemetryData()); + } + + void CarlaEgoVehicleTelemetryDataPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaEgoVehicleTelemetryDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaEgoVehicleTelemetryData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h new file mode 100644 index 00000000000..6056b1a85ad --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaEgoVehicleTelemetryData.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaEgoVehicleTelemetryData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleTelemetryData defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLETELEMETRYDATA + */ + class CarlaEgoVehicleTelemetryDataPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaEgoVehicleTelemetryData type; + + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataPubSubType(); + + eProsima_user_DllExport virtual ~CarlaEgoVehicleTelemetryDataPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx new file mode 100644 index 00000000000..5fea3453e79 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx @@ -0,0 +1,615 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataWheel.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaEgoVehicleTelemetryDataWheel.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel() +{ + // m_tire_friction com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f15d60e + m_tire_friction = 0.0; + // m_lat_slip com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1be2019a + m_lat_slip = 0.0; + // m_long_slip com.eprosima.idl.parser.typecode.PrimitiveTypeCode@29d80d2b + m_long_slip = 0.0; + // m_omega com.eprosima.idl.parser.typecode.PrimitiveTypeCode@58e1d9d + m_omega = 0.0; + // m_tire_load com.eprosima.idl.parser.typecode.PrimitiveTypeCode@446a1e84 + m_tire_load = 0.0; + // m_normalized_tire_load com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f0f2942 + m_normalized_tire_load = 0.0; + // m_torque com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2657d4dd + m_torque = 0.0; + // m_long_force com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5340477f + m_long_force = 0.0; + // m_lat_force com.eprosima.idl.parser.typecode.PrimitiveTypeCode@47caedad + m_lat_force = 0.0; + // m_normalized_long_force com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7139992f + m_normalized_long_force = 0.0; + // m_normalized_lat_force com.eprosima.idl.parser.typecode.PrimitiveTypeCode@69504ae9 + m_normalized_lat_force = 0.0; + +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::~CarlaEgoVehicleTelemetryDataWheel() +{ + + + + + + + + + + +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel( + const CarlaEgoVehicleTelemetryDataWheel& x) +{ + m_tire_friction = x.m_tire_friction; + m_lat_slip = x.m_lat_slip; + m_long_slip = x.m_long_slip; + m_omega = x.m_omega; + m_tire_load = x.m_tire_load; + m_normalized_tire_load = x.m_normalized_tire_load; + m_torque = x.m_torque; + m_long_force = x.m_long_force; + m_lat_force = x.m_lat_force; + m_normalized_long_force = x.m_normalized_long_force; + m_normalized_lat_force = x.m_normalized_lat_force; +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel( + CarlaEgoVehicleTelemetryDataWheel&& x) +{ + m_tire_friction = x.m_tire_friction; + m_lat_slip = x.m_lat_slip; + m_long_slip = x.m_long_slip; + m_omega = x.m_omega; + m_tire_load = x.m_tire_load; + m_normalized_tire_load = x.m_normalized_tire_load; + m_torque = x.m_torque; + m_long_force = x.m_long_force; + m_lat_force = x.m_lat_force; + m_normalized_long_force = x.m_normalized_long_force; + m_normalized_lat_force = x.m_normalized_lat_force; +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator =( + const CarlaEgoVehicleTelemetryDataWheel& x) +{ + + m_tire_friction = x.m_tire_friction; + m_lat_slip = x.m_lat_slip; + m_long_slip = x.m_long_slip; + m_omega = x.m_omega; + m_tire_load = x.m_tire_load; + m_normalized_tire_load = x.m_normalized_tire_load; + m_torque = x.m_torque; + m_long_force = x.m_long_force; + m_lat_force = x.m_lat_force; + m_normalized_long_force = x.m_normalized_long_force; + m_normalized_lat_force = x.m_normalized_lat_force; + + return *this; +} + +carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator =( + CarlaEgoVehicleTelemetryDataWheel&& x) +{ + + m_tire_friction = x.m_tire_friction; + m_lat_slip = x.m_lat_slip; + m_long_slip = x.m_long_slip; + m_omega = x.m_omega; + m_tire_load = x.m_tire_load; + m_normalized_tire_load = x.m_normalized_tire_load; + m_torque = x.m_torque; + m_long_force = x.m_long_force; + m_lat_force = x.m_lat_force; + m_normalized_long_force = x.m_normalized_long_force; + m_normalized_lat_force = x.m_normalized_lat_force; + + return *this; +} + +bool carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator ==( + const CarlaEgoVehicleTelemetryDataWheel& x) const +{ + + return (m_tire_friction == x.m_tire_friction && m_lat_slip == x.m_lat_slip && m_long_slip == x.m_long_slip && m_omega == x.m_omega && m_tire_load == x.m_tire_load && m_normalized_tire_load == x.m_normalized_tire_load && m_torque == x.m_torque && m_long_force == x.m_long_force && m_lat_force == x.m_lat_force && m_normalized_long_force == x.m_normalized_long_force && m_normalized_lat_force == x.m_normalized_lat_force); +} + +bool carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator !=( + const CarlaEgoVehicleTelemetryDataWheel& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_tire_friction; + scdr << m_lat_slip; + scdr << m_long_slip; + scdr << m_omega; + scdr << m_tire_load; + scdr << m_normalized_tire_load; + scdr << m_torque; + scdr << m_long_force; + scdr << m_lat_force; + scdr << m_normalized_long_force; + scdr << m_normalized_lat_force; + +} + +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_tire_friction; + dcdr >> m_lat_slip; + dcdr >> m_long_slip; + dcdr >> m_omega; + dcdr >> m_tire_load; + dcdr >> m_normalized_tire_load; + dcdr >> m_torque; + dcdr >> m_long_force; + dcdr >> m_lat_force; + dcdr >> m_normalized_long_force; + dcdr >> m_normalized_lat_force; +} + +/*! + * @brief This function sets a value in member tire_friction + * @param _tire_friction New value for member tire_friction + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_friction( + float _tire_friction) +{ + m_tire_friction = _tire_friction; +} + +/*! + * @brief This function returns the value of member tire_friction + * @return Value of member tire_friction + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_friction() const +{ + return m_tire_friction; +} + +/*! + * @brief This function returns a reference to member tire_friction + * @return Reference to member tire_friction + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_friction() +{ + return m_tire_friction; +} + +/*! + * @brief This function sets a value in member lat_slip + * @param _lat_slip New value for member lat_slip + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_slip( + float _lat_slip) +{ + m_lat_slip = _lat_slip; +} + +/*! + * @brief This function returns the value of member lat_slip + * @return Value of member lat_slip + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_slip() const +{ + return m_lat_slip; +} + +/*! + * @brief This function returns a reference to member lat_slip + * @return Reference to member lat_slip + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_slip() +{ + return m_lat_slip; +} + +/*! + * @brief This function sets a value in member long_slip + * @param _long_slip New value for member long_slip + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_slip( + float _long_slip) +{ + m_long_slip = _long_slip; +} + +/*! + * @brief This function returns the value of member long_slip + * @return Value of member long_slip + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_slip() const +{ + return m_long_slip; +} + +/*! + * @brief This function returns a reference to member long_slip + * @return Reference to member long_slip + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_slip() +{ + return m_long_slip; +} + +/*! + * @brief This function sets a value in member omega + * @param _omega New value for member omega + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::omega( + float _omega) +{ + m_omega = _omega; +} + +/*! + * @brief This function returns the value of member omega + * @return Value of member omega + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::omega() const +{ + return m_omega; +} + +/*! + * @brief This function returns a reference to member omega + * @return Reference to member omega + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::omega() +{ + return m_omega; +} + +/*! + * @brief This function sets a value in member tire_load + * @param _tire_load New value for member tire_load + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_load( + float _tire_load) +{ + m_tire_load = _tire_load; +} + +/*! + * @brief This function returns the value of member tire_load + * @return Value of member tire_load + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_load() const +{ + return m_tire_load; +} + +/*! + * @brief This function returns a reference to member tire_load + * @return Reference to member tire_load + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_load() +{ + return m_tire_load; +} + +/*! + * @brief This function sets a value in member normalized_tire_load + * @param _normalized_tire_load New value for member normalized_tire_load + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load( + float _normalized_tire_load) +{ + m_normalized_tire_load = _normalized_tire_load; +} + +/*! + * @brief This function returns the value of member normalized_tire_load + * @return Value of member normalized_tire_load + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load() const +{ + return m_normalized_tire_load; +} + +/*! + * @brief This function returns a reference to member normalized_tire_load + * @return Reference to member normalized_tire_load + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load() +{ + return m_normalized_tire_load; +} + +/*! + * @brief This function sets a value in member torque + * @param _torque New value for member torque + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::torque( + float _torque) +{ + m_torque = _torque; +} + +/*! + * @brief This function returns the value of member torque + * @return Value of member torque + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::torque() const +{ + return m_torque; +} + +/*! + * @brief This function returns a reference to member torque + * @return Reference to member torque + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::torque() +{ + return m_torque; +} + +/*! + * @brief This function sets a value in member long_force + * @param _long_force New value for member long_force + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_force( + float _long_force) +{ + m_long_force = _long_force; +} + +/*! + * @brief This function returns the value of member long_force + * @return Value of member long_force + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_force() const +{ + return m_long_force; +} + +/*! + * @brief This function returns a reference to member long_force + * @return Reference to member long_force + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_force() +{ + return m_long_force; +} + +/*! + * @brief This function sets a value in member lat_force + * @param _lat_force New value for member lat_force + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_force( + float _lat_force) +{ + m_lat_force = _lat_force; +} + +/*! + * @brief This function returns the value of member lat_force + * @return Value of member lat_force + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_force() const +{ + return m_lat_force; +} + +/*! + * @brief This function returns a reference to member lat_force + * @return Reference to member lat_force + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_force() +{ + return m_lat_force; +} + +/*! + * @brief This function sets a value in member normalized_long_force + * @param _normalized_long_force New value for member normalized_long_force + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_long_force( + float _normalized_long_force) +{ + m_normalized_long_force = _normalized_long_force; +} + +/*! + * @brief This function returns the value of member normalized_long_force + * @return Value of member normalized_long_force + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_long_force() const +{ + return m_normalized_long_force; +} + +/*! + * @brief This function returns a reference to member normalized_long_force + * @return Reference to member normalized_long_force + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_long_force() +{ + return m_normalized_long_force; +} + +/*! + * @brief This function sets a value in member normalized_lat_force + * @param _normalized_lat_force New value for member normalized_lat_force + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force( + float _normalized_lat_force) +{ + m_normalized_lat_force = _normalized_lat_force; +} + +/*! + * @brief This function returns the value of member normalized_lat_force + * @return Value of member normalized_lat_force + */ +float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force() const +{ + return m_normalized_lat_force; +} + +/*! + * @brief This function returns a reference to member normalized_lat_force + * @return Reference to member normalized_lat_force + */ +float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force() +{ + return m_normalized_lat_force; +} + + +size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h new file mode 100644 index 00000000000..03859a1c742 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h @@ -0,0 +1,410 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataWheel.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaEgoVehicleTelemetryDataWheel_SOURCE) +#define CarlaEgoVehicleTelemetryDataWheel_DllAPI __declspec( dllexport ) +#else +#define CarlaEgoVehicleTelemetryDataWheel_DllAPI __declspec( dllimport ) +#endif // CarlaEgoVehicleTelemetryDataWheel_SOURCE +#else +#define CarlaEgoVehicleTelemetryDataWheel_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaEgoVehicleTelemetryDataWheel_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaEgoVehicleTelemetryDataWheel defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLETELEMETRYDATAWHEEL + */ + class CarlaEgoVehicleTelemetryDataWheel + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleTelemetryDataWheel(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel( + const CarlaEgoVehicleTelemetryDataWheel& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel( + CarlaEgoVehicleTelemetryDataWheel&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel& operator =( + const CarlaEgoVehicleTelemetryDataWheel& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel& operator =( + CarlaEgoVehicleTelemetryDataWheel&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleTelemetryDataWheel& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleTelemetryDataWheel& x) const; + + /*! + * @brief This function sets a value in member tire_friction + * @param _tire_friction New value for member tire_friction + */ + eProsima_user_DllExport void tire_friction( + float _tire_friction); + + /*! + * @brief This function returns the value of member tire_friction + * @return Value of member tire_friction + */ + eProsima_user_DllExport float tire_friction() const; + + /*! + * @brief This function returns a reference to member tire_friction + * @return Reference to member tire_friction + */ + eProsima_user_DllExport float& tire_friction(); + + /*! + * @brief This function sets a value in member lat_slip + * @param _lat_slip New value for member lat_slip + */ + eProsima_user_DllExport void lat_slip( + float _lat_slip); + + /*! + * @brief This function returns the value of member lat_slip + * @return Value of member lat_slip + */ + eProsima_user_DllExport float lat_slip() const; + + /*! + * @brief This function returns a reference to member lat_slip + * @return Reference to member lat_slip + */ + eProsima_user_DllExport float& lat_slip(); + + /*! + * @brief This function sets a value in member long_slip + * @param _long_slip New value for member long_slip + */ + eProsima_user_DllExport void long_slip( + float _long_slip); + + /*! + * @brief This function returns the value of member long_slip + * @return Value of member long_slip + */ + eProsima_user_DllExport float long_slip() const; + + /*! + * @brief This function returns a reference to member long_slip + * @return Reference to member long_slip + */ + eProsima_user_DllExport float& long_slip(); + + /*! + * @brief This function sets a value in member omega + * @param _omega New value for member omega + */ + eProsima_user_DllExport void omega( + float _omega); + + /*! + * @brief This function returns the value of member omega + * @return Value of member omega + */ + eProsima_user_DllExport float omega() const; + + /*! + * @brief This function returns a reference to member omega + * @return Reference to member omega + */ + eProsima_user_DllExport float& omega(); + + /*! + * @brief This function sets a value in member tire_load + * @param _tire_load New value for member tire_load + */ + eProsima_user_DllExport void tire_load( + float _tire_load); + + /*! + * @brief This function returns the value of member tire_load + * @return Value of member tire_load + */ + eProsima_user_DllExport float tire_load() const; + + /*! + * @brief This function returns a reference to member tire_load + * @return Reference to member tire_load + */ + eProsima_user_DllExport float& tire_load(); + + /*! + * @brief This function sets a value in member normalized_tire_load + * @param _normalized_tire_load New value for member normalized_tire_load + */ + eProsima_user_DllExport void normalized_tire_load( + float _normalized_tire_load); + + /*! + * @brief This function returns the value of member normalized_tire_load + * @return Value of member normalized_tire_load + */ + eProsima_user_DllExport float normalized_tire_load() const; + + /*! + * @brief This function returns a reference to member normalized_tire_load + * @return Reference to member normalized_tire_load + */ + eProsima_user_DllExport float& normalized_tire_load(); + + /*! + * @brief This function sets a value in member torque + * @param _torque New value for member torque + */ + eProsima_user_DllExport void torque( + float _torque); + + /*! + * @brief This function returns the value of member torque + * @return Value of member torque + */ + eProsima_user_DllExport float torque() const; + + /*! + * @brief This function returns a reference to member torque + * @return Reference to member torque + */ + eProsima_user_DllExport float& torque(); + + /*! + * @brief This function sets a value in member long_force + * @param _long_force New value for member long_force + */ + eProsima_user_DllExport void long_force( + float _long_force); + + /*! + * @brief This function returns the value of member long_force + * @return Value of member long_force + */ + eProsima_user_DllExport float long_force() const; + + /*! + * @brief This function returns a reference to member long_force + * @return Reference to member long_force + */ + eProsima_user_DllExport float& long_force(); + + /*! + * @brief This function sets a value in member lat_force + * @param _lat_force New value for member lat_force + */ + eProsima_user_DllExport void lat_force( + float _lat_force); + + /*! + * @brief This function returns the value of member lat_force + * @return Value of member lat_force + */ + eProsima_user_DllExport float lat_force() const; + + /*! + * @brief This function returns a reference to member lat_force + * @return Reference to member lat_force + */ + eProsima_user_DllExport float& lat_force(); + + /*! + * @brief This function sets a value in member normalized_long_force + * @param _normalized_long_force New value for member normalized_long_force + */ + eProsima_user_DllExport void normalized_long_force( + float _normalized_long_force); + + /*! + * @brief This function returns the value of member normalized_long_force + * @return Value of member normalized_long_force + */ + eProsima_user_DllExport float normalized_long_force() const; + + /*! + * @brief This function returns a reference to member normalized_long_force + * @return Reference to member normalized_long_force + */ + eProsima_user_DllExport float& normalized_long_force(); + + /*! + * @brief This function sets a value in member normalized_lat_force + * @param _normalized_lat_force New value for member normalized_lat_force + */ + eProsima_user_DllExport void normalized_lat_force( + float _normalized_lat_force); + + /*! + * @brief This function returns the value of member normalized_lat_force + * @return Value of member normalized_lat_force + */ + eProsima_user_DllExport float normalized_lat_force() const; + + /*! + * @brief This function returns a reference to member normalized_lat_force + * @return Reference to member normalized_lat_force + */ + eProsima_user_DllExport float& normalized_lat_force(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + float m_tire_friction; + float m_lat_slip; + float m_long_slip; + float m_omega; + float m_tire_load; + float m_normalized_tire_load; + float m_torque; + float m_long_force; + float m_lat_force; + float m_normalized_long_force; + float m_normalized_lat_force; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx new file mode 100644 index 00000000000..f50b3bfb5d8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaEgoVehicleTelemetryDataWheelPubSubType::CarlaEgoVehicleTelemetryDataWheelPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaEgoVehicleTelemetryDataWheel_"); + auto type_size = CarlaEgoVehicleTelemetryDataWheel::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaEgoVehicleTelemetryDataWheel::isKeyDefined(); + size_t keyLength = CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize() > 16 ? + CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaEgoVehicleTelemetryDataWheelPubSubType::~CarlaEgoVehicleTelemetryDataWheelPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaEgoVehicleTelemetryDataWheelPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaEgoVehicleTelemetryDataWheel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaEgoVehicleTelemetryDataWheelPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaEgoVehicleTelemetryDataWheel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaEgoVehicleTelemetryDataWheelPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaEgoVehicleTelemetryDataWheelPubSubType::createData() + { + return reinterpret_cast(new CarlaEgoVehicleTelemetryDataWheel()); + } + + void CarlaEgoVehicleTelemetryDataWheelPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaEgoVehicleTelemetryDataWheelPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaEgoVehicleTelemetryDataWheel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h new file mode 100644 index 00000000000..79a78733627 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaEgoVehicleTelemetryDataWheel.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaEgoVehicleTelemetryDataWheel is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleTelemetryDataWheel defined by the user in the IDL file. + * @ingroup CARLAEGOVEHICLETELEMETRYDATAWHEEL + */ + class CarlaEgoVehicleTelemetryDataWheelPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaEgoVehicleTelemetryDataWheel type; + + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheelPubSubType(); + + eProsima_user_DllExport virtual ~CarlaEgoVehicleTelemetryDataWheelPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaEgoVehicleTelemetryDataWheel(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.cxx new file mode 100644 index 00000000000..7083041fa1c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.cxx @@ -0,0 +1,615 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEpisodeSettings.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaEpisodeSettings.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaEpisodeSettings::CarlaEpisodeSettings() +{ + // m_synchronous_mode com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5dafbe45 + m_synchronous_mode = false; + // m_no_rendering_mode com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2254127a + m_no_rendering_mode = false; + // m_fixed_delta_seconds com.eprosima.idl.parser.typecode.PrimitiveTypeCode@51891008 + m_fixed_delta_seconds = 0.0; + // m_substepping com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2f953efd + m_substepping = true; + // m_max_substep_delta_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@f68f0dc + m_max_substep_delta_time = 0.01; + // m_max_substeps com.eprosima.idl.parser.typecode.PrimitiveTypeCode@d2de489 + m_max_substeps = 10; + // m_max_culling_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@14bdbc74 + m_max_culling_distance = 0.0; + // m_deterministic_ragdolls com.eprosima.idl.parser.typecode.PrimitiveTypeCode@12591ac8 + m_deterministic_ragdolls = false; + // m_tile_stream_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5a7fe64f + m_tile_stream_distance = 3000.0; + // m_actor_active_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1b66c0fb + m_actor_active_distance = 2000.0; + // m_spectator_as_ego com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3e0e1046 + m_spectator_as_ego = true; + +} + +carla_msgs::msg::CarlaEpisodeSettings::~CarlaEpisodeSettings() +{ + + + + + + + + + + +} + +carla_msgs::msg::CarlaEpisodeSettings::CarlaEpisodeSettings( + const CarlaEpisodeSettings& x) +{ + m_synchronous_mode = x.m_synchronous_mode; + m_no_rendering_mode = x.m_no_rendering_mode; + m_fixed_delta_seconds = x.m_fixed_delta_seconds; + m_substepping = x.m_substepping; + m_max_substep_delta_time = x.m_max_substep_delta_time; + m_max_substeps = x.m_max_substeps; + m_max_culling_distance = x.m_max_culling_distance; + m_deterministic_ragdolls = x.m_deterministic_ragdolls; + m_tile_stream_distance = x.m_tile_stream_distance; + m_actor_active_distance = x.m_actor_active_distance; + m_spectator_as_ego = x.m_spectator_as_ego; +} + +carla_msgs::msg::CarlaEpisodeSettings::CarlaEpisodeSettings( + CarlaEpisodeSettings&& x) +{ + m_synchronous_mode = x.m_synchronous_mode; + m_no_rendering_mode = x.m_no_rendering_mode; + m_fixed_delta_seconds = x.m_fixed_delta_seconds; + m_substepping = x.m_substepping; + m_max_substep_delta_time = x.m_max_substep_delta_time; + m_max_substeps = x.m_max_substeps; + m_max_culling_distance = x.m_max_culling_distance; + m_deterministic_ragdolls = x.m_deterministic_ragdolls; + m_tile_stream_distance = x.m_tile_stream_distance; + m_actor_active_distance = x.m_actor_active_distance; + m_spectator_as_ego = x.m_spectator_as_ego; +} + +carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaEpisodeSettings::operator =( + const CarlaEpisodeSettings& x) +{ + + m_synchronous_mode = x.m_synchronous_mode; + m_no_rendering_mode = x.m_no_rendering_mode; + m_fixed_delta_seconds = x.m_fixed_delta_seconds; + m_substepping = x.m_substepping; + m_max_substep_delta_time = x.m_max_substep_delta_time; + m_max_substeps = x.m_max_substeps; + m_max_culling_distance = x.m_max_culling_distance; + m_deterministic_ragdolls = x.m_deterministic_ragdolls; + m_tile_stream_distance = x.m_tile_stream_distance; + m_actor_active_distance = x.m_actor_active_distance; + m_spectator_as_ego = x.m_spectator_as_ego; + + return *this; +} + +carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaEpisodeSettings::operator =( + CarlaEpisodeSettings&& x) +{ + + m_synchronous_mode = x.m_synchronous_mode; + m_no_rendering_mode = x.m_no_rendering_mode; + m_fixed_delta_seconds = x.m_fixed_delta_seconds; + m_substepping = x.m_substepping; + m_max_substep_delta_time = x.m_max_substep_delta_time; + m_max_substeps = x.m_max_substeps; + m_max_culling_distance = x.m_max_culling_distance; + m_deterministic_ragdolls = x.m_deterministic_ragdolls; + m_tile_stream_distance = x.m_tile_stream_distance; + m_actor_active_distance = x.m_actor_active_distance; + m_spectator_as_ego = x.m_spectator_as_ego; + + return *this; +} + +bool carla_msgs::msg::CarlaEpisodeSettings::operator ==( + const CarlaEpisodeSettings& x) const +{ + + return (m_synchronous_mode == x.m_synchronous_mode && m_no_rendering_mode == x.m_no_rendering_mode && m_fixed_delta_seconds == x.m_fixed_delta_seconds && m_substepping == x.m_substepping && m_max_substep_delta_time == x.m_max_substep_delta_time && m_max_substeps == x.m_max_substeps && m_max_culling_distance == x.m_max_culling_distance && m_deterministic_ragdolls == x.m_deterministic_ragdolls && m_tile_stream_distance == x.m_tile_stream_distance && m_actor_active_distance == x.m_actor_active_distance && m_spectator_as_ego == x.m_spectator_as_ego); +} + +bool carla_msgs::msg::CarlaEpisodeSettings::operator !=( + const CarlaEpisodeSettings& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaEpisodeSettings::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaEpisodeSettings::getCdrSerializedSize( + const carla_msgs::msg::CarlaEpisodeSettings& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaEpisodeSettings::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_synchronous_mode; + scdr << m_no_rendering_mode; + scdr << m_fixed_delta_seconds; + scdr << m_substepping; + scdr << m_max_substep_delta_time; + scdr << m_max_substeps; + scdr << m_max_culling_distance; + scdr << m_deterministic_ragdolls; + scdr << m_tile_stream_distance; + scdr << m_actor_active_distance; + scdr << m_spectator_as_ego; + +} + +void carla_msgs::msg::CarlaEpisodeSettings::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_synchronous_mode; + dcdr >> m_no_rendering_mode; + dcdr >> m_fixed_delta_seconds; + dcdr >> m_substepping; + dcdr >> m_max_substep_delta_time; + dcdr >> m_max_substeps; + dcdr >> m_max_culling_distance; + dcdr >> m_deterministic_ragdolls; + dcdr >> m_tile_stream_distance; + dcdr >> m_actor_active_distance; + dcdr >> m_spectator_as_ego; +} + +/*! + * @brief This function sets a value in member synchronous_mode + * @param _synchronous_mode New value for member synchronous_mode + */ +void carla_msgs::msg::CarlaEpisodeSettings::synchronous_mode( + bool _synchronous_mode) +{ + m_synchronous_mode = _synchronous_mode; +} + +/*! + * @brief This function returns the value of member synchronous_mode + * @return Value of member synchronous_mode + */ +bool carla_msgs::msg::CarlaEpisodeSettings::synchronous_mode() const +{ + return m_synchronous_mode; +} + +/*! + * @brief This function returns a reference to member synchronous_mode + * @return Reference to member synchronous_mode + */ +bool& carla_msgs::msg::CarlaEpisodeSettings::synchronous_mode() +{ + return m_synchronous_mode; +} + +/*! + * @brief This function sets a value in member no_rendering_mode + * @param _no_rendering_mode New value for member no_rendering_mode + */ +void carla_msgs::msg::CarlaEpisodeSettings::no_rendering_mode( + bool _no_rendering_mode) +{ + m_no_rendering_mode = _no_rendering_mode; +} + +/*! + * @brief This function returns the value of member no_rendering_mode + * @return Value of member no_rendering_mode + */ +bool carla_msgs::msg::CarlaEpisodeSettings::no_rendering_mode() const +{ + return m_no_rendering_mode; +} + +/*! + * @brief This function returns a reference to member no_rendering_mode + * @return Reference to member no_rendering_mode + */ +bool& carla_msgs::msg::CarlaEpisodeSettings::no_rendering_mode() +{ + return m_no_rendering_mode; +} + +/*! + * @brief This function sets a value in member fixed_delta_seconds + * @param _fixed_delta_seconds New value for member fixed_delta_seconds + */ +void carla_msgs::msg::CarlaEpisodeSettings::fixed_delta_seconds( + double _fixed_delta_seconds) +{ + m_fixed_delta_seconds = _fixed_delta_seconds; +} + +/*! + * @brief This function returns the value of member fixed_delta_seconds + * @return Value of member fixed_delta_seconds + */ +double carla_msgs::msg::CarlaEpisodeSettings::fixed_delta_seconds() const +{ + return m_fixed_delta_seconds; +} + +/*! + * @brief This function returns a reference to member fixed_delta_seconds + * @return Reference to member fixed_delta_seconds + */ +double& carla_msgs::msg::CarlaEpisodeSettings::fixed_delta_seconds() +{ + return m_fixed_delta_seconds; +} + +/*! + * @brief This function sets a value in member substepping + * @param _substepping New value for member substepping + */ +void carla_msgs::msg::CarlaEpisodeSettings::substepping( + bool _substepping) +{ + m_substepping = _substepping; +} + +/*! + * @brief This function returns the value of member substepping + * @return Value of member substepping + */ +bool carla_msgs::msg::CarlaEpisodeSettings::substepping() const +{ + return m_substepping; +} + +/*! + * @brief This function returns a reference to member substepping + * @return Reference to member substepping + */ +bool& carla_msgs::msg::CarlaEpisodeSettings::substepping() +{ + return m_substepping; +} + +/*! + * @brief This function sets a value in member max_substep_delta_time + * @param _max_substep_delta_time New value for member max_substep_delta_time + */ +void carla_msgs::msg::CarlaEpisodeSettings::max_substep_delta_time( + double _max_substep_delta_time) +{ + m_max_substep_delta_time = _max_substep_delta_time; +} + +/*! + * @brief This function returns the value of member max_substep_delta_time + * @return Value of member max_substep_delta_time + */ +double carla_msgs::msg::CarlaEpisodeSettings::max_substep_delta_time() const +{ + return m_max_substep_delta_time; +} + +/*! + * @brief This function returns a reference to member max_substep_delta_time + * @return Reference to member max_substep_delta_time + */ +double& carla_msgs::msg::CarlaEpisodeSettings::max_substep_delta_time() +{ + return m_max_substep_delta_time; +} + +/*! + * @brief This function sets a value in member max_substeps + * @param _max_substeps New value for member max_substeps + */ +void carla_msgs::msg::CarlaEpisodeSettings::max_substeps( + int32_t _max_substeps) +{ + m_max_substeps = _max_substeps; +} + +/*! + * @brief This function returns the value of member max_substeps + * @return Value of member max_substeps + */ +int32_t carla_msgs::msg::CarlaEpisodeSettings::max_substeps() const +{ + return m_max_substeps; +} + +/*! + * @brief This function returns a reference to member max_substeps + * @return Reference to member max_substeps + */ +int32_t& carla_msgs::msg::CarlaEpisodeSettings::max_substeps() +{ + return m_max_substeps; +} + +/*! + * @brief This function sets a value in member max_culling_distance + * @param _max_culling_distance New value for member max_culling_distance + */ +void carla_msgs::msg::CarlaEpisodeSettings::max_culling_distance( + float _max_culling_distance) +{ + m_max_culling_distance = _max_culling_distance; +} + +/*! + * @brief This function returns the value of member max_culling_distance + * @return Value of member max_culling_distance + */ +float carla_msgs::msg::CarlaEpisodeSettings::max_culling_distance() const +{ + return m_max_culling_distance; +} + +/*! + * @brief This function returns a reference to member max_culling_distance + * @return Reference to member max_culling_distance + */ +float& carla_msgs::msg::CarlaEpisodeSettings::max_culling_distance() +{ + return m_max_culling_distance; +} + +/*! + * @brief This function sets a value in member deterministic_ragdolls + * @param _deterministic_ragdolls New value for member deterministic_ragdolls + */ +void carla_msgs::msg::CarlaEpisodeSettings::deterministic_ragdolls( + bool _deterministic_ragdolls) +{ + m_deterministic_ragdolls = _deterministic_ragdolls; +} + +/*! + * @brief This function returns the value of member deterministic_ragdolls + * @return Value of member deterministic_ragdolls + */ +bool carla_msgs::msg::CarlaEpisodeSettings::deterministic_ragdolls() const +{ + return m_deterministic_ragdolls; +} + +/*! + * @brief This function returns a reference to member deterministic_ragdolls + * @return Reference to member deterministic_ragdolls + */ +bool& carla_msgs::msg::CarlaEpisodeSettings::deterministic_ragdolls() +{ + return m_deterministic_ragdolls; +} + +/*! + * @brief This function sets a value in member tile_stream_distance + * @param _tile_stream_distance New value for member tile_stream_distance + */ +void carla_msgs::msg::CarlaEpisodeSettings::tile_stream_distance( + float _tile_stream_distance) +{ + m_tile_stream_distance = _tile_stream_distance; +} + +/*! + * @brief This function returns the value of member tile_stream_distance + * @return Value of member tile_stream_distance + */ +float carla_msgs::msg::CarlaEpisodeSettings::tile_stream_distance() const +{ + return m_tile_stream_distance; +} + +/*! + * @brief This function returns a reference to member tile_stream_distance + * @return Reference to member tile_stream_distance + */ +float& carla_msgs::msg::CarlaEpisodeSettings::tile_stream_distance() +{ + return m_tile_stream_distance; +} + +/*! + * @brief This function sets a value in member actor_active_distance + * @param _actor_active_distance New value for member actor_active_distance + */ +void carla_msgs::msg::CarlaEpisodeSettings::actor_active_distance( + float _actor_active_distance) +{ + m_actor_active_distance = _actor_active_distance; +} + +/*! + * @brief This function returns the value of member actor_active_distance + * @return Value of member actor_active_distance + */ +float carla_msgs::msg::CarlaEpisodeSettings::actor_active_distance() const +{ + return m_actor_active_distance; +} + +/*! + * @brief This function returns a reference to member actor_active_distance + * @return Reference to member actor_active_distance + */ +float& carla_msgs::msg::CarlaEpisodeSettings::actor_active_distance() +{ + return m_actor_active_distance; +} + +/*! + * @brief This function sets a value in member spectator_as_ego + * @param _spectator_as_ego New value for member spectator_as_ego + */ +void carla_msgs::msg::CarlaEpisodeSettings::spectator_as_ego( + bool _spectator_as_ego) +{ + m_spectator_as_ego = _spectator_as_ego; +} + +/*! + * @brief This function returns the value of member spectator_as_ego + * @return Value of member spectator_as_ego + */ +bool carla_msgs::msg::CarlaEpisodeSettings::spectator_as_ego() const +{ + return m_spectator_as_ego; +} + +/*! + * @brief This function returns a reference to member spectator_as_ego + * @return Reference to member spectator_as_ego + */ +bool& carla_msgs::msg::CarlaEpisodeSettings::spectator_as_ego() +{ + return m_spectator_as_ego; +} + + +size_t carla_msgs::msg::CarlaEpisodeSettings::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaEpisodeSettings::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaEpisodeSettings::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.h new file mode 100644 index 00000000000..5721de80b70 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.h @@ -0,0 +1,410 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEpisodeSettings.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaEpisodeSettings_SOURCE) +#define CarlaEpisodeSettings_DllAPI __declspec( dllexport ) +#else +#define CarlaEpisodeSettings_DllAPI __declspec( dllimport ) +#endif // CarlaEpisodeSettings_SOURCE +#else +#define CarlaEpisodeSettings_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaEpisodeSettings_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaEpisodeSettings defined by the user in the IDL file. + * @ingroup CARLAEPISODESETTINGS + */ + class CarlaEpisodeSettings + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEpisodeSettings(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEpisodeSettings(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. + */ + eProsima_user_DllExport CarlaEpisodeSettings( + const CarlaEpisodeSettings& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. + */ + eProsima_user_DllExport CarlaEpisodeSettings( + CarlaEpisodeSettings&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. + */ + eProsima_user_DllExport CarlaEpisodeSettings& operator =( + const CarlaEpisodeSettings& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. + */ + eProsima_user_DllExport CarlaEpisodeSettings& operator =( + CarlaEpisodeSettings&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEpisodeSettings object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEpisodeSettings& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEpisodeSettings object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEpisodeSettings& x) const; + + /*! + * @brief This function sets a value in member synchronous_mode + * @param _synchronous_mode New value for member synchronous_mode + */ + eProsima_user_DllExport void synchronous_mode( + bool _synchronous_mode); + + /*! + * @brief This function returns the value of member synchronous_mode + * @return Value of member synchronous_mode + */ + eProsima_user_DllExport bool synchronous_mode() const; + + /*! + * @brief This function returns a reference to member synchronous_mode + * @return Reference to member synchronous_mode + */ + eProsima_user_DllExport bool& synchronous_mode(); + + /*! + * @brief This function sets a value in member no_rendering_mode + * @param _no_rendering_mode New value for member no_rendering_mode + */ + eProsima_user_DllExport void no_rendering_mode( + bool _no_rendering_mode); + + /*! + * @brief This function returns the value of member no_rendering_mode + * @return Value of member no_rendering_mode + */ + eProsima_user_DllExport bool no_rendering_mode() const; + + /*! + * @brief This function returns a reference to member no_rendering_mode + * @return Reference to member no_rendering_mode + */ + eProsima_user_DllExport bool& no_rendering_mode(); + + /*! + * @brief This function sets a value in member fixed_delta_seconds + * @param _fixed_delta_seconds New value for member fixed_delta_seconds + */ + eProsima_user_DllExport void fixed_delta_seconds( + double _fixed_delta_seconds); + + /*! + * @brief This function returns the value of member fixed_delta_seconds + * @return Value of member fixed_delta_seconds + */ + eProsima_user_DllExport double fixed_delta_seconds() const; + + /*! + * @brief This function returns a reference to member fixed_delta_seconds + * @return Reference to member fixed_delta_seconds + */ + eProsima_user_DllExport double& fixed_delta_seconds(); + + /*! + * @brief This function sets a value in member substepping + * @param _substepping New value for member substepping + */ + eProsima_user_DllExport void substepping( + bool _substepping); + + /*! + * @brief This function returns the value of member substepping + * @return Value of member substepping + */ + eProsima_user_DllExport bool substepping() const; + + /*! + * @brief This function returns a reference to member substepping + * @return Reference to member substepping + */ + eProsima_user_DllExport bool& substepping(); + + /*! + * @brief This function sets a value in member max_substep_delta_time + * @param _max_substep_delta_time New value for member max_substep_delta_time + */ + eProsima_user_DllExport void max_substep_delta_time( + double _max_substep_delta_time); + + /*! + * @brief This function returns the value of member max_substep_delta_time + * @return Value of member max_substep_delta_time + */ + eProsima_user_DllExport double max_substep_delta_time() const; + + /*! + * @brief This function returns a reference to member max_substep_delta_time + * @return Reference to member max_substep_delta_time + */ + eProsima_user_DllExport double& max_substep_delta_time(); + + /*! + * @brief This function sets a value in member max_substeps + * @param _max_substeps New value for member max_substeps + */ + eProsima_user_DllExport void max_substeps( + int32_t _max_substeps); + + /*! + * @brief This function returns the value of member max_substeps + * @return Value of member max_substeps + */ + eProsima_user_DllExport int32_t max_substeps() const; + + /*! + * @brief This function returns a reference to member max_substeps + * @return Reference to member max_substeps + */ + eProsima_user_DllExport int32_t& max_substeps(); + + /*! + * @brief This function sets a value in member max_culling_distance + * @param _max_culling_distance New value for member max_culling_distance + */ + eProsima_user_DllExport void max_culling_distance( + float _max_culling_distance); + + /*! + * @brief This function returns the value of member max_culling_distance + * @return Value of member max_culling_distance + */ + eProsima_user_DllExport float max_culling_distance() const; + + /*! + * @brief This function returns a reference to member max_culling_distance + * @return Reference to member max_culling_distance + */ + eProsima_user_DllExport float& max_culling_distance(); + + /*! + * @brief This function sets a value in member deterministic_ragdolls + * @param _deterministic_ragdolls New value for member deterministic_ragdolls + */ + eProsima_user_DllExport void deterministic_ragdolls( + bool _deterministic_ragdolls); + + /*! + * @brief This function returns the value of member deterministic_ragdolls + * @return Value of member deterministic_ragdolls + */ + eProsima_user_DllExport bool deterministic_ragdolls() const; + + /*! + * @brief This function returns a reference to member deterministic_ragdolls + * @return Reference to member deterministic_ragdolls + */ + eProsima_user_DllExport bool& deterministic_ragdolls(); + + /*! + * @brief This function sets a value in member tile_stream_distance + * @param _tile_stream_distance New value for member tile_stream_distance + */ + eProsima_user_DllExport void tile_stream_distance( + float _tile_stream_distance); + + /*! + * @brief This function returns the value of member tile_stream_distance + * @return Value of member tile_stream_distance + */ + eProsima_user_DllExport float tile_stream_distance() const; + + /*! + * @brief This function returns a reference to member tile_stream_distance + * @return Reference to member tile_stream_distance + */ + eProsima_user_DllExport float& tile_stream_distance(); + + /*! + * @brief This function sets a value in member actor_active_distance + * @param _actor_active_distance New value for member actor_active_distance + */ + eProsima_user_DllExport void actor_active_distance( + float _actor_active_distance); + + /*! + * @brief This function returns the value of member actor_active_distance + * @return Value of member actor_active_distance + */ + eProsima_user_DllExport float actor_active_distance() const; + + /*! + * @brief This function returns a reference to member actor_active_distance + * @return Reference to member actor_active_distance + */ + eProsima_user_DllExport float& actor_active_distance(); + + /*! + * @brief This function sets a value in member spectator_as_ego + * @param _spectator_as_ego New value for member spectator_as_ego + */ + eProsima_user_DllExport void spectator_as_ego( + bool _spectator_as_ego); + + /*! + * @brief This function returns the value of member spectator_as_ego + * @return Value of member spectator_as_ego + */ + eProsima_user_DllExport bool spectator_as_ego() const; + + /*! + * @brief This function returns a reference to member spectator_as_ego + * @return Reference to member spectator_as_ego + */ + eProsima_user_DllExport bool& spectator_as_ego(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaEpisodeSettings& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + bool m_synchronous_mode; + bool m_no_rendering_mode; + double m_fixed_delta_seconds; + bool m_substepping; + double m_max_substep_delta_time; + int32_t m_max_substeps; + float m_max_culling_distance; + bool m_deterministic_ragdolls; + float m_tile_stream_distance; + float m_actor_active_distance; + bool m_spectator_as_ego; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.cxx new file mode 100644 index 00000000000..6ce6b26d917 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEpisodeSettingsPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaEpisodeSettingsPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaEpisodeSettingsPubSubType::CarlaEpisodeSettingsPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaEpisodeSettings_"); + auto type_size = CarlaEpisodeSettings::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaEpisodeSettings::isKeyDefined(); + size_t keyLength = CarlaEpisodeSettings::getKeyMaxCdrSerializedSize() > 16 ? + CarlaEpisodeSettings::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaEpisodeSettingsPubSubType::~CarlaEpisodeSettingsPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaEpisodeSettingsPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaEpisodeSettings* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaEpisodeSettingsPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaEpisodeSettings* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaEpisodeSettingsPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaEpisodeSettingsPubSubType::createData() + { + return reinterpret_cast(new CarlaEpisodeSettings()); + } + + void CarlaEpisodeSettingsPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaEpisodeSettingsPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaEpisodeSettings* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaEpisodeSettings::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaEpisodeSettings::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h new file mode 100644 index 00000000000..48925fde9b8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEpisodeSettingsPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaEpisodeSettings.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaEpisodeSettings is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaEpisodeSettings defined by the user in the IDL file. + * @ingroup CARLAEPISODESETTINGS + */ + class CarlaEpisodeSettingsPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaEpisodeSettings type; + + eProsima_user_DllExport CarlaEpisodeSettingsPubSubType(); + + eProsima_user_DllExport virtual ~CarlaEpisodeSettingsPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaEpisodeSettings(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/CarlaLineInvasion.cpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.cxx similarity index 99% rename from LibCarla/source/carla/ros2/types/CarlaLineInvasion.cpp rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.cxx index ce483598762..64292e68d9a 100644 --- a/LibCarla/source/carla/ros2/types/CarlaLineInvasion.cpp +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.cxx @@ -13,7 +13,7 @@ // limitations under the License. /*! - * @file CarlaLineInvasion.cpp + * @file CarlaLaneInvasion.cpp * This source file contains the definition of the described types in the IDL file. * * This file was generated by the tool gen. @@ -26,7 +26,7 @@ char dummy; } // namespace #endif // _WIN32 -#include "CarlaLineInvasion.h" +#include "CarlaLaneInvasion.h" #include #include diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.h new file mode 100644 index 00000000000..236cf4fc08e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.h @@ -0,0 +1,225 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaLaneInvasion.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_H_ + +#include "std_msgs/msg/Header.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaLaneInvasion_SOURCE) +#define CarlaLaneInvasion_DllAPI __declspec(dllexport) +#else +#define CarlaLaneInvasion_DllAPI __declspec(dllimport) +#endif // CarlaLaneInvasion_SOURCE +#else +#define CarlaLaneInvasion_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaLaneInvasion_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace carla_msgs { +namespace msg { +const int32_t LANE_MARKING_OTHER = 0; +const int32_t LANE_MARKING_BROKEN = 1; +const int32_t LANE_MARKING_SOLID = 2; +/*! + * @brief This class represents the structure LaneInvasionEvent defined by the user in the IDL file. + * @ingroup CarlaLaneInvasion + */ +class LaneInvasionEvent { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LaneInvasionEvent(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LaneInvasionEvent(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. + */ + eProsima_user_DllExport LaneInvasionEvent(const LaneInvasionEvent& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. + */ + eProsima_user_DllExport LaneInvasionEvent(LaneInvasionEvent&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. + */ + eProsima_user_DllExport LaneInvasionEvent& operator=(const LaneInvasionEvent& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. + */ + eProsima_user_DllExport LaneInvasionEvent& operator=(LaneInvasionEvent&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::LaneInvasionEvent object to compare. + */ + eProsima_user_DllExport bool operator==(const LaneInvasionEvent& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::LaneInvasionEvent object to compare. + */ + eProsima_user_DllExport bool operator!=(const LaneInvasionEvent& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function copies the value in member crossed_lane_markings + * @param _crossed_lane_markings New value to be copied in member crossed_lane_markings + */ + eProsima_user_DllExport void crossed_lane_markings(const std::vector& _crossed_lane_markings); + + /*! + * @brief This function moves the value in member crossed_lane_markings + * @param _crossed_lane_markings New value to be moved in member crossed_lane_markings + */ + eProsima_user_DllExport void crossed_lane_markings(std::vector&& _crossed_lane_markings); + + /*! + * @brief This function returns a constant reference to member crossed_lane_markings + * @return Constant reference to member crossed_lane_markings + */ + eProsima_user_DllExport const std::vector& crossed_lane_markings() const; + + /*! + * @brief This function returns a reference to member crossed_lane_markings + * @return Reference to member crossed_lane_markings + */ + eProsima_user_DllExport std::vector& crossed_lane_markings(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const carla_msgs::msg::LaneInvasionEvent& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + std::vector m_crossed_lane_markings; +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.cxx new file mode 100644 index 00000000000..9fb493e166b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.cxx @@ -0,0 +1,255 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaLaneInvasionEvent.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaLaneInvasionEvent.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +carla_msgs::msg::CarlaLaneInvasionEvent::CarlaLaneInvasionEvent() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5e3f861 + + // m_crossed_lane_markings com.eprosima.idl.parser.typecode.SequenceTypeCode@2fb0623e + + +} + +carla_msgs::msg::CarlaLaneInvasionEvent::~CarlaLaneInvasionEvent() +{ + +} + +carla_msgs::msg::CarlaLaneInvasionEvent::CarlaLaneInvasionEvent( + const CarlaLaneInvasionEvent& x) +{ + m_header = x.m_header; + m_crossed_lane_markings = x.m_crossed_lane_markings; +} + +carla_msgs::msg::CarlaLaneInvasionEvent::CarlaLaneInvasionEvent( + CarlaLaneInvasionEvent&& x) +{ + m_header = std::move(x.m_header); + m_crossed_lane_markings = std::move(x.m_crossed_lane_markings); +} + +carla_msgs::msg::CarlaLaneInvasionEvent& carla_msgs::msg::CarlaLaneInvasionEvent::operator =( + const CarlaLaneInvasionEvent& x) +{ + + m_header = x.m_header; + m_crossed_lane_markings = x.m_crossed_lane_markings; + + return *this; +} + +carla_msgs::msg::CarlaLaneInvasionEvent& carla_msgs::msg::CarlaLaneInvasionEvent::operator =( + CarlaLaneInvasionEvent&& x) +{ + + m_header = std::move(x.m_header); + m_crossed_lane_markings = std::move(x.m_crossed_lane_markings); + + return *this; +} + +bool carla_msgs::msg::CarlaLaneInvasionEvent::operator ==( + const CarlaLaneInvasionEvent& x) const +{ + + return (m_header == x.m_header && m_crossed_lane_markings == x.m_crossed_lane_markings); +} + +bool carla_msgs::msg::CarlaLaneInvasionEvent::operator !=( + const CarlaLaneInvasionEvent& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaLaneInvasionEvent::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaLaneInvasionEvent::getCdrSerializedSize( + const carla_msgs::msg::CarlaLaneInvasionEvent& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.crossed_lane_markings().size() > 0) + { + current_alignment += (data.crossed_lane_markings().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaLaneInvasionEvent::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_crossed_lane_markings; + +} + +void carla_msgs::msg::CarlaLaneInvasionEvent::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_crossed_lane_markings; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void carla_msgs::msg::CarlaLaneInvasionEvent::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void carla_msgs::msg::CarlaLaneInvasionEvent::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& carla_msgs::msg::CarlaLaneInvasionEvent::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& carla_msgs::msg::CarlaLaneInvasionEvent::header() +{ + return m_header; +} +/*! + * @brief This function copies the value in member crossed_lane_markings + * @param _crossed_lane_markings New value to be copied in member crossed_lane_markings + */ +void carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings( + const std::vector& _crossed_lane_markings) +{ + m_crossed_lane_markings = _crossed_lane_markings; +} + +/*! + * @brief This function moves the value in member crossed_lane_markings + * @param _crossed_lane_markings New value to be moved in member crossed_lane_markings + */ +void carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings( + std::vector&& _crossed_lane_markings) +{ + m_crossed_lane_markings = std::move(_crossed_lane_markings); +} + +/*! + * @brief This function returns a constant reference to member crossed_lane_markings + * @return Constant reference to member crossed_lane_markings + */ +const std::vector& carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings() const +{ + return m_crossed_lane_markings; +} + +/*! + * @brief This function returns a reference to member crossed_lane_markings + * @return Reference to member crossed_lane_markings + */ +std::vector& carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings() +{ + return m_crossed_lane_markings; +} + +size_t carla_msgs::msg::CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaLaneInvasionEvent::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaLaneInvasionEvent::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/CarlaLineInvasion.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.h similarity index 74% rename from LibCarla/source/carla/ros2/types/CarlaLineInvasion.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.h index b1077107c40..c91607f1d4e 100644 --- a/LibCarla/source/carla/ros2/types/CarlaLineInvasion.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.h @@ -13,18 +13,16 @@ // limitations under the License. /*! - * @file CarlaLineInvasion.h + * @file CarlaLaneInvasionEvent.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALINEINVASION_H_ -#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALINEINVASION_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_H_ -#include "Header.h" - -#include +#include "std_msgs/msg/Header.h" #include #include @@ -45,16 +43,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaLineInvasion_SOURCE) -#define CarlaLineInvasion_DllAPI __declspec( dllexport ) +#if defined(CarlaLaneInvasionEvent_SOURCE) +#define CarlaLaneInvasionEvent_DllAPI __declspec( dllexport ) #else -#define CarlaLineInvasion_DllAPI __declspec( dllimport ) -#endif // CarlaLineInvasion_SOURCE +#define CarlaLaneInvasionEvent_DllAPI __declspec( dllimport ) +#endif // CarlaLaneInvasionEvent_SOURCE #else -#define CarlaLineInvasion_DllAPI +#define CarlaLaneInvasionEvent_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaLineInvasion_DllAPI +#define CarlaLaneInvasionEvent_DllAPI #endif // _WIN32 namespace eprosima { @@ -63,69 +61,73 @@ class Cdr; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { namespace msg { - const int32_t LANE_MARKING_OTHER = 0; - const int32_t LANE_MARKING_BROKEN = 1; - const int32_t LANE_MARKING_SOLID = 2; + namespace CarlaLaneInvasionEvent_Constants { + const int32_t LANE_MARKING_OTHER = 0; + const int32_t LANE_MARKING_BROKEN = 1; + const int32_t LANE_MARKING_SOLID = 2; + } // namespace CarlaLaneInvasionEvent_Constants /*! - * @brief This class represents the structure LaneInvasionEvent defined by the user in the IDL file. - * @ingroup CARLALINEINVASION + * @brief This class represents the structure CarlaLaneInvasionEvent defined by the user in the IDL file. + * @ingroup CARLALANEINVASIONEVENT */ - class LaneInvasionEvent + class CarlaLaneInvasionEvent { public: + /*! * @brief Default constructor. */ - eProsima_user_DllExport LaneInvasionEvent(); + eProsima_user_DllExport CarlaLaneInvasionEvent(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~LaneInvasionEvent(); + eProsima_user_DllExport ~CarlaLaneInvasionEvent(); /*! * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. */ - eProsima_user_DllExport LaneInvasionEvent( - const LaneInvasionEvent& x); + eProsima_user_DllExport CarlaLaneInvasionEvent( + const CarlaLaneInvasionEvent& x); /*! * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. */ - eProsima_user_DllExport LaneInvasionEvent( - LaneInvasionEvent&& x) noexcept; + eProsima_user_DllExport CarlaLaneInvasionEvent( + CarlaLaneInvasionEvent&& x); /*! * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. */ - eProsima_user_DllExport LaneInvasionEvent& operator =( - const LaneInvasionEvent& x); + eProsima_user_DllExport CarlaLaneInvasionEvent& operator =( + const CarlaLaneInvasionEvent& x); /*! * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. */ - eProsima_user_DllExport LaneInvasionEvent& operator =( - LaneInvasionEvent&& x) noexcept; + eProsima_user_DllExport CarlaLaneInvasionEvent& operator =( + CarlaLaneInvasionEvent&& x); /*! * @brief Comparison operator. - * @param x carla_msgs::msg::LaneInvasionEvent object to compare. + * @param x carla_msgs::msg::CarlaLaneInvasionEvent object to compare. */ eProsima_user_DllExport bool operator ==( - const LaneInvasionEvent& x) const; + const CarlaLaneInvasionEvent& x) const; /*! * @brief Comparison operator. - * @param x carla_msgs::msg::LaneInvasionEvent object to compare. + * @param x carla_msgs::msg::CarlaLaneInvasionEvent object to compare. */ eProsima_user_DllExport bool operator !=( - const LaneInvasionEvent& x) const; + const CarlaLaneInvasionEvent& x) const; /*! * @brief This function copies the value in member header @@ -179,11 +181,11 @@ namespace carla_msgs { eProsima_user_DllExport std::vector& crossed_lane_markings(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -194,9 +196,10 @@ namespace carla_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::LaneInvasionEvent& data, + const carla_msgs::msg::CarlaLaneInvasionEvent& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -211,6 +214,8 @@ namespace carla_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -233,10 +238,11 @@ namespace carla_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + std_msgs::msg::Header m_header; std::vector m_crossed_lane_markings; }; } // namespace msg } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALINEINVASION_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.cxx new file mode 100644 index 00000000000..0c2df428c3c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaLaneInvasionEventPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaLaneInvasionEventPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + namespace CarlaLaneInvasionEvent_Constants { + + + + + } //End of namespace CarlaLaneInvasionEvent_Constants + CarlaLaneInvasionEventPubSubType::CarlaLaneInvasionEventPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaLaneInvasionEvent_"); + auto type_size = CarlaLaneInvasionEvent::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaLaneInvasionEvent::isKeyDefined(); + size_t keyLength = CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize() > 16 ? + CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaLaneInvasionEventPubSubType::~CarlaLaneInvasionEventPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaLaneInvasionEventPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaLaneInvasionEvent* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaLaneInvasionEventPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaLaneInvasionEvent* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaLaneInvasionEventPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaLaneInvasionEventPubSubType::createData() + { + return reinterpret_cast(new CarlaLaneInvasionEvent()); + } + + void CarlaLaneInvasionEventPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaLaneInvasionEventPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaLaneInvasionEvent* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.h new file mode 100644 index 00000000000..6e6bb375272 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaLaneInvasionEventPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaLaneInvasionEvent.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaLaneInvasionEvent is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + namespace CarlaLaneInvasionEvent_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type CarlaLaneInvasionEvent defined by the user in the IDL file. + * @ingroup CARLALANEINVASIONEVENT + */ + class CarlaLaneInvasionEventPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaLaneInvasionEvent type; + + eProsima_user_DllExport CarlaLaneInvasionEventPubSubType(); + + eProsima_user_DllExport virtual ~CarlaLaneInvasionEventPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/CarlaLineInvasionPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.cxx similarity index 98% rename from LibCarla/source/carla/ros2/types/CarlaLineInvasionPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.cxx index d23c113c4b2..65535475f00 100644 --- a/LibCarla/source/carla/ros2/types/CarlaLineInvasionPubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.cxx @@ -13,7 +13,7 @@ // limitations under the License. /*! - * @file CarlaLineInvasionPubSubTypes.cpp + * @file CarlaLaneInvasionPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * * This file was generated by the tool fastcdrgen. @@ -22,7 +22,7 @@ #include #include -#include "CarlaLineInvasionPubSubTypes.h" +#include "CarlaLaneInvasionPubSubTypes.h" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.h new file mode 100644 index 00000000000..2c5620a95a6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.h @@ -0,0 +1,92 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaLaneInvasionPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaLaneInvasion.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaLaneInvasion is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type LaneInvasionEvent defined by the user in the IDL file. + * @ingroup CarlaLaneInvasion + */ +class LaneInvasionEventPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef LaneInvasionEvent type; + + eProsima_user_DllExport LaneInvasionEventPubSubType(); + + eProsima_user_DllExport virtual ~LaneInvasionEventPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.cxx new file mode 100644 index 00000000000..54cb5c9a42d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.cxx @@ -0,0 +1,384 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaStatus.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaStatus.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaStatus::CarlaStatus() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@769a1df5 + + // m_episode_settings com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@41f69e84 + + // m_frame com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7975d1d8 + m_frame = 0; + // m_synchronous_mode_participant_states com.eprosima.idl.parser.typecode.SequenceTypeCode@2438dcd + + // m_game_running com.eprosima.idl.parser.typecode.PrimitiveTypeCode@24105dc5 + m_game_running = false; + +} + +carla_msgs::msg::CarlaStatus::~CarlaStatus() +{ + + + + +} + +carla_msgs::msg::CarlaStatus::CarlaStatus( + const CarlaStatus& x) +{ + m_header = x.m_header; + m_episode_settings = x.m_episode_settings; + m_frame = x.m_frame; + m_synchronous_mode_participant_states = x.m_synchronous_mode_participant_states; + m_game_running = x.m_game_running; +} + +carla_msgs::msg::CarlaStatus::CarlaStatus( + CarlaStatus&& x) +{ + m_header = std::move(x.m_header); + m_episode_settings = std::move(x.m_episode_settings); + m_frame = x.m_frame; + m_synchronous_mode_participant_states = std::move(x.m_synchronous_mode_participant_states); + m_game_running = x.m_game_running; +} + +carla_msgs::msg::CarlaStatus& carla_msgs::msg::CarlaStatus::operator =( + const CarlaStatus& x) +{ + + m_header = x.m_header; + m_episode_settings = x.m_episode_settings; + m_frame = x.m_frame; + m_synchronous_mode_participant_states = x.m_synchronous_mode_participant_states; + m_game_running = x.m_game_running; + + return *this; +} + +carla_msgs::msg::CarlaStatus& carla_msgs::msg::CarlaStatus::operator =( + CarlaStatus&& x) +{ + + m_header = std::move(x.m_header); + m_episode_settings = std::move(x.m_episode_settings); + m_frame = x.m_frame; + m_synchronous_mode_participant_states = std::move(x.m_synchronous_mode_participant_states); + m_game_running = x.m_game_running; + + return *this; +} + +bool carla_msgs::msg::CarlaStatus::operator ==( + const CarlaStatus& x) const +{ + + return (m_header == x.m_header && m_episode_settings == x.m_episode_settings && m_frame == x.m_frame && m_synchronous_mode_participant_states == x.m_synchronous_mode_participant_states && m_game_running == x.m_game_running); +} + +bool carla_msgs::msg::CarlaStatus::operator !=( + const CarlaStatus& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaStatus::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += carla_msgs::msg::CarlaEpisodeSettings::getMaxCdrSerializedSize(current_alignment); + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getMaxCdrSerializedSize(current_alignment);} + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaStatus::getCdrSerializedSize( + const carla_msgs::msg::CarlaStatus& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += carla_msgs::msg::CarlaEpisodeSettings::getCdrSerializedSize(data.episode_settings(), current_alignment); + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.synchronous_mode_participant_states().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getCdrSerializedSize(data.synchronous_mode_participant_states().at(a), current_alignment);} + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaStatus::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_episode_settings; + scdr << m_frame; + scdr << m_synchronous_mode_participant_states; + scdr << m_game_running; + +} + +void carla_msgs::msg::CarlaStatus::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_episode_settings; + dcdr >> m_frame; + dcdr >> m_synchronous_mode_participant_states; + dcdr >> m_game_running; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void carla_msgs::msg::CarlaStatus::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void carla_msgs::msg::CarlaStatus::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& carla_msgs::msg::CarlaStatus::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& carla_msgs::msg::CarlaStatus::header() +{ + return m_header; +} +/*! + * @brief This function copies the value in member episode_settings + * @param _episode_settings New value to be copied in member episode_settings + */ +void carla_msgs::msg::CarlaStatus::episode_settings( + const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings) +{ + m_episode_settings = _episode_settings; +} + +/*! + * @brief This function moves the value in member episode_settings + * @param _episode_settings New value to be moved in member episode_settings + */ +void carla_msgs::msg::CarlaStatus::episode_settings( + carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings) +{ + m_episode_settings = std::move(_episode_settings); +} + +/*! + * @brief This function returns a constant reference to member episode_settings + * @return Constant reference to member episode_settings + */ +const carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaStatus::episode_settings() const +{ + return m_episode_settings; +} + +/*! + * @brief This function returns a reference to member episode_settings + * @return Reference to member episode_settings + */ +carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaStatus::episode_settings() +{ + return m_episode_settings; +} +/*! + * @brief This function sets a value in member frame + * @param _frame New value for member frame + */ +void carla_msgs::msg::CarlaStatus::frame( + uint64_t _frame) +{ + m_frame = _frame; +} + +/*! + * @brief This function returns the value of member frame + * @return Value of member frame + */ +uint64_t carla_msgs::msg::CarlaStatus::frame() const +{ + return m_frame; +} + +/*! + * @brief This function returns a reference to member frame + * @return Reference to member frame + */ +uint64_t& carla_msgs::msg::CarlaStatus::frame() +{ + return m_frame; +} + +/*! + * @brief This function copies the value in member synchronous_mode_participant_states + * @param _synchronous_mode_participant_states New value to be copied in member synchronous_mode_participant_states + */ +void carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states( + const std::vector& _synchronous_mode_participant_states) +{ + m_synchronous_mode_participant_states = _synchronous_mode_participant_states; +} + +/*! + * @brief This function moves the value in member synchronous_mode_participant_states + * @param _synchronous_mode_participant_states New value to be moved in member synchronous_mode_participant_states + */ +void carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states( + std::vector&& _synchronous_mode_participant_states) +{ + m_synchronous_mode_participant_states = std::move(_synchronous_mode_participant_states); +} + +/*! + * @brief This function returns a constant reference to member synchronous_mode_participant_states + * @return Constant reference to member synchronous_mode_participant_states + */ +const std::vector& carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states() const +{ + return m_synchronous_mode_participant_states; +} + +/*! + * @brief This function returns a reference to member synchronous_mode_participant_states + * @return Reference to member synchronous_mode_participant_states + */ +std::vector& carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states() +{ + return m_synchronous_mode_participant_states; +} +/*! + * @brief This function sets a value in member game_running + * @param _game_running New value for member game_running + */ +void carla_msgs::msg::CarlaStatus::game_running( + bool _game_running) +{ + m_game_running = _game_running; +} + +/*! + * @brief This function returns the value of member game_running + * @return Value of member game_running + */ +bool carla_msgs::msg::CarlaStatus::game_running() const +{ + return m_game_running; +} + +/*! + * @brief This function returns a reference to member game_running + * @return Reference to member game_running + */ +bool& carla_msgs::msg::CarlaStatus::game_running() +{ + return m_game_running; +} + + +size_t carla_msgs::msg::CarlaStatus::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaStatus::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaStatus::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/Image.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.h similarity index 52% rename from LibCarla/source/carla/ros2/types/Image.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.h index 3f8114c04d7..3866c796204 100644 --- a/LibCarla/source/carla/ros2/types/Image.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.h @@ -13,18 +13,18 @@ // limitations under the License. /*! - * @file Image.h + * @file CarlaStatus.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_H_ -#include "Header.h" - -#include +#include "carla_msgs/msg/CarlaEpisodeSettings.h" +#include "carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h" +#include "std_msgs/msg/Header.h" #include #include @@ -45,16 +45,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Image_SOURCE) -#define Image_DllAPI __declspec( dllexport ) +#if defined(CarlaStatus_SOURCE) +#define CarlaStatus_DllAPI __declspec( dllexport ) #else -#define Image_DllAPI __declspec( dllimport ) -#endif // Image_SOURCE +#define CarlaStatus_DllAPI __declspec( dllimport ) +#endif // CarlaStatus_SOURCE #else -#define Image_DllAPI +#define CarlaStatus_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Image_DllAPI +#define CarlaStatus_DllAPI #endif // _WIN32 namespace eprosima { @@ -63,67 +63,68 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace sensor_msgs { + +namespace carla_msgs { namespace msg { /*! - * @brief This class represents the structure Image defined by the user in the IDL file. - * @ingroup IMAGE + * @brief This class represents the structure CarlaStatus defined by the user in the IDL file. + * @ingroup CARLASTATUS */ - class Image + class CarlaStatus { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport Image(); + eProsima_user_DllExport CarlaStatus(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Image(); + eProsima_user_DllExport ~CarlaStatus(); /*! * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::Image that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. */ - eProsima_user_DllExport Image( - const Image& x); + eProsima_user_DllExport CarlaStatus( + const CarlaStatus& x); /*! * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::Image that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. */ - eProsima_user_DllExport Image( - Image&& x) noexcept; + eProsima_user_DllExport CarlaStatus( + CarlaStatus&& x); /*! * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::Image that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. */ - eProsima_user_DllExport Image& operator =( - const Image& x); + eProsima_user_DllExport CarlaStatus& operator =( + const CarlaStatus& x); /*! * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::Image that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. */ - eProsima_user_DllExport Image& operator =( - Image&& x) noexcept; + eProsima_user_DllExport CarlaStatus& operator =( + CarlaStatus&& x); /*! * @brief Comparison operator. - * @param x sensor_msgs::msg::Image object to compare. + * @param x carla_msgs::msg::CarlaStatus object to compare. */ eProsima_user_DllExport bool operator ==( - const Image& x) const; + const CarlaStatus& x) const; /*! * @brief Comparison operator. - * @param x sensor_msgs::msg::Image object to compare. + * @param x carla_msgs::msg::CarlaStatus object to compare. */ eProsima_user_DllExport bool operator !=( - const Image& x) const; + const CarlaStatus& x) const; /*! * @brief This function copies the value in member header @@ -151,138 +152,100 @@ namespace sensor_msgs { */ eProsima_user_DllExport std_msgs::msg::Header& header(); /*! - * @brief This function sets a value in member height - * @param _height New value for member height + * @brief This function copies the value in member episode_settings + * @param _episode_settings New value to be copied in member episode_settings */ - eProsima_user_DllExport void height( - uint32_t _height); + eProsima_user_DllExport void episode_settings( + const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings); /*! - * @brief This function returns the value of member height - * @return Value of member height + * @brief This function moves the value in member episode_settings + * @param _episode_settings New value to be moved in member episode_settings */ - eProsima_user_DllExport uint32_t height() const; + eProsima_user_DllExport void episode_settings( + carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings); /*! - * @brief This function returns a reference to member height - * @return Reference to member height + * @brief This function returns a constant reference to member episode_settings + * @return Constant reference to member episode_settings */ - eProsima_user_DllExport uint32_t& height(); + eProsima_user_DllExport const carla_msgs::msg::CarlaEpisodeSettings& episode_settings() const; /*! - * @brief This function sets a value in member width - * @param _width New value for member width + * @brief This function returns a reference to member episode_settings + * @return Reference to member episode_settings */ - eProsima_user_DllExport void width( - uint32_t _width); - + eProsima_user_DllExport carla_msgs::msg::CarlaEpisodeSettings& episode_settings(); /*! - * @brief This function returns the value of member width - * @return Value of member width + * @brief This function sets a value in member frame + * @param _frame New value for member frame */ - eProsima_user_DllExport uint32_t width() const; + eProsima_user_DllExport void frame( + uint64_t _frame); /*! - * @brief This function returns a reference to member width - * @return Reference to member width + * @brief This function returns the value of member frame + * @return Value of member frame */ - eProsima_user_DllExport uint32_t& width(); + eProsima_user_DllExport uint64_t frame() const; /*! - * @brief This function copies the value in member encoding - * @param _encoding New value to be copied in member encoding + * @brief This function returns a reference to member frame + * @return Reference to member frame */ - eProsima_user_DllExport void encoding( - const std::string& _encoding); + eProsima_user_DllExport uint64_t& frame(); /*! - * @brief This function moves the value in member encoding - * @param _encoding New value to be moved in member encoding + * @brief This function copies the value in member synchronous_mode_participant_states + * @param _synchronous_mode_participant_states New value to be copied in member synchronous_mode_participant_states */ - eProsima_user_DllExport void encoding( - std::string&& _encoding); + eProsima_user_DllExport void synchronous_mode_participant_states( + const std::vector& _synchronous_mode_participant_states); /*! - * @brief This function returns a constant reference to member encoding - * @return Constant reference to member encoding + * @brief This function moves the value in member synchronous_mode_participant_states + * @param _synchronous_mode_participant_states New value to be moved in member synchronous_mode_participant_states */ - eProsima_user_DllExport const std::string& encoding() const; + eProsima_user_DllExport void synchronous_mode_participant_states( + std::vector&& _synchronous_mode_participant_states); /*! - * @brief This function returns a reference to member encoding - * @return Reference to member encoding + * @brief This function returns a constant reference to member synchronous_mode_participant_states + * @return Constant reference to member synchronous_mode_participant_states */ - eProsima_user_DllExport std::string& encoding(); - /*! - * @brief This function sets a value in member is_bigendian - * @param _is_bigendian New value for member is_bigendian - */ - eProsima_user_DllExport void is_bigendian( - uint8_t _is_bigendian); + eProsima_user_DllExport const std::vector& synchronous_mode_participant_states() const; /*! - * @brief This function returns the value of member is_bigendian - * @return Value of member is_bigendian + * @brief This function returns a reference to member synchronous_mode_participant_states + * @return Reference to member synchronous_mode_participant_states */ - eProsima_user_DllExport uint8_t is_bigendian() const; - + eProsima_user_DllExport std::vector& synchronous_mode_participant_states(); /*! - * @brief This function returns a reference to member is_bigendian - * @return Reference to member is_bigendian + * @brief This function sets a value in member game_running + * @param _game_running New value for member game_running */ - eProsima_user_DllExport uint8_t& is_bigendian(); + eProsima_user_DllExport void game_running( + bool _game_running); /*! - * @brief This function sets a value in member step - * @param _step New value for member step + * @brief This function returns the value of member game_running + * @return Value of member game_running */ - eProsima_user_DllExport void step( - uint32_t _step); + eProsima_user_DllExport bool game_running() const; /*! - * @brief This function returns the value of member step - * @return Value of member step + * @brief This function returns a reference to member game_running + * @return Reference to member game_running */ - eProsima_user_DllExport uint32_t step() const; + eProsima_user_DllExport bool& game_running(); - /*! - * @brief This function returns a reference to member step - * @return Reference to member step - */ - eProsima_user_DllExport uint32_t& step(); - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. */ - eProsima_user_DllExport std::vector& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -293,7 +256,7 @@ namespace sensor_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const sensor_msgs::msg::Image& data, + const carla_msgs::msg::CarlaStatus& data, size_t current_alignment = 0); @@ -311,6 +274,8 @@ namespace sensor_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -333,15 +298,14 @@ namespace sensor_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + std_msgs::msg::Header m_header; - uint32_t m_height; - uint32_t m_width; - std::string m_encoding; - uint8_t m_is_bigendian; - uint32_t m_step; - std::vector m_data; + carla_msgs::msg::CarlaEpisodeSettings m_episode_settings; + uint64_t m_frame; + std::vector m_synchronous_mode_participant_states; + bool m_game_running; }; } // namespace msg -} // namespace sensor_msgs +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/PointCloud2PubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.cxx similarity index 69% rename from LibCarla/source/carla/ros2/types/PointCloud2PubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.cxx index d2e39c66dc9..4726108d66c 100644 --- a/LibCarla/source/carla/ros2/types/PointCloud2PubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.cxx @@ -13,36 +13,37 @@ // limitations under the License. /*! - * @file PointCloud2PubSubTypes.cpp + * @file CarlaStatusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * * This file was generated by the tool fastcdrgen. */ + #include #include -#include "PointCloud2PubSubTypes.h" +#include "CarlaStatusPubSubTypes.h" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -namespace sensor_msgs { +namespace carla_msgs { namespace msg { - PointCloud2PubSubType::PointCloud2PubSubType() + CarlaStatusPubSubType::CarlaStatusPubSubType() { - setName("sensor_msgs::msg::dds_::PointCloud2_"); - auto type_size = PointCloud2::getMaxCdrSerializedSize(); + setName("carla_msgs::msg::dds_::CarlaStatus_"); + auto type_size = CarlaStatus::getMaxCdrSerializedSize(); type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PointCloud2::isKeyDefined(); - size_t keyLength = PointCloud2::getKeyMaxCdrSerializedSize() > 16 ? - PointCloud2::getKeyMaxCdrSerializedSize() : 16; + m_isGetKeyDefined = CarlaStatus::isKeyDefined(); + size_t keyLength = CarlaStatus::getKeyMaxCdrSerializedSize() > 16 ? + CarlaStatus::getKeyMaxCdrSerializedSize() : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } - PointCloud2PubSubType::~PointCloud2PubSubType() + CarlaStatusPubSubType::~CarlaStatusPubSubType() { if (m_keyBuffer != nullptr) { @@ -50,11 +51,11 @@ namespace sensor_msgs { } } - bool PointCloud2PubSubType::serialize( + bool CarlaStatusPubSubType::serialize( void* data, SerializedPayload_t* payload) { - PointCloud2* p_type = static_cast(data); + CarlaStatus* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -79,25 +80,25 @@ namespace sensor_msgs { return true; } - bool PointCloud2PubSubType::deserialize( + bool CarlaStatusPubSubType::deserialize( SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - PointCloud2* p_type = static_cast(data); + //Convert DATA to pointer of your type + CarlaStatus* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -109,28 +110,28 @@ namespace sensor_msgs { return true; } - std::function PointCloud2PubSubType::getSerializedSizeProvider( + std::function CarlaStatusPubSubType::getSerializedSizeProvider( void* data) { return [data]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + 4u /*encapsulation*/; }; } - void* PointCloud2PubSubType::createData() + void* CarlaStatusPubSubType::createData() { - return reinterpret_cast(new PointCloud2()); + return reinterpret_cast(new CarlaStatus()); } - void PointCloud2PubSubType::deleteData( + void CarlaStatusPubSubType::deleteData( void* data) { - delete(reinterpret_cast(data)); + delete(reinterpret_cast(data)); } - bool PointCloud2PubSubType::getKey( + bool CarlaStatusPubSubType::getKey( void* data, InstanceHandle_t* handle, bool force_md5) @@ -140,16 +141,16 @@ namespace sensor_msgs { return false; } - PointCloud2* p_type = static_cast(data); + CarlaStatus* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PointCloud2::getKeyMaxCdrSerializedSize()); + CarlaStatus::getKeyMaxCdrSerializedSize()); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); p_type->serializeKey(ser); - if (force_md5 || PointCloud2::getKeyMaxCdrSerializedSize() > 16) + if (force_md5 || CarlaStatus::getKeyMaxCdrSerializedSize() > 16) { m_md5.init(); m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); @@ -168,5 +169,8 @@ namespace sensor_msgs { } return true; } + + } //End of namespace msg -} //End of namespace sensor_msgs + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/types/PointFieldPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.h similarity index 79% rename from LibCarla/source/carla/ros2/types/PointFieldPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.h index 1ff3d73c430..3ab5acb6ec7 100644 --- a/LibCarla/source/carla/ros2/types/PointFieldPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.h @@ -13,42 +13,43 @@ // limitations under the License. /*! - * @file PointFieldPubSubTypes.h + * @file CarlaStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_PUBSUBTYPES_H_ #include #include -#include "PointField.h" +#include "CarlaStatus.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated PointField is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CarlaStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace sensor_msgs +namespace carla_msgs { namespace msg { /*! - * @brief This class represents the TopicDataType of the type PointField defined by the user in the IDL file. - * @ingroup POINTFIELD + * @brief This class represents the TopicDataType of the type CarlaStatus defined by the user in the IDL file. + * @ingroup CARLASTATUS */ - class PointFieldPubSubType : public eprosima::fastdds::dds::TopicDataType + class CarlaStatusPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef PointField type; + typedef CarlaStatus type; - eProsima_user_DllExport PointFieldPubSubType(); + eProsima_user_DllExport CarlaStatusPubSubType(); - eProsima_user_DllExport virtual ~PointFieldPubSubType() override; + eProsima_user_DllExport virtual ~CarlaStatusPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -96,10 +97,11 @@ namespace sensor_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.cxx new file mode 100644 index 00000000000..5e360641bb2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.cxx @@ -0,0 +1,183 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindow.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaSynchronizationWindow.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaSynchronizationWindow::CarlaSynchronizationWindow() +{ + // m_synchronization_window_target_game_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2c78324b + m_synchronization_window_target_game_time = 0.0; + +} + +carla_msgs::msg::CarlaSynchronizationWindow::~CarlaSynchronizationWindow() +{ +} + +carla_msgs::msg::CarlaSynchronizationWindow::CarlaSynchronizationWindow( + const CarlaSynchronizationWindow& x) +{ + m_synchronization_window_target_game_time = x.m_synchronization_window_target_game_time; +} + +carla_msgs::msg::CarlaSynchronizationWindow::CarlaSynchronizationWindow( + CarlaSynchronizationWindow&& x) +{ + m_synchronization_window_target_game_time = x.m_synchronization_window_target_game_time; +} + +carla_msgs::msg::CarlaSynchronizationWindow& carla_msgs::msg::CarlaSynchronizationWindow::operator =( + const CarlaSynchronizationWindow& x) +{ + + m_synchronization_window_target_game_time = x.m_synchronization_window_target_game_time; + + return *this; +} + +carla_msgs::msg::CarlaSynchronizationWindow& carla_msgs::msg::CarlaSynchronizationWindow::operator =( + CarlaSynchronizationWindow&& x) +{ + + m_synchronization_window_target_game_time = x.m_synchronization_window_target_game_time; + + return *this; +} + +bool carla_msgs::msg::CarlaSynchronizationWindow::operator ==( + const CarlaSynchronizationWindow& x) const +{ + + return (m_synchronization_window_target_game_time == x.m_synchronization_window_target_game_time); +} + +bool carla_msgs::msg::CarlaSynchronizationWindow::operator !=( + const CarlaSynchronizationWindow& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaSynchronizationWindow::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaSynchronizationWindow::getCdrSerializedSize( + const carla_msgs::msg::CarlaSynchronizationWindow& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaSynchronizationWindow::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_synchronization_window_target_game_time; + +} + +void carla_msgs::msg::CarlaSynchronizationWindow::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_synchronization_window_target_game_time; +} + +/*! + * @brief This function sets a value in member synchronization_window_target_game_time + * @param _synchronization_window_target_game_time New value for member synchronization_window_target_game_time + */ +void carla_msgs::msg::CarlaSynchronizationWindow::synchronization_window_target_game_time( + float _synchronization_window_target_game_time) +{ + m_synchronization_window_target_game_time = _synchronization_window_target_game_time; +} + +/*! + * @brief This function returns the value of member synchronization_window_target_game_time + * @return Value of member synchronization_window_target_game_time + */ +float carla_msgs::msg::CarlaSynchronizationWindow::synchronization_window_target_game_time() const +{ + return m_synchronization_window_target_game_time; +} + +/*! + * @brief This function returns a reference to member synchronization_window_target_game_time + * @return Reference to member synchronization_window_target_game_time + */ +float& carla_msgs::msg::CarlaSynchronizationWindow::synchronization_window_target_game_time() +{ + return m_synchronization_window_target_game_time; +} + + +size_t carla_msgs::msg::CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaSynchronizationWindow::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaSynchronizationWindow::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.h new file mode 100644 index 00000000000..8288f455158 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.h @@ -0,0 +1,210 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindow.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaSynchronizationWindow_SOURCE) +#define CarlaSynchronizationWindow_DllAPI __declspec( dllexport ) +#else +#define CarlaSynchronizationWindow_DllAPI __declspec( dllimport ) +#endif // CarlaSynchronizationWindow_SOURCE +#else +#define CarlaSynchronizationWindow_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaSynchronizationWindow_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaSynchronizationWindow defined by the user in the IDL file. + * @ingroup CARLASYNCHRONIZATIONWINDOW + */ + class CarlaSynchronizationWindow + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaSynchronizationWindow(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaSynchronizationWindow(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindow( + const CarlaSynchronizationWindow& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindow( + CarlaSynchronizationWindow&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindow& operator =( + const CarlaSynchronizationWindow& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindow& operator =( + CarlaSynchronizationWindow&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaSynchronizationWindow object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaSynchronizationWindow& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaSynchronizationWindow object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaSynchronizationWindow& x) const; + + /*! + * @brief This function sets a value in member synchronization_window_target_game_time + * @param _synchronization_window_target_game_time New value for member synchronization_window_target_game_time + */ + eProsima_user_DllExport void synchronization_window_target_game_time( + float _synchronization_window_target_game_time); + + /*! + * @brief This function returns the value of member synchronization_window_target_game_time + * @return Value of member synchronization_window_target_game_time + */ + eProsima_user_DllExport float synchronization_window_target_game_time() const; + + /*! + * @brief This function returns a reference to member synchronization_window_target_game_time + * @return Reference to member synchronization_window_target_game_time + */ + eProsima_user_DllExport float& synchronization_window_target_game_time(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaSynchronizationWindow& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + float m_synchronization_window_target_game_time; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.cxx new file mode 100644 index 00000000000..ccebc7f826f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.cxx @@ -0,0 +1,278 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowParticipantState.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaSynchronizationWindowParticipantState.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState() +{ + // m_client_id com.eprosima.idl.parser.typecode.StringTypeCode@2e570ded + m_client_id =""; + // m_participant_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@b86de0d + m_participant_id = 0; + // m_target_game_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@81d9a72 + m_target_game_time = 0.0; + +} + +carla_msgs::msg::CarlaSynchronizationWindowParticipantState::~CarlaSynchronizationWindowParticipantState() +{ + + +} + +carla_msgs::msg::CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState( + const CarlaSynchronizationWindowParticipantState& x) +{ + m_client_id = x.m_client_id; + m_participant_id = x.m_participant_id; + m_target_game_time = x.m_target_game_time; +} + +carla_msgs::msg::CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState( + CarlaSynchronizationWindowParticipantState&& x) +{ + m_client_id = std::move(x.m_client_id); + m_participant_id = x.m_participant_id; + m_target_game_time = x.m_target_game_time; +} + +carla_msgs::msg::CarlaSynchronizationWindowParticipantState& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::operator =( + const CarlaSynchronizationWindowParticipantState& x) +{ + + m_client_id = x.m_client_id; + m_participant_id = x.m_participant_id; + m_target_game_time = x.m_target_game_time; + + return *this; +} + +carla_msgs::msg::CarlaSynchronizationWindowParticipantState& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::operator =( + CarlaSynchronizationWindowParticipantState&& x) +{ + + m_client_id = std::move(x.m_client_id); + m_participant_id = x.m_participant_id; + m_target_game_time = x.m_target_game_time; + + return *this; +} + +bool carla_msgs::msg::CarlaSynchronizationWindowParticipantState::operator ==( + const CarlaSynchronizationWindowParticipantState& x) const +{ + + return (m_client_id == x.m_client_id && m_participant_id == x.m_participant_id && m_target_game_time == x.m_target_game_time); +} + +bool carla_msgs::msg::CarlaSynchronizationWindowParticipantState::operator !=( + const CarlaSynchronizationWindowParticipantState& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getCdrSerializedSize( + const carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.client_id().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_client_id; + scdr << m_participant_id; + scdr << m_target_game_time; + +} + +void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_client_id; + dcdr >> m_participant_id; + dcdr >> m_target_game_time; +} + +/*! + * @brief This function copies the value in member client_id + * @param _client_id New value to be copied in member client_id + */ +void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id( + const std::string& _client_id) +{ + m_client_id = _client_id; +} + +/*! + * @brief This function moves the value in member client_id + * @param _client_id New value to be moved in member client_id + */ +void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id( + std::string&& _client_id) +{ + m_client_id = std::move(_client_id); +} + +/*! + * @brief This function returns a constant reference to member client_id + * @return Constant reference to member client_id + */ +const std::string& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id() const +{ + return m_client_id; +} + +/*! + * @brief This function returns a reference to member client_id + * @return Reference to member client_id + */ +std::string& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id() +{ + return m_client_id; +} +/*! + * @brief This function sets a value in member participant_id + * @param _participant_id New value for member participant_id + */ +void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::participant_id( + uint32_t _participant_id) +{ + m_participant_id = _participant_id; +} + +/*! + * @brief This function returns the value of member participant_id + * @return Value of member participant_id + */ +uint32_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::participant_id() const +{ + return m_participant_id; +} + +/*! + * @brief This function returns a reference to member participant_id + * @return Reference to member participant_id + */ +uint32_t& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::participant_id() +{ + return m_participant_id; +} + +/*! + * @brief This function sets a value in member target_game_time + * @param _target_game_time New value for member target_game_time + */ +void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::target_game_time( + double _target_game_time) +{ + m_target_game_time = _target_game_time; +} + +/*! + * @brief This function returns the value of member target_game_time + * @return Value of member target_game_time + */ +double carla_msgs::msg::CarlaSynchronizationWindowParticipantState::target_game_time() const +{ + return m_target_game_time; +} + +/*! + * @brief This function returns a reference to member target_game_time + * @return Reference to member target_game_time + */ +double& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::target_game_time() +{ + return m_target_game_time; +} + + +size_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaSynchronizationWindowParticipantState::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h new file mode 100644 index 00000000000..75431586354 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h @@ -0,0 +1,256 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowParticipantState.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaSynchronizationWindowParticipantState_SOURCE) +#define CarlaSynchronizationWindowParticipantState_DllAPI __declspec( dllexport ) +#else +#define CarlaSynchronizationWindowParticipantState_DllAPI __declspec( dllimport ) +#endif // CarlaSynchronizationWindowParticipantState_SOURCE +#else +#define CarlaSynchronizationWindowParticipantState_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaSynchronizationWindowParticipantState_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaSynchronizationWindowParticipantState defined by the user in the IDL file. + * @ingroup CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE + */ + class CarlaSynchronizationWindowParticipantState + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaSynchronizationWindowParticipantState(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState( + const CarlaSynchronizationWindowParticipantState& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState( + CarlaSynchronizationWindowParticipantState&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState& operator =( + const CarlaSynchronizationWindowParticipantState& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState& operator =( + CarlaSynchronizationWindowParticipantState&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaSynchronizationWindowParticipantState object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaSynchronizationWindowParticipantState& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaSynchronizationWindowParticipantState object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaSynchronizationWindowParticipantState& x) const; + + /*! + * @brief This function copies the value in member client_id + * @param _client_id New value to be copied in member client_id + */ + eProsima_user_DllExport void client_id( + const std::string& _client_id); + + /*! + * @brief This function moves the value in member client_id + * @param _client_id New value to be moved in member client_id + */ + eProsima_user_DllExport void client_id( + std::string&& _client_id); + + /*! + * @brief This function returns a constant reference to member client_id + * @return Constant reference to member client_id + */ + eProsima_user_DllExport const std::string& client_id() const; + + /*! + * @brief This function returns a reference to member client_id + * @return Reference to member client_id + */ + eProsima_user_DllExport std::string& client_id(); + /*! + * @brief This function sets a value in member participant_id + * @param _participant_id New value for member participant_id + */ + eProsima_user_DllExport void participant_id( + uint32_t _participant_id); + + /*! + * @brief This function returns the value of member participant_id + * @return Value of member participant_id + */ + eProsima_user_DllExport uint32_t participant_id() const; + + /*! + * @brief This function returns a reference to member participant_id + * @return Reference to member participant_id + */ + eProsima_user_DllExport uint32_t& participant_id(); + + /*! + * @brief This function sets a value in member target_game_time + * @param _target_game_time New value for member target_game_time + */ + eProsima_user_DllExport void target_game_time( + double _target_game_time); + + /*! + * @brief This function returns the value of member target_game_time + * @return Value of member target_game_time + */ + eProsima_user_DllExport double target_game_time() const; + + /*! + * @brief This function returns a reference to member target_game_time + * @return Reference to member target_game_time + */ + eProsima_user_DllExport double& target_game_time(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::string m_client_id; + uint32_t m_participant_id; + double m_target_game_time; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.cxx new file mode 100644 index 00000000000..0df7f36926b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowParticipantStatePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaSynchronizationWindowParticipantStatePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaSynchronizationWindowParticipantStatePubSubType::CarlaSynchronizationWindowParticipantStatePubSubType() + { + setName("carla_msgs::msg::dds_::CarlaSynchronizationWindowParticipantState_"); + auto type_size = CarlaSynchronizationWindowParticipantState::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaSynchronizationWindowParticipantState::isKeyDefined(); + size_t keyLength = CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize() > 16 ? + CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaSynchronizationWindowParticipantStatePubSubType::~CarlaSynchronizationWindowParticipantStatePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaSynchronizationWindowParticipantStatePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaSynchronizationWindowParticipantState* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaSynchronizationWindowParticipantStatePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaSynchronizationWindowParticipantState* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaSynchronizationWindowParticipantStatePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaSynchronizationWindowParticipantStatePubSubType::createData() + { + return reinterpret_cast(new CarlaSynchronizationWindowParticipantState()); + } + + void CarlaSynchronizationWindowParticipantStatePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaSynchronizationWindowParticipantStatePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaSynchronizationWindowParticipantState* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.h new file mode 100644 index 00000000000..13850848bc3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowParticipantStatePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaSynchronizationWindowParticipantState.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaSynchronizationWindowParticipantState is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaSynchronizationWindowParticipantState defined by the user in the IDL file. + * @ingroup CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE + */ + class CarlaSynchronizationWindowParticipantStatePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaSynchronizationWindowParticipantState type; + + eProsima_user_DllExport CarlaSynchronizationWindowParticipantStatePubSubType(); + + eProsima_user_DllExport virtual ~CarlaSynchronizationWindowParticipantStatePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.cxx new file mode 100644 index 00000000000..f3b17091359 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaSynchronizationWindowPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaSynchronizationWindowPubSubType::CarlaSynchronizationWindowPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaSynchronizationWindow_"); + auto type_size = CarlaSynchronizationWindow::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaSynchronizationWindow::isKeyDefined(); + size_t keyLength = CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize() > 16 ? + CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaSynchronizationWindowPubSubType::~CarlaSynchronizationWindowPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaSynchronizationWindowPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaSynchronizationWindow* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaSynchronizationWindowPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaSynchronizationWindow* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaSynchronizationWindowPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaSynchronizationWindowPubSubType::createData() + { + return reinterpret_cast(new CarlaSynchronizationWindow()); + } + + void CarlaSynchronizationWindowPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaSynchronizationWindowPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaSynchronizationWindow* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h new file mode 100644 index 00000000000..450288b0418 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaSynchronizationWindow.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaSynchronizationWindow is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaSynchronizationWindow defined by the user in the IDL file. + * @ingroup CARLASYNCHRONIZATIONWINDOW + */ + class CarlaSynchronizationWindowPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaSynchronizationWindow type; + + eProsima_user_DllExport CarlaSynchronizationWindowPubSubType(); + + eProsima_user_DllExport virtual ~CarlaSynchronizationWindowPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaSynchronizationWindow(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.cxx new file mode 100644 index 00000000000..843647e1e29 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.cxx @@ -0,0 +1,281 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfo.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaTrafficLightInfo.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaTrafficLightInfo::CarlaTrafficLightInfo() +{ + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f8e8894 + m_id = 0; + // m_transform com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3cfdd820 + + // m_trigger_volume com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@928763c + + +} + +carla_msgs::msg::CarlaTrafficLightInfo::~CarlaTrafficLightInfo() +{ + + +} + +carla_msgs::msg::CarlaTrafficLightInfo::CarlaTrafficLightInfo( + const CarlaTrafficLightInfo& x) +{ + m_id = x.m_id; + m_transform = x.m_transform; + m_trigger_volume = x.m_trigger_volume; +} + +carla_msgs::msg::CarlaTrafficLightInfo::CarlaTrafficLightInfo( + CarlaTrafficLightInfo&& x) +{ + m_id = x.m_id; + m_transform = std::move(x.m_transform); + m_trigger_volume = std::move(x.m_trigger_volume); +} + +carla_msgs::msg::CarlaTrafficLightInfo& carla_msgs::msg::CarlaTrafficLightInfo::operator =( + const CarlaTrafficLightInfo& x) +{ + + m_id = x.m_id; + m_transform = x.m_transform; + m_trigger_volume = x.m_trigger_volume; + + return *this; +} + +carla_msgs::msg::CarlaTrafficLightInfo& carla_msgs::msg::CarlaTrafficLightInfo::operator =( + CarlaTrafficLightInfo&& x) +{ + + m_id = x.m_id; + m_transform = std::move(x.m_transform); + m_trigger_volume = std::move(x.m_trigger_volume); + + return *this; +} + +bool carla_msgs::msg::CarlaTrafficLightInfo::operator ==( + const CarlaTrafficLightInfo& x) const +{ + + return (m_id == x.m_id && m_transform == x.m_transform && m_trigger_volume == x.m_trigger_volume); +} + +bool carla_msgs::msg::CarlaTrafficLightInfo::operator !=( + const CarlaTrafficLightInfo& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaTrafficLightInfo::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Pose::getMaxCdrSerializedSize(current_alignment); + current_alignment += carla_msgs::msg::CarlaBoundingBox::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaTrafficLightInfo::getCdrSerializedSize( + const carla_msgs::msg::CarlaTrafficLightInfo& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.transform(), current_alignment); + current_alignment += carla_msgs::msg::CarlaBoundingBox::getCdrSerializedSize(data.trigger_volume(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaTrafficLightInfo::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_id; + scdr << m_transform; + scdr << m_trigger_volume; + +} + +void carla_msgs::msg::CarlaTrafficLightInfo::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_id; + dcdr >> m_transform; + dcdr >> m_trigger_volume; +} + +/*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ +void carla_msgs::msg::CarlaTrafficLightInfo::id( + uint32_t _id) +{ + m_id = _id; +} + +/*! + * @brief This function returns the value of member id + * @return Value of member id + */ +uint32_t carla_msgs::msg::CarlaTrafficLightInfo::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +uint32_t& carla_msgs::msg::CarlaTrafficLightInfo::id() +{ + return m_id; +} + +/*! + * @brief This function copies the value in member transform + * @param _transform New value to be copied in member transform + */ +void carla_msgs::msg::CarlaTrafficLightInfo::transform( + const geometry_msgs::msg::Pose& _transform) +{ + m_transform = _transform; +} + +/*! + * @brief This function moves the value in member transform + * @param _transform New value to be moved in member transform + */ +void carla_msgs::msg::CarlaTrafficLightInfo::transform( + geometry_msgs::msg::Pose&& _transform) +{ + m_transform = std::move(_transform); +} + +/*! + * @brief This function returns a constant reference to member transform + * @return Constant reference to member transform + */ +const geometry_msgs::msg::Pose& carla_msgs::msg::CarlaTrafficLightInfo::transform() const +{ + return m_transform; +} + +/*! + * @brief This function returns a reference to member transform + * @return Reference to member transform + */ +geometry_msgs::msg::Pose& carla_msgs::msg::CarlaTrafficLightInfo::transform() +{ + return m_transform; +} +/*! + * @brief This function copies the value in member trigger_volume + * @param _trigger_volume New value to be copied in member trigger_volume + */ +void carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume( + const carla_msgs::msg::CarlaBoundingBox& _trigger_volume) +{ + m_trigger_volume = _trigger_volume; +} + +/*! + * @brief This function moves the value in member trigger_volume + * @param _trigger_volume New value to be moved in member trigger_volume + */ +void carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume( + carla_msgs::msg::CarlaBoundingBox&& _trigger_volume) +{ + m_trigger_volume = std::move(_trigger_volume); +} + +/*! + * @brief This function returns a constant reference to member trigger_volume + * @return Constant reference to member trigger_volume + */ +const carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume() const +{ + return m_trigger_volume; +} + +/*! + * @brief This function returns a reference to member trigger_volume + * @return Reference to member trigger_volume + */ +carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume() +{ + return m_trigger_volume; +} + +size_t carla_msgs::msg::CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaTrafficLightInfo::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaTrafficLightInfo::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/PointField.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.h similarity index 50% rename from LibCarla/source/carla/ros2/types/PointField.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.h index 16be2f69924..79a8363dc7a 100644 --- a/LibCarla/source/carla/ros2/types/PointField.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.h @@ -13,16 +13,17 @@ // limitations under the License. /*! - * @file PointField.h + * @file CarlaTrafficLightInfo.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_H_ -#include +#include "carla_msgs/msg/CarlaBoundingBox.h" +#include "geometry_msgs/msg/Pose.h" #include #include @@ -43,16 +44,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PointField_SOURCE) -#define PointField_DllAPI __declspec( dllexport ) +#if defined(CarlaTrafficLightInfo_SOURCE) +#define CarlaTrafficLightInfo_DllAPI __declspec( dllexport ) #else -#define PointField_DllAPI __declspec( dllimport ) -#endif // PointField_SOURCE +#define CarlaTrafficLightInfo_DllAPI __declspec( dllimport ) +#endif // CarlaTrafficLightInfo_SOURCE #else -#define PointField_DllAPI +#define CarlaTrafficLightInfo_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PointField_DllAPI +#define CarlaTrafficLightInfo_DllAPI #endif // _WIN32 namespace eprosima { @@ -61,165 +62,145 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace sensor_msgs { - namespace msg { - const uint8_t PointField__INT8 = 1; - const uint8_t PointField__UINT8 = 2; - const uint8_t PointField__INT16 = 3; - const uint8_t PointField__UINT16 = 4; - const uint8_t PointField__INT32 = 5; - const uint8_t PointField__UINT32 = 6; - const uint8_t PointField__FLOAT32 = 7; - const uint8_t PointField__FLOAT64 = 8; +namespace carla_msgs { + namespace msg { /*! - * @brief This class represents the structure PointField defined by the user in the IDL file. - * @ingroup POINTFIELD + * @brief This class represents the structure CarlaTrafficLightInfo defined by the user in the IDL file. + * @ingroup CARLATRAFFICLIGHTINFO */ - class PointField + class CarlaTrafficLightInfo { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport PointField(); + eProsima_user_DllExport CarlaTrafficLightInfo(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~PointField(); + eProsima_user_DllExport ~CarlaTrafficLightInfo(); /*! * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. */ - eProsima_user_DllExport PointField( - const PointField& x); + eProsima_user_DllExport CarlaTrafficLightInfo( + const CarlaTrafficLightInfo& x); /*! * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. */ - eProsima_user_DllExport PointField( - PointField&& x) noexcept; + eProsima_user_DllExport CarlaTrafficLightInfo( + CarlaTrafficLightInfo&& x); /*! * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. */ - eProsima_user_DllExport PointField& operator =( - const PointField& x); + eProsima_user_DllExport CarlaTrafficLightInfo& operator =( + const CarlaTrafficLightInfo& x); /*! * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. */ - eProsima_user_DllExport PointField& operator =( - PointField&& x) noexcept; + eProsima_user_DllExport CarlaTrafficLightInfo& operator =( + CarlaTrafficLightInfo&& x); /*! * @brief Comparison operator. - * @param x sensor_msgs::msg::PointField object to compare. + * @param x carla_msgs::msg::CarlaTrafficLightInfo object to compare. */ eProsima_user_DllExport bool operator ==( - const PointField& x) const; + const CarlaTrafficLightInfo& x) const; /*! * @brief Comparison operator. - * @param x sensor_msgs::msg::PointField object to compare. + * @param x carla_msgs::msg::CarlaTrafficLightInfo object to compare. */ eProsima_user_DllExport bool operator !=( - const PointField& x) const; + const CarlaTrafficLightInfo& x) const; /*! - * @brief This function copies the value in member name - * @param _name New value to be copied in member name + * @brief This function sets a value in member id + * @param _id New value for member id */ - eProsima_user_DllExport void name( - const std::string& _name); + eProsima_user_DllExport void id( + uint32_t _id); /*! - * @brief This function moves the value in member name - * @param _name New value to be moved in member name + * @brief This function returns the value of member id + * @return Value of member id */ - eProsima_user_DllExport void name( - std::string&& _name); + eProsima_user_DllExport uint32_t id() const; /*! - * @brief This function returns a constant reference to member name - * @return Constant reference to member name + * @brief This function returns a reference to member id + * @return Reference to member id */ - eProsima_user_DllExport const std::string& name() const; + eProsima_user_DllExport uint32_t& id(); /*! - * @brief This function returns a reference to member name - * @return Reference to member name - */ - eProsima_user_DllExport std::string& name(); - /*! - * @brief This function sets a value in member offset - * @param _offset New value for member offset + * @brief This function copies the value in member transform + * @param _transform New value to be copied in member transform */ - eProsima_user_DllExport void offset( - uint32_t _offset); + eProsima_user_DllExport void transform( + const geometry_msgs::msg::Pose& _transform); /*! - * @brief This function returns the value of member offset - * @return Value of member offset + * @brief This function moves the value in member transform + * @param _transform New value to be moved in member transform */ - eProsima_user_DllExport uint32_t offset() const; + eProsima_user_DllExport void transform( + geometry_msgs::msg::Pose&& _transform); /*! - * @brief This function returns a reference to member offset - * @return Reference to member offset + * @brief This function returns a constant reference to member transform + * @return Constant reference to member transform */ - eProsima_user_DllExport uint32_t& offset(); + eProsima_user_DllExport const geometry_msgs::msg::Pose& transform() const; /*! - * @brief This function sets a value in member datatype - * @param _datatype New value for member datatype + * @brief This function returns a reference to member transform + * @return Reference to member transform */ - eProsima_user_DllExport void datatype( - uint8_t _datatype); - + eProsima_user_DllExport geometry_msgs::msg::Pose& transform(); /*! - * @brief This function returns the value of member datatype - * @return Value of member datatype + * @brief This function copies the value in member trigger_volume + * @param _trigger_volume New value to be copied in member trigger_volume */ - eProsima_user_DllExport uint8_t datatype() const; + eProsima_user_DllExport void trigger_volume( + const carla_msgs::msg::CarlaBoundingBox& _trigger_volume); /*! - * @brief This function returns a reference to member datatype - * @return Reference to member datatype + * @brief This function moves the value in member trigger_volume + * @param _trigger_volume New value to be moved in member trigger_volume */ - eProsima_user_DllExport uint8_t& datatype(); + eProsima_user_DllExport void trigger_volume( + carla_msgs::msg::CarlaBoundingBox&& _trigger_volume); /*! - * @brief This function sets a value in member count - * @param _count New value for member count + * @brief This function returns a constant reference to member trigger_volume + * @return Constant reference to member trigger_volume */ - eProsima_user_DllExport void count( - uint32_t _count); + eProsima_user_DllExport const carla_msgs::msg::CarlaBoundingBox& trigger_volume() const; /*! - * @brief This function returns the value of member count - * @return Value of member count + * @brief This function returns a reference to member trigger_volume + * @return Reference to member trigger_volume */ - eProsima_user_DllExport uint32_t count() const; + eProsima_user_DllExport carla_msgs::msg::CarlaBoundingBox& trigger_volume(); /*! - * @brief This function returns a reference to member count - * @return Reference to member count + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. */ - eProsima_user_DllExport uint32_t& count(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -230,9 +211,10 @@ namespace sensor_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const sensor_msgs::msg::PointField& data, + const carla_msgs::msg::CarlaTrafficLightInfo& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -247,6 +229,8 @@ namespace sensor_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -269,13 +253,12 @@ namespace sensor_msgs { eprosima::fastcdr::Cdr& cdr) const; private: - std::string m_name; - uint32_t m_offset; - uint8_t m_datatype; - uint32_t m_count; + uint32_t m_id; + geometry_msgs::msg::Pose m_transform; + carla_msgs::msg::CarlaBoundingBox m_trigger_volume; }; } // namespace msg -} // namespace sensor_msgs +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.cxx new file mode 100644 index 00000000000..1880ab1b645 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.cxx @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoList.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaTrafficLightInfoList.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaTrafficLightInfoList::CarlaTrafficLightInfoList() +{ + // m_traffic_lights com.eprosima.idl.parser.typecode.SequenceTypeCode@7ba8c737 + + +} + +carla_msgs::msg::CarlaTrafficLightInfoList::~CarlaTrafficLightInfoList() +{ +} + +carla_msgs::msg::CarlaTrafficLightInfoList::CarlaTrafficLightInfoList( + const CarlaTrafficLightInfoList& x) +{ + m_traffic_lights = x.m_traffic_lights; +} + +carla_msgs::msg::CarlaTrafficLightInfoList::CarlaTrafficLightInfoList( + CarlaTrafficLightInfoList&& x) +{ + m_traffic_lights = std::move(x.m_traffic_lights); +} + +carla_msgs::msg::CarlaTrafficLightInfoList& carla_msgs::msg::CarlaTrafficLightInfoList::operator =( + const CarlaTrafficLightInfoList& x) +{ + + m_traffic_lights = x.m_traffic_lights; + + return *this; +} + +carla_msgs::msg::CarlaTrafficLightInfoList& carla_msgs::msg::CarlaTrafficLightInfoList::operator =( + CarlaTrafficLightInfoList&& x) +{ + + m_traffic_lights = std::move(x.m_traffic_lights); + + return *this; +} + +bool carla_msgs::msg::CarlaTrafficLightInfoList::operator ==( + const CarlaTrafficLightInfoList& x) const +{ + + return (m_traffic_lights == x.m_traffic_lights); +} + +bool carla_msgs::msg::CarlaTrafficLightInfoList::operator !=( + const CarlaTrafficLightInfoList& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaTrafficLightInfoList::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaTrafficLightInfo::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaTrafficLightInfoList::getCdrSerializedSize( + const carla_msgs::msg::CarlaTrafficLightInfoList& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.traffic_lights().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaTrafficLightInfo::getCdrSerializedSize(data.traffic_lights().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaTrafficLightInfoList::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_traffic_lights; +} + +void carla_msgs::msg::CarlaTrafficLightInfoList::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_traffic_lights;} + +/*! + * @brief This function copies the value in member traffic_lights + * @param _traffic_lights New value to be copied in member traffic_lights + */ +void carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights( + const std::vector& _traffic_lights) +{ + m_traffic_lights = _traffic_lights; +} + +/*! + * @brief This function moves the value in member traffic_lights + * @param _traffic_lights New value to be moved in member traffic_lights + */ +void carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights( + std::vector&& _traffic_lights) +{ + m_traffic_lights = std::move(_traffic_lights); +} + +/*! + * @brief This function returns a constant reference to member traffic_lights + * @return Constant reference to member traffic_lights + */ +const std::vector& carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights() const +{ + return m_traffic_lights; +} + +/*! + * @brief This function returns a reference to member traffic_lights + * @return Reference to member traffic_lights + */ +std::vector& carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights() +{ + return m_traffic_lights; +} + +size_t carla_msgs::msg::CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaTrafficLightInfoList::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaTrafficLightInfoList::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.h new file mode 100644 index 00000000000..60700da478b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoList.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_H_ + +#include "carla_msgs/msg/CarlaTrafficLightInfo.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaTrafficLightInfoList_SOURCE) +#define CarlaTrafficLightInfoList_DllAPI __declspec( dllexport ) +#else +#define CarlaTrafficLightInfoList_DllAPI __declspec( dllimport ) +#endif // CarlaTrafficLightInfoList_SOURCE +#else +#define CarlaTrafficLightInfoList_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaTrafficLightInfoList_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaTrafficLightInfoList defined by the user in the IDL file. + * @ingroup CARLATRAFFICLIGHTINFOLIST + */ + class CarlaTrafficLightInfoList + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaTrafficLightInfoList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList( + const CarlaTrafficLightInfoList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList( + CarlaTrafficLightInfoList&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList& operator =( + const CarlaTrafficLightInfoList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList& operator =( + CarlaTrafficLightInfoList&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightInfoList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaTrafficLightInfoList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightInfoList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaTrafficLightInfoList& x) const; + + /*! + * @brief This function copies the value in member traffic_lights + * @param _traffic_lights New value to be copied in member traffic_lights + */ + eProsima_user_DllExport void traffic_lights( + const std::vector& _traffic_lights); + + /*! + * @brief This function moves the value in member traffic_lights + * @param _traffic_lights New value to be moved in member traffic_lights + */ + eProsima_user_DllExport void traffic_lights( + std::vector&& _traffic_lights); + + /*! + * @brief This function returns a constant reference to member traffic_lights + * @return Constant reference to member traffic_lights + */ + eProsima_user_DllExport const std::vector& traffic_lights() const; + + /*! + * @brief This function returns a reference to member traffic_lights + * @return Reference to member traffic_lights + */ + eProsima_user_DllExport std::vector& traffic_lights(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaTrafficLightInfoList& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_traffic_lights; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.cxx new file mode 100644 index 00000000000..c2ac4109ae0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoListPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaTrafficLightInfoListPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaTrafficLightInfoListPubSubType::CarlaTrafficLightInfoListPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaTrafficLightInfoList_"); + auto type_size = CarlaTrafficLightInfoList::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaTrafficLightInfoList::isKeyDefined(); + size_t keyLength = CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize() > 16 ? + CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaTrafficLightInfoListPubSubType::~CarlaTrafficLightInfoListPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaTrafficLightInfoListPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaTrafficLightInfoList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaTrafficLightInfoListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaTrafficLightInfoList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaTrafficLightInfoListPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaTrafficLightInfoListPubSubType::createData() + { + return reinterpret_cast(new CarlaTrafficLightInfoList()); + } + + void CarlaTrafficLightInfoListPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaTrafficLightInfoListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaTrafficLightInfoList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h new file mode 100644 index 00000000000..e6b2ebe2ca6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoListPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaTrafficLightInfoList.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaTrafficLightInfoList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaTrafficLightInfoList defined by the user in the IDL file. + * @ingroup CARLATRAFFICLIGHTINFOLIST + */ + class CarlaTrafficLightInfoListPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaTrafficLightInfoList type; + + eProsima_user_DllExport CarlaTrafficLightInfoListPubSubType(); + + eProsima_user_DllExport virtual ~CarlaTrafficLightInfoListPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.cxx new file mode 100644 index 00000000000..d371004b517 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaTrafficLightInfoPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaTrafficLightInfoPubSubType::CarlaTrafficLightInfoPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaTrafficLightInfo_"); + auto type_size = CarlaTrafficLightInfo::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaTrafficLightInfo::isKeyDefined(); + size_t keyLength = CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize() > 16 ? + CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaTrafficLightInfoPubSubType::~CarlaTrafficLightInfoPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaTrafficLightInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaTrafficLightInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaTrafficLightInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaTrafficLightInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaTrafficLightInfoPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaTrafficLightInfoPubSubType::createData() + { + return reinterpret_cast(new CarlaTrafficLightInfo()); + } + + void CarlaTrafficLightInfoPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaTrafficLightInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaTrafficLightInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h new file mode 100644 index 00000000000..8bbaff04a96 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaTrafficLightInfo.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaTrafficLightInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaTrafficLightInfo defined by the user in the IDL file. + * @ingroup CARLATRAFFICLIGHTINFO + */ + class CarlaTrafficLightInfoPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaTrafficLightInfo type; + + eProsima_user_DllExport CarlaTrafficLightInfoPubSubType(); + + eProsima_user_DllExport virtual ~CarlaTrafficLightInfoPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaTrafficLightInfo(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.cxx new file mode 100644 index 00000000000..0477dd03897 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.cxx @@ -0,0 +1,282 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatus.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaTrafficLightStatus.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +carla_msgs::msg::CarlaTrafficLightStatus::CarlaTrafficLightStatus() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@37911f88 + + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f1c29b7 + m_id = 0; + // m_state com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4d6025c5 + m_state = 0; + +} + +carla_msgs::msg::CarlaTrafficLightStatus::~CarlaTrafficLightStatus() +{ + + +} + +carla_msgs::msg::CarlaTrafficLightStatus::CarlaTrafficLightStatus( + const CarlaTrafficLightStatus& x) +{ + m_header = x.m_header; + m_id = x.m_id; + m_state = x.m_state; +} + +carla_msgs::msg::CarlaTrafficLightStatus::CarlaTrafficLightStatus( + CarlaTrafficLightStatus&& x) +{ + m_header = std::move(x.m_header); + m_id = x.m_id; + m_state = x.m_state; +} + +carla_msgs::msg::CarlaTrafficLightStatus& carla_msgs::msg::CarlaTrafficLightStatus::operator =( + const CarlaTrafficLightStatus& x) +{ + + m_header = x.m_header; + m_id = x.m_id; + m_state = x.m_state; + + return *this; +} + +carla_msgs::msg::CarlaTrafficLightStatus& carla_msgs::msg::CarlaTrafficLightStatus::operator =( + CarlaTrafficLightStatus&& x) +{ + + m_header = std::move(x.m_header); + m_id = x.m_id; + m_state = x.m_state; + + return *this; +} + +bool carla_msgs::msg::CarlaTrafficLightStatus::operator ==( + const CarlaTrafficLightStatus& x) const +{ + + return (m_header == x.m_header && m_id == x.m_id && m_state == x.m_state); +} + +bool carla_msgs::msg::CarlaTrafficLightStatus::operator !=( + const CarlaTrafficLightStatus& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaTrafficLightStatus::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaTrafficLightStatus::getCdrSerializedSize( + const carla_msgs::msg::CarlaTrafficLightStatus& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaTrafficLightStatus::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_id; + scdr << m_state; + +} + +void carla_msgs::msg::CarlaTrafficLightStatus::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_id; + dcdr >> m_state; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void carla_msgs::msg::CarlaTrafficLightStatus::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void carla_msgs::msg::CarlaTrafficLightStatus::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& carla_msgs::msg::CarlaTrafficLightStatus::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& carla_msgs::msg::CarlaTrafficLightStatus::header() +{ + return m_header; +} +/*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ +void carla_msgs::msg::CarlaTrafficLightStatus::id( + uint32_t _id) +{ + m_id = _id; +} + +/*! + * @brief This function returns the value of member id + * @return Value of member id + */ +uint32_t carla_msgs::msg::CarlaTrafficLightStatus::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +uint32_t& carla_msgs::msg::CarlaTrafficLightStatus::id() +{ + return m_id; +} + +/*! + * @brief This function sets a value in member state + * @param _state New value for member state + */ +void carla_msgs::msg::CarlaTrafficLightStatus::state( + uint8_t _state) +{ + m_state = _state; +} + +/*! + * @brief This function returns the value of member state + * @return Value of member state + */ +uint8_t carla_msgs::msg::CarlaTrafficLightStatus::state() const +{ + return m_state; +} + +/*! + * @brief This function returns a reference to member state + * @return Reference to member state + */ +uint8_t& carla_msgs::msg::CarlaTrafficLightStatus::state() +{ + return m_state; +} + + +size_t carla_msgs::msg::CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaTrafficLightStatus::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaTrafficLightStatus::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/Odometry.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.h similarity index 52% rename from LibCarla/source/carla/ros2/types/Odometry.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.h index fe33619e665..c96d050333c 100644 --- a/LibCarla/source/carla/ros2/types/Odometry.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.h @@ -13,20 +13,16 @@ // limitations under the License. /*! - * @file Odometry.h + * @file CarlaTrafficLightStatus.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ -#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_H_ -#include "PoseWithCovariance.h" -#include "TwistWithCovariance.h" -#include "Header.h" - -#include +#include "std_msgs/msg/Header.h" #include #include @@ -47,16 +43,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Odometry_SOURCE) -#define Odometry_DllAPI __declspec( dllexport ) +#if defined(CarlaTrafficLightStatus_SOURCE) +#define CarlaTrafficLightStatus_DllAPI __declspec( dllexport ) #else -#define Odometry_DllAPI __declspec( dllimport ) -#endif // Odometry_SOURCE +#define CarlaTrafficLightStatus_DllAPI __declspec( dllimport ) +#endif // CarlaTrafficLightStatus_SOURCE #else -#define Odometry_DllAPI +#define CarlaTrafficLightStatus_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Odometry_DllAPI +#define CarlaTrafficLightStatus_DllAPI #endif // _WIN32 namespace eprosima { @@ -65,67 +61,75 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace nav_msgs { + +namespace carla_msgs { namespace msg { + namespace CarlaTrafficLightStatus_Constants { + const uint8_t RED = 0; + const uint8_t YELLOW = 1; + const uint8_t GREEN = 2; + const uint8_t OFF = 3; + const uint8_t UNKNOWN = 4; + } // namespace CarlaTrafficLightStatus_Constants /*! - * @brief This class represents the structure Odometry defined by the user in the IDL file. - * @ingroup ODOMETRY + * @brief This class represents the structure CarlaTrafficLightStatus defined by the user in the IDL file. + * @ingroup CARLATRAFFICLIGHTSTATUS */ - class Odometry + class CarlaTrafficLightStatus { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport Odometry(); + eProsima_user_DllExport CarlaTrafficLightStatus(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Odometry(); + eProsima_user_DllExport ~CarlaTrafficLightStatus(); /*! * @brief Copy constructor. - * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. */ - eProsima_user_DllExport Odometry( - const Odometry& x); + eProsima_user_DllExport CarlaTrafficLightStatus( + const CarlaTrafficLightStatus& x); /*! * @brief Move constructor. - * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. */ - eProsima_user_DllExport Odometry( - Odometry&& x) noexcept; + eProsima_user_DllExport CarlaTrafficLightStatus( + CarlaTrafficLightStatus&& x); /*! * @brief Copy assignment. - * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. */ - eProsima_user_DllExport Odometry& operator =( - const Odometry& x); + eProsima_user_DllExport CarlaTrafficLightStatus& operator =( + const CarlaTrafficLightStatus& x); /*! * @brief Move assignment. - * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. */ - eProsima_user_DllExport Odometry& operator =( - Odometry&& x) noexcept; + eProsima_user_DllExport CarlaTrafficLightStatus& operator =( + CarlaTrafficLightStatus&& x); /*! * @brief Comparison operator. - * @param x nav_msgs::msg::Odometry object to compare. + * @param x carla_msgs::msg::CarlaTrafficLightStatus object to compare. */ eProsima_user_DllExport bool operator ==( - const Odometry& x) const; + const CarlaTrafficLightStatus& x) const; /*! * @brief Comparison operator. - * @param x nav_msgs::msg::Odometry object to compare. + * @param x carla_msgs::msg::CarlaTrafficLightStatus object to compare. */ eProsima_user_DllExport bool operator !=( - const Odometry& x) const; + const CarlaTrafficLightStatus& x) const; /*! * @brief This function copies the value in member header @@ -153,87 +157,50 @@ namespace nav_msgs { */ eProsima_user_DllExport std_msgs::msg::Header& header(); /*! - * @brief This function copies the value in member child_frame_id - * @param _child_frame_id New value to be copied in member child_frame_id - */ - eProsima_user_DllExport void child_frame_id( - const std::string& _child_frame_id); - - /*! - * @brief This function moves the value in member child_frame_id - * @param _child_frame_id New value to be moved in member child_frame_id + * @brief This function sets a value in member id + * @param _id New value for member id */ - eProsima_user_DllExport void child_frame_id( - std::string&& _child_frame_id); + eProsima_user_DllExport void id( + uint32_t _id); /*! - * @brief This function returns a constant reference to member child_frame_id - * @return Constant reference to member child_frame_id + * @brief This function returns the value of member id + * @return Value of member id */ - eProsima_user_DllExport const std::string& child_frame_id() const; + eProsima_user_DllExport uint32_t id() const; /*! - * @brief This function returns a reference to member child_frame_id - * @return Reference to member child_frame_id - */ - eProsima_user_DllExport std::string& child_frame_id(); - /*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose + * @brief This function returns a reference to member id + * @return Reference to member id */ - eProsima_user_DllExport void pose( - const geometry_msgs::msg::PoseWithCovariance& _pose); + eProsima_user_DllExport uint32_t& id(); /*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose + * @brief This function sets a value in member state + * @param _state New value for member state */ - eProsima_user_DllExport void pose( - geometry_msgs::msg::PoseWithCovariance&& _pose); + eProsima_user_DllExport void state( + uint8_t _state); /*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose + * @brief This function returns the value of member state + * @return Value of member state */ - eProsima_user_DllExport const geometry_msgs::msg::PoseWithCovariance& pose() const; + eProsima_user_DllExport uint8_t state() const; /*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ - eProsima_user_DllExport geometry_msgs::msg::PoseWithCovariance& pose(); - /*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist + * @brief This function returns a reference to member state + * @return Reference to member state */ - eProsima_user_DllExport void twist( - const geometry_msgs::msg::TwistWithCovariance& _twist); + eProsima_user_DllExport uint8_t& state(); - /*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ - eProsima_user_DllExport void twist( - geometry_msgs::msg::TwistWithCovariance&& _twist); /*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ - eProsima_user_DllExport const geometry_msgs::msg::TwistWithCovariance& twist() const; - - /*! - * @brief This function returns a reference to member twist - * @return Reference to member twist + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. */ - eProsima_user_DllExport geometry_msgs::msg::TwistWithCovariance& twist(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -244,9 +211,10 @@ namespace nav_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const nav_msgs::msg::Odometry& data, + const carla_msgs::msg::CarlaTrafficLightStatus& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -261,6 +229,8 @@ namespace nav_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -283,12 +253,12 @@ namespace nav_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + std_msgs::msg::Header m_header; - std::string m_child_frame_id; - geometry_msgs::msg::PoseWithCovariance m_pose; - geometry_msgs::msg::TwistWithCovariance m_twist; + uint32_t m_id; + uint8_t m_state; }; } // namespace msg -} // namespace nav_msgs +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.cxx new file mode 100644 index 00000000000..d6d3b2c25cf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.cxx @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusList.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaTrafficLightStatusList.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaTrafficLightStatusList::CarlaTrafficLightStatusList() +{ + // m_traffic_lights com.eprosima.idl.parser.typecode.SequenceTypeCode@5456afaa + + +} + +carla_msgs::msg::CarlaTrafficLightStatusList::~CarlaTrafficLightStatusList() +{ +} + +carla_msgs::msg::CarlaTrafficLightStatusList::CarlaTrafficLightStatusList( + const CarlaTrafficLightStatusList& x) +{ + m_traffic_lights = x.m_traffic_lights; +} + +carla_msgs::msg::CarlaTrafficLightStatusList::CarlaTrafficLightStatusList( + CarlaTrafficLightStatusList&& x) +{ + m_traffic_lights = std::move(x.m_traffic_lights); +} + +carla_msgs::msg::CarlaTrafficLightStatusList& carla_msgs::msg::CarlaTrafficLightStatusList::operator =( + const CarlaTrafficLightStatusList& x) +{ + + m_traffic_lights = x.m_traffic_lights; + + return *this; +} + +carla_msgs::msg::CarlaTrafficLightStatusList& carla_msgs::msg::CarlaTrafficLightStatusList::operator =( + CarlaTrafficLightStatusList&& x) +{ + + m_traffic_lights = std::move(x.m_traffic_lights); + + return *this; +} + +bool carla_msgs::msg::CarlaTrafficLightStatusList::operator ==( + const CarlaTrafficLightStatusList& x) const +{ + + return (m_traffic_lights == x.m_traffic_lights); +} + +bool carla_msgs::msg::CarlaTrafficLightStatusList::operator !=( + const CarlaTrafficLightStatusList& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaTrafficLightStatusList::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaTrafficLightStatus::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaTrafficLightStatusList::getCdrSerializedSize( + const carla_msgs::msg::CarlaTrafficLightStatusList& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.traffic_lights().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaTrafficLightStatus::getCdrSerializedSize(data.traffic_lights().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaTrafficLightStatusList::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_traffic_lights; +} + +void carla_msgs::msg::CarlaTrafficLightStatusList::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_traffic_lights;} + +/*! + * @brief This function copies the value in member traffic_lights + * @param _traffic_lights New value to be copied in member traffic_lights + */ +void carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights( + const std::vector& _traffic_lights) +{ + m_traffic_lights = _traffic_lights; +} + +/*! + * @brief This function moves the value in member traffic_lights + * @param _traffic_lights New value to be moved in member traffic_lights + */ +void carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights( + std::vector&& _traffic_lights) +{ + m_traffic_lights = std::move(_traffic_lights); +} + +/*! + * @brief This function returns a constant reference to member traffic_lights + * @return Constant reference to member traffic_lights + */ +const std::vector& carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights() const +{ + return m_traffic_lights; +} + +/*! + * @brief This function returns a reference to member traffic_lights + * @return Reference to member traffic_lights + */ +std::vector& carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights() +{ + return m_traffic_lights; +} + +size_t carla_msgs::msg::CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaTrafficLightStatusList::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaTrafficLightStatusList::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.h new file mode 100644 index 00000000000..e1a44ccbdc8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusList.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_H_ + +#include "carla_msgs/msg/CarlaTrafficLightStatus.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaTrafficLightStatusList_SOURCE) +#define CarlaTrafficLightStatusList_DllAPI __declspec( dllexport ) +#else +#define CarlaTrafficLightStatusList_DllAPI __declspec( dllimport ) +#endif // CarlaTrafficLightStatusList_SOURCE +#else +#define CarlaTrafficLightStatusList_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaTrafficLightStatusList_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaTrafficLightStatusList defined by the user in the IDL file. + * @ingroup CARLATRAFFICLIGHTSTATUSLIST + */ + class CarlaTrafficLightStatusList + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaTrafficLightStatusList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList( + const CarlaTrafficLightStatusList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList( + CarlaTrafficLightStatusList&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList& operator =( + const CarlaTrafficLightStatusList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList& operator =( + CarlaTrafficLightStatusList&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightStatusList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaTrafficLightStatusList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightStatusList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaTrafficLightStatusList& x) const; + + /*! + * @brief This function copies the value in member traffic_lights + * @param _traffic_lights New value to be copied in member traffic_lights + */ + eProsima_user_DllExport void traffic_lights( + const std::vector& _traffic_lights); + + /*! + * @brief This function moves the value in member traffic_lights + * @param _traffic_lights New value to be moved in member traffic_lights + */ + eProsima_user_DllExport void traffic_lights( + std::vector&& _traffic_lights); + + /*! + * @brief This function returns a constant reference to member traffic_lights + * @return Constant reference to member traffic_lights + */ + eProsima_user_DllExport const std::vector& traffic_lights() const; + + /*! + * @brief This function returns a reference to member traffic_lights + * @return Reference to member traffic_lights + */ + eProsima_user_DllExport std::vector& traffic_lights(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaTrafficLightStatusList& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_traffic_lights; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.cxx new file mode 100644 index 00000000000..d31612840d4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusListPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaTrafficLightStatusListPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaTrafficLightStatusListPubSubType::CarlaTrafficLightStatusListPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaTrafficLightStatusList_"); + auto type_size = CarlaTrafficLightStatusList::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaTrafficLightStatusList::isKeyDefined(); + size_t keyLength = CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize() > 16 ? + CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaTrafficLightStatusListPubSubType::~CarlaTrafficLightStatusListPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaTrafficLightStatusListPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaTrafficLightStatusList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaTrafficLightStatusListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaTrafficLightStatusList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaTrafficLightStatusListPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaTrafficLightStatusListPubSubType::createData() + { + return reinterpret_cast(new CarlaTrafficLightStatusList()); + } + + void CarlaTrafficLightStatusListPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaTrafficLightStatusListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaTrafficLightStatusList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h new file mode 100644 index 00000000000..185f5c53918 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusListPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaTrafficLightStatusList.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaTrafficLightStatusList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaTrafficLightStatusList defined by the user in the IDL file. + * @ingroup CARLATRAFFICLIGHTSTATUSLIST + */ + class CarlaTrafficLightStatusListPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaTrafficLightStatusList type; + + eProsima_user_DllExport CarlaTrafficLightStatusListPubSubType(); + + eProsima_user_DllExport virtual ~CarlaTrafficLightStatusListPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.cxx new file mode 100644 index 00000000000..1f461e58653 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaTrafficLightStatusPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + namespace CarlaTrafficLightStatus_Constants { + + + + + + + } //End of namespace CarlaTrafficLightStatus_Constants + CarlaTrafficLightStatusPubSubType::CarlaTrafficLightStatusPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaTrafficLightStatus_"); + auto type_size = CarlaTrafficLightStatus::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaTrafficLightStatus::isKeyDefined(); + size_t keyLength = CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize() > 16 ? + CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaTrafficLightStatusPubSubType::~CarlaTrafficLightStatusPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaTrafficLightStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaTrafficLightStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaTrafficLightStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaTrafficLightStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaTrafficLightStatusPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaTrafficLightStatusPubSubType::createData() + { + return reinterpret_cast(new CarlaTrafficLightStatus()); + } + + void CarlaTrafficLightStatusPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaTrafficLightStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaTrafficLightStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h new file mode 100644 index 00000000000..b842189b98a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaTrafficLightStatus.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaTrafficLightStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + namespace CarlaTrafficLightStatus_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type CarlaTrafficLightStatus defined by the user in the IDL file. + * @ingroup CARLATRAFFICLIGHTSTATUS + */ + class CarlaTrafficLightStatusPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaTrafficLightStatus type; + + eProsima_user_DllExport CarlaTrafficLightStatusPubSubType(); + + eProsima_user_DllExport virtual ~CarlaTrafficLightStatusPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.cxx new file mode 100644 index 00000000000..1c310bd2a7d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.cxx @@ -0,0 +1,242 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XByteArray.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaV2XByteArray.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + +carla_msgs::msg::CarlaV2XByteArray::CarlaV2XByteArray() +{ + // m_data_size com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1a75e76a + m_data_size = 0; + // m_bytes com.eprosima.idl.parser.typecode.AliasTypeCode@5524cca1 + memset(&m_bytes, 0, (100) * 1); + +} + +carla_msgs::msg::CarlaV2XByteArray::~CarlaV2XByteArray() +{ + +} + +carla_msgs::msg::CarlaV2XByteArray::CarlaV2XByteArray( + const CarlaV2XByteArray& x) +{ + m_data_size = x.m_data_size; + m_bytes = x.m_bytes; +} + +carla_msgs::msg::CarlaV2XByteArray::CarlaV2XByteArray( + CarlaV2XByteArray&& x) +{ + m_data_size = x.m_data_size; + m_bytes = std::move(x.m_bytes); +} + +carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XByteArray::operator =( + const CarlaV2XByteArray& x) +{ + + m_data_size = x.m_data_size; + m_bytes = x.m_bytes; + + return *this; +} + +carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XByteArray::operator =( + CarlaV2XByteArray&& x) +{ + + m_data_size = x.m_data_size; + m_bytes = std::move(x.m_bytes); + + return *this; +} + +bool carla_msgs::msg::CarlaV2XByteArray::operator ==( + const CarlaV2XByteArray& x) const +{ + + return (m_data_size == x.m_data_size && m_bytes == x.m_bytes); +} + +bool carla_msgs::msg::CarlaV2XByteArray::operator !=( + const CarlaV2XByteArray& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaV2XByteArray::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += ((100) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaV2XByteArray::getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XByteArray& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + if ((100) > 0) + { + current_alignment += ((100) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaV2XByteArray::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_data_size; + scdr << m_bytes; + + +} + +void carla_msgs::msg::CarlaV2XByteArray::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_data_size; + dcdr >> m_bytes; + +} + +/*! + * @brief This function sets a value in member data_size + * @param _data_size New value for member data_size + */ +void carla_msgs::msg::CarlaV2XByteArray::data_size( + uint8_t _data_size) +{ + m_data_size = _data_size; +} + +/*! + * @brief This function returns the value of member data_size + * @return Value of member data_size + */ +uint8_t carla_msgs::msg::CarlaV2XByteArray::data_size() const +{ + return m_data_size; +} + +/*! + * @brief This function returns a reference to member data_size + * @return Reference to member data_size + */ +uint8_t& carla_msgs::msg::CarlaV2XByteArray::data_size() +{ + return m_data_size; +} + +/*! + * @brief This function copies the value in member bytes + * @param _bytes New value to be copied in member bytes + */ +void carla_msgs::msg::CarlaV2XByteArray::bytes( + const carla_msgs::msg::octet__100& _bytes) +{ + m_bytes = _bytes; +} + +/*! + * @brief This function moves the value in member bytes + * @param _bytes New value to be moved in member bytes + */ +void carla_msgs::msg::CarlaV2XByteArray::bytes( + carla_msgs::msg::octet__100&& _bytes) +{ + m_bytes = std::move(_bytes); +} + +/*! + * @brief This function returns a constant reference to member bytes + * @return Constant reference to member bytes + */ +const carla_msgs::msg::octet__100& carla_msgs::msg::CarlaV2XByteArray::bytes() const +{ + return m_bytes; +} + +/*! + * @brief This function returns a reference to member bytes + * @return Reference to member bytes + */ +carla_msgs::msg::octet__100& carla_msgs::msg::CarlaV2XByteArray::bytes() +{ + return m_bytes; +} + +size_t carla_msgs::msg::CarlaV2XByteArray::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaV2XByteArray::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaV2XByteArray::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/TF2Error.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.h similarity index 55% rename from LibCarla/source/carla/ros2/types/TF2Error.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.h index 07b5804d4db..2e7ff27a1af 100644 --- a/LibCarla/source/carla/ros2/types/TF2Error.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.h @@ -13,16 +13,15 @@ // limitations under the License. /*! - * @file TF2Error.h + * @file CarlaV2XByteArray.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ -#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_H_ -#include #include #include @@ -43,16 +42,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TF2Error_SOURCE) -#define TF2Error_DllAPI __declspec( dllexport ) +#if defined(CarlaV2XByteArray_SOURCE) +#define CarlaV2XByteArray_DllAPI __declspec( dllexport ) #else -#define TF2Error_DllAPI __declspec( dllimport ) -#endif // TF2Error_SOURCE +#define CarlaV2XByteArray_DllAPI __declspec( dllimport ) +#endif // CarlaV2XByteArray_SOURCE #else -#define TF2Error_DllAPI +#define CarlaV2XByteArray_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TF2Error_DllAPI +#define CarlaV2XByteArray_DllAPI #endif // _WIN32 namespace eprosima { @@ -62,126 +61,120 @@ class Cdr; } // namespace eprosima -namespace tf2_msgs { +namespace carla_msgs { namespace msg { - const uint8_t TF2Error__NO_ERROR = 0; - const uint8_t TF2Error__LOOKUP_ERROR = 1; - const uint8_t TF2Error__CONNECTIVITY_ERROR = 2; - const uint8_t TF2Error__EXTRAPOLATION_ERROR = 3; - const uint8_t TF2Error__INVALID_ARGUMENT_ERROR = 4; - const uint8_t TF2Error__TIMEOUT_ERROR = 5; - const uint8_t TF2Error__TRANSFORM_ERROR = 6; + typedef std::array octet__100; /*! - * @brief This class represents the structure TF2Error defined by the user in the IDL file. - * @ingroup TF2ERROR + * @brief This class represents the structure CarlaV2XByteArray defined by the user in the IDL file. + * @ingroup CARLAV2XBYTEARRAY */ - class TF2Error + class CarlaV2XByteArray { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport TF2Error(); + eProsima_user_DllExport CarlaV2XByteArray(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~TF2Error(); + eProsima_user_DllExport ~CarlaV2XByteArray(); /*! * @brief Copy constructor. - * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. */ - eProsima_user_DllExport TF2Error( - const TF2Error& x); + eProsima_user_DllExport CarlaV2XByteArray( + const CarlaV2XByteArray& x); /*! * @brief Move constructor. - * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. */ - eProsima_user_DllExport TF2Error( - TF2Error&& x) noexcept; + eProsima_user_DllExport CarlaV2XByteArray( + CarlaV2XByteArray&& x); /*! * @brief Copy assignment. - * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. */ - eProsima_user_DllExport TF2Error& operator =( - const TF2Error& x); + eProsima_user_DllExport CarlaV2XByteArray& operator =( + const CarlaV2XByteArray& x); /*! * @brief Move assignment. - * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. */ - eProsima_user_DllExport TF2Error& operator =( - TF2Error&& x) noexcept; + eProsima_user_DllExport CarlaV2XByteArray& operator =( + CarlaV2XByteArray&& x); /*! * @brief Comparison operator. - * @param x tf2_msgs::msg::TF2Error object to compare. + * @param x carla_msgs::msg::CarlaV2XByteArray object to compare. */ eProsima_user_DllExport bool operator ==( - const TF2Error& x) const; + const CarlaV2XByteArray& x) const; /*! * @brief Comparison operator. - * @param x tf2_msgs::msg::TF2Error object to compare. + * @param x carla_msgs::msg::CarlaV2XByteArray object to compare. */ eProsima_user_DllExport bool operator !=( - const TF2Error& x) const; + const CarlaV2XByteArray& x) const; /*! - * @brief This function sets a value in member error - * @param _error New value for member error + * @brief This function sets a value in member data_size + * @param _data_size New value for member data_size */ - eProsima_user_DllExport void error( - uint8_t _error); + eProsima_user_DllExport void data_size( + uint8_t _data_size); /*! - * @brief This function returns the value of member error - * @return Value of member error + * @brief This function returns the value of member data_size + * @return Value of member data_size */ - eProsima_user_DllExport uint8_t error() const; + eProsima_user_DllExport uint8_t data_size() const; /*! - * @brief This function returns a reference to member error - * @return Reference to member error + * @brief This function returns a reference to member data_size + * @return Reference to member data_size */ - eProsima_user_DllExport uint8_t& error(); + eProsima_user_DllExport uint8_t& data_size(); /*! - * @brief This function copies the value in member error_string - * @param _error_string New value to be copied in member error_string + * @brief This function copies the value in member bytes + * @param _bytes New value to be copied in member bytes */ - eProsima_user_DllExport void error_string( - const std::string& _error_string); + eProsima_user_DllExport void bytes( + const carla_msgs::msg::octet__100& _bytes); /*! - * @brief This function moves the value in member error_string - * @param _error_string New value to be moved in member error_string + * @brief This function moves the value in member bytes + * @param _bytes New value to be moved in member bytes */ - eProsima_user_DllExport void error_string( - std::string&& _error_string); + eProsima_user_DllExport void bytes( + carla_msgs::msg::octet__100&& _bytes); /*! - * @brief This function returns a constant reference to member error_string - * @return Constant reference to member error_string + * @brief This function returns a constant reference to member bytes + * @return Constant reference to member bytes */ - eProsima_user_DllExport const std::string& error_string() const; + eProsima_user_DllExport const carla_msgs::msg::octet__100& bytes() const; /*! - * @brief This function returns a reference to member error_string - * @return Reference to member error_string + * @brief This function returns a reference to member bytes + * @return Reference to member bytes */ - eProsima_user_DllExport std::string& error_string(); + eProsima_user_DllExport carla_msgs::msg::octet__100& bytes(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -192,9 +185,10 @@ namespace tf2_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const tf2_msgs::msg::TF2Error& data, + const carla_msgs::msg::CarlaV2XByteArray& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -209,6 +203,8 @@ namespace tf2_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -231,10 +227,11 @@ namespace tf2_msgs { eprosima::fastcdr::Cdr& cdr) const; private: - uint8_t m_error; - std::string m_error_string; + + uint8_t m_data_size; + carla_msgs::msg::octet__100 m_bytes; }; } // namespace msg -} // namespace tf2_msgs +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.cxx new file mode 100644 index 00000000000..7780afaa68f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.cxx @@ -0,0 +1,177 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XByteArrayPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaV2XByteArrayPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + + CarlaV2XByteArrayPubSubType::CarlaV2XByteArrayPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaV2XByteArray_"); + auto type_size = CarlaV2XByteArray::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaV2XByteArray::isKeyDefined(); + size_t keyLength = CarlaV2XByteArray::getKeyMaxCdrSerializedSize() > 16 ? + CarlaV2XByteArray::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaV2XByteArrayPubSubType::~CarlaV2XByteArrayPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaV2XByteArrayPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaV2XByteArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaV2XByteArrayPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaV2XByteArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaV2XByteArrayPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaV2XByteArrayPubSubType::createData() + { + return reinterpret_cast(new CarlaV2XByteArray()); + } + + void CarlaV2XByteArrayPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaV2XByteArrayPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaV2XByteArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaV2XByteArray::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaV2XByteArray::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h new file mode 100644 index 00000000000..e8fa6fafc18 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h @@ -0,0 +1,108 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XByteArrayPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaV2XByteArray.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaV2XByteArray is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + typedef std::array octet__100; + /*! + * @brief This class represents the TopicDataType of the type CarlaV2XByteArray defined by the user in the IDL file. + * @ingroup CARLAV2XBYTEARRAY + */ + class CarlaV2XByteArrayPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaV2XByteArray type; + + eProsima_user_DllExport CarlaV2XByteArrayPubSubType(); + + eProsima_user_DllExport virtual ~CarlaV2XByteArrayPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaV2XByteArray(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.cxx new file mode 100644 index 00000000000..5d9c94909e1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.cxx @@ -0,0 +1,240 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustom.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaV2XCustom.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaV2XCustom::CarlaV2XCustom() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5fdcaa40 + + // m_message com.eprosima.idl.parser.typecode.StringTypeCode@6dc17b83 + m_message =""; + +} + +carla_msgs::msg::CarlaV2XCustom::~CarlaV2XCustom() +{ + +} + +carla_msgs::msg::CarlaV2XCustom::CarlaV2XCustom( + const CarlaV2XCustom& x) +{ + m_header = x.m_header; + m_message = x.m_message; +} + +carla_msgs::msg::CarlaV2XCustom::CarlaV2XCustom( + CarlaV2XCustom&& x) +{ + m_header = std::move(x.m_header); + m_message = std::move(x.m_message); +} + +carla_msgs::msg::CarlaV2XCustom& carla_msgs::msg::CarlaV2XCustom::operator =( + const CarlaV2XCustom& x) +{ + + m_header = x.m_header; + m_message = x.m_message; + + return *this; +} + +carla_msgs::msg::CarlaV2XCustom& carla_msgs::msg::CarlaV2XCustom::operator =( + CarlaV2XCustom&& x) +{ + + m_header = std::move(x.m_header); + m_message = std::move(x.m_message); + + return *this; +} + +bool carla_msgs::msg::CarlaV2XCustom::operator ==( + const CarlaV2XCustom& x) const +{ + + return (m_header == x.m_header && m_message == x.m_message); +} + +bool carla_msgs::msg::CarlaV2XCustom::operator !=( + const CarlaV2XCustom& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaV2XCustom::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaV2XCustom::getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XCustom& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaV2XCustom::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_message; + +} + +void carla_msgs::msg::CarlaV2XCustom::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_message; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void carla_msgs::msg::CarlaV2XCustom::header( + const etsi_its_cam_msgs::msg::ItsPduHeader& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void carla_msgs::msg::CarlaV2XCustom::header( + etsi_its_cam_msgs::msg::ItsPduHeader&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustom::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustom::header() +{ + return m_header; +} +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void carla_msgs::msg::CarlaV2XCustom::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void carla_msgs::msg::CarlaV2XCustom::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& carla_msgs::msg::CarlaV2XCustom::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& carla_msgs::msg::CarlaV2XCustom::message() +{ + return m_message; +} + +size_t carla_msgs::msg::CarlaV2XCustom::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaV2XCustom::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaV2XCustom::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.h new file mode 100644 index 00000000000..e07b55ef863 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustom.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_H_ + +#include "etsi_its_cam_msgs/msg/ItsPduHeader.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaV2XCustom_SOURCE) +#define CarlaV2XCustom_DllAPI __declspec( dllexport ) +#else +#define CarlaV2XCustom_DllAPI __declspec( dllimport ) +#endif // CarlaV2XCustom_SOURCE +#else +#define CarlaV2XCustom_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaV2XCustom_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaV2XCustom defined by the user in the IDL file. + * @ingroup CARLAV2XCUSTOM + */ + class CarlaV2XCustom + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XCustom(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XCustom(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustom that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustom( + const CarlaV2XCustom& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustom that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustom( + CarlaV2XCustom&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustom that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustom& operator =( + const CarlaV2XCustom& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustom that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustom& operator =( + CarlaV2XCustom&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustom object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XCustom& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustom object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XCustom& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const etsi_its_cam_msgs::msg::ItsPduHeader& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + etsi_its_cam_msgs::msg::ItsPduHeader&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ItsPduHeader& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ItsPduHeader& header(); + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XCustom& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::ItsPduHeader m_header; + std::string m_message; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.cxx new file mode 100644 index 00000000000..9c2e642ea8e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomData.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaV2XCustomData.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaV2XCustomData::CarlaV2XCustomData() +{ + // m_power com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6be968ce + m_power = 0.0; + // m_message com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7c37508a + + +} + +carla_msgs::msg::CarlaV2XCustomData::~CarlaV2XCustomData() +{ + +} + +carla_msgs::msg::CarlaV2XCustomData::CarlaV2XCustomData( + const CarlaV2XCustomData& x) +{ + m_power = x.m_power; + m_message = x.m_message; +} + +carla_msgs::msg::CarlaV2XCustomData::CarlaV2XCustomData( + CarlaV2XCustomData&& x) +{ + m_power = x.m_power; + m_message = std::move(x.m_message); +} + +carla_msgs::msg::CarlaV2XCustomData& carla_msgs::msg::CarlaV2XCustomData::operator =( + const CarlaV2XCustomData& x) +{ + + m_power = x.m_power; + m_message = x.m_message; + + return *this; +} + +carla_msgs::msg::CarlaV2XCustomData& carla_msgs::msg::CarlaV2XCustomData::operator =( + CarlaV2XCustomData&& x) +{ + + m_power = x.m_power; + m_message = std::move(x.m_message); + + return *this; +} + +bool carla_msgs::msg::CarlaV2XCustomData::operator ==( + const CarlaV2XCustomData& x) const +{ + + return (m_power == x.m_power && m_message == x.m_message); +} + +bool carla_msgs::msg::CarlaV2XCustomData::operator !=( + const CarlaV2XCustomData& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaV2XCustomData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += carla_msgs::msg::CarlaV2XCustomMessage::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaV2XCustomData::getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XCustomData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += carla_msgs::msg::CarlaV2XCustomMessage::getCdrSerializedSize(data.message(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaV2XCustomData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_power; + scdr << m_message; + +} + +void carla_msgs::msg::CarlaV2XCustomData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_power; + dcdr >> m_message; +} + +/*! + * @brief This function sets a value in member power + * @param _power New value for member power + */ +void carla_msgs::msg::CarlaV2XCustomData::power( + float _power) +{ + m_power = _power; +} + +/*! + * @brief This function returns the value of member power + * @return Value of member power + */ +float carla_msgs::msg::CarlaV2XCustomData::power() const +{ + return m_power; +} + +/*! + * @brief This function returns a reference to member power + * @return Reference to member power + */ +float& carla_msgs::msg::CarlaV2XCustomData::power() +{ + return m_power; +} + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void carla_msgs::msg::CarlaV2XCustomData::message( + const carla_msgs::msg::CarlaV2XCustomMessage& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void carla_msgs::msg::CarlaV2XCustomData::message( + carla_msgs::msg::CarlaV2XCustomMessage&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomData::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomData::message() +{ + return m_message; +} + +size_t carla_msgs::msg::CarlaV2XCustomData::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaV2XCustomData::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaV2XCustomData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.h new file mode 100644 index 00000000000..c41a1ece1d0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.h @@ -0,0 +1,237 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomData.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_H_ + +#include "CarlaV2XCustomMessage.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaV2XCustomData_SOURCE) +#define CarlaV2XCustomData_DllAPI __declspec( dllexport ) +#else +#define CarlaV2XCustomData_DllAPI __declspec( dllimport ) +#endif // CarlaV2XCustomData_SOURCE +#else +#define CarlaV2XCustomData_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaV2XCustomData_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaV2XCustomData defined by the user in the IDL file. + * @ingroup CARLAV2XCUSTOMDATA + */ + class CarlaV2XCustomData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XCustomData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XCustomData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomData( + const CarlaV2XCustomData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomData( + CarlaV2XCustomData&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomData& operator =( + const CarlaV2XCustomData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomData& operator =( + CarlaV2XCustomData&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XCustomData& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XCustomData& x) const; + + /*! + * @brief This function sets a value in member power + * @param _power New value for member power + */ + eProsima_user_DllExport void power( + float _power); + + /*! + * @brief This function returns the value of member power + * @return Value of member power + */ + eProsima_user_DllExport float power() const; + + /*! + * @brief This function returns a reference to member power + * @return Reference to member power + */ + eProsima_user_DllExport float& power(); + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const carla_msgs::msg::CarlaV2XCustomMessage& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + carla_msgs::msg::CarlaV2XCustomMessage&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaV2XCustomMessage& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport carla_msgs::msg::CarlaV2XCustomMessage& message(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XCustomData& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + float m_power; + carla_msgs::msg::CarlaV2XCustomMessage m_message; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.cxx new file mode 100644 index 00000000000..d55fe266e57 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.cxx @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataList.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaV2XCustomDataList.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaV2XCustomDataList::CarlaV2XCustomDataList() +{ + // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@723ca036 + + +} + +carla_msgs::msg::CarlaV2XCustomDataList::~CarlaV2XCustomDataList() +{ +} + +carla_msgs::msg::CarlaV2XCustomDataList::CarlaV2XCustomDataList( + const CarlaV2XCustomDataList& x) +{ + m_data = x.m_data; +} + +carla_msgs::msg::CarlaV2XCustomDataList::CarlaV2XCustomDataList( + CarlaV2XCustomDataList&& x) +{ + m_data = std::move(x.m_data); +} + +carla_msgs::msg::CarlaV2XCustomDataList& carla_msgs::msg::CarlaV2XCustomDataList::operator =( + const CarlaV2XCustomDataList& x) +{ + + m_data = x.m_data; + + return *this; +} + +carla_msgs::msg::CarlaV2XCustomDataList& carla_msgs::msg::CarlaV2XCustomDataList::operator =( + CarlaV2XCustomDataList&& x) +{ + + m_data = std::move(x.m_data); + + return *this; +} + +bool carla_msgs::msg::CarlaV2XCustomDataList::operator ==( + const CarlaV2XCustomDataList& x) const +{ + + return (m_data == x.m_data); +} + +bool carla_msgs::msg::CarlaV2XCustomDataList::operator !=( + const CarlaV2XCustomDataList& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaV2XCustomDataList::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaV2XCustomData::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaV2XCustomDataList::getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XCustomDataList& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.data().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaV2XCustomData::getCdrSerializedSize(data.data().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaV2XCustomDataList::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_data; +} + +void carla_msgs::msg::CarlaV2XCustomDataList::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_data;} + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +void carla_msgs::msg::CarlaV2XCustomDataList::data( + const std::vector& _data) +{ + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +void carla_msgs::msg::CarlaV2XCustomDataList::data( + std::vector&& _data) +{ + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +const std::vector& carla_msgs::msg::CarlaV2XCustomDataList::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +std::vector& carla_msgs::msg::CarlaV2XCustomDataList::data() +{ + return m_data; +} + +size_t carla_msgs::msg::CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaV2XCustomDataList::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaV2XCustomDataList::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.h new file mode 100644 index 00000000000..7a3e80a10fe --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataList.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_H_ + +#include "CarlaV2XCustomData.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaV2XCustomDataList_SOURCE) +#define CarlaV2XCustomDataList_DllAPI __declspec( dllexport ) +#else +#define CarlaV2XCustomDataList_DllAPI __declspec( dllimport ) +#endif // CarlaV2XCustomDataList_SOURCE +#else +#define CarlaV2XCustomDataList_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaV2XCustomDataList_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaV2XCustomDataList defined by the user in the IDL file. + * @ingroup CARLAV2XCUSTOMDATALIST + */ + class CarlaV2XCustomDataList + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XCustomDataList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XCustomDataList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomDataList( + const CarlaV2XCustomDataList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomDataList( + CarlaV2XCustomDataList&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomDataList& operator =( + const CarlaV2XCustomDataList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomDataList& operator =( + CarlaV2XCustomDataList&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomDataList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XCustomDataList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomDataList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XCustomDataList& x) const; + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XCustomDataList& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_data; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.cxx new file mode 100644 index 00000000000..c2886fe3a52 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataListPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaV2XCustomDataListPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaV2XCustomDataListPubSubType::CarlaV2XCustomDataListPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaV2XCustomDataList_"); + auto type_size = CarlaV2XCustomDataList::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaV2XCustomDataList::isKeyDefined(); + size_t keyLength = CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize() > 16 ? + CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaV2XCustomDataListPubSubType::~CarlaV2XCustomDataListPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaV2XCustomDataListPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaV2XCustomDataList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaV2XCustomDataListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaV2XCustomDataList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaV2XCustomDataListPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaV2XCustomDataListPubSubType::createData() + { + return reinterpret_cast(new CarlaV2XCustomDataList()); + } + + void CarlaV2XCustomDataListPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaV2XCustomDataListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaV2XCustomDataList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h new file mode 100644 index 00000000000..fba673efa29 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataListPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaV2XCustomDataList.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaV2XCustomDataList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaV2XCustomDataList defined by the user in the IDL file. + * @ingroup CARLAV2XCUSTOMDATALIST + */ + class CarlaV2XCustomDataListPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaV2XCustomDataList type; + + eProsima_user_DllExport CarlaV2XCustomDataListPubSubType(); + + eProsima_user_DllExport virtual ~CarlaV2XCustomDataListPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.cxx new file mode 100644 index 00000000000..ed8788995cf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaV2XCustomDataPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaV2XCustomDataPubSubType::CarlaV2XCustomDataPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaV2XCustomData_"); + auto type_size = CarlaV2XCustomData::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaV2XCustomData::isKeyDefined(); + size_t keyLength = CarlaV2XCustomData::getKeyMaxCdrSerializedSize() > 16 ? + CarlaV2XCustomData::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaV2XCustomDataPubSubType::~CarlaV2XCustomDataPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaV2XCustomDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaV2XCustomData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaV2XCustomDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaV2XCustomData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaV2XCustomDataPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaV2XCustomDataPubSubType::createData() + { + return reinterpret_cast(new CarlaV2XCustomData()); + } + + void CarlaV2XCustomDataPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaV2XCustomDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaV2XCustomData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaV2XCustomData::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaV2XCustomData::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.h new file mode 100644 index 00000000000..7fc1b67991d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaV2XCustomData.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaV2XCustomData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaV2XCustomData defined by the user in the IDL file. + * @ingroup CARLAV2XCUSTOMDATA + */ + class CarlaV2XCustomDataPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaV2XCustomData type; + + eProsima_user_DllExport CarlaV2XCustomDataPubSubType(); + + eProsima_user_DllExport virtual ~CarlaV2XCustomDataPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaV2XCustomData(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.cxx new file mode 100644 index 00000000000..68d63e62954 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomMessage.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaV2XCustomMessage.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaV2XCustomMessage::CarlaV2XCustomMessage() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3de8f619 + + // m_data com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2ab4bc72 + + +} + +carla_msgs::msg::CarlaV2XCustomMessage::~CarlaV2XCustomMessage() +{ + +} + +carla_msgs::msg::CarlaV2XCustomMessage::CarlaV2XCustomMessage( + const CarlaV2XCustomMessage& x) +{ + m_header = x.m_header; + m_data = x.m_data; +} + +carla_msgs::msg::CarlaV2XCustomMessage::CarlaV2XCustomMessage( + CarlaV2XCustomMessage&& x) +{ + m_header = std::move(x.m_header); + m_data = std::move(x.m_data); +} + +carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomMessage::operator =( + const CarlaV2XCustomMessage& x) +{ + + m_header = x.m_header; + m_data = x.m_data; + + return *this; +} + +carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomMessage::operator =( + CarlaV2XCustomMessage&& x) +{ + + m_header = std::move(x.m_header); + m_data = std::move(x.m_data); + + return *this; +} + +bool carla_msgs::msg::CarlaV2XCustomMessage::operator ==( + const CarlaV2XCustomMessage& x) const +{ + + return (m_header == x.m_header && m_data == x.m_data); +} + +bool carla_msgs::msg::CarlaV2XCustomMessage::operator !=( + const CarlaV2XCustomMessage& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaV2XCustomMessage::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getMaxCdrSerializedSize(current_alignment); + current_alignment += carla_msgs::msg::CarlaV2XByteArray::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaV2XCustomMessage::getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XCustomMessage& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += carla_msgs::msg::CarlaV2XByteArray::getCdrSerializedSize(data.data(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaV2XCustomMessage::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_data; + +} + +void carla_msgs::msg::CarlaV2XCustomMessage::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_data; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void carla_msgs::msg::CarlaV2XCustomMessage::header( + const etsi_its_cam_msgs::msg::ItsPduHeader& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void carla_msgs::msg::CarlaV2XCustomMessage::header( + etsi_its_cam_msgs::msg::ItsPduHeader&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustomMessage::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustomMessage::header() +{ + return m_header; +} +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +void carla_msgs::msg::CarlaV2XCustomMessage::data( + const carla_msgs::msg::CarlaV2XByteArray& _data) +{ + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +void carla_msgs::msg::CarlaV2XCustomMessage::data( + carla_msgs::msg::CarlaV2XByteArray&& _data) +{ + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +const carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XCustomMessage::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XCustomMessage::data() +{ + return m_data; +} + +size_t carla_msgs::msg::CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaV2XCustomMessage::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaV2XCustomMessage::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.h new file mode 100644 index 00000000000..a922fc393a0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomMessage.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_H_ + +#include "etsi_its_cam_msgs/msg/ItsPduHeader.h" +#include "CarlaV2XByteArray.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaV2XCustomMessage_SOURCE) +#define CarlaV2XCustomMessage_DllAPI __declspec( dllexport ) +#else +#define CarlaV2XCustomMessage_DllAPI __declspec( dllimport ) +#endif // CarlaV2XCustomMessage_SOURCE +#else +#define CarlaV2XCustomMessage_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaV2XCustomMessage_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaV2XCustomMessage defined by the user in the IDL file. + * @ingroup CARLAV2XCUSTOMMESSAGE + */ + class CarlaV2XCustomMessage + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XCustomMessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XCustomMessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomMessage( + const CarlaV2XCustomMessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomMessage( + CarlaV2XCustomMessage&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomMessage& operator =( + const CarlaV2XCustomMessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomMessage& operator =( + CarlaV2XCustomMessage&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomMessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XCustomMessage& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomMessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XCustomMessage& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const etsi_its_cam_msgs::msg::ItsPduHeader& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + etsi_its_cam_msgs::msg::ItsPduHeader&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ItsPduHeader& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ItsPduHeader& header(); + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const carla_msgs::msg::CarlaV2XByteArray& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + carla_msgs::msg::CarlaV2XByteArray&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaV2XByteArray& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport carla_msgs::msg::CarlaV2XByteArray& data(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XCustomMessage& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::ItsPduHeader m_header; + carla_msgs::msg::CarlaV2XByteArray m_data; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.cxx new file mode 100644 index 00000000000..873197c3293 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomMessagePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaV2XCustomMessagePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaV2XCustomMessagePubSubType::CarlaV2XCustomMessagePubSubType() + { + setName("carla_msgs::msg::dds_::CarlaV2XCustomMessage_"); + auto type_size = CarlaV2XCustomMessage::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaV2XCustomMessage::isKeyDefined(); + size_t keyLength = CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize() > 16 ? + CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaV2XCustomMessagePubSubType::~CarlaV2XCustomMessagePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaV2XCustomMessagePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaV2XCustomMessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaV2XCustomMessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaV2XCustomMessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaV2XCustomMessagePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaV2XCustomMessagePubSubType::createData() + { + return reinterpret_cast(new CarlaV2XCustomMessage()); + } + + void CarlaV2XCustomMessagePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaV2XCustomMessagePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaV2XCustomMessage* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.h new file mode 100644 index 00000000000..77c8d6cafde --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomMessagePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaV2XCustomMessage.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaV2XCustomMessage is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaV2XCustomMessage defined by the user in the IDL file. + * @ingroup CARLAV2XCUSTOMMESSAGE + */ + class CarlaV2XCustomMessagePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaV2XCustomMessage type; + + eProsima_user_DllExport CarlaV2XCustomMessagePubSubType(); + + eProsima_user_DllExport virtual ~CarlaV2XCustomMessagePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaV2XCustomMessage(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.cxx new file mode 100644 index 00000000000..83520b6d783 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaV2XCustomPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaV2XCustomPubSubType::CarlaV2XCustomPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaV2XCustom_"); + auto type_size = CarlaV2XCustom::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaV2XCustom::isKeyDefined(); + size_t keyLength = CarlaV2XCustom::getKeyMaxCdrSerializedSize() > 16 ? + CarlaV2XCustom::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaV2XCustomPubSubType::~CarlaV2XCustomPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaV2XCustomPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaV2XCustom* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaV2XCustomPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaV2XCustom* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaV2XCustomPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaV2XCustomPubSubType::createData() + { + return reinterpret_cast(new CarlaV2XCustom()); + } + + void CarlaV2XCustomPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaV2XCustomPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaV2XCustom* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaV2XCustom::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaV2XCustom::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.h new file mode 100644 index 00000000000..5f8f40b70fb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaV2XCustom.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaV2XCustom is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaV2XCustom defined by the user in the IDL file. + * @ingroup CARLAV2XCUSTOM + */ + class CarlaV2XCustomPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaV2XCustom type; + + eProsima_user_DllExport CarlaV2XCustomPubSubType(); + + eProsima_user_DllExport virtual ~CarlaV2XCustomPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.cxx new file mode 100644 index 00000000000..d47aa161353 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XData.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaV2XData.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaV2XData::CarlaV2XData() +{ + // m_power com.eprosima.idl.parser.typecode.PrimitiveTypeCode@f1da57d + m_power = 0.0; + // m_message com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@72c8e7b + + +} + +carla_msgs::msg::CarlaV2XData::~CarlaV2XData() +{ + +} + +carla_msgs::msg::CarlaV2XData::CarlaV2XData( + const CarlaV2XData& x) +{ + m_power = x.m_power; + m_message = x.m_message; +} + +carla_msgs::msg::CarlaV2XData::CarlaV2XData( + CarlaV2XData&& x) +{ + m_power = x.m_power; + m_message = std::move(x.m_message); +} + +carla_msgs::msg::CarlaV2XData& carla_msgs::msg::CarlaV2XData::operator =( + const CarlaV2XData& x) +{ + + m_power = x.m_power; + m_message = x.m_message; + + return *this; +} + +carla_msgs::msg::CarlaV2XData& carla_msgs::msg::CarlaV2XData::operator =( + CarlaV2XData&& x) +{ + + m_power = x.m_power; + m_message = std::move(x.m_message); + + return *this; +} + +bool carla_msgs::msg::CarlaV2XData::operator ==( + const CarlaV2XData& x) const +{ + + return (m_power == x.m_power && m_message == x.m_message); +} + +bool carla_msgs::msg::CarlaV2XData::operator !=( + const CarlaV2XData& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaV2XData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += etsi_its_cam_msgs::msg::CAM::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaV2XData::getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += etsi_its_cam_msgs::msg::CAM::getCdrSerializedSize(data.message(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaV2XData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_power; + scdr << m_message; + +} + +void carla_msgs::msg::CarlaV2XData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_power; + dcdr >> m_message; +} + +/*! + * @brief This function sets a value in member power + * @param _power New value for member power + */ +void carla_msgs::msg::CarlaV2XData::power( + float _power) +{ + m_power = _power; +} + +/*! + * @brief This function returns the value of member power + * @return Value of member power + */ +float carla_msgs::msg::CarlaV2XData::power() const +{ + return m_power; +} + +/*! + * @brief This function returns a reference to member power + * @return Reference to member power + */ +float& carla_msgs::msg::CarlaV2XData::power() +{ + return m_power; +} + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void carla_msgs::msg::CarlaV2XData::message( + const etsi_its_cam_msgs::msg::CAM& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void carla_msgs::msg::CarlaV2XData::message( + etsi_its_cam_msgs::msg::CAM&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const etsi_its_cam_msgs::msg::CAM& carla_msgs::msg::CarlaV2XData::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +etsi_its_cam_msgs::msg::CAM& carla_msgs::msg::CarlaV2XData::message() +{ + return m_message; +} + +size_t carla_msgs::msg::CarlaV2XData::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaV2XData::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaV2XData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/NavSatStatus.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.h similarity index 55% rename from LibCarla/source/carla/ros2/types/NavSatStatus.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.h index df69678aee5..55f36360acb 100644 --- a/LibCarla/source/carla/ros2/types/NavSatStatus.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.h @@ -13,16 +13,16 @@ // limitations under the License. /*! - * @file NavSatStatus.h + * @file CarlaV2XData.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_H_ -#include +#include "etsi_its_cam_msgs/msg/CAM.h" #include #include @@ -43,16 +43,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(NavSatStatus_SOURCE) -#define NavSatStatus_DllAPI __declspec( dllexport ) +#if defined(CarlaV2XData_SOURCE) +#define CarlaV2XData_DllAPI __declspec( dllexport ) #else -#define NavSatStatus_DllAPI __declspec( dllimport ) -#endif // NavSatStatus_SOURCE +#define CarlaV2XData_DllAPI __declspec( dllimport ) +#endif // CarlaV2XData_SOURCE #else -#define NavSatStatus_DllAPI +#define CarlaV2XData_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define NavSatStatus_DllAPI +#define CarlaV2XData_DllAPI #endif // _WIN32 namespace eprosima { @@ -61,120 +61,120 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace sensor_msgs { + +namespace carla_msgs { namespace msg { - const uint8_t NavSatStatus__STATUS_NO_FIX = 255; - const uint8_t NavSatStatus__STATUS_FIX = 0; - const uint8_t NavSatStatus__STATUS_SBAS_FIX = 1; - const uint8_t NavSatStatus__STATUS_GBAS_FIX = 2; - const uint16_t NavSatStatus__SERVICE_GPS = 1; - const uint16_t NavSatStatus__SERVICE_GLONASS = 2; - const uint16_t NavSatStatus__SERVICE_COMPASS = 4; - const uint16_t NavSatStatus__SERVICE_GALILEO = 8; /*! - * @brief This class represents the structure NavSatStatus defined by the user in the IDL file. - * @ingroup NAVSATSTATUS + * @brief This class represents the structure CarlaV2XData defined by the user in the IDL file. + * @ingroup CARLAV2XDATA */ - class NavSatStatus + class CarlaV2XData { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport NavSatStatus(); + eProsima_user_DllExport CarlaV2XData(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~NavSatStatus(); + eProsima_user_DllExport ~CarlaV2XData(); /*! * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. */ - eProsima_user_DllExport NavSatStatus( - const NavSatStatus& x); + eProsima_user_DllExport CarlaV2XData( + const CarlaV2XData& x); /*! * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. */ - eProsima_user_DllExport NavSatStatus( - NavSatStatus&& x) noexcept; + eProsima_user_DllExport CarlaV2XData( + CarlaV2XData&& x); /*! * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. */ - eProsima_user_DllExport NavSatStatus& operator =( - const NavSatStatus& x); + eProsima_user_DllExport CarlaV2XData& operator =( + const CarlaV2XData& x); /*! * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. */ - eProsima_user_DllExport NavSatStatus& operator =( - NavSatStatus&& x) noexcept; + eProsima_user_DllExport CarlaV2XData& operator =( + CarlaV2XData&& x); /*! * @brief Comparison operator. - * @param x sensor_msgs::msg::NavSatStatus object to compare. + * @param x carla_msgs::msg::CarlaV2XData object to compare. */ eProsima_user_DllExport bool operator ==( - const NavSatStatus& x) const; + const CarlaV2XData& x) const; /*! * @brief Comparison operator. - * @param x sensor_msgs::msg::NavSatStatus object to compare. + * @param x carla_msgs::msg::CarlaV2XData object to compare. */ eProsima_user_DllExport bool operator !=( - const NavSatStatus& x) const; + const CarlaV2XData& x) const; + + /*! + * @brief This function sets a value in member power + * @param _power New value for member power + */ + eProsima_user_DllExport void power( + float _power); /*! - * @brief This function sets a value in member status - * @param _status New value for member status + * @brief This function returns the value of member power + * @return Value of member power */ - eProsima_user_DllExport void status( - uint8_t _status); + eProsima_user_DllExport float power() const; /*! - * @brief This function returns the value of member status - * @return Value of member status + * @brief This function returns a reference to member power + * @return Reference to member power */ - eProsima_user_DllExport uint8_t status() const; + eProsima_user_DllExport float& power(); /*! - * @brief This function returns a reference to member status - * @return Reference to member status + * @brief This function copies the value in member message + * @param _message New value to be copied in member message */ - eProsima_user_DllExport uint8_t& status(); + eProsima_user_DllExport void message( + const etsi_its_cam_msgs::msg::CAM& _message); /*! - * @brief This function sets a value in member service - * @param _service New value for member service + * @brief This function moves the value in member message + * @param _message New value to be moved in member message */ - eProsima_user_DllExport void service( - uint16_t _service); + eProsima_user_DllExport void message( + etsi_its_cam_msgs::msg::CAM&& _message); /*! - * @brief This function returns the value of member service - * @return Value of member service + * @brief This function returns a constant reference to member message + * @return Constant reference to member message */ - eProsima_user_DllExport uint16_t service() const; + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CAM& message() const; /*! - * @brief This function returns a reference to member service - * @return Reference to member service + * @brief This function returns a reference to member message + * @return Reference to member message */ - eProsima_user_DllExport uint16_t& service(); + eProsima_user_DllExport etsi_its_cam_msgs::msg::CAM& message(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -185,9 +185,10 @@ namespace sensor_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const sensor_msgs::msg::NavSatStatus& data, + const carla_msgs::msg::CarlaV2XData& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -202,6 +203,8 @@ namespace sensor_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -224,10 +227,11 @@ namespace sensor_msgs { eprosima::fastcdr::Cdr& cdr) const; private: - uint8_t m_status; - uint16_t m_service; + + float m_power; + etsi_its_cam_msgs::msg::CAM m_message; }; } // namespace msg -} // namespace sensor_msgs +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.cxx new file mode 100644 index 00000000000..dbe4e1b9de1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.cxx @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XDataList.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaV2XDataList.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaV2XDataList::CarlaV2XDataList() +{ + // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@60f00693 + + +} + +carla_msgs::msg::CarlaV2XDataList::~CarlaV2XDataList() +{ +} + +carla_msgs::msg::CarlaV2XDataList::CarlaV2XDataList( + const CarlaV2XDataList& x) +{ + m_data = x.m_data; +} + +carla_msgs::msg::CarlaV2XDataList::CarlaV2XDataList( + CarlaV2XDataList&& x) +{ + m_data = std::move(x.m_data); +} + +carla_msgs::msg::CarlaV2XDataList& carla_msgs::msg::CarlaV2XDataList::operator =( + const CarlaV2XDataList& x) +{ + + m_data = x.m_data; + + return *this; +} + +carla_msgs::msg::CarlaV2XDataList& carla_msgs::msg::CarlaV2XDataList::operator =( + CarlaV2XDataList&& x) +{ + + m_data = std::move(x.m_data); + + return *this; +} + +bool carla_msgs::msg::CarlaV2XDataList::operator ==( + const CarlaV2XDataList& x) const +{ + + return (m_data == x.m_data); +} + +bool carla_msgs::msg::CarlaV2XDataList::operator !=( + const CarlaV2XDataList& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaV2XDataList::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaV2XData::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaV2XDataList::getCdrSerializedSize( + const carla_msgs::msg::CarlaV2XDataList& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.data().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaV2XData::getCdrSerializedSize(data.data().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaV2XDataList::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_data; +} + +void carla_msgs::msg::CarlaV2XDataList::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_data;} + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +void carla_msgs::msg::CarlaV2XDataList::data( + const std::vector& _data) +{ + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +void carla_msgs::msg::CarlaV2XDataList::data( + std::vector&& _data) +{ + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +const std::vector& carla_msgs::msg::CarlaV2XDataList::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +std::vector& carla_msgs::msg::CarlaV2XDataList::data() +{ + return m_data; +} + +size_t carla_msgs::msg::CarlaV2XDataList::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaV2XDataList::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaV2XDataList::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/String.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.h similarity index 65% rename from LibCarla/source/carla/ros2/types/String.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.h index 1c99d0d8a2d..c223f5f2e55 100644 --- a/LibCarla/source/carla/ros2/types/String.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.h @@ -13,16 +13,16 @@ // limitations under the License. /*! - * @file String.h + * @file CarlaV2XDataList.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_H_ -#include +#include "CarlaV2XData.h" #include #include @@ -43,16 +43,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(String_SOURCE) -#define String_DllAPI __declspec( dllexport ) +#if defined(CarlaV2XDataList_SOURCE) +#define CarlaV2XDataList_DllAPI __declspec( dllexport ) #else -#define String_DllAPI __declspec( dllimport ) -#endif // String_SOURCE +#define CarlaV2XDataList_DllAPI __declspec( dllimport ) +#endif // CarlaV2XDataList_SOURCE #else -#define String_DllAPI +#define CarlaV2XDataList_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define String_DllAPI +#define CarlaV2XDataList_DllAPI #endif // _WIN32 namespace eprosima { @@ -61,100 +61,101 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace std_msgs { + +namespace carla_msgs { namespace msg { /*! - * @brief This class represents the structure String defined by the user in the IDL file. - * @ingroup STRING + * @brief This class represents the structure CarlaV2XDataList defined by the user in the IDL file. + * @ingroup CARLAV2XDATALIST */ - class String + class CarlaV2XDataList { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport String(); + eProsima_user_DllExport CarlaV2XDataList(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~String(); + eProsima_user_DllExport ~CarlaV2XDataList(); /*! * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::String that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. */ - eProsima_user_DllExport String( - const String& x); + eProsima_user_DllExport CarlaV2XDataList( + const CarlaV2XDataList& x); /*! * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::String that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. */ - eProsima_user_DllExport String( - String&& x) noexcept; + eProsima_user_DllExport CarlaV2XDataList( + CarlaV2XDataList&& x); /*! * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::String that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. */ - eProsima_user_DllExport String& operator =( - const String& x); + eProsima_user_DllExport CarlaV2XDataList& operator =( + const CarlaV2XDataList& x); /*! * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::String that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. */ - eProsima_user_DllExport String& operator =( - String&& x) noexcept; + eProsima_user_DllExport CarlaV2XDataList& operator =( + CarlaV2XDataList&& x); /*! * @brief Comparison operator. - * @param x std_msgs::msg::String object to compare. + * @param x carla_msgs::msg::CarlaV2XDataList object to compare. */ eProsima_user_DllExport bool operator ==( - const String& x) const; + const CarlaV2XDataList& x) const; /*! * @brief Comparison operator. - * @param x std_msgs::msg::String object to compare. + * @param x carla_msgs::msg::CarlaV2XDataList object to compare. */ eProsima_user_DllExport bool operator !=( - const String& x) const; + const CarlaV2XDataList& x) const; /*! * @brief This function copies the value in member data * @param _data New value to be copied in member data */ eProsima_user_DllExport void data( - const std::string& _data); + const std::vector& _data); /*! * @brief This function moves the value in member data * @param _data New value to be moved in member data */ eProsima_user_DllExport void data( - std::string&& _data); + std::vector&& _data); /*! * @brief This function returns a constant reference to member data * @return Constant reference to member data */ - eProsima_user_DllExport const std::string& data() const; + eProsima_user_DllExport const std::vector& data() const; /*! * @brief This function returns a reference to member data * @return Reference to member data */ - eProsima_user_DllExport std::string& data(); + eProsima_user_DllExport std::vector& data(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -165,9 +166,10 @@ namespace std_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const std_msgs::msg::String& data, + const carla_msgs::msg::CarlaV2XDataList& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -182,6 +184,8 @@ namespace std_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -204,9 +208,10 @@ namespace std_msgs { eprosima::fastcdr::Cdr& cdr) const; private: - std::string m_data; + + std::vector m_data; }; } // namespace msg -} // namespace std_msgs +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.cxx new file mode 100644 index 00000000000..6fa29800f84 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XDataListPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaV2XDataListPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaV2XDataListPubSubType::CarlaV2XDataListPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaV2XDataList_"); + auto type_size = CarlaV2XDataList::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaV2XDataList::isKeyDefined(); + size_t keyLength = CarlaV2XDataList::getKeyMaxCdrSerializedSize() > 16 ? + CarlaV2XDataList::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaV2XDataListPubSubType::~CarlaV2XDataListPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaV2XDataListPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaV2XDataList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaV2XDataListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaV2XDataList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaV2XDataListPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaV2XDataListPubSubType::createData() + { + return reinterpret_cast(new CarlaV2XDataList()); + } + + void CarlaV2XDataListPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaV2XDataListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaV2XDataList* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaV2XDataList::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaV2XDataList::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/types/TransformStampedPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.h similarity index 78% rename from LibCarla/source/carla/ros2/types/TransformStampedPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.h index 7bd5a9b400f..787738b46c3 100644 --- a/LibCarla/source/carla/ros2/types/TransformStampedPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.h @@ -13,46 +13,43 @@ // limitations under the License. /*! - * @file TransformStampedPubSubTypes.h + * @file CarlaV2XDataListPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_PUBSUBTYPES_H_ #include #include -#include "TransformStamped.h" - -#include "HeaderPubSubTypes.h" -#include "TransformPubSubTypes.h" +#include "CarlaV2XDataList.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated TransformStamped is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CarlaV2XDataList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace carla_msgs { namespace msg { - /*! - * @brief This class represents the TopicDataType of the type TransformStamped defined by the user in the IDL file. - * @ingroup TRANSFORMSTAMPED + * @brief This class represents the TopicDataType of the type CarlaV2XDataList defined by the user in the IDL file. + * @ingroup CARLAV2XDATALIST */ - class TransformStampedPubSubType : public eprosima::fastdds::dds::TopicDataType + class CarlaV2XDataListPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef TransformStamped type; + typedef CarlaV2XDataList type; - eProsima_user_DllExport TransformStampedPubSubType(); + eProsima_user_DllExport CarlaV2XDataListPubSubType(); - eProsima_user_DllExport virtual ~TransformStampedPubSubType() override; + eProsima_user_DllExport virtual ~CarlaV2XDataListPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -100,10 +97,11 @@ namespace geometry_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.cxx new file mode 100644 index 00000000000..43a907f6064 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XDataPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaV2XDataPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaV2XDataPubSubType::CarlaV2XDataPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaV2XData_"); + auto type_size = CarlaV2XData::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaV2XData::isKeyDefined(); + size_t keyLength = CarlaV2XData::getKeyMaxCdrSerializedSize() > 16 ? + CarlaV2XData::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaV2XDataPubSubType::~CarlaV2XDataPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaV2XDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaV2XData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaV2XDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaV2XData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaV2XDataPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaV2XDataPubSubType::createData() + { + return reinterpret_cast(new CarlaV2XData()); + } + + void CarlaV2XDataPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaV2XDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaV2XData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaV2XData::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaV2XData::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/types/HeaderPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.h similarity index 78% rename from LibCarla/source/carla/ros2/types/HeaderPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.h index ddc9ca2b87c..d073f9fbc41 100644 --- a/LibCarla/source/carla/ros2/types/HeaderPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.h @@ -13,42 +13,43 @@ // limitations under the License. /*! - * @file HeaderPubSubTypes.h + * @file CarlaV2XDataPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_PUBSUBTYPES_H_ #include #include -#include "Header.h" +#include "CarlaV2XData.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated Header is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CarlaV2XData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace std_msgs +namespace carla_msgs { namespace msg { /*! - * @brief This class represents the TopicDataType of the type Header defined by the user in the IDL file. - * @ingroup HEADER + * @brief This class represents the TopicDataType of the type CarlaV2XData defined by the user in the IDL file. + * @ingroup CARLAV2XDATA */ - class HeaderPubSubType : public eprosima::fastdds::dds::TopicDataType + class CarlaV2XDataPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef Header type; + typedef CarlaV2XData type; - eProsima_user_DllExport HeaderPubSubType(); + eProsima_user_DllExport CarlaV2XDataPubSubType(); - eProsima_user_DllExport virtual ~HeaderPubSubType() override; + eProsima_user_DllExport virtual ~CarlaV2XDataPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -103,4 +104,4 @@ namespace std_msgs } } -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.cxx new file mode 100644 index 00000000000..b4bad442772 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.cxx @@ -0,0 +1,324 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWalkerControl.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaWalkerControl.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaWalkerControl::CarlaWalkerControl() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5d99c6b5 + + // m_direction com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@266374ef + + // m_speed com.eprosima.idl.parser.typecode.PrimitiveTypeCode@13b3d178 + m_speed = 0.0; + // m_jump com.eprosima.idl.parser.typecode.PrimitiveTypeCode@24c4ddae + m_jump = false; + +} + +carla_msgs::msg::CarlaWalkerControl::~CarlaWalkerControl() +{ + + + +} + +carla_msgs::msg::CarlaWalkerControl::CarlaWalkerControl( + const CarlaWalkerControl& x) +{ + m_header = x.m_header; + m_direction = x.m_direction; + m_speed = x.m_speed; + m_jump = x.m_jump; +} + +carla_msgs::msg::CarlaWalkerControl::CarlaWalkerControl( + CarlaWalkerControl&& x) +{ + m_header = std::move(x.m_header); + m_direction = std::move(x.m_direction); + m_speed = x.m_speed; + m_jump = x.m_jump; +} + +carla_msgs::msg::CarlaWalkerControl& carla_msgs::msg::CarlaWalkerControl::operator =( + const CarlaWalkerControl& x) +{ + + m_header = x.m_header; + m_direction = x.m_direction; + m_speed = x.m_speed; + m_jump = x.m_jump; + + return *this; +} + +carla_msgs::msg::CarlaWalkerControl& carla_msgs::msg::CarlaWalkerControl::operator =( + CarlaWalkerControl&& x) +{ + + m_header = std::move(x.m_header); + m_direction = std::move(x.m_direction); + m_speed = x.m_speed; + m_jump = x.m_jump; + + return *this; +} + +bool carla_msgs::msg::CarlaWalkerControl::operator ==( + const CarlaWalkerControl& x) const +{ + + return (m_header == x.m_header && m_direction == x.m_direction && m_speed == x.m_speed && m_jump == x.m_jump); +} + +bool carla_msgs::msg::CarlaWalkerControl::operator !=( + const CarlaWalkerControl& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaWalkerControl::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaWalkerControl::getCdrSerializedSize( + const carla_msgs::msg::CarlaWalkerControl& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.direction(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaWalkerControl::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_direction; + scdr << m_speed; + scdr << m_jump; + +} + +void carla_msgs::msg::CarlaWalkerControl::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_direction; + dcdr >> m_speed; + dcdr >> m_jump; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void carla_msgs::msg::CarlaWalkerControl::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void carla_msgs::msg::CarlaWalkerControl::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& carla_msgs::msg::CarlaWalkerControl::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& carla_msgs::msg::CarlaWalkerControl::header() +{ + return m_header; +} +/*! + * @brief This function copies the value in member direction + * @param _direction New value to be copied in member direction + */ +void carla_msgs::msg::CarlaWalkerControl::direction( + const geometry_msgs::msg::Vector3& _direction) +{ + m_direction = _direction; +} + +/*! + * @brief This function moves the value in member direction + * @param _direction New value to be moved in member direction + */ +void carla_msgs::msg::CarlaWalkerControl::direction( + geometry_msgs::msg::Vector3&& _direction) +{ + m_direction = std::move(_direction); +} + +/*! + * @brief This function returns a constant reference to member direction + * @return Constant reference to member direction + */ +const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaWalkerControl::direction() const +{ + return m_direction; +} + +/*! + * @brief This function returns a reference to member direction + * @return Reference to member direction + */ +geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaWalkerControl::direction() +{ + return m_direction; +} +/*! + * @brief This function sets a value in member speed + * @param _speed New value for member speed + */ +void carla_msgs::msg::CarlaWalkerControl::speed( + float _speed) +{ + m_speed = _speed; +} + +/*! + * @brief This function returns the value of member speed + * @return Value of member speed + */ +float carla_msgs::msg::CarlaWalkerControl::speed() const +{ + return m_speed; +} + +/*! + * @brief This function returns a reference to member speed + * @return Reference to member speed + */ +float& carla_msgs::msg::CarlaWalkerControl::speed() +{ + return m_speed; +} + +/*! + * @brief This function sets a value in member jump + * @param _jump New value for member jump + */ +void carla_msgs::msg::CarlaWalkerControl::jump( + bool _jump) +{ + m_jump = _jump; +} + +/*! + * @brief This function returns the value of member jump + * @return Value of member jump + */ +bool carla_msgs::msg::CarlaWalkerControl::jump() const +{ + return m_jump; +} + +/*! + * @brief This function returns a reference to member jump + * @return Reference to member jump + */ +bool& carla_msgs::msg::CarlaWalkerControl::jump() +{ + return m_jump; +} + + +size_t carla_msgs::msg::CarlaWalkerControl::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaWalkerControl::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaWalkerControl::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/TransformStamped.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.h similarity index 56% rename from LibCarla/source/carla/ros2/types/TransformStamped.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.h index a5f1fd27e6f..262e21061da 100644 --- a/LibCarla/source/carla/ros2/types/TransformStamped.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.h @@ -13,19 +13,17 @@ // limitations under the License. /*! - * @file TransformStamped.h + * @file CarlaWalkerControl.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_H_ -#include "Header.h" -#include "Transform.h" - -#include +#include "geometry_msgs/msg/Vector3.h" +#include "std_msgs/msg/Header.h" #include #include @@ -46,16 +44,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TransformStamped_SOURCE) -#define TransformStamped_DllAPI __declspec( dllexport ) +#if defined(CarlaWalkerControl_SOURCE) +#define CarlaWalkerControl_DllAPI __declspec( dllexport ) #else -#define TransformStamped_DllAPI __declspec( dllimport ) -#endif // TransformStamped_SOURCE +#define CarlaWalkerControl_DllAPI __declspec( dllimport ) +#endif // CarlaWalkerControl_SOURCE #else -#define TransformStamped_DllAPI +#define CarlaWalkerControl_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TransformStamped_DllAPI +#define CarlaWalkerControl_DllAPI #endif // _WIN32 namespace eprosima { @@ -64,67 +62,68 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace geometry_msgs { + +namespace carla_msgs { namespace msg { /*! - * @brief This class represents the structure TransformStamped defined by the user in the IDL file. - * @ingroup TRANSFORMSTAMPED + * @brief This class represents the structure CarlaWalkerControl defined by the user in the IDL file. + * @ingroup CARLAWALKERCONTROL */ - class TransformStamped + class CarlaWalkerControl { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport TransformStamped(); + eProsima_user_DllExport CarlaWalkerControl(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~TransformStamped(); + eProsima_user_DllExport ~CarlaWalkerControl(); /*! * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. */ - eProsima_user_DllExport TransformStamped( - const TransformStamped& x); + eProsima_user_DllExport CarlaWalkerControl( + const CarlaWalkerControl& x); /*! * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. */ - eProsima_user_DllExport TransformStamped( - TransformStamped&& x) noexcept; + eProsima_user_DllExport CarlaWalkerControl( + CarlaWalkerControl&& x); /*! * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. */ - eProsima_user_DllExport TransformStamped& operator =( - const TransformStamped& x); + eProsima_user_DllExport CarlaWalkerControl& operator =( + const CarlaWalkerControl& x); /*! * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. */ - eProsima_user_DllExport TransformStamped& operator =( - TransformStamped&& x) noexcept; + eProsima_user_DllExport CarlaWalkerControl& operator =( + CarlaWalkerControl&& x); /*! * @brief Comparison operator. - * @param x geometry_msgs::msg::TransformStamped object to compare. + * @param x carla_msgs::msg::CarlaWalkerControl object to compare. */ eProsima_user_DllExport bool operator ==( - const TransformStamped& x) const; + const CarlaWalkerControl& x) const; /*! * @brief Comparison operator. - * @param x geometry_msgs::msg::TransformStamped object to compare. + * @param x carla_msgs::msg::CarlaWalkerControl object to compare. */ eProsima_user_DllExport bool operator !=( - const TransformStamped& x) const; + const CarlaWalkerControl& x) const; /*! * @brief This function copies the value in member header @@ -152,62 +151,75 @@ namespace geometry_msgs { */ eProsima_user_DllExport std_msgs::msg::Header& header(); /*! - * @brief This function copies the value in member child_frame_id - * @param _child_frame_id New value to be copied in member child_frame_id + * @brief This function copies the value in member direction + * @param _direction New value to be copied in member direction */ - eProsima_user_DllExport void child_frame_id( - const std::string& _child_frame_id); + eProsima_user_DllExport void direction( + const geometry_msgs::msg::Vector3& _direction); /*! - * @brief This function moves the value in member child_frame_id - * @param _child_frame_id New value to be moved in member child_frame_id + * @brief This function moves the value in member direction + * @param _direction New value to be moved in member direction */ - eProsima_user_DllExport void child_frame_id( - std::string&& _child_frame_id); + eProsima_user_DllExport void direction( + geometry_msgs::msg::Vector3&& _direction); /*! - * @brief This function returns a constant reference to member child_frame_id - * @return Constant reference to member child_frame_id + * @brief This function returns a constant reference to member direction + * @return Constant reference to member direction */ - eProsima_user_DllExport const std::string& child_frame_id() const; + eProsima_user_DllExport const geometry_msgs::msg::Vector3& direction() const; /*! - * @brief This function returns a reference to member child_frame_id - * @return Reference to member child_frame_id + * @brief This function returns a reference to member direction + * @return Reference to member direction */ - eProsima_user_DllExport std::string& child_frame_id(); + eProsima_user_DllExport geometry_msgs::msg::Vector3& direction(); + /*! + * @brief This function sets a value in member speed + * @param _speed New value for member speed + */ + eProsima_user_DllExport void speed( + float _speed); + /*! - * @brief This function copies the value in member transform - * @param _transform New value to be copied in member transform + * @brief This function returns the value of member speed + * @return Value of member speed */ - eProsima_user_DllExport void transform( - const geometry_msgs::msg::Transform& _transform); + eProsima_user_DllExport float speed() const; /*! - * @brief This function moves the value in member transform - * @param _transform New value to be moved in member transform + * @brief This function returns a reference to member speed + * @return Reference to member speed */ - eProsima_user_DllExport void transform( - geometry_msgs::msg::Transform&& _transform); + eProsima_user_DllExport float& speed(); /*! - * @brief This function returns a constant reference to member transform - * @return Constant reference to member transform + * @brief This function sets a value in member jump + * @param _jump New value for member jump */ - eProsima_user_DllExport const geometry_msgs::msg::Transform& transform() const; + eProsima_user_DllExport void jump( + bool _jump); /*! - * @brief This function returns a reference to member transform - * @return Reference to member transform + * @brief This function returns the value of member jump + * @return Value of member jump */ - eProsima_user_DllExport geometry_msgs::msg::Transform& transform(); + eProsima_user_DllExport bool jump() const; + + /*! + * @brief This function returns a reference to member jump + * @return Reference to member jump + */ + eProsima_user_DllExport bool& jump(); + /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -218,9 +230,10 @@ namespace geometry_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::TransformStamped& data, + const carla_msgs::msg::CarlaWalkerControl& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -235,6 +248,8 @@ namespace geometry_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -257,12 +272,13 @@ namespace geometry_msgs { eprosima::fastcdr::Cdr& cdr) const; private: - std_msgs::msg::Header m_header; - std::string m_child_frame_id; - geometry_msgs::msg::Transform m_transform; + std_msgs::msg::Header m_header; + geometry_msgs::msg::Vector3 m_direction; + float m_speed; + bool m_jump; }; } // namespace msg -} // namespace geometry_msgs +} // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.cxx new file mode 100644 index 00000000000..20477573866 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWalkerControlPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaWalkerControlPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaWalkerControlPubSubType::CarlaWalkerControlPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaWalkerControl_"); + auto type_size = CarlaWalkerControl::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaWalkerControl::isKeyDefined(); + size_t keyLength = CarlaWalkerControl::getKeyMaxCdrSerializedSize() > 16 ? + CarlaWalkerControl::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaWalkerControlPubSubType::~CarlaWalkerControlPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaWalkerControlPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaWalkerControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaWalkerControlPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaWalkerControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaWalkerControlPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaWalkerControlPubSubType::createData() + { + return reinterpret_cast(new CarlaWalkerControl()); + } + + void CarlaWalkerControlPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaWalkerControlPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaWalkerControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaWalkerControl::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaWalkerControl::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/types/OdometryPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.h similarity index 77% rename from LibCarla/source/carla/ros2/types/OdometryPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.h index 2c333fe0cf1..e9aff523706 100644 --- a/LibCarla/source/carla/ros2/types/OdometryPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.h @@ -13,46 +13,43 @@ // limitations under the License. /*! - * @file OdometryPubSubTypes.h + * @file CarlaWalkerControlPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_PUBSUBTYPES_H_ #include #include -#include "Odometry.h" -#include "PoseWithCovariancePubSubTypes.h" -#include "TwistWithCovariancePubSubTypes.h" -#include "HeaderPubSubTypes.h" +#include "CarlaWalkerControl.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated Odometry is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CarlaWalkerControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace nav_msgs +namespace carla_msgs { namespace msg { - /*! - * @brief This class represents the TopicDataType of the type Odometry defined by the user in the IDL file. - * @ingroup ODOMETRY + * @brief This class represents the TopicDataType of the type CarlaWalkerControl defined by the user in the IDL file. + * @ingroup CARLAWALKERCONTROL */ - class OdometryPubSubType : public eprosima::fastdds::dds::TopicDataType + class CarlaWalkerControlPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef Odometry type; + typedef CarlaWalkerControl type; - eProsima_user_DllExport OdometryPubSubType(); + eProsima_user_DllExport CarlaWalkerControlPubSubType(); - eProsima_user_DllExport virtual ~OdometryPubSubType() override; + eProsima_user_DllExport virtual ~CarlaWalkerControlPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -100,10 +97,11 @@ namespace nav_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx new file mode 100644 index 00000000000..f06951fcbd5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx @@ -0,0 +1,529 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWeatherParameters.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaWeatherParameters.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters() +{ + // m_cloudiness com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f6745d6 + m_cloudiness = 0.0; + // m_precipitation com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27508c5d + m_precipitation = 0.0; + // m_precipitation_deposits com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f704591 + m_precipitation_deposits = 0.0; + // m_wind_intensity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4b5189ac + m_wind_intensity = 0.0; + // m_fog_density com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e4d3ce5 + m_fog_density = 0.0; + // m_fog_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3ddc6915 + m_fog_distance = 0.0; + // m_wetness com.eprosima.idl.parser.typecode.PrimitiveTypeCode@704deff2 + m_wetness = 0.0; + // m_sun_azimuth_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@379614be + m_sun_azimuth_angle = 0.0; + // m_sun_altitude_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@404bbcbd + m_sun_altitude_angle = 0.0; + +} + +carla_msgs::msg::CarlaWeatherParameters::~CarlaWeatherParameters() +{ + + + + + + + + +} + +carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( + const CarlaWeatherParameters& x) +{ + m_cloudiness = x.m_cloudiness; + m_precipitation = x.m_precipitation; + m_precipitation_deposits = x.m_precipitation_deposits; + m_wind_intensity = x.m_wind_intensity; + m_fog_density = x.m_fog_density; + m_fog_distance = x.m_fog_distance; + m_wetness = x.m_wetness; + m_sun_azimuth_angle = x.m_sun_azimuth_angle; + m_sun_altitude_angle = x.m_sun_altitude_angle; +} + +carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( + CarlaWeatherParameters&& x) +{ + m_cloudiness = x.m_cloudiness; + m_precipitation = x.m_precipitation; + m_precipitation_deposits = x.m_precipitation_deposits; + m_wind_intensity = x.m_wind_intensity; + m_fog_density = x.m_fog_density; + m_fog_distance = x.m_fog_distance; + m_wetness = x.m_wetness; + m_sun_azimuth_angle = x.m_sun_azimuth_angle; + m_sun_altitude_angle = x.m_sun_altitude_angle; +} + +carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters::operator =( + const CarlaWeatherParameters& x) +{ + + m_cloudiness = x.m_cloudiness; + m_precipitation = x.m_precipitation; + m_precipitation_deposits = x.m_precipitation_deposits; + m_wind_intensity = x.m_wind_intensity; + m_fog_density = x.m_fog_density; + m_fog_distance = x.m_fog_distance; + m_wetness = x.m_wetness; + m_sun_azimuth_angle = x.m_sun_azimuth_angle; + m_sun_altitude_angle = x.m_sun_altitude_angle; + + return *this; +} + +carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters::operator =( + CarlaWeatherParameters&& x) +{ + + m_cloudiness = x.m_cloudiness; + m_precipitation = x.m_precipitation; + m_precipitation_deposits = x.m_precipitation_deposits; + m_wind_intensity = x.m_wind_intensity; + m_fog_density = x.m_fog_density; + m_fog_distance = x.m_fog_distance; + m_wetness = x.m_wetness; + m_sun_azimuth_angle = x.m_sun_azimuth_angle; + m_sun_altitude_angle = x.m_sun_altitude_angle; + + return *this; +} + +bool carla_msgs::msg::CarlaWeatherParameters::operator ==( + const CarlaWeatherParameters& x) const +{ + + return (m_cloudiness == x.m_cloudiness && m_precipitation == x.m_precipitation && m_precipitation_deposits == x.m_precipitation_deposits && m_wind_intensity == x.m_wind_intensity && m_fog_density == x.m_fog_density && m_fog_distance == x.m_fog_distance && m_wetness == x.m_wetness && m_sun_azimuth_angle == x.m_sun_azimuth_angle && m_sun_altitude_angle == x.m_sun_altitude_angle); +} + +bool carla_msgs::msg::CarlaWeatherParameters::operator !=( + const CarlaWeatherParameters& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaWeatherParameters::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaWeatherParameters::getCdrSerializedSize( + const carla_msgs::msg::CarlaWeatherParameters& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaWeatherParameters::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_cloudiness; + scdr << m_precipitation; + scdr << m_precipitation_deposits; + scdr << m_wind_intensity; + scdr << m_fog_density; + scdr << m_fog_distance; + scdr << m_wetness; + scdr << m_sun_azimuth_angle; + scdr << m_sun_altitude_angle; + +} + +void carla_msgs::msg::CarlaWeatherParameters::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_cloudiness; + dcdr >> m_precipitation; + dcdr >> m_precipitation_deposits; + dcdr >> m_wind_intensity; + dcdr >> m_fog_density; + dcdr >> m_fog_distance; + dcdr >> m_wetness; + dcdr >> m_sun_azimuth_angle; + dcdr >> m_sun_altitude_angle; +} + +/*! + * @brief This function sets a value in member cloudiness + * @param _cloudiness New value for member cloudiness + */ +void carla_msgs::msg::CarlaWeatherParameters::cloudiness( + float _cloudiness) +{ + m_cloudiness = _cloudiness; +} + +/*! + * @brief This function returns the value of member cloudiness + * @return Value of member cloudiness + */ +float carla_msgs::msg::CarlaWeatherParameters::cloudiness() const +{ + return m_cloudiness; +} + +/*! + * @brief This function returns a reference to member cloudiness + * @return Reference to member cloudiness + */ +float& carla_msgs::msg::CarlaWeatherParameters::cloudiness() +{ + return m_cloudiness; +} + +/*! + * @brief This function sets a value in member precipitation + * @param _precipitation New value for member precipitation + */ +void carla_msgs::msg::CarlaWeatherParameters::precipitation( + float _precipitation) +{ + m_precipitation = _precipitation; +} + +/*! + * @brief This function returns the value of member precipitation + * @return Value of member precipitation + */ +float carla_msgs::msg::CarlaWeatherParameters::precipitation() const +{ + return m_precipitation; +} + +/*! + * @brief This function returns a reference to member precipitation + * @return Reference to member precipitation + */ +float& carla_msgs::msg::CarlaWeatherParameters::precipitation() +{ + return m_precipitation; +} + +/*! + * @brief This function sets a value in member precipitation_deposits + * @param _precipitation_deposits New value for member precipitation_deposits + */ +void carla_msgs::msg::CarlaWeatherParameters::precipitation_deposits( + float _precipitation_deposits) +{ + m_precipitation_deposits = _precipitation_deposits; +} + +/*! + * @brief This function returns the value of member precipitation_deposits + * @return Value of member precipitation_deposits + */ +float carla_msgs::msg::CarlaWeatherParameters::precipitation_deposits() const +{ + return m_precipitation_deposits; +} + +/*! + * @brief This function returns a reference to member precipitation_deposits + * @return Reference to member precipitation_deposits + */ +float& carla_msgs::msg::CarlaWeatherParameters::precipitation_deposits() +{ + return m_precipitation_deposits; +} + +/*! + * @brief This function sets a value in member wind_intensity + * @param _wind_intensity New value for member wind_intensity + */ +void carla_msgs::msg::CarlaWeatherParameters::wind_intensity( + float _wind_intensity) +{ + m_wind_intensity = _wind_intensity; +} + +/*! + * @brief This function returns the value of member wind_intensity + * @return Value of member wind_intensity + */ +float carla_msgs::msg::CarlaWeatherParameters::wind_intensity() const +{ + return m_wind_intensity; +} + +/*! + * @brief This function returns a reference to member wind_intensity + * @return Reference to member wind_intensity + */ +float& carla_msgs::msg::CarlaWeatherParameters::wind_intensity() +{ + return m_wind_intensity; +} + +/*! + * @brief This function sets a value in member fog_density + * @param _fog_density New value for member fog_density + */ +void carla_msgs::msg::CarlaWeatherParameters::fog_density( + float _fog_density) +{ + m_fog_density = _fog_density; +} + +/*! + * @brief This function returns the value of member fog_density + * @return Value of member fog_density + */ +float carla_msgs::msg::CarlaWeatherParameters::fog_density() const +{ + return m_fog_density; +} + +/*! + * @brief This function returns a reference to member fog_density + * @return Reference to member fog_density + */ +float& carla_msgs::msg::CarlaWeatherParameters::fog_density() +{ + return m_fog_density; +} + +/*! + * @brief This function sets a value in member fog_distance + * @param _fog_distance New value for member fog_distance + */ +void carla_msgs::msg::CarlaWeatherParameters::fog_distance( + float _fog_distance) +{ + m_fog_distance = _fog_distance; +} + +/*! + * @brief This function returns the value of member fog_distance + * @return Value of member fog_distance + */ +float carla_msgs::msg::CarlaWeatherParameters::fog_distance() const +{ + return m_fog_distance; +} + +/*! + * @brief This function returns a reference to member fog_distance + * @return Reference to member fog_distance + */ +float& carla_msgs::msg::CarlaWeatherParameters::fog_distance() +{ + return m_fog_distance; +} + +/*! + * @brief This function sets a value in member wetness + * @param _wetness New value for member wetness + */ +void carla_msgs::msg::CarlaWeatherParameters::wetness( + float _wetness) +{ + m_wetness = _wetness; +} + +/*! + * @brief This function returns the value of member wetness + * @return Value of member wetness + */ +float carla_msgs::msg::CarlaWeatherParameters::wetness() const +{ + return m_wetness; +} + +/*! + * @brief This function returns a reference to member wetness + * @return Reference to member wetness + */ +float& carla_msgs::msg::CarlaWeatherParameters::wetness() +{ + return m_wetness; +} + +/*! + * @brief This function sets a value in member sun_azimuth_angle + * @param _sun_azimuth_angle New value for member sun_azimuth_angle + */ +void carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle( + float _sun_azimuth_angle) +{ + m_sun_azimuth_angle = _sun_azimuth_angle; +} + +/*! + * @brief This function returns the value of member sun_azimuth_angle + * @return Value of member sun_azimuth_angle + */ +float carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() const +{ + return m_sun_azimuth_angle; +} + +/*! + * @brief This function returns a reference to member sun_azimuth_angle + * @return Reference to member sun_azimuth_angle + */ +float& carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() +{ + return m_sun_azimuth_angle; +} + +/*! + * @brief This function sets a value in member sun_altitude_angle + * @param _sun_altitude_angle New value for member sun_altitude_angle + */ +void carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle( + float _sun_altitude_angle) +{ + m_sun_altitude_angle = _sun_altitude_angle; +} + +/*! + * @brief This function returns the value of member sun_altitude_angle + * @return Value of member sun_altitude_angle + */ +float carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() const +{ + return m_sun_altitude_angle; +} + +/*! + * @brief This function returns a reference to member sun_altitude_angle + * @return Reference to member sun_altitude_angle + */ +float& carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() +{ + return m_sun_altitude_angle; +} + + +size_t carla_msgs::msg::CarlaWeatherParameters::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaWeatherParameters::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaWeatherParameters::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h new file mode 100644 index 00000000000..fdf671a8cbf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h @@ -0,0 +1,370 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWeatherParameters.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaWeatherParameters_SOURCE) +#define CarlaWeatherParameters_DllAPI __declspec( dllexport ) +#else +#define CarlaWeatherParameters_DllAPI __declspec( dllimport ) +#endif // CarlaWeatherParameters_SOURCE +#else +#define CarlaWeatherParameters_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaWeatherParameters_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaWeatherParameters defined by the user in the IDL file. + * @ingroup CARLAWEATHERPARAMETERS + */ + class CarlaWeatherParameters + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaWeatherParameters(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaWeatherParameters(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. + */ + eProsima_user_DllExport CarlaWeatherParameters( + const CarlaWeatherParameters& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. + */ + eProsima_user_DllExport CarlaWeatherParameters( + CarlaWeatherParameters&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. + */ + eProsima_user_DllExport CarlaWeatherParameters& operator =( + const CarlaWeatherParameters& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. + */ + eProsima_user_DllExport CarlaWeatherParameters& operator =( + CarlaWeatherParameters&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWeatherParameters object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaWeatherParameters& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWeatherParameters object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaWeatherParameters& x) const; + + /*! + * @brief This function sets a value in member cloudiness + * @param _cloudiness New value for member cloudiness + */ + eProsima_user_DllExport void cloudiness( + float _cloudiness); + + /*! + * @brief This function returns the value of member cloudiness + * @return Value of member cloudiness + */ + eProsima_user_DllExport float cloudiness() const; + + /*! + * @brief This function returns a reference to member cloudiness + * @return Reference to member cloudiness + */ + eProsima_user_DllExport float& cloudiness(); + + /*! + * @brief This function sets a value in member precipitation + * @param _precipitation New value for member precipitation + */ + eProsima_user_DllExport void precipitation( + float _precipitation); + + /*! + * @brief This function returns the value of member precipitation + * @return Value of member precipitation + */ + eProsima_user_DllExport float precipitation() const; + + /*! + * @brief This function returns a reference to member precipitation + * @return Reference to member precipitation + */ + eProsima_user_DllExport float& precipitation(); + + /*! + * @brief This function sets a value in member precipitation_deposits + * @param _precipitation_deposits New value for member precipitation_deposits + */ + eProsima_user_DllExport void precipitation_deposits( + float _precipitation_deposits); + + /*! + * @brief This function returns the value of member precipitation_deposits + * @return Value of member precipitation_deposits + */ + eProsima_user_DllExport float precipitation_deposits() const; + + /*! + * @brief This function returns a reference to member precipitation_deposits + * @return Reference to member precipitation_deposits + */ + eProsima_user_DllExport float& precipitation_deposits(); + + /*! + * @brief This function sets a value in member wind_intensity + * @param _wind_intensity New value for member wind_intensity + */ + eProsima_user_DllExport void wind_intensity( + float _wind_intensity); + + /*! + * @brief This function returns the value of member wind_intensity + * @return Value of member wind_intensity + */ + eProsima_user_DllExport float wind_intensity() const; + + /*! + * @brief This function returns a reference to member wind_intensity + * @return Reference to member wind_intensity + */ + eProsima_user_DllExport float& wind_intensity(); + + /*! + * @brief This function sets a value in member fog_density + * @param _fog_density New value for member fog_density + */ + eProsima_user_DllExport void fog_density( + float _fog_density); + + /*! + * @brief This function returns the value of member fog_density + * @return Value of member fog_density + */ + eProsima_user_DllExport float fog_density() const; + + /*! + * @brief This function returns a reference to member fog_density + * @return Reference to member fog_density + */ + eProsima_user_DllExport float& fog_density(); + + /*! + * @brief This function sets a value in member fog_distance + * @param _fog_distance New value for member fog_distance + */ + eProsima_user_DllExport void fog_distance( + float _fog_distance); + + /*! + * @brief This function returns the value of member fog_distance + * @return Value of member fog_distance + */ + eProsima_user_DllExport float fog_distance() const; + + /*! + * @brief This function returns a reference to member fog_distance + * @return Reference to member fog_distance + */ + eProsima_user_DllExport float& fog_distance(); + + /*! + * @brief This function sets a value in member wetness + * @param _wetness New value for member wetness + */ + eProsima_user_DllExport void wetness( + float _wetness); + + /*! + * @brief This function returns the value of member wetness + * @return Value of member wetness + */ + eProsima_user_DllExport float wetness() const; + + /*! + * @brief This function returns a reference to member wetness + * @return Reference to member wetness + */ + eProsima_user_DllExport float& wetness(); + + /*! + * @brief This function sets a value in member sun_azimuth_angle + * @param _sun_azimuth_angle New value for member sun_azimuth_angle + */ + eProsima_user_DllExport void sun_azimuth_angle( + float _sun_azimuth_angle); + + /*! + * @brief This function returns the value of member sun_azimuth_angle + * @return Value of member sun_azimuth_angle + */ + eProsima_user_DllExport float sun_azimuth_angle() const; + + /*! + * @brief This function returns a reference to member sun_azimuth_angle + * @return Reference to member sun_azimuth_angle + */ + eProsima_user_DllExport float& sun_azimuth_angle(); + + /*! + * @brief This function sets a value in member sun_altitude_angle + * @param _sun_altitude_angle New value for member sun_altitude_angle + */ + eProsima_user_DllExport void sun_altitude_angle( + float _sun_altitude_angle); + + /*! + * @brief This function returns the value of member sun_altitude_angle + * @return Value of member sun_altitude_angle + */ + eProsima_user_DllExport float sun_altitude_angle() const; + + /*! + * @brief This function returns a reference to member sun_altitude_angle + * @return Reference to member sun_altitude_angle + */ + eProsima_user_DllExport float& sun_altitude_angle(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaWeatherParameters& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + float m_cloudiness; + float m_precipitation; + float m_precipitation_deposits; + float m_wind_intensity; + float m_fog_density; + float m_fog_distance; + float m_wetness; + float m_sun_azimuth_angle; + float m_sun_altitude_angle; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.cxx new file mode 100644 index 00000000000..514e3bfc24e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWeatherParametersPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaWeatherParametersPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaWeatherParametersPubSubType::CarlaWeatherParametersPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaWeatherParameters_"); + auto type_size = CarlaWeatherParameters::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaWeatherParameters::isKeyDefined(); + size_t keyLength = CarlaWeatherParameters::getKeyMaxCdrSerializedSize() > 16 ? + CarlaWeatherParameters::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaWeatherParametersPubSubType::~CarlaWeatherParametersPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaWeatherParametersPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaWeatherParameters* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaWeatherParametersPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaWeatherParameters* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaWeatherParametersPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaWeatherParametersPubSubType::createData() + { + return reinterpret_cast(new CarlaWeatherParameters()); + } + + void CarlaWeatherParametersPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaWeatherParametersPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaWeatherParameters* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaWeatherParameters::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaWeatherParameters::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h new file mode 100644 index 00000000000..5bac31db030 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWeatherParametersPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaWeatherParameters.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaWeatherParameters is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaWeatherParameters defined by the user in the IDL file. + * @ingroup CARLAWEATHERPARAMETERS + */ + class CarlaWeatherParametersPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaWeatherParameters type; + + eProsima_user_DllExport CarlaWeatherParametersPubSubType(); + + eProsima_user_DllExport virtual ~CarlaWeatherParametersPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CarlaWeatherParameters(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx new file mode 100644 index 00000000000..00c1a7c5422 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx @@ -0,0 +1,242 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWorldInfo.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CarlaWorldInfo.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo() +{ + // m_map_name com.eprosima.idl.parser.typecode.StringTypeCode@6e15fe2 + m_map_name =""; + // m_opendrive com.eprosima.idl.parser.typecode.StringTypeCode@68f1b17f + m_opendrive =""; + +} + +carla_msgs::msg::CarlaWorldInfo::~CarlaWorldInfo() +{ + +} + +carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo( + const CarlaWorldInfo& x) +{ + m_map_name = x.m_map_name; + m_opendrive = x.m_opendrive; +} + +carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo( + CarlaWorldInfo&& x) +{ + m_map_name = std::move(x.m_map_name); + m_opendrive = std::move(x.m_opendrive); +} + +carla_msgs::msg::CarlaWorldInfo& carla_msgs::msg::CarlaWorldInfo::operator =( + const CarlaWorldInfo& x) +{ + + m_map_name = x.m_map_name; + m_opendrive = x.m_opendrive; + + return *this; +} + +carla_msgs::msg::CarlaWorldInfo& carla_msgs::msg::CarlaWorldInfo::operator =( + CarlaWorldInfo&& x) +{ + + m_map_name = std::move(x.m_map_name); + m_opendrive = std::move(x.m_opendrive); + + return *this; +} + +bool carla_msgs::msg::CarlaWorldInfo::operator ==( + const CarlaWorldInfo& x) const +{ + + return (m_map_name == x.m_map_name && m_opendrive == x.m_opendrive); +} + +bool carla_msgs::msg::CarlaWorldInfo::operator !=( + const CarlaWorldInfo& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::msg::CarlaWorldInfo::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::msg::CarlaWorldInfo::getCdrSerializedSize( + const carla_msgs::msg::CarlaWorldInfo& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.map_name().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.opendrive().size() + 1; + + + return current_alignment - initial_alignment; +} + +void carla_msgs::msg::CarlaWorldInfo::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_map_name; + scdr << m_opendrive; + +} + +void carla_msgs::msg::CarlaWorldInfo::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_map_name; + dcdr >> m_opendrive; +} + +/*! + * @brief This function copies the value in member map_name + * @param _map_name New value to be copied in member map_name + */ +void carla_msgs::msg::CarlaWorldInfo::map_name( + const std::string& _map_name) +{ + m_map_name = _map_name; +} + +/*! + * @brief This function moves the value in member map_name + * @param _map_name New value to be moved in member map_name + */ +void carla_msgs::msg::CarlaWorldInfo::map_name( + std::string&& _map_name) +{ + m_map_name = std::move(_map_name); +} + +/*! + * @brief This function returns a constant reference to member map_name + * @return Constant reference to member map_name + */ +const std::string& carla_msgs::msg::CarlaWorldInfo::map_name() const +{ + return m_map_name; +} + +/*! + * @brief This function returns a reference to member map_name + * @return Reference to member map_name + */ +std::string& carla_msgs::msg::CarlaWorldInfo::map_name() +{ + return m_map_name; +} +/*! + * @brief This function copies the value in member opendrive + * @param _opendrive New value to be copied in member opendrive + */ +void carla_msgs::msg::CarlaWorldInfo::opendrive( + const std::string& _opendrive) +{ + m_opendrive = _opendrive; +} + +/*! + * @brief This function moves the value in member opendrive + * @param _opendrive New value to be moved in member opendrive + */ +void carla_msgs::msg::CarlaWorldInfo::opendrive( + std::string&& _opendrive) +{ + m_opendrive = std::move(_opendrive); +} + +/*! + * @brief This function returns a constant reference to member opendrive + * @return Constant reference to member opendrive + */ +const std::string& carla_msgs::msg::CarlaWorldInfo::opendrive() const +{ + return m_opendrive; +} + +/*! + * @brief This function returns a reference to member opendrive + * @return Reference to member opendrive + */ +std::string& carla_msgs::msg::CarlaWorldInfo::opendrive() +{ + return m_opendrive; +} + +size_t carla_msgs::msg::CarlaWorldInfo::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::msg::CarlaWorldInfo::isKeyDefined() +{ + return false; +} + +void carla_msgs::msg::CarlaWorldInfo::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h new file mode 100644 index 00000000000..2bf1f07a233 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h @@ -0,0 +1,242 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWorldInfo.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CarlaWorldInfo_SOURCE) +#define CarlaWorldInfo_DllAPI __declspec( dllexport ) +#else +#define CarlaWorldInfo_DllAPI __declspec( dllimport ) +#endif // CarlaWorldInfo_SOURCE +#else +#define CarlaWorldInfo_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CarlaWorldInfo_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace msg { + /*! + * @brief This class represents the structure CarlaWorldInfo defined by the user in the IDL file. + * @ingroup CARLAWORLDINFO + */ + class CarlaWorldInfo + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaWorldInfo(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaWorldInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. + */ + eProsima_user_DllExport CarlaWorldInfo( + const CarlaWorldInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. + */ + eProsima_user_DllExport CarlaWorldInfo( + CarlaWorldInfo&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. + */ + eProsima_user_DllExport CarlaWorldInfo& operator =( + const CarlaWorldInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. + */ + eProsima_user_DllExport CarlaWorldInfo& operator =( + CarlaWorldInfo&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWorldInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaWorldInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWorldInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaWorldInfo& x) const; + + /*! + * @brief This function copies the value in member map_name + * @param _map_name New value to be copied in member map_name + */ + eProsima_user_DllExport void map_name( + const std::string& _map_name); + + /*! + * @brief This function moves the value in member map_name + * @param _map_name New value to be moved in member map_name + */ + eProsima_user_DllExport void map_name( + std::string&& _map_name); + + /*! + * @brief This function returns a constant reference to member map_name + * @return Constant reference to member map_name + */ + eProsima_user_DllExport const std::string& map_name() const; + + /*! + * @brief This function returns a reference to member map_name + * @return Reference to member map_name + */ + eProsima_user_DllExport std::string& map_name(); + /*! + * @brief This function copies the value in member opendrive + * @param _opendrive New value to be copied in member opendrive + */ + eProsima_user_DllExport void opendrive( + const std::string& _opendrive); + + /*! + * @brief This function moves the value in member opendrive + * @param _opendrive New value to be moved in member opendrive + */ + eProsima_user_DllExport void opendrive( + std::string&& _opendrive); + + /*! + * @brief This function returns a constant reference to member opendrive + * @return Constant reference to member opendrive + */ + eProsima_user_DllExport const std::string& opendrive() const; + + /*! + * @brief This function returns a reference to member opendrive + * @return Reference to member opendrive + */ + eProsima_user_DllExport std::string& opendrive(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::msg::CarlaWorldInfo& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::string m_map_name; + std::string m_opendrive; + }; + } // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.cxx new file mode 100644 index 00000000000..5fbc333d593 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWorldInfoPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CarlaWorldInfoPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace msg { + CarlaWorldInfoPubSubType::CarlaWorldInfoPubSubType() + { + setName("carla_msgs::msg::dds_::CarlaWorldInfo_"); + auto type_size = CarlaWorldInfo::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CarlaWorldInfo::isKeyDefined(); + size_t keyLength = CarlaWorldInfo::getKeyMaxCdrSerializedSize() > 16 ? + CarlaWorldInfo::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CarlaWorldInfoPubSubType::~CarlaWorldInfoPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CarlaWorldInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CarlaWorldInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CarlaWorldInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CarlaWorldInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CarlaWorldInfoPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CarlaWorldInfoPubSubType::createData() + { + return reinterpret_cast(new CarlaWorldInfo()); + } + + void CarlaWorldInfoPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CarlaWorldInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CarlaWorldInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CarlaWorldInfo::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CarlaWorldInfo::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.h new file mode 100644 index 00000000000..4ae4a0036e8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWorldInfoPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_PUBSUBTYPES_H_ + +#include +#include + +#include "CarlaWorldInfo.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CarlaWorldInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CarlaWorldInfo defined by the user in the IDL file. + * @ingroup CARLAWORLDINFO + */ + class CarlaWorldInfoPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CarlaWorldInfo type; + + eProsima_user_DllExport CarlaWorldInfoPubSubType(); + + eProsima_user_DllExport virtual ~CarlaWorldInfoPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.cxx new file mode 100644 index 00000000000..dc5fa93adfc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.cxx @@ -0,0 +1,329 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DestroyObject.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DestroyObject.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::srv::DestroyObject_Request::DestroyObject_Request() +{ + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@32a068d1 + m_id = 0; + +} + +carla_msgs::srv::DestroyObject_Request::~DestroyObject_Request() +{ +} + +carla_msgs::srv::DestroyObject_Request::DestroyObject_Request( + const DestroyObject_Request& x) +{ + m_id = x.m_id; +} + +carla_msgs::srv::DestroyObject_Request::DestroyObject_Request( + DestroyObject_Request&& x) +{ + m_id = x.m_id; +} + +carla_msgs::srv::DestroyObject_Request& carla_msgs::srv::DestroyObject_Request::operator =( + const DestroyObject_Request& x) +{ + + m_id = x.m_id; + + return *this; +} + +carla_msgs::srv::DestroyObject_Request& carla_msgs::srv::DestroyObject_Request::operator =( + DestroyObject_Request&& x) +{ + + m_id = x.m_id; + + return *this; +} + +bool carla_msgs::srv::DestroyObject_Request::operator ==( + const DestroyObject_Request& x) const +{ + + return (m_id == x.m_id); +} + +bool carla_msgs::srv::DestroyObject_Request::operator !=( + const DestroyObject_Request& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::DestroyObject_Request::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::DestroyObject_Request::getCdrSerializedSize( + const carla_msgs::srv::DestroyObject_Request& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::DestroyObject_Request::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_id; + +} + +void carla_msgs::srv::DestroyObject_Request::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_id; +} + +/*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ +void carla_msgs::srv::DestroyObject_Request::id( + int32_t _id) +{ + m_id = _id; +} + +/*! + * @brief This function returns the value of member id + * @return Value of member id + */ +int32_t carla_msgs::srv::DestroyObject_Request::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +int32_t& carla_msgs::srv::DestroyObject_Request::id() +{ + return m_id; +} + + +size_t carla_msgs::srv::DestroyObject_Request::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::DestroyObject_Request::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::DestroyObject_Request::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + +carla_msgs::srv::DestroyObject_Response::DestroyObject_Response() +{ + // m_success com.eprosima.idl.parser.typecode.PrimitiveTypeCode@62fdb4a6 + m_success = false; + +} + +carla_msgs::srv::DestroyObject_Response::~DestroyObject_Response() +{ +} + +carla_msgs::srv::DestroyObject_Response::DestroyObject_Response( + const DestroyObject_Response& x) +{ + m_success = x.m_success; +} + +carla_msgs::srv::DestroyObject_Response::DestroyObject_Response( + DestroyObject_Response&& x) +{ + m_success = x.m_success; +} + +carla_msgs::srv::DestroyObject_Response& carla_msgs::srv::DestroyObject_Response::operator =( + const DestroyObject_Response& x) +{ + + m_success = x.m_success; + + return *this; +} + +carla_msgs::srv::DestroyObject_Response& carla_msgs::srv::DestroyObject_Response::operator =( + DestroyObject_Response&& x) +{ + + m_success = x.m_success; + + return *this; +} + +bool carla_msgs::srv::DestroyObject_Response::operator ==( + const DestroyObject_Response& x) const +{ + + return (m_success == x.m_success); +} + +bool carla_msgs::srv::DestroyObject_Response::operator !=( + const DestroyObject_Response& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::DestroyObject_Response::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::DestroyObject_Response::getCdrSerializedSize( + const carla_msgs::srv::DestroyObject_Response& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::DestroyObject_Response::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_success; + +} + +void carla_msgs::srv::DestroyObject_Response::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_success; +} + +/*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ +void carla_msgs::srv::DestroyObject_Response::success( + bool _success) +{ + m_success = _success; +} + +/*! + * @brief This function returns the value of member success + * @return Value of member success + */ +bool carla_msgs::srv::DestroyObject_Response::success() const +{ + return m_success; +} + +/*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ +bool& carla_msgs::srv::DestroyObject_Response::success() +{ + return m_success; +} + + +size_t carla_msgs::srv::DestroyObject_Response::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::DestroyObject_Response::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::DestroyObject_Response::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.h new file mode 100644 index 00000000000..f505e6a1f17 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.h @@ -0,0 +1,351 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DestroyObject.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DestroyObject_SOURCE) +#define DestroyObject_DllAPI __declspec( dllexport ) +#else +#define DestroyObject_DllAPI __declspec( dllimport ) +#endif // DestroyObject_SOURCE +#else +#define DestroyObject_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DestroyObject_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace srv { + /*! + * @brief This class represents the structure DestroyObject_Request defined by the user in the IDL file. + * @ingroup DESTROYOBJECT + */ + class DestroyObject_Request + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DestroyObject_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DestroyObject_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. + */ + eProsima_user_DllExport DestroyObject_Request( + const DestroyObject_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. + */ + eProsima_user_DllExport DestroyObject_Request( + DestroyObject_Request&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. + */ + eProsima_user_DllExport DestroyObject_Request& operator =( + const DestroyObject_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. + */ + eProsima_user_DllExport DestroyObject_Request& operator =( + DestroyObject_Request&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::DestroyObject_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DestroyObject_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::DestroyObject_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DestroyObject_Request& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + int32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport int32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport int32_t& id(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::DestroyObject_Request& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int32_t m_id; + }; + /*! + * @brief This class represents the structure DestroyObject_Response defined by the user in the IDL file. + * @ingroup DESTROYOBJECT + */ + class DestroyObject_Response + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DestroyObject_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DestroyObject_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. + */ + eProsima_user_DllExport DestroyObject_Response( + const DestroyObject_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. + */ + eProsima_user_DllExport DestroyObject_Response( + DestroyObject_Response&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. + */ + eProsima_user_DllExport DestroyObject_Response& operator =( + const DestroyObject_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. + */ + eProsima_user_DllExport DestroyObject_Response& operator =( + DestroyObject_Response&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::DestroyObject_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DestroyObject_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::DestroyObject_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DestroyObject_Response& x) const; + + /*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ + eProsima_user_DllExport void success( + bool _success); + + /*! + * @brief This function returns the value of member success + * @return Value of member success + */ + eProsima_user_DllExport bool success() const; + + /*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ + eProsima_user_DllExport bool& success(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::DestroyObject_Response& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + bool m_success; + }; + } // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.cxx new file mode 100644 index 00000000000..0b32cd6ee2f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.cxx @@ -0,0 +1,316 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DestroyObjectPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DestroyObjectPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace srv { + DestroyObject_RequestPubSubType::DestroyObject_RequestPubSubType() + { + setName("carla_msgs::srv::dds_::DestroyObject_Request_"); + auto type_size = DestroyObject_Request::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DestroyObject_Request::isKeyDefined(); + size_t keyLength = DestroyObject_Request::getKeyMaxCdrSerializedSize() > 16 ? + DestroyObject_Request::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DestroyObject_RequestPubSubType::~DestroyObject_RequestPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DestroyObject_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DestroyObject_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DestroyObject_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DestroyObject_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DestroyObject_RequestPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DestroyObject_RequestPubSubType::createData() + { + return reinterpret_cast(new DestroyObject_Request()); + } + + void DestroyObject_RequestPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DestroyObject_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DestroyObject_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DestroyObject_Request::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DestroyObject_Request::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + DestroyObject_ResponsePubSubType::DestroyObject_ResponsePubSubType() + { + setName("carla_msgs::srv::dds_::DestroyObject_Response_"); + auto type_size = DestroyObject_Response::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DestroyObject_Response::isKeyDefined(); + size_t keyLength = DestroyObject_Response::getKeyMaxCdrSerializedSize() > 16 ? + DestroyObject_Response::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DestroyObject_ResponsePubSubType::~DestroyObject_ResponsePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DestroyObject_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DestroyObject_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DestroyObject_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DestroyObject_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DestroyObject_ResponsePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DestroyObject_ResponsePubSubType::createData() + { + return reinterpret_cast(new DestroyObject_Response()); + } + + void DestroyObject_ResponsePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DestroyObject_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DestroyObject_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DestroyObject_Response::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DestroyObject_Response::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace srv + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.h new file mode 100644 index 00000000000..06d7a601072 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.h @@ -0,0 +1,171 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DestroyObjectPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_PUBSUBTYPES_H_ + +#include +#include + +#include "DestroyObject.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated DestroyObject is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace srv + { + /*! + * @brief This class represents the TopicDataType of the type DestroyObject_Request defined by the user in the IDL file. + * @ingroup DESTROYOBJECT + */ + class DestroyObject_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DestroyObject_Request type; + + eProsima_user_DllExport DestroyObject_RequestPubSubType(); + + eProsima_user_DllExport virtual ~DestroyObject_RequestPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DestroyObject_Request(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + /*! + * @brief This class represents the TopicDataType of the type DestroyObject_Response defined by the user in the IDL file. + * @ingroup DESTROYOBJECT + */ + class DestroyObject_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DestroyObject_Response type; + + eProsima_user_DllExport DestroyObject_ResponsePubSubType(); + + eProsima_user_DllExport virtual ~DestroyObject_ResponsePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DestroyObject_Response(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.cxx new file mode 100644 index 00000000000..86a1288538a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.cxx @@ -0,0 +1,344 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetAvailableMaps.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "GetAvailableMaps.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::srv::GetAvailableMaps_Request::GetAvailableMaps_Request() +{ + // m_structure_needs_at_least_one_member com.eprosima.idl.parser.typecode.PrimitiveTypeCode@70b0b186 + m_structure_needs_at_least_one_member = 0; + +} + +carla_msgs::srv::GetAvailableMaps_Request::~GetAvailableMaps_Request() +{ +} + +carla_msgs::srv::GetAvailableMaps_Request::GetAvailableMaps_Request( + const GetAvailableMaps_Request& x) +{ + m_structure_needs_at_least_one_member = x.m_structure_needs_at_least_one_member; +} + +carla_msgs::srv::GetAvailableMaps_Request::GetAvailableMaps_Request( + GetAvailableMaps_Request&& x) +{ + m_structure_needs_at_least_one_member = x.m_structure_needs_at_least_one_member; +} + +carla_msgs::srv::GetAvailableMaps_Request& carla_msgs::srv::GetAvailableMaps_Request::operator =( + const GetAvailableMaps_Request& x) +{ + + m_structure_needs_at_least_one_member = x.m_structure_needs_at_least_one_member; + + return *this; +} + +carla_msgs::srv::GetAvailableMaps_Request& carla_msgs::srv::GetAvailableMaps_Request::operator =( + GetAvailableMaps_Request&& x) +{ + + m_structure_needs_at_least_one_member = x.m_structure_needs_at_least_one_member; + + return *this; +} + +bool carla_msgs::srv::GetAvailableMaps_Request::operator ==( + const GetAvailableMaps_Request& x) const +{ + + return (m_structure_needs_at_least_one_member == x.m_structure_needs_at_least_one_member); +} + +bool carla_msgs::srv::GetAvailableMaps_Request::operator !=( + const GetAvailableMaps_Request& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::GetAvailableMaps_Request::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::GetAvailableMaps_Request::getCdrSerializedSize( + const carla_msgs::srv::GetAvailableMaps_Request& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::GetAvailableMaps_Request::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_structure_needs_at_least_one_member; + +} + +void carla_msgs::srv::GetAvailableMaps_Request::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_structure_needs_at_least_one_member; +} + +/*! + * @brief This function sets a value in member structure_needs_at_least_one_member + * @param _structure_needs_at_least_one_member New value for member structure_needs_at_least_one_member + */ +void carla_msgs::srv::GetAvailableMaps_Request::structure_needs_at_least_one_member( + uint8_t _structure_needs_at_least_one_member) +{ + m_structure_needs_at_least_one_member = _structure_needs_at_least_one_member; +} + +/*! + * @brief This function returns the value of member structure_needs_at_least_one_member + * @return Value of member structure_needs_at_least_one_member + */ +uint8_t carla_msgs::srv::GetAvailableMaps_Request::structure_needs_at_least_one_member() const +{ + return m_structure_needs_at_least_one_member; +} + +/*! + * @brief This function returns a reference to member structure_needs_at_least_one_member + * @return Reference to member structure_needs_at_least_one_member + */ +uint8_t& carla_msgs::srv::GetAvailableMaps_Request::structure_needs_at_least_one_member() +{ + return m_structure_needs_at_least_one_member; +} + + +size_t carla_msgs::srv::GetAvailableMaps_Request::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::GetAvailableMaps_Request::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::GetAvailableMaps_Request::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + +carla_msgs::srv::GetAvailableMaps_Response::GetAvailableMaps_Response() +{ + // m_maps com.eprosima.idl.parser.typecode.SequenceTypeCode@1e67a849 + + +} + +carla_msgs::srv::GetAvailableMaps_Response::~GetAvailableMaps_Response() +{ +} + +carla_msgs::srv::GetAvailableMaps_Response::GetAvailableMaps_Response( + const GetAvailableMaps_Response& x) +{ + m_maps = x.m_maps; +} + +carla_msgs::srv::GetAvailableMaps_Response::GetAvailableMaps_Response( + GetAvailableMaps_Response&& x) +{ + m_maps = std::move(x.m_maps); +} + +carla_msgs::srv::GetAvailableMaps_Response& carla_msgs::srv::GetAvailableMaps_Response::operator =( + const GetAvailableMaps_Response& x) +{ + + m_maps = x.m_maps; + + return *this; +} + +carla_msgs::srv::GetAvailableMaps_Response& carla_msgs::srv::GetAvailableMaps_Response::operator =( + GetAvailableMaps_Response&& x) +{ + + m_maps = std::move(x.m_maps); + + return *this; +} + +bool carla_msgs::srv::GetAvailableMaps_Response::operator ==( + const GetAvailableMaps_Response& x) const +{ + + return (m_maps == x.m_maps); +} + +bool carla_msgs::srv::GetAvailableMaps_Response::operator !=( + const GetAvailableMaps_Response& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::GetAvailableMaps_Response::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + } + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::GetAvailableMaps_Response::getCdrSerializedSize( + const carla_msgs::srv::GetAvailableMaps_Response& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.maps().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + + data.maps().at(a).size() + 1; + } + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::GetAvailableMaps_Response::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_maps;} + +void carla_msgs::srv::GetAvailableMaps_Response::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_maps;} + +/*! + * @brief This function copies the value in member maps + * @param _maps New value to be copied in member maps + */ +void carla_msgs::srv::GetAvailableMaps_Response::maps( + const std::vector& _maps) +{ + m_maps = _maps; +} + +/*! + * @brief This function moves the value in member maps + * @param _maps New value to be moved in member maps + */ +void carla_msgs::srv::GetAvailableMaps_Response::maps( + std::vector&& _maps) +{ + m_maps = std::move(_maps); +} + +/*! + * @brief This function returns a constant reference to member maps + * @return Constant reference to member maps + */ +const std::vector& carla_msgs::srv::GetAvailableMaps_Response::maps() const +{ + return m_maps; +} + +/*! + * @brief This function returns a reference to member maps + * @return Reference to member maps + */ +std::vector& carla_msgs::srv::GetAvailableMaps_Response::maps() +{ + return m_maps; +} + +size_t carla_msgs::srv::GetAvailableMaps_Response::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::GetAvailableMaps_Response::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::GetAvailableMaps_Response::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.h new file mode 100644 index 00000000000..a58220f60c4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.h @@ -0,0 +1,357 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetAvailableMaps.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(GetAvailableMaps_SOURCE) +#define GetAvailableMaps_DllAPI __declspec( dllexport ) +#else +#define GetAvailableMaps_DllAPI __declspec( dllimport ) +#endif // GetAvailableMaps_SOURCE +#else +#define GetAvailableMaps_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define GetAvailableMaps_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace srv { + /*! + * @brief This class represents the structure GetAvailableMaps_Request defined by the user in the IDL file. + * @ingroup GETAVAILABLEMAPS + */ + class GetAvailableMaps_Request + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GetAvailableMaps_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GetAvailableMaps_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Request( + const GetAvailableMaps_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Request( + GetAvailableMaps_Request&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Request& operator =( + const GetAvailableMaps_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Request& operator =( + GetAvailableMaps_Request&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetAvailableMaps_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GetAvailableMaps_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetAvailableMaps_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GetAvailableMaps_Request& x) const; + + /*! + * @brief This function sets a value in member structure_needs_at_least_one_member + * @param _structure_needs_at_least_one_member New value for member structure_needs_at_least_one_member + */ + eProsima_user_DllExport void structure_needs_at_least_one_member( + uint8_t _structure_needs_at_least_one_member); + + /*! + * @brief This function returns the value of member structure_needs_at_least_one_member + * @return Value of member structure_needs_at_least_one_member + */ + eProsima_user_DllExport uint8_t structure_needs_at_least_one_member() const; + + /*! + * @brief This function returns a reference to member structure_needs_at_least_one_member + * @return Reference to member structure_needs_at_least_one_member + */ + eProsima_user_DllExport uint8_t& structure_needs_at_least_one_member(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::GetAvailableMaps_Request& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_structure_needs_at_least_one_member; + }; + /*! + * @brief This class represents the structure GetAvailableMaps_Response defined by the user in the IDL file. + * @ingroup GETAVAILABLEMAPS + */ + class GetAvailableMaps_Response + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GetAvailableMaps_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GetAvailableMaps_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Response( + const GetAvailableMaps_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Response( + GetAvailableMaps_Response&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Response& operator =( + const GetAvailableMaps_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Response& operator =( + GetAvailableMaps_Response&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetAvailableMaps_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GetAvailableMaps_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetAvailableMaps_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GetAvailableMaps_Response& x) const; + + /*! + * @brief This function copies the value in member maps + * @param _maps New value to be copied in member maps + */ + eProsima_user_DllExport void maps( + const std::vector& _maps); + + /*! + * @brief This function moves the value in member maps + * @param _maps New value to be moved in member maps + */ + eProsima_user_DllExport void maps( + std::vector&& _maps); + + /*! + * @brief This function returns a constant reference to member maps + * @return Constant reference to member maps + */ + eProsima_user_DllExport const std::vector& maps() const; + + /*! + * @brief This function returns a reference to member maps + * @return Reference to member maps + */ + eProsima_user_DllExport std::vector& maps(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::GetAvailableMaps_Response& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_maps; + }; + } // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.cxx new file mode 100644 index 00000000000..dc46fb0e1a3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.cxx @@ -0,0 +1,316 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetAvailableMapsPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "GetAvailableMapsPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace srv { + GetAvailableMaps_RequestPubSubType::GetAvailableMaps_RequestPubSubType() + { + setName("carla_msgs::srv::dds_::GetAvailableMaps_Request_"); + auto type_size = GetAvailableMaps_Request::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = GetAvailableMaps_Request::isKeyDefined(); + size_t keyLength = GetAvailableMaps_Request::getKeyMaxCdrSerializedSize() > 16 ? + GetAvailableMaps_Request::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + GetAvailableMaps_RequestPubSubType::~GetAvailableMaps_RequestPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool GetAvailableMaps_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + GetAvailableMaps_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool GetAvailableMaps_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + GetAvailableMaps_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function GetAvailableMaps_RequestPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* GetAvailableMaps_RequestPubSubType::createData() + { + return reinterpret_cast(new GetAvailableMaps_Request()); + } + + void GetAvailableMaps_RequestPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool GetAvailableMaps_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + GetAvailableMaps_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + GetAvailableMaps_Request::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || GetAvailableMaps_Request::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + GetAvailableMaps_ResponsePubSubType::GetAvailableMaps_ResponsePubSubType() + { + setName("carla_msgs::srv::dds_::GetAvailableMaps_Response_"); + auto type_size = GetAvailableMaps_Response::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = GetAvailableMaps_Response::isKeyDefined(); + size_t keyLength = GetAvailableMaps_Response::getKeyMaxCdrSerializedSize() > 16 ? + GetAvailableMaps_Response::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + GetAvailableMaps_ResponsePubSubType::~GetAvailableMaps_ResponsePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool GetAvailableMaps_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + GetAvailableMaps_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool GetAvailableMaps_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + GetAvailableMaps_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function GetAvailableMaps_ResponsePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* GetAvailableMaps_ResponsePubSubType::createData() + { + return reinterpret_cast(new GetAvailableMaps_Response()); + } + + void GetAvailableMaps_ResponsePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool GetAvailableMaps_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + GetAvailableMaps_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + GetAvailableMaps_Response::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || GetAvailableMaps_Response::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace srv + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.h new file mode 100644 index 00000000000..d9da4b72170 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.h @@ -0,0 +1,171 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetAvailableMapsPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_PUBSUBTYPES_H_ + +#include +#include + +#include "GetAvailableMaps.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated GetAvailableMaps is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace srv + { + /*! + * @brief This class represents the TopicDataType of the type GetAvailableMaps_Request defined by the user in the IDL file. + * @ingroup GETAVAILABLEMAPS + */ + class GetAvailableMaps_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef GetAvailableMaps_Request type; + + eProsima_user_DllExport GetAvailableMaps_RequestPubSubType(); + + eProsima_user_DllExport virtual ~GetAvailableMaps_RequestPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) GetAvailableMaps_Request(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + /*! + * @brief This class represents the TopicDataType of the type GetAvailableMaps_Response defined by the user in the IDL file. + * @ingroup GETAVAILABLEMAPS + */ + class GetAvailableMaps_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef GetAvailableMaps_Response type; + + eProsima_user_DllExport GetAvailableMaps_ResponsePubSubType(); + + eProsima_user_DllExport virtual ~GetAvailableMaps_ResponsePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.cxx new file mode 100644 index 00000000000..8110bf119b9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.cxx @@ -0,0 +1,351 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetBlueprints.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "GetBlueprints.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::srv::GetBlueprints_Request::GetBlueprints_Request() +{ + // m_filter com.eprosima.idl.parser.typecode.StringTypeCode@7c417213 + m_filter =""; + +} + +carla_msgs::srv::GetBlueprints_Request::~GetBlueprints_Request() +{ +} + +carla_msgs::srv::GetBlueprints_Request::GetBlueprints_Request( + const GetBlueprints_Request& x) +{ + m_filter = x.m_filter; +} + +carla_msgs::srv::GetBlueprints_Request::GetBlueprints_Request( + GetBlueprints_Request&& x) +{ + m_filter = std::move(x.m_filter); +} + +carla_msgs::srv::GetBlueprints_Request& carla_msgs::srv::GetBlueprints_Request::operator =( + const GetBlueprints_Request& x) +{ + + m_filter = x.m_filter; + + return *this; +} + +carla_msgs::srv::GetBlueprints_Request& carla_msgs::srv::GetBlueprints_Request::operator =( + GetBlueprints_Request&& x) +{ + + m_filter = std::move(x.m_filter); + + return *this; +} + +bool carla_msgs::srv::GetBlueprints_Request::operator ==( + const GetBlueprints_Request& x) const +{ + + return (m_filter == x.m_filter); +} + +bool carla_msgs::srv::GetBlueprints_Request::operator !=( + const GetBlueprints_Request& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::GetBlueprints_Request::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::GetBlueprints_Request::getCdrSerializedSize( + const carla_msgs::srv::GetBlueprints_Request& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.filter().size() + 1; + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::GetBlueprints_Request::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_filter; + +} + +void carla_msgs::srv::GetBlueprints_Request::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_filter; +} + +/*! + * @brief This function copies the value in member filter + * @param _filter New value to be copied in member filter + */ +void carla_msgs::srv::GetBlueprints_Request::filter( + const std::string& _filter) +{ + m_filter = _filter; +} + +/*! + * @brief This function moves the value in member filter + * @param _filter New value to be moved in member filter + */ +void carla_msgs::srv::GetBlueprints_Request::filter( + std::string&& _filter) +{ + m_filter = std::move(_filter); +} + +/*! + * @brief This function returns a constant reference to member filter + * @return Constant reference to member filter + */ +const std::string& carla_msgs::srv::GetBlueprints_Request::filter() const +{ + return m_filter; +} + +/*! + * @brief This function returns a reference to member filter + * @return Reference to member filter + */ +std::string& carla_msgs::srv::GetBlueprints_Request::filter() +{ + return m_filter; +} + +size_t carla_msgs::srv::GetBlueprints_Request::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::GetBlueprints_Request::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::GetBlueprints_Request::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + +carla_msgs::srv::GetBlueprints_Response::GetBlueprints_Response() +{ + // m_blueprints com.eprosima.idl.parser.typecode.SequenceTypeCode@5e4c8041 + + +} + +carla_msgs::srv::GetBlueprints_Response::~GetBlueprints_Response() +{ +} + +carla_msgs::srv::GetBlueprints_Response::GetBlueprints_Response( + const GetBlueprints_Response& x) +{ + m_blueprints = x.m_blueprints; +} + +carla_msgs::srv::GetBlueprints_Response::GetBlueprints_Response( + GetBlueprints_Response&& x) +{ + m_blueprints = std::move(x.m_blueprints); +} + +carla_msgs::srv::GetBlueprints_Response& carla_msgs::srv::GetBlueprints_Response::operator =( + const GetBlueprints_Response& x) +{ + + m_blueprints = x.m_blueprints; + + return *this; +} + +carla_msgs::srv::GetBlueprints_Response& carla_msgs::srv::GetBlueprints_Response::operator =( + GetBlueprints_Response&& x) +{ + + m_blueprints = std::move(x.m_blueprints); + + return *this; +} + +bool carla_msgs::srv::GetBlueprints_Response::operator ==( + const GetBlueprints_Response& x) const +{ + + return (m_blueprints == x.m_blueprints); +} + +bool carla_msgs::srv::GetBlueprints_Response::operator !=( + const GetBlueprints_Response& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::GetBlueprints_Response::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += carla_msgs::msg::CarlaActorBlueprint::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::GetBlueprints_Response::getCdrSerializedSize( + const carla_msgs::srv::GetBlueprints_Response& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.blueprints().size(); ++a) + { + current_alignment += carla_msgs::msg::CarlaActorBlueprint::getCdrSerializedSize(data.blueprints().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::GetBlueprints_Response::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_blueprints; +} + +void carla_msgs::srv::GetBlueprints_Response::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_blueprints;} + +/*! + * @brief This function copies the value in member blueprints + * @param _blueprints New value to be copied in member blueprints + */ +void carla_msgs::srv::GetBlueprints_Response::blueprints( + const std::vector& _blueprints) +{ + m_blueprints = _blueprints; +} + +/*! + * @brief This function moves the value in member blueprints + * @param _blueprints New value to be moved in member blueprints + */ +void carla_msgs::srv::GetBlueprints_Response::blueprints( + std::vector&& _blueprints) +{ + m_blueprints = std::move(_blueprints); +} + +/*! + * @brief This function returns a constant reference to member blueprints + * @return Constant reference to member blueprints + */ +const std::vector& carla_msgs::srv::GetBlueprints_Response::blueprints() const +{ + return m_blueprints; +} + +/*! + * @brief This function returns a reference to member blueprints + * @return Reference to member blueprints + */ +std::vector& carla_msgs::srv::GetBlueprints_Response::blueprints() +{ + return m_blueprints; +} + +size_t carla_msgs::srv::GetBlueprints_Response::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::GetBlueprints_Response::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::GetBlueprints_Response::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.h new file mode 100644 index 00000000000..548a7b44cf1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.h @@ -0,0 +1,364 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetBlueprints.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_H_ + +#include "carla_msgs/msg/CarlaActorBlueprint.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(GetBlueprints_SOURCE) +#define GetBlueprints_DllAPI __declspec( dllexport ) +#else +#define GetBlueprints_DllAPI __declspec( dllimport ) +#endif // GetBlueprints_SOURCE +#else +#define GetBlueprints_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define GetBlueprints_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace srv { + /*! + * @brief This class represents the structure GetBlueprints_Request defined by the user in the IDL file. + * @ingroup GETBLUEPRINTS + */ + class GetBlueprints_Request + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GetBlueprints_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GetBlueprints_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Request( + const GetBlueprints_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Request( + GetBlueprints_Request&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Request& operator =( + const GetBlueprints_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Request& operator =( + GetBlueprints_Request&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetBlueprints_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GetBlueprints_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetBlueprints_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GetBlueprints_Request& x) const; + + /*! + * @brief This function copies the value in member filter + * @param _filter New value to be copied in member filter + */ + eProsima_user_DllExport void filter( + const std::string& _filter); + + /*! + * @brief This function moves the value in member filter + * @param _filter New value to be moved in member filter + */ + eProsima_user_DllExport void filter( + std::string&& _filter); + + /*! + * @brief This function returns a constant reference to member filter + * @return Constant reference to member filter + */ + eProsima_user_DllExport const std::string& filter() const; + + /*! + * @brief This function returns a reference to member filter + * @return Reference to member filter + */ + eProsima_user_DllExport std::string& filter(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::GetBlueprints_Request& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::string m_filter; + }; + /*! + * @brief This class represents the structure GetBlueprints_Response defined by the user in the IDL file. + * @ingroup GETBLUEPRINTS + */ + class GetBlueprints_Response + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GetBlueprints_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GetBlueprints_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Response( + const GetBlueprints_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Response( + GetBlueprints_Response&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Response& operator =( + const GetBlueprints_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Response& operator =( + GetBlueprints_Response&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetBlueprints_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GetBlueprints_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetBlueprints_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GetBlueprints_Response& x) const; + + /*! + * @brief This function copies the value in member blueprints + * @param _blueprints New value to be copied in member blueprints + */ + eProsima_user_DllExport void blueprints( + const std::vector& _blueprints); + + /*! + * @brief This function moves the value in member blueprints + * @param _blueprints New value to be moved in member blueprints + */ + eProsima_user_DllExport void blueprints( + std::vector&& _blueprints); + + /*! + * @brief This function returns a constant reference to member blueprints + * @return Constant reference to member blueprints + */ + eProsima_user_DllExport const std::vector& blueprints() const; + + /*! + * @brief This function returns a reference to member blueprints + * @return Reference to member blueprints + */ + eProsima_user_DllExport std::vector& blueprints(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::GetBlueprints_Response& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_blueprints; + }; + } // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.cxx new file mode 100644 index 00000000000..5c0b0f12ec1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.cxx @@ -0,0 +1,316 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetBlueprintsPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "GetBlueprintsPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace srv { + GetBlueprints_RequestPubSubType::GetBlueprints_RequestPubSubType() + { + setName("carla_msgs::srv::dds_::GetBlueprints_Request_"); + auto type_size = GetBlueprints_Request::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = GetBlueprints_Request::isKeyDefined(); + size_t keyLength = GetBlueprints_Request::getKeyMaxCdrSerializedSize() > 16 ? + GetBlueprints_Request::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + GetBlueprints_RequestPubSubType::~GetBlueprints_RequestPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool GetBlueprints_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + GetBlueprints_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool GetBlueprints_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + GetBlueprints_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function GetBlueprints_RequestPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* GetBlueprints_RequestPubSubType::createData() + { + return reinterpret_cast(new GetBlueprints_Request()); + } + + void GetBlueprints_RequestPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool GetBlueprints_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + GetBlueprints_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + GetBlueprints_Request::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || GetBlueprints_Request::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + GetBlueprints_ResponsePubSubType::GetBlueprints_ResponsePubSubType() + { + setName("carla_msgs::srv::dds_::GetBlueprints_Response_"); + auto type_size = GetBlueprints_Response::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = GetBlueprints_Response::isKeyDefined(); + size_t keyLength = GetBlueprints_Response::getKeyMaxCdrSerializedSize() > 16 ? + GetBlueprints_Response::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + GetBlueprints_ResponsePubSubType::~GetBlueprints_ResponsePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool GetBlueprints_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + GetBlueprints_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool GetBlueprints_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + GetBlueprints_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function GetBlueprints_ResponsePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* GetBlueprints_ResponsePubSubType::createData() + { + return reinterpret_cast(new GetBlueprints_Response()); + } + + void GetBlueprints_ResponsePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool GetBlueprints_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + GetBlueprints_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + GetBlueprints_Response::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || GetBlueprints_Response::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace srv + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.h new file mode 100644 index 00000000000..d609fa66c15 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.h @@ -0,0 +1,171 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetBlueprintsPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_PUBSUBTYPES_H_ + +#include +#include + +#include "GetBlueprints.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated GetBlueprints is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace srv + { + /*! + * @brief This class represents the TopicDataType of the type GetBlueprints_Request defined by the user in the IDL file. + * @ingroup GETBLUEPRINTS + */ + class GetBlueprints_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef GetBlueprints_Request type; + + eProsima_user_DllExport GetBlueprints_RequestPubSubType(); + + eProsima_user_DllExport virtual ~GetBlueprints_RequestPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + /*! + * @brief This class represents the TopicDataType of the type GetBlueprints_Response defined by the user in the IDL file. + * @ingroup GETBLUEPRINTS + */ + class GetBlueprints_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef GetBlueprints_Response type; + + eProsima_user_DllExport GetBlueprints_ResponsePubSubType(); + + eProsima_user_DllExport virtual ~GetBlueprints_ResponsePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.cxx new file mode 100644 index 00000000000..8b0e9aab91a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.cxx @@ -0,0 +1,479 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoadMap.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LoadMap.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + +carla_msgs::srv::LoadMap_Request::LoadMap_Request() +{ + // m_mapname com.eprosima.idl.parser.typecode.StringTypeCode@3d3fcdb0 + m_mapname =""; + // m_force_reload com.eprosima.idl.parser.typecode.PrimitiveTypeCode@641147d0 + m_force_reload = false; + // m_reset_episode_settings com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e38921c + m_reset_episode_settings = true; + // m_map_layers com.eprosima.idl.parser.typecode.PrimitiveTypeCode@64d7f7e0 + m_map_layers = 65535; + +} + +carla_msgs::srv::LoadMap_Request::~LoadMap_Request() +{ + + + +} + +carla_msgs::srv::LoadMap_Request::LoadMap_Request( + const LoadMap_Request& x) +{ + m_mapname = x.m_mapname; + m_force_reload = x.m_force_reload; + m_reset_episode_settings = x.m_reset_episode_settings; + m_map_layers = x.m_map_layers; +} + +carla_msgs::srv::LoadMap_Request::LoadMap_Request( + LoadMap_Request&& x) +{ + m_mapname = std::move(x.m_mapname); + m_force_reload = x.m_force_reload; + m_reset_episode_settings = x.m_reset_episode_settings; + m_map_layers = x.m_map_layers; +} + +carla_msgs::srv::LoadMap_Request& carla_msgs::srv::LoadMap_Request::operator =( + const LoadMap_Request& x) +{ + + m_mapname = x.m_mapname; + m_force_reload = x.m_force_reload; + m_reset_episode_settings = x.m_reset_episode_settings; + m_map_layers = x.m_map_layers; + + return *this; +} + +carla_msgs::srv::LoadMap_Request& carla_msgs::srv::LoadMap_Request::operator =( + LoadMap_Request&& x) +{ + + m_mapname = std::move(x.m_mapname); + m_force_reload = x.m_force_reload; + m_reset_episode_settings = x.m_reset_episode_settings; + m_map_layers = x.m_map_layers; + + return *this; +} + +bool carla_msgs::srv::LoadMap_Request::operator ==( + const LoadMap_Request& x) const +{ + + return (m_mapname == x.m_mapname && m_force_reload == x.m_force_reload && m_reset_episode_settings == x.m_reset_episode_settings && m_map_layers == x.m_map_layers); +} + +bool carla_msgs::srv::LoadMap_Request::operator !=( + const LoadMap_Request& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::LoadMap_Request::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::LoadMap_Request::getCdrSerializedSize( + const carla_msgs::srv::LoadMap_Request& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.mapname().size() + 1; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::LoadMap_Request::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_mapname; + scdr << m_force_reload; + scdr << m_reset_episode_settings; + scdr << m_map_layers; + +} + +void carla_msgs::srv::LoadMap_Request::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_mapname; + dcdr >> m_force_reload; + dcdr >> m_reset_episode_settings; + dcdr >> m_map_layers; +} + +/*! + * @brief This function copies the value in member mapname + * @param _mapname New value to be copied in member mapname + */ +void carla_msgs::srv::LoadMap_Request::mapname( + const std::string& _mapname) +{ + m_mapname = _mapname; +} + +/*! + * @brief This function moves the value in member mapname + * @param _mapname New value to be moved in member mapname + */ +void carla_msgs::srv::LoadMap_Request::mapname( + std::string&& _mapname) +{ + m_mapname = std::move(_mapname); +} + +/*! + * @brief This function returns a constant reference to member mapname + * @return Constant reference to member mapname + */ +const std::string& carla_msgs::srv::LoadMap_Request::mapname() const +{ + return m_mapname; +} + +/*! + * @brief This function returns a reference to member mapname + * @return Reference to member mapname + */ +std::string& carla_msgs::srv::LoadMap_Request::mapname() +{ + return m_mapname; +} +/*! + * @brief This function sets a value in member force_reload + * @param _force_reload New value for member force_reload + */ +void carla_msgs::srv::LoadMap_Request::force_reload( + bool _force_reload) +{ + m_force_reload = _force_reload; +} + +/*! + * @brief This function returns the value of member force_reload + * @return Value of member force_reload + */ +bool carla_msgs::srv::LoadMap_Request::force_reload() const +{ + return m_force_reload; +} + +/*! + * @brief This function returns a reference to member force_reload + * @return Reference to member force_reload + */ +bool& carla_msgs::srv::LoadMap_Request::force_reload() +{ + return m_force_reload; +} + +/*! + * @brief This function sets a value in member reset_episode_settings + * @param _reset_episode_settings New value for member reset_episode_settings + */ +void carla_msgs::srv::LoadMap_Request::reset_episode_settings( + bool _reset_episode_settings) +{ + m_reset_episode_settings = _reset_episode_settings; +} + +/*! + * @brief This function returns the value of member reset_episode_settings + * @return Value of member reset_episode_settings + */ +bool carla_msgs::srv::LoadMap_Request::reset_episode_settings() const +{ + return m_reset_episode_settings; +} + +/*! + * @brief This function returns a reference to member reset_episode_settings + * @return Reference to member reset_episode_settings + */ +bool& carla_msgs::srv::LoadMap_Request::reset_episode_settings() +{ + return m_reset_episode_settings; +} + +/*! + * @brief This function sets a value in member map_layers + * @param _map_layers New value for member map_layers + */ +void carla_msgs::srv::LoadMap_Request::map_layers( + uint16_t _map_layers) +{ + m_map_layers = _map_layers; +} + +/*! + * @brief This function returns the value of member map_layers + * @return Value of member map_layers + */ +uint16_t carla_msgs::srv::LoadMap_Request::map_layers() const +{ + return m_map_layers; +} + +/*! + * @brief This function returns a reference to member map_layers + * @return Reference to member map_layers + */ +uint16_t& carla_msgs::srv::LoadMap_Request::map_layers() +{ + return m_map_layers; +} + + +size_t carla_msgs::srv::LoadMap_Request::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::LoadMap_Request::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::LoadMap_Request::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + +carla_msgs::srv::LoadMap_Response::LoadMap_Response() +{ + // m_success com.eprosima.idl.parser.typecode.PrimitiveTypeCode@ba8d91c + m_success = false; + +} + +carla_msgs::srv::LoadMap_Response::~LoadMap_Response() +{ +} + +carla_msgs::srv::LoadMap_Response::LoadMap_Response( + const LoadMap_Response& x) +{ + m_success = x.m_success; +} + +carla_msgs::srv::LoadMap_Response::LoadMap_Response( + LoadMap_Response&& x) +{ + m_success = x.m_success; +} + +carla_msgs::srv::LoadMap_Response& carla_msgs::srv::LoadMap_Response::operator =( + const LoadMap_Response& x) +{ + + m_success = x.m_success; + + return *this; +} + +carla_msgs::srv::LoadMap_Response& carla_msgs::srv::LoadMap_Response::operator =( + LoadMap_Response&& x) +{ + + m_success = x.m_success; + + return *this; +} + +bool carla_msgs::srv::LoadMap_Response::operator ==( + const LoadMap_Response& x) const +{ + + return (m_success == x.m_success); +} + +bool carla_msgs::srv::LoadMap_Response::operator !=( + const LoadMap_Response& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::LoadMap_Response::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::LoadMap_Response::getCdrSerializedSize( + const carla_msgs::srv::LoadMap_Response& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::LoadMap_Response::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_success; + +} + +void carla_msgs::srv::LoadMap_Response::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_success; +} + +/*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ +void carla_msgs::srv::LoadMap_Response::success( + bool _success) +{ + m_success = _success; +} + +/*! + * @brief This function returns the value of member success + * @return Value of member success + */ +bool carla_msgs::srv::LoadMap_Response::success() const +{ + return m_success; +} + +/*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ +bool& carla_msgs::srv::LoadMap_Response::success() +{ + return m_success; +} + + +size_t carla_msgs::srv::LoadMap_Response::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::LoadMap_Response::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::LoadMap_Response::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.h new file mode 100644 index 00000000000..a990e38e04c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.h @@ -0,0 +1,430 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoadMap.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LoadMap_SOURCE) +#define LoadMap_DllAPI __declspec( dllexport ) +#else +#define LoadMap_DllAPI __declspec( dllimport ) +#endif // LoadMap_SOURCE +#else +#define LoadMap_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LoadMap_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace srv { + namespace LoadMap_Request_Constants { + const uint16_t MAPLAYERFLAG_NONE = 0; + const uint16_t MAPLAYERFLAG_BUILDINGS = 1; + const uint16_t MAPLAYERFLAG_DECALS = 2; + const uint16_t MAPLAYERFLAG_FOLIAGE = 4; + const uint16_t MAPLAYERFLAG_GROUND = 8; + const uint16_t MAPLAYERFLAG_PARKEDVEHICLES = 16; + const uint16_t MAPLAYERFLAG_PARTICLES = 32; + const uint16_t MAPLAYERFLAG_PROPS = 64; + const uint16_t MAPLAYERFLAG_STREETLIGHTS = 128; + const uint16_t MAPLAYERFLAG_WALLS = 256; + const uint16_t MAPLAYERFLAG_ALL = 65535; + } // namespace LoadMap_Request_Constants + /*! + * @brief This class represents the structure LoadMap_Request defined by the user in the IDL file. + * @ingroup LOADMAP + */ + class LoadMap_Request + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LoadMap_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LoadMap_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. + */ + eProsima_user_DllExport LoadMap_Request( + const LoadMap_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. + */ + eProsima_user_DllExport LoadMap_Request( + LoadMap_Request&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. + */ + eProsima_user_DllExport LoadMap_Request& operator =( + const LoadMap_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. + */ + eProsima_user_DllExport LoadMap_Request& operator =( + LoadMap_Request&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::LoadMap_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LoadMap_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::LoadMap_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LoadMap_Request& x) const; + + /*! + * @brief This function copies the value in member mapname + * @param _mapname New value to be copied in member mapname + */ + eProsima_user_DllExport void mapname( + const std::string& _mapname); + + /*! + * @brief This function moves the value in member mapname + * @param _mapname New value to be moved in member mapname + */ + eProsima_user_DllExport void mapname( + std::string&& _mapname); + + /*! + * @brief This function returns a constant reference to member mapname + * @return Constant reference to member mapname + */ + eProsima_user_DllExport const std::string& mapname() const; + + /*! + * @brief This function returns a reference to member mapname + * @return Reference to member mapname + */ + eProsima_user_DllExport std::string& mapname(); + /*! + * @brief This function sets a value in member force_reload + * @param _force_reload New value for member force_reload + */ + eProsima_user_DllExport void force_reload( + bool _force_reload); + + /*! + * @brief This function returns the value of member force_reload + * @return Value of member force_reload + */ + eProsima_user_DllExport bool force_reload() const; + + /*! + * @brief This function returns a reference to member force_reload + * @return Reference to member force_reload + */ + eProsima_user_DllExport bool& force_reload(); + + /*! + * @brief This function sets a value in member reset_episode_settings + * @param _reset_episode_settings New value for member reset_episode_settings + */ + eProsima_user_DllExport void reset_episode_settings( + bool _reset_episode_settings); + + /*! + * @brief This function returns the value of member reset_episode_settings + * @return Value of member reset_episode_settings + */ + eProsima_user_DllExport bool reset_episode_settings() const; + + /*! + * @brief This function returns a reference to member reset_episode_settings + * @return Reference to member reset_episode_settings + */ + eProsima_user_DllExport bool& reset_episode_settings(); + + /*! + * @brief This function sets a value in member map_layers + * @param _map_layers New value for member map_layers + */ + eProsima_user_DllExport void map_layers( + uint16_t _map_layers); + + /*! + * @brief This function returns the value of member map_layers + * @return Value of member map_layers + */ + eProsima_user_DllExport uint16_t map_layers() const; + + /*! + * @brief This function returns a reference to member map_layers + * @return Reference to member map_layers + */ + eProsima_user_DllExport uint16_t& map_layers(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::LoadMap_Request& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::string m_mapname; + bool m_force_reload; + bool m_reset_episode_settings; + uint16_t m_map_layers; + }; + /*! + * @brief This class represents the structure LoadMap_Response defined by the user in the IDL file. + * @ingroup LOADMAP + */ + class LoadMap_Response + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LoadMap_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LoadMap_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. + */ + eProsima_user_DllExport LoadMap_Response( + const LoadMap_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. + */ + eProsima_user_DllExport LoadMap_Response( + LoadMap_Response&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. + */ + eProsima_user_DllExport LoadMap_Response& operator =( + const LoadMap_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. + */ + eProsima_user_DllExport LoadMap_Response& operator =( + LoadMap_Response&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::LoadMap_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LoadMap_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::LoadMap_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LoadMap_Response& x) const; + + /*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ + eProsima_user_DllExport void success( + bool _success); + + /*! + * @brief This function returns the value of member success + * @return Value of member success + */ + eProsima_user_DllExport bool success() const; + + /*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ + eProsima_user_DllExport bool& success(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::LoadMap_Response& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + bool m_success; + }; + } // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.cxx new file mode 100644 index 00000000000..f1832f0b6fc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.cxx @@ -0,0 +1,330 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoadMapPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LoadMapPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace srv { + namespace LoadMap_Request_Constants { + + + + + + + + + + + + + } //End of namespace LoadMap_Request_Constants + LoadMap_RequestPubSubType::LoadMap_RequestPubSubType() + { + setName("carla_msgs::srv::dds_::LoadMap_Request_"); + auto type_size = LoadMap_Request::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LoadMap_Request::isKeyDefined(); + size_t keyLength = LoadMap_Request::getKeyMaxCdrSerializedSize() > 16 ? + LoadMap_Request::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LoadMap_RequestPubSubType::~LoadMap_RequestPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LoadMap_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LoadMap_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LoadMap_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LoadMap_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LoadMap_RequestPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LoadMap_RequestPubSubType::createData() + { + return reinterpret_cast(new LoadMap_Request()); + } + + void LoadMap_RequestPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LoadMap_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LoadMap_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LoadMap_Request::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LoadMap_Request::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + LoadMap_ResponsePubSubType::LoadMap_ResponsePubSubType() + { + setName("carla_msgs::srv::dds_::LoadMap_Response_"); + auto type_size = LoadMap_Response::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LoadMap_Response::isKeyDefined(); + size_t keyLength = LoadMap_Response::getKeyMaxCdrSerializedSize() > 16 ? + LoadMap_Response::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LoadMap_ResponsePubSubType::~LoadMap_ResponsePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LoadMap_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LoadMap_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LoadMap_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LoadMap_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LoadMap_ResponsePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LoadMap_ResponsePubSubType::createData() + { + return reinterpret_cast(new LoadMap_Response()); + } + + void LoadMap_ResponsePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LoadMap_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LoadMap_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LoadMap_Response::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LoadMap_Response::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace srv + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.h new file mode 100644 index 00000000000..49c03382c12 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.h @@ -0,0 +1,185 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoadMapPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_PUBSUBTYPES_H_ + +#include +#include + +#include "LoadMap.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated LoadMap is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace srv + { + namespace LoadMap_Request_Constants + { + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type LoadMap_Request defined by the user in the IDL file. + * @ingroup LOADMAP + */ + class LoadMap_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LoadMap_Request type; + + eProsima_user_DllExport LoadMap_RequestPubSubType(); + + eProsima_user_DllExport virtual ~LoadMap_RequestPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + /*! + * @brief This class represents the TopicDataType of the type LoadMap_Response defined by the user in the IDL file. + * @ingroup LOADMAP + */ + class LoadMap_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LoadMap_Response type; + + eProsima_user_DllExport LoadMap_ResponsePubSubType(); + + eProsima_user_DllExport virtual ~LoadMap_ResponsePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) LoadMap_Response(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.cxx new file mode 100644 index 00000000000..d799de62933 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.cxx @@ -0,0 +1,336 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SetEpisodeSettings.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SetEpisodeSettings.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::srv::SetEpisodeSettings_Request::SetEpisodeSettings_Request() +{ + // m_episode_settings com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@79ca92b9 + + +} + +carla_msgs::srv::SetEpisodeSettings_Request::~SetEpisodeSettings_Request() +{ +} + +carla_msgs::srv::SetEpisodeSettings_Request::SetEpisodeSettings_Request( + const SetEpisodeSettings_Request& x) +{ + m_episode_settings = x.m_episode_settings; +} + +carla_msgs::srv::SetEpisodeSettings_Request::SetEpisodeSettings_Request( + SetEpisodeSettings_Request&& x) +{ + m_episode_settings = std::move(x.m_episode_settings); +} + +carla_msgs::srv::SetEpisodeSettings_Request& carla_msgs::srv::SetEpisodeSettings_Request::operator =( + const SetEpisodeSettings_Request& x) +{ + + m_episode_settings = x.m_episode_settings; + + return *this; +} + +carla_msgs::srv::SetEpisodeSettings_Request& carla_msgs::srv::SetEpisodeSettings_Request::operator =( + SetEpisodeSettings_Request&& x) +{ + + m_episode_settings = std::move(x.m_episode_settings); + + return *this; +} + +bool carla_msgs::srv::SetEpisodeSettings_Request::operator ==( + const SetEpisodeSettings_Request& x) const +{ + + return (m_episode_settings == x.m_episode_settings); +} + +bool carla_msgs::srv::SetEpisodeSettings_Request::operator !=( + const SetEpisodeSettings_Request& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::SetEpisodeSettings_Request::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += carla_msgs::msg::CarlaEpisodeSettings::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::SetEpisodeSettings_Request::getCdrSerializedSize( + const carla_msgs::srv::SetEpisodeSettings_Request& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += carla_msgs::msg::CarlaEpisodeSettings::getCdrSerializedSize(data.episode_settings(), current_alignment); + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::SetEpisodeSettings_Request::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_episode_settings; + +} + +void carla_msgs::srv::SetEpisodeSettings_Request::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_episode_settings; +} + +/*! + * @brief This function copies the value in member episode_settings + * @param _episode_settings New value to be copied in member episode_settings + */ +void carla_msgs::srv::SetEpisodeSettings_Request::episode_settings( + const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings) +{ + m_episode_settings = _episode_settings; +} + +/*! + * @brief This function moves the value in member episode_settings + * @param _episode_settings New value to be moved in member episode_settings + */ +void carla_msgs::srv::SetEpisodeSettings_Request::episode_settings( + carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings) +{ + m_episode_settings = std::move(_episode_settings); +} + +/*! + * @brief This function returns a constant reference to member episode_settings + * @return Constant reference to member episode_settings + */ +const carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::srv::SetEpisodeSettings_Request::episode_settings() const +{ + return m_episode_settings; +} + +/*! + * @brief This function returns a reference to member episode_settings + * @return Reference to member episode_settings + */ +carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::srv::SetEpisodeSettings_Request::episode_settings() +{ + return m_episode_settings; +} + +size_t carla_msgs::srv::SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::SetEpisodeSettings_Request::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::SetEpisodeSettings_Request::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + +carla_msgs::srv::SetEpisodeSettings_Response::SetEpisodeSettings_Response() +{ + // m_success com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2aa3cd93 + m_success = false; + +} + +carla_msgs::srv::SetEpisodeSettings_Response::~SetEpisodeSettings_Response() +{ +} + +carla_msgs::srv::SetEpisodeSettings_Response::SetEpisodeSettings_Response( + const SetEpisodeSettings_Response& x) +{ + m_success = x.m_success; +} + +carla_msgs::srv::SetEpisodeSettings_Response::SetEpisodeSettings_Response( + SetEpisodeSettings_Response&& x) +{ + m_success = x.m_success; +} + +carla_msgs::srv::SetEpisodeSettings_Response& carla_msgs::srv::SetEpisodeSettings_Response::operator =( + const SetEpisodeSettings_Response& x) +{ + + m_success = x.m_success; + + return *this; +} + +carla_msgs::srv::SetEpisodeSettings_Response& carla_msgs::srv::SetEpisodeSettings_Response::operator =( + SetEpisodeSettings_Response&& x) +{ + + m_success = x.m_success; + + return *this; +} + +bool carla_msgs::srv::SetEpisodeSettings_Response::operator ==( + const SetEpisodeSettings_Response& x) const +{ + + return (m_success == x.m_success); +} + +bool carla_msgs::srv::SetEpisodeSettings_Response::operator !=( + const SetEpisodeSettings_Response& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::SetEpisodeSettings_Response::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::SetEpisodeSettings_Response::getCdrSerializedSize( + const carla_msgs::srv::SetEpisodeSettings_Response& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::SetEpisodeSettings_Response::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_success; + +} + +void carla_msgs::srv::SetEpisodeSettings_Response::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_success; +} + +/*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ +void carla_msgs::srv::SetEpisodeSettings_Response::success( + bool _success) +{ + m_success = _success; +} + +/*! + * @brief This function returns the value of member success + * @return Value of member success + */ +bool carla_msgs::srv::SetEpisodeSettings_Response::success() const +{ + return m_success; +} + +/*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ +bool& carla_msgs::srv::SetEpisodeSettings_Response::success() +{ + return m_success; +} + + +size_t carla_msgs::srv::SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::SetEpisodeSettings_Response::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::SetEpisodeSettings_Response::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.h new file mode 100644 index 00000000000..3663969b5ee --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.h @@ -0,0 +1,358 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SetEpisodeSettings.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_H_ + +#include "carla_msgs/msg/CarlaEpisodeSettings.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SetEpisodeSettings_SOURCE) +#define SetEpisodeSettings_DllAPI __declspec( dllexport ) +#else +#define SetEpisodeSettings_DllAPI __declspec( dllimport ) +#endif // SetEpisodeSettings_SOURCE +#else +#define SetEpisodeSettings_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SetEpisodeSettings_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace srv { + /*! + * @brief This class represents the structure SetEpisodeSettings_Request defined by the user in the IDL file. + * @ingroup SETEPISODESETTINGS + */ + class SetEpisodeSettings_Request + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SetEpisodeSettings_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SetEpisodeSettings_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Request( + const SetEpisodeSettings_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Request( + SetEpisodeSettings_Request&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Request& operator =( + const SetEpisodeSettings_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Request& operator =( + SetEpisodeSettings_Request&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SetEpisodeSettings_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SetEpisodeSettings_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SetEpisodeSettings_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SetEpisodeSettings_Request& x) const; + + /*! + * @brief This function copies the value in member episode_settings + * @param _episode_settings New value to be copied in member episode_settings + */ + eProsima_user_DllExport void episode_settings( + const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings); + + /*! + * @brief This function moves the value in member episode_settings + * @param _episode_settings New value to be moved in member episode_settings + */ + eProsima_user_DllExport void episode_settings( + carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings); + + /*! + * @brief This function returns a constant reference to member episode_settings + * @return Constant reference to member episode_settings + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaEpisodeSettings& episode_settings() const; + + /*! + * @brief This function returns a reference to member episode_settings + * @return Reference to member episode_settings + */ + eProsima_user_DllExport carla_msgs::msg::CarlaEpisodeSettings& episode_settings(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::SetEpisodeSettings_Request& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + carla_msgs::msg::CarlaEpisodeSettings m_episode_settings; + }; + /*! + * @brief This class represents the structure SetEpisodeSettings_Response defined by the user in the IDL file. + * @ingroup SETEPISODESETTINGS + */ + class SetEpisodeSettings_Response + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SetEpisodeSettings_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SetEpisodeSettings_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Response( + const SetEpisodeSettings_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Response( + SetEpisodeSettings_Response&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Response& operator =( + const SetEpisodeSettings_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Response& operator =( + SetEpisodeSettings_Response&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SetEpisodeSettings_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SetEpisodeSettings_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SetEpisodeSettings_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SetEpisodeSettings_Response& x) const; + + /*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ + eProsima_user_DllExport void success( + bool _success); + + /*! + * @brief This function returns the value of member success + * @return Value of member success + */ + eProsima_user_DllExport bool success() const; + + /*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ + eProsima_user_DllExport bool& success(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::SetEpisodeSettings_Response& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + bool m_success; + }; + } // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.cxx new file mode 100644 index 00000000000..7b146a803f2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.cxx @@ -0,0 +1,316 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SetEpisodeSettingsPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SetEpisodeSettingsPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace srv { + SetEpisodeSettings_RequestPubSubType::SetEpisodeSettings_RequestPubSubType() + { + setName("carla_msgs::srv::dds_::SetEpisodeSettings_Request_"); + auto type_size = SetEpisodeSettings_Request::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SetEpisodeSettings_Request::isKeyDefined(); + size_t keyLength = SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize() > 16 ? + SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SetEpisodeSettings_RequestPubSubType::~SetEpisodeSettings_RequestPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SetEpisodeSettings_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SetEpisodeSettings_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SetEpisodeSettings_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SetEpisodeSettings_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SetEpisodeSettings_RequestPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SetEpisodeSettings_RequestPubSubType::createData() + { + return reinterpret_cast(new SetEpisodeSettings_Request()); + } + + void SetEpisodeSettings_RequestPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SetEpisodeSettings_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SetEpisodeSettings_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + SetEpisodeSettings_ResponsePubSubType::SetEpisodeSettings_ResponsePubSubType() + { + setName("carla_msgs::srv::dds_::SetEpisodeSettings_Response_"); + auto type_size = SetEpisodeSettings_Response::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SetEpisodeSettings_Response::isKeyDefined(); + size_t keyLength = SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize() > 16 ? + SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SetEpisodeSettings_ResponsePubSubType::~SetEpisodeSettings_ResponsePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SetEpisodeSettings_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SetEpisodeSettings_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SetEpisodeSettings_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SetEpisodeSettings_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SetEpisodeSettings_ResponsePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SetEpisodeSettings_ResponsePubSubType::createData() + { + return reinterpret_cast(new SetEpisodeSettings_Response()); + } + + void SetEpisodeSettings_ResponsePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SetEpisodeSettings_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SetEpisodeSettings_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace srv + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h new file mode 100644 index 00000000000..0257b5be409 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h @@ -0,0 +1,171 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SetEpisodeSettingsPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_PUBSUBTYPES_H_ + +#include +#include + +#include "SetEpisodeSettings.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SetEpisodeSettings is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace srv + { + /*! + * @brief This class represents the TopicDataType of the type SetEpisodeSettings_Request defined by the user in the IDL file. + * @ingroup SETEPISODESETTINGS + */ + class SetEpisodeSettings_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SetEpisodeSettings_Request type; + + eProsima_user_DllExport SetEpisodeSettings_RequestPubSubType(); + + eProsima_user_DllExport virtual ~SetEpisodeSettings_RequestPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SetEpisodeSettings_Request(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + /*! + * @brief This class represents the TopicDataType of the type SetEpisodeSettings_Response defined by the user in the IDL file. + * @ingroup SETEPISODESETTINGS + */ + class SetEpisodeSettings_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SetEpisodeSettings_Response type; + + eProsima_user_DllExport SetEpisodeSettings_ResponsePubSubType(); + + eProsima_user_DllExport virtual ~SetEpisodeSettings_ResponsePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SetEpisodeSettings_Response(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.cxx new file mode 100644 index 00000000000..9edb18c717b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.cxx @@ -0,0 +1,522 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpawnObject.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SpawnObject.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +carla_msgs::srv::SpawnObject_Request::SpawnObject_Request() +{ + // m_blueprint com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1622f1b + + // m_transform com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@72a7c7e0 + + // m_attach_to com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2e4b8173 + m_attach_to = 0; + // m_random_pose com.eprosima.idl.parser.typecode.PrimitiveTypeCode@70e8f8e + m_random_pose = false; + +} + +carla_msgs::srv::SpawnObject_Request::~SpawnObject_Request() +{ + + + +} + +carla_msgs::srv::SpawnObject_Request::SpawnObject_Request( + const SpawnObject_Request& x) +{ + m_blueprint = x.m_blueprint; + m_transform = x.m_transform; + m_attach_to = x.m_attach_to; + m_random_pose = x.m_random_pose; +} + +carla_msgs::srv::SpawnObject_Request::SpawnObject_Request( + SpawnObject_Request&& x) +{ + m_blueprint = std::move(x.m_blueprint); + m_transform = std::move(x.m_transform); + m_attach_to = x.m_attach_to; + m_random_pose = x.m_random_pose; +} + +carla_msgs::srv::SpawnObject_Request& carla_msgs::srv::SpawnObject_Request::operator =( + const SpawnObject_Request& x) +{ + + m_blueprint = x.m_blueprint; + m_transform = x.m_transform; + m_attach_to = x.m_attach_to; + m_random_pose = x.m_random_pose; + + return *this; +} + +carla_msgs::srv::SpawnObject_Request& carla_msgs::srv::SpawnObject_Request::operator =( + SpawnObject_Request&& x) +{ + + m_blueprint = std::move(x.m_blueprint); + m_transform = std::move(x.m_transform); + m_attach_to = x.m_attach_to; + m_random_pose = x.m_random_pose; + + return *this; +} + +bool carla_msgs::srv::SpawnObject_Request::operator ==( + const SpawnObject_Request& x) const +{ + + return (m_blueprint == x.m_blueprint && m_transform == x.m_transform && m_attach_to == x.m_attach_to && m_random_pose == x.m_random_pose); +} + +bool carla_msgs::srv::SpawnObject_Request::operator !=( + const SpawnObject_Request& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::SpawnObject_Request::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += carla_msgs::msg::CarlaActorBlueprint::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Pose::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::SpawnObject_Request::getCdrSerializedSize( + const carla_msgs::srv::SpawnObject_Request& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += carla_msgs::msg::CarlaActorBlueprint::getCdrSerializedSize(data.blueprint(), current_alignment); + current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.transform(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::SpawnObject_Request::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_blueprint; + scdr << m_transform; + scdr << m_attach_to; + scdr << m_random_pose; + +} + +void carla_msgs::srv::SpawnObject_Request::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_blueprint; + dcdr >> m_transform; + dcdr >> m_attach_to; + dcdr >> m_random_pose; +} + +/*! + * @brief This function copies the value in member blueprint + * @param _blueprint New value to be copied in member blueprint + */ +void carla_msgs::srv::SpawnObject_Request::blueprint( + const carla_msgs::msg::CarlaActorBlueprint& _blueprint) +{ + m_blueprint = _blueprint; +} + +/*! + * @brief This function moves the value in member blueprint + * @param _blueprint New value to be moved in member blueprint + */ +void carla_msgs::srv::SpawnObject_Request::blueprint( + carla_msgs::msg::CarlaActorBlueprint&& _blueprint) +{ + m_blueprint = std::move(_blueprint); +} + +/*! + * @brief This function returns a constant reference to member blueprint + * @return Constant reference to member blueprint + */ +const carla_msgs::msg::CarlaActorBlueprint& carla_msgs::srv::SpawnObject_Request::blueprint() const +{ + return m_blueprint; +} + +/*! + * @brief This function returns a reference to member blueprint + * @return Reference to member blueprint + */ +carla_msgs::msg::CarlaActorBlueprint& carla_msgs::srv::SpawnObject_Request::blueprint() +{ + return m_blueprint; +} +/*! + * @brief This function copies the value in member transform + * @param _transform New value to be copied in member transform + */ +void carla_msgs::srv::SpawnObject_Request::transform( + const geometry_msgs::msg::Pose& _transform) +{ + m_transform = _transform; +} + +/*! + * @brief This function moves the value in member transform + * @param _transform New value to be moved in member transform + */ +void carla_msgs::srv::SpawnObject_Request::transform( + geometry_msgs::msg::Pose&& _transform) +{ + m_transform = std::move(_transform); +} + +/*! + * @brief This function returns a constant reference to member transform + * @return Constant reference to member transform + */ +const geometry_msgs::msg::Pose& carla_msgs::srv::SpawnObject_Request::transform() const +{ + return m_transform; +} + +/*! + * @brief This function returns a reference to member transform + * @return Reference to member transform + */ +geometry_msgs::msg::Pose& carla_msgs::srv::SpawnObject_Request::transform() +{ + return m_transform; +} +/*! + * @brief This function sets a value in member attach_to + * @param _attach_to New value for member attach_to + */ +void carla_msgs::srv::SpawnObject_Request::attach_to( + uint32_t _attach_to) +{ + m_attach_to = _attach_to; +} + +/*! + * @brief This function returns the value of member attach_to + * @return Value of member attach_to + */ +uint32_t carla_msgs::srv::SpawnObject_Request::attach_to() const +{ + return m_attach_to; +} + +/*! + * @brief This function returns a reference to member attach_to + * @return Reference to member attach_to + */ +uint32_t& carla_msgs::srv::SpawnObject_Request::attach_to() +{ + return m_attach_to; +} + +/*! + * @brief This function sets a value in member random_pose + * @param _random_pose New value for member random_pose + */ +void carla_msgs::srv::SpawnObject_Request::random_pose( + bool _random_pose) +{ + m_random_pose = _random_pose; +} + +/*! + * @brief This function returns the value of member random_pose + * @return Value of member random_pose + */ +bool carla_msgs::srv::SpawnObject_Request::random_pose() const +{ + return m_random_pose; +} + +/*! + * @brief This function returns a reference to member random_pose + * @return Reference to member random_pose + */ +bool& carla_msgs::srv::SpawnObject_Request::random_pose() +{ + return m_random_pose; +} + + +size_t carla_msgs::srv::SpawnObject_Request::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::SpawnObject_Request::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::SpawnObject_Request::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + +carla_msgs::srv::SpawnObject_Response::SpawnObject_Response() +{ + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e82df6a + m_id = 0; + // m_error_string com.eprosima.idl.parser.typecode.StringTypeCode@3f197a46 + m_error_string =""; + +} + +carla_msgs::srv::SpawnObject_Response::~SpawnObject_Response() +{ + +} + +carla_msgs::srv::SpawnObject_Response::SpawnObject_Response( + const SpawnObject_Response& x) +{ + m_id = x.m_id; + m_error_string = x.m_error_string; +} + +carla_msgs::srv::SpawnObject_Response::SpawnObject_Response( + SpawnObject_Response&& x) +{ + m_id = x.m_id; + m_error_string = std::move(x.m_error_string); +} + +carla_msgs::srv::SpawnObject_Response& carla_msgs::srv::SpawnObject_Response::operator =( + const SpawnObject_Response& x) +{ + + m_id = x.m_id; + m_error_string = x.m_error_string; + + return *this; +} + +carla_msgs::srv::SpawnObject_Response& carla_msgs::srv::SpawnObject_Response::operator =( + SpawnObject_Response&& x) +{ + + m_id = x.m_id; + m_error_string = std::move(x.m_error_string); + + return *this; +} + +bool carla_msgs::srv::SpawnObject_Response::operator ==( + const SpawnObject_Response& x) const +{ + + return (m_id == x.m_id && m_error_string == x.m_error_string); +} + +bool carla_msgs::srv::SpawnObject_Response::operator !=( + const SpawnObject_Response& x) const +{ + return !(*this == x); +} + +size_t carla_msgs::srv::SpawnObject_Response::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + + return current_alignment - initial_alignment; +} + +size_t carla_msgs::srv::SpawnObject_Response::getCdrSerializedSize( + const carla_msgs::srv::SpawnObject_Response& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.error_string().size() + 1; + + + return current_alignment - initial_alignment; +} + +void carla_msgs::srv::SpawnObject_Response::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_id; + scdr << m_error_string; + +} + +void carla_msgs::srv::SpawnObject_Response::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_id; + dcdr >> m_error_string; +} + +/*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ +void carla_msgs::srv::SpawnObject_Response::id( + int32_t _id) +{ + m_id = _id; +} + +/*! + * @brief This function returns the value of member id + * @return Value of member id + */ +int32_t carla_msgs::srv::SpawnObject_Response::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +int32_t& carla_msgs::srv::SpawnObject_Response::id() +{ + return m_id; +} + +/*! + * @brief This function copies the value in member error_string + * @param _error_string New value to be copied in member error_string + */ +void carla_msgs::srv::SpawnObject_Response::error_string( + const std::string& _error_string) +{ + m_error_string = _error_string; +} + +/*! + * @brief This function moves the value in member error_string + * @param _error_string New value to be moved in member error_string + */ +void carla_msgs::srv::SpawnObject_Response::error_string( + std::string&& _error_string) +{ + m_error_string = std::move(_error_string); +} + +/*! + * @brief This function returns a constant reference to member error_string + * @return Constant reference to member error_string + */ +const std::string& carla_msgs::srv::SpawnObject_Response::error_string() const +{ + return m_error_string; +} + +/*! + * @brief This function returns a reference to member error_string + * @return Reference to member error_string + */ +std::string& carla_msgs::srv::SpawnObject_Response::error_string() +{ + return m_error_string; +} + +size_t carla_msgs::srv::SpawnObject_Response::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool carla_msgs::srv::SpawnObject_Response::isKeyDefined() +{ + return false; +} + +void carla_msgs::srv::SpawnObject_Response::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.h new file mode 100644 index 00000000000..5d2a9d4d783 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.h @@ -0,0 +1,451 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpawnObject.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_H_ + +#include "carla_msgs/msg/CarlaActorBlueprint.h" +#include "geometry_msgs/msg/Pose.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SpawnObject_SOURCE) +#define SpawnObject_DllAPI __declspec( dllexport ) +#else +#define SpawnObject_DllAPI __declspec( dllimport ) +#endif // SpawnObject_SOURCE +#else +#define SpawnObject_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SpawnObject_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace carla_msgs { + namespace srv { + /*! + * @brief This class represents the structure SpawnObject_Request defined by the user in the IDL file. + * @ingroup SPAWNOBJECT + */ + class SpawnObject_Request + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpawnObject_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpawnObject_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. + */ + eProsima_user_DllExport SpawnObject_Request( + const SpawnObject_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. + */ + eProsima_user_DllExport SpawnObject_Request( + SpawnObject_Request&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. + */ + eProsima_user_DllExport SpawnObject_Request& operator =( + const SpawnObject_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. + */ + eProsima_user_DllExport SpawnObject_Request& operator =( + SpawnObject_Request&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SpawnObject_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpawnObject_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SpawnObject_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpawnObject_Request& x) const; + + /*! + * @brief This function copies the value in member blueprint + * @param _blueprint New value to be copied in member blueprint + */ + eProsima_user_DllExport void blueprint( + const carla_msgs::msg::CarlaActorBlueprint& _blueprint); + + /*! + * @brief This function moves the value in member blueprint + * @param _blueprint New value to be moved in member blueprint + */ + eProsima_user_DllExport void blueprint( + carla_msgs::msg::CarlaActorBlueprint&& _blueprint); + + /*! + * @brief This function returns a constant reference to member blueprint + * @return Constant reference to member blueprint + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaActorBlueprint& blueprint() const; + + /*! + * @brief This function returns a reference to member blueprint + * @return Reference to member blueprint + */ + eProsima_user_DllExport carla_msgs::msg::CarlaActorBlueprint& blueprint(); + /*! + * @brief This function copies the value in member transform + * @param _transform New value to be copied in member transform + */ + eProsima_user_DllExport void transform( + const geometry_msgs::msg::Pose& _transform); + + /*! + * @brief This function moves the value in member transform + * @param _transform New value to be moved in member transform + */ + eProsima_user_DllExport void transform( + geometry_msgs::msg::Pose&& _transform); + + /*! + * @brief This function returns a constant reference to member transform + * @return Constant reference to member transform + */ + eProsima_user_DllExport const geometry_msgs::msg::Pose& transform() const; + + /*! + * @brief This function returns a reference to member transform + * @return Reference to member transform + */ + eProsima_user_DllExport geometry_msgs::msg::Pose& transform(); + /*! + * @brief This function sets a value in member attach_to + * @param _attach_to New value for member attach_to + */ + eProsima_user_DllExport void attach_to( + uint32_t _attach_to); + + /*! + * @brief This function returns the value of member attach_to + * @return Value of member attach_to + */ + eProsima_user_DllExport uint32_t attach_to() const; + + /*! + * @brief This function returns a reference to member attach_to + * @return Reference to member attach_to + */ + eProsima_user_DllExport uint32_t& attach_to(); + + /*! + * @brief This function sets a value in member random_pose + * @param _random_pose New value for member random_pose + */ + eProsima_user_DllExport void random_pose( + bool _random_pose); + + /*! + * @brief This function returns the value of member random_pose + * @return Value of member random_pose + */ + eProsima_user_DllExport bool random_pose() const; + + /*! + * @brief This function returns a reference to member random_pose + * @return Reference to member random_pose + */ + eProsima_user_DllExport bool& random_pose(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::SpawnObject_Request& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + carla_msgs::msg::CarlaActorBlueprint m_blueprint; + geometry_msgs::msg::Pose m_transform; + uint32_t m_attach_to; + bool m_random_pose; + }; + /*! + * @brief This class represents the structure SpawnObject_Response defined by the user in the IDL file. + * @ingroup SPAWNOBJECT + */ + class SpawnObject_Response + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpawnObject_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpawnObject_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. + */ + eProsima_user_DllExport SpawnObject_Response( + const SpawnObject_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. + */ + eProsima_user_DllExport SpawnObject_Response( + SpawnObject_Response&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. + */ + eProsima_user_DllExport SpawnObject_Response& operator =( + const SpawnObject_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. + */ + eProsima_user_DllExport SpawnObject_Response& operator =( + SpawnObject_Response&& x); + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SpawnObject_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpawnObject_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SpawnObject_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpawnObject_Response& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + int32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport int32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport int32_t& id(); + + /*! + * @brief This function copies the value in member error_string + * @param _error_string New value to be copied in member error_string + */ + eProsima_user_DllExport void error_string( + const std::string& _error_string); + + /*! + * @brief This function moves the value in member error_string + * @param _error_string New value to be moved in member error_string + */ + eProsima_user_DllExport void error_string( + std::string&& _error_string); + + /*! + * @brief This function returns a constant reference to member error_string + * @return Constant reference to member error_string + */ + eProsima_user_DllExport const std::string& error_string() const; + + /*! + * @brief This function returns a reference to member error_string + * @return Reference to member error_string + */ + eProsima_user_DllExport std::string& error_string(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const carla_msgs::srv::SpawnObject_Response& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int32_t m_id; + std::string m_error_string; + }; + } // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.cxx new file mode 100644 index 00000000000..4ead5374baf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.cxx @@ -0,0 +1,316 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpawnObjectPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SpawnObjectPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace carla_msgs { + namespace srv { + SpawnObject_RequestPubSubType::SpawnObject_RequestPubSubType() + { + setName("carla_msgs::srv::dds_::SpawnObject_Request_"); + auto type_size = SpawnObject_Request::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SpawnObject_Request::isKeyDefined(); + size_t keyLength = SpawnObject_Request::getKeyMaxCdrSerializedSize() > 16 ? + SpawnObject_Request::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpawnObject_RequestPubSubType::~SpawnObject_RequestPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpawnObject_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SpawnObject_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpawnObject_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SpawnObject_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpawnObject_RequestPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpawnObject_RequestPubSubType::createData() + { + return reinterpret_cast(new SpawnObject_Request()); + } + + void SpawnObject_RequestPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpawnObject_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SpawnObject_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SpawnObject_Request::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SpawnObject_Request::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + SpawnObject_ResponsePubSubType::SpawnObject_ResponsePubSubType() + { + setName("carla_msgs::srv::dds_::SpawnObject_Response_"); + auto type_size = SpawnObject_Response::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SpawnObject_Response::isKeyDefined(); + size_t keyLength = SpawnObject_Response::getKeyMaxCdrSerializedSize() > 16 ? + SpawnObject_Response::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpawnObject_ResponsePubSubType::~SpawnObject_ResponsePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpawnObject_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SpawnObject_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpawnObject_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SpawnObject_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpawnObject_ResponsePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpawnObject_ResponsePubSubType::createData() + { + return reinterpret_cast(new SpawnObject_Response()); + } + + void SpawnObject_ResponsePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpawnObject_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SpawnObject_Response* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SpawnObject_Response::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SpawnObject_Response::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace srv + +} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.h new file mode 100644 index 00000000000..a0cd80095ab --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.h @@ -0,0 +1,171 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpawnObjectPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_PUBSUBTYPES_H_ + +#include +#include + +#include "SpawnObject.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SpawnObject is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace carla_msgs +{ + namespace srv + { + /*! + * @brief This class represents the TopicDataType of the type SpawnObject_Request defined by the user in the IDL file. + * @ingroup SPAWNOBJECT + */ + class SpawnObject_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SpawnObject_Request type; + + eProsima_user_DllExport SpawnObject_RequestPubSubType(); + + eProsima_user_DllExport virtual ~SpawnObject_RequestPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + /*! + * @brief This class represents the TopicDataType of the type SpawnObject_Response defined by the user in the IDL file. + * @ingroup SPAWNOBJECT + */ + class SpawnObject_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SpawnObject_Response type; + + eProsima_user_DllExport SpawnObject_ResponsePubSubType(); + + eProsima_user_DllExport virtual ~SpawnObject_ResponsePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.cxx new file mode 100644 index 00000000000..3c4ed7cb410 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.cxx @@ -0,0 +1,703 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Object.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Object.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + +derived_object_msgs::msg::Object::Object() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3cc1435c + + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6bf0219d + m_id = 0; + // m_detection_level com.eprosima.idl.parser.typecode.PrimitiveTypeCode@dd0c991 + m_detection_level = 0; + // m_object_classified com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5f16132a + m_object_classified = false; + // m_pose com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@69fb6037 + + // m_twist com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@36d585c + + // m_accel com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@87a85e1 + + // m_polygon com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@671a5887 + + // m_shape com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5552768b + + // m_classification com.eprosima.idl.parser.typecode.PrimitiveTypeCode@55f616cf + m_classification = 0; + // m_classification_certainty com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1356d4d4 + m_classification_certainty = 0; + // m_classification_age com.eprosima.idl.parser.typecode.PrimitiveTypeCode@c03cf28 + m_classification_age = 0; + +} + +derived_object_msgs::msg::Object::~Object() +{ + + + + + + + + + + + +} + +derived_object_msgs::msg::Object::Object( + const Object& x) +{ + m_header = x.m_header; + m_id = x.m_id; + m_detection_level = x.m_detection_level; + m_object_classified = x.m_object_classified; + m_pose = x.m_pose; + m_twist = x.m_twist; + m_accel = x.m_accel; + m_polygon = x.m_polygon; + m_shape = x.m_shape; + m_classification = x.m_classification; + m_classification_certainty = x.m_classification_certainty; + m_classification_age = x.m_classification_age; +} + +derived_object_msgs::msg::Object::Object( + Object&& x) +{ + m_header = std::move(x.m_header); + m_id = x.m_id; + m_detection_level = x.m_detection_level; + m_object_classified = x.m_object_classified; + m_pose = std::move(x.m_pose); + m_twist = std::move(x.m_twist); + m_accel = std::move(x.m_accel); + m_polygon = std::move(x.m_polygon); + m_shape = std::move(x.m_shape); + m_classification = x.m_classification; + m_classification_certainty = x.m_classification_certainty; + m_classification_age = x.m_classification_age; +} + +derived_object_msgs::msg::Object& derived_object_msgs::msg::Object::operator =( + const Object& x) +{ + + m_header = x.m_header; + m_id = x.m_id; + m_detection_level = x.m_detection_level; + m_object_classified = x.m_object_classified; + m_pose = x.m_pose; + m_twist = x.m_twist; + m_accel = x.m_accel; + m_polygon = x.m_polygon; + m_shape = x.m_shape; + m_classification = x.m_classification; + m_classification_certainty = x.m_classification_certainty; + m_classification_age = x.m_classification_age; + + return *this; +} + +derived_object_msgs::msg::Object& derived_object_msgs::msg::Object::operator =( + Object&& x) +{ + + m_header = std::move(x.m_header); + m_id = x.m_id; + m_detection_level = x.m_detection_level; + m_object_classified = x.m_object_classified; + m_pose = std::move(x.m_pose); + m_twist = std::move(x.m_twist); + m_accel = std::move(x.m_accel); + m_polygon = std::move(x.m_polygon); + m_shape = std::move(x.m_shape); + m_classification = x.m_classification; + m_classification_certainty = x.m_classification_certainty; + m_classification_age = x.m_classification_age; + + return *this; +} + +bool derived_object_msgs::msg::Object::operator ==( + const Object& x) const +{ + + return (m_header == x.m_header && m_id == x.m_id && m_detection_level == x.m_detection_level && m_object_classified == x.m_object_classified && m_pose == x.m_pose && m_twist == x.m_twist && m_accel == x.m_accel && m_polygon == x.m_polygon && m_shape == x.m_shape && m_classification == x.m_classification && m_classification_certainty == x.m_classification_certainty && m_classification_age == x.m_classification_age); +} + +bool derived_object_msgs::msg::Object::operator !=( + const Object& x) const +{ + return !(*this == x); +} + +size_t derived_object_msgs::msg::Object::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += geometry_msgs::msg::Pose::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Twist::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Accel::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Polygon::getMaxCdrSerializedSize(current_alignment); + current_alignment += shape_msgs::msg::SolidPrimitive::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + +size_t derived_object_msgs::msg::Object::getCdrSerializedSize( + const derived_object_msgs::msg::Object& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.pose(), current_alignment); + current_alignment += geometry_msgs::msg::Twist::getCdrSerializedSize(data.twist(), current_alignment); + current_alignment += geometry_msgs::msg::Accel::getCdrSerializedSize(data.accel(), current_alignment); + current_alignment += geometry_msgs::msg::Polygon::getCdrSerializedSize(data.polygon(), current_alignment); + current_alignment += shape_msgs::msg::SolidPrimitive::getCdrSerializedSize(data.shape(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + +void derived_object_msgs::msg::Object::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_id; + scdr << m_detection_level; + scdr << m_object_classified; + scdr << m_pose; + scdr << m_twist; + scdr << m_accel; + scdr << m_polygon; + scdr << m_shape; + scdr << m_classification; + scdr << m_classification_certainty; + scdr << m_classification_age; + +} + +void derived_object_msgs::msg::Object::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_id; + dcdr >> m_detection_level; + dcdr >> m_object_classified; + dcdr >> m_pose; + dcdr >> m_twist; + dcdr >> m_accel; + dcdr >> m_polygon; + dcdr >> m_shape; + dcdr >> m_classification; + dcdr >> m_classification_certainty; + dcdr >> m_classification_age; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void derived_object_msgs::msg::Object::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void derived_object_msgs::msg::Object::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& derived_object_msgs::msg::Object::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& derived_object_msgs::msg::Object::header() +{ + return m_header; +} +/*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ +void derived_object_msgs::msg::Object::id( + uint32_t _id) +{ + m_id = _id; +} + +/*! + * @brief This function returns the value of member id + * @return Value of member id + */ +uint32_t derived_object_msgs::msg::Object::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +uint32_t& derived_object_msgs::msg::Object::id() +{ + return m_id; +} + +/*! + * @brief This function sets a value in member detection_level + * @param _detection_level New value for member detection_level + */ +void derived_object_msgs::msg::Object::detection_level( + uint8_t _detection_level) +{ + m_detection_level = _detection_level; +} + +/*! + * @brief This function returns the value of member detection_level + * @return Value of member detection_level + */ +uint8_t derived_object_msgs::msg::Object::detection_level() const +{ + return m_detection_level; +} + +/*! + * @brief This function returns a reference to member detection_level + * @return Reference to member detection_level + */ +uint8_t& derived_object_msgs::msg::Object::detection_level() +{ + return m_detection_level; +} + +/*! + * @brief This function sets a value in member object_classified + * @param _object_classified New value for member object_classified + */ +void derived_object_msgs::msg::Object::object_classified( + bool _object_classified) +{ + m_object_classified = _object_classified; +} + +/*! + * @brief This function returns the value of member object_classified + * @return Value of member object_classified + */ +bool derived_object_msgs::msg::Object::object_classified() const +{ + return m_object_classified; +} + +/*! + * @brief This function returns a reference to member object_classified + * @return Reference to member object_classified + */ +bool& derived_object_msgs::msg::Object::object_classified() +{ + return m_object_classified; +} + +/*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ +void derived_object_msgs::msg::Object::pose( + const geometry_msgs::msg::Pose& _pose) +{ + m_pose = _pose; +} + +/*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ +void derived_object_msgs::msg::Object::pose( + geometry_msgs::msg::Pose&& _pose) +{ + m_pose = std::move(_pose); +} + +/*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ +const geometry_msgs::msg::Pose& derived_object_msgs::msg::Object::pose() const +{ + return m_pose; +} + +/*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ +geometry_msgs::msg::Pose& derived_object_msgs::msg::Object::pose() +{ + return m_pose; +} +/*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ +void derived_object_msgs::msg::Object::twist( + const geometry_msgs::msg::Twist& _twist) +{ + m_twist = _twist; +} + +/*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ +void derived_object_msgs::msg::Object::twist( + geometry_msgs::msg::Twist&& _twist) +{ + m_twist = std::move(_twist); +} + +/*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ +const geometry_msgs::msg::Twist& derived_object_msgs::msg::Object::twist() const +{ + return m_twist; +} + +/*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ +geometry_msgs::msg::Twist& derived_object_msgs::msg::Object::twist() +{ + return m_twist; +} +/*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ +void derived_object_msgs::msg::Object::accel( + const geometry_msgs::msg::Accel& _accel) +{ + m_accel = _accel; +} + +/*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ +void derived_object_msgs::msg::Object::accel( + geometry_msgs::msg::Accel&& _accel) +{ + m_accel = std::move(_accel); +} + +/*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ +const geometry_msgs::msg::Accel& derived_object_msgs::msg::Object::accel() const +{ + return m_accel; +} + +/*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ +geometry_msgs::msg::Accel& derived_object_msgs::msg::Object::accel() +{ + return m_accel; +} +/*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ +void derived_object_msgs::msg::Object::polygon( + const geometry_msgs::msg::Polygon& _polygon) +{ + m_polygon = _polygon; +} + +/*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ +void derived_object_msgs::msg::Object::polygon( + geometry_msgs::msg::Polygon&& _polygon) +{ + m_polygon = std::move(_polygon); +} + +/*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ +const geometry_msgs::msg::Polygon& derived_object_msgs::msg::Object::polygon() const +{ + return m_polygon; +} + +/*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ +geometry_msgs::msg::Polygon& derived_object_msgs::msg::Object::polygon() +{ + return m_polygon; +} +/*! + * @brief This function copies the value in member shape + * @param _shape New value to be copied in member shape + */ +void derived_object_msgs::msg::Object::shape( + const shape_msgs::msg::SolidPrimitive& _shape) +{ + m_shape = _shape; +} + +/*! + * @brief This function moves the value in member shape + * @param _shape New value to be moved in member shape + */ +void derived_object_msgs::msg::Object::shape( + shape_msgs::msg::SolidPrimitive&& _shape) +{ + m_shape = std::move(_shape); +} + +/*! + * @brief This function returns a constant reference to member shape + * @return Constant reference to member shape + */ +const shape_msgs::msg::SolidPrimitive& derived_object_msgs::msg::Object::shape() const +{ + return m_shape; +} + +/*! + * @brief This function returns a reference to member shape + * @return Reference to member shape + */ +shape_msgs::msg::SolidPrimitive& derived_object_msgs::msg::Object::shape() +{ + return m_shape; +} +/*! + * @brief This function sets a value in member classification + * @param _classification New value for member classification + */ +void derived_object_msgs::msg::Object::classification( + uint8_t _classification) +{ + m_classification = _classification; +} + +/*! + * @brief This function returns the value of member classification + * @return Value of member classification + */ +uint8_t derived_object_msgs::msg::Object::classification() const +{ + return m_classification; +} + +/*! + * @brief This function returns a reference to member classification + * @return Reference to member classification + */ +uint8_t& derived_object_msgs::msg::Object::classification() +{ + return m_classification; +} + +/*! + * @brief This function sets a value in member classification_certainty + * @param _classification_certainty New value for member classification_certainty + */ +void derived_object_msgs::msg::Object::classification_certainty( + uint8_t _classification_certainty) +{ + m_classification_certainty = _classification_certainty; +} + +/*! + * @brief This function returns the value of member classification_certainty + * @return Value of member classification_certainty + */ +uint8_t derived_object_msgs::msg::Object::classification_certainty() const +{ + return m_classification_certainty; +} + +/*! + * @brief This function returns a reference to member classification_certainty + * @return Reference to member classification_certainty + */ +uint8_t& derived_object_msgs::msg::Object::classification_certainty() +{ + return m_classification_certainty; +} + +/*! + * @brief This function sets a value in member classification_age + * @param _classification_age New value for member classification_age + */ +void derived_object_msgs::msg::Object::classification_age( + uint32_t _classification_age) +{ + m_classification_age = _classification_age; +} + +/*! + * @brief This function returns the value of member classification_age + * @return Value of member classification_age + */ +uint32_t derived_object_msgs::msg::Object::classification_age() const +{ + return m_classification_age; +} + +/*! + * @brief This function returns a reference to member classification_age + * @return Reference to member classification_age + */ +uint32_t& derived_object_msgs::msg::Object::classification_age() +{ + return m_classification_age; +} + + +size_t derived_object_msgs::msg::Object::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool derived_object_msgs::msg::Object::isKeyDefined() +{ + return false; +} + +void derived_object_msgs::msg::Object::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.h new file mode 100644 index 00000000000..5b24ea2ba73 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.h @@ -0,0 +1,450 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Object.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_H_ + +#include "geometry_msgs/msg/Accel.h" +#include "geometry_msgs/msg/Polygon.h" +#include "geometry_msgs/msg/Pose.h" +#include "geometry_msgs/msg/Twist.h" +#include "shape_msgs/msg/SolidPrimitive.h" +#include "std_msgs/msg/Header.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Object_SOURCE) +#define Object_DllAPI __declspec(dllexport) +#else +#define Object_DllAPI __declspec(dllimport) +#endif // Object_SOURCE +#else +#define Object_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Object_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace derived_object_msgs { +namespace msg { +namespace Object_Constants { +const uint8_t OBJECT_DETECTED = 0; +const uint8_t OBJECT_TRACKED = 1; +const uint8_t CLASSIFICATION_UNKNOWN = 0; +const uint8_t CLASSIFICATION_UNKNOWN_SMALL = 1; +const uint8_t CLASSIFICATION_UNKNOWN_MEDIUM = 2; +const uint8_t CLASSIFICATION_UNKNOWN_BIG = 3; +const uint8_t CLASSIFICATION_PEDESTRIAN = 4; +const uint8_t CLASSIFICATION_BIKE = 5; +const uint8_t CLASSIFICATION_CAR = 6; +const uint8_t CLASSIFICATION_TRUCK = 7; +const uint8_t CLASSIFICATION_MOTORCYCLE = 8; +const uint8_t CLASSIFICATION_OTHER_VEHICLE = 9; +const uint8_t CLASSIFICATION_BARRIER = 10; +const uint8_t CLASSIFICATION_SIGN = 11; +} // namespace Object_Constants +/*! + * @brief This class represents the structure Object defined by the user in the IDL file. + * @ingroup OBJECT + */ +class Object { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Object(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Object(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. + */ + eProsima_user_DllExport Object(const Object& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. + */ + eProsima_user_DllExport Object(Object&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. + */ + eProsima_user_DllExport Object& operator=(const Object& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. + */ + eProsima_user_DllExport Object& operator=(Object&& x); + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::Object object to compare. + */ + eProsima_user_DllExport bool operator==(const Object& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::Object object to compare. + */ + eProsima_user_DllExport bool operator!=(const Object& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id(uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + /*! + * @brief This function sets a value in member detection_level + * @param _detection_level New value for member detection_level + */ + eProsima_user_DllExport void detection_level(uint8_t _detection_level); + + /*! + * @brief This function returns the value of member detection_level + * @return Value of member detection_level + */ + eProsima_user_DllExport uint8_t detection_level() const; + + /*! + * @brief This function returns a reference to member detection_level + * @return Reference to member detection_level + */ + eProsima_user_DllExport uint8_t& detection_level(); + + /*! + * @brief This function sets a value in member object_classified + * @param _object_classified New value for member object_classified + */ + eProsima_user_DllExport void object_classified(bool _object_classified); + + /*! + * @brief This function returns the value of member object_classified + * @return Value of member object_classified + */ + eProsima_user_DllExport bool object_classified() const; + + /*! + * @brief This function returns a reference to member object_classified + * @return Reference to member object_classified + */ + eProsima_user_DllExport bool& object_classified(); + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose(const geometry_msgs::msg::Pose& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose(geometry_msgs::msg::Pose&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::Pose& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::Pose& pose(); + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist(const geometry_msgs::msg::Twist& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist(geometry_msgs::msg::Twist&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::Twist& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::Twist& twist(); + /*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ + eProsima_user_DllExport void accel(const geometry_msgs::msg::Accel& _accel); + + /*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ + eProsima_user_DllExport void accel(geometry_msgs::msg::Accel&& _accel); + + /*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ + eProsima_user_DllExport const geometry_msgs::msg::Accel& accel() const; + + /*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ + eProsima_user_DllExport geometry_msgs::msg::Accel& accel(); + /*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ + eProsima_user_DllExport void polygon(const geometry_msgs::msg::Polygon& _polygon); + + /*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ + eProsima_user_DllExport void polygon(geometry_msgs::msg::Polygon&& _polygon); + + /*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ + eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; + + /*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ + eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); + /*! + * @brief This function copies the value in member shape + * @param _shape New value to be copied in member shape + */ + eProsima_user_DllExport void shape(const shape_msgs::msg::SolidPrimitive& _shape); + + /*! + * @brief This function moves the value in member shape + * @param _shape New value to be moved in member shape + */ + eProsima_user_DllExport void shape(shape_msgs::msg::SolidPrimitive&& _shape); + + /*! + * @brief This function returns a constant reference to member shape + * @return Constant reference to member shape + */ + eProsima_user_DllExport const shape_msgs::msg::SolidPrimitive& shape() const; + + /*! + * @brief This function returns a reference to member shape + * @return Reference to member shape + */ + eProsima_user_DllExport shape_msgs::msg::SolidPrimitive& shape(); + /*! + * @brief This function sets a value in member classification + * @param _classification New value for member classification + */ + eProsima_user_DllExport void classification(uint8_t _classification); + + /*! + * @brief This function returns the value of member classification + * @return Value of member classification + */ + eProsima_user_DllExport uint8_t classification() const; + + /*! + * @brief This function returns a reference to member classification + * @return Reference to member classification + */ + eProsima_user_DllExport uint8_t& classification(); + + /*! + * @brief This function sets a value in member classification_certainty + * @param _classification_certainty New value for member classification_certainty + */ + eProsima_user_DllExport void classification_certainty(uint8_t _classification_certainty); + + /*! + * @brief This function returns the value of member classification_certainty + * @return Value of member classification_certainty + */ + eProsima_user_DllExport uint8_t classification_certainty() const; + + /*! + * @brief This function returns a reference to member classification_certainty + * @return Reference to member classification_certainty + */ + eProsima_user_DllExport uint8_t& classification_certainty(); + + /*! + * @brief This function sets a value in member classification_age + * @param _classification_age New value for member classification_age + */ + eProsima_user_DllExport void classification_age(uint32_t _classification_age); + + /*! + * @brief This function returns the value of member classification_age + * @return Value of member classification_age + */ + eProsima_user_DllExport uint32_t classification_age() const; + + /*! + * @brief This function returns a reference to member classification_age + * @return Reference to member classification_age + */ + eProsima_user_DllExport uint32_t& classification_age(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const derived_object_msgs::msg::Object& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + uint32_t m_id; + uint8_t m_detection_level; + bool m_object_classified; + geometry_msgs::msg::Pose m_pose; + geometry_msgs::msg::Twist m_twist; + geometry_msgs::msg::Accel m_accel; + geometry_msgs::msg::Polygon m_polygon; + shape_msgs::msg::SolidPrimitive m_shape; + uint8_t m_classification; + uint8_t m_classification_certainty; + uint32_t m_classification_age; +}; +} // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.cxx new file mode 100644 index 00000000000..18c2b27b437 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.cxx @@ -0,0 +1,250 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectArray.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ObjectArray.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +derived_object_msgs::msg::ObjectArray::ObjectArray() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6db9f5a4 + + // m_objects com.eprosima.idl.parser.typecode.SequenceTypeCode@1ebd319f + + +} + +derived_object_msgs::msg::ObjectArray::~ObjectArray() +{ + +} + +derived_object_msgs::msg::ObjectArray::ObjectArray( + const ObjectArray& x) +{ + m_header = x.m_header; + m_objects = x.m_objects; +} + +derived_object_msgs::msg::ObjectArray::ObjectArray( + ObjectArray&& x) +{ + m_header = std::move(x.m_header); + m_objects = std::move(x.m_objects); +} + +derived_object_msgs::msg::ObjectArray& derived_object_msgs::msg::ObjectArray::operator =( + const ObjectArray& x) +{ + + m_header = x.m_header; + m_objects = x.m_objects; + + return *this; +} + +derived_object_msgs::msg::ObjectArray& derived_object_msgs::msg::ObjectArray::operator =( + ObjectArray&& x) +{ + + m_header = std::move(x.m_header); + m_objects = std::move(x.m_objects); + + return *this; +} + +bool derived_object_msgs::msg::ObjectArray::operator ==( + const ObjectArray& x) const +{ + + return (m_header == x.m_header && m_objects == x.m_objects); +} + +bool derived_object_msgs::msg::ObjectArray::operator !=( + const ObjectArray& x) const +{ + return !(*this == x); +} + +size_t derived_object_msgs::msg::ObjectArray::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += derived_object_msgs::msg::Object::getMaxCdrSerializedSize(current_alignment);} + + + return current_alignment - initial_alignment; +} + +size_t derived_object_msgs::msg::ObjectArray::getCdrSerializedSize( + const derived_object_msgs::msg::ObjectArray& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.objects().size(); ++a) + { + current_alignment += derived_object_msgs::msg::Object::getCdrSerializedSize(data.objects().at(a), current_alignment);} + + + return current_alignment - initial_alignment; +} + +void derived_object_msgs::msg::ObjectArray::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_objects; + +} + +void derived_object_msgs::msg::ObjectArray::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_objects; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void derived_object_msgs::msg::ObjectArray::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void derived_object_msgs::msg::ObjectArray::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& derived_object_msgs::msg::ObjectArray::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& derived_object_msgs::msg::ObjectArray::header() +{ + return m_header; +} +/*! + * @brief This function copies the value in member objects + * @param _objects New value to be copied in member objects + */ +void derived_object_msgs::msg::ObjectArray::objects( + const std::vector& _objects) +{ + m_objects = _objects; +} + +/*! + * @brief This function moves the value in member objects + * @param _objects New value to be moved in member objects + */ +void derived_object_msgs::msg::ObjectArray::objects( + std::vector&& _objects) +{ + m_objects = std::move(_objects); +} + +/*! + * @brief This function returns a constant reference to member objects + * @return Constant reference to member objects + */ +const std::vector& derived_object_msgs::msg::ObjectArray::objects() const +{ + return m_objects; +} + +/*! + * @brief This function returns a reference to member objects + * @return Reference to member objects + */ +std::vector& derived_object_msgs::msg::ObjectArray::objects() +{ + return m_objects; +} + +size_t derived_object_msgs::msg::ObjectArray::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool derived_object_msgs::msg::ObjectArray::isKeyDefined() +{ + return false; +} + +void derived_object_msgs::msg::ObjectArray::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.h new file mode 100644 index 00000000000..d4f8f2f0540 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.h @@ -0,0 +1,220 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectArray.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_H_ + +#include "Object.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ObjectArray_SOURCE) +#define ObjectArray_DllAPI __declspec(dllexport) +#else +#define ObjectArray_DllAPI __declspec(dllimport) +#endif // ObjectArray_SOURCE +#else +#define ObjectArray_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ObjectArray_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace derived_object_msgs { +namespace msg { +/*! + * @brief This class represents the structure ObjectArray defined by the user in the IDL file. + * @ingroup OBJECTARRAY + */ +class ObjectArray { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ObjectArray(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ObjectArray(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. + */ + eProsima_user_DllExport ObjectArray(const ObjectArray& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. + */ + eProsima_user_DllExport ObjectArray(ObjectArray&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. + */ + eProsima_user_DllExport ObjectArray& operator=(const ObjectArray& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. + */ + eProsima_user_DllExport ObjectArray& operator=(ObjectArray&& x); + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectArray object to compare. + */ + eProsima_user_DllExport bool operator==(const ObjectArray& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectArray object to compare. + */ + eProsima_user_DllExport bool operator!=(const ObjectArray& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function copies the value in member objects + * @param _objects New value to be copied in member objects + */ + eProsima_user_DllExport void objects(const std::vector& _objects); + + /*! + * @brief This function moves the value in member objects + * @param _objects New value to be moved in member objects + */ + eProsima_user_DllExport void objects(std::vector&& _objects); + + /*! + * @brief This function returns a constant reference to member objects + * @return Constant reference to member objects + */ + eProsima_user_DllExport const std::vector& objects() const; + + /*! + * @brief This function returns a reference to member objects + * @return Reference to member objects + */ + eProsima_user_DllExport std::vector& objects(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const derived_object_msgs::msg::ObjectArray& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + std::vector m_objects; +}; +} // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.cxx new file mode 100644 index 00000000000..4d78bea9736 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectArrayPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ObjectArrayPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace derived_object_msgs { + namespace msg { + ObjectArrayPubSubType::ObjectArrayPubSubType() + { + setName("derived_object_msgs::msg::dds_::ObjectArray_"); + auto type_size = ObjectArray::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ObjectArray::isKeyDefined(); + size_t keyLength = ObjectArray::getKeyMaxCdrSerializedSize() > 16 ? + ObjectArray::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ObjectArrayPubSubType::~ObjectArrayPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ObjectArrayPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ObjectArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ObjectArrayPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ObjectArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ObjectArrayPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ObjectArrayPubSubType::createData() + { + return reinterpret_cast(new ObjectArray()); + } + + void ObjectArrayPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ObjectArrayPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ObjectArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ObjectArray::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ObjectArray::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace derived_object_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.h new file mode 100644 index 00000000000..1818dee0a77 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.h @@ -0,0 +1,91 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectArrayPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_PUBSUBTYPES_H_ + +#include +#include + +#include "ObjectArray.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated ObjectArray is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace derived_object_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type ObjectArray defined by the user in the IDL file. + * @ingroup OBJECTARRAY + */ +class ObjectArrayPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef ObjectArray type; + + eProsima_user_DllExport ObjectArrayPubSubType(); + + eProsima_user_DllExport virtual ~ObjectArrayPubSubType(); + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.cxx new file mode 100644 index 00000000000..a8f3b22d08a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.cxx @@ -0,0 +1,193 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ObjectPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace derived_object_msgs { + namespace msg { + namespace Object_Constants { + + + + + + + + + + + + + + + + } //End of namespace Object_Constants + ObjectPubSubType::ObjectPubSubType() + { + setName("derived_object_msgs::msg::dds_::Object_"); + auto type_size = Object::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Object::isKeyDefined(); + size_t keyLength = Object::getKeyMaxCdrSerializedSize() > 16 ? + Object::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ObjectPubSubType::~ObjectPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ObjectPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Object* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ObjectPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Object* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ObjectPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ObjectPubSubType::createData() + { + return reinterpret_cast(new Object()); + } + + void ObjectPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ObjectPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Object* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Object::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Object::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace derived_object_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.h new file mode 100644 index 00000000000..7cb94c9e9a9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.h @@ -0,0 +1,92 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_PUBSUBTYPES_H_ + +#include +#include + +#include "Object.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Object is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace derived_object_msgs { +namespace msg { +namespace Object_Constants {} +/*! + * @brief This class represents the TopicDataType of the type Object defined by the user in the IDL file. + * @ingroup OBJECT + */ +class ObjectPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef Object type; + + eProsima_user_DllExport ObjectPubSubType(); + + eProsima_user_DllExport virtual ~ObjectPubSubType(); + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.cxx new file mode 100644 index 00000000000..3bdd73f14f7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.cxx @@ -0,0 +1,703 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovariance.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ObjectWithCovariance.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + +derived_object_msgs::msg::ObjectWithCovariance::ObjectWithCovariance() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5552768b + + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3c947bc5 + m_id = 0; + // m_detection_level com.eprosima.idl.parser.typecode.PrimitiveTypeCode@609db43b + m_detection_level = 0; + // m_object_classified com.eprosima.idl.parser.typecode.PrimitiveTypeCode@55f616cf + m_object_classified = false; + // m_pose com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1356d4d4 + + // m_twist com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@c03cf28 + + // m_accel com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1329eff + + // m_polygon com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6497b078 + + // m_shape com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@41c2284a + + // m_classification com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1fb700ee + m_classification = 0; + // m_classification_certainty com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f67eb2a + m_classification_certainty = 0; + // m_classification_age com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4a668b6e + m_classification_age = 0; + +} + +derived_object_msgs::msg::ObjectWithCovariance::~ObjectWithCovariance() +{ + + + + + + + + + + + +} + +derived_object_msgs::msg::ObjectWithCovariance::ObjectWithCovariance( + const ObjectWithCovariance& x) +{ + m_header = x.m_header; + m_id = x.m_id; + m_detection_level = x.m_detection_level; + m_object_classified = x.m_object_classified; + m_pose = x.m_pose; + m_twist = x.m_twist; + m_accel = x.m_accel; + m_polygon = x.m_polygon; + m_shape = x.m_shape; + m_classification = x.m_classification; + m_classification_certainty = x.m_classification_certainty; + m_classification_age = x.m_classification_age; +} + +derived_object_msgs::msg::ObjectWithCovariance::ObjectWithCovariance( + ObjectWithCovariance&& x) +{ + m_header = std::move(x.m_header); + m_id = x.m_id; + m_detection_level = x.m_detection_level; + m_object_classified = x.m_object_classified; + m_pose = std::move(x.m_pose); + m_twist = std::move(x.m_twist); + m_accel = std::move(x.m_accel); + m_polygon = std::move(x.m_polygon); + m_shape = std::move(x.m_shape); + m_classification = x.m_classification; + m_classification_certainty = x.m_classification_certainty; + m_classification_age = x.m_classification_age; +} + +derived_object_msgs::msg::ObjectWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::operator =( + const ObjectWithCovariance& x) +{ + + m_header = x.m_header; + m_id = x.m_id; + m_detection_level = x.m_detection_level; + m_object_classified = x.m_object_classified; + m_pose = x.m_pose; + m_twist = x.m_twist; + m_accel = x.m_accel; + m_polygon = x.m_polygon; + m_shape = x.m_shape; + m_classification = x.m_classification; + m_classification_certainty = x.m_classification_certainty; + m_classification_age = x.m_classification_age; + + return *this; +} + +derived_object_msgs::msg::ObjectWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::operator =( + ObjectWithCovariance&& x) +{ + + m_header = std::move(x.m_header); + m_id = x.m_id; + m_detection_level = x.m_detection_level; + m_object_classified = x.m_object_classified; + m_pose = std::move(x.m_pose); + m_twist = std::move(x.m_twist); + m_accel = std::move(x.m_accel); + m_polygon = std::move(x.m_polygon); + m_shape = std::move(x.m_shape); + m_classification = x.m_classification; + m_classification_certainty = x.m_classification_certainty; + m_classification_age = x.m_classification_age; + + return *this; +} + +bool derived_object_msgs::msg::ObjectWithCovariance::operator ==( + const ObjectWithCovariance& x) const +{ + + return (m_header == x.m_header && m_id == x.m_id && m_detection_level == x.m_detection_level && m_object_classified == x.m_object_classified && m_pose == x.m_pose && m_twist == x.m_twist && m_accel == x.m_accel && m_polygon == x.m_polygon && m_shape == x.m_shape && m_classification == x.m_classification && m_classification_certainty == x.m_classification_certainty && m_classification_age == x.m_classification_age); +} + +bool derived_object_msgs::msg::ObjectWithCovariance::operator !=( + const ObjectWithCovariance& x) const +{ + return !(*this == x); +} + +size_t derived_object_msgs::msg::ObjectWithCovariance::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += geometry_msgs::msg::PoseWithCovariance::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::TwistWithCovariance::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::AccelWithCovariance::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Polygon::getMaxCdrSerializedSize(current_alignment); + current_alignment += derived_object_msgs::msg::SolidPrimitiveWithCovariance::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + +size_t derived_object_msgs::msg::ObjectWithCovariance::getCdrSerializedSize( + const derived_object_msgs::msg::ObjectWithCovariance& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += geometry_msgs::msg::PoseWithCovariance::getCdrSerializedSize(data.pose(), current_alignment); + current_alignment += geometry_msgs::msg::TwistWithCovariance::getCdrSerializedSize(data.twist(), current_alignment); + current_alignment += geometry_msgs::msg::AccelWithCovariance::getCdrSerializedSize(data.accel(), current_alignment); + current_alignment += geometry_msgs::msg::Polygon::getCdrSerializedSize(data.polygon(), current_alignment); + current_alignment += derived_object_msgs::msg::SolidPrimitiveWithCovariance::getCdrSerializedSize(data.shape(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + +void derived_object_msgs::msg::ObjectWithCovariance::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_id; + scdr << m_detection_level; + scdr << m_object_classified; + scdr << m_pose; + scdr << m_twist; + scdr << m_accel; + scdr << m_polygon; + scdr << m_shape; + scdr << m_classification; + scdr << m_classification_certainty; + scdr << m_classification_age; + +} + +void derived_object_msgs::msg::ObjectWithCovariance::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_id; + dcdr >> m_detection_level; + dcdr >> m_object_classified; + dcdr >> m_pose; + dcdr >> m_twist; + dcdr >> m_accel; + dcdr >> m_polygon; + dcdr >> m_shape; + dcdr >> m_classification; + dcdr >> m_classification_certainty; + dcdr >> m_classification_age; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void derived_object_msgs::msg::ObjectWithCovariance::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void derived_object_msgs::msg::ObjectWithCovariance::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovariance::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovariance::header() +{ + return m_header; +} +/*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ +void derived_object_msgs::msg::ObjectWithCovariance::id( + uint32_t _id) +{ + m_id = _id; +} + +/*! + * @brief This function returns the value of member id + * @return Value of member id + */ +uint32_t derived_object_msgs::msg::ObjectWithCovariance::id() const +{ + return m_id; +} + +/*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ +uint32_t& derived_object_msgs::msg::ObjectWithCovariance::id() +{ + return m_id; +} + +/*! + * @brief This function sets a value in member detection_level + * @param _detection_level New value for member detection_level + */ +void derived_object_msgs::msg::ObjectWithCovariance::detection_level( + uint8_t _detection_level) +{ + m_detection_level = _detection_level; +} + +/*! + * @brief This function returns the value of member detection_level + * @return Value of member detection_level + */ +uint8_t derived_object_msgs::msg::ObjectWithCovariance::detection_level() const +{ + return m_detection_level; +} + +/*! + * @brief This function returns a reference to member detection_level + * @return Reference to member detection_level + */ +uint8_t& derived_object_msgs::msg::ObjectWithCovariance::detection_level() +{ + return m_detection_level; +} + +/*! + * @brief This function sets a value in member object_classified + * @param _object_classified New value for member object_classified + */ +void derived_object_msgs::msg::ObjectWithCovariance::object_classified( + bool _object_classified) +{ + m_object_classified = _object_classified; +} + +/*! + * @brief This function returns the value of member object_classified + * @return Value of member object_classified + */ +bool derived_object_msgs::msg::ObjectWithCovariance::object_classified() const +{ + return m_object_classified; +} + +/*! + * @brief This function returns a reference to member object_classified + * @return Reference to member object_classified + */ +bool& derived_object_msgs::msg::ObjectWithCovariance::object_classified() +{ + return m_object_classified; +} + +/*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ +void derived_object_msgs::msg::ObjectWithCovariance::pose( + const geometry_msgs::msg::PoseWithCovariance& _pose) +{ + m_pose = _pose; +} + +/*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ +void derived_object_msgs::msg::ObjectWithCovariance::pose( + geometry_msgs::msg::PoseWithCovariance&& _pose) +{ + m_pose = std::move(_pose); +} + +/*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ +const geometry_msgs::msg::PoseWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::pose() const +{ + return m_pose; +} + +/*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ +geometry_msgs::msg::PoseWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::pose() +{ + return m_pose; +} +/*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ +void derived_object_msgs::msg::ObjectWithCovariance::twist( + const geometry_msgs::msg::TwistWithCovariance& _twist) +{ + m_twist = _twist; +} + +/*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ +void derived_object_msgs::msg::ObjectWithCovariance::twist( + geometry_msgs::msg::TwistWithCovariance&& _twist) +{ + m_twist = std::move(_twist); +} + +/*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ +const geometry_msgs::msg::TwistWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::twist() const +{ + return m_twist; +} + +/*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ +geometry_msgs::msg::TwistWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::twist() +{ + return m_twist; +} +/*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ +void derived_object_msgs::msg::ObjectWithCovariance::accel( + const geometry_msgs::msg::AccelWithCovariance& _accel) +{ + m_accel = _accel; +} + +/*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ +void derived_object_msgs::msg::ObjectWithCovariance::accel( + geometry_msgs::msg::AccelWithCovariance&& _accel) +{ + m_accel = std::move(_accel); +} + +/*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ +const geometry_msgs::msg::AccelWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::accel() const +{ + return m_accel; +} + +/*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ +geometry_msgs::msg::AccelWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::accel() +{ + return m_accel; +} +/*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ +void derived_object_msgs::msg::ObjectWithCovariance::polygon( + const geometry_msgs::msg::Polygon& _polygon) +{ + m_polygon = _polygon; +} + +/*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ +void derived_object_msgs::msg::ObjectWithCovariance::polygon( + geometry_msgs::msg::Polygon&& _polygon) +{ + m_polygon = std::move(_polygon); +} + +/*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ +const geometry_msgs::msg::Polygon& derived_object_msgs::msg::ObjectWithCovariance::polygon() const +{ + return m_polygon; +} + +/*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ +geometry_msgs::msg::Polygon& derived_object_msgs::msg::ObjectWithCovariance::polygon() +{ + return m_polygon; +} +/*! + * @brief This function copies the value in member shape + * @param _shape New value to be copied in member shape + */ +void derived_object_msgs::msg::ObjectWithCovariance::shape( + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& _shape) +{ + m_shape = _shape; +} + +/*! + * @brief This function moves the value in member shape + * @param _shape New value to be moved in member shape + */ +void derived_object_msgs::msg::ObjectWithCovariance::shape( + derived_object_msgs::msg::SolidPrimitiveWithCovariance&& _shape) +{ + m_shape = std::move(_shape); +} + +/*! + * @brief This function returns a constant reference to member shape + * @return Constant reference to member shape + */ +const derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::shape() const +{ + return m_shape; +} + +/*! + * @brief This function returns a reference to member shape + * @return Reference to member shape + */ +derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::shape() +{ + return m_shape; +} +/*! + * @brief This function sets a value in member classification + * @param _classification New value for member classification + */ +void derived_object_msgs::msg::ObjectWithCovariance::classification( + uint8_t _classification) +{ + m_classification = _classification; +} + +/*! + * @brief This function returns the value of member classification + * @return Value of member classification + */ +uint8_t derived_object_msgs::msg::ObjectWithCovariance::classification() const +{ + return m_classification; +} + +/*! + * @brief This function returns a reference to member classification + * @return Reference to member classification + */ +uint8_t& derived_object_msgs::msg::ObjectWithCovariance::classification() +{ + return m_classification; +} + +/*! + * @brief This function sets a value in member classification_certainty + * @param _classification_certainty New value for member classification_certainty + */ +void derived_object_msgs::msg::ObjectWithCovariance::classification_certainty( + uint8_t _classification_certainty) +{ + m_classification_certainty = _classification_certainty; +} + +/*! + * @brief This function returns the value of member classification_certainty + * @return Value of member classification_certainty + */ +uint8_t derived_object_msgs::msg::ObjectWithCovariance::classification_certainty() const +{ + return m_classification_certainty; +} + +/*! + * @brief This function returns a reference to member classification_certainty + * @return Reference to member classification_certainty + */ +uint8_t& derived_object_msgs::msg::ObjectWithCovariance::classification_certainty() +{ + return m_classification_certainty; +} + +/*! + * @brief This function sets a value in member classification_age + * @param _classification_age New value for member classification_age + */ +void derived_object_msgs::msg::ObjectWithCovariance::classification_age( + uint32_t _classification_age) +{ + m_classification_age = _classification_age; +} + +/*! + * @brief This function returns the value of member classification_age + * @return Value of member classification_age + */ +uint32_t derived_object_msgs::msg::ObjectWithCovariance::classification_age() const +{ + return m_classification_age; +} + +/*! + * @brief This function returns a reference to member classification_age + * @return Reference to member classification_age + */ +uint32_t& derived_object_msgs::msg::ObjectWithCovariance::classification_age() +{ + return m_classification_age; +} + + +size_t derived_object_msgs::msg::ObjectWithCovariance::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool derived_object_msgs::msg::ObjectWithCovariance::isKeyDefined() +{ + return false; +} + +void derived_object_msgs::msg::ObjectWithCovariance::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.h new file mode 100644 index 00000000000..20b7cb1dcf9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.h @@ -0,0 +1,488 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovariance.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_H_ + +#include "geometry_msgs/msg/PoseWithCovariance.h" +#include "geometry_msgs/msg/TwistWithCovariance.h" +#include "SolidPrimitiveWithCovariance.h" +#include "geometry_msgs/msg/Polygon.h" +#include "std_msgs/msg/Header.h" +#include "geometry_msgs/msg/AccelWithCovariance.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ObjectWithCovariance_SOURCE) +#define ObjectWithCovariance_DllAPI __declspec( dllexport ) +#else +#define ObjectWithCovariance_DllAPI __declspec( dllimport ) +#endif // ObjectWithCovariance_SOURCE +#else +#define ObjectWithCovariance_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ObjectWithCovariance_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace derived_object_msgs { + namespace msg { + namespace ObjectWithCovariance_Constants { + const uint8_t OBJECT_DETECTED = 0; + const uint8_t OBJECT_TRACKED = 1; + const uint8_t CLASSIFICATION_UNKNOWN = 0; + const uint8_t CLASSIFICATION_UNKNOWN_SMALL = 1; + const uint8_t CLASSIFICATION_UNKNOWN_MEDIUM = 2; + const uint8_t CLASSIFICATION_UNKNOWN_BIG = 3; + const uint8_t CLASSIFICATION_PEDESTRIAN = 4; + const uint8_t CLASSIFICATION_BIKE = 5; + const uint8_t CLASSIFICATION_CAR = 6; + const uint8_t CLASSIFICATION_TRUCK = 7; + const uint8_t CLASSIFICATION_MOTORCYCLE = 8; + const uint8_t CLASSIFICATION_OTHER_VEHICLE = 9; + const uint8_t CLASSIFICATION_BARRIER = 10; + const uint8_t CLASSIFICATION_SIGN = 11; + } // namespace ObjectWithCovariance_Constants + /*! + * @brief This class represents the structure ObjectWithCovariance defined by the user in the IDL file. + * @ingroup OBJECTWITHCOVARIANCE + */ + class ObjectWithCovariance + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ObjectWithCovariance(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ObjectWithCovariance(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. + */ + eProsima_user_DllExport ObjectWithCovariance( + const ObjectWithCovariance& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. + */ + eProsima_user_DllExport ObjectWithCovariance( + ObjectWithCovariance&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. + */ + eProsima_user_DllExport ObjectWithCovariance& operator =( + const ObjectWithCovariance& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. + */ + eProsima_user_DllExport ObjectWithCovariance& operator =( + ObjectWithCovariance&& x); + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ObjectWithCovariance& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ObjectWithCovariance& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + /*! + * @brief This function sets a value in member detection_level + * @param _detection_level New value for member detection_level + */ + eProsima_user_DllExport void detection_level( + uint8_t _detection_level); + + /*! + * @brief This function returns the value of member detection_level + * @return Value of member detection_level + */ + eProsima_user_DllExport uint8_t detection_level() const; + + /*! + * @brief This function returns a reference to member detection_level + * @return Reference to member detection_level + */ + eProsima_user_DllExport uint8_t& detection_level(); + + /*! + * @brief This function sets a value in member object_classified + * @param _object_classified New value for member object_classified + */ + eProsima_user_DllExport void object_classified( + bool _object_classified); + + /*! + * @brief This function returns the value of member object_classified + * @return Value of member object_classified + */ + eProsima_user_DllExport bool object_classified() const; + + /*! + * @brief This function returns a reference to member object_classified + * @return Reference to member object_classified + */ + eProsima_user_DllExport bool& object_classified(); + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose( + const geometry_msgs::msg::PoseWithCovariance& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose( + geometry_msgs::msg::PoseWithCovariance&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::PoseWithCovariance& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::PoseWithCovariance& pose(); + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist( + const geometry_msgs::msg::TwistWithCovariance& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist( + geometry_msgs::msg::TwistWithCovariance&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::TwistWithCovariance& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::TwistWithCovariance& twist(); + /*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ + eProsima_user_DllExport void accel( + const geometry_msgs::msg::AccelWithCovariance& _accel); + + /*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ + eProsima_user_DllExport void accel( + geometry_msgs::msg::AccelWithCovariance&& _accel); + + /*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ + eProsima_user_DllExport const geometry_msgs::msg::AccelWithCovariance& accel() const; + + /*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ + eProsima_user_DllExport geometry_msgs::msg::AccelWithCovariance& accel(); + /*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ + eProsima_user_DllExport void polygon( + const geometry_msgs::msg::Polygon& _polygon); + + /*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ + eProsima_user_DllExport void polygon( + geometry_msgs::msg::Polygon&& _polygon); + + /*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ + eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; + + /*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ + eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); + /*! + * @brief This function copies the value in member shape + * @param _shape New value to be copied in member shape + */ + eProsima_user_DllExport void shape( + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& _shape); + + /*! + * @brief This function moves the value in member shape + * @param _shape New value to be moved in member shape + */ + eProsima_user_DllExport void shape( + derived_object_msgs::msg::SolidPrimitiveWithCovariance&& _shape); + + /*! + * @brief This function returns a constant reference to member shape + * @return Constant reference to member shape + */ + eProsima_user_DllExport const derived_object_msgs::msg::SolidPrimitiveWithCovariance& shape() const; + + /*! + * @brief This function returns a reference to member shape + * @return Reference to member shape + */ + eProsima_user_DllExport derived_object_msgs::msg::SolidPrimitiveWithCovariance& shape(); + /*! + * @brief This function sets a value in member classification + * @param _classification New value for member classification + */ + eProsima_user_DllExport void classification( + uint8_t _classification); + + /*! + * @brief This function returns the value of member classification + * @return Value of member classification + */ + eProsima_user_DllExport uint8_t classification() const; + + /*! + * @brief This function returns a reference to member classification + * @return Reference to member classification + */ + eProsima_user_DllExport uint8_t& classification(); + + /*! + * @brief This function sets a value in member classification_certainty + * @param _classification_certainty New value for member classification_certainty + */ + eProsima_user_DllExport void classification_certainty( + uint8_t _classification_certainty); + + /*! + * @brief This function returns the value of member classification_certainty + * @return Value of member classification_certainty + */ + eProsima_user_DllExport uint8_t classification_certainty() const; + + /*! + * @brief This function returns a reference to member classification_certainty + * @return Reference to member classification_certainty + */ + eProsima_user_DllExport uint8_t& classification_certainty(); + + /*! + * @brief This function sets a value in member classification_age + * @param _classification_age New value for member classification_age + */ + eProsima_user_DllExport void classification_age( + uint32_t _classification_age); + + /*! + * @brief This function returns the value of member classification_age + * @return Value of member classification_age + */ + eProsima_user_DllExport uint32_t classification_age() const; + + /*! + * @brief This function returns a reference to member classification_age + * @return Reference to member classification_age + */ + eProsima_user_DllExport uint32_t& classification_age(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const derived_object_msgs::msg::ObjectWithCovariance& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std_msgs::msg::Header m_header; + uint32_t m_id; + uint8_t m_detection_level; + bool m_object_classified; + geometry_msgs::msg::PoseWithCovariance m_pose; + geometry_msgs::msg::TwistWithCovariance m_twist; + geometry_msgs::msg::AccelWithCovariance m_accel; + geometry_msgs::msg::Polygon m_polygon; + derived_object_msgs::msg::SolidPrimitiveWithCovariance m_shape; + uint8_t m_classification; + uint8_t m_classification_certainty; + uint32_t m_classification_age; + }; + } // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.cxx new file mode 100644 index 00000000000..1cb2d8f6329 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.cxx @@ -0,0 +1,250 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovarianceArray.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ObjectWithCovarianceArray.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +derived_object_msgs::msg::ObjectWithCovarianceArray::ObjectWithCovarianceArray() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6e509ffa + + // m_objects com.eprosima.idl.parser.typecode.SequenceTypeCode@68267da0 + + +} + +derived_object_msgs::msg::ObjectWithCovarianceArray::~ObjectWithCovarianceArray() +{ + +} + +derived_object_msgs::msg::ObjectWithCovarianceArray::ObjectWithCovarianceArray( + const ObjectWithCovarianceArray& x) +{ + m_header = x.m_header; + m_objects = x.m_objects; +} + +derived_object_msgs::msg::ObjectWithCovarianceArray::ObjectWithCovarianceArray( + ObjectWithCovarianceArray&& x) +{ + m_header = std::move(x.m_header); + m_objects = std::move(x.m_objects); +} + +derived_object_msgs::msg::ObjectWithCovarianceArray& derived_object_msgs::msg::ObjectWithCovarianceArray::operator =( + const ObjectWithCovarianceArray& x) +{ + + m_header = x.m_header; + m_objects = x.m_objects; + + return *this; +} + +derived_object_msgs::msg::ObjectWithCovarianceArray& derived_object_msgs::msg::ObjectWithCovarianceArray::operator =( + ObjectWithCovarianceArray&& x) +{ + + m_header = std::move(x.m_header); + m_objects = std::move(x.m_objects); + + return *this; +} + +bool derived_object_msgs::msg::ObjectWithCovarianceArray::operator ==( + const ObjectWithCovarianceArray& x) const +{ + + return (m_header == x.m_header && m_objects == x.m_objects); +} + +bool derived_object_msgs::msg::ObjectWithCovarianceArray::operator !=( + const ObjectWithCovarianceArray& x) const +{ + return !(*this == x); +} + +size_t derived_object_msgs::msg::ObjectWithCovarianceArray::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += derived_object_msgs::msg::ObjectWithCovariance::getMaxCdrSerializedSize(current_alignment);} + + + return current_alignment - initial_alignment; +} + +size_t derived_object_msgs::msg::ObjectWithCovarianceArray::getCdrSerializedSize( + const derived_object_msgs::msg::ObjectWithCovarianceArray& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.objects().size(); ++a) + { + current_alignment += derived_object_msgs::msg::ObjectWithCovariance::getCdrSerializedSize(data.objects().at(a), current_alignment);} + + + return current_alignment - initial_alignment; +} + +void derived_object_msgs::msg::ObjectWithCovarianceArray::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_objects; + +} + +void derived_object_msgs::msg::ObjectWithCovarianceArray::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_objects; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void derived_object_msgs::msg::ObjectWithCovarianceArray::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void derived_object_msgs::msg::ObjectWithCovarianceArray::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovarianceArray::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovarianceArray::header() +{ + return m_header; +} +/*! + * @brief This function copies the value in member objects + * @param _objects New value to be copied in member objects + */ +void derived_object_msgs::msg::ObjectWithCovarianceArray::objects( + const std::vector& _objects) +{ + m_objects = _objects; +} + +/*! + * @brief This function moves the value in member objects + * @param _objects New value to be moved in member objects + */ +void derived_object_msgs::msg::ObjectWithCovarianceArray::objects( + std::vector&& _objects) +{ + m_objects = std::move(_objects); +} + +/*! + * @brief This function returns a constant reference to member objects + * @return Constant reference to member objects + */ +const std::vector& derived_object_msgs::msg::ObjectWithCovarianceArray::objects() const +{ + return m_objects; +} + +/*! + * @brief This function returns a reference to member objects + * @return Reference to member objects + */ +std::vector& derived_object_msgs::msg::ObjectWithCovarianceArray::objects() +{ + return m_objects; +} + +size_t derived_object_msgs::msg::ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool derived_object_msgs::msg::ObjectWithCovarianceArray::isKeyDefined() +{ + return false; +} + +void derived_object_msgs::msg::ObjectWithCovarianceArray::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/AckermannDriveStamped.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.h similarity index 60% rename from LibCarla/source/carla/ros2/types/AckermannDriveStamped.h rename to LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.h index 5c3427ea345..e2f2985c278 100644 --- a/LibCarla/source/carla/ros2/types/AckermannDriveStamped.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.h @@ -13,19 +13,16 @@ // limitations under the License. /*! - * @file AckermannDriveStamped.h + * @file ObjectWithCovarianceArray.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ -#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_H_ -#include "AckermannDrive.h" -#include "Header.h" - -#include +#include "ObjectWithCovariance.h" #include #include @@ -46,16 +43,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ACKERMANNDRIVESTAMPED_SOURCE) -#define ACKERMANNDRIVESTAMPED_DllAPI __declspec( dllexport ) +#if defined(ObjectWithCovarianceArray_SOURCE) +#define ObjectWithCovarianceArray_DllAPI __declspec( dllexport ) #else -#define ACKERMANNDRIVESTAMPED_DllAPI __declspec( dllimport ) -#endif // ACKERMANNDRIVESTAMPED_SOURCE +#define ObjectWithCovarianceArray_DllAPI __declspec( dllimport ) +#endif // ObjectWithCovarianceArray_SOURCE #else -#define ACKERMANNDRIVESTAMPED_DllAPI +#define ObjectWithCovarianceArray_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ACKERMANNDRIVESTAMPED_DllAPI +#define ObjectWithCovarianceArray_DllAPI #endif // _WIN32 namespace eprosima { @@ -65,67 +62,67 @@ class Cdr; } // namespace eprosima -namespace ackermann_msgs { +namespace derived_object_msgs { namespace msg { /*! - * @brief This class represents the structure AckermannDriveStamped defined by the user in the IDL file. - * @ingroup AckermannDriveStamped + * @brief This class represents the structure ObjectWithCovarianceArray defined by the user in the IDL file. + * @ingroup OBJECTWITHCOVARIANCEARRAY */ - class AckermannDriveStamped + class ObjectWithCovarianceArray { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport AckermannDriveStamped(); + eProsima_user_DllExport ObjectWithCovarianceArray(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~AckermannDriveStamped(); + eProsima_user_DllExport ~ObjectWithCovarianceArray(); /*! * @brief Copy constructor. - * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. */ - eProsima_user_DllExport AckermannDriveStamped( - const AckermannDriveStamped& x); + eProsima_user_DllExport ObjectWithCovarianceArray( + const ObjectWithCovarianceArray& x); /*! * @brief Move constructor. - * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. */ - eProsima_user_DllExport AckermannDriveStamped( - AckermannDriveStamped&& x) noexcept; + eProsima_user_DllExport ObjectWithCovarianceArray( + ObjectWithCovarianceArray&& x); /*! * @brief Copy assignment. - * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. */ - eProsima_user_DllExport AckermannDriveStamped& operator =( - const AckermannDriveStamped& x); + eProsima_user_DllExport ObjectWithCovarianceArray& operator =( + const ObjectWithCovarianceArray& x); /*! * @brief Move assignment. - * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. */ - eProsima_user_DllExport AckermannDriveStamped& operator =( - AckermannDriveStamped&& x) noexcept; + eProsima_user_DllExport ObjectWithCovarianceArray& operator =( + ObjectWithCovarianceArray&& x); /*! * @brief Comparison operator. - * @param x ackermann_msgs::msg::AckermannDriveStamped object to compare. + * @param x derived_object_msgs::msg::ObjectWithCovarianceArray object to compare. */ eProsima_user_DllExport bool operator ==( - const AckermannDriveStamped& x) const; + const ObjectWithCovarianceArray& x) const; /*! * @brief Comparison operator. - * @param x ackermann_msgs::msg::AckermannDriveStamped object to compare. + * @param x derived_object_msgs::msg::ObjectWithCovarianceArray object to compare. */ eProsima_user_DllExport bool operator !=( - const AckermannDriveStamped& x) const; + const ObjectWithCovarianceArray& x) const; /*! * @brief This function copies the value in member header @@ -153,37 +150,37 @@ namespace ackermann_msgs { */ eProsima_user_DllExport std_msgs::msg::Header& header(); /*! - * @brief This function copies the value in member drive - * @param _drive New value to be copied in member drive + * @brief This function copies the value in member objects + * @param _objects New value to be copied in member objects */ - eProsima_user_DllExport void drive( - const ackermann_msgs::msg::AckermannDrive& _drive); + eProsima_user_DllExport void objects( + const std::vector& _objects); /*! - * @brief This function moves the value in member drive - * @param _drive New value to be moved in member drive + * @brief This function moves the value in member objects + * @param _objects New value to be moved in member objects */ - eProsima_user_DllExport void drive( - ackermann_msgs::msg::AckermannDrive&& _drive); + eProsima_user_DllExport void objects( + std::vector&& _objects); /*! - * @brief This function returns a constant reference to member drive - * @return Constant reference to member drive + * @brief This function returns a constant reference to member objects + * @return Constant reference to member objects */ - eProsima_user_DllExport const ackermann_msgs::msg::AckermannDrive& drive() const; + eProsima_user_DllExport const std::vector& objects() const; /*! - * @brief This function returns a reference to member drive - * @return Reference to member drive + * @brief This function returns a reference to member objects + * @return Reference to member objects */ - eProsima_user_DllExport ackermann_msgs::msg::AckermannDrive& drive(); + eProsima_user_DllExport std::vector& objects(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -194,7 +191,7 @@ namespace ackermann_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const ackermann_msgs::msg::AckermannDriveStamped& data, + const derived_object_msgs::msg::ObjectWithCovarianceArray& data, size_t current_alignment = 0); @@ -238,11 +235,9 @@ namespace ackermann_msgs { private: std_msgs::msg::Header m_header; - ackermann_msgs::msg::AckermannDrive m_drive; - + std::vector m_objects; }; } // namespace msg -} // namespace ackermann_msgs - -#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ +} // namespace derived_object_msgs +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.cxx new file mode 100644 index 00000000000..e0f71c8f0a8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovarianceArrayPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ObjectWithCovarianceArrayPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace derived_object_msgs { + namespace msg { + ObjectWithCovarianceArrayPubSubType::ObjectWithCovarianceArrayPubSubType() + { + setName("derived_object_msgs::msg::dds_::ObjectWithCovarianceArray_"); + auto type_size = ObjectWithCovarianceArray::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ObjectWithCovarianceArray::isKeyDefined(); + size_t keyLength = ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize() > 16 ? + ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ObjectWithCovarianceArrayPubSubType::~ObjectWithCovarianceArrayPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ObjectWithCovarianceArrayPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ObjectWithCovarianceArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ObjectWithCovarianceArrayPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ObjectWithCovarianceArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ObjectWithCovarianceArrayPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ObjectWithCovarianceArrayPubSubType::createData() + { + return reinterpret_cast(new ObjectWithCovarianceArray()); + } + + void ObjectWithCovarianceArrayPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ObjectWithCovarianceArrayPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ObjectWithCovarianceArray* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace derived_object_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h new file mode 100644 index 00000000000..359c8aa8a63 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovarianceArrayPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_PUBSUBTYPES_H_ + +#include +#include + +#include "ObjectWithCovarianceArray.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ObjectWithCovarianceArray is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace derived_object_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type ObjectWithCovarianceArray defined by the user in the IDL file. + * @ingroup OBJECTWITHCOVARIANCEARRAY + */ + class ObjectWithCovarianceArrayPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ObjectWithCovarianceArray type; + + eProsima_user_DllExport ObjectWithCovarianceArrayPubSubType(); + + eProsima_user_DllExport virtual ~ObjectWithCovarianceArrayPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.cxx new file mode 100644 index 00000000000..d5f4af276e3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.cxx @@ -0,0 +1,193 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovariancePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ObjectWithCovariancePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace derived_object_msgs { + namespace msg { + namespace ObjectWithCovariance_Constants { + + + + + + + + + + + + + + + + } //End of namespace ObjectWithCovariance_Constants + ObjectWithCovariancePubSubType::ObjectWithCovariancePubSubType() + { + setName("derived_object_msgs::msg::dds_::ObjectWithCovariance_"); + auto type_size = ObjectWithCovariance::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ObjectWithCovariance::isKeyDefined(); + size_t keyLength = ObjectWithCovariance::getKeyMaxCdrSerializedSize() > 16 ? + ObjectWithCovariance::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ObjectWithCovariancePubSubType::~ObjectWithCovariancePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ObjectWithCovariancePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ObjectWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ObjectWithCovariancePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ObjectWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ObjectWithCovariancePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ObjectWithCovariancePubSubType::createData() + { + return reinterpret_cast(new ObjectWithCovariance()); + } + + void ObjectWithCovariancePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ObjectWithCovariancePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ObjectWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ObjectWithCovariance::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ObjectWithCovariance::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace derived_object_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h new file mode 100644 index 00000000000..b29521ecfe9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h @@ -0,0 +1,124 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include + +#include "ObjectWithCovariance.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ObjectWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace derived_object_msgs +{ + namespace msg + { + namespace ObjectWithCovariance_Constants + { + + + + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type ObjectWithCovariance defined by the user in the IDL file. + * @ingroup OBJECTWITHCOVARIANCE + */ + class ObjectWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ObjectWithCovariance type; + + eProsima_user_DllExport ObjectWithCovariancePubSubType(); + + eProsima_user_DllExport virtual ~ObjectWithCovariancePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.cxx new file mode 100644 index 00000000000..c147b3ba564 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.cxx @@ -0,0 +1,320 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitiveWithCovariance.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SolidPrimitiveWithCovariance.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + +derived_object_msgs::msg::SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance() +{ + // m_type com.eprosima.idl.parser.typecode.PrimitiveTypeCode@48075da3 + m_type = 0; + // m_dimensions com.eprosima.idl.parser.typecode.SequenceTypeCode@68c9133c + + // m_covariance com.eprosima.idl.parser.typecode.SequenceTypeCode@7a35b0f5 + + +} + +derived_object_msgs::msg::SolidPrimitiveWithCovariance::~SolidPrimitiveWithCovariance() +{ + + +} + +derived_object_msgs::msg::SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance( + const SolidPrimitiveWithCovariance& x) +{ + m_type = x.m_type; + m_dimensions = x.m_dimensions; + m_covariance = x.m_covariance; +} + +derived_object_msgs::msg::SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance( + SolidPrimitiveWithCovariance&& x) +{ + m_type = x.m_type; + m_dimensions = std::move(x.m_dimensions); + m_covariance = std::move(x.m_covariance); +} + +derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msgs::msg::SolidPrimitiveWithCovariance::operator =( + const SolidPrimitiveWithCovariance& x) +{ + + m_type = x.m_type; + m_dimensions = x.m_dimensions; + m_covariance = x.m_covariance; + + return *this; +} + +derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msgs::msg::SolidPrimitiveWithCovariance::operator =( + SolidPrimitiveWithCovariance&& x) +{ + + m_type = x.m_type; + m_dimensions = std::move(x.m_dimensions); + m_covariance = std::move(x.m_covariance); + + return *this; +} + +bool derived_object_msgs::msg::SolidPrimitiveWithCovariance::operator ==( + const SolidPrimitiveWithCovariance& x) const +{ + + return (m_type == x.m_type && m_dimensions == x.m_dimensions && m_covariance == x.m_covariance); +} + +bool derived_object_msgs::msg::SolidPrimitiveWithCovariance::operator !=( + const SolidPrimitiveWithCovariance& x) const +{ + return !(*this == x); +} + +size_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + + return current_alignment - initial_alignment; +} + +size_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::getCdrSerializedSize( + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.dimensions().size() > 0) + { + current_alignment += (data.dimensions().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.covariance().size() > 0) + { + current_alignment += (data.covariance().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + + return current_alignment - initial_alignment; +} + +void derived_object_msgs::msg::SolidPrimitiveWithCovariance::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_type; + scdr << m_dimensions; + scdr << m_covariance; + +} + +void derived_object_msgs::msg::SolidPrimitiveWithCovariance::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_type; + dcdr >> m_dimensions; + dcdr >> m_covariance; +} + +/*! + * @brief This function sets a value in member type + * @param _type New value for member type + */ +void derived_object_msgs::msg::SolidPrimitiveWithCovariance::type( + uint8_t _type) +{ + m_type = _type; +} + +/*! + * @brief This function returns the value of member type + * @return Value of member type + */ +uint8_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::type() const +{ + return m_type; +} + +/*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ +uint8_t& derived_object_msgs::msg::SolidPrimitiveWithCovariance::type() +{ + return m_type; +} + +/*! + * @brief This function copies the value in member dimensions + * @param _dimensions New value to be copied in member dimensions + */ +void derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions( + const std::vector& _dimensions) +{ + m_dimensions = _dimensions; +} + +/*! + * @brief This function moves the value in member dimensions + * @param _dimensions New value to be moved in member dimensions + */ +void derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions( + std::vector&& _dimensions) +{ + m_dimensions = std::move(_dimensions); +} + +/*! + * @brief This function returns a constant reference to member dimensions + * @return Constant reference to member dimensions + */ +const std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions() const +{ + return m_dimensions; +} + +/*! + * @brief This function returns a reference to member dimensions + * @return Reference to member dimensions + */ +std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions() +{ + return m_dimensions; +} +/*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ +void derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance( + const std::vector& _covariance) +{ + m_covariance = _covariance; +} + +/*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ +void derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance( + std::vector&& _covariance) +{ + m_covariance = std::move(_covariance); +} + +/*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ +const std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance() const +{ + return m_covariance; +} + +/*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ +std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance() +{ + return m_covariance; +} + +size_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool derived_object_msgs::msg::SolidPrimitiveWithCovariance::isKeyDefined() +{ + return false; +} + +void derived_object_msgs::msg::SolidPrimitiveWithCovariance::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.h new file mode 100644 index 00000000000..702fe4746ff --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.h @@ -0,0 +1,276 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitiveWithCovariance.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SolidPrimitiveWithCovariance_SOURCE) +#define SolidPrimitiveWithCovariance_DllAPI __declspec( dllexport ) +#else +#define SolidPrimitiveWithCovariance_DllAPI __declspec( dllimport ) +#endif // SolidPrimitiveWithCovariance_SOURCE +#else +#define SolidPrimitiveWithCovariance_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SolidPrimitiveWithCovariance_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace derived_object_msgs { + namespace msg { + namespace SolidPrimitiveWithCovariance_Constants { + const uint8_t BOX = 1; + const uint8_t SPHERE = 2; + const uint8_t CYLINDER = 3; + const uint8_t CONE = 4; + const uint8_t BOX_X = 0; + const uint8_t BOX_Y = 1; + const uint8_t BOX_Z = 2; + const uint8_t SPHERE_RADIUS = 0; + const uint8_t CYLINDER_HEIGHT = 0; + const uint8_t CYLINDER_RADIUS = 1; + const uint8_t CONE_HEIGHT = 0; + const uint8_t CONE_RADIUS = 1; + } // namespace SolidPrimitiveWithCovariance_Constants + /*! + * @brief This class represents the structure SolidPrimitiveWithCovariance defined by the user in the IDL file. + * @ingroup SOLIDPRIMITIVEWITHCOVARIANCE + */ + class SolidPrimitiveWithCovariance + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SolidPrimitiveWithCovariance(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance( + const SolidPrimitiveWithCovariance& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance( + SolidPrimitiveWithCovariance&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance& operator =( + const SolidPrimitiveWithCovariance& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance& operator =( + SolidPrimitiveWithCovariance&& x); + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::SolidPrimitiveWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SolidPrimitiveWithCovariance& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::SolidPrimitiveWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SolidPrimitiveWithCovariance& x) const; + + /*! + * @brief This function sets a value in member type + * @param _type New value for member type + */ + eProsima_user_DllExport void type( + uint8_t _type); + + /*! + * @brief This function returns the value of member type + * @return Value of member type + */ + eProsima_user_DllExport uint8_t type() const; + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport uint8_t& type(); + + /*! + * @brief This function copies the value in member dimensions + * @param _dimensions New value to be copied in member dimensions + */ + eProsima_user_DllExport void dimensions( + const std::vector& _dimensions); + + /*! + * @brief This function moves the value in member dimensions + * @param _dimensions New value to be moved in member dimensions + */ + eProsima_user_DllExport void dimensions( + std::vector&& _dimensions); + + /*! + * @brief This function returns a constant reference to member dimensions + * @return Constant reference to member dimensions + */ + eProsima_user_DllExport const std::vector& dimensions() const; + + /*! + * @brief This function returns a reference to member dimensions + * @return Reference to member dimensions + */ + eProsima_user_DllExport std::vector& dimensions(); + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const std::vector& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + std::vector&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const std::vector& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport std::vector& covariance(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_type; + std::vector m_dimensions; + std::vector m_covariance; + }; + } // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.cxx new file mode 100644 index 00000000000..0c23b089740 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.cxx @@ -0,0 +1,191 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitiveWithCovariancePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SolidPrimitiveWithCovariancePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace derived_object_msgs { + namespace msg { + namespace SolidPrimitiveWithCovariance_Constants { + + + + + + + + + + + + + + } //End of namespace SolidPrimitiveWithCovariance_Constants + SolidPrimitiveWithCovariancePubSubType::SolidPrimitiveWithCovariancePubSubType() + { + setName("derived_object_msgs::msg::dds_::SolidPrimitiveWithCovariance_"); + auto type_size = SolidPrimitiveWithCovariance::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SolidPrimitiveWithCovariance::isKeyDefined(); + size_t keyLength = SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize() > 16 ? + SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SolidPrimitiveWithCovariancePubSubType::~SolidPrimitiveWithCovariancePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SolidPrimitiveWithCovariancePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SolidPrimitiveWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SolidPrimitiveWithCovariancePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SolidPrimitiveWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SolidPrimitiveWithCovariancePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SolidPrimitiveWithCovariancePubSubType::createData() + { + return reinterpret_cast(new SolidPrimitiveWithCovariance()); + } + + void SolidPrimitiveWithCovariancePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SolidPrimitiveWithCovariancePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SolidPrimitiveWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace derived_object_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.h new file mode 100644 index 00000000000..b63468cab18 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.h @@ -0,0 +1,122 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitiveWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include + +#include "SolidPrimitiveWithCovariance.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SolidPrimitiveWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace derived_object_msgs +{ + namespace msg + { + namespace SolidPrimitiveWithCovariance_Constants + { + + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type SolidPrimitiveWithCovariance defined by the user in the IDL file. + * @ingroup SOLIDPRIMITIVEWITHCOVARIANCE + */ + class SolidPrimitiveWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SolidPrimitiveWithCovariance type; + + eProsima_user_DllExport SolidPrimitiveWithCovariancePubSubType(); + + eProsima_user_DllExport virtual ~SolidPrimitiveWithCovariancePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.cxx b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.cxx new file mode 100644 index 00000000000..d6c663435b8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.cxx @@ -0,0 +1,242 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "KeyValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +diagnostic_msgs::msg::KeyValue::KeyValue() +{ + // m_key com.eprosima.idl.parser.typecode.StringTypeCode@77888435 + m_key =""; + // m_value com.eprosima.idl.parser.typecode.StringTypeCode@73a1e9a9 + m_value =""; + +} + +diagnostic_msgs::msg::KeyValue::~KeyValue() +{ + +} + +diagnostic_msgs::msg::KeyValue::KeyValue( + const KeyValue& x) +{ + m_key = x.m_key; + m_value = x.m_value; +} + +diagnostic_msgs::msg::KeyValue::KeyValue( + KeyValue&& x) +{ + m_key = std::move(x.m_key); + m_value = std::move(x.m_value); +} + +diagnostic_msgs::msg::KeyValue& diagnostic_msgs::msg::KeyValue::operator =( + const KeyValue& x) +{ + + m_key = x.m_key; + m_value = x.m_value; + + return *this; +} + +diagnostic_msgs::msg::KeyValue& diagnostic_msgs::msg::KeyValue::operator =( + KeyValue&& x) +{ + + m_key = std::move(x.m_key); + m_value = std::move(x.m_value); + + return *this; +} + +bool diagnostic_msgs::msg::KeyValue::operator ==( + const KeyValue& x) const +{ + + return (m_key == x.m_key && m_value == x.m_value); +} + +bool diagnostic_msgs::msg::KeyValue::operator !=( + const KeyValue& x) const +{ + return !(*this == x); +} + +size_t diagnostic_msgs::msg::KeyValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + + return current_alignment - initial_alignment; +} + +size_t diagnostic_msgs::msg::KeyValue::getCdrSerializedSize( + const diagnostic_msgs::msg::KeyValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.key().size() + 1; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.value().size() + 1; + + + return current_alignment - initial_alignment; +} + +void diagnostic_msgs::msg::KeyValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_key; + scdr << m_value; + +} + +void diagnostic_msgs::msg::KeyValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_key; + dcdr >> m_value; +} + +/*! + * @brief This function copies the value in member key + * @param _key New value to be copied in member key + */ +void diagnostic_msgs::msg::KeyValue::key( + const std::string& _key) +{ + m_key = _key; +} + +/*! + * @brief This function moves the value in member key + * @param _key New value to be moved in member key + */ +void diagnostic_msgs::msg::KeyValue::key( + std::string&& _key) +{ + m_key = std::move(_key); +} + +/*! + * @brief This function returns a constant reference to member key + * @return Constant reference to member key + */ +const std::string& diagnostic_msgs::msg::KeyValue::key() const +{ + return m_key; +} + +/*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ +std::string& diagnostic_msgs::msg::KeyValue::key() +{ + return m_key; +} +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void diagnostic_msgs::msg::KeyValue::value( + const std::string& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void diagnostic_msgs::msg::KeyValue::value( + std::string&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::string& diagnostic_msgs::msg::KeyValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::string& diagnostic_msgs::msg::KeyValue::value() +{ + return m_value; +} + +size_t diagnostic_msgs::msg::KeyValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool diagnostic_msgs::msg::KeyValue::isKeyDefined() +{ + return false; +} + +void diagnostic_msgs::msg::KeyValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.h b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.h new file mode 100644 index 00000000000..4d5ecac164d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.h @@ -0,0 +1,218 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_H_ +#define _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_H_ + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(KeyValue_SOURCE) +#define KeyValue_DllAPI __declspec(dllexport) +#else +#define KeyValue_DllAPI __declspec(dllimport) +#endif // KeyValue_SOURCE +#else +#define KeyValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define KeyValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace diagnostic_msgs { +namespace msg { +/*! + * @brief This class represents the structure KeyValue defined by the user in the IDL file. + * @ingroup KEYVALUE + */ +class KeyValue { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport KeyValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~KeyValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. + */ + eProsima_user_DllExport KeyValue(const KeyValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. + */ + eProsima_user_DllExport KeyValue(KeyValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. + */ + eProsima_user_DllExport KeyValue& operator=(const KeyValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. + */ + eProsima_user_DllExport KeyValue& operator=(KeyValue&& x); + + /*! + * @brief Comparison operator. + * @param x diagnostic_msgs::msg::KeyValue object to compare. + */ + eProsima_user_DllExport bool operator==(const KeyValue& x) const; + + /*! + * @brief Comparison operator. + * @param x diagnostic_msgs::msg::KeyValue object to compare. + */ + eProsima_user_DllExport bool operator!=(const KeyValue& x) const; + + /*! + * @brief This function copies the value in member key + * @param _key New value to be copied in member key + */ + eProsima_user_DllExport void key(const std::string& _key); + + /*! + * @brief This function moves the value in member key + * @param _key New value to be moved in member key + */ + eProsima_user_DllExport void key(std::string&& _key); + + /*! + * @brief This function returns a constant reference to member key + * @return Constant reference to member key + */ + eProsima_user_DllExport const std::string& key() const; + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport std::string& key(); + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value(const std::string& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value(std::string&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::string& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::string& value(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const diagnostic_msgs::msg::KeyValue& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std::string m_key; + std::string m_value; +}; +} // namespace msg +} // namespace diagnostic_msgs + +#endif // _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.cxx new file mode 100644 index 00000000000..1ef029471c8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "KeyValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace diagnostic_msgs { + namespace msg { + KeyValuePubSubType::KeyValuePubSubType() + { + setName("diagnostic_msgs::msg::dds_::KeyValue_"); + auto type_size = KeyValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = KeyValue::isKeyDefined(); + size_t keyLength = KeyValue::getKeyMaxCdrSerializedSize() > 16 ? + KeyValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + KeyValuePubSubType::~KeyValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool KeyValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + KeyValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool KeyValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + KeyValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function KeyValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* KeyValuePubSubType::createData() + { + return reinterpret_cast(new KeyValue()); + } + + void KeyValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool KeyValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + KeyValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + KeyValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || KeyValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace diagnostic_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.h new file mode 100644 index 00000000000..c8294a09b09 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.h @@ -0,0 +1,91 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "KeyValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated KeyValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace diagnostic_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type KeyValue defined by the user in the IDL file. + * @ingroup KEYVALUE + */ +class KeyValuePubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef KeyValue type; + + eProsima_user_DllExport KeyValuePubSubType(); + + eProsima_user_DllExport virtual ~KeyValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace diagnostic_msgs + +#endif // _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.cxx new file mode 100644 index 00000000000..01057ba7cc3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationConfidence.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "AccelerationConfidence.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::AccelerationConfidence::AccelerationConfidence() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@488b50ec + m_value = 0; + +} + +etsi_its_cam_msgs::msg::AccelerationConfidence::~AccelerationConfidence() +{ +} + +etsi_its_cam_msgs::msg::AccelerationConfidence::AccelerationConfidence( + const AccelerationConfidence& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::AccelerationConfidence::AccelerationConfidence( + AccelerationConfidence&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::AccelerationConfidence::operator =( + const AccelerationConfidence& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::AccelerationConfidence::operator =( + AccelerationConfidence&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::AccelerationConfidence::operator ==( + const AccelerationConfidence& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::AccelerationConfidence::operator !=( + const AccelerationConfidence& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::AccelerationConfidence::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::AccelerationConfidence::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::AccelerationConfidence& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::AccelerationConfidence::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::AccelerationConfidence::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::AccelerationConfidence::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::AccelerationConfidence::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::AccelerationConfidence::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::AccelerationConfidence::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::AccelerationConfidence::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::AccelerationConfidence::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.h new file mode 100644 index 00000000000..77772770cf0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationConfidence.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(AccelerationConfidence_SOURCE) +#define AccelerationConfidence_DllAPI __declspec( dllexport ) +#else +#define AccelerationConfidence_DllAPI __declspec( dllimport ) +#endif // AccelerationConfidence_SOURCE +#else +#define AccelerationConfidence_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define AccelerationConfidence_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace AccelerationConfidence_Constants { + const uint8_t MIN = 0; + const uint8_t MAX = 102; + const uint8_t POINT_ONE_METER_PER_SEC_SQUARED = 1; + const uint8_t OUT_OF_RANGE = 101; + const uint8_t UNAVAILABLE = 102; + } // namespace AccelerationConfidence_Constants + /*! + * @brief This class represents the structure AccelerationConfidence defined by the user in the IDL file. + * @ingroup ACCELERATIONCONFIDENCE + */ + class AccelerationConfidence + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AccelerationConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AccelerationConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. + */ + eProsima_user_DllExport AccelerationConfidence( + const AccelerationConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. + */ + eProsima_user_DllExport AccelerationConfidence( + AccelerationConfidence&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. + */ + eProsima_user_DllExport AccelerationConfidence& operator =( + const AccelerationConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. + */ + eProsima_user_DllExport AccelerationConfidence& operator =( + AccelerationConfidence&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AccelerationConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AccelerationConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AccelerationConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AccelerationConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::AccelerationConfidence& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.cxx new file mode 100644 index 00000000000..364f536aaea --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationConfidencePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "AccelerationConfidencePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace AccelerationConfidence_Constants { + + + + + + + } //End of namespace AccelerationConfidence_Constants + AccelerationConfidencePubSubType::AccelerationConfidencePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::AccelerationConfidence_"); + auto type_size = AccelerationConfidence::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = AccelerationConfidence::isKeyDefined(); + size_t keyLength = AccelerationConfidence::getKeyMaxCdrSerializedSize() > 16 ? + AccelerationConfidence::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + AccelerationConfidencePubSubType::~AccelerationConfidencePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool AccelerationConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + AccelerationConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool AccelerationConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + AccelerationConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function AccelerationConfidencePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* AccelerationConfidencePubSubType::createData() + { + return reinterpret_cast(new AccelerationConfidence()); + } + + void AccelerationConfidencePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool AccelerationConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + AccelerationConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + AccelerationConfidence::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || AccelerationConfidence::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.h new file mode 100644 index 00000000000..d8b8905bb0c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationConfidencePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_PUBSUBTYPES_H_ + +#include +#include + +#include "AccelerationConfidence.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated AccelerationConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace AccelerationConfidence_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type AccelerationConfidence defined by the user in the IDL file. + * @ingroup ACCELERATIONCONFIDENCE + */ + class AccelerationConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef AccelerationConfidence type; + + eProsima_user_DllExport AccelerationConfidencePubSubType(); + + eProsima_user_DllExport virtual ~AccelerationConfidencePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) AccelerationConfidence(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.cxx new file mode 100644 index 00000000000..c383be637fc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.cxx @@ -0,0 +1,255 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationControl.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "AccelerationControl.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + +etsi_its_cam_msgs::msg::AccelerationControl::AccelerationControl() +{ + // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@7fab4be7 + + // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@a64e035 + m_bits_unused = 0; + +} + +etsi_its_cam_msgs::msg::AccelerationControl::~AccelerationControl() +{ + +} + +etsi_its_cam_msgs::msg::AccelerationControl::AccelerationControl( + const AccelerationControl& x) +{ + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::AccelerationControl::AccelerationControl( + AccelerationControl&& x) +{ + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::AccelerationControl::operator =( + const AccelerationControl& x) +{ + + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; + + return *this; +} + +etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::AccelerationControl::operator =( + AccelerationControl&& x) +{ + + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; + + return *this; +} + +bool etsi_its_cam_msgs::msg::AccelerationControl::operator ==( + const AccelerationControl& x) const +{ + + return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); +} + +bool etsi_its_cam_msgs::msg::AccelerationControl::operator !=( + const AccelerationControl& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::AccelerationControl::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::AccelerationControl::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::AccelerationControl& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.value().size() > 0) + { + current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::AccelerationControl::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + scdr << m_bits_unused; + +} + +void etsi_its_cam_msgs::msg::AccelerationControl::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; + dcdr >> m_bits_unused; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void etsi_its_cam_msgs::msg::AccelerationControl::value( + const std::vector& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void etsi_its_cam_msgs::msg::AccelerationControl::value( + std::vector&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::vector& etsi_its_cam_msgs::msg::AccelerationControl::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::vector& etsi_its_cam_msgs::msg::AccelerationControl::value() +{ + return m_value; +} +/*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ +void etsi_its_cam_msgs::msg::AccelerationControl::bits_unused( + uint8_t _bits_unused) +{ + m_bits_unused = _bits_unused; +} + +/*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ +uint8_t etsi_its_cam_msgs::msg::AccelerationControl::bits_unused() const +{ + return m_bits_unused; +} + +/*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ +uint8_t& etsi_its_cam_msgs::msg::AccelerationControl::bits_unused() +{ + return m_bits_unused; +} + + +size_t etsi_its_cam_msgs::msg::AccelerationControl::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::AccelerationControl::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::AccelerationControl::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.h new file mode 100644 index 00000000000..752a9644c16 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.h @@ -0,0 +1,246 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationControl.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(AccelerationControl_SOURCE) +#define AccelerationControl_DllAPI __declspec( dllexport ) +#else +#define AccelerationControl_DllAPI __declspec( dllimport ) +#endif // AccelerationControl_SOURCE +#else +#define AccelerationControl_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define AccelerationControl_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace AccelerationControl_Constants { + const uint8_t SIZE_BITS = 7; + const uint8_t BIT_INDEX_BRAKE_PEDAL_ENGAGED = 0; + const uint8_t BIT_INDEX_GAS_PEDAL_ENGAGED = 1; + const uint8_t BIT_INDEX_EMERGENCY_BRAKE_ENGAGED = 2; + const uint8_t BIT_INDEX_COLLISION_WARNING_ENGAGED = 3; + const uint8_t BIT_INDEX_ACC_ENGAGED = 4; + const uint8_t BIT_INDEX_CRUISE_CONTROL_ENGAGED = 5; + const uint8_t BIT_INDEX_SPEED_LIMITER_ENGAGED = 6; + } // namespace AccelerationControl_Constants + /*! + * @brief This class represents the structure AccelerationControl defined by the user in the IDL file. + * @ingroup ACCELERATIONCONTROL + */ + class AccelerationControl + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AccelerationControl(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AccelerationControl(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. + */ + eProsima_user_DllExport AccelerationControl( + const AccelerationControl& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. + */ + eProsima_user_DllExport AccelerationControl( + AccelerationControl&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. + */ + eProsima_user_DllExport AccelerationControl& operator =( + const AccelerationControl& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. + */ + eProsima_user_DllExport AccelerationControl& operator =( + AccelerationControl&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AccelerationControl object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AccelerationControl& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AccelerationControl object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AccelerationControl& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::AccelerationControl& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_value; + uint8_t m_bits_unused; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.cxx new file mode 100644 index 00000000000..5c820a04f00 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationControlPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "AccelerationControlPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace AccelerationControl_Constants { + + + + + + + + + + } //End of namespace AccelerationControl_Constants + AccelerationControlPubSubType::AccelerationControlPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::AccelerationControl_"); + auto type_size = AccelerationControl::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = AccelerationControl::isKeyDefined(); + size_t keyLength = AccelerationControl::getKeyMaxCdrSerializedSize() > 16 ? + AccelerationControl::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + AccelerationControlPubSubType::~AccelerationControlPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool AccelerationControlPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + AccelerationControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool AccelerationControlPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + AccelerationControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function AccelerationControlPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* AccelerationControlPubSubType::createData() + { + return reinterpret_cast(new AccelerationControl()); + } + + void AccelerationControlPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool AccelerationControlPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + AccelerationControl* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + AccelerationControl::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || AccelerationControl::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.h new file mode 100644 index 00000000000..e3209bc69bf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.h @@ -0,0 +1,118 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationControlPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_PUBSUBTYPES_H_ + +#include +#include + +#include "AccelerationControl.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated AccelerationControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace AccelerationControl_Constants + { + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type AccelerationControl defined by the user in the IDL file. + * @ingroup ACCELERATIONCONTROL + */ + class AccelerationControlPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef AccelerationControl type; + + eProsima_user_DllExport AccelerationControlPubSubType(); + + eProsima_user_DllExport virtual ~AccelerationControlPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.cxx new file mode 100644 index 00000000000..46655cfa36f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Altitude.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Altitude.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::Altitude::Altitude() +{ + // m_altitude_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@476a736d + + // m_altitude_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5f80fa43 + + +} + +etsi_its_cam_msgs::msg::Altitude::~Altitude() +{ + +} + +etsi_its_cam_msgs::msg::Altitude::Altitude( + const Altitude& x) +{ + m_altitude_value = x.m_altitude_value; + m_altitude_confidence = x.m_altitude_confidence; +} + +etsi_its_cam_msgs::msg::Altitude::Altitude( + Altitude&& x) +{ + m_altitude_value = std::move(x.m_altitude_value); + m_altitude_confidence = std::move(x.m_altitude_confidence); +} + +etsi_its_cam_msgs::msg::Altitude& etsi_its_cam_msgs::msg::Altitude::operator =( + const Altitude& x) +{ + + m_altitude_value = x.m_altitude_value; + m_altitude_confidence = x.m_altitude_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::Altitude& etsi_its_cam_msgs::msg::Altitude::operator =( + Altitude&& x) +{ + + m_altitude_value = std::move(x.m_altitude_value); + m_altitude_confidence = std::move(x.m_altitude_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::Altitude::operator ==( + const Altitude& x) const +{ + + return (m_altitude_value == x.m_altitude_value && m_altitude_confidence == x.m_altitude_confidence); +} + +bool etsi_its_cam_msgs::msg::Altitude::operator !=( + const Altitude& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::Altitude::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::AltitudeValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AltitudeConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::Altitude::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Altitude& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::AltitudeValue::getCdrSerializedSize(data.altitude_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AltitudeConfidence::getCdrSerializedSize(data.altitude_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::Altitude::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_altitude_value; + scdr << m_altitude_confidence; + +} + +void etsi_its_cam_msgs::msg::Altitude::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_altitude_value; + dcdr >> m_altitude_confidence; +} + +/*! + * @brief This function copies the value in member altitude_value + * @param _altitude_value New value to be copied in member altitude_value + */ +void etsi_its_cam_msgs::msg::Altitude::altitude_value( + const etsi_its_cam_msgs::msg::AltitudeValue& _altitude_value) +{ + m_altitude_value = _altitude_value; +} + +/*! + * @brief This function moves the value in member altitude_value + * @param _altitude_value New value to be moved in member altitude_value + */ +void etsi_its_cam_msgs::msg::Altitude::altitude_value( + etsi_its_cam_msgs::msg::AltitudeValue&& _altitude_value) +{ + m_altitude_value = std::move(_altitude_value); +} + +/*! + * @brief This function returns a constant reference to member altitude_value + * @return Constant reference to member altitude_value + */ +const etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::Altitude::altitude_value() const +{ + return m_altitude_value; +} + +/*! + * @brief This function returns a reference to member altitude_value + * @return Reference to member altitude_value + */ +etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::Altitude::altitude_value() +{ + return m_altitude_value; +} +/*! + * @brief This function copies the value in member altitude_confidence + * @param _altitude_confidence New value to be copied in member altitude_confidence + */ +void etsi_its_cam_msgs::msg::Altitude::altitude_confidence( + const etsi_its_cam_msgs::msg::AltitudeConfidence& _altitude_confidence) +{ + m_altitude_confidence = _altitude_confidence; +} + +/*! + * @brief This function moves the value in member altitude_confidence + * @param _altitude_confidence New value to be moved in member altitude_confidence + */ +void etsi_its_cam_msgs::msg::Altitude::altitude_confidence( + etsi_its_cam_msgs::msg::AltitudeConfidence&& _altitude_confidence) +{ + m_altitude_confidence = std::move(_altitude_confidence); +} + +/*! + * @brief This function returns a constant reference to member altitude_confidence + * @return Constant reference to member altitude_confidence + */ +const etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::Altitude::altitude_confidence() const +{ + return m_altitude_confidence; +} + +/*! + * @brief This function returns a reference to member altitude_confidence + * @return Reference to member altitude_confidence + */ +etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::Altitude::altitude_confidence() +{ + return m_altitude_confidence; +} + +size_t etsi_its_cam_msgs::msg::Altitude::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::Altitude::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::Altitude::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.h new file mode 100644 index 00000000000..7ca4d3a2a24 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Altitude.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_H_ + +#include "AltitudeConfidence.h" +#include "AltitudeValue.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Altitude_SOURCE) +#define Altitude_DllAPI __declspec( dllexport ) +#else +#define Altitude_DllAPI __declspec( dllimport ) +#endif // Altitude_SOURCE +#else +#define Altitude_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Altitude_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure Altitude defined by the user in the IDL file. + * @ingroup ALTITUDE + */ + class Altitude + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Altitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Altitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. + */ + eProsima_user_DllExport Altitude( + const Altitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. + */ + eProsima_user_DllExport Altitude( + Altitude&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. + */ + eProsima_user_DllExport Altitude& operator =( + const Altitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. + */ + eProsima_user_DllExport Altitude& operator =( + Altitude&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Altitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Altitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Altitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Altitude& x) const; + + /*! + * @brief This function copies the value in member altitude_value + * @param _altitude_value New value to be copied in member altitude_value + */ + eProsima_user_DllExport void altitude_value( + const etsi_its_cam_msgs::msg::AltitudeValue& _altitude_value); + + /*! + * @brief This function moves the value in member altitude_value + * @param _altitude_value New value to be moved in member altitude_value + */ + eProsima_user_DllExport void altitude_value( + etsi_its_cam_msgs::msg::AltitudeValue&& _altitude_value); + + /*! + * @brief This function returns a constant reference to member altitude_value + * @return Constant reference to member altitude_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AltitudeValue& altitude_value() const; + + /*! + * @brief This function returns a reference to member altitude_value + * @return Reference to member altitude_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AltitudeValue& altitude_value(); + /*! + * @brief This function copies the value in member altitude_confidence + * @param _altitude_confidence New value to be copied in member altitude_confidence + */ + eProsima_user_DllExport void altitude_confidence( + const etsi_its_cam_msgs::msg::AltitudeConfidence& _altitude_confidence); + + /*! + * @brief This function moves the value in member altitude_confidence + * @param _altitude_confidence New value to be moved in member altitude_confidence + */ + eProsima_user_DllExport void altitude_confidence( + etsi_its_cam_msgs::msg::AltitudeConfidence&& _altitude_confidence); + + /*! + * @brief This function returns a constant reference to member altitude_confidence + * @return Constant reference to member altitude_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AltitudeConfidence& altitude_confidence() const; + + /*! + * @brief This function returns a reference to member altitude_confidence + * @return Reference to member altitude_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AltitudeConfidence& altitude_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Altitude& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::AltitudeValue m_altitude_value; + etsi_its_cam_msgs::msg::AltitudeConfidence m_altitude_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.cxx new file mode 100644 index 00000000000..56d8de4d586 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.cxx @@ -0,0 +1,200 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeConfidence.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "AltitudeConfidence.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + + + +etsi_its_cam_msgs::msg::AltitudeConfidence::AltitudeConfidence() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@540dbda9 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::AltitudeConfidence::~AltitudeConfidence() +{ +} + +etsi_its_cam_msgs::msg::AltitudeConfidence::AltitudeConfidence( + const AltitudeConfidence& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::AltitudeConfidence::AltitudeConfidence( + AltitudeConfidence&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::AltitudeConfidence::operator =( + const AltitudeConfidence& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::AltitudeConfidence::operator =( + AltitudeConfidence&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::AltitudeConfidence::operator ==( + const AltitudeConfidence& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::AltitudeConfidence::operator !=( + const AltitudeConfidence& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::AltitudeConfidence::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::AltitudeConfidence::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::AltitudeConfidence& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::AltitudeConfidence::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::AltitudeConfidence::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::AltitudeConfidence::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::AltitudeConfidence::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::AltitudeConfidence::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::AltitudeConfidence::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::AltitudeConfidence::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::AltitudeConfidence::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.h new file mode 100644 index 00000000000..0c35bb1ce82 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.h @@ -0,0 +1,228 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeConfidence.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(AltitudeConfidence_SOURCE) +#define AltitudeConfidence_DllAPI __declspec( dllexport ) +#else +#define AltitudeConfidence_DllAPI __declspec( dllimport ) +#endif // AltitudeConfidence_SOURCE +#else +#define AltitudeConfidence_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define AltitudeConfidence_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace AltitudeConfidence_Constants { + const uint8_t ALT_000_01 = 0; + const uint8_t ALT_000_02 = 1; + const uint8_t ALT_000_05 = 2; + const uint8_t ALT_000_10 = 3; + const uint8_t ALT_000_20 = 4; + const uint8_t ALT_000_50 = 5; + const uint8_t ALT_001_00 = 6; + const uint8_t ALT_002_00 = 7; + const uint8_t ALT_005_00 = 8; + const uint8_t ALT_010_00 = 9; + const uint8_t ALT_020_00 = 10; + const uint8_t ALT_050_00 = 11; + const uint8_t ALT_100_00 = 12; + const uint8_t ALT_200_00 = 13; + const uint8_t OUT_OF_RANGE = 14; + const uint8_t UNAVAILABLE = 15; + } // namespace AltitudeConfidence_Constants + /*! + * @brief This class represents the structure AltitudeConfidence defined by the user in the IDL file. + * @ingroup ALTITUDECONFIDENCE + */ + class AltitudeConfidence + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AltitudeConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AltitudeConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. + */ + eProsima_user_DllExport AltitudeConfidence( + const AltitudeConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. + */ + eProsima_user_DllExport AltitudeConfidence( + AltitudeConfidence&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. + */ + eProsima_user_DllExport AltitudeConfidence& operator =( + const AltitudeConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. + */ + eProsima_user_DllExport AltitudeConfidence& operator =( + AltitudeConfidence&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AltitudeConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AltitudeConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AltitudeConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AltitudeConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::AltitudeConfidence& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.cxx new file mode 100644 index 00000000000..4759559641f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.cxx @@ -0,0 +1,195 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeConfidencePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "AltitudeConfidencePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace AltitudeConfidence_Constants { + + + + + + + + + + + + + + + + + + } //End of namespace AltitudeConfidence_Constants + AltitudeConfidencePubSubType::AltitudeConfidencePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::AltitudeConfidence_"); + auto type_size = AltitudeConfidence::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = AltitudeConfidence::isKeyDefined(); + size_t keyLength = AltitudeConfidence::getKeyMaxCdrSerializedSize() > 16 ? + AltitudeConfidence::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + AltitudeConfidencePubSubType::~AltitudeConfidencePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool AltitudeConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + AltitudeConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool AltitudeConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + AltitudeConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function AltitudeConfidencePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* AltitudeConfidencePubSubType::createData() + { + return reinterpret_cast(new AltitudeConfidence()); + } + + void AltitudeConfidencePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool AltitudeConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + AltitudeConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + AltitudeConfidence::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || AltitudeConfidence::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.h new file mode 100644 index 00000000000..c1fbf19f3b7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.h @@ -0,0 +1,126 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeConfidencePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_PUBSUBTYPES_H_ + +#include +#include + +#include "AltitudeConfidence.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated AltitudeConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace AltitudeConfidence_Constants + { + + + + + + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type AltitudeConfidence defined by the user in the IDL file. + * @ingroup ALTITUDECONFIDENCE + */ + class AltitudeConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef AltitudeConfidence type; + + eProsima_user_DllExport AltitudeConfidencePubSubType(); + + eProsima_user_DllExport virtual ~AltitudeConfidencePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) AltitudeConfidence(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.cxx new file mode 100644 index 00000000000..a7a18adfcca --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "AltitudePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + AltitudePubSubType::AltitudePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::Altitude_"); + auto type_size = Altitude::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Altitude::isKeyDefined(); + size_t keyLength = Altitude::getKeyMaxCdrSerializedSize() > 16 ? + Altitude::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + AltitudePubSubType::~AltitudePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool AltitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Altitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool AltitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Altitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function AltitudePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* AltitudePubSubType::createData() + { + return reinterpret_cast(new Altitude()); + } + + void AltitudePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool AltitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Altitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Altitude::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Altitude::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.h new file mode 100644 index 00000000000..7389ed241dc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_PUBSUBTYPES_H_ + +#include +#include + +#include "Altitude.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated Altitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type Altitude defined by the user in the IDL file. + * @ingroup ALTITUDE + */ + class AltitudePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Altitude type; + + eProsima_user_DllExport AltitudePubSubType(); + + eProsima_user_DllExport virtual ~AltitudePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Altitude(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.cxx new file mode 100644 index 00000000000..a61347e9cfb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "AltitudeValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::AltitudeValue::AltitudeValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@22bd2039 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::AltitudeValue::~AltitudeValue() +{ +} + +etsi_its_cam_msgs::msg::AltitudeValue::AltitudeValue( + const AltitudeValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::AltitudeValue::AltitudeValue( + AltitudeValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::AltitudeValue::operator =( + const AltitudeValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::AltitudeValue::operator =( + AltitudeValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::AltitudeValue::operator ==( + const AltitudeValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::AltitudeValue::operator !=( + const AltitudeValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::AltitudeValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::AltitudeValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::AltitudeValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::AltitudeValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::AltitudeValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::AltitudeValue::value( + int32_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int32_t etsi_its_cam_msgs::msg::AltitudeValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int32_t& etsi_its_cam_msgs::msg::AltitudeValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::AltitudeValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::AltitudeValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::AltitudeValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.h new file mode 100644 index 00000000000..7e85c6cb2fe --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(AltitudeValue_SOURCE) +#define AltitudeValue_DllAPI __declspec( dllexport ) +#else +#define AltitudeValue_DllAPI __declspec( dllimport ) +#endif // AltitudeValue_SOURCE +#else +#define AltitudeValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define AltitudeValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace AltitudeValue_Constants { + const int32_t MIN = -100000; + const int32_t MAX = 800001; + const int32_t REFERENCE_ELLIPSOID_SURFACE = 0; + const int32_t ONE_CENTIMETER = 1; + const int32_t UNAVAILABLE = 800001; + } // namespace AltitudeValue_Constants + /*! + * @brief This class represents the structure AltitudeValue defined by the user in the IDL file. + * @ingroup ALTITUDEVALUE + */ + class AltitudeValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AltitudeValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AltitudeValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. + */ + eProsima_user_DllExport AltitudeValue( + const AltitudeValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. + */ + eProsima_user_DllExport AltitudeValue( + AltitudeValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. + */ + eProsima_user_DllExport AltitudeValue& operator =( + const AltitudeValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. + */ + eProsima_user_DllExport AltitudeValue& operator =( + AltitudeValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AltitudeValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AltitudeValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AltitudeValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AltitudeValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::AltitudeValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int32_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.cxx new file mode 100644 index 00000000000..2757a77d662 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "AltitudeValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace AltitudeValue_Constants { + + + + + + + } //End of namespace AltitudeValue_Constants + AltitudeValuePubSubType::AltitudeValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::AltitudeValue_"); + auto type_size = AltitudeValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = AltitudeValue::isKeyDefined(); + size_t keyLength = AltitudeValue::getKeyMaxCdrSerializedSize() > 16 ? + AltitudeValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + AltitudeValuePubSubType::~AltitudeValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool AltitudeValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + AltitudeValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool AltitudeValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + AltitudeValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function AltitudeValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* AltitudeValuePubSubType::createData() + { + return reinterpret_cast(new AltitudeValue()); + } + + void AltitudeValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool AltitudeValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + AltitudeValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + AltitudeValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || AltitudeValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.h new file mode 100644 index 00000000000..d347db612ac --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "AltitudeValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated AltitudeValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace AltitudeValue_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type AltitudeValue defined by the user in the IDL file. + * @ingroup ALTITUDEVALUE + */ + class AltitudeValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef AltitudeValue type; + + eProsima_user_DllExport AltitudeValuePubSubType(); + + eProsima_user_DllExport virtual ~AltitudeValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) AltitudeValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.cxx new file mode 100644 index 00000000000..50f3dbfe26d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "BasicContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::BasicContainer::BasicContainer() +{ + // m_station_type com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@432034a + + // m_reference_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@78de58ea + + +} + +etsi_its_cam_msgs::msg::BasicContainer::~BasicContainer() +{ + +} + +etsi_its_cam_msgs::msg::BasicContainer::BasicContainer( + const BasicContainer& x) +{ + m_station_type = x.m_station_type; + m_reference_position = x.m_reference_position; +} + +etsi_its_cam_msgs::msg::BasicContainer::BasicContainer( + BasicContainer&& x) +{ + m_station_type = std::move(x.m_station_type); + m_reference_position = std::move(x.m_reference_position); +} + +etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::BasicContainer::operator =( + const BasicContainer& x) +{ + + m_station_type = x.m_station_type; + m_reference_position = x.m_reference_position; + + return *this; +} + +etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::BasicContainer::operator =( + BasicContainer&& x) +{ + + m_station_type = std::move(x.m_station_type); + m_reference_position = std::move(x.m_reference_position); + + return *this; +} + +bool etsi_its_cam_msgs::msg::BasicContainer::operator ==( + const BasicContainer& x) const +{ + + return (m_station_type == x.m_station_type && m_reference_position == x.m_reference_position); +} + +bool etsi_its_cam_msgs::msg::BasicContainer::operator !=( + const BasicContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::BasicContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::StationType::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::ReferencePosition::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::BasicContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::BasicContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::StationType::getCdrSerializedSize(data.station_type(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::ReferencePosition::getCdrSerializedSize(data.reference_position(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::BasicContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_station_type; + scdr << m_reference_position; + +} + +void etsi_its_cam_msgs::msg::BasicContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_station_type; + dcdr >> m_reference_position; +} + +/*! + * @brief This function copies the value in member station_type + * @param _station_type New value to be copied in member station_type + */ +void etsi_its_cam_msgs::msg::BasicContainer::station_type( + const etsi_its_cam_msgs::msg::StationType& _station_type) +{ + m_station_type = _station_type; +} + +/*! + * @brief This function moves the value in member station_type + * @param _station_type New value to be moved in member station_type + */ +void etsi_its_cam_msgs::msg::BasicContainer::station_type( + etsi_its_cam_msgs::msg::StationType&& _station_type) +{ + m_station_type = std::move(_station_type); +} + +/*! + * @brief This function returns a constant reference to member station_type + * @return Constant reference to member station_type + */ +const etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::BasicContainer::station_type() const +{ + return m_station_type; +} + +/*! + * @brief This function returns a reference to member station_type + * @return Reference to member station_type + */ +etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::BasicContainer::station_type() +{ + return m_station_type; +} +/*! + * @brief This function copies the value in member reference_position + * @param _reference_position New value to be copied in member reference_position + */ +void etsi_its_cam_msgs::msg::BasicContainer::reference_position( + const etsi_its_cam_msgs::msg::ReferencePosition& _reference_position) +{ + m_reference_position = _reference_position; +} + +/*! + * @brief This function moves the value in member reference_position + * @param _reference_position New value to be moved in member reference_position + */ +void etsi_its_cam_msgs::msg::BasicContainer::reference_position( + etsi_its_cam_msgs::msg::ReferencePosition&& _reference_position) +{ + m_reference_position = std::move(_reference_position); +} + +/*! + * @brief This function returns a constant reference to member reference_position + * @return Constant reference to member reference_position + */ +const etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::BasicContainer::reference_position() const +{ + return m_reference_position; +} + +/*! + * @brief This function returns a reference to member reference_position + * @return Reference to member reference_position + */ +etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::BasicContainer::reference_position() +{ + return m_reference_position; +} + +size_t etsi_its_cam_msgs::msg::BasicContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::BasicContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::BasicContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.h new file mode 100644 index 00000000000..632ceafad36 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_H_ + +#include "ReferencePosition.h" +#include "StationType.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(BasicContainer_SOURCE) +#define BasicContainer_DllAPI __declspec( dllexport ) +#else +#define BasicContainer_DllAPI __declspec( dllimport ) +#endif // BasicContainer_SOURCE +#else +#define BasicContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define BasicContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure BasicContainer defined by the user in the IDL file. + * @ingroup BASICCONTAINER + */ + class BasicContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. + */ + eProsima_user_DllExport BasicContainer( + const BasicContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. + */ + eProsima_user_DllExport BasicContainer( + BasicContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. + */ + eProsima_user_DllExport BasicContainer& operator =( + const BasicContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. + */ + eProsima_user_DllExport BasicContainer& operator =( + BasicContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicContainer& x) const; + + /*! + * @brief This function copies the value in member station_type + * @param _station_type New value to be copied in member station_type + */ + eProsima_user_DllExport void station_type( + const etsi_its_cam_msgs::msg::StationType& _station_type); + + /*! + * @brief This function moves the value in member station_type + * @param _station_type New value to be moved in member station_type + */ + eProsima_user_DllExport void station_type( + etsi_its_cam_msgs::msg::StationType&& _station_type); + + /*! + * @brief This function returns a constant reference to member station_type + * @return Constant reference to member station_type + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::StationType& station_type() const; + + /*! + * @brief This function returns a reference to member station_type + * @return Reference to member station_type + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::StationType& station_type(); + /*! + * @brief This function copies the value in member reference_position + * @param _reference_position New value to be copied in member reference_position + */ + eProsima_user_DllExport void reference_position( + const etsi_its_cam_msgs::msg::ReferencePosition& _reference_position); + + /*! + * @brief This function moves the value in member reference_position + * @param _reference_position New value to be moved in member reference_position + */ + eProsima_user_DllExport void reference_position( + etsi_its_cam_msgs::msg::ReferencePosition&& _reference_position); + + /*! + * @brief This function returns a constant reference to member reference_position + * @return Constant reference to member reference_position + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ReferencePosition& reference_position() const; + + /*! + * @brief This function returns a reference to member reference_position + * @return Reference to member reference_position + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ReferencePosition& reference_position(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::BasicContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::StationType m_station_type; + etsi_its_cam_msgs::msg::ReferencePosition m_reference_position; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.cxx new file mode 100644 index 00000000000..16e86f50ad3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "BasicContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + BasicContainerPubSubType::BasicContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::BasicContainer_"); + auto type_size = BasicContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = BasicContainer::isKeyDefined(); + size_t keyLength = BasicContainer::getKeyMaxCdrSerializedSize() > 16 ? + BasicContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + BasicContainerPubSubType::~BasicContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool BasicContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + BasicContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool BasicContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + BasicContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function BasicContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* BasicContainerPubSubType::createData() + { + return reinterpret_cast(new BasicContainer()); + } + + void BasicContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool BasicContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + BasicContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + BasicContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || BasicContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.h new file mode 100644 index 00000000000..22c59616956 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "BasicContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated BasicContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type BasicContainer defined by the user in the IDL file. + * @ingroup BASICCONTAINER + */ + class BasicContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef BasicContainer type; + + eProsima_user_DllExport BasicContainerPubSubType(); + + eProsima_user_DllExport virtual ~BasicContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) BasicContainer(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.cxx new file mode 100644 index 00000000000..c954bbbbf21 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.cxx @@ -0,0 +1,1211 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerHighFrequency.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "BasicVehicleContainerHighFrequency.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency() +{ + // m_heading com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5aa6202e + + // m_speed com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3af9aa66 + + // m_drive_direction com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@771158fb + + // m_vehicle_length com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@91c4a3f + + // m_vehicle_width com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@62d0ac62 + + // m_longitudinal_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@150d80c4 + + // m_curvature com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6826c41e + + // m_curvature_calculation_mode com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3003697 + + // m_yaw_rate com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@64d43929 + + // m_acceleration_control com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1d269ed7 + + // m_acceleration_control_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@437ebf59 + m_acceleration_control_is_present = false; + // m_lane_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@41c89d2f + + // m_lane_position_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@410e94e + m_lane_position_is_present = false; + // m_steering_wheel_angle com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2d691f3d + + // m_steering_wheel_angle_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1bdbf9be + m_steering_wheel_angle_is_present = false; + // m_lateral_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1e7f2e0f + + // m_lateral_acceleration_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1da6ee17 + m_lateral_acceleration_is_present = false; + // m_vertical_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@78d39a69 + + // m_vertical_acceleration_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3c818ac4 + m_vertical_acceleration_is_present = false; + // m_performance_class com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5b69d40d + + // m_performance_class_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71154f21 + m_performance_class_is_present = false; + // m_cen_dsrc_tolling_zone com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@15f193b8 + + // m_cen_dsrc_tolling_zone_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2516fc68 + m_cen_dsrc_tolling_zone_is_present = false; + +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::~BasicVehicleContainerHighFrequency() +{ + + + + + + + + + + + + + + + + + + + + + + +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency( + const BasicVehicleContainerHighFrequency& x) +{ + m_heading = x.m_heading; + m_speed = x.m_speed; + m_drive_direction = x.m_drive_direction; + m_vehicle_length = x.m_vehicle_length; + m_vehicle_width = x.m_vehicle_width; + m_longitudinal_acceleration = x.m_longitudinal_acceleration; + m_curvature = x.m_curvature; + m_curvature_calculation_mode = x.m_curvature_calculation_mode; + m_yaw_rate = x.m_yaw_rate; + m_acceleration_control = x.m_acceleration_control; + m_acceleration_control_is_present = x.m_acceleration_control_is_present; + m_lane_position = x.m_lane_position; + m_lane_position_is_present = x.m_lane_position_is_present; + m_steering_wheel_angle = x.m_steering_wheel_angle; + m_steering_wheel_angle_is_present = x.m_steering_wheel_angle_is_present; + m_lateral_acceleration = x.m_lateral_acceleration; + m_lateral_acceleration_is_present = x.m_lateral_acceleration_is_present; + m_vertical_acceleration = x.m_vertical_acceleration; + m_vertical_acceleration_is_present = x.m_vertical_acceleration_is_present; + m_performance_class = x.m_performance_class; + m_performance_class_is_present = x.m_performance_class_is_present; + m_cen_dsrc_tolling_zone = x.m_cen_dsrc_tolling_zone; + m_cen_dsrc_tolling_zone_is_present = x.m_cen_dsrc_tolling_zone_is_present; +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency( + BasicVehicleContainerHighFrequency&& x) +{ + m_heading = std::move(x.m_heading); + m_speed = std::move(x.m_speed); + m_drive_direction = std::move(x.m_drive_direction); + m_vehicle_length = std::move(x.m_vehicle_length); + m_vehicle_width = std::move(x.m_vehicle_width); + m_longitudinal_acceleration = std::move(x.m_longitudinal_acceleration); + m_curvature = std::move(x.m_curvature); + m_curvature_calculation_mode = std::move(x.m_curvature_calculation_mode); + m_yaw_rate = std::move(x.m_yaw_rate); + m_acceleration_control = std::move(x.m_acceleration_control); + m_acceleration_control_is_present = x.m_acceleration_control_is_present; + m_lane_position = std::move(x.m_lane_position); + m_lane_position_is_present = x.m_lane_position_is_present; + m_steering_wheel_angle = std::move(x.m_steering_wheel_angle); + m_steering_wheel_angle_is_present = x.m_steering_wheel_angle_is_present; + m_lateral_acceleration = std::move(x.m_lateral_acceleration); + m_lateral_acceleration_is_present = x.m_lateral_acceleration_is_present; + m_vertical_acceleration = std::move(x.m_vertical_acceleration); + m_vertical_acceleration_is_present = x.m_vertical_acceleration_is_present; + m_performance_class = std::move(x.m_performance_class); + m_performance_class_is_present = x.m_performance_class_is_present; + m_cen_dsrc_tolling_zone = std::move(x.m_cen_dsrc_tolling_zone); + m_cen_dsrc_tolling_zone_is_present = x.m_cen_dsrc_tolling_zone_is_present; +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::operator =( + const BasicVehicleContainerHighFrequency& x) +{ + + m_heading = x.m_heading; + m_speed = x.m_speed; + m_drive_direction = x.m_drive_direction; + m_vehicle_length = x.m_vehicle_length; + m_vehicle_width = x.m_vehicle_width; + m_longitudinal_acceleration = x.m_longitudinal_acceleration; + m_curvature = x.m_curvature; + m_curvature_calculation_mode = x.m_curvature_calculation_mode; + m_yaw_rate = x.m_yaw_rate; + m_acceleration_control = x.m_acceleration_control; + m_acceleration_control_is_present = x.m_acceleration_control_is_present; + m_lane_position = x.m_lane_position; + m_lane_position_is_present = x.m_lane_position_is_present; + m_steering_wheel_angle = x.m_steering_wheel_angle; + m_steering_wheel_angle_is_present = x.m_steering_wheel_angle_is_present; + m_lateral_acceleration = x.m_lateral_acceleration; + m_lateral_acceleration_is_present = x.m_lateral_acceleration_is_present; + m_vertical_acceleration = x.m_vertical_acceleration; + m_vertical_acceleration_is_present = x.m_vertical_acceleration_is_present; + m_performance_class = x.m_performance_class; + m_performance_class_is_present = x.m_performance_class_is_present; + m_cen_dsrc_tolling_zone = x.m_cen_dsrc_tolling_zone; + m_cen_dsrc_tolling_zone_is_present = x.m_cen_dsrc_tolling_zone_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::operator =( + BasicVehicleContainerHighFrequency&& x) +{ + + m_heading = std::move(x.m_heading); + m_speed = std::move(x.m_speed); + m_drive_direction = std::move(x.m_drive_direction); + m_vehicle_length = std::move(x.m_vehicle_length); + m_vehicle_width = std::move(x.m_vehicle_width); + m_longitudinal_acceleration = std::move(x.m_longitudinal_acceleration); + m_curvature = std::move(x.m_curvature); + m_curvature_calculation_mode = std::move(x.m_curvature_calculation_mode); + m_yaw_rate = std::move(x.m_yaw_rate); + m_acceleration_control = std::move(x.m_acceleration_control); + m_acceleration_control_is_present = x.m_acceleration_control_is_present; + m_lane_position = std::move(x.m_lane_position); + m_lane_position_is_present = x.m_lane_position_is_present; + m_steering_wheel_angle = std::move(x.m_steering_wheel_angle); + m_steering_wheel_angle_is_present = x.m_steering_wheel_angle_is_present; + m_lateral_acceleration = std::move(x.m_lateral_acceleration); + m_lateral_acceleration_is_present = x.m_lateral_acceleration_is_present; + m_vertical_acceleration = std::move(x.m_vertical_acceleration); + m_vertical_acceleration_is_present = x.m_vertical_acceleration_is_present; + m_performance_class = std::move(x.m_performance_class); + m_performance_class_is_present = x.m_performance_class_is_present; + m_cen_dsrc_tolling_zone = std::move(x.m_cen_dsrc_tolling_zone); + m_cen_dsrc_tolling_zone_is_present = x.m_cen_dsrc_tolling_zone_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::operator ==( + const BasicVehicleContainerHighFrequency& x) const +{ + + return (m_heading == x.m_heading && m_speed == x.m_speed && m_drive_direction == x.m_drive_direction && m_vehicle_length == x.m_vehicle_length && m_vehicle_width == x.m_vehicle_width && m_longitudinal_acceleration == x.m_longitudinal_acceleration && m_curvature == x.m_curvature && m_curvature_calculation_mode == x.m_curvature_calculation_mode && m_yaw_rate == x.m_yaw_rate && m_acceleration_control == x.m_acceleration_control && m_acceleration_control_is_present == x.m_acceleration_control_is_present && m_lane_position == x.m_lane_position && m_lane_position_is_present == x.m_lane_position_is_present && m_steering_wheel_angle == x.m_steering_wheel_angle && m_steering_wheel_angle_is_present == x.m_steering_wheel_angle_is_present && m_lateral_acceleration == x.m_lateral_acceleration && m_lateral_acceleration_is_present == x.m_lateral_acceleration_is_present && m_vertical_acceleration == x.m_vertical_acceleration && m_vertical_acceleration_is_present == x.m_vertical_acceleration_is_present && m_performance_class == x.m_performance_class && m_performance_class_is_present == x.m_performance_class_is_present && m_cen_dsrc_tolling_zone == x.m_cen_dsrc_tolling_zone && m_cen_dsrc_tolling_zone_is_present == x.m_cen_dsrc_tolling_zone_is_present); +} + +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::operator !=( + const BasicVehicleContainerHighFrequency& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::Heading::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Speed::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::DriveDirection::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::VehicleLength::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::VehicleWidth::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::LongitudinalAcceleration::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Curvature::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CurvatureCalculationMode::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::YawRate::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AccelerationControl::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::LanePosition::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngle::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::LateralAcceleration::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::VerticalAcceleration::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::PerformanceClass::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::CenDsrcTollingZone::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::Heading::getCdrSerializedSize(data.heading(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Speed::getCdrSerializedSize(data.speed(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::DriveDirection::getCdrSerializedSize(data.drive_direction(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::VehicleLength::getCdrSerializedSize(data.vehicle_length(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::VehicleWidth::getCdrSerializedSize(data.vehicle_width(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::LongitudinalAcceleration::getCdrSerializedSize(data.longitudinal_acceleration(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Curvature::getCdrSerializedSize(data.curvature(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CurvatureCalculationMode::getCdrSerializedSize(data.curvature_calculation_mode(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::YawRate::getCdrSerializedSize(data.yaw_rate(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AccelerationControl::getCdrSerializedSize(data.acceleration_control(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::LanePosition::getCdrSerializedSize(data.lane_position(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngle::getCdrSerializedSize(data.steering_wheel_angle(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::LateralAcceleration::getCdrSerializedSize(data.lateral_acceleration(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::VerticalAcceleration::getCdrSerializedSize(data.vertical_acceleration(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::PerformanceClass::getCdrSerializedSize(data.performance_class(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::CenDsrcTollingZone::getCdrSerializedSize(data.cen_dsrc_tolling_zone(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_heading; + scdr << m_speed; + scdr << m_drive_direction; + scdr << m_vehicle_length; + scdr << m_vehicle_width; + scdr << m_longitudinal_acceleration; + scdr << m_curvature; + scdr << m_curvature_calculation_mode; + scdr << m_yaw_rate; + scdr << m_acceleration_control; + scdr << m_acceleration_control_is_present; + scdr << m_lane_position; + scdr << m_lane_position_is_present; + scdr << m_steering_wheel_angle; + scdr << m_steering_wheel_angle_is_present; + scdr << m_lateral_acceleration; + scdr << m_lateral_acceleration_is_present; + scdr << m_vertical_acceleration; + scdr << m_vertical_acceleration_is_present; + scdr << m_performance_class; + scdr << m_performance_class_is_present; + scdr << m_cen_dsrc_tolling_zone; + scdr << m_cen_dsrc_tolling_zone_is_present; + +} + +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_heading; + dcdr >> m_speed; + dcdr >> m_drive_direction; + dcdr >> m_vehicle_length; + dcdr >> m_vehicle_width; + dcdr >> m_longitudinal_acceleration; + dcdr >> m_curvature; + dcdr >> m_curvature_calculation_mode; + dcdr >> m_yaw_rate; + dcdr >> m_acceleration_control; + dcdr >> m_acceleration_control_is_present; + dcdr >> m_lane_position; + dcdr >> m_lane_position_is_present; + dcdr >> m_steering_wheel_angle; + dcdr >> m_steering_wheel_angle_is_present; + dcdr >> m_lateral_acceleration; + dcdr >> m_lateral_acceleration_is_present; + dcdr >> m_vertical_acceleration; + dcdr >> m_vertical_acceleration_is_present; + dcdr >> m_performance_class; + dcdr >> m_performance_class_is_present; + dcdr >> m_cen_dsrc_tolling_zone; + dcdr >> m_cen_dsrc_tolling_zone_is_present; +} + +/*! + * @brief This function copies the value in member heading_ + * @param _heading New value to be copied in member heading_ + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::heading( + const etsi_its_cam_msgs::msg::Heading& _heading) +{ + m_heading = _heading; +} + +/*! + * @brief This function moves the value in member heading_ + * @param _heading New value to be moved in member heading_ + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::heading( + etsi_its_cam_msgs::msg::Heading&& _heading) +{ + m_heading = std::move(_heading); +} + +/*! + * @brief This function returns a constant reference to member heading_ + * @return Constant reference to member heading_ + */ +const etsi_its_cam_msgs::msg::Heading& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::heading() const +{ + return m_heading; +} + +/*! + * @brief This function returns a reference to member heading_ + * @return Reference to member heading_ + */ +etsi_its_cam_msgs::msg::Heading& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::heading() +{ + return m_heading; +} +/*! + * @brief This function copies the value in member speed_ + * @param _speed New value to be copied in member speed_ + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::speed( + const etsi_its_cam_msgs::msg::Speed& _speed) +{ + m_speed = _speed; +} + +/*! + * @brief This function moves the value in member speed_ + * @param _speed New value to be moved in member speed_ + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::speed( + etsi_its_cam_msgs::msg::Speed&& _speed) +{ + m_speed = std::move(_speed); +} + +/*! + * @brief This function returns a constant reference to member speed_ + * @return Constant reference to member speed_ + */ +const etsi_its_cam_msgs::msg::Speed& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::speed() const +{ + return m_speed; +} + +/*! + * @brief This function returns a reference to member speed_ + * @return Reference to member speed_ + */ +etsi_its_cam_msgs::msg::Speed& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::speed() +{ + return m_speed; +} +/*! + * @brief This function copies the value in member drive_direction + * @param _drive_direction New value to be copied in member drive_direction + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction( + const etsi_its_cam_msgs::msg::DriveDirection& _drive_direction) +{ + m_drive_direction = _drive_direction; +} + +/*! + * @brief This function moves the value in member drive_direction + * @param _drive_direction New value to be moved in member drive_direction + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction( + etsi_its_cam_msgs::msg::DriveDirection&& _drive_direction) +{ + m_drive_direction = std::move(_drive_direction); +} + +/*! + * @brief This function returns a constant reference to member drive_direction + * @return Constant reference to member drive_direction + */ +const etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction() const +{ + return m_drive_direction; +} + +/*! + * @brief This function returns a reference to member drive_direction + * @return Reference to member drive_direction + */ +etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction() +{ + return m_drive_direction; +} +/*! + * @brief This function copies the value in member vehicle_length + * @param _vehicle_length New value to be copied in member vehicle_length + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length( + const etsi_its_cam_msgs::msg::VehicleLength& _vehicle_length) +{ + m_vehicle_length = _vehicle_length; +} + +/*! + * @brief This function moves the value in member vehicle_length + * @param _vehicle_length New value to be moved in member vehicle_length + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length( + etsi_its_cam_msgs::msg::VehicleLength&& _vehicle_length) +{ + m_vehicle_length = std::move(_vehicle_length); +} + +/*! + * @brief This function returns a constant reference to member vehicle_length + * @return Constant reference to member vehicle_length + */ +const etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length() const +{ + return m_vehicle_length; +} + +/*! + * @brief This function returns a reference to member vehicle_length + * @return Reference to member vehicle_length + */ +etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length() +{ + return m_vehicle_length; +} +/*! + * @brief This function copies the value in member vehicle_width + * @param _vehicle_width New value to be copied in member vehicle_width + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width( + const etsi_its_cam_msgs::msg::VehicleWidth& _vehicle_width) +{ + m_vehicle_width = _vehicle_width; +} + +/*! + * @brief This function moves the value in member vehicle_width + * @param _vehicle_width New value to be moved in member vehicle_width + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width( + etsi_its_cam_msgs::msg::VehicleWidth&& _vehicle_width) +{ + m_vehicle_width = std::move(_vehicle_width); +} + +/*! + * @brief This function returns a constant reference to member vehicle_width + * @return Constant reference to member vehicle_width + */ +const etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width() const +{ + return m_vehicle_width; +} + +/*! + * @brief This function returns a reference to member vehicle_width + * @return Reference to member vehicle_width + */ +etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width() +{ + return m_vehicle_width; +} +/*! + * @brief This function copies the value in member longitudinal_acceleration + * @param _longitudinal_acceleration New value to be copied in member longitudinal_acceleration + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_acceleration( + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& _longitudinal_acceleration) +{ + m_longitudinal_acceleration = _longitudinal_acceleration; +} + +/*! + * @brief This function moves the value in member longitudinal_acceleration + * @param _longitudinal_acceleration New value to be moved in member longitudinal_acceleration + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_acceleration( + etsi_its_cam_msgs::msg::LongitudinalAcceleration&& _longitudinal_acceleration) +{ + m_longitudinal_acceleration = std::move(_longitudinal_acceleration); +} + +/*! + * @brief This function returns a constant reference to member longitudinal_acceleration + * @return Constant reference to member longitudinal_acceleration + */ +const etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_acceleration() const +{ + return m_longitudinal_acceleration; +} + +/*! + * @brief This function returns a reference to member longitudinal_acceleration + * @return Reference to member longitudinal_acceleration + */ +etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_acceleration() +{ + return m_longitudinal_acceleration; +} +/*! + * @brief This function copies the value in member curvature_ + * @param _curvature New value to be copied in member curvature_ + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature( + const etsi_its_cam_msgs::msg::Curvature& _curvature) +{ + m_curvature = _curvature; +} + +/*! + * @brief This function moves the value in member curvature_ + * @param _curvature New value to be moved in member curvature_ + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature( + etsi_its_cam_msgs::msg::Curvature&& _curvature) +{ + m_curvature = std::move(_curvature); +} + +/*! + * @brief This function returns a constant reference to member curvature_ + * @return Constant reference to member curvature_ + */ +const etsi_its_cam_msgs::msg::Curvature& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature() const +{ + return m_curvature; +} + +/*! + * @brief This function returns a reference to member curvature_ + * @return Reference to member curvature_ + */ +etsi_its_cam_msgs::msg::Curvature& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature() +{ + return m_curvature; +} +/*! + * @brief This function copies the value in member curvature_calculation_mode + * @param _curvature_calculation_mode New value to be copied in member curvature_calculation_mode + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calculation_mode( + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& _curvature_calculation_mode) +{ + m_curvature_calculation_mode = _curvature_calculation_mode; +} + +/*! + * @brief This function moves the value in member curvature_calculation_mode + * @param _curvature_calculation_mode New value to be moved in member curvature_calculation_mode + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calculation_mode( + etsi_its_cam_msgs::msg::CurvatureCalculationMode&& _curvature_calculation_mode) +{ + m_curvature_calculation_mode = std::move(_curvature_calculation_mode); +} + +/*! + * @brief This function returns a constant reference to member curvature_calculation_mode + * @return Constant reference to member curvature_calculation_mode + */ +const etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calculation_mode() const +{ + return m_curvature_calculation_mode; +} + +/*! + * @brief This function returns a reference to member curvature_calculation_mode + * @return Reference to member curvature_calculation_mode + */ +etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calculation_mode() +{ + return m_curvature_calculation_mode; +} +/*! + * @brief This function copies the value in member yaw_rate + * @param _yaw_rate New value to be copied in member yaw_rate + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate( + const etsi_its_cam_msgs::msg::YawRate& _yaw_rate) +{ + m_yaw_rate = _yaw_rate; +} + +/*! + * @brief This function moves the value in member yaw_rate + * @param _yaw_rate New value to be moved in member yaw_rate + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate( + etsi_its_cam_msgs::msg::YawRate&& _yaw_rate) +{ + m_yaw_rate = std::move(_yaw_rate); +} + +/*! + * @brief This function returns a constant reference to member yaw_rate + * @return Constant reference to member yaw_rate + */ +const etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate() const +{ + return m_yaw_rate; +} + +/*! + * @brief This function returns a reference to member yaw_rate + * @return Reference to member yaw_rate + */ +etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate() +{ + return m_yaw_rate; +} +/*! + * @brief This function copies the value in member acceleration_control + * @param _acceleration_control New value to be copied in member acceleration_control + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control( + const etsi_its_cam_msgs::msg::AccelerationControl& _acceleration_control) +{ + m_acceleration_control = _acceleration_control; +} + +/*! + * @brief This function moves the value in member acceleration_control + * @param _acceleration_control New value to be moved in member acceleration_control + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control( + etsi_its_cam_msgs::msg::AccelerationControl&& _acceleration_control) +{ + m_acceleration_control = std::move(_acceleration_control); +} + +/*! + * @brief This function returns a constant reference to member acceleration_control + * @return Constant reference to member acceleration_control + */ +const etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control() const +{ + return m_acceleration_control; +} + +/*! + * @brief This function returns a reference to member acceleration_control + * @return Reference to member acceleration_control + */ +etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control() +{ + return m_acceleration_control; +} +/*! + * @brief This function sets a value in member acceleration_control_is_present + * @param _acceleration_control_is_present New value for member acceleration_control_is_present + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control_is_present( + bool _acceleration_control_is_present) +{ + m_acceleration_control_is_present = _acceleration_control_is_present; +} + +/*! + * @brief This function returns the value of member acceleration_control_is_present + * @return Value of member acceleration_control_is_present + */ +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control_is_present() const +{ + return m_acceleration_control_is_present; +} + +/*! + * @brief This function returns a reference to member acceleration_control_is_present + * @return Reference to member acceleration_control_is_present + */ +bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control_is_present() +{ + return m_acceleration_control_is_present; +} + +/*! + * @brief This function copies the value in member lane_position + * @param _lane_position New value to be copied in member lane_position + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position( + const etsi_its_cam_msgs::msg::LanePosition& _lane_position) +{ + m_lane_position = _lane_position; +} + +/*! + * @brief This function moves the value in member lane_position + * @param _lane_position New value to be moved in member lane_position + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position( + etsi_its_cam_msgs::msg::LanePosition&& _lane_position) +{ + m_lane_position = std::move(_lane_position); +} + +/*! + * @brief This function returns a constant reference to member lane_position + * @return Constant reference to member lane_position + */ +const etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position() const +{ + return m_lane_position; +} + +/*! + * @brief This function returns a reference to member lane_position + * @return Reference to member lane_position + */ +etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position() +{ + return m_lane_position; +} +/*! + * @brief This function sets a value in member lane_position_is_present + * @param _lane_position_is_present New value for member lane_position_is_present + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position_is_present( + bool _lane_position_is_present) +{ + m_lane_position_is_present = _lane_position_is_present; +} + +/*! + * @brief This function returns the value of member lane_position_is_present + * @return Value of member lane_position_is_present + */ +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position_is_present() const +{ + return m_lane_position_is_present; +} + +/*! + * @brief This function returns a reference to member lane_position_is_present + * @return Reference to member lane_position_is_present + */ +bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position_is_present() +{ + return m_lane_position_is_present; +} + +/*! + * @brief This function copies the value in member steering_wheel_angle + * @param _steering_wheel_angle New value to be copied in member steering_wheel_angle + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle( + const etsi_its_cam_msgs::msg::SteeringWheelAngle& _steering_wheel_angle) +{ + m_steering_wheel_angle = _steering_wheel_angle; +} + +/*! + * @brief This function moves the value in member steering_wheel_angle + * @param _steering_wheel_angle New value to be moved in member steering_wheel_angle + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle( + etsi_its_cam_msgs::msg::SteeringWheelAngle&& _steering_wheel_angle) +{ + m_steering_wheel_angle = std::move(_steering_wheel_angle); +} + +/*! + * @brief This function returns a constant reference to member steering_wheel_angle + * @return Constant reference to member steering_wheel_angle + */ +const etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle() const +{ + return m_steering_wheel_angle; +} + +/*! + * @brief This function returns a reference to member steering_wheel_angle + * @return Reference to member steering_wheel_angle + */ +etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle() +{ + return m_steering_wheel_angle; +} +/*! + * @brief This function sets a value in member steering_wheel_angle_is_present + * @param _steering_wheel_angle_is_present New value for member steering_wheel_angle_is_present + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present( + bool _steering_wheel_angle_is_present) +{ + m_steering_wheel_angle_is_present = _steering_wheel_angle_is_present; +} + +/*! + * @brief This function returns the value of member steering_wheel_angle_is_present + * @return Value of member steering_wheel_angle_is_present + */ +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present() const +{ + return m_steering_wheel_angle_is_present; +} + +/*! + * @brief This function returns a reference to member steering_wheel_angle_is_present + * @return Reference to member steering_wheel_angle_is_present + */ +bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present() +{ + return m_steering_wheel_angle_is_present; +} + +/*! + * @brief This function copies the value in member lateral_acceleration + * @param _lateral_acceleration New value to be copied in member lateral_acceleration + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration( + const etsi_its_cam_msgs::msg::LateralAcceleration& _lateral_acceleration) +{ + m_lateral_acceleration = _lateral_acceleration; +} + +/*! + * @brief This function moves the value in member lateral_acceleration + * @param _lateral_acceleration New value to be moved in member lateral_acceleration + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration( + etsi_its_cam_msgs::msg::LateralAcceleration&& _lateral_acceleration) +{ + m_lateral_acceleration = std::move(_lateral_acceleration); +} + +/*! + * @brief This function returns a constant reference to member lateral_acceleration + * @return Constant reference to member lateral_acceleration + */ +const etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration() const +{ + return m_lateral_acceleration; +} + +/*! + * @brief This function returns a reference to member lateral_acceleration + * @return Reference to member lateral_acceleration + */ +etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration() +{ + return m_lateral_acceleration; +} +/*! + * @brief This function sets a value in member lateral_acceleration_is_present + * @param _lateral_acceleration_is_present New value for member lateral_acceleration_is_present + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration_is_present( + bool _lateral_acceleration_is_present) +{ + m_lateral_acceleration_is_present = _lateral_acceleration_is_present; +} + +/*! + * @brief This function returns the value of member lateral_acceleration_is_present + * @return Value of member lateral_acceleration_is_present + */ +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration_is_present() const +{ + return m_lateral_acceleration_is_present; +} + +/*! + * @brief This function returns a reference to member lateral_acceleration_is_present + * @return Reference to member lateral_acceleration_is_present + */ +bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration_is_present() +{ + return m_lateral_acceleration_is_present; +} + +/*! + * @brief This function copies the value in member vertical_acceleration + * @param _vertical_acceleration New value to be copied in member vertical_acceleration + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration( + const etsi_its_cam_msgs::msg::VerticalAcceleration& _vertical_acceleration) +{ + m_vertical_acceleration = _vertical_acceleration; +} + +/*! + * @brief This function moves the value in member vertical_acceleration + * @param _vertical_acceleration New value to be moved in member vertical_acceleration + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration( + etsi_its_cam_msgs::msg::VerticalAcceleration&& _vertical_acceleration) +{ + m_vertical_acceleration = std::move(_vertical_acceleration); +} + +/*! + * @brief This function returns a constant reference to member vertical_acceleration + * @return Constant reference to member vertical_acceleration + */ +const etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration() const +{ + return m_vertical_acceleration; +} + +/*! + * @brief This function returns a reference to member vertical_acceleration + * @return Reference to member vertical_acceleration + */ +etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration() +{ + return m_vertical_acceleration; +} +/*! + * @brief This function sets a value in member vertical_acceleration_is_present + * @param _vertical_acceleration_is_present New value for member vertical_acceleration_is_present + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration_is_present( + bool _vertical_acceleration_is_present) +{ + m_vertical_acceleration_is_present = _vertical_acceleration_is_present; +} + +/*! + * @brief This function returns the value of member vertical_acceleration_is_present + * @return Value of member vertical_acceleration_is_present + */ +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration_is_present() const +{ + return m_vertical_acceleration_is_present; +} + +/*! + * @brief This function returns a reference to member vertical_acceleration_is_present + * @return Reference to member vertical_acceleration_is_present + */ +bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration_is_present() +{ + return m_vertical_acceleration_is_present; +} + +/*! + * @brief This function copies the value in member performance_class + * @param _performance_class New value to be copied in member performance_class + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class( + const etsi_its_cam_msgs::msg::PerformanceClass& _performance_class) +{ + m_performance_class = _performance_class; +} + +/*! + * @brief This function moves the value in member performance_class + * @param _performance_class New value to be moved in member performance_class + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class( + etsi_its_cam_msgs::msg::PerformanceClass&& _performance_class) +{ + m_performance_class = std::move(_performance_class); +} + +/*! + * @brief This function returns a constant reference to member performance_class + * @return Constant reference to member performance_class + */ +const etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class() const +{ + return m_performance_class; +} + +/*! + * @brief This function returns a reference to member performance_class + * @return Reference to member performance_class + */ +etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class() +{ + return m_performance_class; +} +/*! + * @brief This function sets a value in member performance_class_is_present + * @param _performance_class_is_present New value for member performance_class_is_present + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class_is_present( + bool _performance_class_is_present) +{ + m_performance_class_is_present = _performance_class_is_present; +} + +/*! + * @brief This function returns the value of member performance_class_is_present + * @return Value of member performance_class_is_present + */ +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class_is_present() const +{ + return m_performance_class_is_present; +} + +/*! + * @brief This function returns a reference to member performance_class_is_present + * @return Reference to member performance_class_is_present + */ +bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class_is_present() +{ + return m_performance_class_is_present; +} + +/*! + * @brief This function copies the value in member cen_dsrc_tolling_zone + * @param _cen_dsrc_tolling_zone New value to be copied in member cen_dsrc_tolling_zone + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone( + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& _cen_dsrc_tolling_zone) +{ + m_cen_dsrc_tolling_zone = _cen_dsrc_tolling_zone; +} + +/*! + * @brief This function moves the value in member cen_dsrc_tolling_zone + * @param _cen_dsrc_tolling_zone New value to be moved in member cen_dsrc_tolling_zone + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone( + etsi_its_cam_msgs::msg::CenDsrcTollingZone&& _cen_dsrc_tolling_zone) +{ + m_cen_dsrc_tolling_zone = std::move(_cen_dsrc_tolling_zone); +} + +/*! + * @brief This function returns a constant reference to member cen_dsrc_tolling_zone + * @return Constant reference to member cen_dsrc_tolling_zone + */ +const etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone() const +{ + return m_cen_dsrc_tolling_zone; +} + +/*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone + * @return Reference to member cen_dsrc_tolling_zone + */ +etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone() +{ + return m_cen_dsrc_tolling_zone; +} +/*! + * @brief This function sets a value in member cen_dsrc_tolling_zone_is_present + * @param _cen_dsrc_tolling_zone_is_present New value for member cen_dsrc_tolling_zone_is_present + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present( + bool _cen_dsrc_tolling_zone_is_present) +{ + m_cen_dsrc_tolling_zone_is_present = _cen_dsrc_tolling_zone_is_present; +} + +/*! + * @brief This function returns the value of member cen_dsrc_tolling_zone_is_present + * @return Value of member cen_dsrc_tolling_zone_is_present + */ +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present() const +{ + return m_cen_dsrc_tolling_zone_is_present; +} + +/*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_is_present + * @return Reference to member cen_dsrc_tolling_zone_is_present + */ +bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present() +{ + return m_cen_dsrc_tolling_zone_is_present; +} + + +size_t etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.h new file mode 100644 index 00000000000..2ebb6a5f341 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.h @@ -0,0 +1,762 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerHighFrequency.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_H_ + +#include "DriveDirection.h" +#include "Speed.h" +#include "Heading.h" +#include "VehicleWidth.h" +#include "CenDsrcTollingZone.h" +#include "YawRate.h" +#include "VehicleLength.h" +#include "CurvatureCalculationMode.h" +#include "LanePosition.h" +#include "LateralAcceleration.h" +#include "VerticalAcceleration.h" +#include "SteeringWheelAngle.h" +#include "LongitudinalAcceleration.h" +#include "Curvature.h" +#include "PerformanceClass.h" +#include "AccelerationControl.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(BasicVehicleContainerHighFrequency_SOURCE) +#define BasicVehicleContainerHighFrequency_DllAPI __declspec( dllexport ) +#else +#define BasicVehicleContainerHighFrequency_DllAPI __declspec( dllimport ) +#endif // BasicVehicleContainerHighFrequency_SOURCE +#else +#define BasicVehicleContainerHighFrequency_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define BasicVehicleContainerHighFrequency_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure BasicVehicleContainerHighFrequency defined by the user in the IDL file. + * @ingroup BASICVEHICLECONTAINERHIGHFREQUENCY + */ + class BasicVehicleContainerHighFrequency + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicVehicleContainerHighFrequency(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency( + const BasicVehicleContainerHighFrequency& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency( + BasicVehicleContainerHighFrequency&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency& operator =( + const BasicVehicleContainerHighFrequency& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency& operator =( + BasicVehicleContainerHighFrequency&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicVehicleContainerHighFrequency& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicVehicleContainerHighFrequency& x) const; + + /*! + * @brief This function copies the value in member heading_ + * @param _heading New value to be copied in member heading_ + */ + eProsima_user_DllExport void heading( + const etsi_its_cam_msgs::msg::Heading& _heading); + + /*! + * @brief This function moves the value in member heading_ + * @param _heading New value to be moved in member heading_ + */ + eProsima_user_DllExport void heading( + etsi_its_cam_msgs::msg::Heading&& _heading); + + /*! + * @brief This function returns a constant reference to member heading_ + * @return Constant reference to member heading_ + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Heading& heading() const; + + /*! + * @brief This function returns a reference to member heading_ + * @return Reference to member heading_ + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Heading& heading(); + /*! + * @brief This function copies the value in member speed_ + * @param _speed New value to be copied in member speed_ + */ + eProsima_user_DllExport void speed( + const etsi_its_cam_msgs::msg::Speed& _speed); + + /*! + * @brief This function moves the value in member speed_ + * @param _speed New value to be moved in member speed_ + */ + eProsima_user_DllExport void speed( + etsi_its_cam_msgs::msg::Speed&& _speed); + + /*! + * @brief This function returns a constant reference to member speed_ + * @return Constant reference to member speed_ + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Speed& speed() const; + + /*! + * @brief This function returns a reference to member speed_ + * @return Reference to member speed_ + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Speed& speed(); + /*! + * @brief This function copies the value in member drive_direction + * @param _drive_direction New value to be copied in member drive_direction + */ + eProsima_user_DllExport void drive_direction( + const etsi_its_cam_msgs::msg::DriveDirection& _drive_direction); + + /*! + * @brief This function moves the value in member drive_direction + * @param _drive_direction New value to be moved in member drive_direction + */ + eProsima_user_DllExport void drive_direction( + etsi_its_cam_msgs::msg::DriveDirection&& _drive_direction); + + /*! + * @brief This function returns a constant reference to member drive_direction + * @return Constant reference to member drive_direction + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DriveDirection& drive_direction() const; + + /*! + * @brief This function returns a reference to member drive_direction + * @return Reference to member drive_direction + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DriveDirection& drive_direction(); + /*! + * @brief This function copies the value in member vehicle_length + * @param _vehicle_length New value to be copied in member vehicle_length + */ + eProsima_user_DllExport void vehicle_length( + const etsi_its_cam_msgs::msg::VehicleLength& _vehicle_length); + + /*! + * @brief This function moves the value in member vehicle_length + * @param _vehicle_length New value to be moved in member vehicle_length + */ + eProsima_user_DllExport void vehicle_length( + etsi_its_cam_msgs::msg::VehicleLength&& _vehicle_length); + + /*! + * @brief This function returns a constant reference to member vehicle_length + * @return Constant reference to member vehicle_length + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLength& vehicle_length() const; + + /*! + * @brief This function returns a reference to member vehicle_length + * @return Reference to member vehicle_length + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLength& vehicle_length(); + /*! + * @brief This function copies the value in member vehicle_width + * @param _vehicle_width New value to be copied in member vehicle_width + */ + eProsima_user_DllExport void vehicle_width( + const etsi_its_cam_msgs::msg::VehicleWidth& _vehicle_width); + + /*! + * @brief This function moves the value in member vehicle_width + * @param _vehicle_width New value to be moved in member vehicle_width + */ + eProsima_user_DllExport void vehicle_width( + etsi_its_cam_msgs::msg::VehicleWidth&& _vehicle_width); + + /*! + * @brief This function returns a constant reference to member vehicle_width + * @return Constant reference to member vehicle_width + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleWidth& vehicle_width() const; + + /*! + * @brief This function returns a reference to member vehicle_width + * @return Reference to member vehicle_width + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleWidth& vehicle_width(); + /*! + * @brief This function copies the value in member longitudinal_acceleration + * @param _longitudinal_acceleration New value to be copied in member longitudinal_acceleration + */ + eProsima_user_DllExport void longitudinal_acceleration( + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& _longitudinal_acceleration); + + /*! + * @brief This function moves the value in member longitudinal_acceleration + * @param _longitudinal_acceleration New value to be moved in member longitudinal_acceleration + */ + eProsima_user_DllExport void longitudinal_acceleration( + etsi_its_cam_msgs::msg::LongitudinalAcceleration&& _longitudinal_acceleration); + + /*! + * @brief This function returns a constant reference to member longitudinal_acceleration + * @return Constant reference to member longitudinal_acceleration + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LongitudinalAcceleration& longitudinal_acceleration() const; + + /*! + * @brief This function returns a reference to member longitudinal_acceleration + * @return Reference to member longitudinal_acceleration + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LongitudinalAcceleration& longitudinal_acceleration(); + /*! + * @brief This function copies the value in member curvature_ + * @param _curvature New value to be copied in member curvature_ + */ + eProsima_user_DllExport void curvature( + const etsi_its_cam_msgs::msg::Curvature& _curvature); + + /*! + * @brief This function moves the value in member curvature_ + * @param _curvature New value to be moved in member curvature_ + */ + eProsima_user_DllExport void curvature( + etsi_its_cam_msgs::msg::Curvature&& _curvature); + + /*! + * @brief This function returns a constant reference to member curvature_ + * @return Constant reference to member curvature_ + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Curvature& curvature() const; + + /*! + * @brief This function returns a reference to member curvature_ + * @return Reference to member curvature_ + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Curvature& curvature(); + /*! + * @brief This function copies the value in member curvature_calculation_mode + * @param _curvature_calculation_mode New value to be copied in member curvature_calculation_mode + */ + eProsima_user_DllExport void curvature_calculation_mode( + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& _curvature_calculation_mode); + + /*! + * @brief This function moves the value in member curvature_calculation_mode + * @param _curvature_calculation_mode New value to be moved in member curvature_calculation_mode + */ + eProsima_user_DllExport void curvature_calculation_mode( + etsi_its_cam_msgs::msg::CurvatureCalculationMode&& _curvature_calculation_mode); + + /*! + * @brief This function returns a constant reference to member curvature_calculation_mode + * @return Constant reference to member curvature_calculation_mode + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureCalculationMode& curvature_calculation_mode() const; + + /*! + * @brief This function returns a reference to member curvature_calculation_mode + * @return Reference to member curvature_calculation_mode + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureCalculationMode& curvature_calculation_mode(); + /*! + * @brief This function copies the value in member yaw_rate + * @param _yaw_rate New value to be copied in member yaw_rate + */ + eProsima_user_DllExport void yaw_rate( + const etsi_its_cam_msgs::msg::YawRate& _yaw_rate); + + /*! + * @brief This function moves the value in member yaw_rate + * @param _yaw_rate New value to be moved in member yaw_rate + */ + eProsima_user_DllExport void yaw_rate( + etsi_its_cam_msgs::msg::YawRate&& _yaw_rate); + + /*! + * @brief This function returns a constant reference to member yaw_rate + * @return Constant reference to member yaw_rate + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRate& yaw_rate() const; + + /*! + * @brief This function returns a reference to member yaw_rate + * @return Reference to member yaw_rate + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRate& yaw_rate(); + /*! + * @brief This function copies the value in member acceleration_control + * @param _acceleration_control New value to be copied in member acceleration_control + */ + eProsima_user_DllExport void acceleration_control( + const etsi_its_cam_msgs::msg::AccelerationControl& _acceleration_control); + + /*! + * @brief This function moves the value in member acceleration_control + * @param _acceleration_control New value to be moved in member acceleration_control + */ + eProsima_user_DllExport void acceleration_control( + etsi_its_cam_msgs::msg::AccelerationControl&& _acceleration_control); + + /*! + * @brief This function returns a constant reference to member acceleration_control + * @return Constant reference to member acceleration_control + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationControl& acceleration_control() const; + + /*! + * @brief This function returns a reference to member acceleration_control + * @return Reference to member acceleration_control + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationControl& acceleration_control(); + /*! + * @brief This function sets a value in member acceleration_control_is_present + * @param _acceleration_control_is_present New value for member acceleration_control_is_present + */ + eProsima_user_DllExport void acceleration_control_is_present( + bool _acceleration_control_is_present); + + /*! + * @brief This function returns the value of member acceleration_control_is_present + * @return Value of member acceleration_control_is_present + */ + eProsima_user_DllExport bool acceleration_control_is_present() const; + + /*! + * @brief This function returns a reference to member acceleration_control_is_present + * @return Reference to member acceleration_control_is_present + */ + eProsima_user_DllExport bool& acceleration_control_is_present(); + + /*! + * @brief This function copies the value in member lane_position + * @param _lane_position New value to be copied in member lane_position + */ + eProsima_user_DllExport void lane_position( + const etsi_its_cam_msgs::msg::LanePosition& _lane_position); + + /*! + * @brief This function moves the value in member lane_position + * @param _lane_position New value to be moved in member lane_position + */ + eProsima_user_DllExport void lane_position( + etsi_its_cam_msgs::msg::LanePosition&& _lane_position); + + /*! + * @brief This function returns a constant reference to member lane_position + * @return Constant reference to member lane_position + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LanePosition& lane_position() const; + + /*! + * @brief This function returns a reference to member lane_position + * @return Reference to member lane_position + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LanePosition& lane_position(); + /*! + * @brief This function sets a value in member lane_position_is_present + * @param _lane_position_is_present New value for member lane_position_is_present + */ + eProsima_user_DllExport void lane_position_is_present( + bool _lane_position_is_present); + + /*! + * @brief This function returns the value of member lane_position_is_present + * @return Value of member lane_position_is_present + */ + eProsima_user_DllExport bool lane_position_is_present() const; + + /*! + * @brief This function returns a reference to member lane_position_is_present + * @return Reference to member lane_position_is_present + */ + eProsima_user_DllExport bool& lane_position_is_present(); + + /*! + * @brief This function copies the value in member steering_wheel_angle + * @param _steering_wheel_angle New value to be copied in member steering_wheel_angle + */ + eProsima_user_DllExport void steering_wheel_angle( + const etsi_its_cam_msgs::msg::SteeringWheelAngle& _steering_wheel_angle); + + /*! + * @brief This function moves the value in member steering_wheel_angle + * @param _steering_wheel_angle New value to be moved in member steering_wheel_angle + */ + eProsima_user_DllExport void steering_wheel_angle( + etsi_its_cam_msgs::msg::SteeringWheelAngle&& _steering_wheel_angle); + + /*! + * @brief This function returns a constant reference to member steering_wheel_angle + * @return Constant reference to member steering_wheel_angle + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngle& steering_wheel_angle() const; + + /*! + * @brief This function returns a reference to member steering_wheel_angle + * @return Reference to member steering_wheel_angle + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngle& steering_wheel_angle(); + /*! + * @brief This function sets a value in member steering_wheel_angle_is_present + * @param _steering_wheel_angle_is_present New value for member steering_wheel_angle_is_present + */ + eProsima_user_DllExport void steering_wheel_angle_is_present( + bool _steering_wheel_angle_is_present); + + /*! + * @brief This function returns the value of member steering_wheel_angle_is_present + * @return Value of member steering_wheel_angle_is_present + */ + eProsima_user_DllExport bool steering_wheel_angle_is_present() const; + + /*! + * @brief This function returns a reference to member steering_wheel_angle_is_present + * @return Reference to member steering_wheel_angle_is_present + */ + eProsima_user_DllExport bool& steering_wheel_angle_is_present(); + + /*! + * @brief This function copies the value in member lateral_acceleration + * @param _lateral_acceleration New value to be copied in member lateral_acceleration + */ + eProsima_user_DllExport void lateral_acceleration( + const etsi_its_cam_msgs::msg::LateralAcceleration& _lateral_acceleration); + + /*! + * @brief This function moves the value in member lateral_acceleration + * @param _lateral_acceleration New value to be moved in member lateral_acceleration + */ + eProsima_user_DllExport void lateral_acceleration( + etsi_its_cam_msgs::msg::LateralAcceleration&& _lateral_acceleration); + + /*! + * @brief This function returns a constant reference to member lateral_acceleration + * @return Constant reference to member lateral_acceleration + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LateralAcceleration& lateral_acceleration() const; + + /*! + * @brief This function returns a reference to member lateral_acceleration + * @return Reference to member lateral_acceleration + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LateralAcceleration& lateral_acceleration(); + /*! + * @brief This function sets a value in member lateral_acceleration_is_present + * @param _lateral_acceleration_is_present New value for member lateral_acceleration_is_present + */ + eProsima_user_DllExport void lateral_acceleration_is_present( + bool _lateral_acceleration_is_present); + + /*! + * @brief This function returns the value of member lateral_acceleration_is_present + * @return Value of member lateral_acceleration_is_present + */ + eProsima_user_DllExport bool lateral_acceleration_is_present() const; + + /*! + * @brief This function returns a reference to member lateral_acceleration_is_present + * @return Reference to member lateral_acceleration_is_present + */ + eProsima_user_DllExport bool& lateral_acceleration_is_present(); + + /*! + * @brief This function copies the value in member vertical_acceleration + * @param _vertical_acceleration New value to be copied in member vertical_acceleration + */ + eProsima_user_DllExport void vertical_acceleration( + const etsi_its_cam_msgs::msg::VerticalAcceleration& _vertical_acceleration); + + /*! + * @brief This function moves the value in member vertical_acceleration + * @param _vertical_acceleration New value to be moved in member vertical_acceleration + */ + eProsima_user_DllExport void vertical_acceleration( + etsi_its_cam_msgs::msg::VerticalAcceleration&& _vertical_acceleration); + + /*! + * @brief This function returns a constant reference to member vertical_acceleration + * @return Constant reference to member vertical_acceleration + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VerticalAcceleration& vertical_acceleration() const; + + /*! + * @brief This function returns a reference to member vertical_acceleration + * @return Reference to member vertical_acceleration + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VerticalAcceleration& vertical_acceleration(); + /*! + * @brief This function sets a value in member vertical_acceleration_is_present + * @param _vertical_acceleration_is_present New value for member vertical_acceleration_is_present + */ + eProsima_user_DllExport void vertical_acceleration_is_present( + bool _vertical_acceleration_is_present); + + /*! + * @brief This function returns the value of member vertical_acceleration_is_present + * @return Value of member vertical_acceleration_is_present + */ + eProsima_user_DllExport bool vertical_acceleration_is_present() const; + + /*! + * @brief This function returns a reference to member vertical_acceleration_is_present + * @return Reference to member vertical_acceleration_is_present + */ + eProsima_user_DllExport bool& vertical_acceleration_is_present(); + + /*! + * @brief This function copies the value in member performance_class + * @param _performance_class New value to be copied in member performance_class + */ + eProsima_user_DllExport void performance_class( + const etsi_its_cam_msgs::msg::PerformanceClass& _performance_class); + + /*! + * @brief This function moves the value in member performance_class + * @param _performance_class New value to be moved in member performance_class + */ + eProsima_user_DllExport void performance_class( + etsi_its_cam_msgs::msg::PerformanceClass&& _performance_class); + + /*! + * @brief This function returns a constant reference to member performance_class + * @return Constant reference to member performance_class + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PerformanceClass& performance_class() const; + + /*! + * @brief This function returns a reference to member performance_class + * @return Reference to member performance_class + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PerformanceClass& performance_class(); + /*! + * @brief This function sets a value in member performance_class_is_present + * @param _performance_class_is_present New value for member performance_class_is_present + */ + eProsima_user_DllExport void performance_class_is_present( + bool _performance_class_is_present); + + /*! + * @brief This function returns the value of member performance_class_is_present + * @return Value of member performance_class_is_present + */ + eProsima_user_DllExport bool performance_class_is_present() const; + + /*! + * @brief This function returns a reference to member performance_class_is_present + * @return Reference to member performance_class_is_present + */ + eProsima_user_DllExport bool& performance_class_is_present(); + + /*! + * @brief This function copies the value in member cen_dsrc_tolling_zone + * @param _cen_dsrc_tolling_zone New value to be copied in member cen_dsrc_tolling_zone + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone( + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& _cen_dsrc_tolling_zone); + + /*! + * @brief This function moves the value in member cen_dsrc_tolling_zone + * @param _cen_dsrc_tolling_zone New value to be moved in member cen_dsrc_tolling_zone + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone( + etsi_its_cam_msgs::msg::CenDsrcTollingZone&& _cen_dsrc_tolling_zone); + + /*! + * @brief This function returns a constant reference to member cen_dsrc_tolling_zone + * @return Constant reference to member cen_dsrc_tolling_zone + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CenDsrcTollingZone& cen_dsrc_tolling_zone() const; + + /*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone + * @return Reference to member cen_dsrc_tolling_zone + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CenDsrcTollingZone& cen_dsrc_tolling_zone(); + /*! + * @brief This function sets a value in member cen_dsrc_tolling_zone_is_present + * @param _cen_dsrc_tolling_zone_is_present New value for member cen_dsrc_tolling_zone_is_present + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone_is_present( + bool _cen_dsrc_tolling_zone_is_present); + + /*! + * @brief This function returns the value of member cen_dsrc_tolling_zone_is_present + * @return Value of member cen_dsrc_tolling_zone_is_present + */ + eProsima_user_DllExport bool cen_dsrc_tolling_zone_is_present() const; + + /*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_is_present + * @return Reference to member cen_dsrc_tolling_zone_is_present + */ + eProsima_user_DllExport bool& cen_dsrc_tolling_zone_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::Heading m_heading; + etsi_its_cam_msgs::msg::Speed m_speed; + etsi_its_cam_msgs::msg::DriveDirection m_drive_direction; + etsi_its_cam_msgs::msg::VehicleLength m_vehicle_length; + etsi_its_cam_msgs::msg::VehicleWidth m_vehicle_width; + etsi_its_cam_msgs::msg::LongitudinalAcceleration m_longitudinal_acceleration; + etsi_its_cam_msgs::msg::Curvature m_curvature; + etsi_its_cam_msgs::msg::CurvatureCalculationMode m_curvature_calculation_mode; + etsi_its_cam_msgs::msg::YawRate m_yaw_rate; + etsi_its_cam_msgs::msg::AccelerationControl m_acceleration_control; + bool m_acceleration_control_is_present; + etsi_its_cam_msgs::msg::LanePosition m_lane_position; + bool m_lane_position_is_present; + etsi_its_cam_msgs::msg::SteeringWheelAngle m_steering_wheel_angle; + bool m_steering_wheel_angle_is_present; + etsi_its_cam_msgs::msg::LateralAcceleration m_lateral_acceleration; + bool m_lateral_acceleration_is_present; + etsi_its_cam_msgs::msg::VerticalAcceleration m_vertical_acceleration; + bool m_vertical_acceleration_is_present; + etsi_its_cam_msgs::msg::PerformanceClass m_performance_class; + bool m_performance_class_is_present; + etsi_its_cam_msgs::msg::CenDsrcTollingZone m_cen_dsrc_tolling_zone; + bool m_cen_dsrc_tolling_zone_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.cxx new file mode 100644 index 00000000000..9a127480329 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerHighFrequencyPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "BasicVehicleContainerHighFrequencyPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + BasicVehicleContainerHighFrequencyPubSubType::BasicVehicleContainerHighFrequencyPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::BasicVehicleContainerHighFrequency_"); + auto type_size = BasicVehicleContainerHighFrequency::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = BasicVehicleContainerHighFrequency::isKeyDefined(); + size_t keyLength = BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize() > 16 ? + BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + BasicVehicleContainerHighFrequencyPubSubType::~BasicVehicleContainerHighFrequencyPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool BasicVehicleContainerHighFrequencyPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + BasicVehicleContainerHighFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool BasicVehicleContainerHighFrequencyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + BasicVehicleContainerHighFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function BasicVehicleContainerHighFrequencyPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* BasicVehicleContainerHighFrequencyPubSubType::createData() + { + return reinterpret_cast(new BasicVehicleContainerHighFrequency()); + } + + void BasicVehicleContainerHighFrequencyPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool BasicVehicleContainerHighFrequencyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + BasicVehicleContainerHighFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.h new file mode 100644 index 00000000000..963ba23024e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerHighFrequencyPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ + +#include +#include + +#include "BasicVehicleContainerHighFrequency.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated BasicVehicleContainerHighFrequency is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type BasicVehicleContainerHighFrequency defined by the user in the IDL file. + * @ingroup BASICVEHICLECONTAINERHIGHFREQUENCY + */ + class BasicVehicleContainerHighFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef BasicVehicleContainerHighFrequency type; + + eProsima_user_DllExport BasicVehicleContainerHighFrequencyPubSubType(); + + eProsima_user_DllExport virtual ~BasicVehicleContainerHighFrequencyPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.cxx new file mode 100644 index 00000000000..6123b6a7f4e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerLowFrequency.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "BasicVehicleContainerLowFrequency.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency() +{ + // m_vehicle_role com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@210386e0 + + // m_exterior_lights com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3d4d3fe7 + + // m_path_history com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@65f87a2c + + +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::~BasicVehicleContainerLowFrequency() +{ + + +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency( + const BasicVehicleContainerLowFrequency& x) +{ + m_vehicle_role = x.m_vehicle_role; + m_exterior_lights = x.m_exterior_lights; + m_path_history = x.m_path_history; +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency( + BasicVehicleContainerLowFrequency&& x) +{ + m_vehicle_role = std::move(x.m_vehicle_role); + m_exterior_lights = std::move(x.m_exterior_lights); + m_path_history = std::move(x.m_path_history); +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::operator =( + const BasicVehicleContainerLowFrequency& x) +{ + + m_vehicle_role = x.m_vehicle_role; + m_exterior_lights = x.m_exterior_lights; + m_path_history = x.m_path_history; + + return *this; +} + +etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::operator =( + BasicVehicleContainerLowFrequency&& x) +{ + + m_vehicle_role = std::move(x.m_vehicle_role); + m_exterior_lights = std::move(x.m_exterior_lights); + m_path_history = std::move(x.m_path_history); + + return *this; +} + +bool etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::operator ==( + const BasicVehicleContainerLowFrequency& x) const +{ + + return (m_vehicle_role == x.m_vehicle_role && m_exterior_lights == x.m_exterior_lights && m_path_history == x.m_path_history); +} + +bool etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::operator !=( + const BasicVehicleContainerLowFrequency& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::VehicleRole::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::ExteriorLights::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PathHistory::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::VehicleRole::getCdrSerializedSize(data.vehicle_role(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::ExteriorLights::getCdrSerializedSize(data.exterior_lights(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PathHistory::getCdrSerializedSize(data.path_history(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_vehicle_role; + scdr << m_exterior_lights; + scdr << m_path_history; + +} + +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_vehicle_role; + dcdr >> m_exterior_lights; + dcdr >> m_path_history; +} + +/*! + * @brief This function copies the value in member vehicle_role + * @param _vehicle_role New value to be copied in member vehicle_role + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role( + const etsi_its_cam_msgs::msg::VehicleRole& _vehicle_role) +{ + m_vehicle_role = _vehicle_role; +} + +/*! + * @brief This function moves the value in member vehicle_role + * @param _vehicle_role New value to be moved in member vehicle_role + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role( + etsi_its_cam_msgs::msg::VehicleRole&& _vehicle_role) +{ + m_vehicle_role = std::move(_vehicle_role); +} + +/*! + * @brief This function returns a constant reference to member vehicle_role + * @return Constant reference to member vehicle_role + */ +const etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role() const +{ + return m_vehicle_role; +} + +/*! + * @brief This function returns a reference to member vehicle_role + * @return Reference to member vehicle_role + */ +etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role() +{ + return m_vehicle_role; +} +/*! + * @brief This function copies the value in member exterior_lights + * @param _exterior_lights New value to be copied in member exterior_lights + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights( + const etsi_its_cam_msgs::msg::ExteriorLights& _exterior_lights) +{ + m_exterior_lights = _exterior_lights; +} + +/*! + * @brief This function moves the value in member exterior_lights + * @param _exterior_lights New value to be moved in member exterior_lights + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights( + etsi_its_cam_msgs::msg::ExteriorLights&& _exterior_lights) +{ + m_exterior_lights = std::move(_exterior_lights); +} + +/*! + * @brief This function returns a constant reference to member exterior_lights + * @return Constant reference to member exterior_lights + */ +const etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights() const +{ + return m_exterior_lights; +} + +/*! + * @brief This function returns a reference to member exterior_lights + * @return Reference to member exterior_lights + */ +etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights() +{ + return m_exterior_lights; +} +/*! + * @brief This function copies the value in member path_history + * @param _path_history New value to be copied in member path_history + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history( + const etsi_its_cam_msgs::msg::PathHistory& _path_history) +{ + m_path_history = _path_history; +} + +/*! + * @brief This function moves the value in member path_history + * @param _path_history New value to be moved in member path_history + */ +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history( + etsi_its_cam_msgs::msg::PathHistory&& _path_history) +{ + m_path_history = std::move(_path_history); +} + +/*! + * @brief This function returns a constant reference to member path_history + * @return Constant reference to member path_history + */ +const etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history() const +{ + return m_path_history; +} + +/*! + * @brief This function returns a reference to member path_history + * @return Reference to member path_history + */ +etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history() +{ + return m_path_history; +} + +size_t etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.h new file mode 100644 index 00000000000..549dac222f6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.h @@ -0,0 +1,271 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerLowFrequency.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_H_ + +#include "VehicleRole.h" +#include "ExteriorLights.h" +#include "PathHistory.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(BasicVehicleContainerLowFrequency_SOURCE) +#define BasicVehicleContainerLowFrequency_DllAPI __declspec( dllexport ) +#else +#define BasicVehicleContainerLowFrequency_DllAPI __declspec( dllimport ) +#endif // BasicVehicleContainerLowFrequency_SOURCE +#else +#define BasicVehicleContainerLowFrequency_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define BasicVehicleContainerLowFrequency_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure BasicVehicleContainerLowFrequency defined by the user in the IDL file. + * @ingroup BASICVEHICLECONTAINERLOWFREQUENCY + */ + class BasicVehicleContainerLowFrequency + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicVehicleContainerLowFrequency(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency( + const BasicVehicleContainerLowFrequency& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency( + BasicVehicleContainerLowFrequency&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency& operator =( + const BasicVehicleContainerLowFrequency& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency& operator =( + BasicVehicleContainerLowFrequency&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicVehicleContainerLowFrequency& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicVehicleContainerLowFrequency& x) const; + + /*! + * @brief This function copies the value in member vehicle_role + * @param _vehicle_role New value to be copied in member vehicle_role + */ + eProsima_user_DllExport void vehicle_role( + const etsi_its_cam_msgs::msg::VehicleRole& _vehicle_role); + + /*! + * @brief This function moves the value in member vehicle_role + * @param _vehicle_role New value to be moved in member vehicle_role + */ + eProsima_user_DllExport void vehicle_role( + etsi_its_cam_msgs::msg::VehicleRole&& _vehicle_role); + + /*! + * @brief This function returns a constant reference to member vehicle_role + * @return Constant reference to member vehicle_role + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleRole& vehicle_role() const; + + /*! + * @brief This function returns a reference to member vehicle_role + * @return Reference to member vehicle_role + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleRole& vehicle_role(); + /*! + * @brief This function copies the value in member exterior_lights + * @param _exterior_lights New value to be copied in member exterior_lights + */ + eProsima_user_DllExport void exterior_lights( + const etsi_its_cam_msgs::msg::ExteriorLights& _exterior_lights); + + /*! + * @brief This function moves the value in member exterior_lights + * @param _exterior_lights New value to be moved in member exterior_lights + */ + eProsima_user_DllExport void exterior_lights( + etsi_its_cam_msgs::msg::ExteriorLights&& _exterior_lights); + + /*! + * @brief This function returns a constant reference to member exterior_lights + * @return Constant reference to member exterior_lights + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ExteriorLights& exterior_lights() const; + + /*! + * @brief This function returns a reference to member exterior_lights + * @return Reference to member exterior_lights + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ExteriorLights& exterior_lights(); + /*! + * @brief This function copies the value in member path_history + * @param _path_history New value to be copied in member path_history + */ + eProsima_user_DllExport void path_history( + const etsi_its_cam_msgs::msg::PathHistory& _path_history); + + /*! + * @brief This function moves the value in member path_history + * @param _path_history New value to be moved in member path_history + */ + eProsima_user_DllExport void path_history( + etsi_its_cam_msgs::msg::PathHistory&& _path_history); + + /*! + * @brief This function returns a constant reference to member path_history + * @return Constant reference to member path_history + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PathHistory& path_history() const; + + /*! + * @brief This function returns a reference to member path_history + * @return Reference to member path_history + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PathHistory& path_history(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::VehicleRole m_vehicle_role; + etsi_its_cam_msgs::msg::ExteriorLights m_exterior_lights; + etsi_its_cam_msgs::msg::PathHistory m_path_history; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.cxx new file mode 100644 index 00000000000..36cb0110bc0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerLowFrequencyPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "BasicVehicleContainerLowFrequencyPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + BasicVehicleContainerLowFrequencyPubSubType::BasicVehicleContainerLowFrequencyPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::BasicVehicleContainerLowFrequency_"); + auto type_size = BasicVehicleContainerLowFrequency::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = BasicVehicleContainerLowFrequency::isKeyDefined(); + size_t keyLength = BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize() > 16 ? + BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + BasicVehicleContainerLowFrequencyPubSubType::~BasicVehicleContainerLowFrequencyPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool BasicVehicleContainerLowFrequencyPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + BasicVehicleContainerLowFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool BasicVehicleContainerLowFrequencyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + BasicVehicleContainerLowFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function BasicVehicleContainerLowFrequencyPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* BasicVehicleContainerLowFrequencyPubSubType::createData() + { + return reinterpret_cast(new BasicVehicleContainerLowFrequency()); + } + + void BasicVehicleContainerLowFrequencyPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool BasicVehicleContainerLowFrequencyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + BasicVehicleContainerLowFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.h new file mode 100644 index 00000000000..fb7ccfbdf91 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerLowFrequencyPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_PUBSUBTYPES_H_ + +#include +#include + +#include "BasicVehicleContainerLowFrequency.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated BasicVehicleContainerLowFrequency is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type BasicVehicleContainerLowFrequency defined by the user in the IDL file. + * @ingroup BASICVEHICLECONTAINERLOWFREQUENCY + */ + class BasicVehicleContainerLowFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef BasicVehicleContainerLowFrequency type; + + eProsima_user_DllExport BasicVehicleContainerLowFrequencyPubSubType(); + + eProsima_user_DllExport virtual ~BasicVehicleContainerLowFrequencyPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.cxx new file mode 100644 index 00000000000..7cd382b8490 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CAM.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CAM.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::CAM::CAM() +{ + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@618c5d94 + + // m_cam com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5b40ceb + + +} + +etsi_its_cam_msgs::msg::CAM::~CAM() +{ + +} + +etsi_its_cam_msgs::msg::CAM::CAM( + const CAM& x) +{ + m_header = x.m_header; + m_cam = x.m_cam; +} + +etsi_its_cam_msgs::msg::CAM::CAM( + CAM&& x) +{ + m_header = std::move(x.m_header); + m_cam = std::move(x.m_cam); +} + +etsi_its_cam_msgs::msg::CAM& etsi_its_cam_msgs::msg::CAM::operator =( + const CAM& x) +{ + + m_header = x.m_header; + m_cam = x.m_cam; + + return *this; +} + +etsi_its_cam_msgs::msg::CAM& etsi_its_cam_msgs::msg::CAM::operator =( + CAM&& x) +{ + + m_header = std::move(x.m_header); + m_cam = std::move(x.m_cam); + + return *this; +} + +bool etsi_its_cam_msgs::msg::CAM::operator ==( + const CAM& x) const +{ + + return (m_header == x.m_header && m_cam == x.m_cam); +} + +bool etsi_its_cam_msgs::msg::CAM::operator !=( + const CAM& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CAM::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CoopAwareness::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CAM::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CAM& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CoopAwareness::getCdrSerializedSize(data.cam(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CAM::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_header; + scdr << m_cam; + +} + +void etsi_its_cam_msgs::msg::CAM::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_header; + dcdr >> m_cam; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void etsi_its_cam_msgs::msg::CAM::header( + const etsi_its_cam_msgs::msg::ItsPduHeader& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void etsi_its_cam_msgs::msg::CAM::header( + etsi_its_cam_msgs::msg::ItsPduHeader&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::CAM::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::CAM::header() +{ + return m_header; +} +/*! + * @brief This function copies the value in member cam + * @param _cam New value to be copied in member cam + */ +void etsi_its_cam_msgs::msg::CAM::cam( + const etsi_its_cam_msgs::msg::CoopAwareness& _cam) +{ + m_cam = _cam; +} + +/*! + * @brief This function moves the value in member cam + * @param _cam New value to be moved in member cam + */ +void etsi_its_cam_msgs::msg::CAM::cam( + etsi_its_cam_msgs::msg::CoopAwareness&& _cam) +{ + m_cam = std::move(_cam); +} + +/*! + * @brief This function returns a constant reference to member cam + * @return Constant reference to member cam + */ +const etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CAM::cam() const +{ + return m_cam; +} + +/*! + * @brief This function returns a reference to member cam + * @return Reference to member cam + */ +etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CAM::cam() +{ + return m_cam; +} + +size_t etsi_its_cam_msgs::msg::CAM::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CAM::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CAM::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h new file mode 100644 index 00000000000..3d3156113cc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CAM.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_H_ + +#include "ItsPduHeader.h" +#include "CoopAwareness.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CAM_SOURCE) +#define CAM_DllAPI __declspec( dllexport ) +#else +#define CAM_DllAPI __declspec( dllimport ) +#endif // CAM_SOURCE +#else +#define CAM_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CAM_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure CAM defined by the user in the IDL file. + * @ingroup CAM + */ + class CAM + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CAM(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CAM(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. + */ + eProsima_user_DllExport CAM( + const CAM& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. + */ + eProsima_user_DllExport CAM( + CAM&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. + */ + eProsima_user_DllExport CAM& operator =( + const CAM& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. + */ + eProsima_user_DllExport CAM& operator =( + CAM&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CAM object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CAM& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CAM object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CAM& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const etsi_its_cam_msgs::msg::ItsPduHeader& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + etsi_its_cam_msgs::msg::ItsPduHeader&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ItsPduHeader& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ItsPduHeader& header(); + /*! + * @brief This function copies the value in member cam + * @param _cam New value to be copied in member cam + */ + eProsima_user_DllExport void cam( + const etsi_its_cam_msgs::msg::CoopAwareness& _cam); + + /*! + * @brief This function moves the value in member cam + * @param _cam New value to be moved in member cam + */ + eProsima_user_DllExport void cam( + etsi_its_cam_msgs::msg::CoopAwareness&& _cam); + + /*! + * @brief This function returns a constant reference to member cam + * @return Constant reference to member cam + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CoopAwareness& cam() const; + + /*! + * @brief This function returns a reference to member cam + * @return Reference to member cam + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CoopAwareness& cam(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CAM& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::ItsPduHeader m_header; + etsi_its_cam_msgs::msg::CoopAwareness m_cam; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/ImagePubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx similarity index 71% rename from LibCarla/source/carla/ros2/types/ImagePubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx index cadfdf9908b..47720dfbe46 100644 --- a/LibCarla/source/carla/ros2/types/ImagePubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx @@ -13,36 +13,37 @@ // limitations under the License. /*! - * @file ImagePubSubTypes.cpp + * @file CAMPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * * This file was generated by the tool fastcdrgen. */ + #include #include -#include "ImagePubSubTypes.h" +#include "CAMPubSubTypes.h" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -namespace sensor_msgs { +namespace etsi_its_cam_msgs { namespace msg { - ImagePubSubType::ImagePubSubType() + CAMPubSubType::CAMPubSubType() { - setName("sensor_msgs::msg::dds_::Image_"); - auto type_size = Image::getMaxCdrSerializedSize(); + setName("etsi_its_cam_msgs::msg::dds_::CAM_"); + auto type_size = CAM::getMaxCdrSerializedSize(); type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Image::isKeyDefined(); - size_t keyLength = Image::getKeyMaxCdrSerializedSize() > 16 ? - Image::getKeyMaxCdrSerializedSize() : 16; + m_isGetKeyDefined = CAM::isKeyDefined(); + size_t keyLength = CAM::getKeyMaxCdrSerializedSize() > 16 ? + CAM::getKeyMaxCdrSerializedSize() : 16; m_keyBuffer = reinterpret_cast(malloc(keyLength)); memset(m_keyBuffer, 0, keyLength); } - ImagePubSubType::~ImagePubSubType() + CAMPubSubType::~CAMPubSubType() { if (m_keyBuffer != nullptr) { @@ -50,11 +51,11 @@ namespace sensor_msgs { } } - bool ImagePubSubType::serialize( + bool CAMPubSubType::serialize( void* data, SerializedPayload_t* payload) { - Image* p_type = static_cast(data); + CAM* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); @@ -63,18 +64,28 @@ namespace sensor_msgs { payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Serialize encapsulation ser.serialize_encapsulation(); - p_type->serialize(ser); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + // Get the serialized length payload->length = static_cast(ser.getSerializedDataLength()); return true; } - bool ImagePubSubType::deserialize( + bool CAMPubSubType::deserialize( SerializedPayload_t* payload, void* data) { //Convert DATA to pointer of your type - Image* p_type = static_cast(data); + CAM* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); @@ -86,33 +97,41 @@ namespace sensor_msgs { deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Deserialize the object. - p_type->deserialize(deser); + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + return true; } - std::function ImagePubSubType::getSerializedSizeProvider( + std::function CAMPubSubType::getSerializedSizeProvider( void* data) { return [data]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + 4u /*encapsulation*/; }; } - void* ImagePubSubType::createData() + void* CAMPubSubType::createData() { - return reinterpret_cast(new Image()); + return reinterpret_cast(new CAM()); } - void ImagePubSubType::deleteData( + void CAMPubSubType::deleteData( void* data) { - delete(reinterpret_cast(data)); + delete(reinterpret_cast(data)); } - bool ImagePubSubType::getKey( + bool CAMPubSubType::getKey( void* data, InstanceHandle_t* handle, bool force_md5) @@ -122,16 +141,16 @@ namespace sensor_msgs { return false; } - Image* p_type = static_cast(data); + CAM* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Image::getKeyMaxCdrSerializedSize()); + CAM::getKeyMaxCdrSerializedSize()); // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); p_type->serializeKey(ser); - if (force_md5 || Image::getKeyMaxCdrSerializedSize() > 16) + if (force_md5 || CAM::getKeyMaxCdrSerializedSize() > 16) { m_md5.init(); m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); @@ -150,5 +169,8 @@ namespace sensor_msgs { } return true; } + + } //End of namespace msg -} //End of namespace sensor_msgs + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/types/ClockPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.h similarity index 80% rename from LibCarla/source/carla/ros2/types/ClockPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.h index e3cb8ca3b1d..f202cc39de2 100644 --- a/LibCarla/source/carla/ros2/types/ClockPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.h @@ -13,42 +13,43 @@ // limitations under the License. /*! - * @file ClockPubSubTypes.h + * @file CAMPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_PUBSUBTYPES_H_ #include #include -#include "Clock.h" +#include "CAM.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated Clock is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CAM is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace rosgraph +namespace etsi_its_cam_msgs { namespace msg { /*! - * @brief This class represents the TopicDataType of the type Clock defined by the user in the IDL file. - * @ingroup Clock + * @brief This class represents the TopicDataType of the type CAM defined by the user in the IDL file. + * @ingroup CAM */ - class ClockPubSubType : public eprosima::fastdds::dds::TopicDataType + class CAMPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef Clock type; + typedef CAM type; - eProsima_user_DllExport ClockPubSubType(); + eProsima_user_DllExport CAMPubSubType(); - eProsima_user_DllExport virtual ~ClockPubSubType() override; + eProsima_user_DllExport virtual ~CAMPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -96,10 +97,11 @@ namespace rosgraph } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.cxx new file mode 100644 index 00000000000..7323b0c6814 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.cxx @@ -0,0 +1,420 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CamParameters.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CamParameters.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::CamParameters::CamParameters() +{ + // m_basic_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@773cbf4f + + // m_high_frequency_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6b54655f + + // m_low_frequency_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@665e9289 + + // m_low_frequency_container_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7d3430a7 + m_low_frequency_container_is_present = false; + // m_special_vehicle_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6f603e89 + + // m_special_vehicle_container_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2756c0a7 + m_special_vehicle_container_is_present = false; + +} + +etsi_its_cam_msgs::msg::CamParameters::~CamParameters() +{ + + + + + +} + +etsi_its_cam_msgs::msg::CamParameters::CamParameters( + const CamParameters& x) +{ + m_basic_container = x.m_basic_container; + m_high_frequency_container = x.m_high_frequency_container; + m_low_frequency_container = x.m_low_frequency_container; + m_low_frequency_container_is_present = x.m_low_frequency_container_is_present; + m_special_vehicle_container = x.m_special_vehicle_container; + m_special_vehicle_container_is_present = x.m_special_vehicle_container_is_present; +} + +etsi_its_cam_msgs::msg::CamParameters::CamParameters( + CamParameters&& x) +{ + m_basic_container = std::move(x.m_basic_container); + m_high_frequency_container = std::move(x.m_high_frequency_container); + m_low_frequency_container = std::move(x.m_low_frequency_container); + m_low_frequency_container_is_present = x.m_low_frequency_container_is_present; + m_special_vehicle_container = std::move(x.m_special_vehicle_container); + m_special_vehicle_container_is_present = x.m_special_vehicle_container_is_present; +} + +etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CamParameters::operator =( + const CamParameters& x) +{ + + m_basic_container = x.m_basic_container; + m_high_frequency_container = x.m_high_frequency_container; + m_low_frequency_container = x.m_low_frequency_container; + m_low_frequency_container_is_present = x.m_low_frequency_container_is_present; + m_special_vehicle_container = x.m_special_vehicle_container; + m_special_vehicle_container_is_present = x.m_special_vehicle_container_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CamParameters::operator =( + CamParameters&& x) +{ + + m_basic_container = std::move(x.m_basic_container); + m_high_frequency_container = std::move(x.m_high_frequency_container); + m_low_frequency_container = std::move(x.m_low_frequency_container); + m_low_frequency_container_is_present = x.m_low_frequency_container_is_present; + m_special_vehicle_container = std::move(x.m_special_vehicle_container); + m_special_vehicle_container_is_present = x.m_special_vehicle_container_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::CamParameters::operator ==( + const CamParameters& x) const +{ + + return (m_basic_container == x.m_basic_container && m_high_frequency_container == x.m_high_frequency_container && m_low_frequency_container == x.m_low_frequency_container && m_low_frequency_container_is_present == x.m_low_frequency_container_is_present && m_special_vehicle_container == x.m_special_vehicle_container && m_special_vehicle_container_is_present == x.m_special_vehicle_container_is_present); +} + +bool etsi_its_cam_msgs::msg::CamParameters::operator !=( + const CamParameters& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CamParameters::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::BasicContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::HighFrequencyContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::LowFrequencyContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::SpecialVehicleContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CamParameters::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CamParameters& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::BasicContainer::getCdrSerializedSize(data.basic_container(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::HighFrequencyContainer::getCdrSerializedSize(data.high_frequency_container(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::LowFrequencyContainer::getCdrSerializedSize(data.low_frequency_container(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::SpecialVehicleContainer::getCdrSerializedSize(data.special_vehicle_container(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CamParameters::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_basic_container; + scdr << m_high_frequency_container; + scdr << m_low_frequency_container; + scdr << m_low_frequency_container_is_present; + scdr << m_special_vehicle_container; + scdr << m_special_vehicle_container_is_present; + +} + +void etsi_its_cam_msgs::msg::CamParameters::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_basic_container; + dcdr >> m_high_frequency_container; + dcdr >> m_low_frequency_container; + dcdr >> m_low_frequency_container_is_present; + dcdr >> m_special_vehicle_container; + dcdr >> m_special_vehicle_container_is_present; +} + +/*! + * @brief This function copies the value in member basic_container + * @param _basic_container New value to be copied in member basic_container + */ +void etsi_its_cam_msgs::msg::CamParameters::basic_container( + const etsi_its_cam_msgs::msg::BasicContainer& _basic_container) +{ + m_basic_container = _basic_container; +} + +/*! + * @brief This function moves the value in member basic_container + * @param _basic_container New value to be moved in member basic_container + */ +void etsi_its_cam_msgs::msg::CamParameters::basic_container( + etsi_its_cam_msgs::msg::BasicContainer&& _basic_container) +{ + m_basic_container = std::move(_basic_container); +} + +/*! + * @brief This function returns a constant reference to member basic_container + * @return Constant reference to member basic_container + */ +const etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::CamParameters::basic_container() const +{ + return m_basic_container; +} + +/*! + * @brief This function returns a reference to member basic_container + * @return Reference to member basic_container + */ +etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::CamParameters::basic_container() +{ + return m_basic_container; +} +/*! + * @brief This function copies the value in member high_frequency_container + * @param _high_frequency_container New value to be copied in member high_frequency_container + */ +void etsi_its_cam_msgs::msg::CamParameters::high_frequency_container( + const etsi_its_cam_msgs::msg::HighFrequencyContainer& _high_frequency_container) +{ + m_high_frequency_container = _high_frequency_container; +} + +/*! + * @brief This function moves the value in member high_frequency_container + * @param _high_frequency_container New value to be moved in member high_frequency_container + */ +void etsi_its_cam_msgs::msg::CamParameters::high_frequency_container( + etsi_its_cam_msgs::msg::HighFrequencyContainer&& _high_frequency_container) +{ + m_high_frequency_container = std::move(_high_frequency_container); +} + +/*! + * @brief This function returns a constant reference to member high_frequency_container + * @return Constant reference to member high_frequency_container + */ +const etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::CamParameters::high_frequency_container() const +{ + return m_high_frequency_container; +} + +/*! + * @brief This function returns a reference to member high_frequency_container + * @return Reference to member high_frequency_container + */ +etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::CamParameters::high_frequency_container() +{ + return m_high_frequency_container; +} +/*! + * @brief This function copies the value in member low_frequency_container + * @param _low_frequency_container New value to be copied in member low_frequency_container + */ +void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container( + const etsi_its_cam_msgs::msg::LowFrequencyContainer& _low_frequency_container) +{ + m_low_frequency_container = _low_frequency_container; +} + +/*! + * @brief This function moves the value in member low_frequency_container + * @param _low_frequency_container New value to be moved in member low_frequency_container + */ +void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container( + etsi_its_cam_msgs::msg::LowFrequencyContainer&& _low_frequency_container) +{ + m_low_frequency_container = std::move(_low_frequency_container); +} + +/*! + * @brief This function returns a constant reference to member low_frequency_container + * @return Constant reference to member low_frequency_container + */ +const etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::CamParameters::low_frequency_container() const +{ + return m_low_frequency_container; +} + +/*! + * @brief This function returns a reference to member low_frequency_container + * @return Reference to member low_frequency_container + */ +etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::CamParameters::low_frequency_container() +{ + return m_low_frequency_container; +} +/*! + * @brief This function sets a value in member low_frequency_container_is_present + * @param _low_frequency_container_is_present New value for member low_frequency_container_is_present + */ +void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container_is_present( + bool _low_frequency_container_is_present) +{ + m_low_frequency_container_is_present = _low_frequency_container_is_present; +} + +/*! + * @brief This function returns the value of member low_frequency_container_is_present + * @return Value of member low_frequency_container_is_present + */ +bool etsi_its_cam_msgs::msg::CamParameters::low_frequency_container_is_present() const +{ + return m_low_frequency_container_is_present; +} + +/*! + * @brief This function returns a reference to member low_frequency_container_is_present + * @return Reference to member low_frequency_container_is_present + */ +bool& etsi_its_cam_msgs::msg::CamParameters::low_frequency_container_is_present() +{ + return m_low_frequency_container_is_present; +} + +/*! + * @brief This function copies the value in member special_vehicle_container + * @param _special_vehicle_container New value to be copied in member special_vehicle_container + */ +void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container( + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& _special_vehicle_container) +{ + m_special_vehicle_container = _special_vehicle_container; +} + +/*! + * @brief This function moves the value in member special_vehicle_container + * @param _special_vehicle_container New value to be moved in member special_vehicle_container + */ +void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container( + etsi_its_cam_msgs::msg::SpecialVehicleContainer&& _special_vehicle_container) +{ + m_special_vehicle_container = std::move(_special_vehicle_container); +} + +/*! + * @brief This function returns a constant reference to member special_vehicle_container + * @return Constant reference to member special_vehicle_container + */ +const etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container() const +{ + return m_special_vehicle_container; +} + +/*! + * @brief This function returns a reference to member special_vehicle_container + * @return Reference to member special_vehicle_container + */ +etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container() +{ + return m_special_vehicle_container; +} +/*! + * @brief This function sets a value in member special_vehicle_container_is_present + * @param _special_vehicle_container_is_present New value for member special_vehicle_container_is_present + */ +void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container_is_present( + bool _special_vehicle_container_is_present) +{ + m_special_vehicle_container_is_present = _special_vehicle_container_is_present; +} + +/*! + * @brief This function returns the value of member special_vehicle_container_is_present + * @return Value of member special_vehicle_container_is_present + */ +bool etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container_is_present() const +{ + return m_special_vehicle_container_is_present; +} + +/*! + * @brief This function returns a reference to member special_vehicle_container_is_present + * @return Reference to member special_vehicle_container_is_present + */ +bool& etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container_is_present() +{ + return m_special_vehicle_container_is_present; +} + + +size_t etsi_its_cam_msgs::msg::CamParameters::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CamParameters::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CamParameters::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.h new file mode 100644 index 00000000000..b30a7e5a331 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.h @@ -0,0 +1,338 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CamParameters.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_H_ + +#include "SpecialVehicleContainer.h" +#include "BasicContainer.h" +#include "HighFrequencyContainer.h" +#include "LowFrequencyContainer.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CamParameters_SOURCE) +#define CamParameters_DllAPI __declspec( dllexport ) +#else +#define CamParameters_DllAPI __declspec( dllimport ) +#endif // CamParameters_SOURCE +#else +#define CamParameters_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CamParameters_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure CamParameters defined by the user in the IDL file. + * @ingroup CAMPARAMETERS + */ + class CamParameters + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CamParameters(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CamParameters(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. + */ + eProsima_user_DllExport CamParameters( + const CamParameters& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. + */ + eProsima_user_DllExport CamParameters( + CamParameters&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. + */ + eProsima_user_DllExport CamParameters& operator =( + const CamParameters& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. + */ + eProsima_user_DllExport CamParameters& operator =( + CamParameters&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CamParameters object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CamParameters& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CamParameters object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CamParameters& x) const; + + /*! + * @brief This function copies the value in member basic_container + * @param _basic_container New value to be copied in member basic_container + */ + eProsima_user_DllExport void basic_container( + const etsi_its_cam_msgs::msg::BasicContainer& _basic_container); + + /*! + * @brief This function moves the value in member basic_container + * @param _basic_container New value to be moved in member basic_container + */ + eProsima_user_DllExport void basic_container( + etsi_its_cam_msgs::msg::BasicContainer&& _basic_container); + + /*! + * @brief This function returns a constant reference to member basic_container + * @return Constant reference to member basic_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicContainer& basic_container() const; + + /*! + * @brief This function returns a reference to member basic_container + * @return Reference to member basic_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicContainer& basic_container(); + /*! + * @brief This function copies the value in member high_frequency_container + * @param _high_frequency_container New value to be copied in member high_frequency_container + */ + eProsima_user_DllExport void high_frequency_container( + const etsi_its_cam_msgs::msg::HighFrequencyContainer& _high_frequency_container); + + /*! + * @brief This function moves the value in member high_frequency_container + * @param _high_frequency_container New value to be moved in member high_frequency_container + */ + eProsima_user_DllExport void high_frequency_container( + etsi_its_cam_msgs::msg::HighFrequencyContainer&& _high_frequency_container); + + /*! + * @brief This function returns a constant reference to member high_frequency_container + * @return Constant reference to member high_frequency_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HighFrequencyContainer& high_frequency_container() const; + + /*! + * @brief This function returns a reference to member high_frequency_container + * @return Reference to member high_frequency_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HighFrequencyContainer& high_frequency_container(); + /*! + * @brief This function copies the value in member low_frequency_container + * @param _low_frequency_container New value to be copied in member low_frequency_container + */ + eProsima_user_DllExport void low_frequency_container( + const etsi_its_cam_msgs::msg::LowFrequencyContainer& _low_frequency_container); + + /*! + * @brief This function moves the value in member low_frequency_container + * @param _low_frequency_container New value to be moved in member low_frequency_container + */ + eProsima_user_DllExport void low_frequency_container( + etsi_its_cam_msgs::msg::LowFrequencyContainer&& _low_frequency_container); + + /*! + * @brief This function returns a constant reference to member low_frequency_container + * @return Constant reference to member low_frequency_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LowFrequencyContainer& low_frequency_container() const; + + /*! + * @brief This function returns a reference to member low_frequency_container + * @return Reference to member low_frequency_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LowFrequencyContainer& low_frequency_container(); + /*! + * @brief This function sets a value in member low_frequency_container_is_present + * @param _low_frequency_container_is_present New value for member low_frequency_container_is_present + */ + eProsima_user_DllExport void low_frequency_container_is_present( + bool _low_frequency_container_is_present); + + /*! + * @brief This function returns the value of member low_frequency_container_is_present + * @return Value of member low_frequency_container_is_present + */ + eProsima_user_DllExport bool low_frequency_container_is_present() const; + + /*! + * @brief This function returns a reference to member low_frequency_container_is_present + * @return Reference to member low_frequency_container_is_present + */ + eProsima_user_DllExport bool& low_frequency_container_is_present(); + + /*! + * @brief This function copies the value in member special_vehicle_container + * @param _special_vehicle_container New value to be copied in member special_vehicle_container + */ + eProsima_user_DllExport void special_vehicle_container( + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& _special_vehicle_container); + + /*! + * @brief This function moves the value in member special_vehicle_container + * @param _special_vehicle_container New value to be moved in member special_vehicle_container + */ + eProsima_user_DllExport void special_vehicle_container( + etsi_its_cam_msgs::msg::SpecialVehicleContainer&& _special_vehicle_container); + + /*! + * @brief This function returns a constant reference to member special_vehicle_container + * @return Constant reference to member special_vehicle_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialVehicleContainer& special_vehicle_container() const; + + /*! + * @brief This function returns a reference to member special_vehicle_container + * @return Reference to member special_vehicle_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialVehicleContainer& special_vehicle_container(); + /*! + * @brief This function sets a value in member special_vehicle_container_is_present + * @param _special_vehicle_container_is_present New value for member special_vehicle_container_is_present + */ + eProsima_user_DllExport void special_vehicle_container_is_present( + bool _special_vehicle_container_is_present); + + /*! + * @brief This function returns the value of member special_vehicle_container_is_present + * @return Value of member special_vehicle_container_is_present + */ + eProsima_user_DllExport bool special_vehicle_container_is_present() const; + + /*! + * @brief This function returns a reference to member special_vehicle_container_is_present + * @return Reference to member special_vehicle_container_is_present + */ + eProsima_user_DllExport bool& special_vehicle_container_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CamParameters& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::BasicContainer m_basic_container; + etsi_its_cam_msgs::msg::HighFrequencyContainer m_high_frequency_container; + etsi_its_cam_msgs::msg::LowFrequencyContainer m_low_frequency_container; + bool m_low_frequency_container_is_present; + etsi_its_cam_msgs::msg::SpecialVehicleContainer m_special_vehicle_container; + bool m_special_vehicle_container_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.cxx new file mode 100644 index 00000000000..abfad39c34c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CamParametersPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CamParametersPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + CamParametersPubSubType::CamParametersPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CamParameters_"); + auto type_size = CamParameters::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CamParameters::isKeyDefined(); + size_t keyLength = CamParameters::getKeyMaxCdrSerializedSize() > 16 ? + CamParameters::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CamParametersPubSubType::~CamParametersPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CamParametersPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CamParameters* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CamParametersPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CamParameters* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CamParametersPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CamParametersPubSubType::createData() + { + return reinterpret_cast(new CamParameters()); + } + + void CamParametersPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CamParametersPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CamParameters* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CamParameters::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CamParameters::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.h new file mode 100644 index 00000000000..ea7f45e0f65 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CamParametersPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_PUBSUBTYPES_H_ + +#include +#include + +#include "CamParameters.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CamParameters is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CamParameters defined by the user in the IDL file. + * @ingroup CAMPARAMETERS + */ + class CamParametersPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CamParameters type; + + eProsima_user_DllExport CamParametersPubSubType(); + + eProsima_user_DllExport virtual ~CamParametersPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.cxx new file mode 100644 index 00000000000..4e23fcb059d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCode.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CauseCode.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::CauseCode::CauseCode() +{ + // m_cause_code com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@bc57b40 + + // m_sub_cause_code com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1b5bc39d + + +} + +etsi_its_cam_msgs::msg::CauseCode::~CauseCode() +{ + +} + +etsi_its_cam_msgs::msg::CauseCode::CauseCode( + const CauseCode& x) +{ + m_cause_code = x.m_cause_code; + m_sub_cause_code = x.m_sub_cause_code; +} + +etsi_its_cam_msgs::msg::CauseCode::CauseCode( + CauseCode&& x) +{ + m_cause_code = std::move(x.m_cause_code); + m_sub_cause_code = std::move(x.m_sub_cause_code); +} + +etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::CauseCode::operator =( + const CauseCode& x) +{ + + m_cause_code = x.m_cause_code; + m_sub_cause_code = x.m_sub_cause_code; + + return *this; +} + +etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::CauseCode::operator =( + CauseCode&& x) +{ + + m_cause_code = std::move(x.m_cause_code); + m_sub_cause_code = std::move(x.m_sub_cause_code); + + return *this; +} + +bool etsi_its_cam_msgs::msg::CauseCode::operator ==( + const CauseCode& x) const +{ + + return (m_cause_code == x.m_cause_code && m_sub_cause_code == x.m_sub_cause_code); +} + +bool etsi_its_cam_msgs::msg::CauseCode::operator !=( + const CauseCode& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CauseCode::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::CauseCodeType::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SubCauseCodeType::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CauseCode::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CauseCode& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::CauseCodeType::getCdrSerializedSize(data.cause_code(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SubCauseCodeType::getCdrSerializedSize(data.sub_cause_code(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CauseCode::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_cause_code; + scdr << m_sub_cause_code; + +} + +void etsi_its_cam_msgs::msg::CauseCode::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_cause_code; + dcdr >> m_sub_cause_code; +} + +/*! + * @brief This function copies the value in member cause_code + * @param _cause_code New value to be copied in member cause_code + */ +void etsi_its_cam_msgs::msg::CauseCode::cause_code( + const etsi_its_cam_msgs::msg::CauseCodeType& _cause_code) +{ + m_cause_code = _cause_code; +} + +/*! + * @brief This function moves the value in member cause_code + * @param _cause_code New value to be moved in member cause_code + */ +void etsi_its_cam_msgs::msg::CauseCode::cause_code( + etsi_its_cam_msgs::msg::CauseCodeType&& _cause_code) +{ + m_cause_code = std::move(_cause_code); +} + +/*! + * @brief This function returns a constant reference to member cause_code + * @return Constant reference to member cause_code + */ +const etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCode::cause_code() const +{ + return m_cause_code; +} + +/*! + * @brief This function returns a reference to member cause_code + * @return Reference to member cause_code + */ +etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCode::cause_code() +{ + return m_cause_code; +} +/*! + * @brief This function copies the value in member sub_cause_code + * @param _sub_cause_code New value to be copied in member sub_cause_code + */ +void etsi_its_cam_msgs::msg::CauseCode::sub_cause_code( + const etsi_its_cam_msgs::msg::SubCauseCodeType& _sub_cause_code) +{ + m_sub_cause_code = _sub_cause_code; +} + +/*! + * @brief This function moves the value in member sub_cause_code + * @param _sub_cause_code New value to be moved in member sub_cause_code + */ +void etsi_its_cam_msgs::msg::CauseCode::sub_cause_code( + etsi_its_cam_msgs::msg::SubCauseCodeType&& _sub_cause_code) +{ + m_sub_cause_code = std::move(_sub_cause_code); +} + +/*! + * @brief This function returns a constant reference to member sub_cause_code + * @return Constant reference to member sub_cause_code + */ +const etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::CauseCode::sub_cause_code() const +{ + return m_sub_cause_code; +} + +/*! + * @brief This function returns a reference to member sub_cause_code + * @return Reference to member sub_cause_code + */ +etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::CauseCode::sub_cause_code() +{ + return m_sub_cause_code; +} + +size_t etsi_its_cam_msgs::msg::CauseCode::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CauseCode::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CauseCode::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.h new file mode 100644 index 00000000000..4533dc8dbc3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCode.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_H_ + +#include "SubCauseCodeType.h" +#include "CauseCodeType.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CauseCode_SOURCE) +#define CauseCode_DllAPI __declspec( dllexport ) +#else +#define CauseCode_DllAPI __declspec( dllimport ) +#endif // CauseCode_SOURCE +#else +#define CauseCode_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CauseCode_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure CauseCode defined by the user in the IDL file. + * @ingroup CAUSECODE + */ + class CauseCode + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CauseCode(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CauseCode(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. + */ + eProsima_user_DllExport CauseCode( + const CauseCode& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. + */ + eProsima_user_DllExport CauseCode( + CauseCode&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. + */ + eProsima_user_DllExport CauseCode& operator =( + const CauseCode& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. + */ + eProsima_user_DllExport CauseCode& operator =( + CauseCode&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CauseCode object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CauseCode& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CauseCode object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CauseCode& x) const; + + /*! + * @brief This function copies the value in member cause_code + * @param _cause_code New value to be copied in member cause_code + */ + eProsima_user_DllExport void cause_code( + const etsi_its_cam_msgs::msg::CauseCodeType& _cause_code); + + /*! + * @brief This function moves the value in member cause_code + * @param _cause_code New value to be moved in member cause_code + */ + eProsima_user_DllExport void cause_code( + etsi_its_cam_msgs::msg::CauseCodeType&& _cause_code); + + /*! + * @brief This function returns a constant reference to member cause_code + * @return Constant reference to member cause_code + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCodeType& cause_code() const; + + /*! + * @brief This function returns a reference to member cause_code + * @return Reference to member cause_code + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCodeType& cause_code(); + /*! + * @brief This function copies the value in member sub_cause_code + * @param _sub_cause_code New value to be copied in member sub_cause_code + */ + eProsima_user_DllExport void sub_cause_code( + const etsi_its_cam_msgs::msg::SubCauseCodeType& _sub_cause_code); + + /*! + * @brief This function moves the value in member sub_cause_code + * @param _sub_cause_code New value to be moved in member sub_cause_code + */ + eProsima_user_DllExport void sub_cause_code( + etsi_its_cam_msgs::msg::SubCauseCodeType&& _sub_cause_code); + + /*! + * @brief This function returns a constant reference to member sub_cause_code + * @return Constant reference to member sub_cause_code + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SubCauseCodeType& sub_cause_code() const; + + /*! + * @brief This function returns a reference to member sub_cause_code + * @return Reference to member sub_cause_code + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SubCauseCodeType& sub_cause_code(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CauseCode& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::CauseCodeType m_cause_code; + etsi_its_cam_msgs::msg::SubCauseCodeType m_sub_cause_code; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.cxx new file mode 100644 index 00000000000..cc0a7168c68 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CauseCodePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + CauseCodePubSubType::CauseCodePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CauseCode_"); + auto type_size = CauseCode::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CauseCode::isKeyDefined(); + size_t keyLength = CauseCode::getKeyMaxCdrSerializedSize() > 16 ? + CauseCode::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CauseCodePubSubType::~CauseCodePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CauseCodePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CauseCode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CauseCodePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CauseCode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CauseCodePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CauseCodePubSubType::createData() + { + return reinterpret_cast(new CauseCode()); + } + + void CauseCodePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CauseCodePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CauseCode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CauseCode::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CauseCode::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/types/TFMessagePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.h similarity index 77% rename from LibCarla/source/carla/ros2/types/TFMessagePubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.h index 5dbd16037bf..995db83ecf8 100644 --- a/LibCarla/source/carla/ros2/types/TFMessagePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.h @@ -13,45 +13,43 @@ // limitations under the License. /*! - * @file TFMessagePubSubTypes.h + * @file CauseCodePubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_PUBSUBTYPES_H_ #include #include -#include "TFMessage.h" - -#include "TransformStampedPubSubTypes.h" +#include "CauseCode.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated TFMessage is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CauseCode is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace tf2_msgs +namespace etsi_its_cam_msgs { namespace msg { - /*! - * @brief This class represents the TopicDataType of the type TFMessage defined by the user in the IDL file. - * @ingroup TFMESSAGE + * @brief This class represents the TopicDataType of the type CauseCode defined by the user in the IDL file. + * @ingroup CAUSECODE */ - class TFMessagePubSubType : public eprosima::fastdds::dds::TopicDataType + class CauseCodePubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef TFMessage type; + typedef CauseCode type; - eProsima_user_DllExport TFMessagePubSubType(); + eProsima_user_DllExport CauseCodePubSubType(); - eProsima_user_DllExport virtual ~TFMessagePubSubType() override; + eProsima_user_DllExport virtual ~CauseCodePubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -77,7 +75,7 @@ namespace tf2_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -85,7 +83,7 @@ namespace tf2_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -94,15 +92,16 @@ namespace tf2_msgs eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; - return false; + new (memory) CauseCode(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.cxx new file mode 100644 index 00000000000..4c64c12d3bc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.cxx @@ -0,0 +1,213 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodeType.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CauseCodeType.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +etsi_its_cam_msgs::msg::CauseCodeType::CauseCodeType() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2ca47471 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::CauseCodeType::~CauseCodeType() +{ +} + +etsi_its_cam_msgs::msg::CauseCodeType::CauseCodeType( + const CauseCodeType& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CauseCodeType::CauseCodeType( + CauseCodeType&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCodeType::operator =( + const CauseCodeType& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCodeType::operator =( + CauseCodeType&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::CauseCodeType::operator ==( + const CauseCodeType& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::CauseCodeType::operator !=( + const CauseCodeType& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CauseCodeType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CauseCodeType::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CauseCodeType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CauseCodeType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::CauseCodeType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::CauseCodeType::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::CauseCodeType::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::CauseCodeType::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::CauseCodeType::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CauseCodeType::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CauseCodeType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.h new file mode 100644 index 00000000000..b1bb4a7e467 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.h @@ -0,0 +1,241 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodeType.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CauseCodeType_SOURCE) +#define CauseCodeType_DllAPI __declspec( dllexport ) +#else +#define CauseCodeType_DllAPI __declspec( dllimport ) +#endif // CauseCodeType_SOURCE +#else +#define CauseCodeType_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CauseCodeType_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace CauseCodeType_Constants { + const uint8_t MIN = 0; + const uint8_t MAX = 255; + const uint8_t RESERVED = 0; + const uint8_t TRAFFIC_CONDITION = 1; + const uint8_t ACCIDENT = 2; + const uint8_t ROADWORKS = 3; + const uint8_t IMPASSABILITY = 5; + const uint8_t ADVERSE_WEATHER_CONDITION_ADHESION = 6; + const uint8_t AQUAPLANNNING = 7; + const uint8_t HAZARDOUS_LOCATION_SURFACE_CONDITION = 9; + const uint8_t HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD = 10; + const uint8_t HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD = 11; + const uint8_t HUMAN_PRESENCE_ON_THE_ROAD = 12; + const uint8_t WRONG_WAY_DRIVING = 14; + const uint8_t RESCUE_AND_RECOVERY_WORK_IN_PROGRESS = 15; + const uint8_t ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION = 17; + const uint8_t ADVERSE_WEATHER_CONDITION_VISIBILITY = 18; + const uint8_t ADVERSE_WEATHER_CONDITION_PRECIPITATION = 19; + const uint8_t SLOW_VEHICLE = 26; + const uint8_t DANGEROUS_END_OF_QUEUE = 27; + const uint8_t VEHICLE_BREAKDOWN = 91; + const uint8_t POST_CRASH = 92; + const uint8_t HUMAN_PROBLEM = 93; + const uint8_t STATIONARY_VEHICLE = 94; + const uint8_t EMERGENCY_VEHICLE_APPROACHING = 95; + const uint8_t HAZARDOUS_LOCATION_DANGEROUS_CURVE = 96; + const uint8_t COLLISION_RISK = 97; + const uint8_t SIGNAL_VIOLATION = 98; + const uint8_t DANGEROUS_SITUATION = 99; + } // namespace CauseCodeType_Constants + /*! + * @brief This class represents the structure CauseCodeType defined by the user in the IDL file. + * @ingroup CAUSECODETYPE + */ + class CauseCodeType + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CauseCodeType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CauseCodeType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. + */ + eProsima_user_DllExport CauseCodeType( + const CauseCodeType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. + */ + eProsima_user_DllExport CauseCodeType( + CauseCodeType&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. + */ + eProsima_user_DllExport CauseCodeType& operator =( + const CauseCodeType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. + */ + eProsima_user_DllExport CauseCodeType& operator =( + CauseCodeType&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CauseCodeType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CauseCodeType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CauseCodeType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CauseCodeType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CauseCodeType& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.cxx new file mode 100644 index 00000000000..fb783704eb1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.cxx @@ -0,0 +1,208 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodeTypePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CauseCodeTypePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace CauseCodeType_Constants { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } //End of namespace CauseCodeType_Constants + CauseCodeTypePubSubType::CauseCodeTypePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CauseCodeType_"); + auto type_size = CauseCodeType::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CauseCodeType::isKeyDefined(); + size_t keyLength = CauseCodeType::getKeyMaxCdrSerializedSize() > 16 ? + CauseCodeType::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CauseCodeTypePubSubType::~CauseCodeTypePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CauseCodeTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CauseCodeType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CauseCodeTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CauseCodeType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CauseCodeTypePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CauseCodeTypePubSubType::createData() + { + return reinterpret_cast(new CauseCodeType()); + } + + void CauseCodeTypePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CauseCodeTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CauseCodeType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CauseCodeType::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CauseCodeType::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.h new file mode 100644 index 00000000000..d4850117008 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.h @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodeTypePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_PUBSUBTYPES_H_ + +#include +#include + +#include "CauseCodeType.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CauseCodeType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace CauseCodeType_Constants + { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type CauseCodeType defined by the user in the IDL file. + * @ingroup CAUSECODETYPE + */ + class CauseCodeTypePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CauseCodeType type; + + eProsima_user_DllExport CauseCodeTypePubSubType(); + + eProsima_user_DllExport virtual ~CauseCodeTypePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CauseCodeType(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.cxx new file mode 100644 index 00000000000..4e4ec3a12c9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.cxx @@ -0,0 +1,329 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZone.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CenDsrcTollingZone.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::CenDsrcTollingZone::CenDsrcTollingZone() +{ + // m_protected_zone_latitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3a627c80 + + // m_protected_zone_longitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@49aa766b + + // m_cen_dsrc_tolling_zone_id com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@963176 + + // m_cen_dsrc_tolling_zone_id_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@65004ff6 + m_cen_dsrc_tolling_zone_id_is_present = false; + +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZone::~CenDsrcTollingZone() +{ + + + +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZone::CenDsrcTollingZone( + const CenDsrcTollingZone& x) +{ + m_protected_zone_latitude = x.m_protected_zone_latitude; + m_protected_zone_longitude = x.m_protected_zone_longitude; + m_cen_dsrc_tolling_zone_id = x.m_cen_dsrc_tolling_zone_id; + m_cen_dsrc_tolling_zone_id_is_present = x.m_cen_dsrc_tolling_zone_id_is_present; +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZone::CenDsrcTollingZone( + CenDsrcTollingZone&& x) +{ + m_protected_zone_latitude = std::move(x.m_protected_zone_latitude); + m_protected_zone_longitude = std::move(x.m_protected_zone_longitude); + m_cen_dsrc_tolling_zone_id = std::move(x.m_cen_dsrc_tolling_zone_id); + m_cen_dsrc_tolling_zone_id_is_present = x.m_cen_dsrc_tolling_zone_id_is_present; +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::CenDsrcTollingZone::operator =( + const CenDsrcTollingZone& x) +{ + + m_protected_zone_latitude = x.m_protected_zone_latitude; + m_protected_zone_longitude = x.m_protected_zone_longitude; + m_cen_dsrc_tolling_zone_id = x.m_cen_dsrc_tolling_zone_id; + m_cen_dsrc_tolling_zone_id_is_present = x.m_cen_dsrc_tolling_zone_id_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::CenDsrcTollingZone::operator =( + CenDsrcTollingZone&& x) +{ + + m_protected_zone_latitude = std::move(x.m_protected_zone_latitude); + m_protected_zone_longitude = std::move(x.m_protected_zone_longitude); + m_cen_dsrc_tolling_zone_id = std::move(x.m_cen_dsrc_tolling_zone_id); + m_cen_dsrc_tolling_zone_id_is_present = x.m_cen_dsrc_tolling_zone_id_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::operator ==( + const CenDsrcTollingZone& x) const +{ + + return (m_protected_zone_latitude == x.m_protected_zone_latitude && m_protected_zone_longitude == x.m_protected_zone_longitude && m_cen_dsrc_tolling_zone_id == x.m_cen_dsrc_tolling_zone_id && m_cen_dsrc_tolling_zone_id_is_present == x.m_cen_dsrc_tolling_zone_id_is_present); +} + +bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::operator !=( + const CenDsrcTollingZone& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CenDsrcTollingZone::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::Latitude::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Longitude::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CenDsrcTollingZone::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::Latitude::getCdrSerializedSize(data.protected_zone_latitude(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Longitude::getCdrSerializedSize(data.protected_zone_longitude(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getCdrSerializedSize(data.cen_dsrc_tolling_zone_id(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_protected_zone_latitude; + scdr << m_protected_zone_longitude; + scdr << m_cen_dsrc_tolling_zone_id; + scdr << m_cen_dsrc_tolling_zone_id_is_present; + +} + +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_protected_zone_latitude; + dcdr >> m_protected_zone_longitude; + dcdr >> m_cen_dsrc_tolling_zone_id; + dcdr >> m_cen_dsrc_tolling_zone_id_is_present; +} + +/*! + * @brief This function copies the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude( + const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude) +{ + m_protected_zone_latitude = _protected_zone_latitude; +} + +/*! + * @brief This function moves the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude( + etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude) +{ + m_protected_zone_latitude = std::move(_protected_zone_latitude); +} + +/*! + * @brief This function returns a constant reference to member protected_zone_latitude + * @return Constant reference to member protected_zone_latitude + */ +const etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude() const +{ + return m_protected_zone_latitude; +} + +/*! + * @brief This function returns a reference to member protected_zone_latitude + * @return Reference to member protected_zone_latitude + */ +etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude() +{ + return m_protected_zone_latitude; +} +/*! + * @brief This function copies the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude( + const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude) +{ + m_protected_zone_longitude = _protected_zone_longitude; +} + +/*! + * @brief This function moves the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude( + etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude) +{ + m_protected_zone_longitude = std::move(_protected_zone_longitude); +} + +/*! + * @brief This function returns a constant reference to member protected_zone_longitude + * @return Constant reference to member protected_zone_longitude + */ +const etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude() const +{ + return m_protected_zone_longitude; +} + +/*! + * @brief This function returns a reference to member protected_zone_longitude + * @return Reference to member protected_zone_longitude + */ +etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude() +{ + return m_protected_zone_longitude; +} +/*! + * @brief This function copies the value in member cen_dsrc_tolling_zone_id + * @param _cen_dsrc_tolling_zone_id New value to be copied in member cen_dsrc_tolling_zone_id + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id( + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& _cen_dsrc_tolling_zone_id) +{ + m_cen_dsrc_tolling_zone_id = _cen_dsrc_tolling_zone_id; +} + +/*! + * @brief This function moves the value in member cen_dsrc_tolling_zone_id + * @param _cen_dsrc_tolling_zone_id New value to be moved in member cen_dsrc_tolling_zone_id + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id( + etsi_its_cam_msgs::msg::CenDsrcTollingZoneID&& _cen_dsrc_tolling_zone_id) +{ + m_cen_dsrc_tolling_zone_id = std::move(_cen_dsrc_tolling_zone_id); +} + +/*! + * @brief This function returns a constant reference to member cen_dsrc_tolling_zone_id + * @return Constant reference to member cen_dsrc_tolling_zone_id + */ +const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id() const +{ + return m_cen_dsrc_tolling_zone_id; +} + +/*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_id + * @return Reference to member cen_dsrc_tolling_zone_id + */ +etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id() +{ + return m_cen_dsrc_tolling_zone_id; +} +/*! + * @brief This function sets a value in member cen_dsrc_tolling_zone_id_is_present + * @param _cen_dsrc_tolling_zone_id_is_present New value for member cen_dsrc_tolling_zone_id_is_present + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present( + bool _cen_dsrc_tolling_zone_id_is_present) +{ + m_cen_dsrc_tolling_zone_id_is_present = _cen_dsrc_tolling_zone_id_is_present; +} + +/*! + * @brief This function returns the value of member cen_dsrc_tolling_zone_id_is_present + * @return Value of member cen_dsrc_tolling_zone_id_is_present + */ +bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present() const +{ + return m_cen_dsrc_tolling_zone_id_is_present; +} + +/*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_id_is_present + * @return Reference to member cen_dsrc_tolling_zone_id_is_present + */ +bool& etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present() +{ + return m_cen_dsrc_tolling_zone_id_is_present; +} + + +size_t etsi_its_cam_msgs::msg::CenDsrcTollingZone::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CenDsrcTollingZone::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.h new file mode 100644 index 00000000000..8ebadc85c1a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.h @@ -0,0 +1,291 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZone.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_H_ + +#include "CenDsrcTollingZoneID.h" +#include "Latitude.h" +#include "Longitude.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CenDsrcTollingZone_SOURCE) +#define CenDsrcTollingZone_DllAPI __declspec( dllexport ) +#else +#define CenDsrcTollingZone_DllAPI __declspec( dllimport ) +#endif // CenDsrcTollingZone_SOURCE +#else +#define CenDsrcTollingZone_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CenDsrcTollingZone_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure CenDsrcTollingZone defined by the user in the IDL file. + * @ingroup CENDSRCTOLLINGZONE + */ + class CenDsrcTollingZone + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CenDsrcTollingZone(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CenDsrcTollingZone(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZone( + const CenDsrcTollingZone& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZone( + CenDsrcTollingZone&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZone& operator =( + const CenDsrcTollingZone& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZone& operator =( + CenDsrcTollingZone&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZone object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CenDsrcTollingZone& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZone object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CenDsrcTollingZone& x) const; + + /*! + * @brief This function copies the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude + */ + eProsima_user_DllExport void protected_zone_latitude( + const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude); + + /*! + * @brief This function moves the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude + */ + eProsima_user_DllExport void protected_zone_latitude( + etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude); + + /*! + * @brief This function returns a constant reference to member protected_zone_latitude + * @return Constant reference to member protected_zone_latitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude() const; + + /*! + * @brief This function returns a reference to member protected_zone_latitude + * @return Reference to member protected_zone_latitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude(); + /*! + * @brief This function copies the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude + */ + eProsima_user_DllExport void protected_zone_longitude( + const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude); + + /*! + * @brief This function moves the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude + */ + eProsima_user_DllExport void protected_zone_longitude( + etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude); + + /*! + * @brief This function returns a constant reference to member protected_zone_longitude + * @return Constant reference to member protected_zone_longitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude() const; + + /*! + * @brief This function returns a reference to member protected_zone_longitude + * @return Reference to member protected_zone_longitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude(); + /*! + * @brief This function copies the value in member cen_dsrc_tolling_zone_id + * @param _cen_dsrc_tolling_zone_id New value to be copied in member cen_dsrc_tolling_zone_id + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone_id( + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& _cen_dsrc_tolling_zone_id); + + /*! + * @brief This function moves the value in member cen_dsrc_tolling_zone_id + * @param _cen_dsrc_tolling_zone_id New value to be moved in member cen_dsrc_tolling_zone_id + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone_id( + etsi_its_cam_msgs::msg::CenDsrcTollingZoneID&& _cen_dsrc_tolling_zone_id); + + /*! + * @brief This function returns a constant reference to member cen_dsrc_tolling_zone_id + * @return Constant reference to member cen_dsrc_tolling_zone_id + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& cen_dsrc_tolling_zone_id() const; + + /*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_id + * @return Reference to member cen_dsrc_tolling_zone_id + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& cen_dsrc_tolling_zone_id(); + /*! + * @brief This function sets a value in member cen_dsrc_tolling_zone_id_is_present + * @param _cen_dsrc_tolling_zone_id_is_present New value for member cen_dsrc_tolling_zone_id_is_present + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone_id_is_present( + bool _cen_dsrc_tolling_zone_id_is_present); + + /*! + * @brief This function returns the value of member cen_dsrc_tolling_zone_id_is_present + * @return Value of member cen_dsrc_tolling_zone_id_is_present + */ + eProsima_user_DllExport bool cen_dsrc_tolling_zone_id_is_present() const; + + /*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_id_is_present + * @return Reference to member cen_dsrc_tolling_zone_id_is_present + */ + eProsima_user_DllExport bool& cen_dsrc_tolling_zone_id_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::Latitude m_protected_zone_latitude; + etsi_its_cam_msgs::msg::Longitude m_protected_zone_longitude; + etsi_its_cam_msgs::msg::CenDsrcTollingZoneID m_cen_dsrc_tolling_zone_id; + bool m_cen_dsrc_tolling_zone_id_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.cxx new file mode 100644 index 00000000000..ccaaca96dbd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.cxx @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZoneID.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CenDsrcTollingZoneID.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::CenDsrcTollingZoneID() +{ + // m_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@415156bf + + +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::~CenDsrcTollingZoneID() +{ +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::CenDsrcTollingZoneID( + const CenDsrcTollingZoneID& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::CenDsrcTollingZoneID( + CenDsrcTollingZoneID&& x) +{ + m_value = std::move(x.m_value); +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::operator =( + const CenDsrcTollingZoneID& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::operator =( + CenDsrcTollingZoneID&& x) +{ + + m_value = std::move(x.m_value); + + return *this; +} + +bool etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::operator ==( + const CenDsrcTollingZoneID& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::operator !=( + const CenDsrcTollingZoneID& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneID::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneID::getCdrSerializedSize(data.value(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value( + const etsi_its_cam_msgs::msg::ProtectedZoneID& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value( + etsi_its_cam_msgs::msg::ProtectedZoneID&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value() +{ + return m_value; +} + +size_t etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.h new file mode 100644 index 00000000000..e12abfd73e2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZoneID.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_H_ + +#include "ProtectedZoneID.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CenDsrcTollingZoneID_SOURCE) +#define CenDsrcTollingZoneID_DllAPI __declspec( dllexport ) +#else +#define CenDsrcTollingZoneID_DllAPI __declspec( dllimport ) +#endif // CenDsrcTollingZoneID_SOURCE +#else +#define CenDsrcTollingZoneID_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CenDsrcTollingZoneID_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure CenDsrcTollingZoneID defined by the user in the IDL file. + * @ingroup CENDSRCTOLLINGZONEID + */ + class CenDsrcTollingZoneID + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CenDsrcTollingZoneID(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CenDsrcTollingZoneID(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZoneID( + const CenDsrcTollingZoneID& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZoneID( + CenDsrcTollingZoneID&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZoneID& operator =( + const CenDsrcTollingZoneID& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZoneID& operator =( + CenDsrcTollingZoneID&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZoneID object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CenDsrcTollingZoneID& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZoneID object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CenDsrcTollingZoneID& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const etsi_its_cam_msgs::msg::ProtectedZoneID& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + etsi_its_cam_msgs::msg::ProtectedZoneID&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneID& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneID& value(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::ProtectedZoneID m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.cxx new file mode 100644 index 00000000000..e8ee768751f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZoneIDPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CenDsrcTollingZoneIDPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + CenDsrcTollingZoneIDPubSubType::CenDsrcTollingZoneIDPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CenDsrcTollingZoneID_"); + auto type_size = CenDsrcTollingZoneID::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CenDsrcTollingZoneID::isKeyDefined(); + size_t keyLength = CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize() > 16 ? + CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CenDsrcTollingZoneIDPubSubType::~CenDsrcTollingZoneIDPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CenDsrcTollingZoneIDPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CenDsrcTollingZoneID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CenDsrcTollingZoneIDPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CenDsrcTollingZoneID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CenDsrcTollingZoneIDPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CenDsrcTollingZoneIDPubSubType::createData() + { + return reinterpret_cast(new CenDsrcTollingZoneID()); + } + + void CenDsrcTollingZoneIDPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CenDsrcTollingZoneIDPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CenDsrcTollingZoneID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.h new file mode 100644 index 00000000000..0344ef1440d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZoneIDPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_PUBSUBTYPES_H_ + +#include +#include + +#include "CenDsrcTollingZoneID.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CenDsrcTollingZoneID is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CenDsrcTollingZoneID defined by the user in the IDL file. + * @ingroup CENDSRCTOLLINGZONEID + */ + class CenDsrcTollingZoneIDPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CenDsrcTollingZoneID type; + + eProsima_user_DllExport CenDsrcTollingZoneIDPubSubType(); + + eProsima_user_DllExport virtual ~CenDsrcTollingZoneIDPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CenDsrcTollingZoneID(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.cxx new file mode 100644 index 00000000000..bd71435e5d0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZonePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CenDsrcTollingZonePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + CenDsrcTollingZonePubSubType::CenDsrcTollingZonePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CenDsrcTollingZone_"); + auto type_size = CenDsrcTollingZone::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CenDsrcTollingZone::isKeyDefined(); + size_t keyLength = CenDsrcTollingZone::getKeyMaxCdrSerializedSize() > 16 ? + CenDsrcTollingZone::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CenDsrcTollingZonePubSubType::~CenDsrcTollingZonePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CenDsrcTollingZonePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CenDsrcTollingZone* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CenDsrcTollingZonePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CenDsrcTollingZone* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CenDsrcTollingZonePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CenDsrcTollingZonePubSubType::createData() + { + return reinterpret_cast(new CenDsrcTollingZone()); + } + + void CenDsrcTollingZonePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CenDsrcTollingZonePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CenDsrcTollingZone* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CenDsrcTollingZone::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CenDsrcTollingZone::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.h new file mode 100644 index 00000000000..30e07101f51 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZonePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_PUBSUBTYPES_H_ + +#include +#include + +#include "CenDsrcTollingZone.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CenDsrcTollingZone is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type CenDsrcTollingZone defined by the user in the IDL file. + * @ingroup CENDSRCTOLLINGZONE + */ + class CenDsrcTollingZonePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CenDsrcTollingZone type; + + eProsima_user_DllExport CenDsrcTollingZonePubSubType(); + + eProsima_user_DllExport virtual ~CenDsrcTollingZonePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CenDsrcTollingZone(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.cxx new file mode 100644 index 00000000000..25702357b44 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.cxx @@ -0,0 +1,415 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ClosedLanes.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ClosedLanes.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::ClosedLanes::ClosedLanes() +{ + // m_innerhard_shoulder_status com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@841e575 + + // m_innerhard_shoulder_status_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27a5328c + m_innerhard_shoulder_status_is_present = false; + // m_outerhard_shoulder_status com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@841e575 + + // m_outerhard_shoulder_status_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e5f4170 + m_outerhard_shoulder_status_is_present = false; + // m_driving_lane_status com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6c345c5f + + // m_driving_lane_status_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6b5966e1 + m_driving_lane_status_is_present = false; + +} + +etsi_its_cam_msgs::msg::ClosedLanes::~ClosedLanes() +{ + + + + + +} + +etsi_its_cam_msgs::msg::ClosedLanes::ClosedLanes( + const ClosedLanes& x) +{ + m_innerhard_shoulder_status = x.m_innerhard_shoulder_status; + m_innerhard_shoulder_status_is_present = x.m_innerhard_shoulder_status_is_present; + m_outerhard_shoulder_status = x.m_outerhard_shoulder_status; + m_outerhard_shoulder_status_is_present = x.m_outerhard_shoulder_status_is_present; + m_driving_lane_status = x.m_driving_lane_status; + m_driving_lane_status_is_present = x.m_driving_lane_status_is_present; +} + +etsi_its_cam_msgs::msg::ClosedLanes::ClosedLanes( + ClosedLanes&& x) +{ + m_innerhard_shoulder_status = std::move(x.m_innerhard_shoulder_status); + m_innerhard_shoulder_status_is_present = x.m_innerhard_shoulder_status_is_present; + m_outerhard_shoulder_status = std::move(x.m_outerhard_shoulder_status); + m_outerhard_shoulder_status_is_present = x.m_outerhard_shoulder_status_is_present; + m_driving_lane_status = std::move(x.m_driving_lane_status); + m_driving_lane_status_is_present = x.m_driving_lane_status_is_present; +} + +etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::ClosedLanes::operator =( + const ClosedLanes& x) +{ + + m_innerhard_shoulder_status = x.m_innerhard_shoulder_status; + m_innerhard_shoulder_status_is_present = x.m_innerhard_shoulder_status_is_present; + m_outerhard_shoulder_status = x.m_outerhard_shoulder_status; + m_outerhard_shoulder_status_is_present = x.m_outerhard_shoulder_status_is_present; + m_driving_lane_status = x.m_driving_lane_status; + m_driving_lane_status_is_present = x.m_driving_lane_status_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::ClosedLanes::operator =( + ClosedLanes&& x) +{ + + m_innerhard_shoulder_status = std::move(x.m_innerhard_shoulder_status); + m_innerhard_shoulder_status_is_present = x.m_innerhard_shoulder_status_is_present; + m_outerhard_shoulder_status = std::move(x.m_outerhard_shoulder_status); + m_outerhard_shoulder_status_is_present = x.m_outerhard_shoulder_status_is_present; + m_driving_lane_status = std::move(x.m_driving_lane_status); + m_driving_lane_status_is_present = x.m_driving_lane_status_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::ClosedLanes::operator ==( + const ClosedLanes& x) const +{ + + return (m_innerhard_shoulder_status == x.m_innerhard_shoulder_status && m_innerhard_shoulder_status_is_present == x.m_innerhard_shoulder_status_is_present && m_outerhard_shoulder_status == x.m_outerhard_shoulder_status && m_outerhard_shoulder_status_is_present == x.m_outerhard_shoulder_status_is_present && m_driving_lane_status == x.m_driving_lane_status && m_driving_lane_status_is_present == x.m_driving_lane_status_is_present); +} + +bool etsi_its_cam_msgs::msg::ClosedLanes::operator !=( + const ClosedLanes& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ClosedLanes::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::HardShoulderStatus::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::HardShoulderStatus::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::DrivingLaneStatus::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ClosedLanes::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ClosedLanes& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::HardShoulderStatus::getCdrSerializedSize(data.innerhard_shoulder_status(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::HardShoulderStatus::getCdrSerializedSize(data.outerhard_shoulder_status(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::DrivingLaneStatus::getCdrSerializedSize(data.driving_lane_status(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ClosedLanes::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_innerhard_shoulder_status; + scdr << m_innerhard_shoulder_status_is_present; + scdr << m_outerhard_shoulder_status; + scdr << m_outerhard_shoulder_status_is_present; + scdr << m_driving_lane_status; + scdr << m_driving_lane_status_is_present; + +} + +void etsi_its_cam_msgs::msg::ClosedLanes::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_innerhard_shoulder_status; + dcdr >> m_innerhard_shoulder_status_is_present; + dcdr >> m_outerhard_shoulder_status; + dcdr >> m_outerhard_shoulder_status_is_present; + dcdr >> m_driving_lane_status; + dcdr >> m_driving_lane_status_is_present; +} + +/*! + * @brief This function copies the value in member innerhard_shoulder_status + * @param _innerhard_shoulder_status New value to be copied in member innerhard_shoulder_status + */ +void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status( + const etsi_its_cam_msgs::msg::HardShoulderStatus& _innerhard_shoulder_status) +{ + m_innerhard_shoulder_status = _innerhard_shoulder_status; +} + +/*! + * @brief This function moves the value in member innerhard_shoulder_status + * @param _innerhard_shoulder_status New value to be moved in member innerhard_shoulder_status + */ +void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status( + etsi_its_cam_msgs::msg::HardShoulderStatus&& _innerhard_shoulder_status) +{ + m_innerhard_shoulder_status = std::move(_innerhard_shoulder_status); +} + +/*! + * @brief This function returns a constant reference to member innerhard_shoulder_status + * @return Constant reference to member innerhard_shoulder_status + */ +const etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status() const +{ + return m_innerhard_shoulder_status; +} + +/*! + * @brief This function returns a reference to member innerhard_shoulder_status + * @return Reference to member innerhard_shoulder_status + */ +etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status() +{ + return m_innerhard_shoulder_status; +} +/*! + * @brief This function sets a value in member innerhard_shoulder_status_is_present + * @param _innerhard_shoulder_status_is_present New value for member innerhard_shoulder_status_is_present + */ +void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status_is_present( + bool _innerhard_shoulder_status_is_present) +{ + m_innerhard_shoulder_status_is_present = _innerhard_shoulder_status_is_present; +} + +/*! + * @brief This function returns the value of member innerhard_shoulder_status_is_present + * @return Value of member innerhard_shoulder_status_is_present + */ +bool etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status_is_present() const +{ + return m_innerhard_shoulder_status_is_present; +} + +/*! + * @brief This function returns a reference to member innerhard_shoulder_status_is_present + * @return Reference to member innerhard_shoulder_status_is_present + */ +bool& etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status_is_present() +{ + return m_innerhard_shoulder_status_is_present; +} + +/*! + * @brief This function copies the value in member outerhard_shoulder_status + * @param _outerhard_shoulder_status New value to be copied in member outerhard_shoulder_status + */ +void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status( + const etsi_its_cam_msgs::msg::HardShoulderStatus& _outerhard_shoulder_status) +{ + m_outerhard_shoulder_status = _outerhard_shoulder_status; +} + +/*! + * @brief This function moves the value in member outerhard_shoulder_status + * @param _outerhard_shoulder_status New value to be moved in member outerhard_shoulder_status + */ +void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status( + etsi_its_cam_msgs::msg::HardShoulderStatus&& _outerhard_shoulder_status) +{ + m_outerhard_shoulder_status = std::move(_outerhard_shoulder_status); +} + +/*! + * @brief This function returns a constant reference to member outerhard_shoulder_status + * @return Constant reference to member outerhard_shoulder_status + */ +const etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status() const +{ + return m_outerhard_shoulder_status; +} + +/*! + * @brief This function returns a reference to member outerhard_shoulder_status + * @return Reference to member outerhard_shoulder_status + */ +etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status() +{ + return m_outerhard_shoulder_status; +} +/*! + * @brief This function sets a value in member outerhard_shoulder_status_is_present + * @param _outerhard_shoulder_status_is_present New value for member outerhard_shoulder_status_is_present + */ +void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status_is_present( + bool _outerhard_shoulder_status_is_present) +{ + m_outerhard_shoulder_status_is_present = _outerhard_shoulder_status_is_present; +} + +/*! + * @brief This function returns the value of member outerhard_shoulder_status_is_present + * @return Value of member outerhard_shoulder_status_is_present + */ +bool etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status_is_present() const +{ + return m_outerhard_shoulder_status_is_present; +} + +/*! + * @brief This function returns a reference to member outerhard_shoulder_status_is_present + * @return Reference to member outerhard_shoulder_status_is_present + */ +bool& etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status_is_present() +{ + return m_outerhard_shoulder_status_is_present; +} + +/*! + * @brief This function copies the value in member driving_lane_status + * @param _driving_lane_status New value to be copied in member driving_lane_status + */ +void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status( + const etsi_its_cam_msgs::msg::DrivingLaneStatus& _driving_lane_status) +{ + m_driving_lane_status = _driving_lane_status; +} + +/*! + * @brief This function moves the value in member driving_lane_status + * @param _driving_lane_status New value to be moved in member driving_lane_status + */ +void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status( + etsi_its_cam_msgs::msg::DrivingLaneStatus&& _driving_lane_status) +{ + m_driving_lane_status = std::move(_driving_lane_status); +} + +/*! + * @brief This function returns a constant reference to member driving_lane_status + * @return Constant reference to member driving_lane_status + */ +const etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status() const +{ + return m_driving_lane_status; +} + +/*! + * @brief This function returns a reference to member driving_lane_status + * @return Reference to member driving_lane_status + */ +etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status() +{ + return m_driving_lane_status; +} +/*! + * @brief This function sets a value in member driving_lane_status_is_present + * @param _driving_lane_status_is_present New value for member driving_lane_status_is_present + */ +void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status_is_present( + bool _driving_lane_status_is_present) +{ + m_driving_lane_status_is_present = _driving_lane_status_is_present; +} + +/*! + * @brief This function returns the value of member driving_lane_status_is_present + * @return Value of member driving_lane_status_is_present + */ +bool etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status_is_present() const +{ + return m_driving_lane_status_is_present; +} + +/*! + * @brief This function returns a reference to member driving_lane_status_is_present + * @return Reference to member driving_lane_status_is_present + */ +bool& etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status_is_present() +{ + return m_driving_lane_status_is_present; +} + + +size_t etsi_its_cam_msgs::msg::ClosedLanes::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ClosedLanes::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ClosedLanes::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.h new file mode 100644 index 00000000000..5695fa93c41 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.h @@ -0,0 +1,330 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ClosedLanes.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_H_ + +#include "HardShoulderStatus.h" +#include "DrivingLaneStatus.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ClosedLanes_SOURCE) +#define ClosedLanes_DllAPI __declspec( dllexport ) +#else +#define ClosedLanes_DllAPI __declspec( dllimport ) +#endif // ClosedLanes_SOURCE +#else +#define ClosedLanes_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ClosedLanes_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure ClosedLanes defined by the user in the IDL file. + * @ingroup CLOSEDLANES + */ + class ClosedLanes + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ClosedLanes(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ClosedLanes(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. + */ + eProsima_user_DllExport ClosedLanes( + const ClosedLanes& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. + */ + eProsima_user_DllExport ClosedLanes( + ClosedLanes&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. + */ + eProsima_user_DllExport ClosedLanes& operator =( + const ClosedLanes& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. + */ + eProsima_user_DllExport ClosedLanes& operator =( + ClosedLanes&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ClosedLanes object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ClosedLanes& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ClosedLanes object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ClosedLanes& x) const; + + /*! + * @brief This function copies the value in member innerhard_shoulder_status + * @param _innerhard_shoulder_status New value to be copied in member innerhard_shoulder_status + */ + eProsima_user_DllExport void innerhard_shoulder_status( + const etsi_its_cam_msgs::msg::HardShoulderStatus& _innerhard_shoulder_status); + + /*! + * @brief This function moves the value in member innerhard_shoulder_status + * @param _innerhard_shoulder_status New value to be moved in member innerhard_shoulder_status + */ + eProsima_user_DllExport void innerhard_shoulder_status( + etsi_its_cam_msgs::msg::HardShoulderStatus&& _innerhard_shoulder_status); + + /*! + * @brief This function returns a constant reference to member innerhard_shoulder_status + * @return Constant reference to member innerhard_shoulder_status + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HardShoulderStatus& innerhard_shoulder_status() const; + + /*! + * @brief This function returns a reference to member innerhard_shoulder_status + * @return Reference to member innerhard_shoulder_status + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HardShoulderStatus& innerhard_shoulder_status(); + /*! + * @brief This function sets a value in member innerhard_shoulder_status_is_present + * @param _innerhard_shoulder_status_is_present New value for member innerhard_shoulder_status_is_present + */ + eProsima_user_DllExport void innerhard_shoulder_status_is_present( + bool _innerhard_shoulder_status_is_present); + + /*! + * @brief This function returns the value of member innerhard_shoulder_status_is_present + * @return Value of member innerhard_shoulder_status_is_present + */ + eProsima_user_DllExport bool innerhard_shoulder_status_is_present() const; + + /*! + * @brief This function returns a reference to member innerhard_shoulder_status_is_present + * @return Reference to member innerhard_shoulder_status_is_present + */ + eProsima_user_DllExport bool& innerhard_shoulder_status_is_present(); + + /*! + * @brief This function copies the value in member outerhard_shoulder_status + * @param _outerhard_shoulder_status New value to be copied in member outerhard_shoulder_status + */ + eProsima_user_DllExport void outerhard_shoulder_status( + const etsi_its_cam_msgs::msg::HardShoulderStatus& _outerhard_shoulder_status); + + /*! + * @brief This function moves the value in member outerhard_shoulder_status + * @param _outerhard_shoulder_status New value to be moved in member outerhard_shoulder_status + */ + eProsima_user_DllExport void outerhard_shoulder_status( + etsi_its_cam_msgs::msg::HardShoulderStatus&& _outerhard_shoulder_status); + + /*! + * @brief This function returns a constant reference to member outerhard_shoulder_status + * @return Constant reference to member outerhard_shoulder_status + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HardShoulderStatus& outerhard_shoulder_status() const; + + /*! + * @brief This function returns a reference to member outerhard_shoulder_status + * @return Reference to member outerhard_shoulder_status + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HardShoulderStatus& outerhard_shoulder_status(); + /*! + * @brief This function sets a value in member outerhard_shoulder_status_is_present + * @param _outerhard_shoulder_status_is_present New value for member outerhard_shoulder_status_is_present + */ + eProsima_user_DllExport void outerhard_shoulder_status_is_present( + bool _outerhard_shoulder_status_is_present); + + /*! + * @brief This function returns the value of member outerhard_shoulder_status_is_present + * @return Value of member outerhard_shoulder_status_is_present + */ + eProsima_user_DllExport bool outerhard_shoulder_status_is_present() const; + + /*! + * @brief This function returns a reference to member outerhard_shoulder_status_is_present + * @return Reference to member outerhard_shoulder_status_is_present + */ + eProsima_user_DllExport bool& outerhard_shoulder_status_is_present(); + + /*! + * @brief This function copies the value in member driving_lane_status + * @param _driving_lane_status New value to be copied in member driving_lane_status + */ + eProsima_user_DllExport void driving_lane_status( + const etsi_its_cam_msgs::msg::DrivingLaneStatus& _driving_lane_status); + + /*! + * @brief This function moves the value in member driving_lane_status + * @param _driving_lane_status New value to be moved in member driving_lane_status + */ + eProsima_user_DllExport void driving_lane_status( + etsi_its_cam_msgs::msg::DrivingLaneStatus&& _driving_lane_status); + + /*! + * @brief This function returns a constant reference to member driving_lane_status + * @return Constant reference to member driving_lane_status + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DrivingLaneStatus& driving_lane_status() const; + + /*! + * @brief This function returns a reference to member driving_lane_status + * @return Reference to member driving_lane_status + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DrivingLaneStatus& driving_lane_status(); + /*! + * @brief This function sets a value in member driving_lane_status_is_present + * @param _driving_lane_status_is_present New value for member driving_lane_status_is_present + */ + eProsima_user_DllExport void driving_lane_status_is_present( + bool _driving_lane_status_is_present); + + /*! + * @brief This function returns the value of member driving_lane_status_is_present + * @return Value of member driving_lane_status_is_present + */ + eProsima_user_DllExport bool driving_lane_status_is_present() const; + + /*! + * @brief This function returns a reference to member driving_lane_status_is_present + * @return Reference to member driving_lane_status_is_present + */ + eProsima_user_DllExport bool& driving_lane_status_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ClosedLanes& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::HardShoulderStatus m_innerhard_shoulder_status; + bool m_innerhard_shoulder_status_is_present; + etsi_its_cam_msgs::msg::HardShoulderStatus m_outerhard_shoulder_status; + bool m_outerhard_shoulder_status_is_present; + etsi_its_cam_msgs::msg::DrivingLaneStatus m_driving_lane_status; + bool m_driving_lane_status_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.cxx new file mode 100644 index 00000000000..e9942e6527e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ClosedLanesPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ClosedLanesPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + ClosedLanesPubSubType::ClosedLanesPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ClosedLanes_"); + auto type_size = ClosedLanes::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ClosedLanes::isKeyDefined(); + size_t keyLength = ClosedLanes::getKeyMaxCdrSerializedSize() > 16 ? + ClosedLanes::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ClosedLanesPubSubType::~ClosedLanesPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ClosedLanesPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ClosedLanes* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ClosedLanesPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ClosedLanes* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ClosedLanesPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ClosedLanesPubSubType::createData() + { + return reinterpret_cast(new ClosedLanes()); + } + + void ClosedLanesPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ClosedLanesPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ClosedLanes* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ClosedLanes::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ClosedLanes::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/types/PointCloud2PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.h similarity index 79% rename from LibCarla/source/carla/ros2/types/PointCloud2PubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.h index 3fe6150ed01..688689788fe 100644 --- a/LibCarla/source/carla/ros2/types/PointCloud2PubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.h @@ -13,46 +13,43 @@ // limitations under the License. /*! - * @file PointCloud2PubSubTypes.h + * @file ClosedLanesPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_PUBSUBTYPES_H_ #include #include -#include "PointCloud2.h" - -#include "HeaderPubSubTypes.h" -#include "PointFieldPubSubTypes.h" +#include "ClosedLanes.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated PointCloud2 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated ClosedLanes is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace sensor_msgs +namespace etsi_its_cam_msgs { namespace msg { - /*! - * @brief This class represents the TopicDataType of the type PointCloud2 defined by the user in the IDL file. - * @ingroup POINTCLOUD2 + * @brief This class represents the TopicDataType of the type ClosedLanes defined by the user in the IDL file. + * @ingroup CLOSEDLANES */ - class PointCloud2PubSubType : public eprosima::fastdds::dds::TopicDataType + class ClosedLanesPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef PointCloud2 type; + typedef ClosedLanes type; - eProsima_user_DllExport PointCloud2PubSubType(); + eProsima_user_DllExport ClosedLanesPubSubType(); - eProsima_user_DllExport virtual ~PointCloud2PubSubType() override; + eProsima_user_DllExport virtual ~ClosedLanesPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -100,10 +97,11 @@ namespace sensor_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.cxx new file mode 100644 index 00000000000..27559cd96df --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CoopAwareness.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CoopAwareness.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::CoopAwareness::CoopAwareness() +{ + // m_generation_delta_time com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@29e6eb25 + + // m_cam_parameters com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@62435e70 + + +} + +etsi_its_cam_msgs::msg::CoopAwareness::~CoopAwareness() +{ + +} + +etsi_its_cam_msgs::msg::CoopAwareness::CoopAwareness( + const CoopAwareness& x) +{ + m_generation_delta_time = x.m_generation_delta_time; + m_cam_parameters = x.m_cam_parameters; +} + +etsi_its_cam_msgs::msg::CoopAwareness::CoopAwareness( + CoopAwareness&& x) +{ + m_generation_delta_time = std::move(x.m_generation_delta_time); + m_cam_parameters = std::move(x.m_cam_parameters); +} + +etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CoopAwareness::operator =( + const CoopAwareness& x) +{ + + m_generation_delta_time = x.m_generation_delta_time; + m_cam_parameters = x.m_cam_parameters; + + return *this; +} + +etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CoopAwareness::operator =( + CoopAwareness&& x) +{ + + m_generation_delta_time = std::move(x.m_generation_delta_time); + m_cam_parameters = std::move(x.m_cam_parameters); + + return *this; +} + +bool etsi_its_cam_msgs::msg::CoopAwareness::operator ==( + const CoopAwareness& x) const +{ + + return (m_generation_delta_time == x.m_generation_delta_time && m_cam_parameters == x.m_cam_parameters); +} + +bool etsi_its_cam_msgs::msg::CoopAwareness::operator !=( + const CoopAwareness& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CoopAwareness::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::GenerationDeltaTime::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CamParameters::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CoopAwareness::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CoopAwareness& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::GenerationDeltaTime::getCdrSerializedSize(data.generation_delta_time(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CamParameters::getCdrSerializedSize(data.cam_parameters(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CoopAwareness::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_generation_delta_time; + scdr << m_cam_parameters; + +} + +void etsi_its_cam_msgs::msg::CoopAwareness::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_generation_delta_time; + dcdr >> m_cam_parameters; +} + +/*! + * @brief This function copies the value in member generation_delta_time + * @param _generation_delta_time New value to be copied in member generation_delta_time + */ +void etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time( + const etsi_its_cam_msgs::msg::GenerationDeltaTime& _generation_delta_time) +{ + m_generation_delta_time = _generation_delta_time; +} + +/*! + * @brief This function moves the value in member generation_delta_time + * @param _generation_delta_time New value to be moved in member generation_delta_time + */ +void etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time( + etsi_its_cam_msgs::msg::GenerationDeltaTime&& _generation_delta_time) +{ + m_generation_delta_time = std::move(_generation_delta_time); +} + +/*! + * @brief This function returns a constant reference to member generation_delta_time + * @return Constant reference to member generation_delta_time + */ +const etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time() const +{ + return m_generation_delta_time; +} + +/*! + * @brief This function returns a reference to member generation_delta_time + * @return Reference to member generation_delta_time + */ +etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time() +{ + return m_generation_delta_time; +} +/*! + * @brief This function copies the value in member cam_parameters + * @param _cam_parameters New value to be copied in member cam_parameters + */ +void etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters( + const etsi_its_cam_msgs::msg::CamParameters& _cam_parameters) +{ + m_cam_parameters = _cam_parameters; +} + +/*! + * @brief This function moves the value in member cam_parameters + * @param _cam_parameters New value to be moved in member cam_parameters + */ +void etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters( + etsi_its_cam_msgs::msg::CamParameters&& _cam_parameters) +{ + m_cam_parameters = std::move(_cam_parameters); +} + +/*! + * @brief This function returns a constant reference to member cam_parameters + * @return Constant reference to member cam_parameters + */ +const etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters() const +{ + return m_cam_parameters; +} + +/*! + * @brief This function returns a reference to member cam_parameters + * @return Reference to member cam_parameters + */ +etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters() +{ + return m_cam_parameters; +} + +size_t etsi_its_cam_msgs::msg::CoopAwareness::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CoopAwareness::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CoopAwareness::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.h new file mode 100644 index 00000000000..4b2bd951271 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CoopAwareness.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_H_ + +#include "GenerationDeltaTime.h" +#include "CamParameters.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CoopAwareness_SOURCE) +#define CoopAwareness_DllAPI __declspec( dllexport ) +#else +#define CoopAwareness_DllAPI __declspec( dllimport ) +#endif // CoopAwareness_SOURCE +#else +#define CoopAwareness_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CoopAwareness_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure CoopAwareness defined by the user in the IDL file. + * @ingroup COOPAWARENESS + */ + class CoopAwareness + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CoopAwareness(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CoopAwareness(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. + */ + eProsima_user_DllExport CoopAwareness( + const CoopAwareness& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. + */ + eProsima_user_DllExport CoopAwareness( + CoopAwareness&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. + */ + eProsima_user_DllExport CoopAwareness& operator =( + const CoopAwareness& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. + */ + eProsima_user_DllExport CoopAwareness& operator =( + CoopAwareness&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CoopAwareness object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CoopAwareness& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CoopAwareness object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CoopAwareness& x) const; + + /*! + * @brief This function copies the value in member generation_delta_time + * @param _generation_delta_time New value to be copied in member generation_delta_time + */ + eProsima_user_DllExport void generation_delta_time( + const etsi_its_cam_msgs::msg::GenerationDeltaTime& _generation_delta_time); + + /*! + * @brief This function moves the value in member generation_delta_time + * @param _generation_delta_time New value to be moved in member generation_delta_time + */ + eProsima_user_DllExport void generation_delta_time( + etsi_its_cam_msgs::msg::GenerationDeltaTime&& _generation_delta_time); + + /*! + * @brief This function returns a constant reference to member generation_delta_time + * @return Constant reference to member generation_delta_time + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::GenerationDeltaTime& generation_delta_time() const; + + /*! + * @brief This function returns a reference to member generation_delta_time + * @return Reference to member generation_delta_time + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::GenerationDeltaTime& generation_delta_time(); + /*! + * @brief This function copies the value in member cam_parameters + * @param _cam_parameters New value to be copied in member cam_parameters + */ + eProsima_user_DllExport void cam_parameters( + const etsi_its_cam_msgs::msg::CamParameters& _cam_parameters); + + /*! + * @brief This function moves the value in member cam_parameters + * @param _cam_parameters New value to be moved in member cam_parameters + */ + eProsima_user_DllExport void cam_parameters( + etsi_its_cam_msgs::msg::CamParameters&& _cam_parameters); + + /*! + * @brief This function returns a constant reference to member cam_parameters + * @return Constant reference to member cam_parameters + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CamParameters& cam_parameters() const; + + /*! + * @brief This function returns a reference to member cam_parameters + * @return Reference to member cam_parameters + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CamParameters& cam_parameters(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CoopAwareness& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::GenerationDeltaTime m_generation_delta_time; + etsi_its_cam_msgs::msg::CamParameters m_cam_parameters; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.cxx new file mode 100644 index 00000000000..8a736799ff5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CoopAwarenessPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CoopAwarenessPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + CoopAwarenessPubSubType::CoopAwarenessPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CoopAwareness_"); + auto type_size = CoopAwareness::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CoopAwareness::isKeyDefined(); + size_t keyLength = CoopAwareness::getKeyMaxCdrSerializedSize() > 16 ? + CoopAwareness::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CoopAwarenessPubSubType::~CoopAwarenessPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CoopAwarenessPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CoopAwareness* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CoopAwarenessPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CoopAwareness* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CoopAwarenessPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CoopAwarenessPubSubType::createData() + { + return reinterpret_cast(new CoopAwareness()); + } + + void CoopAwarenessPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CoopAwarenessPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CoopAwareness* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CoopAwareness::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CoopAwareness::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/types/StringPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.h similarity index 78% rename from LibCarla/source/carla/ros2/types/StringPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.h index 749abb654c6..d7144b56675 100644 --- a/LibCarla/source/carla/ros2/types/StringPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.h @@ -13,43 +13,43 @@ // limitations under the License. /*! - * @file StringPubSubTypes.h + * @file CoopAwarenessPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_PUBSUBTYPES_H_ #include #include -#include "String.h" +#include "CoopAwareness.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated String is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated CoopAwareness is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace std_msgs +namespace etsi_its_cam_msgs { namespace msg { - /*! - * @brief This class represents the TopicDataType of the type String defined by the user in the IDL file. - * @ingroup STRING + * @brief This class represents the TopicDataType of the type CoopAwareness defined by the user in the IDL file. + * @ingroup COOPAWARENESS */ - class StringPubSubType : public eprosima::fastdds::dds::TopicDataType + class CoopAwarenessPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef String type; + typedef CoopAwareness type; - eProsima_user_DllExport StringPubSubType(); + eProsima_user_DllExport CoopAwarenessPubSubType(); - eProsima_user_DllExport virtual ~StringPubSubType() override; + eProsima_user_DllExport virtual ~CoopAwarenessPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -97,10 +97,11 @@ namespace std_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.cxx new file mode 100644 index 00000000000..292a12a8223 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Curvature.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Curvature.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::Curvature::Curvature() +{ + // m_curvature_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5aae8eb5 + + // m_curvature_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@76954a33 + + +} + +etsi_its_cam_msgs::msg::Curvature::~Curvature() +{ + +} + +etsi_its_cam_msgs::msg::Curvature::Curvature( + const Curvature& x) +{ + m_curvature_value = x.m_curvature_value; + m_curvature_confidence = x.m_curvature_confidence; +} + +etsi_its_cam_msgs::msg::Curvature::Curvature( + Curvature&& x) +{ + m_curvature_value = std::move(x.m_curvature_value); + m_curvature_confidence = std::move(x.m_curvature_confidence); +} + +etsi_its_cam_msgs::msg::Curvature& etsi_its_cam_msgs::msg::Curvature::operator =( + const Curvature& x) +{ + + m_curvature_value = x.m_curvature_value; + m_curvature_confidence = x.m_curvature_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::Curvature& etsi_its_cam_msgs::msg::Curvature::operator =( + Curvature&& x) +{ + + m_curvature_value = std::move(x.m_curvature_value); + m_curvature_confidence = std::move(x.m_curvature_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::Curvature::operator ==( + const Curvature& x) const +{ + + return (m_curvature_value == x.m_curvature_value && m_curvature_confidence == x.m_curvature_confidence); +} + +bool etsi_its_cam_msgs::msg::Curvature::operator !=( + const Curvature& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::Curvature::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::CurvatureValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CurvatureConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::Curvature::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Curvature& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::CurvatureValue::getCdrSerializedSize(data.curvature_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CurvatureConfidence::getCdrSerializedSize(data.curvature_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::Curvature::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_curvature_value; + scdr << m_curvature_confidence; + +} + +void etsi_its_cam_msgs::msg::Curvature::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_curvature_value; + dcdr >> m_curvature_confidence; +} + +/*! + * @brief This function copies the value in member curvature_value + * @param _curvature_value New value to be copied in member curvature_value + */ +void etsi_its_cam_msgs::msg::Curvature::curvature_value( + const etsi_its_cam_msgs::msg::CurvatureValue& _curvature_value) +{ + m_curvature_value = _curvature_value; +} + +/*! + * @brief This function moves the value in member curvature_value + * @param _curvature_value New value to be moved in member curvature_value + */ +void etsi_its_cam_msgs::msg::Curvature::curvature_value( + etsi_its_cam_msgs::msg::CurvatureValue&& _curvature_value) +{ + m_curvature_value = std::move(_curvature_value); +} + +/*! + * @brief This function returns a constant reference to member curvature_value + * @return Constant reference to member curvature_value + */ +const etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::Curvature::curvature_value() const +{ + return m_curvature_value; +} + +/*! + * @brief This function returns a reference to member curvature_value + * @return Reference to member curvature_value + */ +etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::Curvature::curvature_value() +{ + return m_curvature_value; +} +/*! + * @brief This function copies the value in member curvature_confidence + * @param _curvature_confidence New value to be copied in member curvature_confidence + */ +void etsi_its_cam_msgs::msg::Curvature::curvature_confidence( + const etsi_its_cam_msgs::msg::CurvatureConfidence& _curvature_confidence) +{ + m_curvature_confidence = _curvature_confidence; +} + +/*! + * @brief This function moves the value in member curvature_confidence + * @param _curvature_confidence New value to be moved in member curvature_confidence + */ +void etsi_its_cam_msgs::msg::Curvature::curvature_confidence( + etsi_its_cam_msgs::msg::CurvatureConfidence&& _curvature_confidence) +{ + m_curvature_confidence = std::move(_curvature_confidence); +} + +/*! + * @brief This function returns a constant reference to member curvature_confidence + * @return Constant reference to member curvature_confidence + */ +const etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::Curvature::curvature_confidence() const +{ + return m_curvature_confidence; +} + +/*! + * @brief This function returns a reference to member curvature_confidence + * @return Reference to member curvature_confidence + */ +etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::Curvature::curvature_confidence() +{ + return m_curvature_confidence; +} + +size_t etsi_its_cam_msgs::msg::Curvature::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::Curvature::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::Curvature::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.h new file mode 100644 index 00000000000..619038269e0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Curvature.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_H_ + +#include "CurvatureConfidence.h" +#include "CurvatureValue.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Curvature_SOURCE) +#define Curvature_DllAPI __declspec( dllexport ) +#else +#define Curvature_DllAPI __declspec( dllimport ) +#endif // Curvature_SOURCE +#else +#define Curvature_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Curvature_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure Curvature defined by the user in the IDL file. + * @ingroup CURVATURE + */ + class Curvature + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Curvature(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Curvature(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. + */ + eProsima_user_DllExport Curvature( + const Curvature& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. + */ + eProsima_user_DllExport Curvature( + Curvature&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. + */ + eProsima_user_DllExport Curvature& operator =( + const Curvature& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. + */ + eProsima_user_DllExport Curvature& operator =( + Curvature&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Curvature object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Curvature& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Curvature object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Curvature& x) const; + + /*! + * @brief This function copies the value in member curvature_value + * @param _curvature_value New value to be copied in member curvature_value + */ + eProsima_user_DllExport void curvature_value( + const etsi_its_cam_msgs::msg::CurvatureValue& _curvature_value); + + /*! + * @brief This function moves the value in member curvature_value + * @param _curvature_value New value to be moved in member curvature_value + */ + eProsima_user_DllExport void curvature_value( + etsi_its_cam_msgs::msg::CurvatureValue&& _curvature_value); + + /*! + * @brief This function returns a constant reference to member curvature_value + * @return Constant reference to member curvature_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureValue& curvature_value() const; + + /*! + * @brief This function returns a reference to member curvature_value + * @return Reference to member curvature_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureValue& curvature_value(); + /*! + * @brief This function copies the value in member curvature_confidence + * @param _curvature_confidence New value to be copied in member curvature_confidence + */ + eProsima_user_DllExport void curvature_confidence( + const etsi_its_cam_msgs::msg::CurvatureConfidence& _curvature_confidence); + + /*! + * @brief This function moves the value in member curvature_confidence + * @param _curvature_confidence New value to be moved in member curvature_confidence + */ + eProsima_user_DllExport void curvature_confidence( + etsi_its_cam_msgs::msg::CurvatureConfidence&& _curvature_confidence); + + /*! + * @brief This function returns a constant reference to member curvature_confidence + * @return Constant reference to member curvature_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureConfidence& curvature_confidence() const; + + /*! + * @brief This function returns a reference to member curvature_confidence + * @return Reference to member curvature_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureConfidence& curvature_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Curvature& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::CurvatureValue m_curvature_value; + etsi_its_cam_msgs::msg::CurvatureConfidence m_curvature_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.cxx new file mode 100644 index 00000000000..70e39822545 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureCalculationMode.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CurvatureCalculationMode.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::CurvatureCalculationMode::CurvatureCalculationMode() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@c446b14 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::CurvatureCalculationMode::~CurvatureCalculationMode() +{ +} + +etsi_its_cam_msgs::msg::CurvatureCalculationMode::CurvatureCalculationMode( + const CurvatureCalculationMode& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CurvatureCalculationMode::CurvatureCalculationMode( + CurvatureCalculationMode&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg::CurvatureCalculationMode::operator =( + const CurvatureCalculationMode& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg::CurvatureCalculationMode::operator =( + CurvatureCalculationMode&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::CurvatureCalculationMode::operator ==( + const CurvatureCalculationMode& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::CurvatureCalculationMode::operator !=( + const CurvatureCalculationMode& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CurvatureCalculationMode::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::CurvatureCalculationMode::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::CurvatureCalculationMode::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::CurvatureCalculationMode::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CurvatureCalculationMode::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CurvatureCalculationMode::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.h new file mode 100644 index 00000000000..6360629c264 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureCalculationMode.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CurvatureCalculationMode_SOURCE) +#define CurvatureCalculationMode_DllAPI __declspec( dllexport ) +#else +#define CurvatureCalculationMode_DllAPI __declspec( dllimport ) +#endif // CurvatureCalculationMode_SOURCE +#else +#define CurvatureCalculationMode_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CurvatureCalculationMode_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace CurvatureCalculationMode_Constants { + const uint8_t YAW_RATE_USED = 0; + const uint8_t YAW_RATE_NOT_USED = 1; + const uint8_t UNAVAILABLE = 2; + } // namespace CurvatureCalculationMode_Constants + /*! + * @brief This class represents the structure CurvatureCalculationMode defined by the user in the IDL file. + * @ingroup CURVATURECALCULATIONMODE + */ + class CurvatureCalculationMode + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CurvatureCalculationMode(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CurvatureCalculationMode(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. + */ + eProsima_user_DllExport CurvatureCalculationMode( + const CurvatureCalculationMode& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. + */ + eProsima_user_DllExport CurvatureCalculationMode( + CurvatureCalculationMode&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. + */ + eProsima_user_DllExport CurvatureCalculationMode& operator =( + const CurvatureCalculationMode& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. + */ + eProsima_user_DllExport CurvatureCalculationMode& operator =( + CurvatureCalculationMode&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureCalculationMode object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CurvatureCalculationMode& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureCalculationMode object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CurvatureCalculationMode& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.cxx new file mode 100644 index 00000000000..b3a8fcb5ae1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureCalculationModePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CurvatureCalculationModePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace CurvatureCalculationMode_Constants { + + + + + } //End of namespace CurvatureCalculationMode_Constants + CurvatureCalculationModePubSubType::CurvatureCalculationModePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CurvatureCalculationMode_"); + auto type_size = CurvatureCalculationMode::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CurvatureCalculationMode::isKeyDefined(); + size_t keyLength = CurvatureCalculationMode::getKeyMaxCdrSerializedSize() > 16 ? + CurvatureCalculationMode::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CurvatureCalculationModePubSubType::~CurvatureCalculationModePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CurvatureCalculationModePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CurvatureCalculationMode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CurvatureCalculationModePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CurvatureCalculationMode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CurvatureCalculationModePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CurvatureCalculationModePubSubType::createData() + { + return reinterpret_cast(new CurvatureCalculationMode()); + } + + void CurvatureCalculationModePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CurvatureCalculationModePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CurvatureCalculationMode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CurvatureCalculationMode::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CurvatureCalculationMode::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.h new file mode 100644 index 00000000000..f0057bca0fe --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureCalculationModePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_PUBSUBTYPES_H_ + +#include +#include + +#include "CurvatureCalculationMode.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CurvatureCalculationMode is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace CurvatureCalculationMode_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type CurvatureCalculationMode defined by the user in the IDL file. + * @ingroup CURVATURECALCULATIONMODE + */ + class CurvatureCalculationModePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CurvatureCalculationMode type; + + eProsima_user_DllExport CurvatureCalculationModePubSubType(); + + eProsima_user_DllExport virtual ~CurvatureCalculationModePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CurvatureCalculationMode(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.cxx new file mode 100644 index 00000000000..0c9a9650867 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.cxx @@ -0,0 +1,192 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureConfidence.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CurvatureConfidence.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + +etsi_its_cam_msgs::msg::CurvatureConfidence::CurvatureConfidence() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@76075d65 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::CurvatureConfidence::~CurvatureConfidence() +{ +} + +etsi_its_cam_msgs::msg::CurvatureConfidence::CurvatureConfidence( + const CurvatureConfidence& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CurvatureConfidence::CurvatureConfidence( + CurvatureConfidence&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::CurvatureConfidence::operator =( + const CurvatureConfidence& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::CurvatureConfidence::operator =( + CurvatureConfidence&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::CurvatureConfidence::operator ==( + const CurvatureConfidence& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::CurvatureConfidence::operator !=( + const CurvatureConfidence& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CurvatureConfidence::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CurvatureConfidence::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CurvatureConfidence& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CurvatureConfidence::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::CurvatureConfidence::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::CurvatureConfidence::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::CurvatureConfidence::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::CurvatureConfidence::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::CurvatureConfidence::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CurvatureConfidence::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CurvatureConfidence::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.h new file mode 100644 index 00000000000..819fa5b5e23 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.h @@ -0,0 +1,220 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureConfidence.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CurvatureConfidence_SOURCE) +#define CurvatureConfidence_DllAPI __declspec( dllexport ) +#else +#define CurvatureConfidence_DllAPI __declspec( dllimport ) +#endif // CurvatureConfidence_SOURCE +#else +#define CurvatureConfidence_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CurvatureConfidence_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace CurvatureConfidence_Constants { + const uint8_t ONE_PER_METER_0_00002 = 0; + const uint8_t ONE_PER_METER_0_0001 = 1; + const uint8_t ONE_PER_METER_0_0005 = 2; + const uint8_t ONE_PER_METER_0_002 = 3; + const uint8_t ONE_PER_METER_0_01 = 4; + const uint8_t ONE_PER_METER_0_1 = 5; + const uint8_t OUT_OF_RANGE = 6; + const uint8_t UNAVAILABLE = 7; + } // namespace CurvatureConfidence_Constants + /*! + * @brief This class represents the structure CurvatureConfidence defined by the user in the IDL file. + * @ingroup CURVATURECONFIDENCE + */ + class CurvatureConfidence + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CurvatureConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CurvatureConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. + */ + eProsima_user_DllExport CurvatureConfidence( + const CurvatureConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. + */ + eProsima_user_DllExport CurvatureConfidence( + CurvatureConfidence&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. + */ + eProsima_user_DllExport CurvatureConfidence& operator =( + const CurvatureConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. + */ + eProsima_user_DllExport CurvatureConfidence& operator =( + CurvatureConfidence&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CurvatureConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CurvatureConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CurvatureConfidence& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.cxx new file mode 100644 index 00000000000..7a16975794f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureConfidencePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CurvatureConfidencePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace CurvatureConfidence_Constants { + + + + + + + + + + } //End of namespace CurvatureConfidence_Constants + CurvatureConfidencePubSubType::CurvatureConfidencePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CurvatureConfidence_"); + auto type_size = CurvatureConfidence::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CurvatureConfidence::isKeyDefined(); + size_t keyLength = CurvatureConfidence::getKeyMaxCdrSerializedSize() > 16 ? + CurvatureConfidence::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CurvatureConfidencePubSubType::~CurvatureConfidencePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CurvatureConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CurvatureConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CurvatureConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CurvatureConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CurvatureConfidencePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CurvatureConfidencePubSubType::createData() + { + return reinterpret_cast(new CurvatureConfidence()); + } + + void CurvatureConfidencePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CurvatureConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CurvatureConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CurvatureConfidence::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CurvatureConfidence::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.h new file mode 100644 index 00000000000..40a19ad810f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.h @@ -0,0 +1,118 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureConfidencePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_PUBSUBTYPES_H_ + +#include +#include + +#include "CurvatureConfidence.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CurvatureConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace CurvatureConfidence_Constants + { + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type CurvatureConfidence defined by the user in the IDL file. + * @ingroup CURVATURECONFIDENCE + */ + class CurvatureConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CurvatureConfidence type; + + eProsima_user_DllExport CurvatureConfidencePubSubType(); + + eProsima_user_DllExport virtual ~CurvatureConfidencePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CurvatureConfidence(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.cxx new file mode 100644 index 00000000000..97ee8aab403 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvaturePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CurvaturePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + CurvaturePubSubType::CurvaturePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::Curvature_"); + auto type_size = Curvature::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Curvature::isKeyDefined(); + size_t keyLength = Curvature::getKeyMaxCdrSerializedSize() > 16 ? + Curvature::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CurvaturePubSubType::~CurvaturePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CurvaturePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Curvature* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CurvaturePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Curvature* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CurvaturePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CurvaturePubSubType::createData() + { + return reinterpret_cast(new Curvature()); + } + + void CurvaturePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CurvaturePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Curvature* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Curvature::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Curvature::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.h new file mode 100644 index 00000000000..d8c5a516da9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvaturePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_PUBSUBTYPES_H_ + +#include +#include + +#include "Curvature.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated Curvature is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type Curvature defined by the user in the IDL file. + * @ingroup CURVATURE + */ + class CurvaturePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Curvature type; + + eProsima_user_DllExport CurvaturePubSubType(); + + eProsima_user_DllExport virtual ~CurvaturePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Curvature(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.cxx new file mode 100644 index 00000000000..d7890d2f515 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.cxx @@ -0,0 +1,188 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CurvatureValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + +etsi_its_cam_msgs::msg::CurvatureValue::CurvatureValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@426e505c + m_value = 0; + +} + +etsi_its_cam_msgs::msg::CurvatureValue::~CurvatureValue() +{ +} + +etsi_its_cam_msgs::msg::CurvatureValue::CurvatureValue( + const CurvatureValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CurvatureValue::CurvatureValue( + CurvatureValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::CurvatureValue::operator =( + const CurvatureValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::CurvatureValue::operator =( + CurvatureValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::CurvatureValue::operator ==( + const CurvatureValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::CurvatureValue::operator !=( + const CurvatureValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::CurvatureValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::CurvatureValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CurvatureValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::CurvatureValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::CurvatureValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::CurvatureValue::value( + int16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int16_t etsi_its_cam_msgs::msg::CurvatureValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int16_t& etsi_its_cam_msgs::msg::CurvatureValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::CurvatureValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::CurvatureValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::CurvatureValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.h new file mode 100644 index 00000000000..e401f66b36c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.h @@ -0,0 +1,216 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CurvatureValue_SOURCE) +#define CurvatureValue_DllAPI __declspec( dllexport ) +#else +#define CurvatureValue_DllAPI __declspec( dllimport ) +#endif // CurvatureValue_SOURCE +#else +#define CurvatureValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CurvatureValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace CurvatureValue_Constants { + const int16_t MIN = -1023; + const int16_t MAX = 1023; + const int16_t STRAIGHT = 0; + const int16_t UNAVAILABLE = 1023; + } // namespace CurvatureValue_Constants + /*! + * @brief This class represents the structure CurvatureValue defined by the user in the IDL file. + * @ingroup CURVATUREVALUE + */ + class CurvatureValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CurvatureValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CurvatureValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. + */ + eProsima_user_DllExport CurvatureValue( + const CurvatureValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. + */ + eProsima_user_DllExport CurvatureValue( + CurvatureValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. + */ + eProsima_user_DllExport CurvatureValue& operator =( + const CurvatureValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. + */ + eProsima_user_DllExport CurvatureValue& operator =( + CurvatureValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CurvatureValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CurvatureValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::CurvatureValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.cxx new file mode 100644 index 00000000000..374e9c78405 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.cxx @@ -0,0 +1,183 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "CurvatureValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace CurvatureValue_Constants { + + + + + + } //End of namespace CurvatureValue_Constants + CurvatureValuePubSubType::CurvatureValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::CurvatureValue_"); + auto type_size = CurvatureValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = CurvatureValue::isKeyDefined(); + size_t keyLength = CurvatureValue::getKeyMaxCdrSerializedSize() > 16 ? + CurvatureValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + CurvatureValuePubSubType::~CurvatureValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool CurvatureValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + CurvatureValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool CurvatureValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + CurvatureValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function CurvatureValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* CurvatureValuePubSubType::createData() + { + return reinterpret_cast(new CurvatureValue()); + } + + void CurvatureValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool CurvatureValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + CurvatureValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + CurvatureValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || CurvatureValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.h new file mode 100644 index 00000000000..e80800a19b5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.h @@ -0,0 +1,114 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "CurvatureValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated CurvatureValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace CurvatureValue_Constants + { + + + + + } + /*! + * @brief This class represents the TopicDataType of the type CurvatureValue defined by the user in the IDL file. + * @ingroup CURVATUREVALUE + */ + class CurvatureValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef CurvatureValue type; + + eProsima_user_DllExport CurvatureValuePubSubType(); + + eProsima_user_DllExport virtual ~CurvatureValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CurvatureValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.cxx new file mode 100644 index 00000000000..9c50fb7caf4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.cxx @@ -0,0 +1,204 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsBasic.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DangerousGoodsBasic.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + + + + + + + +etsi_its_cam_msgs::msg::DangerousGoodsBasic::DangerousGoodsBasic() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71e9a896 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::DangerousGoodsBasic::~DangerousGoodsBasic() +{ +} + +etsi_its_cam_msgs::msg::DangerousGoodsBasic::DangerousGoodsBasic( + const DangerousGoodsBasic& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DangerousGoodsBasic::DangerousGoodsBasic( + DangerousGoodsBasic&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::DangerousGoodsBasic::operator =( + const DangerousGoodsBasic& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::DangerousGoodsBasic::operator =( + DangerousGoodsBasic&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::DangerousGoodsBasic::operator ==( + const DangerousGoodsBasic& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::DangerousGoodsBasic::operator !=( + const DangerousGoodsBasic& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::DangerousGoodsBasic::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::DangerousGoodsBasic::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::DangerousGoodsBasic::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::DangerousGoodsBasic::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::DangerousGoodsBasic::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::DangerousGoodsBasic::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.h new file mode 100644 index 00000000000..9f551f046cd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.h @@ -0,0 +1,232 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsBasic.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DangerousGoodsBasic_SOURCE) +#define DangerousGoodsBasic_DllAPI __declspec( dllexport ) +#else +#define DangerousGoodsBasic_DllAPI __declspec( dllimport ) +#endif // DangerousGoodsBasic_SOURCE +#else +#define DangerousGoodsBasic_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DangerousGoodsBasic_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DangerousGoodsBasic_Constants { + const uint8_t EXPLOSIVES_1 = 0; + const uint8_t EXPLOSIVES_2 = 1; + const uint8_t EXPLOSIVES_3 = 2; + const uint8_t EXPLOSIVES_4 = 3; + const uint8_t EXPLOSIVES_5 = 4; + const uint8_t EXPLOSIVES_6 = 5; + const uint8_t FLAMMABLE_GASES = 6; + const uint8_t NON_FLAMMABLE_GASES = 7; + const uint8_t TOXIC_GASES = 8; + const uint8_t FLAMMABLE_LIQUIDS = 9; + const uint8_t FLAMMABLE_SOLIDS = 10; + const uint8_t SUBSTANCES_LIABLE_TO_SPONTANEOUS_COMBUSTION = 11; + const uint8_t SUBSTANCES_EMITTING_FLAMMABLE_GASES_UPON_CONTACT_WITH_WATER = 12; + const uint8_t OXIDIZING_SUBSTANCES = 13; + const uint8_t ORGANIC_PEROXIDES = 14; + const uint8_t TOXIC_SUBSTANCES = 15; + const uint8_t INFECTIOUS_SUBSTANCES = 16; + const uint8_t RADIOACTIVE_MATERIAL = 17; + const uint8_t CORROSIVE_SUBSTANCES = 18; + const uint8_t MISCELLANEOUS_DANGEROUS_SUBSTANCES = 19; + } // namespace DangerousGoodsBasic_Constants + /*! + * @brief This class represents the structure DangerousGoodsBasic defined by the user in the IDL file. + * @ingroup DANGEROUSGOODSBASIC + */ + class DangerousGoodsBasic + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DangerousGoodsBasic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DangerousGoodsBasic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. + */ + eProsima_user_DllExport DangerousGoodsBasic( + const DangerousGoodsBasic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. + */ + eProsima_user_DllExport DangerousGoodsBasic( + DangerousGoodsBasic&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. + */ + eProsima_user_DllExport DangerousGoodsBasic& operator =( + const DangerousGoodsBasic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. + */ + eProsima_user_DllExport DangerousGoodsBasic& operator =( + DangerousGoodsBasic&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DangerousGoodsBasic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DangerousGoodsBasic& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DangerousGoodsBasic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DangerousGoodsBasic& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.cxx new file mode 100644 index 00000000000..6c17c6ca8ce --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.cxx @@ -0,0 +1,199 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsBasicPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DangerousGoodsBasicPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DangerousGoodsBasic_Constants { + + + + + + + + + + + + + + + + + + + + + + } //End of namespace DangerousGoodsBasic_Constants + DangerousGoodsBasicPubSubType::DangerousGoodsBasicPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::DangerousGoodsBasic_"); + auto type_size = DangerousGoodsBasic::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DangerousGoodsBasic::isKeyDefined(); + size_t keyLength = DangerousGoodsBasic::getKeyMaxCdrSerializedSize() > 16 ? + DangerousGoodsBasic::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DangerousGoodsBasicPubSubType::~DangerousGoodsBasicPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DangerousGoodsBasicPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DangerousGoodsBasic* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DangerousGoodsBasicPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DangerousGoodsBasic* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DangerousGoodsBasicPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DangerousGoodsBasicPubSubType::createData() + { + return reinterpret_cast(new DangerousGoodsBasic()); + } + + void DangerousGoodsBasicPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DangerousGoodsBasicPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DangerousGoodsBasic* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DangerousGoodsBasic::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DangerousGoodsBasic::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.h new file mode 100644 index 00000000000..515ef86930b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.h @@ -0,0 +1,130 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsBasicPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_PUBSUBTYPES_H_ + +#include +#include + +#include "DangerousGoodsBasic.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated DangerousGoodsBasic is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace DangerousGoodsBasic_Constants + { + + + + + + + + + + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type DangerousGoodsBasic defined by the user in the IDL file. + * @ingroup DANGEROUSGOODSBASIC + */ + class DangerousGoodsBasicPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DangerousGoodsBasic type; + + eProsima_user_DllExport DangerousGoodsBasicPubSubType(); + + eProsima_user_DllExport virtual ~DangerousGoodsBasicPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DangerousGoodsBasic(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.cxx new file mode 100644 index 00000000000..a3fd0ae5863 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.cxx @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DangerousGoodsContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::DangerousGoodsContainer::DangerousGoodsContainer() +{ + // m_dangerous_goods_basic com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2970a5bc + + +} + +etsi_its_cam_msgs::msg::DangerousGoodsContainer::~DangerousGoodsContainer() +{ +} + +etsi_its_cam_msgs::msg::DangerousGoodsContainer::DangerousGoodsContainer( + const DangerousGoodsContainer& x) +{ + m_dangerous_goods_basic = x.m_dangerous_goods_basic; +} + +etsi_its_cam_msgs::msg::DangerousGoodsContainer::DangerousGoodsContainer( + DangerousGoodsContainer&& x) +{ + m_dangerous_goods_basic = std::move(x.m_dangerous_goods_basic); +} + +etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::DangerousGoodsContainer::operator =( + const DangerousGoodsContainer& x) +{ + + m_dangerous_goods_basic = x.m_dangerous_goods_basic; + + return *this; +} + +etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::DangerousGoodsContainer::operator =( + DangerousGoodsContainer&& x) +{ + + m_dangerous_goods_basic = std::move(x.m_dangerous_goods_basic); + + return *this; +} + +bool etsi_its_cam_msgs::msg::DangerousGoodsContainer::operator ==( + const DangerousGoodsContainer& x) const +{ + + return (m_dangerous_goods_basic == x.m_dangerous_goods_basic); +} + +bool etsi_its_cam_msgs::msg::DangerousGoodsContainer::operator !=( + const DangerousGoodsContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::DangerousGoodsContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::DangerousGoodsBasic::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::DangerousGoodsContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::DangerousGoodsBasic::getCdrSerializedSize(data.dangerous_goods_basic(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::DangerousGoodsContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_dangerous_goods_basic; + +} + +void etsi_its_cam_msgs::msg::DangerousGoodsContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_dangerous_goods_basic; +} + +/*! + * @brief This function copies the value in member dangerous_goods_basic + * @param _dangerous_goods_basic New value to be copied in member dangerous_goods_basic + */ +void etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic( + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& _dangerous_goods_basic) +{ + m_dangerous_goods_basic = _dangerous_goods_basic; +} + +/*! + * @brief This function moves the value in member dangerous_goods_basic + * @param _dangerous_goods_basic New value to be moved in member dangerous_goods_basic + */ +void etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic( + etsi_its_cam_msgs::msg::DangerousGoodsBasic&& _dangerous_goods_basic) +{ + m_dangerous_goods_basic = std::move(_dangerous_goods_basic); +} + +/*! + * @brief This function returns a constant reference to member dangerous_goods_basic + * @return Constant reference to member dangerous_goods_basic + */ +const etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic() const +{ + return m_dangerous_goods_basic; +} + +/*! + * @brief This function returns a reference to member dangerous_goods_basic + * @return Reference to member dangerous_goods_basic + */ +etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic() +{ + return m_dangerous_goods_basic; +} + +size_t etsi_its_cam_msgs::msg::DangerousGoodsContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::DangerousGoodsContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::DangerousGoodsContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.h new file mode 100644 index 00000000000..d4ba1a7263d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_H_ + +#include "DangerousGoodsBasic.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DangerousGoodsContainer_SOURCE) +#define DangerousGoodsContainer_DllAPI __declspec( dllexport ) +#else +#define DangerousGoodsContainer_DllAPI __declspec( dllimport ) +#endif // DangerousGoodsContainer_SOURCE +#else +#define DangerousGoodsContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DangerousGoodsContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure DangerousGoodsContainer defined by the user in the IDL file. + * @ingroup DANGEROUSGOODSCONTAINER + */ + class DangerousGoodsContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DangerousGoodsContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DangerousGoodsContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. + */ + eProsima_user_DllExport DangerousGoodsContainer( + const DangerousGoodsContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. + */ + eProsima_user_DllExport DangerousGoodsContainer( + DangerousGoodsContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. + */ + eProsima_user_DllExport DangerousGoodsContainer& operator =( + const DangerousGoodsContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. + */ + eProsima_user_DllExport DangerousGoodsContainer& operator =( + DangerousGoodsContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DangerousGoodsContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DangerousGoodsContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DangerousGoodsContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DangerousGoodsContainer& x) const; + + /*! + * @brief This function copies the value in member dangerous_goods_basic + * @param _dangerous_goods_basic New value to be copied in member dangerous_goods_basic + */ + eProsima_user_DllExport void dangerous_goods_basic( + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& _dangerous_goods_basic); + + /*! + * @brief This function moves the value in member dangerous_goods_basic + * @param _dangerous_goods_basic New value to be moved in member dangerous_goods_basic + */ + eProsima_user_DllExport void dangerous_goods_basic( + etsi_its_cam_msgs::msg::DangerousGoodsBasic&& _dangerous_goods_basic); + + /*! + * @brief This function returns a constant reference to member dangerous_goods_basic + * @return Constant reference to member dangerous_goods_basic + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DangerousGoodsBasic& dangerous_goods_basic() const; + + /*! + * @brief This function returns a reference to member dangerous_goods_basic + * @return Reference to member dangerous_goods_basic + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DangerousGoodsBasic& dangerous_goods_basic(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::DangerousGoodsBasic m_dangerous_goods_basic; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.cxx new file mode 100644 index 00000000000..d535ebf3c23 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DangerousGoodsContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + DangerousGoodsContainerPubSubType::DangerousGoodsContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::DangerousGoodsContainer_"); + auto type_size = DangerousGoodsContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DangerousGoodsContainer::isKeyDefined(); + size_t keyLength = DangerousGoodsContainer::getKeyMaxCdrSerializedSize() > 16 ? + DangerousGoodsContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DangerousGoodsContainerPubSubType::~DangerousGoodsContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DangerousGoodsContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DangerousGoodsContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DangerousGoodsContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DangerousGoodsContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DangerousGoodsContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DangerousGoodsContainerPubSubType::createData() + { + return reinterpret_cast(new DangerousGoodsContainer()); + } + + void DangerousGoodsContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DangerousGoodsContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DangerousGoodsContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DangerousGoodsContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DangerousGoodsContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.h new file mode 100644 index 00000000000..ca101eaae8d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "DangerousGoodsContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated DangerousGoodsContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type DangerousGoodsContainer defined by the user in the IDL file. + * @ingroup DANGEROUSGOODSCONTAINER + */ + class DangerousGoodsContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DangerousGoodsContainer type; + + eProsima_user_DllExport DangerousGoodsContainerPubSubType(); + + eProsima_user_DllExport virtual ~DangerousGoodsContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DangerousGoodsContainer(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.cxx new file mode 100644 index 00000000000..bf1d8b57db6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaAltitude.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DeltaAltitude.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::DeltaAltitude::DeltaAltitude() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@bae47a0 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::DeltaAltitude::~DeltaAltitude() +{ +} + +etsi_its_cam_msgs::msg::DeltaAltitude::DeltaAltitude( + const DeltaAltitude& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DeltaAltitude::DeltaAltitude( + DeltaAltitude&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaAltitude::operator =( + const DeltaAltitude& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaAltitude::operator =( + DeltaAltitude&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::DeltaAltitude::operator ==( + const DeltaAltitude& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::DeltaAltitude::operator !=( + const DeltaAltitude& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::DeltaAltitude::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::DeltaAltitude::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DeltaAltitude& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::DeltaAltitude::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::DeltaAltitude::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::DeltaAltitude::value( + int16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int16_t etsi_its_cam_msgs::msg::DeltaAltitude::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int16_t& etsi_its_cam_msgs::msg::DeltaAltitude::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::DeltaAltitude::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::DeltaAltitude::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::DeltaAltitude::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.h new file mode 100644 index 00000000000..a033de2a66e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaAltitude.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DeltaAltitude_SOURCE) +#define DeltaAltitude_DllAPI __declspec( dllexport ) +#else +#define DeltaAltitude_DllAPI __declspec( dllimport ) +#endif // DeltaAltitude_SOURCE +#else +#define DeltaAltitude_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DeltaAltitude_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DeltaAltitude_Constants { + const int16_t MIN = -12700; + const int16_t MAX = 12800; + const int16_t ONE_CENTIMETER_UP = 1; + const int16_t ONE_CENTIMETER_DOWN = -1; + const int16_t UNAVAILABLE = 12800; + } // namespace DeltaAltitude_Constants + /*! + * @brief This class represents the structure DeltaAltitude defined by the user in the IDL file. + * @ingroup DELTAALTITUDE + */ + class DeltaAltitude + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeltaAltitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeltaAltitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. + */ + eProsima_user_DllExport DeltaAltitude( + const DeltaAltitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. + */ + eProsima_user_DllExport DeltaAltitude( + DeltaAltitude&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. + */ + eProsima_user_DllExport DeltaAltitude& operator =( + const DeltaAltitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. + */ + eProsima_user_DllExport DeltaAltitude& operator =( + DeltaAltitude&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaAltitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeltaAltitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaAltitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeltaAltitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DeltaAltitude& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.cxx new file mode 100644 index 00000000000..9ceeff8f1ee --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaAltitudePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DeltaAltitudePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DeltaAltitude_Constants { + + + + + + + } //End of namespace DeltaAltitude_Constants + DeltaAltitudePubSubType::DeltaAltitudePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::DeltaAltitude_"); + auto type_size = DeltaAltitude::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DeltaAltitude::isKeyDefined(); + size_t keyLength = DeltaAltitude::getKeyMaxCdrSerializedSize() > 16 ? + DeltaAltitude::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DeltaAltitudePubSubType::~DeltaAltitudePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DeltaAltitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DeltaAltitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DeltaAltitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DeltaAltitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DeltaAltitudePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DeltaAltitudePubSubType::createData() + { + return reinterpret_cast(new DeltaAltitude()); + } + + void DeltaAltitudePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DeltaAltitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DeltaAltitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DeltaAltitude::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DeltaAltitude::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.h new file mode 100644 index 00000000000..ba08c1fc281 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaAltitudePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_PUBSUBTYPES_H_ + +#include +#include + +#include "DeltaAltitude.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated DeltaAltitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace DeltaAltitude_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type DeltaAltitude defined by the user in the IDL file. + * @ingroup DELTAALTITUDE + */ + class DeltaAltitudePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DeltaAltitude type; + + eProsima_user_DllExport DeltaAltitudePubSubType(); + + eProsima_user_DllExport virtual ~DeltaAltitudePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DeltaAltitude(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.cxx new file mode 100644 index 00000000000..2554cd0b344 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLatitude.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DeltaLatitude.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::DeltaLatitude::DeltaLatitude() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3a71c100 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::DeltaLatitude::~DeltaLatitude() +{ +} + +etsi_its_cam_msgs::msg::DeltaLatitude::DeltaLatitude( + const DeltaLatitude& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DeltaLatitude::DeltaLatitude( + DeltaLatitude&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaLatitude::operator =( + const DeltaLatitude& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaLatitude::operator =( + DeltaLatitude&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::DeltaLatitude::operator ==( + const DeltaLatitude& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::DeltaLatitude::operator !=( + const DeltaLatitude& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::DeltaLatitude::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::DeltaLatitude::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DeltaLatitude& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::DeltaLatitude::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::DeltaLatitude::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::DeltaLatitude::value( + int32_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int32_t etsi_its_cam_msgs::msg::DeltaLatitude::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int32_t& etsi_its_cam_msgs::msg::DeltaLatitude::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::DeltaLatitude::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::DeltaLatitude::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::DeltaLatitude::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.h new file mode 100644 index 00000000000..1d88654a54b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLatitude.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DeltaLatitude_SOURCE) +#define DeltaLatitude_DllAPI __declspec( dllexport ) +#else +#define DeltaLatitude_DllAPI __declspec( dllimport ) +#endif // DeltaLatitude_SOURCE +#else +#define DeltaLatitude_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DeltaLatitude_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DeltaLatitude_Constants { + const int32_t MIN = -131071; + const int32_t MAX = 131072; + const int32_t ONE_MICRODEGREE_NORTH = 10; + const int32_t ONE_MICRODEGREE_SOUTH = -10; + const int32_t UNAVAILABLE = 131072; + } // namespace DeltaLatitude_Constants + /*! + * @brief This class represents the structure DeltaLatitude defined by the user in the IDL file. + * @ingroup DELTALATITUDE + */ + class DeltaLatitude + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeltaLatitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeltaLatitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. + */ + eProsima_user_DllExport DeltaLatitude( + const DeltaLatitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. + */ + eProsima_user_DllExport DeltaLatitude( + DeltaLatitude&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. + */ + eProsima_user_DllExport DeltaLatitude& operator =( + const DeltaLatitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. + */ + eProsima_user_DllExport DeltaLatitude& operator =( + DeltaLatitude&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaLatitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeltaLatitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaLatitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeltaLatitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DeltaLatitude& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int32_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.cxx new file mode 100644 index 00000000000..52d49bf7fd5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLatitudePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DeltaLatitudePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DeltaLatitude_Constants { + + + + + + + } //End of namespace DeltaLatitude_Constants + DeltaLatitudePubSubType::DeltaLatitudePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::DeltaLatitude_"); + auto type_size = DeltaLatitude::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DeltaLatitude::isKeyDefined(); + size_t keyLength = DeltaLatitude::getKeyMaxCdrSerializedSize() > 16 ? + DeltaLatitude::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DeltaLatitudePubSubType::~DeltaLatitudePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DeltaLatitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DeltaLatitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DeltaLatitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DeltaLatitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DeltaLatitudePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DeltaLatitudePubSubType::createData() + { + return reinterpret_cast(new DeltaLatitude()); + } + + void DeltaLatitudePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DeltaLatitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DeltaLatitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DeltaLatitude::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DeltaLatitude::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.h new file mode 100644 index 00000000000..e20b6656498 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLatitudePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_PUBSUBTYPES_H_ + +#include +#include + +#include "DeltaLatitude.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated DeltaLatitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace DeltaLatitude_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type DeltaLatitude defined by the user in the IDL file. + * @ingroup DELTALATITUDE + */ + class DeltaLatitudePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DeltaLatitude type; + + eProsima_user_DllExport DeltaLatitudePubSubType(); + + eProsima_user_DllExport virtual ~DeltaLatitudePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DeltaLatitude(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.cxx new file mode 100644 index 00000000000..8c1e526a6d4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLongitude.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DeltaLongitude.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::DeltaLongitude::DeltaLongitude() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@26d10f2e + m_value = 0; + +} + +etsi_its_cam_msgs::msg::DeltaLongitude::~DeltaLongitude() +{ +} + +etsi_its_cam_msgs::msg::DeltaLongitude::DeltaLongitude( + const DeltaLongitude& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DeltaLongitude::DeltaLongitude( + DeltaLongitude&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaLongitude::operator =( + const DeltaLongitude& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaLongitude::operator =( + DeltaLongitude&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::DeltaLongitude::operator ==( + const DeltaLongitude& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::DeltaLongitude::operator !=( + const DeltaLongitude& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::DeltaLongitude::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::DeltaLongitude::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DeltaLongitude& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::DeltaLongitude::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::DeltaLongitude::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::DeltaLongitude::value( + int32_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int32_t etsi_its_cam_msgs::msg::DeltaLongitude::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int32_t& etsi_its_cam_msgs::msg::DeltaLongitude::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::DeltaLongitude::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::DeltaLongitude::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::DeltaLongitude::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.h new file mode 100644 index 00000000000..26139eacc05 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLongitude.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DeltaLongitude_SOURCE) +#define DeltaLongitude_DllAPI __declspec( dllexport ) +#else +#define DeltaLongitude_DllAPI __declspec( dllimport ) +#endif // DeltaLongitude_SOURCE +#else +#define DeltaLongitude_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DeltaLongitude_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DeltaLongitude_Constants { + const int32_t MIN = -131071; + const int32_t MAX = 131072; + const int32_t ONE_MICRODEGREE_EAST = 10; + const int32_t ONE_MICRODEGREE_WEST = -10; + const int32_t UNAVAILABLE = 131072; + } // namespace DeltaLongitude_Constants + /*! + * @brief This class represents the structure DeltaLongitude defined by the user in the IDL file. + * @ingroup DELTALONGITUDE + */ + class DeltaLongitude + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeltaLongitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeltaLongitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. + */ + eProsima_user_DllExport DeltaLongitude( + const DeltaLongitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. + */ + eProsima_user_DllExport DeltaLongitude( + DeltaLongitude&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. + */ + eProsima_user_DllExport DeltaLongitude& operator =( + const DeltaLongitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. + */ + eProsima_user_DllExport DeltaLongitude& operator =( + DeltaLongitude&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaLongitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeltaLongitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaLongitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeltaLongitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DeltaLongitude& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int32_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.cxx new file mode 100644 index 00000000000..bd386e71f01 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLongitudePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DeltaLongitudePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DeltaLongitude_Constants { + + + + + + + } //End of namespace DeltaLongitude_Constants + DeltaLongitudePubSubType::DeltaLongitudePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::DeltaLongitude_"); + auto type_size = DeltaLongitude::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DeltaLongitude::isKeyDefined(); + size_t keyLength = DeltaLongitude::getKeyMaxCdrSerializedSize() > 16 ? + DeltaLongitude::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DeltaLongitudePubSubType::~DeltaLongitudePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DeltaLongitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DeltaLongitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DeltaLongitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DeltaLongitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DeltaLongitudePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DeltaLongitudePubSubType::createData() + { + return reinterpret_cast(new DeltaLongitude()); + } + + void DeltaLongitudePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DeltaLongitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DeltaLongitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DeltaLongitude::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DeltaLongitude::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.h new file mode 100644 index 00000000000..cfe9901a5e7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLongitudePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_PUBSUBTYPES_H_ + +#include +#include + +#include "DeltaLongitude.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated DeltaLongitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace DeltaLongitude_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type DeltaLongitude defined by the user in the IDL file. + * @ingroup DELTALONGITUDE + */ + class DeltaLongitudePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DeltaLongitude type; + + eProsima_user_DllExport DeltaLongitudePubSubType(); + + eProsima_user_DllExport virtual ~DeltaLongitudePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DeltaLongitude(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.cxx new file mode 100644 index 00000000000..67bf0d0c59e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaReferencePosition.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DeltaReferencePosition.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::DeltaReferencePosition::DeltaReferencePosition() +{ + // m_delta_latitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@42deb43a + + // m_delta_longitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1deb2c43 + + // m_delta_altitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3bb9efbc + + +} + +etsi_its_cam_msgs::msg::DeltaReferencePosition::~DeltaReferencePosition() +{ + + +} + +etsi_its_cam_msgs::msg::DeltaReferencePosition::DeltaReferencePosition( + const DeltaReferencePosition& x) +{ + m_delta_latitude = x.m_delta_latitude; + m_delta_longitude = x.m_delta_longitude; + m_delta_altitude = x.m_delta_altitude; +} + +etsi_its_cam_msgs::msg::DeltaReferencePosition::DeltaReferencePosition( + DeltaReferencePosition&& x) +{ + m_delta_latitude = std::move(x.m_delta_latitude); + m_delta_longitude = std::move(x.m_delta_longitude); + m_delta_altitude = std::move(x.m_delta_altitude); +} + +etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::DeltaReferencePosition::operator =( + const DeltaReferencePosition& x) +{ + + m_delta_latitude = x.m_delta_latitude; + m_delta_longitude = x.m_delta_longitude; + m_delta_altitude = x.m_delta_altitude; + + return *this; +} + +etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::DeltaReferencePosition::operator =( + DeltaReferencePosition&& x) +{ + + m_delta_latitude = std::move(x.m_delta_latitude); + m_delta_longitude = std::move(x.m_delta_longitude); + m_delta_altitude = std::move(x.m_delta_altitude); + + return *this; +} + +bool etsi_its_cam_msgs::msg::DeltaReferencePosition::operator ==( + const DeltaReferencePosition& x) const +{ + + return (m_delta_latitude == x.m_delta_latitude && m_delta_longitude == x.m_delta_longitude && m_delta_altitude == x.m_delta_altitude); +} + +bool etsi_its_cam_msgs::msg::DeltaReferencePosition::operator !=( + const DeltaReferencePosition& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::DeltaReferencePosition::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::DeltaLatitude::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::DeltaLongitude::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::DeltaAltitude::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::DeltaReferencePosition::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DeltaReferencePosition& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::DeltaLatitude::getCdrSerializedSize(data.delta_latitude(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::DeltaLongitude::getCdrSerializedSize(data.delta_longitude(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::DeltaAltitude::getCdrSerializedSize(data.delta_altitude(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::DeltaReferencePosition::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_delta_latitude; + scdr << m_delta_longitude; + scdr << m_delta_altitude; + +} + +void etsi_its_cam_msgs::msg::DeltaReferencePosition::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_delta_latitude; + dcdr >> m_delta_longitude; + dcdr >> m_delta_altitude; +} + +/*! + * @brief This function copies the value in member delta_latitude + * @param _delta_latitude New value to be copied in member delta_latitude + */ +void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude( + const etsi_its_cam_msgs::msg::DeltaLatitude& _delta_latitude) +{ + m_delta_latitude = _delta_latitude; +} + +/*! + * @brief This function moves the value in member delta_latitude + * @param _delta_latitude New value to be moved in member delta_latitude + */ +void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude( + etsi_its_cam_msgs::msg::DeltaLatitude&& _delta_latitude) +{ + m_delta_latitude = std::move(_delta_latitude); +} + +/*! + * @brief This function returns a constant reference to member delta_latitude + * @return Constant reference to member delta_latitude + */ +const etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude() const +{ + return m_delta_latitude; +} + +/*! + * @brief This function returns a reference to member delta_latitude + * @return Reference to member delta_latitude + */ +etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude() +{ + return m_delta_latitude; +} +/*! + * @brief This function copies the value in member delta_longitude + * @param _delta_longitude New value to be copied in member delta_longitude + */ +void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude( + const etsi_its_cam_msgs::msg::DeltaLongitude& _delta_longitude) +{ + m_delta_longitude = _delta_longitude; +} + +/*! + * @brief This function moves the value in member delta_longitude + * @param _delta_longitude New value to be moved in member delta_longitude + */ +void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude( + etsi_its_cam_msgs::msg::DeltaLongitude&& _delta_longitude) +{ + m_delta_longitude = std::move(_delta_longitude); +} + +/*! + * @brief This function returns a constant reference to member delta_longitude + * @return Constant reference to member delta_longitude + */ +const etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude() const +{ + return m_delta_longitude; +} + +/*! + * @brief This function returns a reference to member delta_longitude + * @return Reference to member delta_longitude + */ +etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude() +{ + return m_delta_longitude; +} +/*! + * @brief This function copies the value in member delta_altitude + * @param _delta_altitude New value to be copied in member delta_altitude + */ +void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude( + const etsi_its_cam_msgs::msg::DeltaAltitude& _delta_altitude) +{ + m_delta_altitude = _delta_altitude; +} + +/*! + * @brief This function moves the value in member delta_altitude + * @param _delta_altitude New value to be moved in member delta_altitude + */ +void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude( + etsi_its_cam_msgs::msg::DeltaAltitude&& _delta_altitude) +{ + m_delta_altitude = std::move(_delta_altitude); +} + +/*! + * @brief This function returns a constant reference to member delta_altitude + * @return Constant reference to member delta_altitude + */ +const etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude() const +{ + return m_delta_altitude; +} + +/*! + * @brief This function returns a reference to member delta_altitude + * @return Reference to member delta_altitude + */ +etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude() +{ + return m_delta_altitude; +} + +size_t etsi_its_cam_msgs::msg::DeltaReferencePosition::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::DeltaReferencePosition::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::DeltaReferencePosition::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.h new file mode 100644 index 00000000000..ce2a1c5045b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.h @@ -0,0 +1,271 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaReferencePosition.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_H_ + +#include "DeltaLongitude.h" +#include "DeltaAltitude.h" +#include "DeltaLatitude.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DeltaReferencePosition_SOURCE) +#define DeltaReferencePosition_DllAPI __declspec( dllexport ) +#else +#define DeltaReferencePosition_DllAPI __declspec( dllimport ) +#endif // DeltaReferencePosition_SOURCE +#else +#define DeltaReferencePosition_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DeltaReferencePosition_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure DeltaReferencePosition defined by the user in the IDL file. + * @ingroup DELTAREFERENCEPOSITION + */ + class DeltaReferencePosition + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeltaReferencePosition(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeltaReferencePosition(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. + */ + eProsima_user_DllExport DeltaReferencePosition( + const DeltaReferencePosition& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. + */ + eProsima_user_DllExport DeltaReferencePosition( + DeltaReferencePosition&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. + */ + eProsima_user_DllExport DeltaReferencePosition& operator =( + const DeltaReferencePosition& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. + */ + eProsima_user_DllExport DeltaReferencePosition& operator =( + DeltaReferencePosition&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaReferencePosition object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeltaReferencePosition& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaReferencePosition object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeltaReferencePosition& x) const; + + /*! + * @brief This function copies the value in member delta_latitude + * @param _delta_latitude New value to be copied in member delta_latitude + */ + eProsima_user_DllExport void delta_latitude( + const etsi_its_cam_msgs::msg::DeltaLatitude& _delta_latitude); + + /*! + * @brief This function moves the value in member delta_latitude + * @param _delta_latitude New value to be moved in member delta_latitude + */ + eProsima_user_DllExport void delta_latitude( + etsi_its_cam_msgs::msg::DeltaLatitude&& _delta_latitude); + + /*! + * @brief This function returns a constant reference to member delta_latitude + * @return Constant reference to member delta_latitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaLatitude& delta_latitude() const; + + /*! + * @brief This function returns a reference to member delta_latitude + * @return Reference to member delta_latitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaLatitude& delta_latitude(); + /*! + * @brief This function copies the value in member delta_longitude + * @param _delta_longitude New value to be copied in member delta_longitude + */ + eProsima_user_DllExport void delta_longitude( + const etsi_its_cam_msgs::msg::DeltaLongitude& _delta_longitude); + + /*! + * @brief This function moves the value in member delta_longitude + * @param _delta_longitude New value to be moved in member delta_longitude + */ + eProsima_user_DllExport void delta_longitude( + etsi_its_cam_msgs::msg::DeltaLongitude&& _delta_longitude); + + /*! + * @brief This function returns a constant reference to member delta_longitude + * @return Constant reference to member delta_longitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaLongitude& delta_longitude() const; + + /*! + * @brief This function returns a reference to member delta_longitude + * @return Reference to member delta_longitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaLongitude& delta_longitude(); + /*! + * @brief This function copies the value in member delta_altitude + * @param _delta_altitude New value to be copied in member delta_altitude + */ + eProsima_user_DllExport void delta_altitude( + const etsi_its_cam_msgs::msg::DeltaAltitude& _delta_altitude); + + /*! + * @brief This function moves the value in member delta_altitude + * @param _delta_altitude New value to be moved in member delta_altitude + */ + eProsima_user_DllExport void delta_altitude( + etsi_its_cam_msgs::msg::DeltaAltitude&& _delta_altitude); + + /*! + * @brief This function returns a constant reference to member delta_altitude + * @return Constant reference to member delta_altitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaAltitude& delta_altitude() const; + + /*! + * @brief This function returns a reference to member delta_altitude + * @return Reference to member delta_altitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaAltitude& delta_altitude(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DeltaReferencePosition& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::DeltaLatitude m_delta_latitude; + etsi_its_cam_msgs::msg::DeltaLongitude m_delta_longitude; + etsi_its_cam_msgs::msg::DeltaAltitude m_delta_altitude; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.cxx new file mode 100644 index 00000000000..474fa36d3d7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaReferencePositionPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DeltaReferencePositionPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + DeltaReferencePositionPubSubType::DeltaReferencePositionPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::DeltaReferencePosition_"); + auto type_size = DeltaReferencePosition::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DeltaReferencePosition::isKeyDefined(); + size_t keyLength = DeltaReferencePosition::getKeyMaxCdrSerializedSize() > 16 ? + DeltaReferencePosition::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DeltaReferencePositionPubSubType::~DeltaReferencePositionPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DeltaReferencePositionPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DeltaReferencePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DeltaReferencePositionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DeltaReferencePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DeltaReferencePositionPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DeltaReferencePositionPubSubType::createData() + { + return reinterpret_cast(new DeltaReferencePosition()); + } + + void DeltaReferencePositionPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DeltaReferencePositionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DeltaReferencePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DeltaReferencePosition::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DeltaReferencePosition::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.h new file mode 100644 index 00000000000..28c77e36f97 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaReferencePositionPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_PUBSUBTYPES_H_ + +#include +#include + +#include "DeltaReferencePosition.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated DeltaReferencePosition is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type DeltaReferencePosition defined by the user in the IDL file. + * @ingroup DELTAREFERENCEPOSITION + */ + class DeltaReferencePositionPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DeltaReferencePosition type; + + eProsima_user_DllExport DeltaReferencePositionPubSubType(); + + eProsima_user_DllExport virtual ~DeltaReferencePositionPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DeltaReferencePosition(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.cxx new file mode 100644 index 00000000000..b1b093bf57b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DriveDirection.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DriveDirection.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::DriveDirection::DriveDirection() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6dd93a21 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::DriveDirection::~DriveDirection() +{ +} + +etsi_its_cam_msgs::msg::DriveDirection::DriveDirection( + const DriveDirection& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DriveDirection::DriveDirection( + DriveDirection&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::DriveDirection::operator =( + const DriveDirection& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::DriveDirection::operator =( + DriveDirection&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::DriveDirection::operator ==( + const DriveDirection& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::DriveDirection::operator !=( + const DriveDirection& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::DriveDirection::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::DriveDirection::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DriveDirection& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::DriveDirection::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::DriveDirection::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::DriveDirection::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::DriveDirection::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::DriveDirection::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::DriveDirection::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::DriveDirection::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::DriveDirection::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.h new file mode 100644 index 00000000000..f36db68b856 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DriveDirection.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DriveDirection_SOURCE) +#define DriveDirection_DllAPI __declspec( dllexport ) +#else +#define DriveDirection_DllAPI __declspec( dllimport ) +#endif // DriveDirection_SOURCE +#else +#define DriveDirection_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DriveDirection_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DriveDirection_Constants { + const uint8_t FORWARD = 0; + const uint8_t BACKWARD = 1; + const uint8_t UNAVAILABLE = 2; + } // namespace DriveDirection_Constants + /*! + * @brief This class represents the structure DriveDirection defined by the user in the IDL file. + * @ingroup DRIVEDIRECTION + */ + class DriveDirection + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DriveDirection(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DriveDirection(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. + */ + eProsima_user_DllExport DriveDirection( + const DriveDirection& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. + */ + eProsima_user_DllExport DriveDirection( + DriveDirection&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. + */ + eProsima_user_DllExport DriveDirection& operator =( + const DriveDirection& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. + */ + eProsima_user_DllExport DriveDirection& operator =( + DriveDirection&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DriveDirection object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DriveDirection& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DriveDirection object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DriveDirection& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DriveDirection& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.cxx new file mode 100644 index 00000000000..7783faf2982 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DriveDirectionPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DriveDirectionPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DriveDirection_Constants { + + + + + } //End of namespace DriveDirection_Constants + DriveDirectionPubSubType::DriveDirectionPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::DriveDirection_"); + auto type_size = DriveDirection::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DriveDirection::isKeyDefined(); + size_t keyLength = DriveDirection::getKeyMaxCdrSerializedSize() > 16 ? + DriveDirection::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DriveDirectionPubSubType::~DriveDirectionPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DriveDirectionPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DriveDirection* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DriveDirectionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DriveDirection* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DriveDirectionPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DriveDirectionPubSubType::createData() + { + return reinterpret_cast(new DriveDirection()); + } + + void DriveDirectionPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DriveDirectionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DriveDirection* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DriveDirection::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DriveDirection::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.h new file mode 100644 index 00000000000..2f76ff111fe --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DriveDirectionPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_PUBSUBTYPES_H_ + +#include +#include + +#include "DriveDirection.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated DriveDirection is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace DriveDirection_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type DriveDirection defined by the user in the IDL file. + * @ingroup DRIVEDIRECTION + */ + class DriveDirectionPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DriveDirection type; + + eProsima_user_DllExport DriveDirectionPubSubType(); + + eProsima_user_DllExport virtual ~DriveDirectionPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) DriveDirection(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.cxx new file mode 100644 index 00000000000..0daf5932cc6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.cxx @@ -0,0 +1,249 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DrivingLaneStatus.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "DrivingLaneStatus.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::DrivingLaneStatus::DrivingLaneStatus() +{ + // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@15a902e7 + + // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7876d598 + m_bits_unused = 0; + +} + +etsi_its_cam_msgs::msg::DrivingLaneStatus::~DrivingLaneStatus() +{ + +} + +etsi_its_cam_msgs::msg::DrivingLaneStatus::DrivingLaneStatus( + const DrivingLaneStatus& x) +{ + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::DrivingLaneStatus::DrivingLaneStatus( + DrivingLaneStatus&& x) +{ + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::DrivingLaneStatus::operator =( + const DrivingLaneStatus& x) +{ + + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; + + return *this; +} + +etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::DrivingLaneStatus::operator =( + DrivingLaneStatus&& x) +{ + + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; + + return *this; +} + +bool etsi_its_cam_msgs::msg::DrivingLaneStatus::operator ==( + const DrivingLaneStatus& x) const +{ + + return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); +} + +bool etsi_its_cam_msgs::msg::DrivingLaneStatus::operator !=( + const DrivingLaneStatus& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::DrivingLaneStatus::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::DrivingLaneStatus::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DrivingLaneStatus& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.value().size() > 0) + { + current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::DrivingLaneStatus::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + scdr << m_bits_unused; + +} + +void etsi_its_cam_msgs::msg::DrivingLaneStatus::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; + dcdr >> m_bits_unused; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void etsi_its_cam_msgs::msg::DrivingLaneStatus::value( + const std::vector& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void etsi_its_cam_msgs::msg::DrivingLaneStatus::value( + std::vector&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::vector& etsi_its_cam_msgs::msg::DrivingLaneStatus::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::vector& etsi_its_cam_msgs::msg::DrivingLaneStatus::value() +{ + return m_value; +} +/*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ +void etsi_its_cam_msgs::msg::DrivingLaneStatus::bits_unused( + uint8_t _bits_unused) +{ + m_bits_unused = _bits_unused; +} + +/*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ +uint8_t etsi_its_cam_msgs::msg::DrivingLaneStatus::bits_unused() const +{ + return m_bits_unused; +} + +/*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ +uint8_t& etsi_its_cam_msgs::msg::DrivingLaneStatus::bits_unused() +{ + return m_bits_unused; +} + + +size_t etsi_its_cam_msgs::msg::DrivingLaneStatus::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::DrivingLaneStatus::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::DrivingLaneStatus::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.h new file mode 100644 index 00000000000..13f818ad751 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.h @@ -0,0 +1,240 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DrivingLaneStatus.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DrivingLaneStatus_SOURCE) +#define DrivingLaneStatus_DllAPI __declspec( dllexport ) +#else +#define DrivingLaneStatus_DllAPI __declspec( dllimport ) +#endif // DrivingLaneStatus_SOURCE +#else +#define DrivingLaneStatus_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DrivingLaneStatus_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DrivingLaneStatus_Constants { + const uint8_t MIN_SIZE_BITS = 1; + const uint8_t MAX_SIZE_BITS = 13; + } // namespace DrivingLaneStatus_Constants + /*! + * @brief This class represents the structure DrivingLaneStatus defined by the user in the IDL file. + * @ingroup DRIVINGLANESTATUS + */ + class DrivingLaneStatus + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DrivingLaneStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DrivingLaneStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. + */ + eProsima_user_DllExport DrivingLaneStatus( + const DrivingLaneStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. + */ + eProsima_user_DllExport DrivingLaneStatus( + DrivingLaneStatus&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. + */ + eProsima_user_DllExport DrivingLaneStatus& operator =( + const DrivingLaneStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. + */ + eProsima_user_DllExport DrivingLaneStatus& operator =( + DrivingLaneStatus&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DrivingLaneStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DrivingLaneStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DrivingLaneStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DrivingLaneStatus& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::DrivingLaneStatus& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_value; + uint8_t m_bits_unused; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.cxx new file mode 100644 index 00000000000..88981d7a021 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DrivingLaneStatusPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "DrivingLaneStatusPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace DrivingLaneStatus_Constants { + + + + } //End of namespace DrivingLaneStatus_Constants + DrivingLaneStatusPubSubType::DrivingLaneStatusPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::DrivingLaneStatus_"); + auto type_size = DrivingLaneStatus::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = DrivingLaneStatus::isKeyDefined(); + size_t keyLength = DrivingLaneStatus::getKeyMaxCdrSerializedSize() > 16 ? + DrivingLaneStatus::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DrivingLaneStatusPubSubType::~DrivingLaneStatusPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DrivingLaneStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + DrivingLaneStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool DrivingLaneStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + DrivingLaneStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function DrivingLaneStatusPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* DrivingLaneStatusPubSubType::createData() + { + return reinterpret_cast(new DrivingLaneStatus()); + } + + void DrivingLaneStatusPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DrivingLaneStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DrivingLaneStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + DrivingLaneStatus::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || DrivingLaneStatus::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/types/CarlaLineInvasionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.h similarity index 77% rename from LibCarla/source/carla/ros2/types/CarlaLineInvasionPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.h index a735ff75839..7cdb201e61a 100644 --- a/LibCarla/source/carla/ros2/types/CarlaLineInvasionPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.h @@ -13,42 +13,48 @@ // limitations under the License. /*! - * @file CarlaLineInvasionPubSubTypes.h + * @file DrivingLaneStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALINEINVASION_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALINEINVASION_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_PUBSUBTYPES_H_ #include #include -#include "CarlaLineInvasion.h" -#include "HeaderPubSubTypes.h" +#include "DrivingLaneStatus.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated CarlaLineInvasion is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated DrivingLaneStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace etsi_its_cam_msgs { namespace msg { + namespace DrivingLaneStatus_Constants + { + + + } /*! - * @brief This class represents the TopicDataType of the type LaneInvasionEvent defined by the user in the IDL file. - * @ingroup CARLALINEINVASION + * @brief This class represents the TopicDataType of the type DrivingLaneStatus defined by the user in the IDL file. + * @ingroup DRIVINGLANESTATUS */ - class LaneInvasionEventPubSubType : public eprosima::fastdds::dds::TopicDataType + class DrivingLaneStatusPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef LaneInvasionEvent type; - eProsima_user_DllExport LaneInvasionEventPubSubType(); + typedef DrivingLaneStatus type; + + eProsima_user_DllExport DrivingLaneStatusPubSubType(); - eProsima_user_DllExport virtual ~LaneInvasionEventPubSubType() override; + eProsima_user_DllExport virtual ~DrivingLaneStatusPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -96,10 +102,11 @@ namespace carla_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALINEINVASION_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.cxx new file mode 100644 index 00000000000..474bdbeac78 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.cxx @@ -0,0 +1,183 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmbarkationStatus.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "EmbarkationStatus.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::EmbarkationStatus::EmbarkationStatus() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4de025bf + m_value = false; + +} + +etsi_its_cam_msgs::msg::EmbarkationStatus::~EmbarkationStatus() +{ +} + +etsi_its_cam_msgs::msg::EmbarkationStatus::EmbarkationStatus( + const EmbarkationStatus& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::EmbarkationStatus::EmbarkationStatus( + EmbarkationStatus&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::EmbarkationStatus::operator =( + const EmbarkationStatus& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::EmbarkationStatus::operator =( + EmbarkationStatus&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::EmbarkationStatus::operator ==( + const EmbarkationStatus& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::EmbarkationStatus::operator !=( + const EmbarkationStatus& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::EmbarkationStatus::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::EmbarkationStatus::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::EmbarkationStatus& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::EmbarkationStatus::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::EmbarkationStatus::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::EmbarkationStatus::value( + bool _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +bool etsi_its_cam_msgs::msg::EmbarkationStatus::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +bool& etsi_its_cam_msgs::msg::EmbarkationStatus::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::EmbarkationStatus::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::EmbarkationStatus::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::EmbarkationStatus::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.h new file mode 100644 index 00000000000..fefe2a1836c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.h @@ -0,0 +1,210 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmbarkationStatus.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(EmbarkationStatus_SOURCE) +#define EmbarkationStatus_DllAPI __declspec( dllexport ) +#else +#define EmbarkationStatus_DllAPI __declspec( dllimport ) +#endif // EmbarkationStatus_SOURCE +#else +#define EmbarkationStatus_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define EmbarkationStatus_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure EmbarkationStatus defined by the user in the IDL file. + * @ingroup EMBARKATIONSTATUS + */ + class EmbarkationStatus + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EmbarkationStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EmbarkationStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. + */ + eProsima_user_DllExport EmbarkationStatus( + const EmbarkationStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. + */ + eProsima_user_DllExport EmbarkationStatus( + EmbarkationStatus&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. + */ + eProsima_user_DllExport EmbarkationStatus& operator =( + const EmbarkationStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. + */ + eProsima_user_DllExport EmbarkationStatus& operator =( + EmbarkationStatus&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmbarkationStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EmbarkationStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmbarkationStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EmbarkationStatus& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + bool _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport bool value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport bool& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::EmbarkationStatus& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + bool m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.cxx new file mode 100644 index 00000000000..d44e6b7a559 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmbarkationStatusPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "EmbarkationStatusPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + EmbarkationStatusPubSubType::EmbarkationStatusPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::EmbarkationStatus_"); + auto type_size = EmbarkationStatus::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = EmbarkationStatus::isKeyDefined(); + size_t keyLength = EmbarkationStatus::getKeyMaxCdrSerializedSize() > 16 ? + EmbarkationStatus::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + EmbarkationStatusPubSubType::~EmbarkationStatusPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool EmbarkationStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + EmbarkationStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool EmbarkationStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + EmbarkationStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function EmbarkationStatusPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* EmbarkationStatusPubSubType::createData() + { + return reinterpret_cast(new EmbarkationStatus()); + } + + void EmbarkationStatusPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool EmbarkationStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + EmbarkationStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + EmbarkationStatus::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || EmbarkationStatus::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.h new file mode 100644 index 00000000000..c5197616663 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmbarkationStatusPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_PUBSUBTYPES_H_ + +#include +#include + +#include "EmbarkationStatus.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated EmbarkationStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type EmbarkationStatus defined by the user in the IDL file. + * @ingroup EMBARKATIONSTATUS + */ + class EmbarkationStatusPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef EmbarkationStatus type; + + eProsima_user_DllExport EmbarkationStatusPubSubType(); + + eProsima_user_DllExport virtual ~EmbarkationStatusPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) EmbarkationStatus(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.cxx new file mode 100644 index 00000000000..10d5e7a80e7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.cxx @@ -0,0 +1,372 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "EmergencyContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::EmergencyContainer::EmergencyContainer() +{ + // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@182f1e9a + + // m_incident_indication com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6928f576 + + // m_incident_indication_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@660e9100 + m_incident_indication_is_present = false; + // m_emergency_priority com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@69f63d95 + + // m_emergency_priority_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9cd25ff + m_emergency_priority_is_present = false; + +} + +etsi_its_cam_msgs::msg::EmergencyContainer::~EmergencyContainer() +{ + + + + +} + +etsi_its_cam_msgs::msg::EmergencyContainer::EmergencyContainer( + const EmergencyContainer& x) +{ + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; + m_incident_indication = x.m_incident_indication; + m_incident_indication_is_present = x.m_incident_indication_is_present; + m_emergency_priority = x.m_emergency_priority; + m_emergency_priority_is_present = x.m_emergency_priority_is_present; +} + +etsi_its_cam_msgs::msg::EmergencyContainer::EmergencyContainer( + EmergencyContainer&& x) +{ + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); + m_incident_indication = std::move(x.m_incident_indication); + m_incident_indication_is_present = x.m_incident_indication_is_present; + m_emergency_priority = std::move(x.m_emergency_priority); + m_emergency_priority_is_present = x.m_emergency_priority_is_present; +} + +etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::EmergencyContainer::operator =( + const EmergencyContainer& x) +{ + + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; + m_incident_indication = x.m_incident_indication; + m_incident_indication_is_present = x.m_incident_indication_is_present; + m_emergency_priority = x.m_emergency_priority; + m_emergency_priority_is_present = x.m_emergency_priority_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::EmergencyContainer::operator =( + EmergencyContainer&& x) +{ + + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); + m_incident_indication = std::move(x.m_incident_indication); + m_incident_indication_is_present = x.m_incident_indication_is_present; + m_emergency_priority = std::move(x.m_emergency_priority); + m_emergency_priority_is_present = x.m_emergency_priority_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::EmergencyContainer::operator ==( + const EmergencyContainer& x) const +{ + + return (m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && m_incident_indication == x.m_incident_indication && m_incident_indication_is_present == x.m_incident_indication_is_present && m_emergency_priority == x.m_emergency_priority && m_emergency_priority_is_present == x.m_emergency_priority_is_present); +} + +bool etsi_its_cam_msgs::msg::EmergencyContainer::operator !=( + const EmergencyContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::EmergencyContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CauseCode::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::EmergencyPriority::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::EmergencyContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::EmergencyContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CauseCode::getCdrSerializedSize(data.incident_indication(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::EmergencyPriority::getCdrSerializedSize(data.emergency_priority(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::EmergencyContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_light_bar_siren_in_use; + scdr << m_incident_indication; + scdr << m_incident_indication_is_present; + scdr << m_emergency_priority; + scdr << m_emergency_priority_is_present; + +} + +void etsi_its_cam_msgs::msg::EmergencyContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_light_bar_siren_in_use; + dcdr >> m_incident_indication; + dcdr >> m_incident_indication_is_present; + dcdr >> m_emergency_priority; + dcdr >> m_emergency_priority_is_present; +} + +/*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = _light_bar_siren_in_use; +} + +/*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); +} + +/*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ +const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use() const +{ + return m_light_bar_siren_in_use; +} + +/*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ +etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use() +{ + return m_light_bar_siren_in_use; +} +/*! + * @brief This function copies the value in member incident_indication + * @param _incident_indication New value to be copied in member incident_indication + */ +void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication( + const etsi_its_cam_msgs::msg::CauseCode& _incident_indication) +{ + m_incident_indication = _incident_indication; +} + +/*! + * @brief This function moves the value in member incident_indication + * @param _incident_indication New value to be moved in member incident_indication + */ +void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication( + etsi_its_cam_msgs::msg::CauseCode&& _incident_indication) +{ + m_incident_indication = std::move(_incident_indication); +} + +/*! + * @brief This function returns a constant reference to member incident_indication + * @return Constant reference to member incident_indication + */ +const etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication() const +{ + return m_incident_indication; +} + +/*! + * @brief This function returns a reference to member incident_indication + * @return Reference to member incident_indication + */ +etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication() +{ + return m_incident_indication; +} +/*! + * @brief This function sets a value in member incident_indication_is_present + * @param _incident_indication_is_present New value for member incident_indication_is_present + */ +void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication_is_present( + bool _incident_indication_is_present) +{ + m_incident_indication_is_present = _incident_indication_is_present; +} + +/*! + * @brief This function returns the value of member incident_indication_is_present + * @return Value of member incident_indication_is_present + */ +bool etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication_is_present() const +{ + return m_incident_indication_is_present; +} + +/*! + * @brief This function returns a reference to member incident_indication_is_present + * @return Reference to member incident_indication_is_present + */ +bool& etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication_is_present() +{ + return m_incident_indication_is_present; +} + +/*! + * @brief This function copies the value in member emergency_priority + * @param _emergency_priority New value to be copied in member emergency_priority + */ +void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority( + const etsi_its_cam_msgs::msg::EmergencyPriority& _emergency_priority) +{ + m_emergency_priority = _emergency_priority; +} + +/*! + * @brief This function moves the value in member emergency_priority + * @param _emergency_priority New value to be moved in member emergency_priority + */ +void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority( + etsi_its_cam_msgs::msg::EmergencyPriority&& _emergency_priority) +{ + m_emergency_priority = std::move(_emergency_priority); +} + +/*! + * @brief This function returns a constant reference to member emergency_priority + * @return Constant reference to member emergency_priority + */ +const etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority() const +{ + return m_emergency_priority; +} + +/*! + * @brief This function returns a reference to member emergency_priority + * @return Reference to member emergency_priority + */ +etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority() +{ + return m_emergency_priority; +} +/*! + * @brief This function sets a value in member emergency_priority_is_present + * @param _emergency_priority_is_present New value for member emergency_priority_is_present + */ +void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority_is_present( + bool _emergency_priority_is_present) +{ + m_emergency_priority_is_present = _emergency_priority_is_present; +} + +/*! + * @brief This function returns the value of member emergency_priority_is_present + * @return Value of member emergency_priority_is_present + */ +bool etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority_is_present() const +{ + return m_emergency_priority_is_present; +} + +/*! + * @brief This function returns a reference to member emergency_priority_is_present + * @return Reference to member emergency_priority_is_present + */ +bool& etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority_is_present() +{ + return m_emergency_priority_is_present; +} + + +size_t etsi_its_cam_msgs::msg::EmergencyContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::EmergencyContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::EmergencyContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.h new file mode 100644 index 00000000000..ac0796f9349 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.h @@ -0,0 +1,311 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_H_ + +#include "CauseCode.h" +#include "EmergencyPriority.h" +#include "LightBarSirenInUse.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(EmergencyContainer_SOURCE) +#define EmergencyContainer_DllAPI __declspec( dllexport ) +#else +#define EmergencyContainer_DllAPI __declspec( dllimport ) +#endif // EmergencyContainer_SOURCE +#else +#define EmergencyContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define EmergencyContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure EmergencyContainer defined by the user in the IDL file. + * @ingroup EMERGENCYCONTAINER + */ + class EmergencyContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EmergencyContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EmergencyContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. + */ + eProsima_user_DllExport EmergencyContainer( + const EmergencyContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. + */ + eProsima_user_DllExport EmergencyContainer( + EmergencyContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. + */ + eProsima_user_DllExport EmergencyContainer& operator =( + const EmergencyContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. + */ + eProsima_user_DllExport EmergencyContainer& operator =( + EmergencyContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmergencyContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EmergencyContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmergencyContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EmergencyContainer& x) const; + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + /*! + * @brief This function copies the value in member incident_indication + * @param _incident_indication New value to be copied in member incident_indication + */ + eProsima_user_DllExport void incident_indication( + const etsi_its_cam_msgs::msg::CauseCode& _incident_indication); + + /*! + * @brief This function moves the value in member incident_indication + * @param _incident_indication New value to be moved in member incident_indication + */ + eProsima_user_DllExport void incident_indication( + etsi_its_cam_msgs::msg::CauseCode&& _incident_indication); + + /*! + * @brief This function returns a constant reference to member incident_indication + * @return Constant reference to member incident_indication + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCode& incident_indication() const; + + /*! + * @brief This function returns a reference to member incident_indication + * @return Reference to member incident_indication + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCode& incident_indication(); + /*! + * @brief This function sets a value in member incident_indication_is_present + * @param _incident_indication_is_present New value for member incident_indication_is_present + */ + eProsima_user_DllExport void incident_indication_is_present( + bool _incident_indication_is_present); + + /*! + * @brief This function returns the value of member incident_indication_is_present + * @return Value of member incident_indication_is_present + */ + eProsima_user_DllExport bool incident_indication_is_present() const; + + /*! + * @brief This function returns a reference to member incident_indication_is_present + * @return Reference to member incident_indication_is_present + */ + eProsima_user_DllExport bool& incident_indication_is_present(); + + /*! + * @brief This function copies the value in member emergency_priority + * @param _emergency_priority New value to be copied in member emergency_priority + */ + eProsima_user_DllExport void emergency_priority( + const etsi_its_cam_msgs::msg::EmergencyPriority& _emergency_priority); + + /*! + * @brief This function moves the value in member emergency_priority + * @param _emergency_priority New value to be moved in member emergency_priority + */ + eProsima_user_DllExport void emergency_priority( + etsi_its_cam_msgs::msg::EmergencyPriority&& _emergency_priority); + + /*! + * @brief This function returns a constant reference to member emergency_priority + * @return Constant reference to member emergency_priority + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmergencyPriority& emergency_priority() const; + + /*! + * @brief This function returns a reference to member emergency_priority + * @return Reference to member emergency_priority + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::EmergencyPriority& emergency_priority(); + /*! + * @brief This function sets a value in member emergency_priority_is_present + * @param _emergency_priority_is_present New value for member emergency_priority_is_present + */ + eProsima_user_DllExport void emergency_priority_is_present( + bool _emergency_priority_is_present); + + /*! + * @brief This function returns the value of member emergency_priority_is_present + * @return Value of member emergency_priority_is_present + */ + eProsima_user_DllExport bool emergency_priority_is_present() const; + + /*! + * @brief This function returns a reference to member emergency_priority_is_present + * @return Reference to member emergency_priority_is_present + */ + eProsima_user_DllExport bool& emergency_priority_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::EmergencyContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + etsi_its_cam_msgs::msg::CauseCode m_incident_indication; + bool m_incident_indication_is_present; + etsi_its_cam_msgs::msg::EmergencyPriority m_emergency_priority; + bool m_emergency_priority_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.cxx new file mode 100644 index 00000000000..e5fbe9557bc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "EmergencyContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + EmergencyContainerPubSubType::EmergencyContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::EmergencyContainer_"); + auto type_size = EmergencyContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = EmergencyContainer::isKeyDefined(); + size_t keyLength = EmergencyContainer::getKeyMaxCdrSerializedSize() > 16 ? + EmergencyContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + EmergencyContainerPubSubType::~EmergencyContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool EmergencyContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + EmergencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool EmergencyContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + EmergencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function EmergencyContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* EmergencyContainerPubSubType::createData() + { + return reinterpret_cast(new EmergencyContainer()); + } + + void EmergencyContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool EmergencyContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + EmergencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + EmergencyContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || EmergencyContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.h new file mode 100644 index 00000000000..d2170db0c27 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "EmergencyContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated EmergencyContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type EmergencyContainer defined by the user in the IDL file. + * @ingroup EMERGENCYCONTAINER + */ + class EmergencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef EmergencyContainer type; + + eProsima_user_DllExport EmergencyContainerPubSubType(); + + eProsima_user_DllExport virtual ~EmergencyContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.cxx new file mode 100644 index 00000000000..2a222e75520 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.cxx @@ -0,0 +1,250 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyPriority.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "EmergencyPriority.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::EmergencyPriority::EmergencyPriority() +{ + // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@579d011c + + // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3670f00 + m_bits_unused = 0; + +} + +etsi_its_cam_msgs::msg::EmergencyPriority::~EmergencyPriority() +{ + +} + +etsi_its_cam_msgs::msg::EmergencyPriority::EmergencyPriority( + const EmergencyPriority& x) +{ + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::EmergencyPriority::EmergencyPriority( + EmergencyPriority&& x) +{ + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::EmergencyPriority::operator =( + const EmergencyPriority& x) +{ + + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; + + return *this; +} + +etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::EmergencyPriority::operator =( + EmergencyPriority&& x) +{ + + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; + + return *this; +} + +bool etsi_its_cam_msgs::msg::EmergencyPriority::operator ==( + const EmergencyPriority& x) const +{ + + return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); +} + +bool etsi_its_cam_msgs::msg::EmergencyPriority::operator !=( + const EmergencyPriority& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::EmergencyPriority::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::EmergencyPriority::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::EmergencyPriority& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.value().size() > 0) + { + current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::EmergencyPriority::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + scdr << m_bits_unused; + +} + +void etsi_its_cam_msgs::msg::EmergencyPriority::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; + dcdr >> m_bits_unused; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void etsi_its_cam_msgs::msg::EmergencyPriority::value( + const std::vector& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void etsi_its_cam_msgs::msg::EmergencyPriority::value( + std::vector&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::vector& etsi_its_cam_msgs::msg::EmergencyPriority::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::vector& etsi_its_cam_msgs::msg::EmergencyPriority::value() +{ + return m_value; +} +/*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ +void etsi_its_cam_msgs::msg::EmergencyPriority::bits_unused( + uint8_t _bits_unused) +{ + m_bits_unused = _bits_unused; +} + +/*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ +uint8_t etsi_its_cam_msgs::msg::EmergencyPriority::bits_unused() const +{ + return m_bits_unused; +} + +/*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ +uint8_t& etsi_its_cam_msgs::msg::EmergencyPriority::bits_unused() +{ + return m_bits_unused; +} + + +size_t etsi_its_cam_msgs::msg::EmergencyPriority::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::EmergencyPriority::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::EmergencyPriority::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.h new file mode 100644 index 00000000000..bd680728921 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.h @@ -0,0 +1,241 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyPriority.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(EmergencyPriority_SOURCE) +#define EmergencyPriority_DllAPI __declspec( dllexport ) +#else +#define EmergencyPriority_DllAPI __declspec( dllimport ) +#endif // EmergencyPriority_SOURCE +#else +#define EmergencyPriority_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define EmergencyPriority_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace EmergencyPriority_Constants { + const uint8_t SIZE_BITS = 2; + const uint8_t BIT_INDEX_REQUEST_FOR_RIGHT_OF_WAY = 0; + const uint8_t BIT_INDEX_REQUEST_FOR_FREE_CROSSING_AT_A_TRAFFIC_LIGHT = 1; + } // namespace EmergencyPriority_Constants + /*! + * @brief This class represents the structure EmergencyPriority defined by the user in the IDL file. + * @ingroup EMERGENCYPRIORITY + */ + class EmergencyPriority + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EmergencyPriority(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EmergencyPriority(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. + */ + eProsima_user_DllExport EmergencyPriority( + const EmergencyPriority& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. + */ + eProsima_user_DllExport EmergencyPriority( + EmergencyPriority&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. + */ + eProsima_user_DllExport EmergencyPriority& operator =( + const EmergencyPriority& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. + */ + eProsima_user_DllExport EmergencyPriority& operator =( + EmergencyPriority&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmergencyPriority object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EmergencyPriority& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmergencyPriority object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EmergencyPriority& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::EmergencyPriority& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_value; + uint8_t m_bits_unused; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.cxx new file mode 100644 index 00000000000..4e446121723 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyPriorityPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "EmergencyPriorityPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace EmergencyPriority_Constants { + + + + + } //End of namespace EmergencyPriority_Constants + EmergencyPriorityPubSubType::EmergencyPriorityPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::EmergencyPriority_"); + auto type_size = EmergencyPriority::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = EmergencyPriority::isKeyDefined(); + size_t keyLength = EmergencyPriority::getKeyMaxCdrSerializedSize() > 16 ? + EmergencyPriority::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + EmergencyPriorityPubSubType::~EmergencyPriorityPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool EmergencyPriorityPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + EmergencyPriority* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool EmergencyPriorityPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + EmergencyPriority* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function EmergencyPriorityPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* EmergencyPriorityPubSubType::createData() + { + return reinterpret_cast(new EmergencyPriority()); + } + + void EmergencyPriorityPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool EmergencyPriorityPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + EmergencyPriority* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + EmergencyPriority::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || EmergencyPriority::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.h new file mode 100644 index 00000000000..8433906892a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyPriorityPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_PUBSUBTYPES_H_ + +#include +#include + +#include "EmergencyPriority.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated EmergencyPriority is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace EmergencyPriority_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type EmergencyPriority defined by the user in the IDL file. + * @ingroup EMERGENCYPRIORITY + */ + class EmergencyPriorityPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef EmergencyPriority type; + + eProsima_user_DllExport EmergencyPriorityPubSubType(); + + eProsima_user_DllExport virtual ~EmergencyPriorityPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.cxx new file mode 100644 index 00000000000..528e147d29c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.cxx @@ -0,0 +1,256 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ExteriorLights.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ExteriorLights.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + +etsi_its_cam_msgs::msg::ExteriorLights::ExteriorLights() +{ + // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@1a1d3c1a + + // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1c65121 + m_bits_unused = 0; + +} + +etsi_its_cam_msgs::msg::ExteriorLights::~ExteriorLights() +{ + +} + +etsi_its_cam_msgs::msg::ExteriorLights::ExteriorLights( + const ExteriorLights& x) +{ + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::ExteriorLights::ExteriorLights( + ExteriorLights&& x) +{ + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::ExteriorLights::operator =( + const ExteriorLights& x) +{ + + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; + + return *this; +} + +etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::ExteriorLights::operator =( + ExteriorLights&& x) +{ + + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; + + return *this; +} + +bool etsi_its_cam_msgs::msg::ExteriorLights::operator ==( + const ExteriorLights& x) const +{ + + return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); +} + +bool etsi_its_cam_msgs::msg::ExteriorLights::operator !=( + const ExteriorLights& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ExteriorLights::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ExteriorLights::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ExteriorLights& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.value().size() > 0) + { + current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ExteriorLights::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + scdr << m_bits_unused; + +} + +void etsi_its_cam_msgs::msg::ExteriorLights::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; + dcdr >> m_bits_unused; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void etsi_its_cam_msgs::msg::ExteriorLights::value( + const std::vector& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void etsi_its_cam_msgs::msg::ExteriorLights::value( + std::vector&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::vector& etsi_its_cam_msgs::msg::ExteriorLights::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::vector& etsi_its_cam_msgs::msg::ExteriorLights::value() +{ + return m_value; +} +/*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ +void etsi_its_cam_msgs::msg::ExteriorLights::bits_unused( + uint8_t _bits_unused) +{ + m_bits_unused = _bits_unused; +} + +/*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ +uint8_t etsi_its_cam_msgs::msg::ExteriorLights::bits_unused() const +{ + return m_bits_unused; +} + +/*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ +uint8_t& etsi_its_cam_msgs::msg::ExteriorLights::bits_unused() +{ + return m_bits_unused; +} + + +size_t etsi_its_cam_msgs::msg::ExteriorLights::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ExteriorLights::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ExteriorLights::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.h new file mode 100644 index 00000000000..8e7328dec49 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.h @@ -0,0 +1,247 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ExteriorLights.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ExteriorLights_SOURCE) +#define ExteriorLights_DllAPI __declspec( dllexport ) +#else +#define ExteriorLights_DllAPI __declspec( dllimport ) +#endif // ExteriorLights_SOURCE +#else +#define ExteriorLights_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ExteriorLights_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ExteriorLights_Constants { + const uint8_t SIZE_BITS = 8; + const uint8_t BIT_INDEX_LOW_BEAM_HEADLIGHTS_ON = 0; + const uint8_t BIT_INDEX_HIGH_BEAM_HEADLIGHTS_ON = 1; + const uint8_t BIT_INDEX_LEFT_TURN_SIGNAL_ON = 2; + const uint8_t BIT_INDEX_RIGHT_TURN_SIGNAL_ON = 3; + const uint8_t BIT_INDEX_DAYTIME_RUNNING_LIGHTS_ON = 4; + const uint8_t BIT_INDEX_REVERSE_LIGHT_ON = 5; + const uint8_t BIT_INDEX_FOG_LIGHT_ON = 6; + const uint8_t BIT_INDEX_PARKING_LIGHTS_ON = 7; + } // namespace ExteriorLights_Constants + /*! + * @brief This class represents the structure ExteriorLights defined by the user in the IDL file. + * @ingroup EXTERIORLIGHTS + */ + class ExteriorLights + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ExteriorLights(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ExteriorLights(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. + */ + eProsima_user_DllExport ExteriorLights( + const ExteriorLights& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. + */ + eProsima_user_DllExport ExteriorLights( + ExteriorLights&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. + */ + eProsima_user_DllExport ExteriorLights& operator =( + const ExteriorLights& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. + */ + eProsima_user_DllExport ExteriorLights& operator =( + ExteriorLights&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ExteriorLights object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ExteriorLights& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ExteriorLights object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ExteriorLights& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ExteriorLights& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_value; + uint8_t m_bits_unused; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.cxx new file mode 100644 index 00000000000..08a0205150f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.cxx @@ -0,0 +1,188 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ExteriorLightsPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ExteriorLightsPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ExteriorLights_Constants { + + + + + + + + + + + } //End of namespace ExteriorLights_Constants + ExteriorLightsPubSubType::ExteriorLightsPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ExteriorLights_"); + auto type_size = ExteriorLights::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ExteriorLights::isKeyDefined(); + size_t keyLength = ExteriorLights::getKeyMaxCdrSerializedSize() > 16 ? + ExteriorLights::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ExteriorLightsPubSubType::~ExteriorLightsPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ExteriorLightsPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ExteriorLights* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ExteriorLightsPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ExteriorLights* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ExteriorLightsPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ExteriorLightsPubSubType::createData() + { + return reinterpret_cast(new ExteriorLights()); + } + + void ExteriorLightsPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ExteriorLightsPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ExteriorLights* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ExteriorLights::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ExteriorLights::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/types/NavSatFixPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.h similarity index 76% rename from LibCarla/source/carla/ros2/types/NavSatFixPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.h index d6bf7437198..9f17312da29 100644 --- a/LibCarla/source/carla/ros2/types/NavSatFixPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.h @@ -13,47 +13,55 @@ // limitations under the License. /*! - * @file NavSatFixPubSubTypes.h + * @file ExteriorLightsPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_PUBSUBTYPES_H_ #include #include -#include "NavSatFix.h" - -#include "HeaderPubSubTypes.h" -#include "NavSatStatusPubSubTypes.h" +#include "ExteriorLights.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated NavSatFix is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated ExteriorLights is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace sensor_msgs +namespace etsi_its_cam_msgs { namespace msg { - typedef std::array sensor_msgs__NavSatFix__double_array_9; + namespace ExteriorLights_Constants + { + + + + + + + + + } /*! - * @brief This class represents the TopicDataType of the type NavSatFix defined by the user in the IDL file. - * @ingroup NAVSATFIX + * @brief This class represents the TopicDataType of the type ExteriorLights defined by the user in the IDL file. + * @ingroup EXTERIORLIGHTS */ - class NavSatFixPubSubType : public eprosima::fastdds::dds::TopicDataType + class ExteriorLightsPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef NavSatFix type; + typedef ExteriorLights type; - eProsima_user_DllExport NavSatFixPubSubType(); + eProsima_user_DllExport ExteriorLightsPubSubType(); - eProsima_user_DllExport virtual ~NavSatFixPubSubType() override; + eProsima_user_DllExport virtual ~ExteriorLightsPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -101,10 +109,11 @@ namespace sensor_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.cxx new file mode 100644 index 00000000000..5297c4ca1ed --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GenerationDeltaTime.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "GenerationDeltaTime.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::GenerationDeltaTime::GenerationDeltaTime() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1c80e49b + m_value = 0; + +} + +etsi_its_cam_msgs::msg::GenerationDeltaTime::~GenerationDeltaTime() +{ +} + +etsi_its_cam_msgs::msg::GenerationDeltaTime::GenerationDeltaTime( + const GenerationDeltaTime& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::GenerationDeltaTime::GenerationDeltaTime( + GenerationDeltaTime&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::GenerationDeltaTime::operator =( + const GenerationDeltaTime& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::GenerationDeltaTime::operator =( + GenerationDeltaTime&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::GenerationDeltaTime::operator ==( + const GenerationDeltaTime& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::GenerationDeltaTime::operator !=( + const GenerationDeltaTime& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::GenerationDeltaTime::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::GenerationDeltaTime::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::GenerationDeltaTime& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::GenerationDeltaTime::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::GenerationDeltaTime::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::GenerationDeltaTime::value( + uint16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint16_t etsi_its_cam_msgs::msg::GenerationDeltaTime::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint16_t& etsi_its_cam_msgs::msg::GenerationDeltaTime::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::GenerationDeltaTime::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::GenerationDeltaTime::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::GenerationDeltaTime::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.h new file mode 100644 index 00000000000..f60dc0d2b54 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GenerationDeltaTime.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(GenerationDeltaTime_SOURCE) +#define GenerationDeltaTime_DllAPI __declspec( dllexport ) +#else +#define GenerationDeltaTime_DllAPI __declspec( dllimport ) +#endif // GenerationDeltaTime_SOURCE +#else +#define GenerationDeltaTime_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define GenerationDeltaTime_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace GenerationDeltaTime_Constants { + const uint16_t MIN = 0; + const uint16_t MAX = 65535; + const uint16_t ONE_MILLI_SEC = 1; + } // namespace GenerationDeltaTime_Constants + /*! + * @brief This class represents the structure GenerationDeltaTime defined by the user in the IDL file. + * @ingroup GENERATIONDELTATIME + */ + class GenerationDeltaTime + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GenerationDeltaTime(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GenerationDeltaTime(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. + */ + eProsima_user_DllExport GenerationDeltaTime( + const GenerationDeltaTime& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. + */ + eProsima_user_DllExport GenerationDeltaTime( + GenerationDeltaTime&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. + */ + eProsima_user_DllExport GenerationDeltaTime& operator =( + const GenerationDeltaTime& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. + */ + eProsima_user_DllExport GenerationDeltaTime& operator =( + GenerationDeltaTime&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::GenerationDeltaTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GenerationDeltaTime& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::GenerationDeltaTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GenerationDeltaTime& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::GenerationDeltaTime& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.cxx new file mode 100644 index 00000000000..ce2720ba3de --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GenerationDeltaTimePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "GenerationDeltaTimePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace GenerationDeltaTime_Constants { + + + + + } //End of namespace GenerationDeltaTime_Constants + GenerationDeltaTimePubSubType::GenerationDeltaTimePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::GenerationDeltaTime_"); + auto type_size = GenerationDeltaTime::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = GenerationDeltaTime::isKeyDefined(); + size_t keyLength = GenerationDeltaTime::getKeyMaxCdrSerializedSize() > 16 ? + GenerationDeltaTime::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + GenerationDeltaTimePubSubType::~GenerationDeltaTimePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool GenerationDeltaTimePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + GenerationDeltaTime* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool GenerationDeltaTimePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + GenerationDeltaTime* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function GenerationDeltaTimePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* GenerationDeltaTimePubSubType::createData() + { + return reinterpret_cast(new GenerationDeltaTime()); + } + + void GenerationDeltaTimePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool GenerationDeltaTimePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + GenerationDeltaTime* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + GenerationDeltaTime::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || GenerationDeltaTime::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.h new file mode 100644 index 00000000000..3cc56e8f5da --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GenerationDeltaTimePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_PUBSUBTYPES_H_ + +#include +#include + +#include "GenerationDeltaTime.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated GenerationDeltaTime is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace GenerationDeltaTime_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type GenerationDeltaTime defined by the user in the IDL file. + * @ingroup GENERATIONDELTATIME + */ + class GenerationDeltaTimePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef GenerationDeltaTime type; + + eProsima_user_DllExport GenerationDeltaTimePubSubType(); + + eProsima_user_DllExport virtual ~GenerationDeltaTimePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) GenerationDeltaTime(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.cxx new file mode 100644 index 00000000000..b64e21673e6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HardShoulderStatus.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HardShoulderStatus.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::HardShoulderStatus::HardShoulderStatus() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4b6579e8 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::HardShoulderStatus::~HardShoulderStatus() +{ +} + +etsi_its_cam_msgs::msg::HardShoulderStatus::HardShoulderStatus( + const HardShoulderStatus& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::HardShoulderStatus::HardShoulderStatus( + HardShoulderStatus&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::HardShoulderStatus::operator =( + const HardShoulderStatus& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::HardShoulderStatus::operator =( + HardShoulderStatus&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::HardShoulderStatus::operator ==( + const HardShoulderStatus& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::HardShoulderStatus::operator !=( + const HardShoulderStatus& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::HardShoulderStatus::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::HardShoulderStatus::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::HardShoulderStatus& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::HardShoulderStatus::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::HardShoulderStatus::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::HardShoulderStatus::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::HardShoulderStatus::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::HardShoulderStatus::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::HardShoulderStatus::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::HardShoulderStatus::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::HardShoulderStatus::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.h new file mode 100644 index 00000000000..074a54f459b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HardShoulderStatus.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HardShoulderStatus_SOURCE) +#define HardShoulderStatus_DllAPI __declspec( dllexport ) +#else +#define HardShoulderStatus_DllAPI __declspec( dllimport ) +#endif // HardShoulderStatus_SOURCE +#else +#define HardShoulderStatus_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HardShoulderStatus_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace HardShoulderStatus_Constants { + const uint8_t AVAILABLE_FOR_STOPPING = 0; + const uint8_t CLOSED = 1; + const uint8_t AVAILABLE_FOR_DRIVING = 2; + } // namespace HardShoulderStatus_Constants + /*! + * @brief This class represents the structure HardShoulderStatus defined by the user in the IDL file. + * @ingroup HARDSHOULDERSTATUS + */ + class HardShoulderStatus + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HardShoulderStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HardShoulderStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. + */ + eProsima_user_DllExport HardShoulderStatus( + const HardShoulderStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. + */ + eProsima_user_DllExport HardShoulderStatus( + HardShoulderStatus&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. + */ + eProsima_user_DllExport HardShoulderStatus& operator =( + const HardShoulderStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. + */ + eProsima_user_DllExport HardShoulderStatus& operator =( + HardShoulderStatus&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HardShoulderStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HardShoulderStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HardShoulderStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HardShoulderStatus& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::HardShoulderStatus& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.cxx new file mode 100644 index 00000000000..3dbbade709c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HardShoulderStatusPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "HardShoulderStatusPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace HardShoulderStatus_Constants { + + + + + } //End of namespace HardShoulderStatus_Constants + HardShoulderStatusPubSubType::HardShoulderStatusPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::HardShoulderStatus_"); + auto type_size = HardShoulderStatus::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = HardShoulderStatus::isKeyDefined(); + size_t keyLength = HardShoulderStatus::getKeyMaxCdrSerializedSize() > 16 ? + HardShoulderStatus::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + HardShoulderStatusPubSubType::~HardShoulderStatusPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool HardShoulderStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + HardShoulderStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool HardShoulderStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + HardShoulderStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function HardShoulderStatusPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* HardShoulderStatusPubSubType::createData() + { + return reinterpret_cast(new HardShoulderStatus()); + } + + void HardShoulderStatusPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool HardShoulderStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + HardShoulderStatus* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + HardShoulderStatus::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || HardShoulderStatus::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.h new file mode 100644 index 00000000000..e638ab6b0ba --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HardShoulderStatusPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_PUBSUBTYPES_H_ + +#include +#include + +#include "HardShoulderStatus.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated HardShoulderStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace HardShoulderStatus_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type HardShoulderStatus defined by the user in the IDL file. + * @ingroup HARDSHOULDERSTATUS + */ + class HardShoulderStatusPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef HardShoulderStatus type; + + eProsima_user_DllExport HardShoulderStatusPubSubType(); + + eProsima_user_DllExport virtual ~HardShoulderStatusPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) HardShoulderStatus(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.cxx new file mode 100644 index 00000000000..752564e14a1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Heading.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Heading.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::Heading::Heading() +{ + // m_heading_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4650a407 + + // m_heading_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@30135202 + + +} + +etsi_its_cam_msgs::msg::Heading::~Heading() +{ + +} + +etsi_its_cam_msgs::msg::Heading::Heading( + const Heading& x) +{ + m_heading_value = x.m_heading_value; + m_heading_confidence = x.m_heading_confidence; +} + +etsi_its_cam_msgs::msg::Heading::Heading( + Heading&& x) +{ + m_heading_value = std::move(x.m_heading_value); + m_heading_confidence = std::move(x.m_heading_confidence); +} + +etsi_its_cam_msgs::msg::Heading& etsi_its_cam_msgs::msg::Heading::operator =( + const Heading& x) +{ + + m_heading_value = x.m_heading_value; + m_heading_confidence = x.m_heading_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::Heading& etsi_its_cam_msgs::msg::Heading::operator =( + Heading&& x) +{ + + m_heading_value = std::move(x.m_heading_value); + m_heading_confidence = std::move(x.m_heading_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::Heading::operator ==( + const Heading& x) const +{ + + return (m_heading_value == x.m_heading_value && m_heading_confidence == x.m_heading_confidence); +} + +bool etsi_its_cam_msgs::msg::Heading::operator !=( + const Heading& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::Heading::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::HeadingValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::HeadingConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::Heading::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Heading& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::HeadingValue::getCdrSerializedSize(data.heading_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::HeadingConfidence::getCdrSerializedSize(data.heading_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::Heading::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_heading_value; + scdr << m_heading_confidence; + +} + +void etsi_its_cam_msgs::msg::Heading::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_heading_value; + dcdr >> m_heading_confidence; +} + +/*! + * @brief This function copies the value in member heading_value + * @param _heading_value New value to be copied in member heading_value + */ +void etsi_its_cam_msgs::msg::Heading::heading_value( + const etsi_its_cam_msgs::msg::HeadingValue& _heading_value) +{ + m_heading_value = _heading_value; +} + +/*! + * @brief This function moves the value in member heading_value + * @param _heading_value New value to be moved in member heading_value + */ +void etsi_its_cam_msgs::msg::Heading::heading_value( + etsi_its_cam_msgs::msg::HeadingValue&& _heading_value) +{ + m_heading_value = std::move(_heading_value); +} + +/*! + * @brief This function returns a constant reference to member heading_value + * @return Constant reference to member heading_value + */ +const etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::Heading::heading_value() const +{ + return m_heading_value; +} + +/*! + * @brief This function returns a reference to member heading_value + * @return Reference to member heading_value + */ +etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::Heading::heading_value() +{ + return m_heading_value; +} +/*! + * @brief This function copies the value in member heading_confidence + * @param _heading_confidence New value to be copied in member heading_confidence + */ +void etsi_its_cam_msgs::msg::Heading::heading_confidence( + const etsi_its_cam_msgs::msg::HeadingConfidence& _heading_confidence) +{ + m_heading_confidence = _heading_confidence; +} + +/*! + * @brief This function moves the value in member heading_confidence + * @param _heading_confidence New value to be moved in member heading_confidence + */ +void etsi_its_cam_msgs::msg::Heading::heading_confidence( + etsi_its_cam_msgs::msg::HeadingConfidence&& _heading_confidence) +{ + m_heading_confidence = std::move(_heading_confidence); +} + +/*! + * @brief This function returns a constant reference to member heading_confidence + * @return Constant reference to member heading_confidence + */ +const etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::Heading::heading_confidence() const +{ + return m_heading_confidence; +} + +/*! + * @brief This function returns a reference to member heading_confidence + * @return Reference to member heading_confidence + */ +etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::Heading::heading_confidence() +{ + return m_heading_confidence; +} + +size_t etsi_its_cam_msgs::msg::Heading::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::Heading::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::Heading::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.h new file mode 100644 index 00000000000..6af346dd677 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Heading.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_H_ + +#include "HeadingConfidence.h" +#include "HeadingValue.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Heading_SOURCE) +#define Heading_DllAPI __declspec( dllexport ) +#else +#define Heading_DllAPI __declspec( dllimport ) +#endif // Heading_SOURCE +#else +#define Heading_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Heading_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure Heading defined by the user in the IDL file. + * @ingroup HEADING + */ + class Heading + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Heading(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Heading(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. + */ + eProsima_user_DllExport Heading( + const Heading& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. + */ + eProsima_user_DllExport Heading( + Heading&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. + */ + eProsima_user_DllExport Heading& operator =( + const Heading& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. + */ + eProsima_user_DllExport Heading& operator =( + Heading&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Heading object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Heading& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Heading object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Heading& x) const; + + /*! + * @brief This function copies the value in member heading_value + * @param _heading_value New value to be copied in member heading_value + */ + eProsima_user_DllExport void heading_value( + const etsi_its_cam_msgs::msg::HeadingValue& _heading_value); + + /*! + * @brief This function moves the value in member heading_value + * @param _heading_value New value to be moved in member heading_value + */ + eProsima_user_DllExport void heading_value( + etsi_its_cam_msgs::msg::HeadingValue&& _heading_value); + + /*! + * @brief This function returns a constant reference to member heading_value + * @return Constant reference to member heading_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingValue& heading_value() const; + + /*! + * @brief This function returns a reference to member heading_value + * @return Reference to member heading_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingValue& heading_value(); + /*! + * @brief This function copies the value in member heading_confidence + * @param _heading_confidence New value to be copied in member heading_confidence + */ + eProsima_user_DllExport void heading_confidence( + const etsi_its_cam_msgs::msg::HeadingConfidence& _heading_confidence); + + /*! + * @brief This function moves the value in member heading_confidence + * @param _heading_confidence New value to be moved in member heading_confidence + */ + eProsima_user_DllExport void heading_confidence( + etsi_its_cam_msgs::msg::HeadingConfidence&& _heading_confidence); + + /*! + * @brief This function returns a constant reference to member heading_confidence + * @return Constant reference to member heading_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingConfidence& heading_confidence() const; + + /*! + * @brief This function returns a reference to member heading_confidence + * @return Reference to member heading_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingConfidence& heading_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Heading& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::HeadingValue m_heading_value; + etsi_its_cam_msgs::msg::HeadingConfidence m_heading_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.cxx new file mode 100644 index 00000000000..a1a724e300b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.cxx @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingConfidence.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HeadingConfidence.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + +etsi_its_cam_msgs::msg::HeadingConfidence::HeadingConfidence() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@551de37d + m_value = 0; + +} + +etsi_its_cam_msgs::msg::HeadingConfidence::~HeadingConfidence() +{ +} + +etsi_its_cam_msgs::msg::HeadingConfidence::HeadingConfidence( + const HeadingConfidence& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::HeadingConfidence::HeadingConfidence( + HeadingConfidence&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::HeadingConfidence::operator =( + const HeadingConfidence& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::HeadingConfidence::operator =( + HeadingConfidence&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::HeadingConfidence::operator ==( + const HeadingConfidence& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::HeadingConfidence::operator !=( + const HeadingConfidence& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::HeadingConfidence::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::HeadingConfidence::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::HeadingConfidence& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::HeadingConfidence::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::HeadingConfidence::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::HeadingConfidence::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::HeadingConfidence::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::HeadingConfidence::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::HeadingConfidence::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::HeadingConfidence::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::HeadingConfidence::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.h new file mode 100644 index 00000000000..624e986be8d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.h @@ -0,0 +1,218 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingConfidence.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HeadingConfidence_SOURCE) +#define HeadingConfidence_DllAPI __declspec( dllexport ) +#else +#define HeadingConfidence_DllAPI __declspec( dllimport ) +#endif // HeadingConfidence_SOURCE +#else +#define HeadingConfidence_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HeadingConfidence_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace HeadingConfidence_Constants { + const uint8_t MIN = 1; + const uint8_t MAX = 127; + const uint8_t EQUAL_OR_WITHIN_ZERO_POINT_ONE_DEGREE = 1; + const uint8_t EQUAL_OR_WITHIN_ONE_DEGREE = 10; + const uint8_t OUT_OF_RANGE = 126; + const uint8_t UNAVAILABLE = 127; + } // namespace HeadingConfidence_Constants + /*! + * @brief This class represents the structure HeadingConfidence defined by the user in the IDL file. + * @ingroup HEADINGCONFIDENCE + */ + class HeadingConfidence + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HeadingConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HeadingConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. + */ + eProsima_user_DllExport HeadingConfidence( + const HeadingConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. + */ + eProsima_user_DllExport HeadingConfidence( + HeadingConfidence&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. + */ + eProsima_user_DllExport HeadingConfidence& operator =( + const HeadingConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. + */ + eProsima_user_DllExport HeadingConfidence& operator =( + HeadingConfidence&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HeadingConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HeadingConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HeadingConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HeadingConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::HeadingConfidence& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.cxx new file mode 100644 index 00000000000..0e4159f952f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.cxx @@ -0,0 +1,185 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingConfidencePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "HeadingConfidencePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace HeadingConfidence_Constants { + + + + + + + + } //End of namespace HeadingConfidence_Constants + HeadingConfidencePubSubType::HeadingConfidencePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::HeadingConfidence_"); + auto type_size = HeadingConfidence::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = HeadingConfidence::isKeyDefined(); + size_t keyLength = HeadingConfidence::getKeyMaxCdrSerializedSize() > 16 ? + HeadingConfidence::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + HeadingConfidencePubSubType::~HeadingConfidencePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool HeadingConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + HeadingConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool HeadingConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + HeadingConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function HeadingConfidencePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* HeadingConfidencePubSubType::createData() + { + return reinterpret_cast(new HeadingConfidence()); + } + + void HeadingConfidencePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool HeadingConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + HeadingConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + HeadingConfidence::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || HeadingConfidence::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.h new file mode 100644 index 00000000000..5e3cd54f2db --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.h @@ -0,0 +1,116 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingConfidencePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_PUBSUBTYPES_H_ + +#include +#include + +#include "HeadingConfidence.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated HeadingConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace HeadingConfidence_Constants + { + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type HeadingConfidence defined by the user in the IDL file. + * @ingroup HEADINGCONFIDENCE + */ + class HeadingConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef HeadingConfidence type; + + eProsima_user_DllExport HeadingConfidencePubSubType(); + + eProsima_user_DllExport virtual ~HeadingConfidencePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) HeadingConfidence(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.cxx new file mode 100644 index 00000000000..d5e1f68613f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "HeadingPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + HeadingPubSubType::HeadingPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::Heading_"); + auto type_size = Heading::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Heading::isKeyDefined(); + size_t keyLength = Heading::getKeyMaxCdrSerializedSize() > 16 ? + Heading::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + HeadingPubSubType::~HeadingPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool HeadingPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Heading* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool HeadingPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Heading* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function HeadingPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* HeadingPubSubType::createData() + { + return reinterpret_cast(new Heading()); + } + + void HeadingPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool HeadingPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Heading* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Heading::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Heading::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.h new file mode 100644 index 00000000000..515f0cfb0a5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_PUBSUBTYPES_H_ + +#include +#include + +#include "Heading.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated Heading is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type Heading defined by the user in the IDL file. + * @ingroup HEADING + */ + class HeadingPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Heading type; + + eProsima_user_DllExport HeadingPubSubType(); + + eProsima_user_DllExport virtual ~HeadingPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Heading(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.cxx new file mode 100644 index 00000000000..253bf878a58 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.cxx @@ -0,0 +1,191 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HeadingValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + +etsi_its_cam_msgs::msg::HeadingValue::HeadingValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7f9ab969 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::HeadingValue::~HeadingValue() +{ +} + +etsi_its_cam_msgs::msg::HeadingValue::HeadingValue( + const HeadingValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::HeadingValue::HeadingValue( + HeadingValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::HeadingValue::operator =( + const HeadingValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::HeadingValue::operator =( + HeadingValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::HeadingValue::operator ==( + const HeadingValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::HeadingValue::operator !=( + const HeadingValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::HeadingValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::HeadingValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::HeadingValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::HeadingValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::HeadingValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::HeadingValue::value( + uint16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint16_t etsi_its_cam_msgs::msg::HeadingValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint16_t& etsi_its_cam_msgs::msg::HeadingValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::HeadingValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::HeadingValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::HeadingValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.h new file mode 100644 index 00000000000..62e93e34c6b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.h @@ -0,0 +1,219 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HeadingValue_SOURCE) +#define HeadingValue_DllAPI __declspec( dllexport ) +#else +#define HeadingValue_DllAPI __declspec( dllimport ) +#endif // HeadingValue_SOURCE +#else +#define HeadingValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HeadingValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace HeadingValue_Constants { + const uint16_t MIN = 0; + const uint16_t MAX = 3601; + const uint16_t WGS_84_NORTH = 0; + const uint16_t WGS_84_EAST = 900; + const uint16_t WGS_84_SOUTH = 1800; + const uint16_t WGS_84_WEST = 2700; + const uint16_t UNAVAILABLE = 3601; + } // namespace HeadingValue_Constants + /*! + * @brief This class represents the structure HeadingValue defined by the user in the IDL file. + * @ingroup HEADINGVALUE + */ + class HeadingValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HeadingValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HeadingValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. + */ + eProsima_user_DllExport HeadingValue( + const HeadingValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. + */ + eProsima_user_DllExport HeadingValue( + HeadingValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. + */ + eProsima_user_DllExport HeadingValue& operator =( + const HeadingValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. + */ + eProsima_user_DllExport HeadingValue& operator =( + HeadingValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HeadingValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HeadingValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HeadingValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HeadingValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::HeadingValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.cxx new file mode 100644 index 00000000000..0c04139e390 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.cxx @@ -0,0 +1,186 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "HeadingValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace HeadingValue_Constants { + + + + + + + + + } //End of namespace HeadingValue_Constants + HeadingValuePubSubType::HeadingValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::HeadingValue_"); + auto type_size = HeadingValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = HeadingValue::isKeyDefined(); + size_t keyLength = HeadingValue::getKeyMaxCdrSerializedSize() > 16 ? + HeadingValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + HeadingValuePubSubType::~HeadingValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool HeadingValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + HeadingValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool HeadingValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + HeadingValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function HeadingValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* HeadingValuePubSubType::createData() + { + return reinterpret_cast(new HeadingValue()); + } + + void HeadingValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool HeadingValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + HeadingValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + HeadingValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || HeadingValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.h new file mode 100644 index 00000000000..4e494522cdb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.h @@ -0,0 +1,117 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "HeadingValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated HeadingValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace HeadingValue_Constants + { + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type HeadingValue defined by the user in the IDL file. + * @ingroup HEADINGVALUE + */ + class HeadingValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef HeadingValue type; + + eProsima_user_DllExport HeadingValuePubSubType(); + + eProsima_user_DllExport virtual ~HeadingValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) HeadingValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.cxx new file mode 100644 index 00000000000..7b5800c4c25 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.cxx @@ -0,0 +1,284 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HighFrequencyContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HighFrequencyContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::HighFrequencyContainer::HighFrequencyContainer() +{ + // m_choice com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9257031 + m_choice = 0; + // m_basic_vehicle_container_high_frequency com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@75201592 + + // m_rsu_container_high_frequency com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7726e185 + + +} + +etsi_its_cam_msgs::msg::HighFrequencyContainer::~HighFrequencyContainer() +{ + + +} + +etsi_its_cam_msgs::msg::HighFrequencyContainer::HighFrequencyContainer( + const HighFrequencyContainer& x) +{ + m_choice = x.m_choice; + m_basic_vehicle_container_high_frequency = x.m_basic_vehicle_container_high_frequency; + m_rsu_container_high_frequency = x.m_rsu_container_high_frequency; +} + +etsi_its_cam_msgs::msg::HighFrequencyContainer::HighFrequencyContainer( + HighFrequencyContainer&& x) +{ + m_choice = x.m_choice; + m_basic_vehicle_container_high_frequency = std::move(x.m_basic_vehicle_container_high_frequency); + m_rsu_container_high_frequency = std::move(x.m_rsu_container_high_frequency); +} + +etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::HighFrequencyContainer::operator =( + const HighFrequencyContainer& x) +{ + + m_choice = x.m_choice; + m_basic_vehicle_container_high_frequency = x.m_basic_vehicle_container_high_frequency; + m_rsu_container_high_frequency = x.m_rsu_container_high_frequency; + + return *this; +} + +etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::HighFrequencyContainer::operator =( + HighFrequencyContainer&& x) +{ + + m_choice = x.m_choice; + m_basic_vehicle_container_high_frequency = std::move(x.m_basic_vehicle_container_high_frequency); + m_rsu_container_high_frequency = std::move(x.m_rsu_container_high_frequency); + + return *this; +} + +bool etsi_its_cam_msgs::msg::HighFrequencyContainer::operator ==( + const HighFrequencyContainer& x) const +{ + + return (m_choice == x.m_choice && m_basic_vehicle_container_high_frequency == x.m_basic_vehicle_container_high_frequency && m_rsu_container_high_frequency == x.m_rsu_container_high_frequency); +} + +bool etsi_its_cam_msgs::msg::HighFrequencyContainer::operator !=( + const HighFrequencyContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::HighFrequencyContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::HighFrequencyContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::HighFrequencyContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getCdrSerializedSize(data.basic_vehicle_container_high_frequency(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getCdrSerializedSize(data.rsu_container_high_frequency(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::HighFrequencyContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_choice; + scdr << m_basic_vehicle_container_high_frequency; + scdr << m_rsu_container_high_frequency; + +} + +void etsi_its_cam_msgs::msg::HighFrequencyContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_choice; + dcdr >> m_basic_vehicle_container_high_frequency; + dcdr >> m_rsu_container_high_frequency; +} + +/*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ +void etsi_its_cam_msgs::msg::HighFrequencyContainer::choice( + uint8_t _choice) +{ + m_choice = _choice; +} + +/*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ +uint8_t etsi_its_cam_msgs::msg::HighFrequencyContainer::choice() const +{ + return m_choice; +} + +/*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ +uint8_t& etsi_its_cam_msgs::msg::HighFrequencyContainer::choice() +{ + return m_choice; +} + +/*! + * @brief This function copies the value in member basic_vehicle_container_high_frequency + * @param _basic_vehicle_container_high_frequency New value to be copied in member basic_vehicle_container_high_frequency + */ +void etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_high_frequency( + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& _basic_vehicle_container_high_frequency) +{ + m_basic_vehicle_container_high_frequency = _basic_vehicle_container_high_frequency; +} + +/*! + * @brief This function moves the value in member basic_vehicle_container_high_frequency + * @param _basic_vehicle_container_high_frequency New value to be moved in member basic_vehicle_container_high_frequency + */ +void etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_high_frequency( + etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency&& _basic_vehicle_container_high_frequency) +{ + m_basic_vehicle_container_high_frequency = std::move(_basic_vehicle_container_high_frequency); +} + +/*! + * @brief This function returns a constant reference to member basic_vehicle_container_high_frequency + * @return Constant reference to member basic_vehicle_container_high_frequency + */ +const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_high_frequency() const +{ + return m_basic_vehicle_container_high_frequency; +} + +/*! + * @brief This function returns a reference to member basic_vehicle_container_high_frequency + * @return Reference to member basic_vehicle_container_high_frequency + */ +etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_high_frequency() +{ + return m_basic_vehicle_container_high_frequency; +} +/*! + * @brief This function copies the value in member rsu_container_high_frequency + * @param _rsu_container_high_frequency New value to be copied in member rsu_container_high_frequency + */ +void etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequency( + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& _rsu_container_high_frequency) +{ + m_rsu_container_high_frequency = _rsu_container_high_frequency; +} + +/*! + * @brief This function moves the value in member rsu_container_high_frequency + * @param _rsu_container_high_frequency New value to be moved in member rsu_container_high_frequency + */ +void etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequency( + etsi_its_cam_msgs::msg::RSUContainerHighFrequency&& _rsu_container_high_frequency) +{ + m_rsu_container_high_frequency = std::move(_rsu_container_high_frequency); +} + +/*! + * @brief This function returns a constant reference to member rsu_container_high_frequency + * @return Constant reference to member rsu_container_high_frequency + */ +const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequency() const +{ + return m_rsu_container_high_frequency; +} + +/*! + * @brief This function returns a reference to member rsu_container_high_frequency + * @return Reference to member rsu_container_high_frequency + */ +etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequency() +{ + return m_rsu_container_high_frequency; +} + +size_t etsi_its_cam_msgs::msg::HighFrequencyContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::HighFrequencyContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::HighFrequencyContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.h new file mode 100644 index 00000000000..34cb0e20473 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.h @@ -0,0 +1,268 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HighFrequencyContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_H_ + +#include "RSUContainerHighFrequency.h" +#include "BasicVehicleContainerHighFrequency.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HighFrequencyContainer_SOURCE) +#define HighFrequencyContainer_DllAPI __declspec( dllexport ) +#else +#define HighFrequencyContainer_DllAPI __declspec( dllimport ) +#endif // HighFrequencyContainer_SOURCE +#else +#define HighFrequencyContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HighFrequencyContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace HighFrequencyContainer_Constants { + const uint8_t CHOICE_BASIC_VEHICLE_CONTAINER_HIGH_FREQUENCY = 0; + const uint8_t CHOICE_RSU_CONTAINER_HIGH_FREQUENCY = 1; + } // namespace HighFrequencyContainer_Constants + /*! + * @brief This class represents the structure HighFrequencyContainer defined by the user in the IDL file. + * @ingroup HIGHFREQUENCYCONTAINER + */ + class HighFrequencyContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HighFrequencyContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HighFrequencyContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. + */ + eProsima_user_DllExport HighFrequencyContainer( + const HighFrequencyContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. + */ + eProsima_user_DllExport HighFrequencyContainer( + HighFrequencyContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. + */ + eProsima_user_DllExport HighFrequencyContainer& operator =( + const HighFrequencyContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. + */ + eProsima_user_DllExport HighFrequencyContainer& operator =( + HighFrequencyContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HighFrequencyContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HighFrequencyContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HighFrequencyContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HighFrequencyContainer& x) const; + + /*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ + eProsima_user_DllExport void choice( + uint8_t _choice); + + /*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ + eProsima_user_DllExport uint8_t choice() const; + + /*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ + eProsima_user_DllExport uint8_t& choice(); + + /*! + * @brief This function copies the value in member basic_vehicle_container_high_frequency + * @param _basic_vehicle_container_high_frequency New value to be copied in member basic_vehicle_container_high_frequency + */ + eProsima_user_DllExport void basic_vehicle_container_high_frequency( + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& _basic_vehicle_container_high_frequency); + + /*! + * @brief This function moves the value in member basic_vehicle_container_high_frequency + * @param _basic_vehicle_container_high_frequency New value to be moved in member basic_vehicle_container_high_frequency + */ + eProsima_user_DllExport void basic_vehicle_container_high_frequency( + etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency&& _basic_vehicle_container_high_frequency); + + /*! + * @brief This function returns a constant reference to member basic_vehicle_container_high_frequency + * @return Constant reference to member basic_vehicle_container_high_frequency + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& basic_vehicle_container_high_frequency() const; + + /*! + * @brief This function returns a reference to member basic_vehicle_container_high_frequency + * @return Reference to member basic_vehicle_container_high_frequency + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& basic_vehicle_container_high_frequency(); + /*! + * @brief This function copies the value in member rsu_container_high_frequency + * @param _rsu_container_high_frequency New value to be copied in member rsu_container_high_frequency + */ + eProsima_user_DllExport void rsu_container_high_frequency( + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& _rsu_container_high_frequency); + + /*! + * @brief This function moves the value in member rsu_container_high_frequency + * @param _rsu_container_high_frequency New value to be moved in member rsu_container_high_frequency + */ + eProsima_user_DllExport void rsu_container_high_frequency( + etsi_its_cam_msgs::msg::RSUContainerHighFrequency&& _rsu_container_high_frequency); + + /*! + * @brief This function returns a constant reference to member rsu_container_high_frequency + * @return Constant reference to member rsu_container_high_frequency + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& rsu_container_high_frequency() const; + + /*! + * @brief This function returns a reference to member rsu_container_high_frequency + * @return Reference to member rsu_container_high_frequency + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::RSUContainerHighFrequency& rsu_container_high_frequency(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::HighFrequencyContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_choice; + etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency m_basic_vehicle_container_high_frequency; + etsi_its_cam_msgs::msg::RSUContainerHighFrequency m_rsu_container_high_frequency; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.cxx new file mode 100644 index 00000000000..f65737b3134 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HighFrequencyContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "HighFrequencyContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace HighFrequencyContainer_Constants { + + + + } //End of namespace HighFrequencyContainer_Constants + HighFrequencyContainerPubSubType::HighFrequencyContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::HighFrequencyContainer_"); + auto type_size = HighFrequencyContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = HighFrequencyContainer::isKeyDefined(); + size_t keyLength = HighFrequencyContainer::getKeyMaxCdrSerializedSize() > 16 ? + HighFrequencyContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + HighFrequencyContainerPubSubType::~HighFrequencyContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool HighFrequencyContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + HighFrequencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool HighFrequencyContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + HighFrequencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function HighFrequencyContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* HighFrequencyContainerPubSubType::createData() + { + return reinterpret_cast(new HighFrequencyContainer()); + } + + void HighFrequencyContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool HighFrequencyContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + HighFrequencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + HighFrequencyContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || HighFrequencyContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.h new file mode 100644 index 00000000000..14ffe108b2e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.h @@ -0,0 +1,112 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HighFrequencyContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "HighFrequencyContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated HighFrequencyContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace HighFrequencyContainer_Constants + { + + + } + /*! + * @brief This class represents the TopicDataType of the type HighFrequencyContainer defined by the user in the IDL file. + * @ingroup HIGHFREQUENCYCONTAINER + */ + class HighFrequencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef HighFrequencyContainer type; + + eProsima_user_DllExport HighFrequencyContainerPubSubType(); + + eProsima_user_DllExport virtual ~HighFrequencyContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.cxx new file mode 100644 index 00000000000..4bac3bd3096 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.cxx @@ -0,0 +1,294 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ItsPduHeader.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ItsPduHeader.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + + + + +etsi_its_cam_msgs::msg::ItsPduHeader::ItsPduHeader() +{ + // m_protocol_version com.eprosima.idl.parser.typecode.PrimitiveTypeCode@640f11a1 + m_protocol_version = 0; + // m_message_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5c10f1c3 + m_message_id = 0; + // m_station_id com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7ac2e39b + + +} + +etsi_its_cam_msgs::msg::ItsPduHeader::~ItsPduHeader() +{ + + +} + +etsi_its_cam_msgs::msg::ItsPduHeader::ItsPduHeader( + const ItsPduHeader& x) +{ + m_protocol_version = x.m_protocol_version; + m_message_id = x.m_message_id; + m_station_id = x.m_station_id; +} + +etsi_its_cam_msgs::msg::ItsPduHeader::ItsPduHeader( + ItsPduHeader&& x) +{ + m_protocol_version = x.m_protocol_version; + m_message_id = x.m_message_id; + m_station_id = std::move(x.m_station_id); +} + +etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::ItsPduHeader::operator =( + const ItsPduHeader& x) +{ + + m_protocol_version = x.m_protocol_version; + m_message_id = x.m_message_id; + m_station_id = x.m_station_id; + + return *this; +} + +etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::ItsPduHeader::operator =( + ItsPduHeader&& x) +{ + + m_protocol_version = x.m_protocol_version; + m_message_id = x.m_message_id; + m_station_id = std::move(x.m_station_id); + + return *this; +} + +bool etsi_its_cam_msgs::msg::ItsPduHeader::operator ==( + const ItsPduHeader& x) const +{ + + return (m_protocol_version == x.m_protocol_version && m_message_id == x.m_message_id && m_station_id == x.m_station_id); +} + +bool etsi_its_cam_msgs::msg::ItsPduHeader::operator !=( + const ItsPduHeader& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ItsPduHeader::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::StationID::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ItsPduHeader::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ItsPduHeader& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::StationID::getCdrSerializedSize(data.station_id(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ItsPduHeader::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_protocol_version; + scdr << m_message_id; + scdr << m_station_id; + +} + +void etsi_its_cam_msgs::msg::ItsPduHeader::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_protocol_version; + dcdr >> m_message_id; + dcdr >> m_station_id; +} + +/*! + * @brief This function sets a value in member protocol_version + * @param _protocol_version New value for member protocol_version + */ +void etsi_its_cam_msgs::msg::ItsPduHeader::protocol_version( + uint8_t _protocol_version) +{ + m_protocol_version = _protocol_version; +} + +/*! + * @brief This function returns the value of member protocol_version + * @return Value of member protocol_version + */ +uint8_t etsi_its_cam_msgs::msg::ItsPduHeader::protocol_version() const +{ + return m_protocol_version; +} + +/*! + * @brief This function returns a reference to member protocol_version + * @return Reference to member protocol_version + */ +uint8_t& etsi_its_cam_msgs::msg::ItsPduHeader::protocol_version() +{ + return m_protocol_version; +} + +/*! + * @brief This function sets a value in member message_id + * @param _message_id New value for member message_id + */ +void etsi_its_cam_msgs::msg::ItsPduHeader::message_id( + uint8_t _message_id) +{ + m_message_id = _message_id; +} + +/*! + * @brief This function returns the value of member message_id + * @return Value of member message_id + */ +uint8_t etsi_its_cam_msgs::msg::ItsPduHeader::message_id() const +{ + return m_message_id; +} + +/*! + * @brief This function returns a reference to member message_id + * @return Reference to member message_id + */ +uint8_t& etsi_its_cam_msgs::msg::ItsPduHeader::message_id() +{ + return m_message_id; +} + +/*! + * @brief This function copies the value in member station_id + * @param _station_id New value to be copied in member station_id + */ +void etsi_its_cam_msgs::msg::ItsPduHeader::station_id( + const etsi_its_cam_msgs::msg::StationID& _station_id) +{ + m_station_id = _station_id; +} + +/*! + * @brief This function moves the value in member station_id + * @param _station_id New value to be moved in member station_id + */ +void etsi_its_cam_msgs::msg::ItsPduHeader::station_id( + etsi_its_cam_msgs::msg::StationID&& _station_id) +{ + m_station_id = std::move(_station_id); +} + +/*! + * @brief This function returns a constant reference to member station_id + * @return Constant reference to member station_id + */ +const etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::ItsPduHeader::station_id() const +{ + return m_station_id; +} + +/*! + * @brief This function returns a reference to member station_id + * @return Reference to member station_id + */ +etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::ItsPduHeader::station_id() +{ + return m_station_id; +} + +size_t etsi_its_cam_msgs::msg::ItsPduHeader::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ItsPduHeader::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ItsPduHeader::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.h new file mode 100644 index 00000000000..916953056a0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.h @@ -0,0 +1,276 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ItsPduHeader.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_H_ + +#include "StationID.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ItsPduHeader_SOURCE) +#define ItsPduHeader_DllAPI __declspec( dllexport ) +#else +#define ItsPduHeader_DllAPI __declspec( dllimport ) +#endif // ItsPduHeader_SOURCE +#else +#define ItsPduHeader_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ItsPduHeader_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ItsPduHeader_Constants { + const uint8_t PROTOCOL_VERSION_MIN = 0; + const uint8_t PROTOCOL_VERSION_MAX = 255; + const uint8_t MESSAGE_ID_MIN = 0; + const uint8_t MESSAGE_ID_MAX = 255; + const uint8_t MESSAGE_ID_DENM = 1; + const uint8_t MESSAGE_ID_CAM = 2; + const uint8_t MESSAGE_ID_POI = 3; + const uint8_t MESSAGE_ID_SPATEM = 4; + const uint8_t MESSAGE_ID_MAPEM = 5; + const uint8_t MESSAGE_ID_IVIM = 6; + const uint8_t MESSAGE_ID_EV_RSR = 7; + const uint8_t MESSAGE_ID_TISTPGTRANSACTION = 8; + const uint8_t MESSAGE_ID_SREM = 9; + const uint8_t MESSAGE_ID_SSEM = 10; + const uint8_t MESSAGE_ID_EVCSN = 11; + const uint8_t MESSAGE_ID_SAEM = 12; + const uint8_t MESSAGE_ID_RTCMEM = 13; + } // namespace ItsPduHeader_Constants + /*! + * @brief This class represents the structure ItsPduHeader defined by the user in the IDL file. + * @ingroup ITSPDUHEADER + */ + class ItsPduHeader + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ItsPduHeader(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ItsPduHeader(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. + */ + eProsima_user_DllExport ItsPduHeader( + const ItsPduHeader& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. + */ + eProsima_user_DllExport ItsPduHeader( + ItsPduHeader&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. + */ + eProsima_user_DllExport ItsPduHeader& operator =( + const ItsPduHeader& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. + */ + eProsima_user_DllExport ItsPduHeader& operator =( + ItsPduHeader&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ItsPduHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ItsPduHeader& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ItsPduHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ItsPduHeader& x) const; + + /*! + * @brief This function sets a value in member protocol_version + * @param _protocol_version New value for member protocol_version + */ + eProsima_user_DllExport void protocol_version( + uint8_t _protocol_version); + + /*! + * @brief This function returns the value of member protocol_version + * @return Value of member protocol_version + */ + eProsima_user_DllExport uint8_t protocol_version() const; + + /*! + * @brief This function returns a reference to member protocol_version + * @return Reference to member protocol_version + */ + eProsima_user_DllExport uint8_t& protocol_version(); + + /*! + * @brief This function sets a value in member message_id + * @param _message_id New value for member message_id + */ + eProsima_user_DllExport void message_id( + uint8_t _message_id); + + /*! + * @brief This function returns the value of member message_id + * @return Value of member message_id + */ + eProsima_user_DllExport uint8_t message_id() const; + + /*! + * @brief This function returns a reference to member message_id + * @return Reference to member message_id + */ + eProsima_user_DllExport uint8_t& message_id(); + + /*! + * @brief This function copies the value in member station_id + * @param _station_id New value to be copied in member station_id + */ + eProsima_user_DllExport void station_id( + const etsi_its_cam_msgs::msg::StationID& _station_id); + + /*! + * @brief This function moves the value in member station_id + * @param _station_id New value to be moved in member station_id + */ + eProsima_user_DllExport void station_id( + etsi_its_cam_msgs::msg::StationID&& _station_id); + + /*! + * @brief This function returns a constant reference to member station_id + * @return Constant reference to member station_id + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::StationID& station_id() const; + + /*! + * @brief This function returns a reference to member station_id + * @return Reference to member station_id + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::StationID& station_id(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ItsPduHeader& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_protocol_version; + uint8_t m_message_id; + etsi_its_cam_msgs::msg::StationID m_station_id; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.cxx new file mode 100644 index 00000000000..2bf6b9d99e2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.cxx @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ItsPduHeaderPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ItsPduHeaderPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ItsPduHeader_Constants { + + + + + + + + + + + + + + + + + + + } //End of namespace ItsPduHeader_Constants + ItsPduHeaderPubSubType::ItsPduHeaderPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ItsPduHeader_"); + auto type_size = ItsPduHeader::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ItsPduHeader::isKeyDefined(); + size_t keyLength = ItsPduHeader::getKeyMaxCdrSerializedSize() > 16 ? + ItsPduHeader::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ItsPduHeaderPubSubType::~ItsPduHeaderPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ItsPduHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ItsPduHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ItsPduHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ItsPduHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ItsPduHeaderPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ItsPduHeaderPubSubType::createData() + { + return reinterpret_cast(new ItsPduHeader()); + } + + void ItsPduHeaderPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ItsPduHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ItsPduHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ItsPduHeader::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ItsPduHeader::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h new file mode 100644 index 00000000000..1abb674c166 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h @@ -0,0 +1,127 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ItsPduHeaderPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_PUBSUBTYPES_H_ + +#include +#include + +#include "ItsPduHeader.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ItsPduHeader is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace ItsPduHeader_Constants + { + + + + + + + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type ItsPduHeader defined by the user in the IDL file. + * @ingroup ITSPDUHEADER + */ + class ItsPduHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ItsPduHeader type; + + eProsima_user_DllExport ItsPduHeaderPubSubType(); + + eProsima_user_DllExport virtual ~ItsPduHeaderPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) ItsPduHeader(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.cxx new file mode 100644 index 00000000000..058af42fbea --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.cxx @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LanePosition.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LanePosition.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + +etsi_its_cam_msgs::msg::LanePosition::LanePosition() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1440c311 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::LanePosition::~LanePosition() +{ +} + +etsi_its_cam_msgs::msg::LanePosition::LanePosition( + const LanePosition& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::LanePosition::LanePosition( + LanePosition&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::LanePosition::operator =( + const LanePosition& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::LanePosition::operator =( + LanePosition&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::LanePosition::operator ==( + const LanePosition& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::LanePosition::operator !=( + const LanePosition& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::LanePosition::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::LanePosition::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LanePosition& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::LanePosition::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::LanePosition::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::LanePosition::value( + int8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int8_t etsi_its_cam_msgs::msg::LanePosition::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int8_t& etsi_its_cam_msgs::msg::LanePosition::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::LanePosition::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::LanePosition::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::LanePosition::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.h new file mode 100644 index 00000000000..63f760c4b9c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.h @@ -0,0 +1,218 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LanePosition.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LanePosition_SOURCE) +#define LanePosition_DllAPI __declspec( dllexport ) +#else +#define LanePosition_DllAPI __declspec( dllimport ) +#endif // LanePosition_SOURCE +#else +#define LanePosition_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LanePosition_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LanePosition_Constants { + const int8_t MIN = -1; + const int8_t MAX = 14; + const int8_t OFF_THE_ROAD = -1; + const int8_t HARD_SHOULDER = 0; + const int8_t OUTERMOST_DRIVING_LANE = 1; + const int8_t SECOND_LANE_FROM_OUTSIDE = 2; + } // namespace LanePosition_Constants + /*! + * @brief This class represents the structure LanePosition defined by the user in the IDL file. + * @ingroup LANEPOSITION + */ + class LanePosition + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LanePosition(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LanePosition(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. + */ + eProsima_user_DllExport LanePosition( + const LanePosition& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. + */ + eProsima_user_DllExport LanePosition( + LanePosition&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. + */ + eProsima_user_DllExport LanePosition& operator =( + const LanePosition& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. + */ + eProsima_user_DllExport LanePosition& operator =( + LanePosition&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LanePosition object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LanePosition& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LanePosition object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LanePosition& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LanePosition& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.cxx new file mode 100644 index 00000000000..8035b88c692 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.cxx @@ -0,0 +1,185 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LanePositionPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LanePositionPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LanePosition_Constants { + + + + + + + + } //End of namespace LanePosition_Constants + LanePositionPubSubType::LanePositionPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::LanePosition_"); + auto type_size = LanePosition::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LanePosition::isKeyDefined(); + size_t keyLength = LanePosition::getKeyMaxCdrSerializedSize() > 16 ? + LanePosition::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LanePositionPubSubType::~LanePositionPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LanePositionPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LanePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LanePositionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LanePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LanePositionPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LanePositionPubSubType::createData() + { + return reinterpret_cast(new LanePosition()); + } + + void LanePositionPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LanePositionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LanePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LanePosition::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LanePosition::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.h new file mode 100644 index 00000000000..f08a575bb81 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.h @@ -0,0 +1,116 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LanePositionPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_PUBSUBTYPES_H_ + +#include +#include + +#include "LanePosition.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated LanePosition is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace LanePosition_Constants + { + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type LanePosition defined by the user in the IDL file. + * @ingroup LANEPOSITION + */ + class LanePositionPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LanePosition type; + + eProsima_user_DllExport LanePositionPubSubType(); + + eProsima_user_DllExport virtual ~LanePositionPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) LanePosition(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.cxx new file mode 100644 index 00000000000..62cec7706db --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAcceleration.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LateralAcceleration.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::LateralAcceleration::LateralAcceleration() +{ + // m_lateral_acceleration_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4b1c0397 + + // m_lateral_acceleration_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@72805168 + + +} + +etsi_its_cam_msgs::msg::LateralAcceleration::~LateralAcceleration() +{ + +} + +etsi_its_cam_msgs::msg::LateralAcceleration::LateralAcceleration( + const LateralAcceleration& x) +{ + m_lateral_acceleration_value = x.m_lateral_acceleration_value; + m_lateral_acceleration_confidence = x.m_lateral_acceleration_confidence; +} + +etsi_its_cam_msgs::msg::LateralAcceleration::LateralAcceleration( + LateralAcceleration&& x) +{ + m_lateral_acceleration_value = std::move(x.m_lateral_acceleration_value); + m_lateral_acceleration_confidence = std::move(x.m_lateral_acceleration_confidence); +} + +etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::LateralAcceleration::operator =( + const LateralAcceleration& x) +{ + + m_lateral_acceleration_value = x.m_lateral_acceleration_value; + m_lateral_acceleration_confidence = x.m_lateral_acceleration_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::LateralAcceleration::operator =( + LateralAcceleration&& x) +{ + + m_lateral_acceleration_value = std::move(x.m_lateral_acceleration_value); + m_lateral_acceleration_confidence = std::move(x.m_lateral_acceleration_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::LateralAcceleration::operator ==( + const LateralAcceleration& x) const +{ + + return (m_lateral_acceleration_value == x.m_lateral_acceleration_value && m_lateral_acceleration_confidence == x.m_lateral_acceleration_confidence); +} + +bool etsi_its_cam_msgs::msg::LateralAcceleration::operator !=( + const LateralAcceleration& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::LateralAcceleration::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LateralAccelerationValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::LateralAcceleration::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LateralAcceleration& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LateralAccelerationValue::getCdrSerializedSize(data.lateral_acceleration_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getCdrSerializedSize(data.lateral_acceleration_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::LateralAcceleration::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_lateral_acceleration_value; + scdr << m_lateral_acceleration_confidence; + +} + +void etsi_its_cam_msgs::msg::LateralAcceleration::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_lateral_acceleration_value; + dcdr >> m_lateral_acceleration_confidence; +} + +/*! + * @brief This function copies the value in member lateral_acceleration_value + * @param _lateral_acceleration_value New value to be copied in member lateral_acceleration_value + */ +void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value( + const etsi_its_cam_msgs::msg::LateralAccelerationValue& _lateral_acceleration_value) +{ + m_lateral_acceleration_value = _lateral_acceleration_value; +} + +/*! + * @brief This function moves the value in member lateral_acceleration_value + * @param _lateral_acceleration_value New value to be moved in member lateral_acceleration_value + */ +void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value( + etsi_its_cam_msgs::msg::LateralAccelerationValue&& _lateral_acceleration_value) +{ + m_lateral_acceleration_value = std::move(_lateral_acceleration_value); +} + +/*! + * @brief This function returns a constant reference to member lateral_acceleration_value + * @return Constant reference to member lateral_acceleration_value + */ +const etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value() const +{ + return m_lateral_acceleration_value; +} + +/*! + * @brief This function returns a reference to member lateral_acceleration_value + * @return Reference to member lateral_acceleration_value + */ +etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value() +{ + return m_lateral_acceleration_value; +} +/*! + * @brief This function copies the value in member lateral_acceleration_confidence + * @param _lateral_acceleration_confidence New value to be copied in member lateral_acceleration_confidence + */ +void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _lateral_acceleration_confidence) +{ + m_lateral_acceleration_confidence = _lateral_acceleration_confidence; +} + +/*! + * @brief This function moves the value in member lateral_acceleration_confidence + * @param _lateral_acceleration_confidence New value to be moved in member lateral_acceleration_confidence + */ +void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _lateral_acceleration_confidence) +{ + m_lateral_acceleration_confidence = std::move(_lateral_acceleration_confidence); +} + +/*! + * @brief This function returns a constant reference to member lateral_acceleration_confidence + * @return Constant reference to member lateral_acceleration_confidence + */ +const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidence() const +{ + return m_lateral_acceleration_confidence; +} + +/*! + * @brief This function returns a reference to member lateral_acceleration_confidence + * @return Reference to member lateral_acceleration_confidence + */ +etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidence() +{ + return m_lateral_acceleration_confidence; +} + +size_t etsi_its_cam_msgs::msg::LateralAcceleration::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::LateralAcceleration::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::LateralAcceleration::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.h new file mode 100644 index 00000000000..aec47b7dca9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAcceleration.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_H_ + +#include "AccelerationConfidence.h" +#include "LateralAccelerationValue.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LateralAcceleration_SOURCE) +#define LateralAcceleration_DllAPI __declspec( dllexport ) +#else +#define LateralAcceleration_DllAPI __declspec( dllimport ) +#endif // LateralAcceleration_SOURCE +#else +#define LateralAcceleration_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LateralAcceleration_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure LateralAcceleration defined by the user in the IDL file. + * @ingroup LATERALACCELERATION + */ + class LateralAcceleration + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LateralAcceleration(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LateralAcceleration(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. + */ + eProsima_user_DllExport LateralAcceleration( + const LateralAcceleration& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. + */ + eProsima_user_DllExport LateralAcceleration( + LateralAcceleration&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. + */ + eProsima_user_DllExport LateralAcceleration& operator =( + const LateralAcceleration& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. + */ + eProsima_user_DllExport LateralAcceleration& operator =( + LateralAcceleration&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LateralAcceleration object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LateralAcceleration& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LateralAcceleration object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LateralAcceleration& x) const; + + /*! + * @brief This function copies the value in member lateral_acceleration_value + * @param _lateral_acceleration_value New value to be copied in member lateral_acceleration_value + */ + eProsima_user_DllExport void lateral_acceleration_value( + const etsi_its_cam_msgs::msg::LateralAccelerationValue& _lateral_acceleration_value); + + /*! + * @brief This function moves the value in member lateral_acceleration_value + * @param _lateral_acceleration_value New value to be moved in member lateral_acceleration_value + */ + eProsima_user_DllExport void lateral_acceleration_value( + etsi_its_cam_msgs::msg::LateralAccelerationValue&& _lateral_acceleration_value); + + /*! + * @brief This function returns a constant reference to member lateral_acceleration_value + * @return Constant reference to member lateral_acceleration_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LateralAccelerationValue& lateral_acceleration_value() const; + + /*! + * @brief This function returns a reference to member lateral_acceleration_value + * @return Reference to member lateral_acceleration_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LateralAccelerationValue& lateral_acceleration_value(); + /*! + * @brief This function copies the value in member lateral_acceleration_confidence + * @param _lateral_acceleration_confidence New value to be copied in member lateral_acceleration_confidence + */ + eProsima_user_DllExport void lateral_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _lateral_acceleration_confidence); + + /*! + * @brief This function moves the value in member lateral_acceleration_confidence + * @param _lateral_acceleration_confidence New value to be moved in member lateral_acceleration_confidence + */ + eProsima_user_DllExport void lateral_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _lateral_acceleration_confidence); + + /*! + * @brief This function returns a constant reference to member lateral_acceleration_confidence + * @return Constant reference to member lateral_acceleration_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& lateral_acceleration_confidence() const; + + /*! + * @brief This function returns a reference to member lateral_acceleration_confidence + * @return Reference to member lateral_acceleration_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& lateral_acceleration_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LateralAcceleration& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::LateralAccelerationValue m_lateral_acceleration_value; + etsi_its_cam_msgs::msg::AccelerationConfidence m_lateral_acceleration_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.cxx new file mode 100644 index 00000000000..0ac8f730b32 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LateralAccelerationPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + LateralAccelerationPubSubType::LateralAccelerationPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::LateralAcceleration_"); + auto type_size = LateralAcceleration::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LateralAcceleration::isKeyDefined(); + size_t keyLength = LateralAcceleration::getKeyMaxCdrSerializedSize() > 16 ? + LateralAcceleration::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LateralAccelerationPubSubType::~LateralAccelerationPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LateralAccelerationPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LateralAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LateralAccelerationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LateralAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LateralAccelerationPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LateralAccelerationPubSubType::createData() + { + return reinterpret_cast(new LateralAcceleration()); + } + + void LateralAccelerationPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LateralAccelerationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LateralAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LateralAcceleration::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LateralAcceleration::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.h new file mode 100644 index 00000000000..4a1deffbe69 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_PUBSUBTYPES_H_ + +#include +#include + +#include "LateralAcceleration.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated LateralAcceleration is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type LateralAcceleration defined by the user in the IDL file. + * @ingroup LATERALACCELERATION + */ + class LateralAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LateralAcceleration type; + + eProsima_user_DllExport LateralAccelerationPubSubType(); + + eProsima_user_DllExport virtual ~LateralAccelerationPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) LateralAcceleration(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.cxx new file mode 100644 index 00000000000..7ef9d155c81 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LateralAccelerationValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::LateralAccelerationValue::LateralAccelerationValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@69cac930 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::LateralAccelerationValue::~LateralAccelerationValue() +{ +} + +etsi_its_cam_msgs::msg::LateralAccelerationValue::LateralAccelerationValue( + const LateralAccelerationValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::LateralAccelerationValue::LateralAccelerationValue( + LateralAccelerationValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg::LateralAccelerationValue::operator =( + const LateralAccelerationValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg::LateralAccelerationValue::operator =( + LateralAccelerationValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::LateralAccelerationValue::operator ==( + const LateralAccelerationValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::LateralAccelerationValue::operator !=( + const LateralAccelerationValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::LateralAccelerationValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::LateralAccelerationValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LateralAccelerationValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::LateralAccelerationValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::LateralAccelerationValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::LateralAccelerationValue::value( + int16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int16_t etsi_its_cam_msgs::msg::LateralAccelerationValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int16_t& etsi_its_cam_msgs::msg::LateralAccelerationValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::LateralAccelerationValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::LateralAccelerationValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::LateralAccelerationValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.h new file mode 100644 index 00000000000..c4e80103315 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LateralAccelerationValue_SOURCE) +#define LateralAccelerationValue_DllAPI __declspec( dllexport ) +#else +#define LateralAccelerationValue_DllAPI __declspec( dllimport ) +#endif // LateralAccelerationValue_SOURCE +#else +#define LateralAccelerationValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LateralAccelerationValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LateralAccelerationValue_Constants { + const int16_t MIN = -160; + const int16_t MAX = 161; + const int16_t POINT_ONE_METER_PER_SEC_SQUARED_TO_RIGHT = -1; + const int16_t POINT_ONE_METER_PER_SEC_SQUARED_TO_LEFT = 1; + const int16_t UNAVAILABLE = 161; + } // namespace LateralAccelerationValue_Constants + /*! + * @brief This class represents the structure LateralAccelerationValue defined by the user in the IDL file. + * @ingroup LATERALACCELERATIONVALUE + */ + class LateralAccelerationValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LateralAccelerationValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LateralAccelerationValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. + */ + eProsima_user_DllExport LateralAccelerationValue( + const LateralAccelerationValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. + */ + eProsima_user_DllExport LateralAccelerationValue( + LateralAccelerationValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. + */ + eProsima_user_DllExport LateralAccelerationValue& operator =( + const LateralAccelerationValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. + */ + eProsima_user_DllExport LateralAccelerationValue& operator =( + LateralAccelerationValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LateralAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LateralAccelerationValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LateralAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LateralAccelerationValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LateralAccelerationValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.cxx new file mode 100644 index 00000000000..27ab18e9283 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LateralAccelerationValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LateralAccelerationValue_Constants { + + + + + + + } //End of namespace LateralAccelerationValue_Constants + LateralAccelerationValuePubSubType::LateralAccelerationValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::LateralAccelerationValue_"); + auto type_size = LateralAccelerationValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LateralAccelerationValue::isKeyDefined(); + size_t keyLength = LateralAccelerationValue::getKeyMaxCdrSerializedSize() > 16 ? + LateralAccelerationValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LateralAccelerationValuePubSubType::~LateralAccelerationValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LateralAccelerationValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LateralAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LateralAccelerationValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LateralAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LateralAccelerationValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LateralAccelerationValuePubSubType::createData() + { + return reinterpret_cast(new LateralAccelerationValue()); + } + + void LateralAccelerationValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LateralAccelerationValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LateralAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LateralAccelerationValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LateralAccelerationValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.h new file mode 100644 index 00000000000..45bcf48ad15 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "LateralAccelerationValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated LateralAccelerationValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace LateralAccelerationValue_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type LateralAccelerationValue defined by the user in the IDL file. + * @ingroup LATERALACCELERATIONVALUE + */ + class LateralAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LateralAccelerationValue type; + + eProsima_user_DllExport LateralAccelerationValuePubSubType(); + + eProsima_user_DllExport virtual ~LateralAccelerationValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) LateralAccelerationValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.cxx new file mode 100644 index 00000000000..e9c27fb6580 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Latitude.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Latitude.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::Latitude::Latitude() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@62e7dffa + m_value = 0; + +} + +etsi_its_cam_msgs::msg::Latitude::~Latitude() +{ +} + +etsi_its_cam_msgs::msg::Latitude::Latitude( + const Latitude& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::Latitude::Latitude( + Latitude&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::Latitude::operator =( + const Latitude& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::Latitude::operator =( + Latitude&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::Latitude::operator ==( + const Latitude& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::Latitude::operator !=( + const Latitude& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::Latitude::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::Latitude::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Latitude& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::Latitude::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::Latitude::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::Latitude::value( + int32_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int32_t etsi_its_cam_msgs::msg::Latitude::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int32_t& etsi_its_cam_msgs::msg::Latitude::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::Latitude::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::Latitude::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::Latitude::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.h new file mode 100644 index 00000000000..1fe8307c384 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Latitude.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Latitude_SOURCE) +#define Latitude_DllAPI __declspec( dllexport ) +#else +#define Latitude_DllAPI __declspec( dllimport ) +#endif // Latitude_SOURCE +#else +#define Latitude_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Latitude_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace Latitude_Constants { + const int32_t MIN = -900000000; + const int32_t MAX = 900000001; + const int32_t ONE_MICRODEGREE_NORTH = 10; + const int32_t ONE_MICRODEGREE_SOUTH = -10; + const int32_t UNAVAILABLE = 900000001; + } // namespace Latitude_Constants + /*! + * @brief This class represents the structure Latitude defined by the user in the IDL file. + * @ingroup LATITUDE + */ + class Latitude + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Latitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Latitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. + */ + eProsima_user_DllExport Latitude( + const Latitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. + */ + eProsima_user_DllExport Latitude( + Latitude&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. + */ + eProsima_user_DllExport Latitude& operator =( + const Latitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. + */ + eProsima_user_DllExport Latitude& operator =( + Latitude&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Latitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Latitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Latitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Latitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Latitude& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int32_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.cxx new file mode 100644 index 00000000000..383f895acc6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LatitudePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LatitudePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace Latitude_Constants { + + + + + + + } //End of namespace Latitude_Constants + LatitudePubSubType::LatitudePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::Latitude_"); + auto type_size = Latitude::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Latitude::isKeyDefined(); + size_t keyLength = Latitude::getKeyMaxCdrSerializedSize() > 16 ? + Latitude::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LatitudePubSubType::~LatitudePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LatitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Latitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LatitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Latitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LatitudePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LatitudePubSubType::createData() + { + return reinterpret_cast(new Latitude()); + } + + void LatitudePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LatitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Latitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Latitude::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Latitude::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.h new file mode 100644 index 00000000000..84953f7f9e1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LatitudePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_PUBSUBTYPES_H_ + +#include +#include + +#include "Latitude.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated Latitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace Latitude_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type Latitude defined by the user in the IDL file. + * @ingroup LATITUDE + */ + class LatitudePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Latitude type; + + eProsima_user_DllExport LatitudePubSubType(); + + eProsima_user_DllExport virtual ~LatitudePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Latitude(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.cxx new file mode 100644 index 00000000000..21b5b41362f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.cxx @@ -0,0 +1,250 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LightBarSirenInUse.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LightBarSirenInUse.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::LightBarSirenInUse::LightBarSirenInUse() +{ + // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@58c540cf + + // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3d6300e8 + m_bits_unused = 0; + +} + +etsi_its_cam_msgs::msg::LightBarSirenInUse::~LightBarSirenInUse() +{ + +} + +etsi_its_cam_msgs::msg::LightBarSirenInUse::LightBarSirenInUse( + const LightBarSirenInUse& x) +{ + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::LightBarSirenInUse::LightBarSirenInUse( + LightBarSirenInUse&& x) +{ + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::LightBarSirenInUse::operator =( + const LightBarSirenInUse& x) +{ + + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; + + return *this; +} + +etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::LightBarSirenInUse::operator =( + LightBarSirenInUse&& x) +{ + + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; + + return *this; +} + +bool etsi_its_cam_msgs::msg::LightBarSirenInUse::operator ==( + const LightBarSirenInUse& x) const +{ + + return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); +} + +bool etsi_its_cam_msgs::msg::LightBarSirenInUse::operator !=( + const LightBarSirenInUse& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.value().size() > 0) + { + current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::LightBarSirenInUse::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + scdr << m_bits_unused; + +} + +void etsi_its_cam_msgs::msg::LightBarSirenInUse::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; + dcdr >> m_bits_unused; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void etsi_its_cam_msgs::msg::LightBarSirenInUse::value( + const std::vector& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void etsi_its_cam_msgs::msg::LightBarSirenInUse::value( + std::vector&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::vector& etsi_its_cam_msgs::msg::LightBarSirenInUse::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::vector& etsi_its_cam_msgs::msg::LightBarSirenInUse::value() +{ + return m_value; +} +/*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ +void etsi_its_cam_msgs::msg::LightBarSirenInUse::bits_unused( + uint8_t _bits_unused) +{ + m_bits_unused = _bits_unused; +} + +/*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ +uint8_t etsi_its_cam_msgs::msg::LightBarSirenInUse::bits_unused() const +{ + return m_bits_unused; +} + +/*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ +uint8_t& etsi_its_cam_msgs::msg::LightBarSirenInUse::bits_unused() +{ + return m_bits_unused; +} + + +size_t etsi_its_cam_msgs::msg::LightBarSirenInUse::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::LightBarSirenInUse::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::LightBarSirenInUse::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.h new file mode 100644 index 00000000000..fe86dd27329 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.h @@ -0,0 +1,241 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LightBarSirenInUse.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LightBarSirenInUse_SOURCE) +#define LightBarSirenInUse_DllAPI __declspec( dllexport ) +#else +#define LightBarSirenInUse_DllAPI __declspec( dllimport ) +#endif // LightBarSirenInUse_SOURCE +#else +#define LightBarSirenInUse_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LightBarSirenInUse_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LightBarSirenInUse_Constants { + const uint8_t SIZE_BITS = 2; + const uint8_t BIT_INDEX_LIGHT_BAR_ACTIVATED = 0; + const uint8_t BIT_INDEX_SIREN_ACTIVATED = 1; + } // namespace LightBarSirenInUse_Constants + /*! + * @brief This class represents the structure LightBarSirenInUse defined by the user in the IDL file. + * @ingroup LIGHTBARSIRENINUSE + */ + class LightBarSirenInUse + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LightBarSirenInUse(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LightBarSirenInUse(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. + */ + eProsima_user_DllExport LightBarSirenInUse( + const LightBarSirenInUse& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. + */ + eProsima_user_DllExport LightBarSirenInUse( + LightBarSirenInUse&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. + */ + eProsima_user_DllExport LightBarSirenInUse& operator =( + const LightBarSirenInUse& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. + */ + eProsima_user_DllExport LightBarSirenInUse& operator =( + LightBarSirenInUse&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LightBarSirenInUse object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LightBarSirenInUse& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LightBarSirenInUse object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LightBarSirenInUse& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_value; + uint8_t m_bits_unused; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.cxx new file mode 100644 index 00000000000..a634d0d7409 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LightBarSirenInUsePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LightBarSirenInUsePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LightBarSirenInUse_Constants { + + + + + } //End of namespace LightBarSirenInUse_Constants + LightBarSirenInUsePubSubType::LightBarSirenInUsePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::LightBarSirenInUse_"); + auto type_size = LightBarSirenInUse::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LightBarSirenInUse::isKeyDefined(); + size_t keyLength = LightBarSirenInUse::getKeyMaxCdrSerializedSize() > 16 ? + LightBarSirenInUse::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LightBarSirenInUsePubSubType::~LightBarSirenInUsePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LightBarSirenInUsePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LightBarSirenInUse* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LightBarSirenInUsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LightBarSirenInUse* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LightBarSirenInUsePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LightBarSirenInUsePubSubType::createData() + { + return reinterpret_cast(new LightBarSirenInUse()); + } + + void LightBarSirenInUsePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LightBarSirenInUsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LightBarSirenInUse* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LightBarSirenInUse::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LightBarSirenInUse::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.h new file mode 100644 index 00000000000..534b5f3043a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LightBarSirenInUsePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_PUBSUBTYPES_H_ + +#include +#include + +#include "LightBarSirenInUse.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated LightBarSirenInUse is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace LightBarSirenInUse_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type LightBarSirenInUse defined by the user in the IDL file. + * @ingroup LIGHTBARSIRENINUSE + */ + class LightBarSirenInUsePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LightBarSirenInUse type; + + eProsima_user_DllExport LightBarSirenInUsePubSubType(); + + eProsima_user_DllExport virtual ~LightBarSirenInUsePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.cxx new file mode 100644 index 00000000000..88d133a50ce --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Longitude.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Longitude.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::Longitude::Longitude() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4567e53d + m_value = 0; + +} + +etsi_its_cam_msgs::msg::Longitude::~Longitude() +{ +} + +etsi_its_cam_msgs::msg::Longitude::Longitude( + const Longitude& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::Longitude::Longitude( + Longitude&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::Longitude::operator =( + const Longitude& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::Longitude::operator =( + Longitude&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::Longitude::operator ==( + const Longitude& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::Longitude::operator !=( + const Longitude& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::Longitude::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::Longitude::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Longitude& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::Longitude::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::Longitude::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::Longitude::value( + int32_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int32_t etsi_its_cam_msgs::msg::Longitude::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int32_t& etsi_its_cam_msgs::msg::Longitude::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::Longitude::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::Longitude::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::Longitude::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.h new file mode 100644 index 00000000000..b80e52005aa --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Longitude.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Longitude_SOURCE) +#define Longitude_DllAPI __declspec( dllexport ) +#else +#define Longitude_DllAPI __declspec( dllimport ) +#endif // Longitude_SOURCE +#else +#define Longitude_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Longitude_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace Longitude_Constants { + const int32_t MIN = -1800000000; + const int32_t MAX = 1800000001; + const int32_t ONE_MICRODEGREE_EAST = 10; + const int32_t ONE_MICRODEGREE_WEST = -10; + const int32_t UNAVAILABLE = 1800000001; + } // namespace Longitude_Constants + /*! + * @brief This class represents the structure Longitude defined by the user in the IDL file. + * @ingroup LONGITUDE + */ + class Longitude + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Longitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Longitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. + */ + eProsima_user_DllExport Longitude( + const Longitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. + */ + eProsima_user_DllExport Longitude( + Longitude&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. + */ + eProsima_user_DllExport Longitude& operator =( + const Longitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. + */ + eProsima_user_DllExport Longitude& operator =( + Longitude&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Longitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Longitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Longitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Longitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Longitude& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int32_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.cxx new file mode 100644 index 00000000000..6105d93aa80 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LongitudePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace Longitude_Constants { + + + + + + + } //End of namespace Longitude_Constants + LongitudePubSubType::LongitudePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::Longitude_"); + auto type_size = Longitude::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Longitude::isKeyDefined(); + size_t keyLength = Longitude::getKeyMaxCdrSerializedSize() > 16 ? + Longitude::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LongitudePubSubType::~LongitudePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LongitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Longitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LongitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Longitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LongitudePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LongitudePubSubType::createData() + { + return reinterpret_cast(new Longitude()); + } + + void LongitudePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LongitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Longitude* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Longitude::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Longitude::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.h new file mode 100644 index 00000000000..70344c0d10a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_PUBSUBTYPES_H_ + +#include +#include + +#include "Longitude.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated Longitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace Longitude_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type Longitude defined by the user in the IDL file. + * @ingroup LONGITUDE + */ + class LongitudePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Longitude type; + + eProsima_user_DllExport LongitudePubSubType(); + + eProsima_user_DllExport virtual ~LongitudePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Longitude(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.cxx new file mode 100644 index 00000000000..9c5163824c3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAcceleration.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LongitudinalAcceleration.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::LongitudinalAcceleration::LongitudinalAcceleration() +{ + // m_longitudinal_acceleration_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@301d8120 + + // m_longitudinal_acceleration_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6d367020 + + +} + +etsi_its_cam_msgs::msg::LongitudinalAcceleration::~LongitudinalAcceleration() +{ + +} + +etsi_its_cam_msgs::msg::LongitudinalAcceleration::LongitudinalAcceleration( + const LongitudinalAcceleration& x) +{ + m_longitudinal_acceleration_value = x.m_longitudinal_acceleration_value; + m_longitudinal_acceleration_confidence = x.m_longitudinal_acceleration_confidence; +} + +etsi_its_cam_msgs::msg::LongitudinalAcceleration::LongitudinalAcceleration( + LongitudinalAcceleration&& x) +{ + m_longitudinal_acceleration_value = std::move(x.m_longitudinal_acceleration_value); + m_longitudinal_acceleration_confidence = std::move(x.m_longitudinal_acceleration_confidence); +} + +etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg::LongitudinalAcceleration::operator =( + const LongitudinalAcceleration& x) +{ + + m_longitudinal_acceleration_value = x.m_longitudinal_acceleration_value; + m_longitudinal_acceleration_confidence = x.m_longitudinal_acceleration_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg::LongitudinalAcceleration::operator =( + LongitudinalAcceleration&& x) +{ + + m_longitudinal_acceleration_value = std::move(x.m_longitudinal_acceleration_value); + m_longitudinal_acceleration_confidence = std::move(x.m_longitudinal_acceleration_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::LongitudinalAcceleration::operator ==( + const LongitudinalAcceleration& x) const +{ + + return (m_longitudinal_acceleration_value == x.m_longitudinal_acceleration_value && m_longitudinal_acceleration_confidence == x.m_longitudinal_acceleration_confidence); +} + +bool etsi_its_cam_msgs::msg::LongitudinalAcceleration::operator !=( + const LongitudinalAcceleration& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::LongitudinalAcceleration::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::LongitudinalAcceleration::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getCdrSerializedSize(data.longitudinal_acceleration_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getCdrSerializedSize(data.longitudinal_acceleration_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::LongitudinalAcceleration::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_longitudinal_acceleration_value; + scdr << m_longitudinal_acceleration_confidence; + +} + +void etsi_its_cam_msgs::msg::LongitudinalAcceleration::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_longitudinal_acceleration_value; + dcdr >> m_longitudinal_acceleration_confidence; +} + +/*! + * @brief This function copies the value in member longitudinal_acceleration_value + * @param _longitudinal_acceleration_value New value to be copied in member longitudinal_acceleration_value + */ +void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_value( + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& _longitudinal_acceleration_value) +{ + m_longitudinal_acceleration_value = _longitudinal_acceleration_value; +} + +/*! + * @brief This function moves the value in member longitudinal_acceleration_value + * @param _longitudinal_acceleration_value New value to be moved in member longitudinal_acceleration_value + */ +void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_value( + etsi_its_cam_msgs::msg::LongitudinalAccelerationValue&& _longitudinal_acceleration_value) +{ + m_longitudinal_acceleration_value = std::move(_longitudinal_acceleration_value); +} + +/*! + * @brief This function returns a constant reference to member longitudinal_acceleration_value + * @return Constant reference to member longitudinal_acceleration_value + */ +const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_value() const +{ + return m_longitudinal_acceleration_value; +} + +/*! + * @brief This function returns a reference to member longitudinal_acceleration_value + * @return Reference to member longitudinal_acceleration_value + */ +etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_value() +{ + return m_longitudinal_acceleration_value; +} +/*! + * @brief This function copies the value in member longitudinal_acceleration_confidence + * @param _longitudinal_acceleration_confidence New value to be copied in member longitudinal_acceleration_confidence + */ +void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _longitudinal_acceleration_confidence) +{ + m_longitudinal_acceleration_confidence = _longitudinal_acceleration_confidence; +} + +/*! + * @brief This function moves the value in member longitudinal_acceleration_confidence + * @param _longitudinal_acceleration_confidence New value to be moved in member longitudinal_acceleration_confidence + */ +void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _longitudinal_acceleration_confidence) +{ + m_longitudinal_acceleration_confidence = std::move(_longitudinal_acceleration_confidence); +} + +/*! + * @brief This function returns a constant reference to member longitudinal_acceleration_confidence + * @return Constant reference to member longitudinal_acceleration_confidence + */ +const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_confidence() const +{ + return m_longitudinal_acceleration_confidence; +} + +/*! + * @brief This function returns a reference to member longitudinal_acceleration_confidence + * @return Reference to member longitudinal_acceleration_confidence + */ +etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_confidence() +{ + return m_longitudinal_acceleration_confidence; +} + +size_t etsi_its_cam_msgs::msg::LongitudinalAcceleration::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::LongitudinalAcceleration::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::LongitudinalAcceleration::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.h new file mode 100644 index 00000000000..589ba9b5039 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAcceleration.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_H_ + +#include "LongitudinalAccelerationValue.h" +#include "AccelerationConfidence.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LongitudinalAcceleration_SOURCE) +#define LongitudinalAcceleration_DllAPI __declspec( dllexport ) +#else +#define LongitudinalAcceleration_DllAPI __declspec( dllimport ) +#endif // LongitudinalAcceleration_SOURCE +#else +#define LongitudinalAcceleration_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LongitudinalAcceleration_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure LongitudinalAcceleration defined by the user in the IDL file. + * @ingroup LONGITUDINALACCELERATION + */ + class LongitudinalAcceleration + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LongitudinalAcceleration(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LongitudinalAcceleration(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. + */ + eProsima_user_DllExport LongitudinalAcceleration( + const LongitudinalAcceleration& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. + */ + eProsima_user_DllExport LongitudinalAcceleration( + LongitudinalAcceleration&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. + */ + eProsima_user_DllExport LongitudinalAcceleration& operator =( + const LongitudinalAcceleration& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. + */ + eProsima_user_DllExport LongitudinalAcceleration& operator =( + LongitudinalAcceleration&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LongitudinalAcceleration object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LongitudinalAcceleration& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LongitudinalAcceleration object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LongitudinalAcceleration& x) const; + + /*! + * @brief This function copies the value in member longitudinal_acceleration_value + * @param _longitudinal_acceleration_value New value to be copied in member longitudinal_acceleration_value + */ + eProsima_user_DllExport void longitudinal_acceleration_value( + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& _longitudinal_acceleration_value); + + /*! + * @brief This function moves the value in member longitudinal_acceleration_value + * @param _longitudinal_acceleration_value New value to be moved in member longitudinal_acceleration_value + */ + eProsima_user_DllExport void longitudinal_acceleration_value( + etsi_its_cam_msgs::msg::LongitudinalAccelerationValue&& _longitudinal_acceleration_value); + + /*! + * @brief This function returns a constant reference to member longitudinal_acceleration_value + * @return Constant reference to member longitudinal_acceleration_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& longitudinal_acceleration_value() const; + + /*! + * @brief This function returns a reference to member longitudinal_acceleration_value + * @return Reference to member longitudinal_acceleration_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& longitudinal_acceleration_value(); + /*! + * @brief This function copies the value in member longitudinal_acceleration_confidence + * @param _longitudinal_acceleration_confidence New value to be copied in member longitudinal_acceleration_confidence + */ + eProsima_user_DllExport void longitudinal_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _longitudinal_acceleration_confidence); + + /*! + * @brief This function moves the value in member longitudinal_acceleration_confidence + * @param _longitudinal_acceleration_confidence New value to be moved in member longitudinal_acceleration_confidence + */ + eProsima_user_DllExport void longitudinal_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _longitudinal_acceleration_confidence); + + /*! + * @brief This function returns a constant reference to member longitudinal_acceleration_confidence + * @return Constant reference to member longitudinal_acceleration_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& longitudinal_acceleration_confidence() const; + + /*! + * @brief This function returns a reference to member longitudinal_acceleration_confidence + * @return Reference to member longitudinal_acceleration_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& longitudinal_acceleration_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::LongitudinalAccelerationValue m_longitudinal_acceleration_value; + etsi_its_cam_msgs::msg::AccelerationConfidence m_longitudinal_acceleration_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.cxx new file mode 100644 index 00000000000..1ab3dc03357 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LongitudinalAccelerationPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + LongitudinalAccelerationPubSubType::LongitudinalAccelerationPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::LongitudinalAcceleration_"); + auto type_size = LongitudinalAcceleration::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LongitudinalAcceleration::isKeyDefined(); + size_t keyLength = LongitudinalAcceleration::getKeyMaxCdrSerializedSize() > 16 ? + LongitudinalAcceleration::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LongitudinalAccelerationPubSubType::~LongitudinalAccelerationPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LongitudinalAccelerationPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LongitudinalAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LongitudinalAccelerationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LongitudinalAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LongitudinalAccelerationPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LongitudinalAccelerationPubSubType::createData() + { + return reinterpret_cast(new LongitudinalAcceleration()); + } + + void LongitudinalAccelerationPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LongitudinalAccelerationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LongitudinalAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LongitudinalAcceleration::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LongitudinalAcceleration::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.h new file mode 100644 index 00000000000..78167e51a6b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_PUBSUBTYPES_H_ + +#include +#include + +#include "LongitudinalAcceleration.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated LongitudinalAcceleration is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type LongitudinalAcceleration defined by the user in the IDL file. + * @ingroup LONGITUDINALACCELERATION + */ + class LongitudinalAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LongitudinalAcceleration type; + + eProsima_user_DllExport LongitudinalAccelerationPubSubType(); + + eProsima_user_DllExport virtual ~LongitudinalAccelerationPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) LongitudinalAcceleration(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.cxx new file mode 100644 index 00000000000..5225678785d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LongitudinalAccelerationValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::LongitudinalAccelerationValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5cbb84b1 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::~LongitudinalAccelerationValue() +{ +} + +etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::LongitudinalAccelerationValue( + const LongitudinalAccelerationValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::LongitudinalAccelerationValue( + LongitudinalAccelerationValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::operator =( + const LongitudinalAccelerationValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::operator =( + LongitudinalAccelerationValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::operator ==( + const LongitudinalAccelerationValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::operator !=( + const LongitudinalAccelerationValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::value( + int16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int16_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int16_t& etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.h new file mode 100644 index 00000000000..4cd69e3e7fe --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LongitudinalAccelerationValue_SOURCE) +#define LongitudinalAccelerationValue_DllAPI __declspec( dllexport ) +#else +#define LongitudinalAccelerationValue_DllAPI __declspec( dllimport ) +#endif // LongitudinalAccelerationValue_SOURCE +#else +#define LongitudinalAccelerationValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LongitudinalAccelerationValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LongitudinalAccelerationValue_Constants { + const int16_t MIN = -160; + const int16_t MAX = 161; + const int16_t POINT_ONE_METER_PER_SEC_SQUARED_FORWARD = 1; + const int16_t POINT_ONE_METER_PER_SEC_SQUARED_BACKWARD = -1; + const int16_t UNAVAILABLE = 161; + } // namespace LongitudinalAccelerationValue_Constants + /*! + * @brief This class represents the structure LongitudinalAccelerationValue defined by the user in the IDL file. + * @ingroup LONGITUDINALACCELERATIONVALUE + */ + class LongitudinalAccelerationValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LongitudinalAccelerationValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LongitudinalAccelerationValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. + */ + eProsima_user_DllExport LongitudinalAccelerationValue( + const LongitudinalAccelerationValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. + */ + eProsima_user_DllExport LongitudinalAccelerationValue( + LongitudinalAccelerationValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. + */ + eProsima_user_DllExport LongitudinalAccelerationValue& operator =( + const LongitudinalAccelerationValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. + */ + eProsima_user_DllExport LongitudinalAccelerationValue& operator =( + LongitudinalAccelerationValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LongitudinalAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LongitudinalAccelerationValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LongitudinalAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LongitudinalAccelerationValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.cxx new file mode 100644 index 00000000000..cc3643f6b50 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LongitudinalAccelerationValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LongitudinalAccelerationValue_Constants { + + + + + + + } //End of namespace LongitudinalAccelerationValue_Constants + LongitudinalAccelerationValuePubSubType::LongitudinalAccelerationValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::LongitudinalAccelerationValue_"); + auto type_size = LongitudinalAccelerationValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LongitudinalAccelerationValue::isKeyDefined(); + size_t keyLength = LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize() > 16 ? + LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LongitudinalAccelerationValuePubSubType::~LongitudinalAccelerationValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LongitudinalAccelerationValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LongitudinalAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LongitudinalAccelerationValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LongitudinalAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LongitudinalAccelerationValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LongitudinalAccelerationValuePubSubType::createData() + { + return reinterpret_cast(new LongitudinalAccelerationValue()); + } + + void LongitudinalAccelerationValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LongitudinalAccelerationValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LongitudinalAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.h new file mode 100644 index 00000000000..2edc3e7443d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "LongitudinalAccelerationValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated LongitudinalAccelerationValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace LongitudinalAccelerationValue_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type LongitudinalAccelerationValue defined by the user in the IDL file. + * @ingroup LONGITUDINALACCELERATIONVALUE + */ + class LongitudinalAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LongitudinalAccelerationValue type; + + eProsima_user_DllExport LongitudinalAccelerationValuePubSubType(); + + eProsima_user_DllExport virtual ~LongitudinalAccelerationValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) LongitudinalAccelerationValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.cxx new file mode 100644 index 00000000000..877548ce460 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.cxx @@ -0,0 +1,234 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LowFrequencyContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LowFrequencyContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + +etsi_its_cam_msgs::msg::LowFrequencyContainer::LowFrequencyContainer() +{ + // m_choice com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4362d7df + m_choice = 0; + // m_basic_vehicle_container_low_frequency com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@66238be2 + + +} + +etsi_its_cam_msgs::msg::LowFrequencyContainer::~LowFrequencyContainer() +{ + +} + +etsi_its_cam_msgs::msg::LowFrequencyContainer::LowFrequencyContainer( + const LowFrequencyContainer& x) +{ + m_choice = x.m_choice; + m_basic_vehicle_container_low_frequency = x.m_basic_vehicle_container_low_frequency; +} + +etsi_its_cam_msgs::msg::LowFrequencyContainer::LowFrequencyContainer( + LowFrequencyContainer&& x) +{ + m_choice = x.m_choice; + m_basic_vehicle_container_low_frequency = std::move(x.m_basic_vehicle_container_low_frequency); +} + +etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::LowFrequencyContainer::operator =( + const LowFrequencyContainer& x) +{ + + m_choice = x.m_choice; + m_basic_vehicle_container_low_frequency = x.m_basic_vehicle_container_low_frequency; + + return *this; +} + +etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::LowFrequencyContainer::operator =( + LowFrequencyContainer&& x) +{ + + m_choice = x.m_choice; + m_basic_vehicle_container_low_frequency = std::move(x.m_basic_vehicle_container_low_frequency); + + return *this; +} + +bool etsi_its_cam_msgs::msg::LowFrequencyContainer::operator ==( + const LowFrequencyContainer& x) const +{ + + return (m_choice == x.m_choice && m_basic_vehicle_container_low_frequency == x.m_basic_vehicle_container_low_frequency); +} + +bool etsi_its_cam_msgs::msg::LowFrequencyContainer::operator !=( + const LowFrequencyContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::LowFrequencyContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::LowFrequencyContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LowFrequencyContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getCdrSerializedSize(data.basic_vehicle_container_low_frequency(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::LowFrequencyContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_choice; + scdr << m_basic_vehicle_container_low_frequency; + +} + +void etsi_its_cam_msgs::msg::LowFrequencyContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_choice; + dcdr >> m_basic_vehicle_container_low_frequency; +} + +/*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ +void etsi_its_cam_msgs::msg::LowFrequencyContainer::choice( + uint8_t _choice) +{ + m_choice = _choice; +} + +/*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ +uint8_t etsi_its_cam_msgs::msg::LowFrequencyContainer::choice() const +{ + return m_choice; +} + +/*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ +uint8_t& etsi_its_cam_msgs::msg::LowFrequencyContainer::choice() +{ + return m_choice; +} + +/*! + * @brief This function copies the value in member basic_vehicle_container_low_frequency + * @param _basic_vehicle_container_low_frequency New value to be copied in member basic_vehicle_container_low_frequency + */ +void etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_frequency( + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& _basic_vehicle_container_low_frequency) +{ + m_basic_vehicle_container_low_frequency = _basic_vehicle_container_low_frequency; +} + +/*! + * @brief This function moves the value in member basic_vehicle_container_low_frequency + * @param _basic_vehicle_container_low_frequency New value to be moved in member basic_vehicle_container_low_frequency + */ +void etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_frequency( + etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency&& _basic_vehicle_container_low_frequency) +{ + m_basic_vehicle_container_low_frequency = std::move(_basic_vehicle_container_low_frequency); +} + +/*! + * @brief This function returns a constant reference to member basic_vehicle_container_low_frequency + * @return Constant reference to member basic_vehicle_container_low_frequency + */ +const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_frequency() const +{ + return m_basic_vehicle_container_low_frequency; +} + +/*! + * @brief This function returns a reference to member basic_vehicle_container_low_frequency + * @return Reference to member basic_vehicle_container_low_frequency + */ +etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_frequency() +{ + return m_basic_vehicle_container_low_frequency; +} + +size_t etsi_its_cam_msgs::msg::LowFrequencyContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::LowFrequencyContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::LowFrequencyContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.h new file mode 100644 index 00000000000..999a96a40a8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.h @@ -0,0 +1,240 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LowFrequencyContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_H_ + +#include "BasicVehicleContainerLowFrequency.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LowFrequencyContainer_SOURCE) +#define LowFrequencyContainer_DllAPI __declspec( dllexport ) +#else +#define LowFrequencyContainer_DllAPI __declspec( dllimport ) +#endif // LowFrequencyContainer_SOURCE +#else +#define LowFrequencyContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LowFrequencyContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LowFrequencyContainer_Constants { + const uint8_t CHOICE_BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY = 0; + } // namespace LowFrequencyContainer_Constants + /*! + * @brief This class represents the structure LowFrequencyContainer defined by the user in the IDL file. + * @ingroup LOWFREQUENCYCONTAINER + */ + class LowFrequencyContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LowFrequencyContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LowFrequencyContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. + */ + eProsima_user_DllExport LowFrequencyContainer( + const LowFrequencyContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. + */ + eProsima_user_DllExport LowFrequencyContainer( + LowFrequencyContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. + */ + eProsima_user_DllExport LowFrequencyContainer& operator =( + const LowFrequencyContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. + */ + eProsima_user_DllExport LowFrequencyContainer& operator =( + LowFrequencyContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LowFrequencyContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LowFrequencyContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LowFrequencyContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LowFrequencyContainer& x) const; + + /*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ + eProsima_user_DllExport void choice( + uint8_t _choice); + + /*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ + eProsima_user_DllExport uint8_t choice() const; + + /*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ + eProsima_user_DllExport uint8_t& choice(); + + /*! + * @brief This function copies the value in member basic_vehicle_container_low_frequency + * @param _basic_vehicle_container_low_frequency New value to be copied in member basic_vehicle_container_low_frequency + */ + eProsima_user_DllExport void basic_vehicle_container_low_frequency( + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& _basic_vehicle_container_low_frequency); + + /*! + * @brief This function moves the value in member basic_vehicle_container_low_frequency + * @param _basic_vehicle_container_low_frequency New value to be moved in member basic_vehicle_container_low_frequency + */ + eProsima_user_DllExport void basic_vehicle_container_low_frequency( + etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency&& _basic_vehicle_container_low_frequency); + + /*! + * @brief This function returns a constant reference to member basic_vehicle_container_low_frequency + * @return Constant reference to member basic_vehicle_container_low_frequency + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& basic_vehicle_container_low_frequency() const; + + /*! + * @brief This function returns a reference to member basic_vehicle_container_low_frequency + * @return Reference to member basic_vehicle_container_low_frequency + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& basic_vehicle_container_low_frequency(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::LowFrequencyContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_choice; + etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency m_basic_vehicle_container_low_frequency; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.cxx new file mode 100644 index 00000000000..7a9ec3027c1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.cxx @@ -0,0 +1,178 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LowFrequencyContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "LowFrequencyContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace LowFrequencyContainer_Constants { + } //End of namespace LowFrequencyContainer_Constants + LowFrequencyContainerPubSubType::LowFrequencyContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::LowFrequencyContainer_"); + auto type_size = LowFrequencyContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = LowFrequencyContainer::isKeyDefined(); + size_t keyLength = LowFrequencyContainer::getKeyMaxCdrSerializedSize() > 16 ? + LowFrequencyContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LowFrequencyContainerPubSubType::~LowFrequencyContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LowFrequencyContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + LowFrequencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool LowFrequencyContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + LowFrequencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function LowFrequencyContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* LowFrequencyContainerPubSubType::createData() + { + return reinterpret_cast(new LowFrequencyContainer()); + } + + void LowFrequencyContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LowFrequencyContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LowFrequencyContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + LowFrequencyContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || LowFrequencyContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.h new file mode 100644 index 00000000000..1f7ba2ac1a0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.h @@ -0,0 +1,110 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LowFrequencyContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "LowFrequencyContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated LowFrequencyContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace LowFrequencyContainer_Constants + { + } + /*! + * @brief This class represents the TopicDataType of the type LowFrequencyContainer defined by the user in the IDL file. + * @ingroup LOWFREQUENCYCONTAINER + */ + class LowFrequencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LowFrequencyContainer type; + + eProsima_user_DllExport LowFrequencyContainerPubSubType(); + + eProsima_user_DllExport virtual ~LowFrequencyContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.cxx new file mode 100644 index 00000000000..7dd529e1aaa --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathDeltaTime.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PathDeltaTime.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::PathDeltaTime::PathDeltaTime() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@60afd40d + m_value = 0; + +} + +etsi_its_cam_msgs::msg::PathDeltaTime::~PathDeltaTime() +{ +} + +etsi_its_cam_msgs::msg::PathDeltaTime::PathDeltaTime( + const PathDeltaTime& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::PathDeltaTime::PathDeltaTime( + PathDeltaTime&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathDeltaTime::operator =( + const PathDeltaTime& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathDeltaTime::operator =( + PathDeltaTime&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::PathDeltaTime::operator ==( + const PathDeltaTime& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::PathDeltaTime::operator !=( + const PathDeltaTime& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PathDeltaTime::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PathDeltaTime::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PathDeltaTime& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PathDeltaTime::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::PathDeltaTime::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::PathDeltaTime::value( + uint16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint16_t etsi_its_cam_msgs::msg::PathDeltaTime::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint16_t& etsi_its_cam_msgs::msg::PathDeltaTime::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::PathDeltaTime::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PathDeltaTime::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PathDeltaTime::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.h new file mode 100644 index 00000000000..c851458eb1b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathDeltaTime.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PathDeltaTime_SOURCE) +#define PathDeltaTime_DllAPI __declspec( dllexport ) +#else +#define PathDeltaTime_DllAPI __declspec( dllimport ) +#endif // PathDeltaTime_SOURCE +#else +#define PathDeltaTime_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PathDeltaTime_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PathDeltaTime_Constants { + const uint16_t MIN = 1; + const uint16_t MAX = 65535; + const uint16_t TEN_MILLI_SECONDS_IN_PAST = 1; + } // namespace PathDeltaTime_Constants + /*! + * @brief This class represents the structure PathDeltaTime defined by the user in the IDL file. + * @ingroup PATHDELTATIME + */ + class PathDeltaTime + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PathDeltaTime(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PathDeltaTime(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. + */ + eProsima_user_DllExport PathDeltaTime( + const PathDeltaTime& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. + */ + eProsima_user_DllExport PathDeltaTime( + PathDeltaTime&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. + */ + eProsima_user_DllExport PathDeltaTime& operator =( + const PathDeltaTime& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. + */ + eProsima_user_DllExport PathDeltaTime& operator =( + PathDeltaTime&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathDeltaTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PathDeltaTime& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathDeltaTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PathDeltaTime& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PathDeltaTime& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.cxx new file mode 100644 index 00000000000..446b7c19fce --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathDeltaTimePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PathDeltaTimePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PathDeltaTime_Constants { + + + + + } //End of namespace PathDeltaTime_Constants + PathDeltaTimePubSubType::PathDeltaTimePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PathDeltaTime_"); + auto type_size = PathDeltaTime::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PathDeltaTime::isKeyDefined(); + size_t keyLength = PathDeltaTime::getKeyMaxCdrSerializedSize() > 16 ? + PathDeltaTime::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PathDeltaTimePubSubType::~PathDeltaTimePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PathDeltaTimePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PathDeltaTime* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PathDeltaTimePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PathDeltaTime* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PathDeltaTimePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PathDeltaTimePubSubType::createData() + { + return reinterpret_cast(new PathDeltaTime()); + } + + void PathDeltaTimePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PathDeltaTimePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PathDeltaTime* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PathDeltaTime::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PathDeltaTime::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.h new file mode 100644 index 00000000000..4db08bacead --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathDeltaTimePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_PUBSUBTYPES_H_ + +#include +#include + +#include "PathDeltaTime.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PathDeltaTime is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace PathDeltaTime_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type PathDeltaTime defined by the user in the IDL file. + * @ingroup PATHDELTATIME + */ + class PathDeltaTimePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PathDeltaTime type; + + eProsima_user_DllExport PathDeltaTimePubSubType(); + + eProsima_user_DllExport virtual ~PathDeltaTimePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) PathDeltaTime(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.cxx new file mode 100644 index 00000000000..01b50a9a696 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.cxx @@ -0,0 +1,201 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathHistory.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PathHistory.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::PathHistory::PathHistory() +{ + // m_array com.eprosima.idl.parser.typecode.SequenceTypeCode@1d572e62 + + +} + +etsi_its_cam_msgs::msg::PathHistory::~PathHistory() +{ +} + +etsi_its_cam_msgs::msg::PathHistory::PathHistory( + const PathHistory& x) +{ + m_array = x.m_array; +} + +etsi_its_cam_msgs::msg::PathHistory::PathHistory( + PathHistory&& x) +{ + m_array = std::move(x.m_array); +} + +etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::PathHistory::operator =( + const PathHistory& x) +{ + + m_array = x.m_array; + + return *this; +} + +etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::PathHistory::operator =( + PathHistory&& x) +{ + + m_array = std::move(x.m_array); + + return *this; +} + +bool etsi_its_cam_msgs::msg::PathHistory::operator ==( + const PathHistory& x) const +{ + + return (m_array == x.m_array); +} + +bool etsi_its_cam_msgs::msg::PathHistory::operator !=( + const PathHistory& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PathHistory::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += etsi_its_cam_msgs::msg::PathPoint::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PathHistory::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PathHistory& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.array().size(); ++a) + { + current_alignment += etsi_its_cam_msgs::msg::PathPoint::getCdrSerializedSize(data.array().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PathHistory::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_array; +} + +void etsi_its_cam_msgs::msg::PathHistory::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_array;} + +/*! + * @brief This function copies the value in member array + * @param _array New value to be copied in member array + */ +void etsi_its_cam_msgs::msg::PathHistory::array( + const std::vector& _array) +{ + m_array = _array; +} + +/*! + * @brief This function moves the value in member array + * @param _array New value to be moved in member array + */ +void etsi_its_cam_msgs::msg::PathHistory::array( + std::vector&& _array) +{ + m_array = std::move(_array); +} + +/*! + * @brief This function returns a constant reference to member array + * @return Constant reference to member array + */ +const std::vector& etsi_its_cam_msgs::msg::PathHistory::array() const +{ + return m_array; +} + +/*! + * @brief This function returns a reference to member array + * @return Reference to member array + */ +std::vector& etsi_its_cam_msgs::msg::PathHistory::array() +{ + return m_array; +} + +size_t etsi_its_cam_msgs::msg::PathHistory::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PathHistory::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PathHistory::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.h new file mode 100644 index 00000000000..d15c6e2f7f8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.h @@ -0,0 +1,221 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathHistory.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_H_ + +#include "PathPoint.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PathHistory_SOURCE) +#define PathHistory_DllAPI __declspec( dllexport ) +#else +#define PathHistory_DllAPI __declspec( dllimport ) +#endif // PathHistory_SOURCE +#else +#define PathHistory_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PathHistory_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PathHistory_Constants { + const uint8_t MIN_SIZE = 0; + const uint8_t MAX_SIZE = 40; + } // namespace PathHistory_Constants + /*! + * @brief This class represents the structure PathHistory defined by the user in the IDL file. + * @ingroup PATHHISTORY + */ + class PathHistory + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PathHistory(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PathHistory(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. + */ + eProsima_user_DllExport PathHistory( + const PathHistory& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. + */ + eProsima_user_DllExport PathHistory( + PathHistory&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. + */ + eProsima_user_DllExport PathHistory& operator =( + const PathHistory& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. + */ + eProsima_user_DllExport PathHistory& operator =( + PathHistory&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathHistory object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PathHistory& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathHistory object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PathHistory& x) const; + + /*! + * @brief This function copies the value in member array + * @param _array New value to be copied in member array + */ + eProsima_user_DllExport void array( + const std::vector& _array); + + /*! + * @brief This function moves the value in member array + * @param _array New value to be moved in member array + */ + eProsima_user_DllExport void array( + std::vector&& _array); + + /*! + * @brief This function returns a constant reference to member array + * @return Constant reference to member array + */ + eProsima_user_DllExport const std::vector& array() const; + + /*! + * @brief This function returns a reference to member array + * @return Reference to member array + */ + eProsima_user_DllExport std::vector& array(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PathHistory& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_array; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.cxx new file mode 100644 index 00000000000..ee1bafed3ef --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathHistoryPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PathHistoryPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PathHistory_Constants { + + + + } //End of namespace PathHistory_Constants + PathHistoryPubSubType::PathHistoryPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PathHistory_"); + auto type_size = PathHistory::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PathHistory::isKeyDefined(); + size_t keyLength = PathHistory::getKeyMaxCdrSerializedSize() > 16 ? + PathHistory::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PathHistoryPubSubType::~PathHistoryPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PathHistoryPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PathHistory* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PathHistoryPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PathHistory* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PathHistoryPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PathHistoryPubSubType::createData() + { + return reinterpret_cast(new PathHistory()); + } + + void PathHistoryPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PathHistoryPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PathHistory* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PathHistory::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PathHistory::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/types/ImuPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.h similarity index 77% rename from LibCarla/source/carla/ros2/types/ImuPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.h index 1dcca34f3e1..e86969c298b 100644 --- a/LibCarla/source/carla/ros2/types/ImuPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.h @@ -13,48 +13,48 @@ // limitations under the License. /*! - * @file ImuPubSubTypes.h + * @file PathHistoryPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_PUBSUBTYPES_H_ #include #include -#include "Imu.h" - -#include "Vector3PubSubTypes.h" -#include "QuaternionPubSubTypes.h" -#include "HeaderPubSubTypes.h" +#include "PathHistory.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated Imu is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated PathHistory is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace sensor_msgs +namespace etsi_its_cam_msgs { namespace msg { - typedef std::array sensor_msgs__Imu__double_array_9; + namespace PathHistory_Constants + { + + } /*! - * @brief This class represents the TopicDataType of the type Imu defined by the user in the IDL file. - * @ingroup IMU + * @brief This class represents the TopicDataType of the type PathHistory defined by the user in the IDL file. + * @ingroup PATHHISTORY */ - class ImuPubSubType : public eprosima::fastdds::dds::TopicDataType + class PathHistoryPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef Imu type; + typedef PathHistory type; - eProsima_user_DllExport ImuPubSubType(); + eProsima_user_DllExport PathHistoryPubSubType(); - eProsima_user_DllExport virtual ~ImuPubSubType() override; + eProsima_user_DllExport virtual ~PathHistoryPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -102,10 +102,11 @@ namespace sensor_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.cxx new file mode 100644 index 00000000000..d8ed47d4519 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.cxx @@ -0,0 +1,281 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathPoint.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PathPoint.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::PathPoint::PathPoint() +{ + // m_path_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5167268 + + // m_path_delta_time com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1cfd1875 + + // m_path_delta_time_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@28c0b664 + m_path_delta_time_is_present = false; + +} + +etsi_its_cam_msgs::msg::PathPoint::~PathPoint() +{ + + +} + +etsi_its_cam_msgs::msg::PathPoint::PathPoint( + const PathPoint& x) +{ + m_path_position = x.m_path_position; + m_path_delta_time = x.m_path_delta_time; + m_path_delta_time_is_present = x.m_path_delta_time_is_present; +} + +etsi_its_cam_msgs::msg::PathPoint::PathPoint( + PathPoint&& x) +{ + m_path_position = std::move(x.m_path_position); + m_path_delta_time = std::move(x.m_path_delta_time); + m_path_delta_time_is_present = x.m_path_delta_time_is_present; +} + +etsi_its_cam_msgs::msg::PathPoint& etsi_its_cam_msgs::msg::PathPoint::operator =( + const PathPoint& x) +{ + + m_path_position = x.m_path_position; + m_path_delta_time = x.m_path_delta_time; + m_path_delta_time_is_present = x.m_path_delta_time_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::PathPoint& etsi_its_cam_msgs::msg::PathPoint::operator =( + PathPoint&& x) +{ + + m_path_position = std::move(x.m_path_position); + m_path_delta_time = std::move(x.m_path_delta_time); + m_path_delta_time_is_present = x.m_path_delta_time_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::PathPoint::operator ==( + const PathPoint& x) const +{ + + return (m_path_position == x.m_path_position && m_path_delta_time == x.m_path_delta_time && m_path_delta_time_is_present == x.m_path_delta_time_is_present); +} + +bool etsi_its_cam_msgs::msg::PathPoint::operator !=( + const PathPoint& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PathPoint::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::DeltaReferencePosition::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PathDeltaTime::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PathPoint::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PathPoint& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::DeltaReferencePosition::getCdrSerializedSize(data.path_position(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PathDeltaTime::getCdrSerializedSize(data.path_delta_time(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PathPoint::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_path_position; + scdr << m_path_delta_time; + scdr << m_path_delta_time_is_present; + +} + +void etsi_its_cam_msgs::msg::PathPoint::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_path_position; + dcdr >> m_path_delta_time; + dcdr >> m_path_delta_time_is_present; +} + +/*! + * @brief This function copies the value in member path_position + * @param _path_position New value to be copied in member path_position + */ +void etsi_its_cam_msgs::msg::PathPoint::path_position( + const etsi_its_cam_msgs::msg::DeltaReferencePosition& _path_position) +{ + m_path_position = _path_position; +} + +/*! + * @brief This function moves the value in member path_position + * @param _path_position New value to be moved in member path_position + */ +void etsi_its_cam_msgs::msg::PathPoint::path_position( + etsi_its_cam_msgs::msg::DeltaReferencePosition&& _path_position) +{ + m_path_position = std::move(_path_position); +} + +/*! + * @brief This function returns a constant reference to member path_position + * @return Constant reference to member path_position + */ +const etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::PathPoint::path_position() const +{ + return m_path_position; +} + +/*! + * @brief This function returns a reference to member path_position + * @return Reference to member path_position + */ +etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::PathPoint::path_position() +{ + return m_path_position; +} +/*! + * @brief This function copies the value in member path_delta_time + * @param _path_delta_time New value to be copied in member path_delta_time + */ +void etsi_its_cam_msgs::msg::PathPoint::path_delta_time( + const etsi_its_cam_msgs::msg::PathDeltaTime& _path_delta_time) +{ + m_path_delta_time = _path_delta_time; +} + +/*! + * @brief This function moves the value in member path_delta_time + * @param _path_delta_time New value to be moved in member path_delta_time + */ +void etsi_its_cam_msgs::msg::PathPoint::path_delta_time( + etsi_its_cam_msgs::msg::PathDeltaTime&& _path_delta_time) +{ + m_path_delta_time = std::move(_path_delta_time); +} + +/*! + * @brief This function returns a constant reference to member path_delta_time + * @return Constant reference to member path_delta_time + */ +const etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathPoint::path_delta_time() const +{ + return m_path_delta_time; +} + +/*! + * @brief This function returns a reference to member path_delta_time + * @return Reference to member path_delta_time + */ +etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathPoint::path_delta_time() +{ + return m_path_delta_time; +} +/*! + * @brief This function sets a value in member path_delta_time_is_present + * @param _path_delta_time_is_present New value for member path_delta_time_is_present + */ +void etsi_its_cam_msgs::msg::PathPoint::path_delta_time_is_present( + bool _path_delta_time_is_present) +{ + m_path_delta_time_is_present = _path_delta_time_is_present; +} + +/*! + * @brief This function returns the value of member path_delta_time_is_present + * @return Value of member path_delta_time_is_present + */ +bool etsi_its_cam_msgs::msg::PathPoint::path_delta_time_is_present() const +{ + return m_path_delta_time_is_present; +} + +/*! + * @brief This function returns a reference to member path_delta_time_is_present + * @return Reference to member path_delta_time_is_present + */ +bool& etsi_its_cam_msgs::msg::PathPoint::path_delta_time_is_present() +{ + return m_path_delta_time_is_present; +} + + +size_t etsi_its_cam_msgs::msg::PathPoint::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PathPoint::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PathPoint::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.h new file mode 100644 index 00000000000..439be91762b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.h @@ -0,0 +1,264 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathPoint.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_H_ + +#include "DeltaReferencePosition.h" +#include "PathDeltaTime.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PathPoint_SOURCE) +#define PathPoint_DllAPI __declspec( dllexport ) +#else +#define PathPoint_DllAPI __declspec( dllimport ) +#endif // PathPoint_SOURCE +#else +#define PathPoint_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PathPoint_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure PathPoint defined by the user in the IDL file. + * @ingroup PATHPOINT + */ + class PathPoint + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PathPoint(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PathPoint(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. + */ + eProsima_user_DllExport PathPoint( + const PathPoint& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. + */ + eProsima_user_DllExport PathPoint( + PathPoint&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. + */ + eProsima_user_DllExport PathPoint& operator =( + const PathPoint& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. + */ + eProsima_user_DllExport PathPoint& operator =( + PathPoint&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathPoint object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PathPoint& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathPoint object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PathPoint& x) const; + + /*! + * @brief This function copies the value in member path_position + * @param _path_position New value to be copied in member path_position + */ + eProsima_user_DllExport void path_position( + const etsi_its_cam_msgs::msg::DeltaReferencePosition& _path_position); + + /*! + * @brief This function moves the value in member path_position + * @param _path_position New value to be moved in member path_position + */ + eProsima_user_DllExport void path_position( + etsi_its_cam_msgs::msg::DeltaReferencePosition&& _path_position); + + /*! + * @brief This function returns a constant reference to member path_position + * @return Constant reference to member path_position + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaReferencePosition& path_position() const; + + /*! + * @brief This function returns a reference to member path_position + * @return Reference to member path_position + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaReferencePosition& path_position(); + /*! + * @brief This function copies the value in member path_delta_time + * @param _path_delta_time New value to be copied in member path_delta_time + */ + eProsima_user_DllExport void path_delta_time( + const etsi_its_cam_msgs::msg::PathDeltaTime& _path_delta_time); + + /*! + * @brief This function moves the value in member path_delta_time + * @param _path_delta_time New value to be moved in member path_delta_time + */ + eProsima_user_DllExport void path_delta_time( + etsi_its_cam_msgs::msg::PathDeltaTime&& _path_delta_time); + + /*! + * @brief This function returns a constant reference to member path_delta_time + * @return Constant reference to member path_delta_time + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PathDeltaTime& path_delta_time() const; + + /*! + * @brief This function returns a reference to member path_delta_time + * @return Reference to member path_delta_time + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PathDeltaTime& path_delta_time(); + /*! + * @brief This function sets a value in member path_delta_time_is_present + * @param _path_delta_time_is_present New value for member path_delta_time_is_present + */ + eProsima_user_DllExport void path_delta_time_is_present( + bool _path_delta_time_is_present); + + /*! + * @brief This function returns the value of member path_delta_time_is_present + * @return Value of member path_delta_time_is_present + */ + eProsima_user_DllExport bool path_delta_time_is_present() const; + + /*! + * @brief This function returns a reference to member path_delta_time_is_present + * @return Reference to member path_delta_time_is_present + */ + eProsima_user_DllExport bool& path_delta_time_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PathPoint& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::DeltaReferencePosition m_path_position; + etsi_its_cam_msgs::msg::PathDeltaTime m_path_delta_time; + bool m_path_delta_time_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.cxx new file mode 100644 index 00000000000..956d7d1f9b2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathPointPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PathPointPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + PathPointPubSubType::PathPointPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PathPoint_"); + auto type_size = PathPoint::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PathPoint::isKeyDefined(); + size_t keyLength = PathPoint::getKeyMaxCdrSerializedSize() > 16 ? + PathPoint::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PathPointPubSubType::~PathPointPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PathPointPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PathPoint* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PathPointPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PathPoint* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PathPointPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PathPointPubSubType::createData() + { + return reinterpret_cast(new PathPoint()); + } + + void PathPointPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PathPointPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PathPoint* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PathPoint::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PathPoint::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.h new file mode 100644 index 00000000000..f7d91879e92 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathPointPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_PUBSUBTYPES_H_ + +#include +#include + +#include "PathPoint.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PathPoint is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type PathPoint defined by the user in the IDL file. + * @ingroup PATHPOINT + */ + class PathPointPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PathPoint type; + + eProsima_user_DllExport PathPointPubSubType(); + + eProsima_user_DllExport virtual ~PathPointPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) PathPoint(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.cxx new file mode 100644 index 00000000000..931268e7ed3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PerformanceClass.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PerformanceClass.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::PerformanceClass::PerformanceClass() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77128dab + m_value = 0; + +} + +etsi_its_cam_msgs::msg::PerformanceClass::~PerformanceClass() +{ +} + +etsi_its_cam_msgs::msg::PerformanceClass::PerformanceClass( + const PerformanceClass& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::PerformanceClass::PerformanceClass( + PerformanceClass&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::PerformanceClass::operator =( + const PerformanceClass& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::PerformanceClass::operator =( + PerformanceClass&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::PerformanceClass::operator ==( + const PerformanceClass& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::PerformanceClass::operator !=( + const PerformanceClass& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PerformanceClass::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PerformanceClass::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PerformanceClass& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PerformanceClass::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::PerformanceClass::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::PerformanceClass::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::PerformanceClass::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::PerformanceClass::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::PerformanceClass::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PerformanceClass::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PerformanceClass::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/Time.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.h similarity index 59% rename from LibCarla/source/carla/ros2/types/Time.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.h index 216907bfda2..ca6a0f130ea 100644 --- a/LibCarla/source/carla/ros2/types/Time.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.h @@ -13,18 +13,16 @@ // limitations under the License. /*! - * @file Time.h + * @file PerformanceClass.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_H_ -#include - #include #include #include @@ -44,16 +42,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Time_SOURCE) -#define Time_DllAPI __declspec( dllexport ) +#if defined(PerformanceClass_SOURCE) +#define PerformanceClass_DllAPI __declspec( dllexport ) #else -#define Time_DllAPI __declspec( dllimport ) -#endif // Time_SOURCE +#define PerformanceClass_DllAPI __declspec( dllimport ) +#endif // PerformanceClass_SOURCE #else -#define Time_DllAPI +#define PerformanceClass_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Time_DllAPI +#define PerformanceClass_DllAPI #endif // _WIN32 namespace eprosima { @@ -62,112 +60,102 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace builtin_interfaces { + +namespace etsi_its_cam_msgs { namespace msg { + namespace PerformanceClass_Constants { + const uint8_t MIN = 0; + const uint8_t MAX = 7; + const uint8_t UNAVAILABLE = 0; + const uint8_t PERFORMANCE_CLASS_A = 1; + const uint8_t PERFORMANCE_CLASS_B = 2; + } // namespace PerformanceClass_Constants /*! - * @brief This class represents the structure Time defined by the user in the IDL file. - * @ingroup TIME + * @brief This class represents the structure PerformanceClass defined by the user in the IDL file. + * @ingroup PERFORMANCECLASS */ - class Time + class PerformanceClass { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport Time(); + eProsima_user_DllExport PerformanceClass(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Time(); + eProsima_user_DllExport ~PerformanceClass(); /*! * @brief Copy constructor. - * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. */ - eProsima_user_DllExport Time( - const Time& x); + eProsima_user_DllExport PerformanceClass( + const PerformanceClass& x); /*! * @brief Move constructor. - * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. */ - eProsima_user_DllExport Time( - Time&& x) noexcept; + eProsima_user_DllExport PerformanceClass( + PerformanceClass&& x); /*! * @brief Copy assignment. - * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. */ - eProsima_user_DllExport Time& operator =( - const Time& x); + eProsima_user_DllExport PerformanceClass& operator =( + const PerformanceClass& x); /*! * @brief Move assignment. - * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. */ - eProsima_user_DllExport Time& operator =( - Time&& x) noexcept; + eProsima_user_DllExport PerformanceClass& operator =( + PerformanceClass&& x); /*! * @brief Comparison operator. - * @param x builtin_interfaces::msg::Time object to compare. + * @param x etsi_its_cam_msgs::msg::PerformanceClass object to compare. */ eProsima_user_DllExport bool operator ==( - const Time& x) const; + const PerformanceClass& x) const; /*! * @brief Comparison operator. - * @param x builtin_interfaces::msg::Time object to compare. + * @param x etsi_its_cam_msgs::msg::PerformanceClass object to compare. */ eProsima_user_DllExport bool operator !=( - const Time& x) const; - - /*! - * @brief This function sets a value in member sec - * @param _sec New value for member sec - */ - eProsima_user_DllExport void sec( - int32_t _sec); + const PerformanceClass& x) const; /*! - * @brief This function returns the value of member sec - * @return Value of member sec + * @brief This function sets a value in member value + * @param _value New value for member value */ - eProsima_user_DllExport int32_t sec() const; + eProsima_user_DllExport void value( + uint8_t _value); /*! - * @brief This function returns a reference to member sec - * @return Reference to member sec + * @brief This function returns the value of member value + * @return Value of member value */ - eProsima_user_DllExport int32_t& sec(); + eProsima_user_DllExport uint8_t value() const; /*! - * @brief This function sets a value in member nanosec - * @param _nanosec New value for member nanosec + * @brief This function returns a reference to member value + * @return Reference to member value */ - eProsima_user_DllExport void nanosec( - uint32_t _nanosec); + eProsima_user_DllExport uint8_t& value(); - /*! - * @brief This function returns the value of member nanosec - * @return Value of member nanosec - */ - eProsima_user_DllExport uint32_t nanosec() const; /*! - * @brief This function returns a reference to member nanosec - * @return Reference to member nanosec + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. */ - eProsima_user_DllExport uint32_t& nanosec(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -178,9 +166,10 @@ namespace builtin_interfaces { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const builtin_interfaces::msg::Time& data, + const etsi_its_cam_msgs::msg::PerformanceClass& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -195,6 +184,8 @@ namespace builtin_interfaces { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -217,10 +208,10 @@ namespace builtin_interfaces { eprosima::fastcdr::Cdr& cdr) const; private: - int32_t m_sec; - uint32_t m_nanosec; + + uint8_t m_value; }; } // namespace msg -} // namespace builtin_interfaces +} // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.cxx new file mode 100644 index 00000000000..73bfb60a691 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PerformanceClassPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PerformanceClassPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PerformanceClass_Constants { + + + + + + + } //End of namespace PerformanceClass_Constants + PerformanceClassPubSubType::PerformanceClassPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PerformanceClass_"); + auto type_size = PerformanceClass::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PerformanceClass::isKeyDefined(); + size_t keyLength = PerformanceClass::getKeyMaxCdrSerializedSize() > 16 ? + PerformanceClass::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PerformanceClassPubSubType::~PerformanceClassPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PerformanceClassPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PerformanceClass* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PerformanceClassPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PerformanceClass* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PerformanceClassPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PerformanceClassPubSubType::createData() + { + return reinterpret_cast(new PerformanceClass()); + } + + void PerformanceClassPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PerformanceClassPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PerformanceClass* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PerformanceClass::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PerformanceClass::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.h new file mode 100644 index 00000000000..4e8945ba55a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PerformanceClassPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_PUBSUBTYPES_H_ + +#include +#include + +#include "PerformanceClass.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PerformanceClass is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace PerformanceClass_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type PerformanceClass defined by the user in the IDL file. + * @ingroup PERFORMANCECLASS + */ + class PerformanceClassPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PerformanceClass type; + + eProsima_user_DllExport PerformanceClassPubSubType(); + + eProsima_user_DllExport virtual ~PerformanceClassPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) PerformanceClass(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.cxx new file mode 100644 index 00000000000..f8b73c2531d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosConfidenceEllipse.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PosConfidenceEllipse.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::PosConfidenceEllipse::PosConfidenceEllipse() +{ + // m_semi_major_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4c03a37 + + // m_semi_minor_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4c03a37 + + // m_semi_major_orientation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2e140e59 + + +} + +etsi_its_cam_msgs::msg::PosConfidenceEllipse::~PosConfidenceEllipse() +{ + + +} + +etsi_its_cam_msgs::msg::PosConfidenceEllipse::PosConfidenceEllipse( + const PosConfidenceEllipse& x) +{ + m_semi_major_confidence = x.m_semi_major_confidence; + m_semi_minor_confidence = x.m_semi_minor_confidence; + m_semi_major_orientation = x.m_semi_major_orientation; +} + +etsi_its_cam_msgs::msg::PosConfidenceEllipse::PosConfidenceEllipse( + PosConfidenceEllipse&& x) +{ + m_semi_major_confidence = std::move(x.m_semi_major_confidence); + m_semi_minor_confidence = std::move(x.m_semi_minor_confidence); + m_semi_major_orientation = std::move(x.m_semi_major_orientation); +} + +etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::PosConfidenceEllipse::operator =( + const PosConfidenceEllipse& x) +{ + + m_semi_major_confidence = x.m_semi_major_confidence; + m_semi_minor_confidence = x.m_semi_minor_confidence; + m_semi_major_orientation = x.m_semi_major_orientation; + + return *this; +} + +etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::PosConfidenceEllipse::operator =( + PosConfidenceEllipse&& x) +{ + + m_semi_major_confidence = std::move(x.m_semi_major_confidence); + m_semi_minor_confidence = std::move(x.m_semi_minor_confidence); + m_semi_major_orientation = std::move(x.m_semi_major_orientation); + + return *this; +} + +bool etsi_its_cam_msgs::msg::PosConfidenceEllipse::operator ==( + const PosConfidenceEllipse& x) const +{ + + return (m_semi_major_confidence == x.m_semi_major_confidence && m_semi_minor_confidence == x.m_semi_minor_confidence && m_semi_major_orientation == x.m_semi_major_orientation); +} + +bool etsi_its_cam_msgs::msg::PosConfidenceEllipse::operator !=( + const PosConfidenceEllipse& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PosConfidenceEllipse::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::SemiAxisLength::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SemiAxisLength::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::HeadingValue::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PosConfidenceEllipse::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::SemiAxisLength::getCdrSerializedSize(data.semi_major_confidence(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SemiAxisLength::getCdrSerializedSize(data.semi_minor_confidence(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::HeadingValue::getCdrSerializedSize(data.semi_major_orientation(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_semi_major_confidence; + scdr << m_semi_minor_confidence; + scdr << m_semi_major_orientation; + +} + +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_semi_major_confidence; + dcdr >> m_semi_minor_confidence; + dcdr >> m_semi_major_orientation; +} + +/*! + * @brief This function copies the value in member semi_major_confidence + * @param _semi_major_confidence New value to be copied in member semi_major_confidence + */ +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence( + const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_major_confidence) +{ + m_semi_major_confidence = _semi_major_confidence; +} + +/*! + * @brief This function moves the value in member semi_major_confidence + * @param _semi_major_confidence New value to be moved in member semi_major_confidence + */ +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence( + etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_major_confidence) +{ + m_semi_major_confidence = std::move(_semi_major_confidence); +} + +/*! + * @brief This function returns a constant reference to member semi_major_confidence + * @return Constant reference to member semi_major_confidence + */ +const etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence() const +{ + return m_semi_major_confidence; +} + +/*! + * @brief This function returns a reference to member semi_major_confidence + * @return Reference to member semi_major_confidence + */ +etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence() +{ + return m_semi_major_confidence; +} +/*! + * @brief This function copies the value in member semi_minor_confidence + * @param _semi_minor_confidence New value to be copied in member semi_minor_confidence + */ +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence( + const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_minor_confidence) +{ + m_semi_minor_confidence = _semi_minor_confidence; +} + +/*! + * @brief This function moves the value in member semi_minor_confidence + * @param _semi_minor_confidence New value to be moved in member semi_minor_confidence + */ +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence( + etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_minor_confidence) +{ + m_semi_minor_confidence = std::move(_semi_minor_confidence); +} + +/*! + * @brief This function returns a constant reference to member semi_minor_confidence + * @return Constant reference to member semi_minor_confidence + */ +const etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence() const +{ + return m_semi_minor_confidence; +} + +/*! + * @brief This function returns a reference to member semi_minor_confidence + * @return Reference to member semi_minor_confidence + */ +etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence() +{ + return m_semi_minor_confidence; +} +/*! + * @brief This function copies the value in member semi_major_orientation + * @param _semi_major_orientation New value to be copied in member semi_major_orientation + */ +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation( + const etsi_its_cam_msgs::msg::HeadingValue& _semi_major_orientation) +{ + m_semi_major_orientation = _semi_major_orientation; +} + +/*! + * @brief This function moves the value in member semi_major_orientation + * @param _semi_major_orientation New value to be moved in member semi_major_orientation + */ +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation( + etsi_its_cam_msgs::msg::HeadingValue&& _semi_major_orientation) +{ + m_semi_major_orientation = std::move(_semi_major_orientation); +} + +/*! + * @brief This function returns a constant reference to member semi_major_orientation + * @return Constant reference to member semi_major_orientation + */ +const etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation() const +{ + return m_semi_major_orientation; +} + +/*! + * @brief This function returns a reference to member semi_major_orientation + * @return Reference to member semi_major_orientation + */ +etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation() +{ + return m_semi_major_orientation; +} + +size_t etsi_its_cam_msgs::msg::PosConfidenceEllipse::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PosConfidenceEllipse::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PosConfidenceEllipse::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.h new file mode 100644 index 00000000000..95472b3428e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.h @@ -0,0 +1,270 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosConfidenceEllipse.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_H_ + +#include "HeadingValue.h" +#include "SemiAxisLength.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PosConfidenceEllipse_SOURCE) +#define PosConfidenceEllipse_DllAPI __declspec( dllexport ) +#else +#define PosConfidenceEllipse_DllAPI __declspec( dllimport ) +#endif // PosConfidenceEllipse_SOURCE +#else +#define PosConfidenceEllipse_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PosConfidenceEllipse_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure PosConfidenceEllipse defined by the user in the IDL file. + * @ingroup POSCONFIDENCEELLIPSE + */ + class PosConfidenceEllipse + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PosConfidenceEllipse(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PosConfidenceEllipse(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. + */ + eProsima_user_DllExport PosConfidenceEllipse( + const PosConfidenceEllipse& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. + */ + eProsima_user_DllExport PosConfidenceEllipse( + PosConfidenceEllipse&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. + */ + eProsima_user_DllExport PosConfidenceEllipse& operator =( + const PosConfidenceEllipse& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. + */ + eProsima_user_DllExport PosConfidenceEllipse& operator =( + PosConfidenceEllipse&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PosConfidenceEllipse object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PosConfidenceEllipse& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PosConfidenceEllipse object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PosConfidenceEllipse& x) const; + + /*! + * @brief This function copies the value in member semi_major_confidence + * @param _semi_major_confidence New value to be copied in member semi_major_confidence + */ + eProsima_user_DllExport void semi_major_confidence( + const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_major_confidence); + + /*! + * @brief This function moves the value in member semi_major_confidence + * @param _semi_major_confidence New value to be moved in member semi_major_confidence + */ + eProsima_user_DllExport void semi_major_confidence( + etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_major_confidence); + + /*! + * @brief This function returns a constant reference to member semi_major_confidence + * @return Constant reference to member semi_major_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SemiAxisLength& semi_major_confidence() const; + + /*! + * @brief This function returns a reference to member semi_major_confidence + * @return Reference to member semi_major_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SemiAxisLength& semi_major_confidence(); + /*! + * @brief This function copies the value in member semi_minor_confidence + * @param _semi_minor_confidence New value to be copied in member semi_minor_confidence + */ + eProsima_user_DllExport void semi_minor_confidence( + const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_minor_confidence); + + /*! + * @brief This function moves the value in member semi_minor_confidence + * @param _semi_minor_confidence New value to be moved in member semi_minor_confidence + */ + eProsima_user_DllExport void semi_minor_confidence( + etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_minor_confidence); + + /*! + * @brief This function returns a constant reference to member semi_minor_confidence + * @return Constant reference to member semi_minor_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SemiAxisLength& semi_minor_confidence() const; + + /*! + * @brief This function returns a reference to member semi_minor_confidence + * @return Reference to member semi_minor_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SemiAxisLength& semi_minor_confidence(); + /*! + * @brief This function copies the value in member semi_major_orientation + * @param _semi_major_orientation New value to be copied in member semi_major_orientation + */ + eProsima_user_DllExport void semi_major_orientation( + const etsi_its_cam_msgs::msg::HeadingValue& _semi_major_orientation); + + /*! + * @brief This function moves the value in member semi_major_orientation + * @param _semi_major_orientation New value to be moved in member semi_major_orientation + */ + eProsima_user_DllExport void semi_major_orientation( + etsi_its_cam_msgs::msg::HeadingValue&& _semi_major_orientation); + + /*! + * @brief This function returns a constant reference to member semi_major_orientation + * @return Constant reference to member semi_major_orientation + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingValue& semi_major_orientation() const; + + /*! + * @brief This function returns a reference to member semi_major_orientation + * @return Reference to member semi_major_orientation + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingValue& semi_major_orientation(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::SemiAxisLength m_semi_major_confidence; + etsi_its_cam_msgs::msg::SemiAxisLength m_semi_minor_confidence; + etsi_its_cam_msgs::msg::HeadingValue m_semi_major_orientation; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.cxx new file mode 100644 index 00000000000..b27946f719d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosConfidenceEllipsePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PosConfidenceEllipsePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + PosConfidenceEllipsePubSubType::PosConfidenceEllipsePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PosConfidenceEllipse_"); + auto type_size = PosConfidenceEllipse::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PosConfidenceEllipse::isKeyDefined(); + size_t keyLength = PosConfidenceEllipse::getKeyMaxCdrSerializedSize() > 16 ? + PosConfidenceEllipse::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PosConfidenceEllipsePubSubType::~PosConfidenceEllipsePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PosConfidenceEllipsePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PosConfidenceEllipse* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PosConfidenceEllipsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PosConfidenceEllipse* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PosConfidenceEllipsePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PosConfidenceEllipsePubSubType::createData() + { + return reinterpret_cast(new PosConfidenceEllipse()); + } + + void PosConfidenceEllipsePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PosConfidenceEllipsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PosConfidenceEllipse* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PosConfidenceEllipse::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PosConfidenceEllipse::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.h new file mode 100644 index 00000000000..9535c127377 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosConfidenceEllipsePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_PUBSUBTYPES_H_ + +#include +#include + +#include "PosConfidenceEllipse.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PosConfidenceEllipse is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type PosConfidenceEllipse defined by the user in the IDL file. + * @ingroup POSCONFIDENCEELLIPSE + */ + class PosConfidenceEllipsePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PosConfidenceEllipse type; + + eProsima_user_DllExport PosConfidenceEllipsePubSubType(); + + eProsima_user_DllExport virtual ~PosConfidenceEllipsePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) PosConfidenceEllipse(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.cxx new file mode 100644 index 00000000000..77723869509 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.cxx @@ -0,0 +1,559 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZone.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ProtectedCommunicationZone.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::ProtectedCommunicationZone::ProtectedCommunicationZone() +{ + // m_protected_zone_type com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@545f80bf + + // m_expiry_time com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@66f66866 + + // m_expiry_time_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@22fa55b2 + m_expiry_time_is_present = false; + // m_protected_zone_latitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4d666b41 + + // m_protected_zone_longitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6594402a + + // m_protected_zone_radius com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@30f4b1a6 + + // m_protected_zone_radius_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@405325cf + m_protected_zone_radius_is_present = false; + // m_protected_zone_id com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3e1162e7 + + // m_protected_zone_id_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@79c3f01f + m_protected_zone_id_is_present = false; + +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZone::~ProtectedCommunicationZone() +{ + + + + + + + + +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZone::ProtectedCommunicationZone( + const ProtectedCommunicationZone& x) +{ + m_protected_zone_type = x.m_protected_zone_type; + m_expiry_time = x.m_expiry_time; + m_expiry_time_is_present = x.m_expiry_time_is_present; + m_protected_zone_latitude = x.m_protected_zone_latitude; + m_protected_zone_longitude = x.m_protected_zone_longitude; + m_protected_zone_radius = x.m_protected_zone_radius; + m_protected_zone_radius_is_present = x.m_protected_zone_radius_is_present; + m_protected_zone_id = x.m_protected_zone_id; + m_protected_zone_id_is_present = x.m_protected_zone_id_is_present; +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZone::ProtectedCommunicationZone( + ProtectedCommunicationZone&& x) +{ + m_protected_zone_type = std::move(x.m_protected_zone_type); + m_expiry_time = std::move(x.m_expiry_time); + m_expiry_time_is_present = x.m_expiry_time_is_present; + m_protected_zone_latitude = std::move(x.m_protected_zone_latitude); + m_protected_zone_longitude = std::move(x.m_protected_zone_longitude); + m_protected_zone_radius = std::move(x.m_protected_zone_radius); + m_protected_zone_radius_is_present = x.m_protected_zone_radius_is_present; + m_protected_zone_id = std::move(x.m_protected_zone_id); + m_protected_zone_id_is_present = x.m_protected_zone_id_is_present; +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZone& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::operator =( + const ProtectedCommunicationZone& x) +{ + + m_protected_zone_type = x.m_protected_zone_type; + m_expiry_time = x.m_expiry_time; + m_expiry_time_is_present = x.m_expiry_time_is_present; + m_protected_zone_latitude = x.m_protected_zone_latitude; + m_protected_zone_longitude = x.m_protected_zone_longitude; + m_protected_zone_radius = x.m_protected_zone_radius; + m_protected_zone_radius_is_present = x.m_protected_zone_radius_is_present; + m_protected_zone_id = x.m_protected_zone_id; + m_protected_zone_id_is_present = x.m_protected_zone_id_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZone& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::operator =( + ProtectedCommunicationZone&& x) +{ + + m_protected_zone_type = std::move(x.m_protected_zone_type); + m_expiry_time = std::move(x.m_expiry_time); + m_expiry_time_is_present = x.m_expiry_time_is_present; + m_protected_zone_latitude = std::move(x.m_protected_zone_latitude); + m_protected_zone_longitude = std::move(x.m_protected_zone_longitude); + m_protected_zone_radius = std::move(x.m_protected_zone_radius); + m_protected_zone_radius_is_present = x.m_protected_zone_radius_is_present; + m_protected_zone_id = std::move(x.m_protected_zone_id); + m_protected_zone_id_is_present = x.m_protected_zone_id_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::operator ==( + const ProtectedCommunicationZone& x) const +{ + + return (m_protected_zone_type == x.m_protected_zone_type && m_expiry_time == x.m_expiry_time && m_expiry_time_is_present == x.m_expiry_time_is_present && m_protected_zone_latitude == x.m_protected_zone_latitude && m_protected_zone_longitude == x.m_protected_zone_longitude && m_protected_zone_radius == x.m_protected_zone_radius && m_protected_zone_radius_is_present == x.m_protected_zone_radius_is_present && m_protected_zone_id == x.m_protected_zone_id && m_protected_zone_id_is_present == x.m_protected_zone_id_is_present); +} + +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::operator !=( + const ProtectedCommunicationZone& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneType::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::TimestampIts::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::Latitude::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Longitude::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneRadius::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneID::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneType::getCdrSerializedSize(data.protected_zone_type(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::TimestampIts::getCdrSerializedSize(data.expiry_time(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::Latitude::getCdrSerializedSize(data.protected_zone_latitude(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Longitude::getCdrSerializedSize(data.protected_zone_longitude(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneRadius::getCdrSerializedSize(data.protected_zone_radius(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneID::getCdrSerializedSize(data.protected_zone_id(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_protected_zone_type; + scdr << m_expiry_time; + scdr << m_expiry_time_is_present; + scdr << m_protected_zone_latitude; + scdr << m_protected_zone_longitude; + scdr << m_protected_zone_radius; + scdr << m_protected_zone_radius_is_present; + scdr << m_protected_zone_id; + scdr << m_protected_zone_id_is_present; + +} + +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_protected_zone_type; + dcdr >> m_expiry_time; + dcdr >> m_expiry_time_is_present; + dcdr >> m_protected_zone_latitude; + dcdr >> m_protected_zone_longitude; + dcdr >> m_protected_zone_radius; + dcdr >> m_protected_zone_radius_is_present; + dcdr >> m_protected_zone_id; + dcdr >> m_protected_zone_id_is_present; +} + +/*! + * @brief This function copies the value in member protected_zone_type + * @param _protected_zone_type New value to be copied in member protected_zone_type + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type( + const etsi_its_cam_msgs::msg::ProtectedZoneType& _protected_zone_type) +{ + m_protected_zone_type = _protected_zone_type; +} + +/*! + * @brief This function moves the value in member protected_zone_type + * @param _protected_zone_type New value to be moved in member protected_zone_type + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type( + etsi_its_cam_msgs::msg::ProtectedZoneType&& _protected_zone_type) +{ + m_protected_zone_type = std::move(_protected_zone_type); +} + +/*! + * @brief This function returns a constant reference to member protected_zone_type + * @return Constant reference to member protected_zone_type + */ +const etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type() const +{ + return m_protected_zone_type; +} + +/*! + * @brief This function returns a reference to member protected_zone_type + * @return Reference to member protected_zone_type + */ +etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type() +{ + return m_protected_zone_type; +} +/*! + * @brief This function copies the value in member expiry_time + * @param _expiry_time New value to be copied in member expiry_time + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time( + const etsi_its_cam_msgs::msg::TimestampIts& _expiry_time) +{ + m_expiry_time = _expiry_time; +} + +/*! + * @brief This function moves the value in member expiry_time + * @param _expiry_time New value to be moved in member expiry_time + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time( + etsi_its_cam_msgs::msg::TimestampIts&& _expiry_time) +{ + m_expiry_time = std::move(_expiry_time); +} + +/*! + * @brief This function returns a constant reference to member expiry_time + * @return Constant reference to member expiry_time + */ +const etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time() const +{ + return m_expiry_time; +} + +/*! + * @brief This function returns a reference to member expiry_time + * @return Reference to member expiry_time + */ +etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time() +{ + return m_expiry_time; +} +/*! + * @brief This function sets a value in member expiry_time_is_present + * @param _expiry_time_is_present New value for member expiry_time_is_present + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time_is_present( + bool _expiry_time_is_present) +{ + m_expiry_time_is_present = _expiry_time_is_present; +} + +/*! + * @brief This function returns the value of member expiry_time_is_present + * @return Value of member expiry_time_is_present + */ +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time_is_present() const +{ + return m_expiry_time_is_present; +} + +/*! + * @brief This function returns a reference to member expiry_time_is_present + * @return Reference to member expiry_time_is_present + */ +bool& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time_is_present() +{ + return m_expiry_time_is_present; +} + +/*! + * @brief This function copies the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude( + const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude) +{ + m_protected_zone_latitude = _protected_zone_latitude; +} + +/*! + * @brief This function moves the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude( + etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude) +{ + m_protected_zone_latitude = std::move(_protected_zone_latitude); +} + +/*! + * @brief This function returns a constant reference to member protected_zone_latitude + * @return Constant reference to member protected_zone_latitude + */ +const etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude() const +{ + return m_protected_zone_latitude; +} + +/*! + * @brief This function returns a reference to member protected_zone_latitude + * @return Reference to member protected_zone_latitude + */ +etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude() +{ + return m_protected_zone_latitude; +} +/*! + * @brief This function copies the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitude( + const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude) +{ + m_protected_zone_longitude = _protected_zone_longitude; +} + +/*! + * @brief This function moves the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitude( + etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude) +{ + m_protected_zone_longitude = std::move(_protected_zone_longitude); +} + +/*! + * @brief This function returns a constant reference to member protected_zone_longitude + * @return Constant reference to member protected_zone_longitude + */ +const etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitude() const +{ + return m_protected_zone_longitude; +} + +/*! + * @brief This function returns a reference to member protected_zone_longitude + * @return Reference to member protected_zone_longitude + */ +etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitude() +{ + return m_protected_zone_longitude; +} +/*! + * @brief This function copies the value in member protected_zone_radius + * @param _protected_zone_radius New value to be copied in member protected_zone_radius + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius( + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& _protected_zone_radius) +{ + m_protected_zone_radius = _protected_zone_radius; +} + +/*! + * @brief This function moves the value in member protected_zone_radius + * @param _protected_zone_radius New value to be moved in member protected_zone_radius + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius( + etsi_its_cam_msgs::msg::ProtectedZoneRadius&& _protected_zone_radius) +{ + m_protected_zone_radius = std::move(_protected_zone_radius); +} + +/*! + * @brief This function returns a constant reference to member protected_zone_radius + * @return Constant reference to member protected_zone_radius + */ +const etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius() const +{ + return m_protected_zone_radius; +} + +/*! + * @brief This function returns a reference to member protected_zone_radius + * @return Reference to member protected_zone_radius + */ +etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius() +{ + return m_protected_zone_radius; +} +/*! + * @brief This function sets a value in member protected_zone_radius_is_present + * @param _protected_zone_radius_is_present New value for member protected_zone_radius_is_present + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius_is_present( + bool _protected_zone_radius_is_present) +{ + m_protected_zone_radius_is_present = _protected_zone_radius_is_present; +} + +/*! + * @brief This function returns the value of member protected_zone_radius_is_present + * @return Value of member protected_zone_radius_is_present + */ +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius_is_present() const +{ + return m_protected_zone_radius_is_present; +} + +/*! + * @brief This function returns a reference to member protected_zone_radius_is_present + * @return Reference to member protected_zone_radius_is_present + */ +bool& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius_is_present() +{ + return m_protected_zone_radius_is_present; +} + +/*! + * @brief This function copies the value in member protected_zone_id + * @param _protected_zone_id New value to be copied in member protected_zone_id + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id( + const etsi_its_cam_msgs::msg::ProtectedZoneID& _protected_zone_id) +{ + m_protected_zone_id = _protected_zone_id; +} + +/*! + * @brief This function moves the value in member protected_zone_id + * @param _protected_zone_id New value to be moved in member protected_zone_id + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id( + etsi_its_cam_msgs::msg::ProtectedZoneID&& _protected_zone_id) +{ + m_protected_zone_id = std::move(_protected_zone_id); +} + +/*! + * @brief This function returns a constant reference to member protected_zone_id + * @return Constant reference to member protected_zone_id + */ +const etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id() const +{ + return m_protected_zone_id; +} + +/*! + * @brief This function returns a reference to member protected_zone_id + * @return Reference to member protected_zone_id + */ +etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id() +{ + return m_protected_zone_id; +} +/*! + * @brief This function sets a value in member protected_zone_id_is_present + * @param _protected_zone_id_is_present New value for member protected_zone_id_is_present + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id_is_present( + bool _protected_zone_id_is_present) +{ + m_protected_zone_id_is_present = _protected_zone_id_is_present; +} + +/*! + * @brief This function returns the value of member protected_zone_id_is_present + * @return Value of member protected_zone_id_is_present + */ +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id_is_present() const +{ + return m_protected_zone_id_is_present; +} + +/*! + * @brief This function returns a reference to member protected_zone_id_is_present + * @return Reference to member protected_zone_id_is_present + */ +bool& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id_is_present() +{ + return m_protected_zone_id_is_present; +} + + +size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.h new file mode 100644 index 00000000000..c754f63c34c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.h @@ -0,0 +1,412 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZone.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_H_ + +#include "ProtectedZoneRadius.h" +#include "TimestampIts.h" +#include "ProtectedZoneID.h" +#include "ProtectedZoneType.h" +#include "Latitude.h" +#include "Longitude.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ProtectedCommunicationZone_SOURCE) +#define ProtectedCommunicationZone_DllAPI __declspec( dllexport ) +#else +#define ProtectedCommunicationZone_DllAPI __declspec( dllimport ) +#endif // ProtectedCommunicationZone_SOURCE +#else +#define ProtectedCommunicationZone_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ProtectedCommunicationZone_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure ProtectedCommunicationZone defined by the user in the IDL file. + * @ingroup PROTECTEDCOMMUNICATIONZONE + */ + class ProtectedCommunicationZone + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedCommunicationZone(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedCommunicationZone(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZone( + const ProtectedCommunicationZone& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZone( + ProtectedCommunicationZone&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZone& operator =( + const ProtectedCommunicationZone& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZone& operator =( + ProtectedCommunicationZone&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZone object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedCommunicationZone& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZone object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedCommunicationZone& x) const; + + /*! + * @brief This function copies the value in member protected_zone_type + * @param _protected_zone_type New value to be copied in member protected_zone_type + */ + eProsima_user_DllExport void protected_zone_type( + const etsi_its_cam_msgs::msg::ProtectedZoneType& _protected_zone_type); + + /*! + * @brief This function moves the value in member protected_zone_type + * @param _protected_zone_type New value to be moved in member protected_zone_type + */ + eProsima_user_DllExport void protected_zone_type( + etsi_its_cam_msgs::msg::ProtectedZoneType&& _protected_zone_type); + + /*! + * @brief This function returns a constant reference to member protected_zone_type + * @return Constant reference to member protected_zone_type + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneType& protected_zone_type() const; + + /*! + * @brief This function returns a reference to member protected_zone_type + * @return Reference to member protected_zone_type + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneType& protected_zone_type(); + /*! + * @brief This function copies the value in member expiry_time + * @param _expiry_time New value to be copied in member expiry_time + */ + eProsima_user_DllExport void expiry_time( + const etsi_its_cam_msgs::msg::TimestampIts& _expiry_time); + + /*! + * @brief This function moves the value in member expiry_time + * @param _expiry_time New value to be moved in member expiry_time + */ + eProsima_user_DllExport void expiry_time( + etsi_its_cam_msgs::msg::TimestampIts&& _expiry_time); + + /*! + * @brief This function returns a constant reference to member expiry_time + * @return Constant reference to member expiry_time + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::TimestampIts& expiry_time() const; + + /*! + * @brief This function returns a reference to member expiry_time + * @return Reference to member expiry_time + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::TimestampIts& expiry_time(); + /*! + * @brief This function sets a value in member expiry_time_is_present + * @param _expiry_time_is_present New value for member expiry_time_is_present + */ + eProsima_user_DllExport void expiry_time_is_present( + bool _expiry_time_is_present); + + /*! + * @brief This function returns the value of member expiry_time_is_present + * @return Value of member expiry_time_is_present + */ + eProsima_user_DllExport bool expiry_time_is_present() const; + + /*! + * @brief This function returns a reference to member expiry_time_is_present + * @return Reference to member expiry_time_is_present + */ + eProsima_user_DllExport bool& expiry_time_is_present(); + + /*! + * @brief This function copies the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude + */ + eProsima_user_DllExport void protected_zone_latitude( + const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude); + + /*! + * @brief This function moves the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude + */ + eProsima_user_DllExport void protected_zone_latitude( + etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude); + + /*! + * @brief This function returns a constant reference to member protected_zone_latitude + * @return Constant reference to member protected_zone_latitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude() const; + + /*! + * @brief This function returns a reference to member protected_zone_latitude + * @return Reference to member protected_zone_latitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude(); + /*! + * @brief This function copies the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude + */ + eProsima_user_DllExport void protected_zone_longitude( + const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude); + + /*! + * @brief This function moves the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude + */ + eProsima_user_DllExport void protected_zone_longitude( + etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude); + + /*! + * @brief This function returns a constant reference to member protected_zone_longitude + * @return Constant reference to member protected_zone_longitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude() const; + + /*! + * @brief This function returns a reference to member protected_zone_longitude + * @return Reference to member protected_zone_longitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude(); + /*! + * @brief This function copies the value in member protected_zone_radius + * @param _protected_zone_radius New value to be copied in member protected_zone_radius + */ + eProsima_user_DllExport void protected_zone_radius( + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& _protected_zone_radius); + + /*! + * @brief This function moves the value in member protected_zone_radius + * @param _protected_zone_radius New value to be moved in member protected_zone_radius + */ + eProsima_user_DllExport void protected_zone_radius( + etsi_its_cam_msgs::msg::ProtectedZoneRadius&& _protected_zone_radius); + + /*! + * @brief This function returns a constant reference to member protected_zone_radius + * @return Constant reference to member protected_zone_radius + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneRadius& protected_zone_radius() const; + + /*! + * @brief This function returns a reference to member protected_zone_radius + * @return Reference to member protected_zone_radius + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneRadius& protected_zone_radius(); + /*! + * @brief This function sets a value in member protected_zone_radius_is_present + * @param _protected_zone_radius_is_present New value for member protected_zone_radius_is_present + */ + eProsima_user_DllExport void protected_zone_radius_is_present( + bool _protected_zone_radius_is_present); + + /*! + * @brief This function returns the value of member protected_zone_radius_is_present + * @return Value of member protected_zone_radius_is_present + */ + eProsima_user_DllExport bool protected_zone_radius_is_present() const; + + /*! + * @brief This function returns a reference to member protected_zone_radius_is_present + * @return Reference to member protected_zone_radius_is_present + */ + eProsima_user_DllExport bool& protected_zone_radius_is_present(); + + /*! + * @brief This function copies the value in member protected_zone_id + * @param _protected_zone_id New value to be copied in member protected_zone_id + */ + eProsima_user_DllExport void protected_zone_id( + const etsi_its_cam_msgs::msg::ProtectedZoneID& _protected_zone_id); + + /*! + * @brief This function moves the value in member protected_zone_id + * @param _protected_zone_id New value to be moved in member protected_zone_id + */ + eProsima_user_DllExport void protected_zone_id( + etsi_its_cam_msgs::msg::ProtectedZoneID&& _protected_zone_id); + + /*! + * @brief This function returns a constant reference to member protected_zone_id + * @return Constant reference to member protected_zone_id + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneID& protected_zone_id() const; + + /*! + * @brief This function returns a reference to member protected_zone_id + * @return Reference to member protected_zone_id + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneID& protected_zone_id(); + /*! + * @brief This function sets a value in member protected_zone_id_is_present + * @param _protected_zone_id_is_present New value for member protected_zone_id_is_present + */ + eProsima_user_DllExport void protected_zone_id_is_present( + bool _protected_zone_id_is_present); + + /*! + * @brief This function returns the value of member protected_zone_id_is_present + * @return Value of member protected_zone_id_is_present + */ + eProsima_user_DllExport bool protected_zone_id_is_present() const; + + /*! + * @brief This function returns a reference to member protected_zone_id_is_present + * @return Reference to member protected_zone_id_is_present + */ + eProsima_user_DllExport bool& protected_zone_id_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::ProtectedZoneType m_protected_zone_type; + etsi_its_cam_msgs::msg::TimestampIts m_expiry_time; + bool m_expiry_time_is_present; + etsi_its_cam_msgs::msg::Latitude m_protected_zone_latitude; + etsi_its_cam_msgs::msg::Longitude m_protected_zone_longitude; + etsi_its_cam_msgs::msg::ProtectedZoneRadius m_protected_zone_radius; + bool m_protected_zone_radius_is_present; + etsi_its_cam_msgs::msg::ProtectedZoneID m_protected_zone_id; + bool m_protected_zone_id_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.cxx new file mode 100644 index 00000000000..0d433e12249 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZonePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ProtectedCommunicationZonePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + ProtectedCommunicationZonePubSubType::ProtectedCommunicationZonePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ProtectedCommunicationZone_"); + auto type_size = ProtectedCommunicationZone::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ProtectedCommunicationZone::isKeyDefined(); + size_t keyLength = ProtectedCommunicationZone::getKeyMaxCdrSerializedSize() > 16 ? + ProtectedCommunicationZone::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ProtectedCommunicationZonePubSubType::~ProtectedCommunicationZonePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ProtectedCommunicationZonePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ProtectedCommunicationZone* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ProtectedCommunicationZonePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ProtectedCommunicationZone* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ProtectedCommunicationZonePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ProtectedCommunicationZonePubSubType::createData() + { + return reinterpret_cast(new ProtectedCommunicationZone()); + } + + void ProtectedCommunicationZonePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ProtectedCommunicationZonePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ProtectedCommunicationZone* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ProtectedCommunicationZone::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ProtectedCommunicationZone::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.h new file mode 100644 index 00000000000..a4ec6e75efe --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZonePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_PUBSUBTYPES_H_ + +#include +#include + +#include "ProtectedCommunicationZone.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ProtectedCommunicationZone is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type ProtectedCommunicationZone defined by the user in the IDL file. + * @ingroup PROTECTEDCOMMUNICATIONZONE + */ + class ProtectedCommunicationZonePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ProtectedCommunicationZone type; + + eProsima_user_DllExport ProtectedCommunicationZonePubSubType(); + + eProsima_user_DllExport virtual ~ProtectedCommunicationZonePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) ProtectedCommunicationZone(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.cxx new file mode 100644 index 00000000000..acb8c9fbd09 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.cxx @@ -0,0 +1,201 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZonesRSU.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ProtectedCommunicationZonesRSU.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU() +{ + // m_array com.eprosima.idl.parser.typecode.SequenceTypeCode@515f4131 + + +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::~ProtectedCommunicationZonesRSU() +{ +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU( + const ProtectedCommunicationZonesRSU& x) +{ + m_array = x.m_array; +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU( + ProtectedCommunicationZonesRSU&& x) +{ + m_array = std::move(x.m_array); +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::operator =( + const ProtectedCommunicationZonesRSU& x) +{ + + m_array = x.m_array; + + return *this; +} + +etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::operator =( + ProtectedCommunicationZonesRSU&& x) +{ + + m_array = std::move(x.m_array); + + return *this; +} + +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::operator ==( + const ProtectedCommunicationZonesRSU& x) const +{ + + return (m_array == x.m_array); +} + +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::operator !=( + const ProtectedCommunicationZonesRSU& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.array().size(); ++a) + { + current_alignment += etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getCdrSerializedSize(data.array().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_array; +} + +void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_array;} + +/*! + * @brief This function copies the value in member array + * @param _array New value to be copied in member array + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array( + const std::vector& _array) +{ + m_array = _array; +} + +/*! + * @brief This function moves the value in member array + * @param _array New value to be moved in member array + */ +void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array( + std::vector&& _array) +{ + m_array = std::move(_array); +} + +/*! + * @brief This function returns a constant reference to member array + * @return Constant reference to member array + */ +const std::vector& etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array() const +{ + return m_array; +} + +/*! + * @brief This function returns a reference to member array + * @return Reference to member array + */ +std::vector& etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array() +{ + return m_array; +} + +size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.h new file mode 100644 index 00000000000..b9fff22407d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.h @@ -0,0 +1,221 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZonesRSU.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_H_ + +#include "ProtectedCommunicationZone.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ProtectedCommunicationZonesRSU_SOURCE) +#define ProtectedCommunicationZonesRSU_DllAPI __declspec( dllexport ) +#else +#define ProtectedCommunicationZonesRSU_DllAPI __declspec( dllimport ) +#endif // ProtectedCommunicationZonesRSU_SOURCE +#else +#define ProtectedCommunicationZonesRSU_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ProtectedCommunicationZonesRSU_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ProtectedCommunicationZonesRSU_Constants { + const uint8_t MIN_SIZE = 1; + const uint8_t MAX_SIZE = 16; + } // namespace ProtectedCommunicationZonesRSU_Constants + /*! + * @brief This class represents the structure ProtectedCommunicationZonesRSU defined by the user in the IDL file. + * @ingroup PROTECTEDCOMMUNICATIONZONESRSU + */ + class ProtectedCommunicationZonesRSU + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedCommunicationZonesRSU(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU( + const ProtectedCommunicationZonesRSU& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU( + ProtectedCommunicationZonesRSU&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU& operator =( + const ProtectedCommunicationZonesRSU& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU& operator =( + ProtectedCommunicationZonesRSU&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedCommunicationZonesRSU& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedCommunicationZonesRSU& x) const; + + /*! + * @brief This function copies the value in member array + * @param _array New value to be copied in member array + */ + eProsima_user_DllExport void array( + const std::vector& _array); + + /*! + * @brief This function moves the value in member array + * @param _array New value to be moved in member array + */ + eProsima_user_DllExport void array( + std::vector&& _array); + + /*! + * @brief This function returns a constant reference to member array + * @return Constant reference to member array + */ + eProsima_user_DllExport const std::vector& array() const; + + /*! + * @brief This function returns a reference to member array + * @return Reference to member array + */ + eProsima_user_DllExport std::vector& array(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_array; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.cxx new file mode 100644 index 00000000000..8c8bf7587b2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZonesRSUPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ProtectedCommunicationZonesRSUPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ProtectedCommunicationZonesRSU_Constants { + + + + } //End of namespace ProtectedCommunicationZonesRSU_Constants + ProtectedCommunicationZonesRSUPubSubType::ProtectedCommunicationZonesRSUPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ProtectedCommunicationZonesRSU_"); + auto type_size = ProtectedCommunicationZonesRSU::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ProtectedCommunicationZonesRSU::isKeyDefined(); + size_t keyLength = ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize() > 16 ? + ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ProtectedCommunicationZonesRSUPubSubType::~ProtectedCommunicationZonesRSUPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ProtectedCommunicationZonesRSUPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ProtectedCommunicationZonesRSU* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ProtectedCommunicationZonesRSUPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ProtectedCommunicationZonesRSU* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ProtectedCommunicationZonesRSUPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ProtectedCommunicationZonesRSUPubSubType::createData() + { + return reinterpret_cast(new ProtectedCommunicationZonesRSU()); + } + + void ProtectedCommunicationZonesRSUPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ProtectedCommunicationZonesRSUPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ProtectedCommunicationZonesRSU* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.h new file mode 100644 index 00000000000..bb68647494c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.h @@ -0,0 +1,112 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZonesRSUPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_PUBSUBTYPES_H_ + +#include +#include + +#include "ProtectedCommunicationZonesRSU.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ProtectedCommunicationZonesRSU is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace ProtectedCommunicationZonesRSU_Constants + { + + + } + /*! + * @brief This class represents the TopicDataType of the type ProtectedCommunicationZonesRSU defined by the user in the IDL file. + * @ingroup PROTECTEDCOMMUNICATIONZONESRSU + */ + class ProtectedCommunicationZonesRSUPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ProtectedCommunicationZonesRSU type; + + eProsima_user_DllExport ProtectedCommunicationZonesRSUPubSubType(); + + eProsima_user_DllExport virtual ~ProtectedCommunicationZonesRSUPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.cxx new file mode 100644 index 00000000000..6c4ab3e2dd9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.cxx @@ -0,0 +1,186 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneID.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ProtectedZoneID.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::ProtectedZoneID::ProtectedZoneID() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27fde870 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::ProtectedZoneID::~ProtectedZoneID() +{ +} + +etsi_its_cam_msgs::msg::ProtectedZoneID::ProtectedZoneID( + const ProtectedZoneID& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::ProtectedZoneID::ProtectedZoneID( + ProtectedZoneID&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::ProtectedZoneID::operator =( + const ProtectedZoneID& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::ProtectedZoneID::operator =( + ProtectedZoneID&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneID::operator ==( + const ProtectedZoneID& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneID::operator !=( + const ProtectedZoneID& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ProtectedZoneID::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ProtectedZoneID::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedZoneID& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ProtectedZoneID::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::ProtectedZoneID::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::ProtectedZoneID::value( + uint32_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint32_t etsi_its_cam_msgs::msg::ProtectedZoneID::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint32_t& etsi_its_cam_msgs::msg::ProtectedZoneID::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::ProtectedZoneID::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneID::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ProtectedZoneID::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.h new file mode 100644 index 00000000000..bd96dee41a8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.h @@ -0,0 +1,214 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneID.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ProtectedZoneID_SOURCE) +#define ProtectedZoneID_DllAPI __declspec( dllexport ) +#else +#define ProtectedZoneID_DllAPI __declspec( dllimport ) +#endif // ProtectedZoneID_SOURCE +#else +#define ProtectedZoneID_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ProtectedZoneID_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ProtectedZoneID_Constants { + const uint32_t MIN = 0; + const uint32_t MAX = 134217727; + } // namespace ProtectedZoneID_Constants + /*! + * @brief This class represents the structure ProtectedZoneID defined by the user in the IDL file. + * @ingroup PROTECTEDZONEID + */ + class ProtectedZoneID + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedZoneID(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedZoneID(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. + */ + eProsima_user_DllExport ProtectedZoneID( + const ProtectedZoneID& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. + */ + eProsima_user_DllExport ProtectedZoneID( + ProtectedZoneID&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. + */ + eProsima_user_DllExport ProtectedZoneID& operator =( + const ProtectedZoneID& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. + */ + eProsima_user_DllExport ProtectedZoneID& operator =( + ProtectedZoneID&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneID object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedZoneID& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneID object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedZoneID& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint32_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedZoneID& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint32_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.cxx new file mode 100644 index 00000000000..34adbbefba3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneIDPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ProtectedZoneIDPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ProtectedZoneID_Constants { + + + + } //End of namespace ProtectedZoneID_Constants + ProtectedZoneIDPubSubType::ProtectedZoneIDPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneID_"); + auto type_size = ProtectedZoneID::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ProtectedZoneID::isKeyDefined(); + size_t keyLength = ProtectedZoneID::getKeyMaxCdrSerializedSize() > 16 ? + ProtectedZoneID::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ProtectedZoneIDPubSubType::~ProtectedZoneIDPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ProtectedZoneIDPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ProtectedZoneID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ProtectedZoneIDPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ProtectedZoneID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ProtectedZoneIDPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ProtectedZoneIDPubSubType::createData() + { + return reinterpret_cast(new ProtectedZoneID()); + } + + void ProtectedZoneIDPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ProtectedZoneIDPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ProtectedZoneID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ProtectedZoneID::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ProtectedZoneID::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.h new file mode 100644 index 00000000000..90766eb715b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.h @@ -0,0 +1,112 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneIDPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_PUBSUBTYPES_H_ + +#include +#include + +#include "ProtectedZoneID.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ProtectedZoneID is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace ProtectedZoneID_Constants + { + + + } + /*! + * @brief This class represents the TopicDataType of the type ProtectedZoneID defined by the user in the IDL file. + * @ingroup PROTECTEDZONEID + */ + class ProtectedZoneIDPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ProtectedZoneID type; + + eProsima_user_DllExport ProtectedZoneIDPubSubType(); + + eProsima_user_DllExport virtual ~ProtectedZoneIDPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) ProtectedZoneID(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.cxx new file mode 100644 index 00000000000..9323631b461 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneRadius.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ProtectedZoneRadius.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::ProtectedZoneRadius::ProtectedZoneRadius() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5d10455d + m_value = 0; + +} + +etsi_its_cam_msgs::msg::ProtectedZoneRadius::~ProtectedZoneRadius() +{ +} + +etsi_its_cam_msgs::msg::ProtectedZoneRadius::ProtectedZoneRadius( + const ProtectedZoneRadius& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::ProtectedZoneRadius::ProtectedZoneRadius( + ProtectedZoneRadius&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::ProtectedZoneRadius::operator =( + const ProtectedZoneRadius& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::ProtectedZoneRadius::operator =( + ProtectedZoneRadius&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneRadius::operator ==( + const ProtectedZoneRadius& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneRadius::operator !=( + const ProtectedZoneRadius& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ProtectedZoneRadius::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::ProtectedZoneRadius::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::ProtectedZoneRadius::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::ProtectedZoneRadius::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneRadius::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ProtectedZoneRadius::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.h new file mode 100644 index 00000000000..d0a2628481b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneRadius.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ProtectedZoneRadius_SOURCE) +#define ProtectedZoneRadius_DllAPI __declspec( dllexport ) +#else +#define ProtectedZoneRadius_DllAPI __declspec( dllimport ) +#endif // ProtectedZoneRadius_SOURCE +#else +#define ProtectedZoneRadius_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ProtectedZoneRadius_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ProtectedZoneRadius_Constants { + const uint8_t MIN = 1; + const uint8_t MAX = 255; + const uint8_t ONE_METER = 1; + } // namespace ProtectedZoneRadius_Constants + /*! + * @brief This class represents the structure ProtectedZoneRadius defined by the user in the IDL file. + * @ingroup PROTECTEDZONERADIUS + */ + class ProtectedZoneRadius + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedZoneRadius(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedZoneRadius(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. + */ + eProsima_user_DllExport ProtectedZoneRadius( + const ProtectedZoneRadius& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. + */ + eProsima_user_DllExport ProtectedZoneRadius( + ProtectedZoneRadius&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. + */ + eProsima_user_DllExport ProtectedZoneRadius& operator =( + const ProtectedZoneRadius& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. + */ + eProsima_user_DllExport ProtectedZoneRadius& operator =( + ProtectedZoneRadius&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneRadius object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedZoneRadius& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneRadius object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedZoneRadius& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.cxx new file mode 100644 index 00000000000..47a1fd3168d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneRadiusPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ProtectedZoneRadiusPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ProtectedZoneRadius_Constants { + + + + + } //End of namespace ProtectedZoneRadius_Constants + ProtectedZoneRadiusPubSubType::ProtectedZoneRadiusPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneRadius_"); + auto type_size = ProtectedZoneRadius::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ProtectedZoneRadius::isKeyDefined(); + size_t keyLength = ProtectedZoneRadius::getKeyMaxCdrSerializedSize() > 16 ? + ProtectedZoneRadius::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ProtectedZoneRadiusPubSubType::~ProtectedZoneRadiusPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ProtectedZoneRadiusPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ProtectedZoneRadius* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ProtectedZoneRadiusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ProtectedZoneRadius* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ProtectedZoneRadiusPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ProtectedZoneRadiusPubSubType::createData() + { + return reinterpret_cast(new ProtectedZoneRadius()); + } + + void ProtectedZoneRadiusPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ProtectedZoneRadiusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ProtectedZoneRadius* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ProtectedZoneRadius::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ProtectedZoneRadius::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.h new file mode 100644 index 00000000000..4fac8e2db05 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.h @@ -0,0 +1,113 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneRadiusPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_PUBSUBTYPES_H_ + +#include +#include + +#include "ProtectedZoneRadius.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ProtectedZoneRadius is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace ProtectedZoneRadius_Constants + { + + + + } + /*! + * @brief This class represents the TopicDataType of the type ProtectedZoneRadius defined by the user in the IDL file. + * @ingroup PROTECTEDZONERADIUS + */ + class ProtectedZoneRadiusPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ProtectedZoneRadius type; + + eProsima_user_DllExport ProtectedZoneRadiusPubSubType(); + + eProsima_user_DllExport virtual ~ProtectedZoneRadiusPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) ProtectedZoneRadius(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.cxx new file mode 100644 index 00000000000..4781e2f54b9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.cxx @@ -0,0 +1,186 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneType.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ProtectedZoneType.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::ProtectedZoneType::ProtectedZoneType() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@737edcfa + m_value = 0; + +} + +etsi_its_cam_msgs::msg::ProtectedZoneType::~ProtectedZoneType() +{ +} + +etsi_its_cam_msgs::msg::ProtectedZoneType::ProtectedZoneType( + const ProtectedZoneType& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::ProtectedZoneType::ProtectedZoneType( + ProtectedZoneType&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::ProtectedZoneType::operator =( + const ProtectedZoneType& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::ProtectedZoneType::operator =( + ProtectedZoneType&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneType::operator ==( + const ProtectedZoneType& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneType::operator !=( + const ProtectedZoneType& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ProtectedZoneType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ProtectedZoneType::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedZoneType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ProtectedZoneType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::ProtectedZoneType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::ProtectedZoneType::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::ProtectedZoneType::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::ProtectedZoneType::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::ProtectedZoneType::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ProtectedZoneType::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ProtectedZoneType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.h new file mode 100644 index 00000000000..dd9651a4c8c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.h @@ -0,0 +1,214 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneType.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ProtectedZoneType_SOURCE) +#define ProtectedZoneType_DllAPI __declspec( dllexport ) +#else +#define ProtectedZoneType_DllAPI __declspec( dllimport ) +#endif // ProtectedZoneType_SOURCE +#else +#define ProtectedZoneType_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ProtectedZoneType_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ProtectedZoneType_Constants { + const uint8_t PERMANENT_CEN_DSRC_TOLLING = 0; + const uint8_t TEMPORARY_CEN_DSRC_TOLLING = 1; + } // namespace ProtectedZoneType_Constants + /*! + * @brief This class represents the structure ProtectedZoneType defined by the user in the IDL file. + * @ingroup PROTECTEDZONETYPE + */ + class ProtectedZoneType + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedZoneType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedZoneType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. + */ + eProsima_user_DllExport ProtectedZoneType( + const ProtectedZoneType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. + */ + eProsima_user_DllExport ProtectedZoneType( + ProtectedZoneType&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. + */ + eProsima_user_DllExport ProtectedZoneType& operator =( + const ProtectedZoneType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. + */ + eProsima_user_DllExport ProtectedZoneType& operator =( + ProtectedZoneType&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedZoneType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedZoneType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ProtectedZoneType& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.cxx new file mode 100644 index 00000000000..4d699d8e58c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneTypePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ProtectedZoneTypePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace ProtectedZoneType_Constants { + + + + } //End of namespace ProtectedZoneType_Constants + ProtectedZoneTypePubSubType::ProtectedZoneTypePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneType_"); + auto type_size = ProtectedZoneType::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ProtectedZoneType::isKeyDefined(); + size_t keyLength = ProtectedZoneType::getKeyMaxCdrSerializedSize() > 16 ? + ProtectedZoneType::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ProtectedZoneTypePubSubType::~ProtectedZoneTypePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ProtectedZoneTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ProtectedZoneType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ProtectedZoneTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ProtectedZoneType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ProtectedZoneTypePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ProtectedZoneTypePubSubType::createData() + { + return reinterpret_cast(new ProtectedZoneType()); + } + + void ProtectedZoneTypePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ProtectedZoneTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ProtectedZoneType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ProtectedZoneType::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ProtectedZoneType::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.h new file mode 100644 index 00000000000..51a1dfa6fc9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.h @@ -0,0 +1,112 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneTypePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_PUBSUBTYPES_H_ + +#include +#include + +#include "ProtectedZoneType.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ProtectedZoneType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace ProtectedZoneType_Constants + { + + + } + /*! + * @brief This class represents the TopicDataType of the type ProtectedZoneType defined by the user in the IDL file. + * @ingroup PROTECTEDZONETYPE + */ + class ProtectedZoneTypePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ProtectedZoneType type; + + eProsima_user_DllExport ProtectedZoneTypePubSubType(); + + eProsima_user_DllExport virtual ~ProtectedZoneTypePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) ProtectedZoneType(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.cxx new file mode 100644 index 00000000000..bc7179b20a9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivation.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PtActivation.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::PtActivation::PtActivation() +{ + // m_pt_activation_type com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4a9cc6cb + + // m_pt_activation_data com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5990e6c5 + + +} + +etsi_its_cam_msgs::msg::PtActivation::~PtActivation() +{ + +} + +etsi_its_cam_msgs::msg::PtActivation::PtActivation( + const PtActivation& x) +{ + m_pt_activation_type = x.m_pt_activation_type; + m_pt_activation_data = x.m_pt_activation_data; +} + +etsi_its_cam_msgs::msg::PtActivation::PtActivation( + PtActivation&& x) +{ + m_pt_activation_type = std::move(x.m_pt_activation_type); + m_pt_activation_data = std::move(x.m_pt_activation_data); +} + +etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PtActivation::operator =( + const PtActivation& x) +{ + + m_pt_activation_type = x.m_pt_activation_type; + m_pt_activation_data = x.m_pt_activation_data; + + return *this; +} + +etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PtActivation::operator =( + PtActivation&& x) +{ + + m_pt_activation_type = std::move(x.m_pt_activation_type); + m_pt_activation_data = std::move(x.m_pt_activation_data); + + return *this; +} + +bool etsi_its_cam_msgs::msg::PtActivation::operator ==( + const PtActivation& x) const +{ + + return (m_pt_activation_type == x.m_pt_activation_type && m_pt_activation_data == x.m_pt_activation_data); +} + +bool etsi_its_cam_msgs::msg::PtActivation::operator !=( + const PtActivation& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PtActivation::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::PtActivationType::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PtActivationData::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PtActivation::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PtActivation& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::PtActivationType::getCdrSerializedSize(data.pt_activation_type(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PtActivationData::getCdrSerializedSize(data.pt_activation_data(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PtActivation::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_pt_activation_type; + scdr << m_pt_activation_data; + +} + +void etsi_its_cam_msgs::msg::PtActivation::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_pt_activation_type; + dcdr >> m_pt_activation_data; +} + +/*! + * @brief This function copies the value in member pt_activation_type + * @param _pt_activation_type New value to be copied in member pt_activation_type + */ +void etsi_its_cam_msgs::msg::PtActivation::pt_activation_type( + const etsi_its_cam_msgs::msg::PtActivationType& _pt_activation_type) +{ + m_pt_activation_type = _pt_activation_type; +} + +/*! + * @brief This function moves the value in member pt_activation_type + * @param _pt_activation_type New value to be moved in member pt_activation_type + */ +void etsi_its_cam_msgs::msg::PtActivation::pt_activation_type( + etsi_its_cam_msgs::msg::PtActivationType&& _pt_activation_type) +{ + m_pt_activation_type = std::move(_pt_activation_type); +} + +/*! + * @brief This function returns a constant reference to member pt_activation_type + * @return Constant reference to member pt_activation_type + */ +const etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActivation::pt_activation_type() const +{ + return m_pt_activation_type; +} + +/*! + * @brief This function returns a reference to member pt_activation_type + * @return Reference to member pt_activation_type + */ +etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActivation::pt_activation_type() +{ + return m_pt_activation_type; +} +/*! + * @brief This function copies the value in member pt_activation_data + * @param _pt_activation_data New value to be copied in member pt_activation_data + */ +void etsi_its_cam_msgs::msg::PtActivation::pt_activation_data( + const etsi_its_cam_msgs::msg::PtActivationData& _pt_activation_data) +{ + m_pt_activation_data = _pt_activation_data; +} + +/*! + * @brief This function moves the value in member pt_activation_data + * @param _pt_activation_data New value to be moved in member pt_activation_data + */ +void etsi_its_cam_msgs::msg::PtActivation::pt_activation_data( + etsi_its_cam_msgs::msg::PtActivationData&& _pt_activation_data) +{ + m_pt_activation_data = std::move(_pt_activation_data); +} + +/*! + * @brief This function returns a constant reference to member pt_activation_data + * @return Constant reference to member pt_activation_data + */ +const etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActivation::pt_activation_data() const +{ + return m_pt_activation_data; +} + +/*! + * @brief This function returns a reference to member pt_activation_data + * @return Reference to member pt_activation_data + */ +etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActivation::pt_activation_data() +{ + return m_pt_activation_data; +} + +size_t etsi_its_cam_msgs::msg::PtActivation::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PtActivation::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PtActivation::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.h new file mode 100644 index 00000000000..fc2c86d68bd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivation.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_H_ + +#include "PtActivationData.h" +#include "PtActivationType.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PtActivation_SOURCE) +#define PtActivation_DllAPI __declspec( dllexport ) +#else +#define PtActivation_DllAPI __declspec( dllimport ) +#endif // PtActivation_SOURCE +#else +#define PtActivation_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PtActivation_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure PtActivation defined by the user in the IDL file. + * @ingroup PTACTIVATION + */ + class PtActivation + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PtActivation(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PtActivation(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. + */ + eProsima_user_DllExport PtActivation( + const PtActivation& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. + */ + eProsima_user_DllExport PtActivation( + PtActivation&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. + */ + eProsima_user_DllExport PtActivation& operator =( + const PtActivation& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. + */ + eProsima_user_DllExport PtActivation& operator =( + PtActivation&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivation object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PtActivation& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivation object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PtActivation& x) const; + + /*! + * @brief This function copies the value in member pt_activation_type + * @param _pt_activation_type New value to be copied in member pt_activation_type + */ + eProsima_user_DllExport void pt_activation_type( + const etsi_its_cam_msgs::msg::PtActivationType& _pt_activation_type); + + /*! + * @brief This function moves the value in member pt_activation_type + * @param _pt_activation_type New value to be moved in member pt_activation_type + */ + eProsima_user_DllExport void pt_activation_type( + etsi_its_cam_msgs::msg::PtActivationType&& _pt_activation_type); + + /*! + * @brief This function returns a constant reference to member pt_activation_type + * @return Constant reference to member pt_activation_type + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivationType& pt_activation_type() const; + + /*! + * @brief This function returns a reference to member pt_activation_type + * @return Reference to member pt_activation_type + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivationType& pt_activation_type(); + /*! + * @brief This function copies the value in member pt_activation_data + * @param _pt_activation_data New value to be copied in member pt_activation_data + */ + eProsima_user_DllExport void pt_activation_data( + const etsi_its_cam_msgs::msg::PtActivationData& _pt_activation_data); + + /*! + * @brief This function moves the value in member pt_activation_data + * @param _pt_activation_data New value to be moved in member pt_activation_data + */ + eProsima_user_DllExport void pt_activation_data( + etsi_its_cam_msgs::msg::PtActivationData&& _pt_activation_data); + + /*! + * @brief This function returns a constant reference to member pt_activation_data + * @return Constant reference to member pt_activation_data + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivationData& pt_activation_data() const; + + /*! + * @brief This function returns a reference to member pt_activation_data + * @return Reference to member pt_activation_data + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivationData& pt_activation_data(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PtActivation& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::PtActivationType m_pt_activation_type; + etsi_its_cam_msgs::msg::PtActivationData m_pt_activation_data; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.cxx new file mode 100644 index 00000000000..aec6eb962a6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.cxx @@ -0,0 +1,202 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationData.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PtActivationData.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::PtActivationData::PtActivationData() +{ + // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@19b30c92 + + +} + +etsi_its_cam_msgs::msg::PtActivationData::~PtActivationData() +{ +} + +etsi_its_cam_msgs::msg::PtActivationData::PtActivationData( + const PtActivationData& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::PtActivationData::PtActivationData( + PtActivationData&& x) +{ + m_value = std::move(x.m_value); +} + +etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActivationData::operator =( + const PtActivationData& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActivationData::operator =( + PtActivationData&& x) +{ + + m_value = std::move(x.m_value); + + return *this; +} + +bool etsi_its_cam_msgs::msg::PtActivationData::operator ==( + const PtActivationData& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::PtActivationData::operator !=( + const PtActivationData& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PtActivationData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PtActivationData::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PtActivationData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.value().size() > 0) + { + current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PtActivationData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; +} + +void etsi_its_cam_msgs::msg::PtActivationData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value;} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void etsi_its_cam_msgs::msg::PtActivationData::value( + const std::vector& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void etsi_its_cam_msgs::msg::PtActivationData::value( + std::vector&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::vector& etsi_its_cam_msgs::msg::PtActivationData::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::vector& etsi_its_cam_msgs::msg::PtActivationData::value() +{ + return m_value; +} + +size_t etsi_its_cam_msgs::msg::PtActivationData::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PtActivationData::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PtActivationData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.h new file mode 100644 index 00000000000..a5937220f4f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.h @@ -0,0 +1,220 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationData.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PtActivationData_SOURCE) +#define PtActivationData_DllAPI __declspec( dllexport ) +#else +#define PtActivationData_DllAPI __declspec( dllimport ) +#endif // PtActivationData_SOURCE +#else +#define PtActivationData_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PtActivationData_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PtActivationData_Constants { + const uint8_t MIN_SIZE = 1; + const uint8_t MAX_SIZE = 20; + } // namespace PtActivationData_Constants + /*! + * @brief This class represents the structure PtActivationData defined by the user in the IDL file. + * @ingroup PTACTIVATIONDATA + */ + class PtActivationData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PtActivationData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PtActivationData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. + */ + eProsima_user_DllExport PtActivationData( + const PtActivationData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. + */ + eProsima_user_DllExport PtActivationData( + PtActivationData&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. + */ + eProsima_user_DllExport PtActivationData& operator =( + const PtActivationData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. + */ + eProsima_user_DllExport PtActivationData& operator =( + PtActivationData&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivationData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PtActivationData& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivationData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PtActivationData& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PtActivationData& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.cxx new file mode 100644 index 00000000000..3c4e779ca23 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationDataPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PtActivationDataPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PtActivationData_Constants { + + + + } //End of namespace PtActivationData_Constants + PtActivationDataPubSubType::PtActivationDataPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PtActivationData_"); + auto type_size = PtActivationData::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PtActivationData::isKeyDefined(); + size_t keyLength = PtActivationData::getKeyMaxCdrSerializedSize() > 16 ? + PtActivationData::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PtActivationDataPubSubType::~PtActivationDataPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PtActivationDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PtActivationData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PtActivationDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PtActivationData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PtActivationDataPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PtActivationDataPubSubType::createData() + { + return reinterpret_cast(new PtActivationData()); + } + + void PtActivationDataPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PtActivationDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PtActivationData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PtActivationData::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PtActivationData::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.h new file mode 100644 index 00000000000..d45d9f58488 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.h @@ -0,0 +1,112 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationDataPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_PUBSUBTYPES_H_ + +#include +#include + +#include "PtActivationData.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PtActivationData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace PtActivationData_Constants + { + + + } + /*! + * @brief This class represents the TopicDataType of the type PtActivationData defined by the user in the IDL file. + * @ingroup PTACTIVATIONDATA + */ + class PtActivationDataPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PtActivationData type; + + eProsima_user_DllExport PtActivationDataPubSubType(); + + eProsima_user_DllExport virtual ~PtActivationDataPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.cxx new file mode 100644 index 00000000000..f06978dd58a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PtActivationPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + PtActivationPubSubType::PtActivationPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PtActivation_"); + auto type_size = PtActivation::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PtActivation::isKeyDefined(); + size_t keyLength = PtActivation::getKeyMaxCdrSerializedSize() > 16 ? + PtActivation::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PtActivationPubSubType::~PtActivationPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PtActivationPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PtActivation* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PtActivationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PtActivation* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PtActivationPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PtActivationPubSubType::createData() + { + return reinterpret_cast(new PtActivation()); + } + + void PtActivationPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PtActivationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PtActivation* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PtActivation::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PtActivation::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.h new file mode 100644 index 00000000000..fd5b438c09c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_PUBSUBTYPES_H_ + +#include +#include + +#include "PtActivation.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PtActivation is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type PtActivation defined by the user in the IDL file. + * @ingroup PTACTIVATION + */ + class PtActivationPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PtActivation type; + + eProsima_user_DllExport PtActivationPubSubType(); + + eProsima_user_DllExport virtual ~PtActivationPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.cxx new file mode 100644 index 00000000000..cc5fbc605a2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationType.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PtActivationType.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::PtActivationType::PtActivationType() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@782a4fff + m_value = 0; + +} + +etsi_its_cam_msgs::msg::PtActivationType::~PtActivationType() +{ +} + +etsi_its_cam_msgs::msg::PtActivationType::PtActivationType( + const PtActivationType& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::PtActivationType::PtActivationType( + PtActivationType&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActivationType::operator =( + const PtActivationType& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActivationType::operator =( + PtActivationType&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::PtActivationType::operator ==( + const PtActivationType& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::PtActivationType::operator !=( + const PtActivationType& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PtActivationType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PtActivationType::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PtActivationType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PtActivationType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::PtActivationType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::PtActivationType::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::PtActivationType::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::PtActivationType::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::PtActivationType::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PtActivationType::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PtActivationType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.h new file mode 100644 index 00000000000..12a1b678381 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationType.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PtActivationType_SOURCE) +#define PtActivationType_DllAPI __declspec( dllexport ) +#else +#define PtActivationType_DllAPI __declspec( dllimport ) +#endif // PtActivationType_SOURCE +#else +#define PtActivationType_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PtActivationType_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PtActivationType_Constants { + const uint8_t MIN = 0; + const uint8_t MAX = 255; + const uint8_t UNDEFINED_CODING_TYPE = 0; + const uint8_t R_09_16_CODING_TYPE = 1; + const uint8_t VDV_50149_CODING_TYPE = 2; + } // namespace PtActivationType_Constants + /*! + * @brief This class represents the structure PtActivationType defined by the user in the IDL file. + * @ingroup PTACTIVATIONTYPE + */ + class PtActivationType + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PtActivationType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PtActivationType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. + */ + eProsima_user_DllExport PtActivationType( + const PtActivationType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. + */ + eProsima_user_DllExport PtActivationType( + PtActivationType&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. + */ + eProsima_user_DllExport PtActivationType& operator =( + const PtActivationType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. + */ + eProsima_user_DllExport PtActivationType& operator =( + PtActivationType&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivationType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PtActivationType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivationType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PtActivationType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PtActivationType& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.cxx new file mode 100644 index 00000000000..305a799c602 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationTypePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PtActivationTypePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace PtActivationType_Constants { + + + + + + + } //End of namespace PtActivationType_Constants + PtActivationTypePubSubType::PtActivationTypePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PtActivationType_"); + auto type_size = PtActivationType::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PtActivationType::isKeyDefined(); + size_t keyLength = PtActivationType::getKeyMaxCdrSerializedSize() > 16 ? + PtActivationType::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PtActivationTypePubSubType::~PtActivationTypePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PtActivationTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PtActivationType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PtActivationTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PtActivationType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PtActivationTypePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PtActivationTypePubSubType::createData() + { + return reinterpret_cast(new PtActivationType()); + } + + void PtActivationTypePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PtActivationTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PtActivationType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PtActivationType::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PtActivationType::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.h new file mode 100644 index 00000000000..595fd47df88 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationTypePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_PUBSUBTYPES_H_ + +#include +#include + +#include "PtActivationType.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PtActivationType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace PtActivationType_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type PtActivationType defined by the user in the IDL file. + * @ingroup PTACTIVATIONTYPE + */ + class PtActivationTypePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PtActivationType type; + + eProsima_user_DllExport PtActivationTypePubSubType(); + + eProsima_user_DllExport virtual ~PtActivationTypePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) PtActivationType(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.cxx new file mode 100644 index 00000000000..8c39b46f55d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.cxx @@ -0,0 +1,281 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PublicTransportContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PublicTransportContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::PublicTransportContainer::PublicTransportContainer() +{ + // m_embarkation_status com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@b91d8c4 + + // m_pt_activation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4b6166aa + + // m_pt_activation_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@a77614d + m_pt_activation_is_present = false; + +} + +etsi_its_cam_msgs::msg::PublicTransportContainer::~PublicTransportContainer() +{ + + +} + +etsi_its_cam_msgs::msg::PublicTransportContainer::PublicTransportContainer( + const PublicTransportContainer& x) +{ + m_embarkation_status = x.m_embarkation_status; + m_pt_activation = x.m_pt_activation; + m_pt_activation_is_present = x.m_pt_activation_is_present; +} + +etsi_its_cam_msgs::msg::PublicTransportContainer::PublicTransportContainer( + PublicTransportContainer&& x) +{ + m_embarkation_status = std::move(x.m_embarkation_status); + m_pt_activation = std::move(x.m_pt_activation); + m_pt_activation_is_present = x.m_pt_activation_is_present; +} + +etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg::PublicTransportContainer::operator =( + const PublicTransportContainer& x) +{ + + m_embarkation_status = x.m_embarkation_status; + m_pt_activation = x.m_pt_activation; + m_pt_activation_is_present = x.m_pt_activation_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg::PublicTransportContainer::operator =( + PublicTransportContainer&& x) +{ + + m_embarkation_status = std::move(x.m_embarkation_status); + m_pt_activation = std::move(x.m_pt_activation); + m_pt_activation_is_present = x.m_pt_activation_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::PublicTransportContainer::operator ==( + const PublicTransportContainer& x) const +{ + + return (m_embarkation_status == x.m_embarkation_status && m_pt_activation == x.m_pt_activation && m_pt_activation_is_present == x.m_pt_activation_is_present); +} + +bool etsi_its_cam_msgs::msg::PublicTransportContainer::operator !=( + const PublicTransportContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::PublicTransportContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::EmbarkationStatus::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PtActivation::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::PublicTransportContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PublicTransportContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::EmbarkationStatus::getCdrSerializedSize(data.embarkation_status(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PtActivation::getCdrSerializedSize(data.pt_activation(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::PublicTransportContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_embarkation_status; + scdr << m_pt_activation; + scdr << m_pt_activation_is_present; + +} + +void etsi_its_cam_msgs::msg::PublicTransportContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_embarkation_status; + dcdr >> m_pt_activation; + dcdr >> m_pt_activation_is_present; +} + +/*! + * @brief This function copies the value in member embarkation_status + * @param _embarkation_status New value to be copied in member embarkation_status + */ +void etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status( + const etsi_its_cam_msgs::msg::EmbarkationStatus& _embarkation_status) +{ + m_embarkation_status = _embarkation_status; +} + +/*! + * @brief This function moves the value in member embarkation_status + * @param _embarkation_status New value to be moved in member embarkation_status + */ +void etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status( + etsi_its_cam_msgs::msg::EmbarkationStatus&& _embarkation_status) +{ + m_embarkation_status = std::move(_embarkation_status); +} + +/*! + * @brief This function returns a constant reference to member embarkation_status + * @return Constant reference to member embarkation_status + */ +const etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status() const +{ + return m_embarkation_status; +} + +/*! + * @brief This function returns a reference to member embarkation_status + * @return Reference to member embarkation_status + */ +etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status() +{ + return m_embarkation_status; +} +/*! + * @brief This function copies the value in member pt_activation + * @param _pt_activation New value to be copied in member pt_activation + */ +void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation( + const etsi_its_cam_msgs::msg::PtActivation& _pt_activation) +{ + m_pt_activation = _pt_activation; +} + +/*! + * @brief This function moves the value in member pt_activation + * @param _pt_activation New value to be moved in member pt_activation + */ +void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation( + etsi_its_cam_msgs::msg::PtActivation&& _pt_activation) +{ + m_pt_activation = std::move(_pt_activation); +} + +/*! + * @brief This function returns a constant reference to member pt_activation + * @return Constant reference to member pt_activation + */ +const etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation() const +{ + return m_pt_activation; +} + +/*! + * @brief This function returns a reference to member pt_activation + * @return Reference to member pt_activation + */ +etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation() +{ + return m_pt_activation; +} +/*! + * @brief This function sets a value in member pt_activation_is_present + * @param _pt_activation_is_present New value for member pt_activation_is_present + */ +void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation_is_present( + bool _pt_activation_is_present) +{ + m_pt_activation_is_present = _pt_activation_is_present; +} + +/*! + * @brief This function returns the value of member pt_activation_is_present + * @return Value of member pt_activation_is_present + */ +bool etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation_is_present() const +{ + return m_pt_activation_is_present; +} + +/*! + * @brief This function returns a reference to member pt_activation_is_present + * @return Reference to member pt_activation_is_present + */ +bool& etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation_is_present() +{ + return m_pt_activation_is_present; +} + + +size_t etsi_its_cam_msgs::msg::PublicTransportContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::PublicTransportContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::PublicTransportContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.h new file mode 100644 index 00000000000..225aea3b44d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.h @@ -0,0 +1,264 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PublicTransportContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_H_ + +#include "PtActivation.h" +#include "EmbarkationStatus.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PublicTransportContainer_SOURCE) +#define PublicTransportContainer_DllAPI __declspec( dllexport ) +#else +#define PublicTransportContainer_DllAPI __declspec( dllimport ) +#endif // PublicTransportContainer_SOURCE +#else +#define PublicTransportContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PublicTransportContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure PublicTransportContainer defined by the user in the IDL file. + * @ingroup PUBLICTRANSPORTCONTAINER + */ + class PublicTransportContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PublicTransportContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PublicTransportContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. + */ + eProsima_user_DllExport PublicTransportContainer( + const PublicTransportContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. + */ + eProsima_user_DllExport PublicTransportContainer( + PublicTransportContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. + */ + eProsima_user_DllExport PublicTransportContainer& operator =( + const PublicTransportContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. + */ + eProsima_user_DllExport PublicTransportContainer& operator =( + PublicTransportContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PublicTransportContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PublicTransportContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PublicTransportContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PublicTransportContainer& x) const; + + /*! + * @brief This function copies the value in member embarkation_status + * @param _embarkation_status New value to be copied in member embarkation_status + */ + eProsima_user_DllExport void embarkation_status( + const etsi_its_cam_msgs::msg::EmbarkationStatus& _embarkation_status); + + /*! + * @brief This function moves the value in member embarkation_status + * @param _embarkation_status New value to be moved in member embarkation_status + */ + eProsima_user_DllExport void embarkation_status( + etsi_its_cam_msgs::msg::EmbarkationStatus&& _embarkation_status); + + /*! + * @brief This function returns a constant reference to member embarkation_status + * @return Constant reference to member embarkation_status + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmbarkationStatus& embarkation_status() const; + + /*! + * @brief This function returns a reference to member embarkation_status + * @return Reference to member embarkation_status + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::EmbarkationStatus& embarkation_status(); + /*! + * @brief This function copies the value in member pt_activation + * @param _pt_activation New value to be copied in member pt_activation + */ + eProsima_user_DllExport void pt_activation( + const etsi_its_cam_msgs::msg::PtActivation& _pt_activation); + + /*! + * @brief This function moves the value in member pt_activation + * @param _pt_activation New value to be moved in member pt_activation + */ + eProsima_user_DllExport void pt_activation( + etsi_its_cam_msgs::msg::PtActivation&& _pt_activation); + + /*! + * @brief This function returns a constant reference to member pt_activation + * @return Constant reference to member pt_activation + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivation& pt_activation() const; + + /*! + * @brief This function returns a reference to member pt_activation + * @return Reference to member pt_activation + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivation& pt_activation(); + /*! + * @brief This function sets a value in member pt_activation_is_present + * @param _pt_activation_is_present New value for member pt_activation_is_present + */ + eProsima_user_DllExport void pt_activation_is_present( + bool _pt_activation_is_present); + + /*! + * @brief This function returns the value of member pt_activation_is_present + * @return Value of member pt_activation_is_present + */ + eProsima_user_DllExport bool pt_activation_is_present() const; + + /*! + * @brief This function returns a reference to member pt_activation_is_present + * @return Reference to member pt_activation_is_present + */ + eProsima_user_DllExport bool& pt_activation_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::PublicTransportContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::EmbarkationStatus m_embarkation_status; + etsi_its_cam_msgs::msg::PtActivation m_pt_activation; + bool m_pt_activation_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.cxx new file mode 100644 index 00000000000..ad910cfd9dd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PublicTransportContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PublicTransportContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + PublicTransportContainerPubSubType::PublicTransportContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::PublicTransportContainer_"); + auto type_size = PublicTransportContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PublicTransportContainer::isKeyDefined(); + size_t keyLength = PublicTransportContainer::getKeyMaxCdrSerializedSize() > 16 ? + PublicTransportContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PublicTransportContainerPubSubType::~PublicTransportContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PublicTransportContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + PublicTransportContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PublicTransportContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + PublicTransportContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PublicTransportContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PublicTransportContainerPubSubType::createData() + { + return reinterpret_cast(new PublicTransportContainer()); + } + + void PublicTransportContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PublicTransportContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + PublicTransportContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PublicTransportContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PublicTransportContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.h new file mode 100644 index 00000000000..433d4a470bc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PublicTransportContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "PublicTransportContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PublicTransportContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type PublicTransportContainer defined by the user in the IDL file. + * @ingroup PUBLICTRANSPORTCONTAINER + */ + class PublicTransportContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PublicTransportContainer type; + + eProsima_user_DllExport PublicTransportContainerPubSubType(); + + eProsima_user_DllExport virtual ~PublicTransportContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.cxx new file mode 100644 index 00000000000..31ad3448e61 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.cxx @@ -0,0 +1,233 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RSUContainerHighFrequency.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "RSUContainerHighFrequency.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::RSUContainerHighFrequency::RSUContainerHighFrequency() +{ + // m_protected_communication_zones_rsu com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@20765ed5 + + // m_protected_communication_zones_rsu_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3b582111 + m_protected_communication_zones_rsu_is_present = false; + +} + +etsi_its_cam_msgs::msg::RSUContainerHighFrequency::~RSUContainerHighFrequency() +{ + +} + +etsi_its_cam_msgs::msg::RSUContainerHighFrequency::RSUContainerHighFrequency( + const RSUContainerHighFrequency& x) +{ + m_protected_communication_zones_rsu = x.m_protected_communication_zones_rsu; + m_protected_communication_zones_rsu_is_present = x.m_protected_communication_zones_rsu_is_present; +} + +etsi_its_cam_msgs::msg::RSUContainerHighFrequency::RSUContainerHighFrequency( + RSUContainerHighFrequency&& x) +{ + m_protected_communication_zones_rsu = std::move(x.m_protected_communication_zones_rsu); + m_protected_communication_zones_rsu_is_present = x.m_protected_communication_zones_rsu_is_present; +} + +etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::operator =( + const RSUContainerHighFrequency& x) +{ + + m_protected_communication_zones_rsu = x.m_protected_communication_zones_rsu; + m_protected_communication_zones_rsu_is_present = x.m_protected_communication_zones_rsu_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::operator =( + RSUContainerHighFrequency&& x) +{ + + m_protected_communication_zones_rsu = std::move(x.m_protected_communication_zones_rsu); + m_protected_communication_zones_rsu_is_present = x.m_protected_communication_zones_rsu_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::operator ==( + const RSUContainerHighFrequency& x) const +{ + + return (m_protected_communication_zones_rsu == x.m_protected_communication_zones_rsu && m_protected_communication_zones_rsu_is_present == x.m_protected_communication_zones_rsu_is_present); +} + +bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::operator !=( + const RSUContainerHighFrequency& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getCdrSerializedSize(data.protected_communication_zones_rsu(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_protected_communication_zones_rsu; + scdr << m_protected_communication_zones_rsu_is_present; + +} + +void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_protected_communication_zones_rsu; + dcdr >> m_protected_communication_zones_rsu_is_present; +} + +/*! + * @brief This function copies the value in member protected_communication_zones_rsu + * @param _protected_communication_zones_rsu New value to be copied in member protected_communication_zones_rsu + */ +void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu( + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& _protected_communication_zones_rsu) +{ + m_protected_communication_zones_rsu = _protected_communication_zones_rsu; +} + +/*! + * @brief This function moves the value in member protected_communication_zones_rsu + * @param _protected_communication_zones_rsu New value to be moved in member protected_communication_zones_rsu + */ +void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu( + etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU&& _protected_communication_zones_rsu) +{ + m_protected_communication_zones_rsu = std::move(_protected_communication_zones_rsu); +} + +/*! + * @brief This function returns a constant reference to member protected_communication_zones_rsu + * @return Constant reference to member protected_communication_zones_rsu + */ +const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu() const +{ + return m_protected_communication_zones_rsu; +} + +/*! + * @brief This function returns a reference to member protected_communication_zones_rsu + * @return Reference to member protected_communication_zones_rsu + */ +etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu() +{ + return m_protected_communication_zones_rsu; +} +/*! + * @brief This function sets a value in member protected_communication_zones_rsu_is_present + * @param _protected_communication_zones_rsu_is_present New value for member protected_communication_zones_rsu_is_present + */ +void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu_is_present( + bool _protected_communication_zones_rsu_is_present) +{ + m_protected_communication_zones_rsu_is_present = _protected_communication_zones_rsu_is_present; +} + +/*! + * @brief This function returns the value of member protected_communication_zones_rsu_is_present + * @return Value of member protected_communication_zones_rsu_is_present + */ +bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu_is_present() const +{ + return m_protected_communication_zones_rsu_is_present; +} + +/*! + * @brief This function returns a reference to member protected_communication_zones_rsu_is_present + * @return Reference to member protected_communication_zones_rsu_is_present + */ +bool& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu_is_present() +{ + return m_protected_communication_zones_rsu_is_present; +} + + +size_t etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.h new file mode 100644 index 00000000000..2e0adb94d29 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.h @@ -0,0 +1,237 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RSUContainerHighFrequency.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_H_ + +#include "ProtectedCommunicationZonesRSU.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(RSUContainerHighFrequency_SOURCE) +#define RSUContainerHighFrequency_DllAPI __declspec( dllexport ) +#else +#define RSUContainerHighFrequency_DllAPI __declspec( dllimport ) +#endif // RSUContainerHighFrequency_SOURCE +#else +#define RSUContainerHighFrequency_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define RSUContainerHighFrequency_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure RSUContainerHighFrequency defined by the user in the IDL file. + * @ingroup RSUCONTAINERHIGHFREQUENCY + */ + class RSUContainerHighFrequency + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RSUContainerHighFrequency(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RSUContainerHighFrequency(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport RSUContainerHighFrequency( + const RSUContainerHighFrequency& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport RSUContainerHighFrequency( + RSUContainerHighFrequency&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport RSUContainerHighFrequency& operator =( + const RSUContainerHighFrequency& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport RSUContainerHighFrequency& operator =( + RSUContainerHighFrequency&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RSUContainerHighFrequency object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RSUContainerHighFrequency& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RSUContainerHighFrequency object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RSUContainerHighFrequency& x) const; + + /*! + * @brief This function copies the value in member protected_communication_zones_rsu + * @param _protected_communication_zones_rsu New value to be copied in member protected_communication_zones_rsu + */ + eProsima_user_DllExport void protected_communication_zones_rsu( + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& _protected_communication_zones_rsu); + + /*! + * @brief This function moves the value in member protected_communication_zones_rsu + * @param _protected_communication_zones_rsu New value to be moved in member protected_communication_zones_rsu + */ + eProsima_user_DllExport void protected_communication_zones_rsu( + etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU&& _protected_communication_zones_rsu); + + /*! + * @brief This function returns a constant reference to member protected_communication_zones_rsu + * @return Constant reference to member protected_communication_zones_rsu + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& protected_communication_zones_rsu() const; + + /*! + * @brief This function returns a reference to member protected_communication_zones_rsu + * @return Reference to member protected_communication_zones_rsu + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& protected_communication_zones_rsu(); + /*! + * @brief This function sets a value in member protected_communication_zones_rsu_is_present + * @param _protected_communication_zones_rsu_is_present New value for member protected_communication_zones_rsu_is_present + */ + eProsima_user_DllExport void protected_communication_zones_rsu_is_present( + bool _protected_communication_zones_rsu_is_present); + + /*! + * @brief This function returns the value of member protected_communication_zones_rsu_is_present + * @return Value of member protected_communication_zones_rsu_is_present + */ + eProsima_user_DllExport bool protected_communication_zones_rsu_is_present() const; + + /*! + * @brief This function returns a reference to member protected_communication_zones_rsu_is_present + * @return Reference to member protected_communication_zones_rsu_is_present + */ + eProsima_user_DllExport bool& protected_communication_zones_rsu_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU m_protected_communication_zones_rsu; + bool m_protected_communication_zones_rsu_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.cxx new file mode 100644 index 00000000000..5afca4c53d8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RSUContainerHighFrequencyPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "RSUContainerHighFrequencyPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + RSUContainerHighFrequencyPubSubType::RSUContainerHighFrequencyPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::RSUContainerHighFrequency_"); + auto type_size = RSUContainerHighFrequency::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = RSUContainerHighFrequency::isKeyDefined(); + size_t keyLength = RSUContainerHighFrequency::getKeyMaxCdrSerializedSize() > 16 ? + RSUContainerHighFrequency::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + RSUContainerHighFrequencyPubSubType::~RSUContainerHighFrequencyPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool RSUContainerHighFrequencyPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + RSUContainerHighFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool RSUContainerHighFrequencyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + RSUContainerHighFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function RSUContainerHighFrequencyPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* RSUContainerHighFrequencyPubSubType::createData() + { + return reinterpret_cast(new RSUContainerHighFrequency()); + } + + void RSUContainerHighFrequencyPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool RSUContainerHighFrequencyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + RSUContainerHighFrequency* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + RSUContainerHighFrequency::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || RSUContainerHighFrequency::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.h new file mode 100644 index 00000000000..14b111fc515 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RSUContainerHighFrequencyPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ + +#include +#include + +#include "RSUContainerHighFrequency.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated RSUContainerHighFrequency is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type RSUContainerHighFrequency defined by the user in the IDL file. + * @ingroup RSUCONTAINERHIGHFREQUENCY + */ + class RSUContainerHighFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef RSUContainerHighFrequency type; + + eProsima_user_DllExport RSUContainerHighFrequencyPubSubType(); + + eProsima_user_DllExport virtual ~RSUContainerHighFrequencyPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.cxx new file mode 100644 index 00000000000..1529379e6ea --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.cxx @@ -0,0 +1,334 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ReferencePosition.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ReferencePosition.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::ReferencePosition::ReferencePosition() +{ + // m_latitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@58399d82 + + // m_longitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@26f96b85 + + // m_position_confidence_ellipse com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@46d8f407 + + // m_altitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3c0036b + + +} + +etsi_its_cam_msgs::msg::ReferencePosition::~ReferencePosition() +{ + + + +} + +etsi_its_cam_msgs::msg::ReferencePosition::ReferencePosition( + const ReferencePosition& x) +{ + m_latitude = x.m_latitude; + m_longitude = x.m_longitude; + m_position_confidence_ellipse = x.m_position_confidence_ellipse; + m_altitude = x.m_altitude; +} + +etsi_its_cam_msgs::msg::ReferencePosition::ReferencePosition( + ReferencePosition&& x) +{ + m_latitude = std::move(x.m_latitude); + m_longitude = std::move(x.m_longitude); + m_position_confidence_ellipse = std::move(x.m_position_confidence_ellipse); + m_altitude = std::move(x.m_altitude); +} + +etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::ReferencePosition::operator =( + const ReferencePosition& x) +{ + + m_latitude = x.m_latitude; + m_longitude = x.m_longitude; + m_position_confidence_ellipse = x.m_position_confidence_ellipse; + m_altitude = x.m_altitude; + + return *this; +} + +etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::ReferencePosition::operator =( + ReferencePosition&& x) +{ + + m_latitude = std::move(x.m_latitude); + m_longitude = std::move(x.m_longitude); + m_position_confidence_ellipse = std::move(x.m_position_confidence_ellipse); + m_altitude = std::move(x.m_altitude); + + return *this; +} + +bool etsi_its_cam_msgs::msg::ReferencePosition::operator ==( + const ReferencePosition& x) const +{ + + return (m_latitude == x.m_latitude && m_longitude == x.m_longitude && m_position_confidence_ellipse == x.m_position_confidence_ellipse && m_altitude == x.m_altitude); +} + +bool etsi_its_cam_msgs::msg::ReferencePosition::operator !=( + const ReferencePosition& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::ReferencePosition::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::Latitude::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Longitude::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PosConfidenceEllipse::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Altitude::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::ReferencePosition::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ReferencePosition& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::Latitude::getCdrSerializedSize(data.latitude(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Longitude::getCdrSerializedSize(data.longitude(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::PosConfidenceEllipse::getCdrSerializedSize(data.position_confidence_ellipse(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::Altitude::getCdrSerializedSize(data.altitude(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::ReferencePosition::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_latitude; + scdr << m_longitude; + scdr << m_position_confidence_ellipse; + scdr << m_altitude; + +} + +void etsi_its_cam_msgs::msg::ReferencePosition::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_latitude; + dcdr >> m_longitude; + dcdr >> m_position_confidence_ellipse; + dcdr >> m_altitude; +} + +/*! + * @brief This function copies the value in member latitude_ + * @param _latitude New value to be copied in member latitude_ + */ +void etsi_its_cam_msgs::msg::ReferencePosition::latitude( + const etsi_its_cam_msgs::msg::Latitude& _latitude) +{ + m_latitude = _latitude; +} + +/*! + * @brief This function moves the value in member latitude_ + * @param _latitude New value to be moved in member latitude_ + */ +void etsi_its_cam_msgs::msg::ReferencePosition::latitude( + etsi_its_cam_msgs::msg::Latitude&& _latitude) +{ + m_latitude = std::move(_latitude); +} + +/*! + * @brief This function returns a constant reference to member latitude_ + * @return Constant reference to member latitude_ + */ +const etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ReferencePosition::latitude() const +{ + return m_latitude; +} + +/*! + * @brief This function returns a reference to member latitude_ + * @return Reference to member latitude_ + */ +etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ReferencePosition::latitude() +{ + return m_latitude; +} +/*! + * @brief This function copies the value in member longitude_ + * @param _longitude New value to be copied in member longitude_ + */ +void etsi_its_cam_msgs::msg::ReferencePosition::longitude( + const etsi_its_cam_msgs::msg::Longitude& _longitude) +{ + m_longitude = _longitude; +} + +/*! + * @brief This function moves the value in member longitude_ + * @param _longitude New value to be moved in member longitude_ + */ +void etsi_its_cam_msgs::msg::ReferencePosition::longitude( + etsi_its_cam_msgs::msg::Longitude&& _longitude) +{ + m_longitude = std::move(_longitude); +} + +/*! + * @brief This function returns a constant reference to member longitude_ + * @return Constant reference to member longitude_ + */ +const etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ReferencePosition::longitude() const +{ + return m_longitude; +} + +/*! + * @brief This function returns a reference to member longitude_ + * @return Reference to member longitude_ + */ +etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ReferencePosition::longitude() +{ + return m_longitude; +} +/*! + * @brief This function copies the value in member position_confidence_ellipse + * @param _position_confidence_ellipse New value to be copied in member position_confidence_ellipse + */ +void etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse( + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& _position_confidence_ellipse) +{ + m_position_confidence_ellipse = _position_confidence_ellipse; +} + +/*! + * @brief This function moves the value in member position_confidence_ellipse + * @param _position_confidence_ellipse New value to be moved in member position_confidence_ellipse + */ +void etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse( + etsi_its_cam_msgs::msg::PosConfidenceEllipse&& _position_confidence_ellipse) +{ + m_position_confidence_ellipse = std::move(_position_confidence_ellipse); +} + +/*! + * @brief This function returns a constant reference to member position_confidence_ellipse + * @return Constant reference to member position_confidence_ellipse + */ +const etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse() const +{ + return m_position_confidence_ellipse; +} + +/*! + * @brief This function returns a reference to member position_confidence_ellipse + * @return Reference to member position_confidence_ellipse + */ +etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse() +{ + return m_position_confidence_ellipse; +} +/*! + * @brief This function copies the value in member altitude_ + * @param _altitude New value to be copied in member altitude_ + */ +void etsi_its_cam_msgs::msg::ReferencePosition::altitude( + const etsi_its_cam_msgs::msg::Altitude& _altitude) +{ + m_altitude = _altitude; +} + +/*! + * @brief This function moves the value in member altitude_ + * @param _altitude New value to be moved in member altitude_ + */ +void etsi_its_cam_msgs::msg::ReferencePosition::altitude( + etsi_its_cam_msgs::msg::Altitude&& _altitude) +{ + m_altitude = std::move(_altitude); +} + +/*! + * @brief This function returns a constant reference to member altitude_ + * @return Constant reference to member altitude_ + */ +const etsi_its_cam_msgs::msg::Altitude& etsi_its_cam_msgs::msg::ReferencePosition::altitude() const +{ + return m_altitude; +} + +/*! + * @brief This function returns a reference to member altitude_ + * @return Reference to member altitude_ + */ +etsi_its_cam_msgs::msg::Altitude& etsi_its_cam_msgs::msg::ReferencePosition::altitude() +{ + return m_altitude; +} + +size_t etsi_its_cam_msgs::msg::ReferencePosition::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::ReferencePosition::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::ReferencePosition::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.h new file mode 100644 index 00000000000..1f450e3ffad --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.h @@ -0,0 +1,298 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ReferencePosition.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_H_ + +#include "Latitude.h" +#include "PosConfidenceEllipse.h" +#include "Longitude.h" +#include "Altitude.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ReferencePosition_SOURCE) +#define ReferencePosition_DllAPI __declspec( dllexport ) +#else +#define ReferencePosition_DllAPI __declspec( dllimport ) +#endif // ReferencePosition_SOURCE +#else +#define ReferencePosition_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ReferencePosition_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure ReferencePosition defined by the user in the IDL file. + * @ingroup REFERENCEPOSITION + */ + class ReferencePosition + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ReferencePosition(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ReferencePosition(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. + */ + eProsima_user_DllExport ReferencePosition( + const ReferencePosition& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. + */ + eProsima_user_DllExport ReferencePosition( + ReferencePosition&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. + */ + eProsima_user_DllExport ReferencePosition& operator =( + const ReferencePosition& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. + */ + eProsima_user_DllExport ReferencePosition& operator =( + ReferencePosition&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ReferencePosition object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ReferencePosition& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ReferencePosition object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ReferencePosition& x) const; + + /*! + * @brief This function copies the value in member latitude_ + * @param _latitude New value to be copied in member latitude_ + */ + eProsima_user_DllExport void latitude( + const etsi_its_cam_msgs::msg::Latitude& _latitude); + + /*! + * @brief This function moves the value in member latitude_ + * @param _latitude New value to be moved in member latitude_ + */ + eProsima_user_DllExport void latitude( + etsi_its_cam_msgs::msg::Latitude&& _latitude); + + /*! + * @brief This function returns a constant reference to member latitude_ + * @return Constant reference to member latitude_ + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& latitude() const; + + /*! + * @brief This function returns a reference to member latitude_ + * @return Reference to member latitude_ + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& latitude(); + /*! + * @brief This function copies the value in member longitude_ + * @param _longitude New value to be copied in member longitude_ + */ + eProsima_user_DllExport void longitude( + const etsi_its_cam_msgs::msg::Longitude& _longitude); + + /*! + * @brief This function moves the value in member longitude_ + * @param _longitude New value to be moved in member longitude_ + */ + eProsima_user_DllExport void longitude( + etsi_its_cam_msgs::msg::Longitude&& _longitude); + + /*! + * @brief This function returns a constant reference to member longitude_ + * @return Constant reference to member longitude_ + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& longitude() const; + + /*! + * @brief This function returns a reference to member longitude_ + * @return Reference to member longitude_ + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& longitude(); + /*! + * @brief This function copies the value in member position_confidence_ellipse + * @param _position_confidence_ellipse New value to be copied in member position_confidence_ellipse + */ + eProsima_user_DllExport void position_confidence_ellipse( + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& _position_confidence_ellipse); + + /*! + * @brief This function moves the value in member position_confidence_ellipse + * @param _position_confidence_ellipse New value to be moved in member position_confidence_ellipse + */ + eProsima_user_DllExport void position_confidence_ellipse( + etsi_its_cam_msgs::msg::PosConfidenceEllipse&& _position_confidence_ellipse); + + /*! + * @brief This function returns a constant reference to member position_confidence_ellipse + * @return Constant reference to member position_confidence_ellipse + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PosConfidenceEllipse& position_confidence_ellipse() const; + + /*! + * @brief This function returns a reference to member position_confidence_ellipse + * @return Reference to member position_confidence_ellipse + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PosConfidenceEllipse& position_confidence_ellipse(); + /*! + * @brief This function copies the value in member altitude_ + * @param _altitude New value to be copied in member altitude_ + */ + eProsima_user_DllExport void altitude( + const etsi_its_cam_msgs::msg::Altitude& _altitude); + + /*! + * @brief This function moves the value in member altitude_ + * @param _altitude New value to be moved in member altitude_ + */ + eProsima_user_DllExport void altitude( + etsi_its_cam_msgs::msg::Altitude&& _altitude); + + /*! + * @brief This function returns a constant reference to member altitude_ + * @return Constant reference to member altitude_ + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Altitude& altitude() const; + + /*! + * @brief This function returns a reference to member altitude_ + * @return Reference to member altitude_ + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Altitude& altitude(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::ReferencePosition& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::Latitude m_latitude; + etsi_its_cam_msgs::msg::Longitude m_longitude; + etsi_its_cam_msgs::msg::PosConfidenceEllipse m_position_confidence_ellipse; + etsi_its_cam_msgs::msg::Altitude m_altitude; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.cxx new file mode 100644 index 00000000000..7f1c30af0d2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ReferencePositionPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "ReferencePositionPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + ReferencePositionPubSubType::ReferencePositionPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::ReferencePosition_"); + auto type_size = ReferencePosition::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = ReferencePosition::isKeyDefined(); + size_t keyLength = ReferencePosition::getKeyMaxCdrSerializedSize() > 16 ? + ReferencePosition::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ReferencePositionPubSubType::~ReferencePositionPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ReferencePositionPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + ReferencePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool ReferencePositionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + ReferencePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function ReferencePositionPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* ReferencePositionPubSubType::createData() + { + return reinterpret_cast(new ReferencePosition()); + } + + void ReferencePositionPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ReferencePositionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ReferencePosition* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + ReferencePosition::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || ReferencePosition::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.h new file mode 100644 index 00000000000..c837c3ebe9e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ReferencePositionPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_PUBSUBTYPES_H_ + +#include +#include + +#include "ReferencePosition.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated ReferencePosition is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type ReferencePosition defined by the user in the IDL file. + * @ingroup REFERENCEPOSITION + */ + class ReferencePositionPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ReferencePosition type; + + eProsima_user_DllExport ReferencePositionPubSubType(); + + eProsima_user_DllExport virtual ~ReferencePositionPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) ReferencePosition(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.cxx new file mode 100644 index 00000000000..e1a6fdf3763 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.cxx @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RescueContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "RescueContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::RescueContainer::RescueContainer() +{ + // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1bdf8190 + + +} + +etsi_its_cam_msgs::msg::RescueContainer::~RescueContainer() +{ +} + +etsi_its_cam_msgs::msg::RescueContainer::RescueContainer( + const RescueContainer& x) +{ + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; +} + +etsi_its_cam_msgs::msg::RescueContainer::RescueContainer( + RescueContainer&& x) +{ + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); +} + +etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::RescueContainer::operator =( + const RescueContainer& x) +{ + + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; + + return *this; +} + +etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::RescueContainer::operator =( + RescueContainer&& x) +{ + + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); + + return *this; +} + +bool etsi_its_cam_msgs::msg::RescueContainer::operator ==( + const RescueContainer& x) const +{ + + return (m_light_bar_siren_in_use == x.m_light_bar_siren_in_use); +} + +bool etsi_its_cam_msgs::msg::RescueContainer::operator !=( + const RescueContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::RescueContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::RescueContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::RescueContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::RescueContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_light_bar_siren_in_use; + +} + +void etsi_its_cam_msgs::msg::RescueContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_light_bar_siren_in_use; +} + +/*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = _light_bar_siren_in_use; +} + +/*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); +} + +/*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ +const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use() const +{ + return m_light_bar_siren_in_use; +} + +/*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ +etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use() +{ + return m_light_bar_siren_in_use; +} + +size_t etsi_its_cam_msgs::msg::RescueContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::RescueContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::RescueContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.h new file mode 100644 index 00000000000..a2816e37c46 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RescueContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_H_ + +#include "LightBarSirenInUse.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(RescueContainer_SOURCE) +#define RescueContainer_DllAPI __declspec( dllexport ) +#else +#define RescueContainer_DllAPI __declspec( dllimport ) +#endif // RescueContainer_SOURCE +#else +#define RescueContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define RescueContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure RescueContainer defined by the user in the IDL file. + * @ingroup RESCUECONTAINER + */ + class RescueContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RescueContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RescueContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. + */ + eProsima_user_DllExport RescueContainer( + const RescueContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. + */ + eProsima_user_DllExport RescueContainer( + RescueContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. + */ + eProsima_user_DllExport RescueContainer& operator =( + const RescueContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. + */ + eProsima_user_DllExport RescueContainer& operator =( + RescueContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RescueContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RescueContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RescueContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RescueContainer& x) const; + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::RescueContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.cxx new file mode 100644 index 00000000000..5b2b7e13557 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RescueContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "RescueContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + RescueContainerPubSubType::RescueContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::RescueContainer_"); + auto type_size = RescueContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = RescueContainer::isKeyDefined(); + size_t keyLength = RescueContainer::getKeyMaxCdrSerializedSize() > 16 ? + RescueContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + RescueContainerPubSubType::~RescueContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool RescueContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + RescueContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool RescueContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + RescueContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function RescueContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* RescueContainerPubSubType::createData() + { + return reinterpret_cast(new RescueContainer()); + } + + void RescueContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool RescueContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + RescueContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + RescueContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || RescueContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.h new file mode 100644 index 00000000000..fbd93064c10 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RescueContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "RescueContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated RescueContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type RescueContainer defined by the user in the IDL file. + * @ingroup RESCUECONTAINER + */ + class RescueContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef RescueContainer type; + + eProsima_user_DllExport RescueContainerPubSubType(); + + eProsima_user_DllExport virtual ~RescueContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.cxx new file mode 100644 index 00000000000..19aa9fdc442 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.cxx @@ -0,0 +1,372 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadWorksContainerBasic.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "RoadWorksContainerBasic.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::RoadWorksContainerBasic::RoadWorksContainerBasic() +{ + // m_roadworks_sub_cause_code com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6ffab045 + + // m_roadworks_sub_cause_code_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@26fb628 + m_roadworks_sub_cause_code_is_present = false; + // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3e2943ab + + // m_closed_lanes com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@70dd7e15 + + // m_closed_lanes_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4a9f80d3 + m_closed_lanes_is_present = false; + +} + +etsi_its_cam_msgs::msg::RoadWorksContainerBasic::~RoadWorksContainerBasic() +{ + + + + +} + +etsi_its_cam_msgs::msg::RoadWorksContainerBasic::RoadWorksContainerBasic( + const RoadWorksContainerBasic& x) +{ + m_roadworks_sub_cause_code = x.m_roadworks_sub_cause_code; + m_roadworks_sub_cause_code_is_present = x.m_roadworks_sub_cause_code_is_present; + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; + m_closed_lanes = x.m_closed_lanes; + m_closed_lanes_is_present = x.m_closed_lanes_is_present; +} + +etsi_its_cam_msgs::msg::RoadWorksContainerBasic::RoadWorksContainerBasic( + RoadWorksContainerBasic&& x) +{ + m_roadworks_sub_cause_code = std::move(x.m_roadworks_sub_cause_code); + m_roadworks_sub_cause_code_is_present = x.m_roadworks_sub_cause_code_is_present; + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); + m_closed_lanes = std::move(x.m_closed_lanes); + m_closed_lanes_is_present = x.m_closed_lanes_is_present; +} + +etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::operator =( + const RoadWorksContainerBasic& x) +{ + + m_roadworks_sub_cause_code = x.m_roadworks_sub_cause_code; + m_roadworks_sub_cause_code_is_present = x.m_roadworks_sub_cause_code_is_present; + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; + m_closed_lanes = x.m_closed_lanes; + m_closed_lanes_is_present = x.m_closed_lanes_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::operator =( + RoadWorksContainerBasic&& x) +{ + + m_roadworks_sub_cause_code = std::move(x.m_roadworks_sub_cause_code); + m_roadworks_sub_cause_code_is_present = x.m_roadworks_sub_cause_code_is_present; + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); + m_closed_lanes = std::move(x.m_closed_lanes); + m_closed_lanes_is_present = x.m_closed_lanes_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::operator ==( + const RoadWorksContainerBasic& x) const +{ + + return (m_roadworks_sub_cause_code == x.m_roadworks_sub_cause_code && m_roadworks_sub_cause_code_is_present == x.m_roadworks_sub_cause_code_is_present && m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && m_closed_lanes == x.m_closed_lanes && m_closed_lanes_is_present == x.m_closed_lanes_is_present); +} + +bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::operator !=( + const RoadWorksContainerBasic& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::ClosedLanes::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getCdrSerializedSize(data.roadworks_sub_cause_code(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::ClosedLanes::getCdrSerializedSize(data.closed_lanes(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_roadworks_sub_cause_code; + scdr << m_roadworks_sub_cause_code_is_present; + scdr << m_light_bar_siren_in_use; + scdr << m_closed_lanes; + scdr << m_closed_lanes_is_present; + +} + +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_roadworks_sub_cause_code; + dcdr >> m_roadworks_sub_cause_code_is_present; + dcdr >> m_light_bar_siren_in_use; + dcdr >> m_closed_lanes; + dcdr >> m_closed_lanes_is_present; +} + +/*! + * @brief This function copies the value in member roadworks_sub_cause_code + * @param _roadworks_sub_cause_code New value to be copied in member roadworks_sub_cause_code + */ +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code( + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& _roadworks_sub_cause_code) +{ + m_roadworks_sub_cause_code = _roadworks_sub_cause_code; +} + +/*! + * @brief This function moves the value in member roadworks_sub_cause_code + * @param _roadworks_sub_cause_code New value to be moved in member roadworks_sub_cause_code + */ +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code( + etsi_its_cam_msgs::msg::RoadworksSubCauseCode&& _roadworks_sub_cause_code) +{ + m_roadworks_sub_cause_code = std::move(_roadworks_sub_cause_code); +} + +/*! + * @brief This function returns a constant reference to member roadworks_sub_cause_code + * @return Constant reference to member roadworks_sub_cause_code + */ +const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code() const +{ + return m_roadworks_sub_cause_code; +} + +/*! + * @brief This function returns a reference to member roadworks_sub_cause_code + * @return Reference to member roadworks_sub_cause_code + */ +etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code() +{ + return m_roadworks_sub_cause_code; +} +/*! + * @brief This function sets a value in member roadworks_sub_cause_code_is_present + * @param _roadworks_sub_cause_code_is_present New value for member roadworks_sub_cause_code_is_present + */ +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code_is_present( + bool _roadworks_sub_cause_code_is_present) +{ + m_roadworks_sub_cause_code_is_present = _roadworks_sub_cause_code_is_present; +} + +/*! + * @brief This function returns the value of member roadworks_sub_cause_code_is_present + * @return Value of member roadworks_sub_cause_code_is_present + */ +bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code_is_present() const +{ + return m_roadworks_sub_cause_code_is_present; +} + +/*! + * @brief This function returns a reference to member roadworks_sub_cause_code_is_present + * @return Reference to member roadworks_sub_cause_code_is_present + */ +bool& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code_is_present() +{ + return m_roadworks_sub_cause_code_is_present; +} + +/*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = _light_bar_siren_in_use; +} + +/*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); +} + +/*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ +const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use() const +{ + return m_light_bar_siren_in_use; +} + +/*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ +etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use() +{ + return m_light_bar_siren_in_use; +} +/*! + * @brief This function copies the value in member closed_lanes + * @param _closed_lanes New value to be copied in member closed_lanes + */ +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes( + const etsi_its_cam_msgs::msg::ClosedLanes& _closed_lanes) +{ + m_closed_lanes = _closed_lanes; +} + +/*! + * @brief This function moves the value in member closed_lanes + * @param _closed_lanes New value to be moved in member closed_lanes + */ +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes( + etsi_its_cam_msgs::msg::ClosedLanes&& _closed_lanes) +{ + m_closed_lanes = std::move(_closed_lanes); +} + +/*! + * @brief This function returns a constant reference to member closed_lanes + * @return Constant reference to member closed_lanes + */ +const etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes() const +{ + return m_closed_lanes; +} + +/*! + * @brief This function returns a reference to member closed_lanes + * @return Reference to member closed_lanes + */ +etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes() +{ + return m_closed_lanes; +} +/*! + * @brief This function sets a value in member closed_lanes_is_present + * @param _closed_lanes_is_present New value for member closed_lanes_is_present + */ +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes_is_present( + bool _closed_lanes_is_present) +{ + m_closed_lanes_is_present = _closed_lanes_is_present; +} + +/*! + * @brief This function returns the value of member closed_lanes_is_present + * @return Value of member closed_lanes_is_present + */ +bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes_is_present() const +{ + return m_closed_lanes_is_present; +} + +/*! + * @brief This function returns a reference to member closed_lanes_is_present + * @return Reference to member closed_lanes_is_present + */ +bool& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes_is_present() +{ + return m_closed_lanes_is_present; +} + + +size_t etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.h new file mode 100644 index 00000000000..146e9d7bfa6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.h @@ -0,0 +1,311 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadWorksContainerBasic.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_H_ + +#include "RoadworksSubCauseCode.h" +#include "ClosedLanes.h" +#include "LightBarSirenInUse.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(RoadWorksContainerBasic_SOURCE) +#define RoadWorksContainerBasic_DllAPI __declspec( dllexport ) +#else +#define RoadWorksContainerBasic_DllAPI __declspec( dllimport ) +#endif // RoadWorksContainerBasic_SOURCE +#else +#define RoadWorksContainerBasic_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define RoadWorksContainerBasic_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure RoadWorksContainerBasic defined by the user in the IDL file. + * @ingroup ROADWORKSCONTAINERBASIC + */ + class RoadWorksContainerBasic + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RoadWorksContainerBasic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RoadWorksContainerBasic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. + */ + eProsima_user_DllExport RoadWorksContainerBasic( + const RoadWorksContainerBasic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. + */ + eProsima_user_DllExport RoadWorksContainerBasic( + RoadWorksContainerBasic&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. + */ + eProsima_user_DllExport RoadWorksContainerBasic& operator =( + const RoadWorksContainerBasic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. + */ + eProsima_user_DllExport RoadWorksContainerBasic& operator =( + RoadWorksContainerBasic&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RoadWorksContainerBasic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RoadWorksContainerBasic& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RoadWorksContainerBasic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RoadWorksContainerBasic& x) const; + + /*! + * @brief This function copies the value in member roadworks_sub_cause_code + * @param _roadworks_sub_cause_code New value to be copied in member roadworks_sub_cause_code + */ + eProsima_user_DllExport void roadworks_sub_cause_code( + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& _roadworks_sub_cause_code); + + /*! + * @brief This function moves the value in member roadworks_sub_cause_code + * @param _roadworks_sub_cause_code New value to be moved in member roadworks_sub_cause_code + */ + eProsima_user_DllExport void roadworks_sub_cause_code( + etsi_its_cam_msgs::msg::RoadworksSubCauseCode&& _roadworks_sub_cause_code); + + /*! + * @brief This function returns a constant reference to member roadworks_sub_cause_code + * @return Constant reference to member roadworks_sub_cause_code + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& roadworks_sub_cause_code() const; + + /*! + * @brief This function returns a reference to member roadworks_sub_cause_code + * @return Reference to member roadworks_sub_cause_code + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::RoadworksSubCauseCode& roadworks_sub_cause_code(); + /*! + * @brief This function sets a value in member roadworks_sub_cause_code_is_present + * @param _roadworks_sub_cause_code_is_present New value for member roadworks_sub_cause_code_is_present + */ + eProsima_user_DllExport void roadworks_sub_cause_code_is_present( + bool _roadworks_sub_cause_code_is_present); + + /*! + * @brief This function returns the value of member roadworks_sub_cause_code_is_present + * @return Value of member roadworks_sub_cause_code_is_present + */ + eProsima_user_DllExport bool roadworks_sub_cause_code_is_present() const; + + /*! + * @brief This function returns a reference to member roadworks_sub_cause_code_is_present + * @return Reference to member roadworks_sub_cause_code_is_present + */ + eProsima_user_DllExport bool& roadworks_sub_cause_code_is_present(); + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + /*! + * @brief This function copies the value in member closed_lanes + * @param _closed_lanes New value to be copied in member closed_lanes + */ + eProsima_user_DllExport void closed_lanes( + const etsi_its_cam_msgs::msg::ClosedLanes& _closed_lanes); + + /*! + * @brief This function moves the value in member closed_lanes + * @param _closed_lanes New value to be moved in member closed_lanes + */ + eProsima_user_DllExport void closed_lanes( + etsi_its_cam_msgs::msg::ClosedLanes&& _closed_lanes); + + /*! + * @brief This function returns a constant reference to member closed_lanes + * @return Constant reference to member closed_lanes + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ClosedLanes& closed_lanes() const; + + /*! + * @brief This function returns a reference to member closed_lanes + * @return Reference to member closed_lanes + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ClosedLanes& closed_lanes(); + /*! + * @brief This function sets a value in member closed_lanes_is_present + * @param _closed_lanes_is_present New value for member closed_lanes_is_present + */ + eProsima_user_DllExport void closed_lanes_is_present( + bool _closed_lanes_is_present); + + /*! + * @brief This function returns the value of member closed_lanes_is_present + * @return Value of member closed_lanes_is_present + */ + eProsima_user_DllExport bool closed_lanes_is_present() const; + + /*! + * @brief This function returns a reference to member closed_lanes_is_present + * @return Reference to member closed_lanes_is_present + */ + eProsima_user_DllExport bool& closed_lanes_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::RoadworksSubCauseCode m_roadworks_sub_cause_code; + bool m_roadworks_sub_cause_code_is_present; + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + etsi_its_cam_msgs::msg::ClosedLanes m_closed_lanes; + bool m_closed_lanes_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.cxx new file mode 100644 index 00000000000..7f28f1f3f06 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadWorksContainerBasicPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "RoadWorksContainerBasicPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + RoadWorksContainerBasicPubSubType::RoadWorksContainerBasicPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::RoadWorksContainerBasic_"); + auto type_size = RoadWorksContainerBasic::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = RoadWorksContainerBasic::isKeyDefined(); + size_t keyLength = RoadWorksContainerBasic::getKeyMaxCdrSerializedSize() > 16 ? + RoadWorksContainerBasic::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + RoadWorksContainerBasicPubSubType::~RoadWorksContainerBasicPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool RoadWorksContainerBasicPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + RoadWorksContainerBasic* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool RoadWorksContainerBasicPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + RoadWorksContainerBasic* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function RoadWorksContainerBasicPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* RoadWorksContainerBasicPubSubType::createData() + { + return reinterpret_cast(new RoadWorksContainerBasic()); + } + + void RoadWorksContainerBasicPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool RoadWorksContainerBasicPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + RoadWorksContainerBasic* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + RoadWorksContainerBasic::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || RoadWorksContainerBasic::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.h new file mode 100644 index 00000000000..ba8645908e9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadWorksContainerBasicPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_PUBSUBTYPES_H_ + +#include +#include + +#include "RoadWorksContainerBasic.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated RoadWorksContainerBasic is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type RoadWorksContainerBasic defined by the user in the IDL file. + * @ingroup ROADWORKSCONTAINERBASIC + */ + class RoadWorksContainerBasicPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef RoadWorksContainerBasic type; + + eProsima_user_DllExport RoadWorksContainerBasicPubSubType(); + + eProsima_user_DllExport virtual ~RoadWorksContainerBasicPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.cxx new file mode 100644 index 00000000000..27b98d6d0be --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.cxx @@ -0,0 +1,193 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadworksSubCauseCode.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "RoadworksSubCauseCode.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + +etsi_its_cam_msgs::msg::RoadworksSubCauseCode::RoadworksSubCauseCode() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@89ff02e + m_value = 0; + +} + +etsi_its_cam_msgs::msg::RoadworksSubCauseCode::~RoadworksSubCauseCode() +{ +} + +etsi_its_cam_msgs::msg::RoadworksSubCauseCode::RoadworksSubCauseCode( + const RoadworksSubCauseCode& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::RoadworksSubCauseCode::RoadworksSubCauseCode( + RoadworksSubCauseCode&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::RoadworksSubCauseCode::operator =( + const RoadworksSubCauseCode& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::RoadworksSubCauseCode::operator =( + RoadworksSubCauseCode&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::RoadworksSubCauseCode::operator ==( + const RoadworksSubCauseCode& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::RoadworksSubCauseCode::operator !=( + const RoadworksSubCauseCode& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::RoadworksSubCauseCode::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::RoadworksSubCauseCode::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.h new file mode 100644 index 00000000000..b81fec0d395 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.h @@ -0,0 +1,221 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadworksSubCauseCode.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(RoadworksSubCauseCode_SOURCE) +#define RoadworksSubCauseCode_DllAPI __declspec( dllexport ) +#else +#define RoadworksSubCauseCode_DllAPI __declspec( dllimport ) +#endif // RoadworksSubCauseCode_SOURCE +#else +#define RoadworksSubCauseCode_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define RoadworksSubCauseCode_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace RoadworksSubCauseCode_Constants { + const uint8_t MIN = 0; + const uint8_t MAX = 255; + const uint8_t UNAVAILABLE = 0; + const uint8_t MAJOR_ROADWORKS = 1; + const uint8_t ROAD_MARKING_WORK = 2; + const uint8_t SLOW_MOVING_ROAD_MAINTENANCE = 3; + const uint8_t SHORT_TERM_STATIONARY_ROADWORKS = 4; + const uint8_t STREET_CLEANING = 5; + const uint8_t WINTER_SERVICE = 6; + } // namespace RoadworksSubCauseCode_Constants + /*! + * @brief This class represents the structure RoadworksSubCauseCode defined by the user in the IDL file. + * @ingroup ROADWORKSSUBCAUSECODE + */ + class RoadworksSubCauseCode + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RoadworksSubCauseCode(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RoadworksSubCauseCode(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. + */ + eProsima_user_DllExport RoadworksSubCauseCode( + const RoadworksSubCauseCode& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. + */ + eProsima_user_DllExport RoadworksSubCauseCode( + RoadworksSubCauseCode&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. + */ + eProsima_user_DllExport RoadworksSubCauseCode& operator =( + const RoadworksSubCauseCode& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. + */ + eProsima_user_DllExport RoadworksSubCauseCode& operator =( + RoadworksSubCauseCode&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RoadworksSubCauseCode object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RoadworksSubCauseCode& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RoadworksSubCauseCode object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RoadworksSubCauseCode& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.cxx new file mode 100644 index 00000000000..58926c36eab --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.cxx @@ -0,0 +1,188 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadworksSubCauseCodePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "RoadworksSubCauseCodePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace RoadworksSubCauseCode_Constants { + + + + + + + + + + + } //End of namespace RoadworksSubCauseCode_Constants + RoadworksSubCauseCodePubSubType::RoadworksSubCauseCodePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::RoadworksSubCauseCode_"); + auto type_size = RoadworksSubCauseCode::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = RoadworksSubCauseCode::isKeyDefined(); + size_t keyLength = RoadworksSubCauseCode::getKeyMaxCdrSerializedSize() > 16 ? + RoadworksSubCauseCode::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + RoadworksSubCauseCodePubSubType::~RoadworksSubCauseCodePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool RoadworksSubCauseCodePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + RoadworksSubCauseCode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool RoadworksSubCauseCodePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + RoadworksSubCauseCode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function RoadworksSubCauseCodePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* RoadworksSubCauseCodePubSubType::createData() + { + return reinterpret_cast(new RoadworksSubCauseCode()); + } + + void RoadworksSubCauseCodePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool RoadworksSubCauseCodePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + RoadworksSubCauseCode* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + RoadworksSubCauseCode::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || RoadworksSubCauseCode::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.h new file mode 100644 index 00000000000..6ea5a7a275c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.h @@ -0,0 +1,119 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadworksSubCauseCodePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_PUBSUBTYPES_H_ + +#include +#include + +#include "RoadworksSubCauseCode.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated RoadworksSubCauseCode is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace RoadworksSubCauseCode_Constants + { + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type RoadworksSubCauseCode defined by the user in the IDL file. + * @ingroup ROADWORKSSUBCAUSECODE + */ + class RoadworksSubCauseCodePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef RoadworksSubCauseCode type; + + eProsima_user_DllExport RoadworksSubCauseCodePubSubType(); + + eProsima_user_DllExport virtual ~RoadworksSubCauseCodePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) RoadworksSubCauseCode(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.cxx new file mode 100644 index 00000000000..ab332dfa7ba --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.cxx @@ -0,0 +1,463 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SafetyCarContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SafetyCarContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::SafetyCarContainer::SafetyCarContainer() +{ + // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5b58ed3c + + // m_incident_indication com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@24faea88 + + // m_incident_indication_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3a320ade + m_incident_indication_is_present = false; + // m_traffic_rule com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@64beebb7 + + // m_traffic_rule_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7813cb11 + m_traffic_rule_is_present = false; + // m_speed_limit com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@bcec031 + + // m_speed_limit_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@21005f6c + m_speed_limit_is_present = false; + +} + +etsi_its_cam_msgs::msg::SafetyCarContainer::~SafetyCarContainer() +{ + + + + + + +} + +etsi_its_cam_msgs::msg::SafetyCarContainer::SafetyCarContainer( + const SafetyCarContainer& x) +{ + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; + m_incident_indication = x.m_incident_indication; + m_incident_indication_is_present = x.m_incident_indication_is_present; + m_traffic_rule = x.m_traffic_rule; + m_traffic_rule_is_present = x.m_traffic_rule_is_present; + m_speed_limit = x.m_speed_limit; + m_speed_limit_is_present = x.m_speed_limit_is_present; +} + +etsi_its_cam_msgs::msg::SafetyCarContainer::SafetyCarContainer( + SafetyCarContainer&& x) +{ + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); + m_incident_indication = std::move(x.m_incident_indication); + m_incident_indication_is_present = x.m_incident_indication_is_present; + m_traffic_rule = std::move(x.m_traffic_rule); + m_traffic_rule_is_present = x.m_traffic_rule_is_present; + m_speed_limit = std::move(x.m_speed_limit); + m_speed_limit_is_present = x.m_speed_limit_is_present; +} + +etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SafetyCarContainer::operator =( + const SafetyCarContainer& x) +{ + + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; + m_incident_indication = x.m_incident_indication; + m_incident_indication_is_present = x.m_incident_indication_is_present; + m_traffic_rule = x.m_traffic_rule; + m_traffic_rule_is_present = x.m_traffic_rule_is_present; + m_speed_limit = x.m_speed_limit; + m_speed_limit_is_present = x.m_speed_limit_is_present; + + return *this; +} + +etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SafetyCarContainer::operator =( + SafetyCarContainer&& x) +{ + + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); + m_incident_indication = std::move(x.m_incident_indication); + m_incident_indication_is_present = x.m_incident_indication_is_present; + m_traffic_rule = std::move(x.m_traffic_rule); + m_traffic_rule_is_present = x.m_traffic_rule_is_present; + m_speed_limit = std::move(x.m_speed_limit); + m_speed_limit_is_present = x.m_speed_limit_is_present; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SafetyCarContainer::operator ==( + const SafetyCarContainer& x) const +{ + + return (m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && m_incident_indication == x.m_incident_indication && m_incident_indication_is_present == x.m_incident_indication_is_present && m_traffic_rule == x.m_traffic_rule && m_traffic_rule_is_present == x.m_traffic_rule_is_present && m_speed_limit == x.m_speed_limit && m_speed_limit_is_present == x.m_speed_limit_is_present); +} + +bool etsi_its_cam_msgs::msg::SafetyCarContainer::operator !=( + const SafetyCarContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SafetyCarContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CauseCode::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::TrafficRule::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::SpeedLimit::getMaxCdrSerializedSize(current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SafetyCarContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SafetyCarContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::CauseCode::getCdrSerializedSize(data.incident_indication(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::TrafficRule::getCdrSerializedSize(data.traffic_rule(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::SpeedLimit::getCdrSerializedSize(data.speed_limit(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SafetyCarContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_light_bar_siren_in_use; + scdr << m_incident_indication; + scdr << m_incident_indication_is_present; + scdr << m_traffic_rule; + scdr << m_traffic_rule_is_present; + scdr << m_speed_limit; + scdr << m_speed_limit_is_present; + +} + +void etsi_its_cam_msgs::msg::SafetyCarContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_light_bar_siren_in_use; + dcdr >> m_incident_indication; + dcdr >> m_incident_indication_is_present; + dcdr >> m_traffic_rule; + dcdr >> m_traffic_rule_is_present; + dcdr >> m_speed_limit; + dcdr >> m_speed_limit_is_present; +} + +/*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = _light_bar_siren_in_use; +} + +/*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); +} + +/*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ +const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use() const +{ + return m_light_bar_siren_in_use; +} + +/*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ +etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use() +{ + return m_light_bar_siren_in_use; +} +/*! + * @brief This function copies the value in member incident_indication + * @param _incident_indication New value to be copied in member incident_indication + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication( + const etsi_its_cam_msgs::msg::CauseCode& _incident_indication) +{ + m_incident_indication = _incident_indication; +} + +/*! + * @brief This function moves the value in member incident_indication + * @param _incident_indication New value to be moved in member incident_indication + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication( + etsi_its_cam_msgs::msg::CauseCode&& _incident_indication) +{ + m_incident_indication = std::move(_incident_indication); +} + +/*! + * @brief This function returns a constant reference to member incident_indication + * @return Constant reference to member incident_indication + */ +const etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication() const +{ + return m_incident_indication; +} + +/*! + * @brief This function returns a reference to member incident_indication + * @return Reference to member incident_indication + */ +etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication() +{ + return m_incident_indication; +} +/*! + * @brief This function sets a value in member incident_indication_is_present + * @param _incident_indication_is_present New value for member incident_indication_is_present + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication_is_present( + bool _incident_indication_is_present) +{ + m_incident_indication_is_present = _incident_indication_is_present; +} + +/*! + * @brief This function returns the value of member incident_indication_is_present + * @return Value of member incident_indication_is_present + */ +bool etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication_is_present() const +{ + return m_incident_indication_is_present; +} + +/*! + * @brief This function returns a reference to member incident_indication_is_present + * @return Reference to member incident_indication_is_present + */ +bool& etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication_is_present() +{ + return m_incident_indication_is_present; +} + +/*! + * @brief This function copies the value in member traffic_rule + * @param _traffic_rule New value to be copied in member traffic_rule + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule( + const etsi_its_cam_msgs::msg::TrafficRule& _traffic_rule) +{ + m_traffic_rule = _traffic_rule; +} + +/*! + * @brief This function moves the value in member traffic_rule + * @param _traffic_rule New value to be moved in member traffic_rule + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule( + etsi_its_cam_msgs::msg::TrafficRule&& _traffic_rule) +{ + m_traffic_rule = std::move(_traffic_rule); +} + +/*! + * @brief This function returns a constant reference to member traffic_rule + * @return Constant reference to member traffic_rule + */ +const etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule() const +{ + return m_traffic_rule; +} + +/*! + * @brief This function returns a reference to member traffic_rule + * @return Reference to member traffic_rule + */ +etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule() +{ + return m_traffic_rule; +} +/*! + * @brief This function sets a value in member traffic_rule_is_present + * @param _traffic_rule_is_present New value for member traffic_rule_is_present + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule_is_present( + bool _traffic_rule_is_present) +{ + m_traffic_rule_is_present = _traffic_rule_is_present; +} + +/*! + * @brief This function returns the value of member traffic_rule_is_present + * @return Value of member traffic_rule_is_present + */ +bool etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule_is_present() const +{ + return m_traffic_rule_is_present; +} + +/*! + * @brief This function returns a reference to member traffic_rule_is_present + * @return Reference to member traffic_rule_is_present + */ +bool& etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule_is_present() +{ + return m_traffic_rule_is_present; +} + +/*! + * @brief This function copies the value in member speed_limit + * @param _speed_limit New value to be copied in member speed_limit + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit( + const etsi_its_cam_msgs::msg::SpeedLimit& _speed_limit) +{ + m_speed_limit = _speed_limit; +} + +/*! + * @brief This function moves the value in member speed_limit + * @param _speed_limit New value to be moved in member speed_limit + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit( + etsi_its_cam_msgs::msg::SpeedLimit&& _speed_limit) +{ + m_speed_limit = std::move(_speed_limit); +} + +/*! + * @brief This function returns a constant reference to member speed_limit + * @return Constant reference to member speed_limit + */ +const etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit() const +{ + return m_speed_limit; +} + +/*! + * @brief This function returns a reference to member speed_limit + * @return Reference to member speed_limit + */ +etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit() +{ + return m_speed_limit; +} +/*! + * @brief This function sets a value in member speed_limit_is_present + * @param _speed_limit_is_present New value for member speed_limit_is_present + */ +void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit_is_present( + bool _speed_limit_is_present) +{ + m_speed_limit_is_present = _speed_limit_is_present; +} + +/*! + * @brief This function returns the value of member speed_limit_is_present + * @return Value of member speed_limit_is_present + */ +bool etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit_is_present() const +{ + return m_speed_limit_is_present; +} + +/*! + * @brief This function returns a reference to member speed_limit_is_present + * @return Reference to member speed_limit_is_present + */ +bool& etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit_is_present() +{ + return m_speed_limit_is_present; +} + + +size_t etsi_its_cam_msgs::msg::SafetyCarContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SafetyCarContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SafetyCarContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.h new file mode 100644 index 00000000000..cc1d65c03db --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.h @@ -0,0 +1,358 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SafetyCarContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_H_ + +#include "SpeedLimit.h" +#include "CauseCode.h" +#include "LightBarSirenInUse.h" +#include "TrafficRule.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SafetyCarContainer_SOURCE) +#define SafetyCarContainer_DllAPI __declspec( dllexport ) +#else +#define SafetyCarContainer_DllAPI __declspec( dllimport ) +#endif // SafetyCarContainer_SOURCE +#else +#define SafetyCarContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SafetyCarContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure SafetyCarContainer defined by the user in the IDL file. + * @ingroup SAFETYCARCONTAINER + */ + class SafetyCarContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SafetyCarContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SafetyCarContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. + */ + eProsima_user_DllExport SafetyCarContainer( + const SafetyCarContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. + */ + eProsima_user_DllExport SafetyCarContainer( + SafetyCarContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. + */ + eProsima_user_DllExport SafetyCarContainer& operator =( + const SafetyCarContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. + */ + eProsima_user_DllExport SafetyCarContainer& operator =( + SafetyCarContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SafetyCarContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SafetyCarContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SafetyCarContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SafetyCarContainer& x) const; + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + /*! + * @brief This function copies the value in member incident_indication + * @param _incident_indication New value to be copied in member incident_indication + */ + eProsima_user_DllExport void incident_indication( + const etsi_its_cam_msgs::msg::CauseCode& _incident_indication); + + /*! + * @brief This function moves the value in member incident_indication + * @param _incident_indication New value to be moved in member incident_indication + */ + eProsima_user_DllExport void incident_indication( + etsi_its_cam_msgs::msg::CauseCode&& _incident_indication); + + /*! + * @brief This function returns a constant reference to member incident_indication + * @return Constant reference to member incident_indication + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCode& incident_indication() const; + + /*! + * @brief This function returns a reference to member incident_indication + * @return Reference to member incident_indication + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCode& incident_indication(); + /*! + * @brief This function sets a value in member incident_indication_is_present + * @param _incident_indication_is_present New value for member incident_indication_is_present + */ + eProsima_user_DllExport void incident_indication_is_present( + bool _incident_indication_is_present); + + /*! + * @brief This function returns the value of member incident_indication_is_present + * @return Value of member incident_indication_is_present + */ + eProsima_user_DllExport bool incident_indication_is_present() const; + + /*! + * @brief This function returns a reference to member incident_indication_is_present + * @return Reference to member incident_indication_is_present + */ + eProsima_user_DllExport bool& incident_indication_is_present(); + + /*! + * @brief This function copies the value in member traffic_rule + * @param _traffic_rule New value to be copied in member traffic_rule + */ + eProsima_user_DllExport void traffic_rule( + const etsi_its_cam_msgs::msg::TrafficRule& _traffic_rule); + + /*! + * @brief This function moves the value in member traffic_rule + * @param _traffic_rule New value to be moved in member traffic_rule + */ + eProsima_user_DllExport void traffic_rule( + etsi_its_cam_msgs::msg::TrafficRule&& _traffic_rule); + + /*! + * @brief This function returns a constant reference to member traffic_rule + * @return Constant reference to member traffic_rule + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::TrafficRule& traffic_rule() const; + + /*! + * @brief This function returns a reference to member traffic_rule + * @return Reference to member traffic_rule + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::TrafficRule& traffic_rule(); + /*! + * @brief This function sets a value in member traffic_rule_is_present + * @param _traffic_rule_is_present New value for member traffic_rule_is_present + */ + eProsima_user_DllExport void traffic_rule_is_present( + bool _traffic_rule_is_present); + + /*! + * @brief This function returns the value of member traffic_rule_is_present + * @return Value of member traffic_rule_is_present + */ + eProsima_user_DllExport bool traffic_rule_is_present() const; + + /*! + * @brief This function returns a reference to member traffic_rule_is_present + * @return Reference to member traffic_rule_is_present + */ + eProsima_user_DllExport bool& traffic_rule_is_present(); + + /*! + * @brief This function copies the value in member speed_limit + * @param _speed_limit New value to be copied in member speed_limit + */ + eProsima_user_DllExport void speed_limit( + const etsi_its_cam_msgs::msg::SpeedLimit& _speed_limit); + + /*! + * @brief This function moves the value in member speed_limit + * @param _speed_limit New value to be moved in member speed_limit + */ + eProsima_user_DllExport void speed_limit( + etsi_its_cam_msgs::msg::SpeedLimit&& _speed_limit); + + /*! + * @brief This function returns a constant reference to member speed_limit + * @return Constant reference to member speed_limit + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedLimit& speed_limit() const; + + /*! + * @brief This function returns a reference to member speed_limit + * @return Reference to member speed_limit + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedLimit& speed_limit(); + /*! + * @brief This function sets a value in member speed_limit_is_present + * @param _speed_limit_is_present New value for member speed_limit_is_present + */ + eProsima_user_DllExport void speed_limit_is_present( + bool _speed_limit_is_present); + + /*! + * @brief This function returns the value of member speed_limit_is_present + * @return Value of member speed_limit_is_present + */ + eProsima_user_DllExport bool speed_limit_is_present() const; + + /*! + * @brief This function returns a reference to member speed_limit_is_present + * @return Reference to member speed_limit_is_present + */ + eProsima_user_DllExport bool& speed_limit_is_present(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SafetyCarContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + etsi_its_cam_msgs::msg::CauseCode m_incident_indication; + bool m_incident_indication_is_present; + etsi_its_cam_msgs::msg::TrafficRule m_traffic_rule; + bool m_traffic_rule_is_present; + etsi_its_cam_msgs::msg::SpeedLimit m_speed_limit; + bool m_speed_limit_is_present; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.cxx new file mode 100644 index 00000000000..1c39058a1b1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SafetyCarContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SafetyCarContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + SafetyCarContainerPubSubType::SafetyCarContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SafetyCarContainer_"); + auto type_size = SafetyCarContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SafetyCarContainer::isKeyDefined(); + size_t keyLength = SafetyCarContainer::getKeyMaxCdrSerializedSize() > 16 ? + SafetyCarContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SafetyCarContainerPubSubType::~SafetyCarContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SafetyCarContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SafetyCarContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SafetyCarContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SafetyCarContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SafetyCarContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SafetyCarContainerPubSubType::createData() + { + return reinterpret_cast(new SafetyCarContainer()); + } + + void SafetyCarContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SafetyCarContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SafetyCarContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SafetyCarContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SafetyCarContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.h new file mode 100644 index 00000000000..f0770ab0dcd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SafetyCarContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "SafetyCarContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SafetyCarContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type SafetyCarContainer defined by the user in the IDL file. + * @ingroup SAFETYCARCONTAINER + */ + class SafetyCarContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SafetyCarContainer type; + + eProsima_user_DllExport SafetyCarContainerPubSubType(); + + eProsima_user_DllExport virtual ~SafetyCarContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.cxx new file mode 100644 index 00000000000..4db3bb66bd7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SemiAxisLength.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SemiAxisLength.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::SemiAxisLength::SemiAxisLength() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@109d724c + m_value = 0; + +} + +etsi_its_cam_msgs::msg::SemiAxisLength::~SemiAxisLength() +{ +} + +etsi_its_cam_msgs::msg::SemiAxisLength::SemiAxisLength( + const SemiAxisLength& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SemiAxisLength::SemiAxisLength( + SemiAxisLength&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::SemiAxisLength::operator =( + const SemiAxisLength& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::SemiAxisLength::operator =( + SemiAxisLength&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SemiAxisLength::operator ==( + const SemiAxisLength& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::SemiAxisLength::operator !=( + const SemiAxisLength& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SemiAxisLength::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SemiAxisLength::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SemiAxisLength& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SemiAxisLength::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::SemiAxisLength::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::SemiAxisLength::value( + uint16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint16_t etsi_its_cam_msgs::msg::SemiAxisLength::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint16_t& etsi_its_cam_msgs::msg::SemiAxisLength::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::SemiAxisLength::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SemiAxisLength::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SemiAxisLength::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.h new file mode 100644 index 00000000000..42d59a56d62 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SemiAxisLength.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SemiAxisLength_SOURCE) +#define SemiAxisLength_DllAPI __declspec( dllexport ) +#else +#define SemiAxisLength_DllAPI __declspec( dllimport ) +#endif // SemiAxisLength_SOURCE +#else +#define SemiAxisLength_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SemiAxisLength_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SemiAxisLength_Constants { + const uint16_t MIN = 0; + const uint16_t MAX = 4095; + const uint16_t ONE_CENTIMETER = 1; + const uint16_t OUT_OF_RANGE = 4094; + const uint16_t UNAVAILABLE = 4095; + } // namespace SemiAxisLength_Constants + /*! + * @brief This class represents the structure SemiAxisLength defined by the user in the IDL file. + * @ingroup SEMIAXISLENGTH + */ + class SemiAxisLength + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SemiAxisLength(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SemiAxisLength(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. + */ + eProsima_user_DllExport SemiAxisLength( + const SemiAxisLength& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. + */ + eProsima_user_DllExport SemiAxisLength( + SemiAxisLength&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. + */ + eProsima_user_DllExport SemiAxisLength& operator =( + const SemiAxisLength& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. + */ + eProsima_user_DllExport SemiAxisLength& operator =( + SemiAxisLength&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SemiAxisLength object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SemiAxisLength& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SemiAxisLength object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SemiAxisLength& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SemiAxisLength& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.cxx new file mode 100644 index 00000000000..53e4abd9bab --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SemiAxisLengthPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SemiAxisLengthPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SemiAxisLength_Constants { + + + + + + + } //End of namespace SemiAxisLength_Constants + SemiAxisLengthPubSubType::SemiAxisLengthPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SemiAxisLength_"); + auto type_size = SemiAxisLength::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SemiAxisLength::isKeyDefined(); + size_t keyLength = SemiAxisLength::getKeyMaxCdrSerializedSize() > 16 ? + SemiAxisLength::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SemiAxisLengthPubSubType::~SemiAxisLengthPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SemiAxisLengthPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SemiAxisLength* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SemiAxisLengthPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SemiAxisLength* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SemiAxisLengthPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SemiAxisLengthPubSubType::createData() + { + return reinterpret_cast(new SemiAxisLength()); + } + + void SemiAxisLengthPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SemiAxisLengthPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SemiAxisLength* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SemiAxisLength::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SemiAxisLength::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.h new file mode 100644 index 00000000000..ecf8b8f362d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SemiAxisLengthPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_PUBSUBTYPES_H_ + +#include +#include + +#include "SemiAxisLength.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SemiAxisLength is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace SemiAxisLength_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type SemiAxisLength defined by the user in the IDL file. + * @ingroup SEMIAXISLENGTH + */ + class SemiAxisLengthPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SemiAxisLength type; + + eProsima_user_DllExport SemiAxisLengthPubSubType(); + + eProsima_user_DllExport virtual ~SemiAxisLengthPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SemiAxisLength(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.cxx new file mode 100644 index 00000000000..7c8f9ec8d9e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SpecialTransportContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::SpecialTransportContainer::SpecialTransportContainer() +{ + // m_special_transport_type com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@9bd0fa6 + + // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@59d2103b + + +} + +etsi_its_cam_msgs::msg::SpecialTransportContainer::~SpecialTransportContainer() +{ + +} + +etsi_its_cam_msgs::msg::SpecialTransportContainer::SpecialTransportContainer( + const SpecialTransportContainer& x) +{ + m_special_transport_type = x.m_special_transport_type; + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; +} + +etsi_its_cam_msgs::msg::SpecialTransportContainer::SpecialTransportContainer( + SpecialTransportContainer&& x) +{ + m_special_transport_type = std::move(x.m_special_transport_type); + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); +} + +etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg::SpecialTransportContainer::operator =( + const SpecialTransportContainer& x) +{ + + m_special_transport_type = x.m_special_transport_type; + m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; + + return *this; +} + +etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg::SpecialTransportContainer::operator =( + SpecialTransportContainer&& x) +{ + + m_special_transport_type = std::move(x.m_special_transport_type); + m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); + + return *this; +} + +bool etsi_its_cam_msgs::msg::SpecialTransportContainer::operator ==( + const SpecialTransportContainer& x) const +{ + + return (m_special_transport_type == x.m_special_transport_type && m_light_bar_siren_in_use == x.m_light_bar_siren_in_use); +} + +bool etsi_its_cam_msgs::msg::SpecialTransportContainer::operator !=( + const SpecialTransportContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SpecialTransportContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::SpecialTransportType::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SpecialTransportContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpecialTransportContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::SpecialTransportType::getCdrSerializedSize(data.special_transport_type(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SpecialTransportContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_special_transport_type; + scdr << m_light_bar_siren_in_use; + +} + +void etsi_its_cam_msgs::msg::SpecialTransportContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_special_transport_type; + dcdr >> m_light_bar_siren_in_use; +} + +/*! + * @brief This function copies the value in member special_transport_type + * @param _special_transport_type New value to be copied in member special_transport_type + */ +void etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type( + const etsi_its_cam_msgs::msg::SpecialTransportType& _special_transport_type) +{ + m_special_transport_type = _special_transport_type; +} + +/*! + * @brief This function moves the value in member special_transport_type + * @param _special_transport_type New value to be moved in member special_transport_type + */ +void etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type( + etsi_its_cam_msgs::msg::SpecialTransportType&& _special_transport_type) +{ + m_special_transport_type = std::move(_special_transport_type); +} + +/*! + * @brief This function returns a constant reference to member special_transport_type + * @return Constant reference to member special_transport_type + */ +const etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type() const +{ + return m_special_transport_type; +} + +/*! + * @brief This function returns a reference to member special_transport_type + * @return Reference to member special_transport_type + */ +etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type() +{ + return m_special_transport_type; +} +/*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = _light_bar_siren_in_use; +} + +/*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ +void etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) +{ + m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); +} + +/*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ +const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use() const +{ + return m_light_bar_siren_in_use; +} + +/*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ +etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use() +{ + return m_light_bar_siren_in_use; +} + +size_t etsi_its_cam_msgs::msg::SpecialTransportContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SpecialTransportContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SpecialTransportContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.h new file mode 100644 index 00000000000..33bd8613f87 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_H_ + +#include "SpecialTransportType.h" +#include "LightBarSirenInUse.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SpecialTransportContainer_SOURCE) +#define SpecialTransportContainer_DllAPI __declspec( dllexport ) +#else +#define SpecialTransportContainer_DllAPI __declspec( dllimport ) +#endif // SpecialTransportContainer_SOURCE +#else +#define SpecialTransportContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SpecialTransportContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure SpecialTransportContainer defined by the user in the IDL file. + * @ingroup SPECIALTRANSPORTCONTAINER + */ + class SpecialTransportContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpecialTransportContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpecialTransportContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. + */ + eProsima_user_DllExport SpecialTransportContainer( + const SpecialTransportContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. + */ + eProsima_user_DllExport SpecialTransportContainer( + SpecialTransportContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. + */ + eProsima_user_DllExport SpecialTransportContainer& operator =( + const SpecialTransportContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. + */ + eProsima_user_DllExport SpecialTransportContainer& operator =( + SpecialTransportContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialTransportContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpecialTransportContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialTransportContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpecialTransportContainer& x) const; + + /*! + * @brief This function copies the value in member special_transport_type + * @param _special_transport_type New value to be copied in member special_transport_type + */ + eProsima_user_DllExport void special_transport_type( + const etsi_its_cam_msgs::msg::SpecialTransportType& _special_transport_type); + + /*! + * @brief This function moves the value in member special_transport_type + * @param _special_transport_type New value to be moved in member special_transport_type + */ + eProsima_user_DllExport void special_transport_type( + etsi_its_cam_msgs::msg::SpecialTransportType&& _special_transport_type); + + /*! + * @brief This function returns a constant reference to member special_transport_type + * @return Constant reference to member special_transport_type + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialTransportType& special_transport_type() const; + + /*! + * @brief This function returns a reference to member special_transport_type + * @return Reference to member special_transport_type + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialTransportType& special_transport_type(); + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpecialTransportContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::SpecialTransportType m_special_transport_type; + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.cxx new file mode 100644 index 00000000000..2133fa070e7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SpecialTransportContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + SpecialTransportContainerPubSubType::SpecialTransportContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SpecialTransportContainer_"); + auto type_size = SpecialTransportContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SpecialTransportContainer::isKeyDefined(); + size_t keyLength = SpecialTransportContainer::getKeyMaxCdrSerializedSize() > 16 ? + SpecialTransportContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpecialTransportContainerPubSubType::~SpecialTransportContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpecialTransportContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SpecialTransportContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpecialTransportContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SpecialTransportContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpecialTransportContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpecialTransportContainerPubSubType::createData() + { + return reinterpret_cast(new SpecialTransportContainer()); + } + + void SpecialTransportContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpecialTransportContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SpecialTransportContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SpecialTransportContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SpecialTransportContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.h new file mode 100644 index 00000000000..b1b215b7ecb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "SpecialTransportContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SpecialTransportContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type SpecialTransportContainer defined by the user in the IDL file. + * @ingroup SPECIALTRANSPORTCONTAINER + */ + class SpecialTransportContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SpecialTransportContainer type; + + eProsima_user_DllExport SpecialTransportContainerPubSubType(); + + eProsima_user_DllExport virtual ~SpecialTransportContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.cxx new file mode 100644 index 00000000000..a78fde6112c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.cxx @@ -0,0 +1,252 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportType.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SpecialTransportType.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::SpecialTransportType::SpecialTransportType() +{ + // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@4ae33a11 + + // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7a48e6e2 + m_bits_unused = 0; + +} + +etsi_its_cam_msgs::msg::SpecialTransportType::~SpecialTransportType() +{ + +} + +etsi_its_cam_msgs::msg::SpecialTransportType::SpecialTransportType( + const SpecialTransportType& x) +{ + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::SpecialTransportType::SpecialTransportType( + SpecialTransportType&& x) +{ + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; +} + +etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::SpecialTransportType::operator =( + const SpecialTransportType& x) +{ + + m_value = x.m_value; + m_bits_unused = x.m_bits_unused; + + return *this; +} + +etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::SpecialTransportType::operator =( + SpecialTransportType&& x) +{ + + m_value = std::move(x.m_value); + m_bits_unused = x.m_bits_unused; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SpecialTransportType::operator ==( + const SpecialTransportType& x) const +{ + + return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); +} + +bool etsi_its_cam_msgs::msg::SpecialTransportType::operator !=( + const SpecialTransportType& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SpecialTransportType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SpecialTransportType::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpecialTransportType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.value().size() > 0) + { + current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SpecialTransportType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + scdr << m_bits_unused; + +} + +void etsi_its_cam_msgs::msg::SpecialTransportType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; + dcdr >> m_bits_unused; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void etsi_its_cam_msgs::msg::SpecialTransportType::value( + const std::vector& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void etsi_its_cam_msgs::msg::SpecialTransportType::value( + std::vector&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::vector& etsi_its_cam_msgs::msg::SpecialTransportType::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::vector& etsi_its_cam_msgs::msg::SpecialTransportType::value() +{ + return m_value; +} +/*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ +void etsi_its_cam_msgs::msg::SpecialTransportType::bits_unused( + uint8_t _bits_unused) +{ + m_bits_unused = _bits_unused; +} + +/*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ +uint8_t etsi_its_cam_msgs::msg::SpecialTransportType::bits_unused() const +{ + return m_bits_unused; +} + +/*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ +uint8_t& etsi_its_cam_msgs::msg::SpecialTransportType::bits_unused() +{ + return m_bits_unused; +} + + +size_t etsi_its_cam_msgs::msg::SpecialTransportType::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SpecialTransportType::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SpecialTransportType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.h new file mode 100644 index 00000000000..7782f292b84 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportType.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SpecialTransportType_SOURCE) +#define SpecialTransportType_DllAPI __declspec( dllexport ) +#else +#define SpecialTransportType_DllAPI __declspec( dllimport ) +#endif // SpecialTransportType_SOURCE +#else +#define SpecialTransportType_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SpecialTransportType_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpecialTransportType_Constants { + const uint8_t SIZE_BITS = 4; + const uint8_t BIT_INDEX_HEAVY_LOAD = 0; + const uint8_t BIT_INDEX_EXCESS_WIDTH = 1; + const uint8_t BIT_INDEX_EXCESS_LENGTH = 2; + const uint8_t BIT_INDEX_EXCESS_HEIGHT = 3; + } // namespace SpecialTransportType_Constants + /*! + * @brief This class represents the structure SpecialTransportType defined by the user in the IDL file. + * @ingroup SPECIALTRANSPORTTYPE + */ + class SpecialTransportType + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpecialTransportType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpecialTransportType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. + */ + eProsima_user_DllExport SpecialTransportType( + const SpecialTransportType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. + */ + eProsima_user_DllExport SpecialTransportType( + SpecialTransportType&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. + */ + eProsima_user_DllExport SpecialTransportType& operator =( + const SpecialTransportType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. + */ + eProsima_user_DllExport SpecialTransportType& operator =( + SpecialTransportType&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialTransportType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpecialTransportType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialTransportType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpecialTransportType& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpecialTransportType& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + std::vector m_value; + uint8_t m_bits_unused; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.cxx new file mode 100644 index 00000000000..4cf1d4b6bbb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportTypePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SpecialTransportTypePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpecialTransportType_Constants { + + + + + + + } //End of namespace SpecialTransportType_Constants + SpecialTransportTypePubSubType::SpecialTransportTypePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SpecialTransportType_"); + auto type_size = SpecialTransportType::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SpecialTransportType::isKeyDefined(); + size_t keyLength = SpecialTransportType::getKeyMaxCdrSerializedSize() > 16 ? + SpecialTransportType::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpecialTransportTypePubSubType::~SpecialTransportTypePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpecialTransportTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SpecialTransportType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpecialTransportTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SpecialTransportType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpecialTransportTypePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpecialTransportTypePubSubType::createData() + { + return reinterpret_cast(new SpecialTransportType()); + } + + void SpecialTransportTypePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpecialTransportTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SpecialTransportType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SpecialTransportType::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SpecialTransportType::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.h new file mode 100644 index 00000000000..4ba09070054 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportTypePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_PUBSUBTYPES_H_ + +#include +#include + +#include "SpecialTransportType.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SpecialTransportType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace SpecialTransportType_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type SpecialTransportType defined by the user in the IDL file. + * @ingroup SPECIALTRANSPORTTYPE + */ + class SpecialTransportTypePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SpecialTransportType type; + + eProsima_user_DllExport SpecialTransportTypePubSubType(); + + eProsima_user_DllExport virtual ~SpecialTransportTypePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.cxx new file mode 100644 index 00000000000..cfe1e0a9ecc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.cxx @@ -0,0 +1,529 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialVehicleContainer.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SpecialVehicleContainer.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + +etsi_its_cam_msgs::msg::SpecialVehicleContainer::SpecialVehicleContainer() +{ + // m_choice com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4275c20c + m_choice = 0; + // m_public_transport_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7c56e013 + + // m_special_transport_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3fc9dfc5 + + // m_dangerous_goods_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@40258c2f + + // m_road_works_container_basic com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2cac4385 + + // m_rescue_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6731787b + + // m_emergency_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@16f7b4af + + // m_safety_car_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7adf16aa + + +} + +etsi_its_cam_msgs::msg::SpecialVehicleContainer::~SpecialVehicleContainer() +{ + + + + + + + +} + +etsi_its_cam_msgs::msg::SpecialVehicleContainer::SpecialVehicleContainer( + const SpecialVehicleContainer& x) +{ + m_choice = x.m_choice; + m_public_transport_container = x.m_public_transport_container; + m_special_transport_container = x.m_special_transport_container; + m_dangerous_goods_container = x.m_dangerous_goods_container; + m_road_works_container_basic = x.m_road_works_container_basic; + m_rescue_container = x.m_rescue_container; + m_emergency_container = x.m_emergency_container; + m_safety_car_container = x.m_safety_car_container; +} + +etsi_its_cam_msgs::msg::SpecialVehicleContainer::SpecialVehicleContainer( + SpecialVehicleContainer&& x) +{ + m_choice = x.m_choice; + m_public_transport_container = std::move(x.m_public_transport_container); + m_special_transport_container = std::move(x.m_special_transport_container); + m_dangerous_goods_container = std::move(x.m_dangerous_goods_container); + m_road_works_container_basic = std::move(x.m_road_works_container_basic); + m_rescue_container = std::move(x.m_rescue_container); + m_emergency_container = std::move(x.m_emergency_container); + m_safety_car_container = std::move(x.m_safety_car_container); +} + +etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::operator =( + const SpecialVehicleContainer& x) +{ + + m_choice = x.m_choice; + m_public_transport_container = x.m_public_transport_container; + m_special_transport_container = x.m_special_transport_container; + m_dangerous_goods_container = x.m_dangerous_goods_container; + m_road_works_container_basic = x.m_road_works_container_basic; + m_rescue_container = x.m_rescue_container; + m_emergency_container = x.m_emergency_container; + m_safety_car_container = x.m_safety_car_container; + + return *this; +} + +etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::operator =( + SpecialVehicleContainer&& x) +{ + + m_choice = x.m_choice; + m_public_transport_container = std::move(x.m_public_transport_container); + m_special_transport_container = std::move(x.m_special_transport_container); + m_dangerous_goods_container = std::move(x.m_dangerous_goods_container); + m_road_works_container_basic = std::move(x.m_road_works_container_basic); + m_rescue_container = std::move(x.m_rescue_container); + m_emergency_container = std::move(x.m_emergency_container); + m_safety_car_container = std::move(x.m_safety_car_container); + + return *this; +} + +bool etsi_its_cam_msgs::msg::SpecialVehicleContainer::operator ==( + const SpecialVehicleContainer& x) const +{ + + return (m_choice == x.m_choice && m_public_transport_container == x.m_public_transport_container && m_special_transport_container == x.m_special_transport_container && m_dangerous_goods_container == x.m_dangerous_goods_container && m_road_works_container_basic == x.m_road_works_container_basic && m_rescue_container == x.m_rescue_container && m_emergency_container == x.m_emergency_container && m_safety_car_container == x.m_safety_car_container); +} + +bool etsi_its_cam_msgs::msg::SpecialVehicleContainer::operator !=( + const SpecialVehicleContainer& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::PublicTransportContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SpecialTransportContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::DangerousGoodsContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::RescueContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::EmergencyContainer::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SafetyCarContainer::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += etsi_its_cam_msgs::msg::PublicTransportContainer::getCdrSerializedSize(data.public_transport_container(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SpecialTransportContainer::getCdrSerializedSize(data.special_transport_container(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::DangerousGoodsContainer::getCdrSerializedSize(data.dangerous_goods_container(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getCdrSerializedSize(data.road_works_container_basic(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::RescueContainer::getCdrSerializedSize(data.rescue_container(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::EmergencyContainer::getCdrSerializedSize(data.emergency_container(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SafetyCarContainer::getCdrSerializedSize(data.safety_car_container(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_choice; + scdr << m_public_transport_container; + scdr << m_special_transport_container; + scdr << m_dangerous_goods_container; + scdr << m_road_works_container_basic; + scdr << m_rescue_container; + scdr << m_emergency_container; + scdr << m_safety_car_container; + +} + +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_choice; + dcdr >> m_public_transport_container; + dcdr >> m_special_transport_container; + dcdr >> m_dangerous_goods_container; + dcdr >> m_road_works_container_basic; + dcdr >> m_rescue_container; + dcdr >> m_emergency_container; + dcdr >> m_safety_car_container; +} + +/*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::choice( + uint8_t _choice) +{ + m_choice = _choice; +} + +/*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ +uint8_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::choice() const +{ + return m_choice; +} + +/*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ +uint8_t& etsi_its_cam_msgs::msg::SpecialVehicleContainer::choice() +{ + return m_choice; +} + +/*! + * @brief This function copies the value in member public_transport_container + * @param _public_transport_container New value to be copied in member public_transport_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container( + const etsi_its_cam_msgs::msg::PublicTransportContainer& _public_transport_container) +{ + m_public_transport_container = _public_transport_container; +} + +/*! + * @brief This function moves the value in member public_transport_container + * @param _public_transport_container New value to be moved in member public_transport_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container( + etsi_its_cam_msgs::msg::PublicTransportContainer&& _public_transport_container) +{ + m_public_transport_container = std::move(_public_transport_container); +} + +/*! + * @brief This function returns a constant reference to member public_transport_container + * @return Constant reference to member public_transport_container + */ +const etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container() const +{ + return m_public_transport_container; +} + +/*! + * @brief This function returns a reference to member public_transport_container + * @return Reference to member public_transport_container + */ +etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container() +{ + return m_public_transport_container; +} +/*! + * @brief This function copies the value in member special_transport_container + * @param _special_transport_container New value to be copied in member special_transport_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_container( + const etsi_its_cam_msgs::msg::SpecialTransportContainer& _special_transport_container) +{ + m_special_transport_container = _special_transport_container; +} + +/*! + * @brief This function moves the value in member special_transport_container + * @param _special_transport_container New value to be moved in member special_transport_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_container( + etsi_its_cam_msgs::msg::SpecialTransportContainer&& _special_transport_container) +{ + m_special_transport_container = std::move(_special_transport_container); +} + +/*! + * @brief This function returns a constant reference to member special_transport_container + * @return Constant reference to member special_transport_container + */ +const etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_container() const +{ + return m_special_transport_container; +} + +/*! + * @brief This function returns a reference to member special_transport_container + * @return Reference to member special_transport_container + */ +etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_container() +{ + return m_special_transport_container; +} +/*! + * @brief This function copies the value in member dangerous_goods_container + * @param _dangerous_goods_container New value to be copied in member dangerous_goods_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container( + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& _dangerous_goods_container) +{ + m_dangerous_goods_container = _dangerous_goods_container; +} + +/*! + * @brief This function moves the value in member dangerous_goods_container + * @param _dangerous_goods_container New value to be moved in member dangerous_goods_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container( + etsi_its_cam_msgs::msg::DangerousGoodsContainer&& _dangerous_goods_container) +{ + m_dangerous_goods_container = std::move(_dangerous_goods_container); +} + +/*! + * @brief This function returns a constant reference to member dangerous_goods_container + * @return Constant reference to member dangerous_goods_container + */ +const etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container() const +{ + return m_dangerous_goods_container; +} + +/*! + * @brief This function returns a reference to member dangerous_goods_container + * @return Reference to member dangerous_goods_container + */ +etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container() +{ + return m_dangerous_goods_container; +} +/*! + * @brief This function copies the value in member road_works_container_basic + * @param _road_works_container_basic New value to be copied in member road_works_container_basic + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic( + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& _road_works_container_basic) +{ + m_road_works_container_basic = _road_works_container_basic; +} + +/*! + * @brief This function moves the value in member road_works_container_basic + * @param _road_works_container_basic New value to be moved in member road_works_container_basic + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic( + etsi_its_cam_msgs::msg::RoadWorksContainerBasic&& _road_works_container_basic) +{ + m_road_works_container_basic = std::move(_road_works_container_basic); +} + +/*! + * @brief This function returns a constant reference to member road_works_container_basic + * @return Constant reference to member road_works_container_basic + */ +const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic() const +{ + return m_road_works_container_basic; +} + +/*! + * @brief This function returns a reference to member road_works_container_basic + * @return Reference to member road_works_container_basic + */ +etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic() +{ + return m_road_works_container_basic; +} +/*! + * @brief This function copies the value in member rescue_container + * @param _rescue_container New value to be copied in member rescue_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container( + const etsi_its_cam_msgs::msg::RescueContainer& _rescue_container) +{ + m_rescue_container = _rescue_container; +} + +/*! + * @brief This function moves the value in member rescue_container + * @param _rescue_container New value to be moved in member rescue_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container( + etsi_its_cam_msgs::msg::RescueContainer&& _rescue_container) +{ + m_rescue_container = std::move(_rescue_container); +} + +/*! + * @brief This function returns a constant reference to member rescue_container + * @return Constant reference to member rescue_container + */ +const etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container() const +{ + return m_rescue_container; +} + +/*! + * @brief This function returns a reference to member rescue_container + * @return Reference to member rescue_container + */ +etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container() +{ + return m_rescue_container; +} +/*! + * @brief This function copies the value in member emergency_container + * @param _emergency_container New value to be copied in member emergency_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container( + const etsi_its_cam_msgs::msg::EmergencyContainer& _emergency_container) +{ + m_emergency_container = _emergency_container; +} + +/*! + * @brief This function moves the value in member emergency_container + * @param _emergency_container New value to be moved in member emergency_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container( + etsi_its_cam_msgs::msg::EmergencyContainer&& _emergency_container) +{ + m_emergency_container = std::move(_emergency_container); +} + +/*! + * @brief This function returns a constant reference to member emergency_container + * @return Constant reference to member emergency_container + */ +const etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container() const +{ + return m_emergency_container; +} + +/*! + * @brief This function returns a reference to member emergency_container + * @return Reference to member emergency_container + */ +etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container() +{ + return m_emergency_container; +} +/*! + * @brief This function copies the value in member safety_car_container + * @param _safety_car_container New value to be copied in member safety_car_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container( + const etsi_its_cam_msgs::msg::SafetyCarContainer& _safety_car_container) +{ + m_safety_car_container = _safety_car_container; +} + +/*! + * @brief This function moves the value in member safety_car_container + * @param _safety_car_container New value to be moved in member safety_car_container + */ +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container( + etsi_its_cam_msgs::msg::SafetyCarContainer&& _safety_car_container) +{ + m_safety_car_container = std::move(_safety_car_container); +} + +/*! + * @brief This function returns a constant reference to member safety_car_container + * @return Constant reference to member safety_car_container + */ +const etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container() const +{ + return m_safety_car_container; +} + +/*! + * @brief This function returns a reference to member safety_car_container + * @return Reference to member safety_car_container + */ +etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container() +{ + return m_safety_car_container; +} + +size_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SpecialVehicleContainer::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SpecialVehicleContainer::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.h new file mode 100644 index 00000000000..7b23d3d8275 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.h @@ -0,0 +1,408 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialVehicleContainer.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_H_ + +#include "PublicTransportContainer.h" +#include "DangerousGoodsContainer.h" +#include "RescueContainer.h" +#include "EmergencyContainer.h" +#include "RoadWorksContainerBasic.h" +#include "SafetyCarContainer.h" +#include "SpecialTransportContainer.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SpecialVehicleContainer_SOURCE) +#define SpecialVehicleContainer_DllAPI __declspec( dllexport ) +#else +#define SpecialVehicleContainer_DllAPI __declspec( dllimport ) +#endif // SpecialVehicleContainer_SOURCE +#else +#define SpecialVehicleContainer_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SpecialVehicleContainer_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpecialVehicleContainer_Constants { + const uint8_t CHOICE_PUBLIC_TRANSPORT_CONTAINER = 0; + const uint8_t CHOICE_SPECIAL_TRANSPORT_CONTAINER = 1; + const uint8_t CHOICE_DANGEROUS_GOODS_CONTAINER = 2; + const uint8_t CHOICE_ROAD_WORKS_CONTAINER_BASIC = 3; + const uint8_t CHOICE_RESCUE_CONTAINER = 4; + const uint8_t CHOICE_EMERGENCY_CONTAINER = 5; + const uint8_t CHOICE_SAFETY_CAR_CONTAINER = 6; + } // namespace SpecialVehicleContainer_Constants + /*! + * @brief This class represents the structure SpecialVehicleContainer defined by the user in the IDL file. + * @ingroup SPECIALVEHICLECONTAINER + */ + class SpecialVehicleContainer + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpecialVehicleContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpecialVehicleContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. + */ + eProsima_user_DllExport SpecialVehicleContainer( + const SpecialVehicleContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. + */ + eProsima_user_DllExport SpecialVehicleContainer( + SpecialVehicleContainer&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. + */ + eProsima_user_DllExport SpecialVehicleContainer& operator =( + const SpecialVehicleContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. + */ + eProsima_user_DllExport SpecialVehicleContainer& operator =( + SpecialVehicleContainer&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialVehicleContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpecialVehicleContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialVehicleContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpecialVehicleContainer& x) const; + + /*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ + eProsima_user_DllExport void choice( + uint8_t _choice); + + /*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ + eProsima_user_DllExport uint8_t choice() const; + + /*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ + eProsima_user_DllExport uint8_t& choice(); + + /*! + * @brief This function copies the value in member public_transport_container + * @param _public_transport_container New value to be copied in member public_transport_container + */ + eProsima_user_DllExport void public_transport_container( + const etsi_its_cam_msgs::msg::PublicTransportContainer& _public_transport_container); + + /*! + * @brief This function moves the value in member public_transport_container + * @param _public_transport_container New value to be moved in member public_transport_container + */ + eProsima_user_DllExport void public_transport_container( + etsi_its_cam_msgs::msg::PublicTransportContainer&& _public_transport_container); + + /*! + * @brief This function returns a constant reference to member public_transport_container + * @return Constant reference to member public_transport_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PublicTransportContainer& public_transport_container() const; + + /*! + * @brief This function returns a reference to member public_transport_container + * @return Reference to member public_transport_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PublicTransportContainer& public_transport_container(); + /*! + * @brief This function copies the value in member special_transport_container + * @param _special_transport_container New value to be copied in member special_transport_container + */ + eProsima_user_DllExport void special_transport_container( + const etsi_its_cam_msgs::msg::SpecialTransportContainer& _special_transport_container); + + /*! + * @brief This function moves the value in member special_transport_container + * @param _special_transport_container New value to be moved in member special_transport_container + */ + eProsima_user_DllExport void special_transport_container( + etsi_its_cam_msgs::msg::SpecialTransportContainer&& _special_transport_container); + + /*! + * @brief This function returns a constant reference to member special_transport_container + * @return Constant reference to member special_transport_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialTransportContainer& special_transport_container() const; + + /*! + * @brief This function returns a reference to member special_transport_container + * @return Reference to member special_transport_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialTransportContainer& special_transport_container(); + /*! + * @brief This function copies the value in member dangerous_goods_container + * @param _dangerous_goods_container New value to be copied in member dangerous_goods_container + */ + eProsima_user_DllExport void dangerous_goods_container( + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& _dangerous_goods_container); + + /*! + * @brief This function moves the value in member dangerous_goods_container + * @param _dangerous_goods_container New value to be moved in member dangerous_goods_container + */ + eProsima_user_DllExport void dangerous_goods_container( + etsi_its_cam_msgs::msg::DangerousGoodsContainer&& _dangerous_goods_container); + + /*! + * @brief This function returns a constant reference to member dangerous_goods_container + * @return Constant reference to member dangerous_goods_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DangerousGoodsContainer& dangerous_goods_container() const; + + /*! + * @brief This function returns a reference to member dangerous_goods_container + * @return Reference to member dangerous_goods_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DangerousGoodsContainer& dangerous_goods_container(); + /*! + * @brief This function copies the value in member road_works_container_basic + * @param _road_works_container_basic New value to be copied in member road_works_container_basic + */ + eProsima_user_DllExport void road_works_container_basic( + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& _road_works_container_basic); + + /*! + * @brief This function moves the value in member road_works_container_basic + * @param _road_works_container_basic New value to be moved in member road_works_container_basic + */ + eProsima_user_DllExport void road_works_container_basic( + etsi_its_cam_msgs::msg::RoadWorksContainerBasic&& _road_works_container_basic); + + /*! + * @brief This function returns a constant reference to member road_works_container_basic + * @return Constant reference to member road_works_container_basic + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& road_works_container_basic() const; + + /*! + * @brief This function returns a reference to member road_works_container_basic + * @return Reference to member road_works_container_basic + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::RoadWorksContainerBasic& road_works_container_basic(); + /*! + * @brief This function copies the value in member rescue_container + * @param _rescue_container New value to be copied in member rescue_container + */ + eProsima_user_DllExport void rescue_container( + const etsi_its_cam_msgs::msg::RescueContainer& _rescue_container); + + /*! + * @brief This function moves the value in member rescue_container + * @param _rescue_container New value to be moved in member rescue_container + */ + eProsima_user_DllExport void rescue_container( + etsi_its_cam_msgs::msg::RescueContainer&& _rescue_container); + + /*! + * @brief This function returns a constant reference to member rescue_container + * @return Constant reference to member rescue_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::RescueContainer& rescue_container() const; + + /*! + * @brief This function returns a reference to member rescue_container + * @return Reference to member rescue_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::RescueContainer& rescue_container(); + /*! + * @brief This function copies the value in member emergency_container + * @param _emergency_container New value to be copied in member emergency_container + */ + eProsima_user_DllExport void emergency_container( + const etsi_its_cam_msgs::msg::EmergencyContainer& _emergency_container); + + /*! + * @brief This function moves the value in member emergency_container + * @param _emergency_container New value to be moved in member emergency_container + */ + eProsima_user_DllExport void emergency_container( + etsi_its_cam_msgs::msg::EmergencyContainer&& _emergency_container); + + /*! + * @brief This function returns a constant reference to member emergency_container + * @return Constant reference to member emergency_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmergencyContainer& emergency_container() const; + + /*! + * @brief This function returns a reference to member emergency_container + * @return Reference to member emergency_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::EmergencyContainer& emergency_container(); + /*! + * @brief This function copies the value in member safety_car_container + * @param _safety_car_container New value to be copied in member safety_car_container + */ + eProsima_user_DllExport void safety_car_container( + const etsi_its_cam_msgs::msg::SafetyCarContainer& _safety_car_container); + + /*! + * @brief This function moves the value in member safety_car_container + * @param _safety_car_container New value to be moved in member safety_car_container + */ + eProsima_user_DllExport void safety_car_container( + etsi_its_cam_msgs::msg::SafetyCarContainer&& _safety_car_container); + + /*! + * @brief This function returns a constant reference to member safety_car_container + * @return Constant reference to member safety_car_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SafetyCarContainer& safety_car_container() const; + + /*! + * @brief This function returns a reference to member safety_car_container + * @return Reference to member safety_car_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SafetyCarContainer& safety_car_container(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_choice; + etsi_its_cam_msgs::msg::PublicTransportContainer m_public_transport_container; + etsi_its_cam_msgs::msg::SpecialTransportContainer m_special_transport_container; + etsi_its_cam_msgs::msg::DangerousGoodsContainer m_dangerous_goods_container; + etsi_its_cam_msgs::msg::RoadWorksContainerBasic m_road_works_container_basic; + etsi_its_cam_msgs::msg::RescueContainer m_rescue_container; + etsi_its_cam_msgs::msg::EmergencyContainer m_emergency_container; + etsi_its_cam_msgs::msg::SafetyCarContainer m_safety_car_container; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.cxx new file mode 100644 index 00000000000..c341e7ee7ef --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.cxx @@ -0,0 +1,186 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialVehicleContainerPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SpecialVehicleContainerPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpecialVehicleContainer_Constants { + + + + + + + + + } //End of namespace SpecialVehicleContainer_Constants + SpecialVehicleContainerPubSubType::SpecialVehicleContainerPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SpecialVehicleContainer_"); + auto type_size = SpecialVehicleContainer::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SpecialVehicleContainer::isKeyDefined(); + size_t keyLength = SpecialVehicleContainer::getKeyMaxCdrSerializedSize() > 16 ? + SpecialVehicleContainer::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpecialVehicleContainerPubSubType::~SpecialVehicleContainerPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpecialVehicleContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SpecialVehicleContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpecialVehicleContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SpecialVehicleContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpecialVehicleContainerPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpecialVehicleContainerPubSubType::createData() + { + return reinterpret_cast(new SpecialVehicleContainer()); + } + + void SpecialVehicleContainerPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpecialVehicleContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SpecialVehicleContainer* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SpecialVehicleContainer::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SpecialVehicleContainer::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.h new file mode 100644 index 00000000000..b46bee1df9b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.h @@ -0,0 +1,117 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialVehicleContainerPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_PUBSUBTYPES_H_ + +#include +#include + +#include "SpecialVehicleContainer.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SpecialVehicleContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace SpecialVehicleContainer_Constants + { + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type SpecialVehicleContainer defined by the user in the IDL file. + * @ingroup SPECIALVEHICLECONTAINER + */ + class SpecialVehicleContainerPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SpecialVehicleContainer type; + + eProsima_user_DllExport SpecialVehicleContainerPubSubType(); + + eProsima_user_DllExport virtual ~SpecialVehicleContainerPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + (void)memory; + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.cxx new file mode 100644 index 00000000000..a7a292e82d2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Speed.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Speed.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::Speed::Speed() +{ + // m_speed_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1d3e6d34 + + // m_speed_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6eafb10e + + +} + +etsi_its_cam_msgs::msg::Speed::~Speed() +{ + +} + +etsi_its_cam_msgs::msg::Speed::Speed( + const Speed& x) +{ + m_speed_value = x.m_speed_value; + m_speed_confidence = x.m_speed_confidence; +} + +etsi_its_cam_msgs::msg::Speed::Speed( + Speed&& x) +{ + m_speed_value = std::move(x.m_speed_value); + m_speed_confidence = std::move(x.m_speed_confidence); +} + +etsi_its_cam_msgs::msg::Speed& etsi_its_cam_msgs::msg::Speed::operator =( + const Speed& x) +{ + + m_speed_value = x.m_speed_value; + m_speed_confidence = x.m_speed_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::Speed& etsi_its_cam_msgs::msg::Speed::operator =( + Speed&& x) +{ + + m_speed_value = std::move(x.m_speed_value); + m_speed_confidence = std::move(x.m_speed_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::Speed::operator ==( + const Speed& x) const +{ + + return (m_speed_value == x.m_speed_value && m_speed_confidence == x.m_speed_confidence); +} + +bool etsi_its_cam_msgs::msg::Speed::operator !=( + const Speed& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::Speed::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::SpeedValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SpeedConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::Speed::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Speed& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::SpeedValue::getCdrSerializedSize(data.speed_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SpeedConfidence::getCdrSerializedSize(data.speed_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::Speed::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_speed_value; + scdr << m_speed_confidence; + +} + +void etsi_its_cam_msgs::msg::Speed::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_speed_value; + dcdr >> m_speed_confidence; +} + +/*! + * @brief This function copies the value in member speed_value + * @param _speed_value New value to be copied in member speed_value + */ +void etsi_its_cam_msgs::msg::Speed::speed_value( + const etsi_its_cam_msgs::msg::SpeedValue& _speed_value) +{ + m_speed_value = _speed_value; +} + +/*! + * @brief This function moves the value in member speed_value + * @param _speed_value New value to be moved in member speed_value + */ +void etsi_its_cam_msgs::msg::Speed::speed_value( + etsi_its_cam_msgs::msg::SpeedValue&& _speed_value) +{ + m_speed_value = std::move(_speed_value); +} + +/*! + * @brief This function returns a constant reference to member speed_value + * @return Constant reference to member speed_value + */ +const etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::Speed::speed_value() const +{ + return m_speed_value; +} + +/*! + * @brief This function returns a reference to member speed_value + * @return Reference to member speed_value + */ +etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::Speed::speed_value() +{ + return m_speed_value; +} +/*! + * @brief This function copies the value in member speed_confidence + * @param _speed_confidence New value to be copied in member speed_confidence + */ +void etsi_its_cam_msgs::msg::Speed::speed_confidence( + const etsi_its_cam_msgs::msg::SpeedConfidence& _speed_confidence) +{ + m_speed_confidence = _speed_confidence; +} + +/*! + * @brief This function moves the value in member speed_confidence + * @param _speed_confidence New value to be moved in member speed_confidence + */ +void etsi_its_cam_msgs::msg::Speed::speed_confidence( + etsi_its_cam_msgs::msg::SpeedConfidence&& _speed_confidence) +{ + m_speed_confidence = std::move(_speed_confidence); +} + +/*! + * @brief This function returns a constant reference to member speed_confidence + * @return Constant reference to member speed_confidence + */ +const etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::Speed::speed_confidence() const +{ + return m_speed_confidence; +} + +/*! + * @brief This function returns a reference to member speed_confidence + * @return Reference to member speed_confidence + */ +etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::Speed::speed_confidence() +{ + return m_speed_confidence; +} + +size_t etsi_its_cam_msgs::msg::Speed::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::Speed::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::Speed::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.h new file mode 100644 index 00000000000..53db960580c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Speed.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_H_ + +#include "SpeedValue.h" +#include "SpeedConfidence.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Speed_SOURCE) +#define Speed_DllAPI __declspec( dllexport ) +#else +#define Speed_DllAPI __declspec( dllimport ) +#endif // Speed_SOURCE +#else +#define Speed_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Speed_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure Speed defined by the user in the IDL file. + * @ingroup SPEED + */ + class Speed + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Speed(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Speed(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. + */ + eProsima_user_DllExport Speed( + const Speed& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. + */ + eProsima_user_DllExport Speed( + Speed&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. + */ + eProsima_user_DllExport Speed& operator =( + const Speed& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. + */ + eProsima_user_DllExport Speed& operator =( + Speed&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Speed object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Speed& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Speed object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Speed& x) const; + + /*! + * @brief This function copies the value in member speed_value + * @param _speed_value New value to be copied in member speed_value + */ + eProsima_user_DllExport void speed_value( + const etsi_its_cam_msgs::msg::SpeedValue& _speed_value); + + /*! + * @brief This function moves the value in member speed_value + * @param _speed_value New value to be moved in member speed_value + */ + eProsima_user_DllExport void speed_value( + etsi_its_cam_msgs::msg::SpeedValue&& _speed_value); + + /*! + * @brief This function returns a constant reference to member speed_value + * @return Constant reference to member speed_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedValue& speed_value() const; + + /*! + * @brief This function returns a reference to member speed_value + * @return Reference to member speed_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedValue& speed_value(); + /*! + * @brief This function copies the value in member speed_confidence + * @param _speed_confidence New value to be copied in member speed_confidence + */ + eProsima_user_DllExport void speed_confidence( + const etsi_its_cam_msgs::msg::SpeedConfidence& _speed_confidence); + + /*! + * @brief This function moves the value in member speed_confidence + * @param _speed_confidence New value to be moved in member speed_confidence + */ + eProsima_user_DllExport void speed_confidence( + etsi_its_cam_msgs::msg::SpeedConfidence&& _speed_confidence); + + /*! + * @brief This function returns a constant reference to member speed_confidence + * @return Constant reference to member speed_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedConfidence& speed_confidence() const; + + /*! + * @brief This function returns a reference to member speed_confidence + * @return Reference to member speed_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedConfidence& speed_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::Speed& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::SpeedValue m_speed_value; + etsi_its_cam_msgs::msg::SpeedConfidence m_speed_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.cxx new file mode 100644 index 00000000000..936602ff0d3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.cxx @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedConfidence.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SpeedConfidence.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + +etsi_its_cam_msgs::msg::SpeedConfidence::SpeedConfidence() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@bcb09a6 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::SpeedConfidence::~SpeedConfidence() +{ +} + +etsi_its_cam_msgs::msg::SpeedConfidence::SpeedConfidence( + const SpeedConfidence& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SpeedConfidence::SpeedConfidence( + SpeedConfidence&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::SpeedConfidence::operator =( + const SpeedConfidence& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::SpeedConfidence::operator =( + SpeedConfidence&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SpeedConfidence::operator ==( + const SpeedConfidence& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::SpeedConfidence::operator !=( + const SpeedConfidence& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SpeedConfidence::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SpeedConfidence::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpeedConfidence& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SpeedConfidence::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::SpeedConfidence::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::SpeedConfidence::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::SpeedConfidence::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::SpeedConfidence::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::SpeedConfidence::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SpeedConfidence::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SpeedConfidence::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.h new file mode 100644 index 00000000000..1f88c66aecf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.h @@ -0,0 +1,218 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedConfidence.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SpeedConfidence_SOURCE) +#define SpeedConfidence_DllAPI __declspec( dllexport ) +#else +#define SpeedConfidence_DllAPI __declspec( dllimport ) +#endif // SpeedConfidence_SOURCE +#else +#define SpeedConfidence_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SpeedConfidence_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpeedConfidence_Constants { + const uint8_t MIN = 1; + const uint8_t MAX = 127; + const uint8_t EQUAL_OR_WITHIN_ONE_CENTIMETER_PER_SEC = 1; + const uint8_t EQUAL_OR_WITHIN_ONE_METER_PER_SEC = 100; + const uint8_t OUT_OF_RANGE = 126; + const uint8_t UNAVAILABLE = 127; + } // namespace SpeedConfidence_Constants + /*! + * @brief This class represents the structure SpeedConfidence defined by the user in the IDL file. + * @ingroup SPEEDCONFIDENCE + */ + class SpeedConfidence + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpeedConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpeedConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. + */ + eProsima_user_DllExport SpeedConfidence( + const SpeedConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. + */ + eProsima_user_DllExport SpeedConfidence( + SpeedConfidence&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. + */ + eProsima_user_DllExport SpeedConfidence& operator =( + const SpeedConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. + */ + eProsima_user_DllExport SpeedConfidence& operator =( + SpeedConfidence&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpeedConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpeedConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpeedConfidence& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.cxx new file mode 100644 index 00000000000..117c751390b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.cxx @@ -0,0 +1,185 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedConfidencePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SpeedConfidencePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpeedConfidence_Constants { + + + + + + + + } //End of namespace SpeedConfidence_Constants + SpeedConfidencePubSubType::SpeedConfidencePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SpeedConfidence_"); + auto type_size = SpeedConfidence::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SpeedConfidence::isKeyDefined(); + size_t keyLength = SpeedConfidence::getKeyMaxCdrSerializedSize() > 16 ? + SpeedConfidence::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpeedConfidencePubSubType::~SpeedConfidencePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpeedConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SpeedConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpeedConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SpeedConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpeedConfidencePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpeedConfidencePubSubType::createData() + { + return reinterpret_cast(new SpeedConfidence()); + } + + void SpeedConfidencePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpeedConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SpeedConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SpeedConfidence::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SpeedConfidence::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.h new file mode 100644 index 00000000000..0590ba645fd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.h @@ -0,0 +1,116 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedConfidencePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_PUBSUBTYPES_H_ + +#include +#include + +#include "SpeedConfidence.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SpeedConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace SpeedConfidence_Constants + { + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type SpeedConfidence defined by the user in the IDL file. + * @ingroup SPEEDCONFIDENCE + */ + class SpeedConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SpeedConfidence type; + + eProsima_user_DllExport SpeedConfidencePubSubType(); + + eProsima_user_DllExport virtual ~SpeedConfidencePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SpeedConfidence(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.cxx new file mode 100644 index 00000000000..da0805886c4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.cxx @@ -0,0 +1,187 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedLimit.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SpeedLimit.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + +etsi_its_cam_msgs::msg::SpeedLimit::SpeedLimit() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fd4acee + m_value = 0; + +} + +etsi_its_cam_msgs::msg::SpeedLimit::~SpeedLimit() +{ +} + +etsi_its_cam_msgs::msg::SpeedLimit::SpeedLimit( + const SpeedLimit& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SpeedLimit::SpeedLimit( + SpeedLimit&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SpeedLimit::operator =( + const SpeedLimit& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SpeedLimit::operator =( + SpeedLimit&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SpeedLimit::operator ==( + const SpeedLimit& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::SpeedLimit::operator !=( + const SpeedLimit& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SpeedLimit::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SpeedLimit::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpeedLimit& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SpeedLimit::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::SpeedLimit::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::SpeedLimit::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::SpeedLimit::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::SpeedLimit::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::SpeedLimit::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SpeedLimit::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SpeedLimit::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.h new file mode 100644 index 00000000000..4ec5893b373 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedLimit.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SpeedLimit_SOURCE) +#define SpeedLimit_DllAPI __declspec( dllexport ) +#else +#define SpeedLimit_DllAPI __declspec( dllimport ) +#endif // SpeedLimit_SOURCE +#else +#define SpeedLimit_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SpeedLimit_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpeedLimit_Constants { + const uint8_t MIN = 1; + const uint8_t MAX = 255; + const uint8_t ONE_KM_PER_HOUR = 1; + } // namespace SpeedLimit_Constants + /*! + * @brief This class represents the structure SpeedLimit defined by the user in the IDL file. + * @ingroup SPEEDLIMIT + */ + class SpeedLimit + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpeedLimit(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpeedLimit(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. + */ + eProsima_user_DllExport SpeedLimit( + const SpeedLimit& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. + */ + eProsima_user_DllExport SpeedLimit( + SpeedLimit&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. + */ + eProsima_user_DllExport SpeedLimit& operator =( + const SpeedLimit& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. + */ + eProsima_user_DllExport SpeedLimit& operator =( + SpeedLimit&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedLimit object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpeedLimit& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedLimit object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpeedLimit& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpeedLimit& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.cxx new file mode 100644 index 00000000000..643f1e77dd1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.cxx @@ -0,0 +1,182 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedLimitPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SpeedLimitPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpeedLimit_Constants { + + + + + } //End of namespace SpeedLimit_Constants + SpeedLimitPubSubType::SpeedLimitPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SpeedLimit_"); + auto type_size = SpeedLimit::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SpeedLimit::isKeyDefined(); + size_t keyLength = SpeedLimit::getKeyMaxCdrSerializedSize() > 16 ? + SpeedLimit::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpeedLimitPubSubType::~SpeedLimitPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpeedLimitPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SpeedLimit* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpeedLimitPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SpeedLimit* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpeedLimitPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpeedLimitPubSubType::createData() + { + return reinterpret_cast(new SpeedLimit()); + } + + void SpeedLimitPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpeedLimitPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SpeedLimit* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SpeedLimit::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SpeedLimit::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/types/CameraInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.h similarity index 75% rename from LibCarla/source/carla/ros2/types/CameraInfoPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.h index fe7764ab98e..4e22177920d 100644 --- a/LibCarla/source/carla/ros2/types/CameraInfoPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.h @@ -13,45 +13,49 @@ // limitations under the License. /*! - * @file CameraInfoPubSubTypes.h + * @file SpeedLimitPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_PUBSUBTYPES_H_ #include #include -#include "CameraInfo.h" - -#include "RegionOfInterestPubSubTypes.h" -#include "HeaderPubSubTypes.h" +#include "SpeedLimit.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated CameraInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated SpeedLimit is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace sensor_msgs +namespace etsi_its_cam_msgs { namespace msg { + namespace SpeedLimit_Constants + { + + + + } /*! - * @brief This class represents the TopicDataType of the type CameraInfo defined by the user in the IDL file. - * @ingroup CameraInfo + * @brief This class represents the TopicDataType of the type SpeedLimit defined by the user in the IDL file. + * @ingroup SPEEDLIMIT */ - class CameraInfoPubSubType : public eprosima::fastdds::dds::TopicDataType + class SpeedLimitPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef CameraInfo type; + typedef SpeedLimit type; - eProsima_user_DllExport CameraInfoPubSubType(); + eProsima_user_DllExport SpeedLimitPubSubType(); - eProsima_user_DllExport virtual ~CameraInfoPubSubType() override; + eProsima_user_DllExport virtual ~SpeedLimitPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -77,7 +81,7 @@ namespace sensor_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -85,7 +89,7 @@ namespace sensor_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -94,15 +98,16 @@ namespace sensor_msgs eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; - return false; + new (memory) SpeedLimit(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.cxx new file mode 100644 index 00000000000..2dc44d40b17 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SpeedPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + SpeedPubSubType::SpeedPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::Speed_"); + auto type_size = Speed::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Speed::isKeyDefined(); + size_t keyLength = Speed::getKeyMaxCdrSerializedSize() > 16 ? + Speed::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpeedPubSubType::~SpeedPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpeedPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Speed* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpeedPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Speed* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpeedPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpeedPubSubType::createData() + { + return reinterpret_cast(new Speed()); + } + + void SpeedPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpeedPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Speed* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Speed::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Speed::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.h new file mode 100644 index 00000000000..14bab114d7e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_PUBSUBTYPES_H_ + +#include +#include + +#include "Speed.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated Speed is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type Speed defined by the user in the IDL file. + * @ingroup SPEED + */ + class SpeedPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Speed type; + + eProsima_user_DllExport SpeedPubSubType(); + + eProsima_user_DllExport virtual ~SpeedPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Speed(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.cxx new file mode 100644 index 00000000000..a1fbb345de5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SpeedValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::SpeedValue::SpeedValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@41477a6d + m_value = 0; + +} + +etsi_its_cam_msgs::msg::SpeedValue::~SpeedValue() +{ +} + +etsi_its_cam_msgs::msg::SpeedValue::SpeedValue( + const SpeedValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SpeedValue::SpeedValue( + SpeedValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::SpeedValue::operator =( + const SpeedValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::SpeedValue::operator =( + SpeedValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SpeedValue::operator ==( + const SpeedValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::SpeedValue::operator !=( + const SpeedValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SpeedValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SpeedValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpeedValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SpeedValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::SpeedValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::SpeedValue::value( + uint16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint16_t etsi_its_cam_msgs::msg::SpeedValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint16_t& etsi_its_cam_msgs::msg::SpeedValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::SpeedValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SpeedValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SpeedValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.h new file mode 100644 index 00000000000..34951129a8d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SpeedValue_SOURCE) +#define SpeedValue_DllAPI __declspec( dllexport ) +#else +#define SpeedValue_DllAPI __declspec( dllimport ) +#endif // SpeedValue_SOURCE +#else +#define SpeedValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SpeedValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpeedValue_Constants { + const uint16_t MIN = 0; + const uint16_t MAX = 16383; + const uint16_t STANDSTILL = 0; + const uint16_t ONE_CENTIMETER_PER_SEC = 1; + const uint16_t UNAVAILABLE = 16383; + } // namespace SpeedValue_Constants + /*! + * @brief This class represents the structure SpeedValue defined by the user in the IDL file. + * @ingroup SPEEDVALUE + */ + class SpeedValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpeedValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpeedValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. + */ + eProsima_user_DllExport SpeedValue( + const SpeedValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. + */ + eProsima_user_DllExport SpeedValue( + SpeedValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. + */ + eProsima_user_DllExport SpeedValue& operator =( + const SpeedValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. + */ + eProsima_user_DllExport SpeedValue& operator =( + SpeedValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpeedValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpeedValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SpeedValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.cxx new file mode 100644 index 00000000000..13b08fc8e7e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SpeedValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SpeedValue_Constants { + + + + + + + } //End of namespace SpeedValue_Constants + SpeedValuePubSubType::SpeedValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SpeedValue_"); + auto type_size = SpeedValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SpeedValue::isKeyDefined(); + size_t keyLength = SpeedValue::getKeyMaxCdrSerializedSize() > 16 ? + SpeedValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SpeedValuePubSubType::~SpeedValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SpeedValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SpeedValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SpeedValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SpeedValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SpeedValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SpeedValuePubSubType::createData() + { + return reinterpret_cast(new SpeedValue()); + } + + void SpeedValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SpeedValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SpeedValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SpeedValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SpeedValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.h new file mode 100644 index 00000000000..9d5ee7fb807 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "SpeedValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SpeedValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace SpeedValue_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type SpeedValue defined by the user in the IDL file. + * @ingroup SPEEDVALUE + */ + class SpeedValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SpeedValue type; + + eProsima_user_DllExport SpeedValuePubSubType(); + + eProsima_user_DllExport virtual ~SpeedValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SpeedValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.cxx new file mode 100644 index 00000000000..1aacaed0d10 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.cxx @@ -0,0 +1,186 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationID.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "StationID.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::StationID::StationID() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e6d5d29 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::StationID::~StationID() +{ +} + +etsi_its_cam_msgs::msg::StationID::StationID( + const StationID& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::StationID::StationID( + StationID&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::StationID::operator =( + const StationID& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::StationID::operator =( + StationID&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::StationID::operator ==( + const StationID& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::StationID::operator !=( + const StationID& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::StationID::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::StationID::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::StationID& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::StationID::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::StationID::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::StationID::value( + uint32_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint32_t etsi_its_cam_msgs::msg::StationID::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint32_t& etsi_its_cam_msgs::msg::StationID::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::StationID::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::StationID::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::StationID::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.h new file mode 100644 index 00000000000..101b07253f0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.h @@ -0,0 +1,214 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationID.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(StationID_SOURCE) +#define StationID_DllAPI __declspec( dllexport ) +#else +#define StationID_DllAPI __declspec( dllimport ) +#endif // StationID_SOURCE +#else +#define StationID_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define StationID_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace StationID_Constants { + const uint32_t MIN = 0; + const uint32_t MAX = 4294967295; + } // namespace StationID_Constants + /*! + * @brief This class represents the structure StationID defined by the user in the IDL file. + * @ingroup STATIONID + */ + class StationID + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StationID(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StationID(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. + */ + eProsima_user_DllExport StationID( + const StationID& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. + */ + eProsima_user_DllExport StationID( + StationID&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. + */ + eProsima_user_DllExport StationID& operator =( + const StationID& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. + */ + eProsima_user_DllExport StationID& operator =( + StationID&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::StationID object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StationID& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::StationID object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StationID& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint32_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::StationID& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint32_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.cxx new file mode 100644 index 00000000000..d501c2176e5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationIDPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "StationIDPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace StationID_Constants { + + + + } //End of namespace StationID_Constants + StationIDPubSubType::StationIDPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::StationID_"); + auto type_size = StationID::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = StationID::isKeyDefined(); + size_t keyLength = StationID::getKeyMaxCdrSerializedSize() > 16 ? + StationID::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + StationIDPubSubType::~StationIDPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool StationIDPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + StationID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool StationIDPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + StationID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function StationIDPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* StationIDPubSubType::createData() + { + return reinterpret_cast(new StationID()); + } + + void StationIDPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool StationIDPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + StationID* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + StationID::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || StationID::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.h new file mode 100644 index 00000000000..90a59a096d4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.h @@ -0,0 +1,112 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationIDPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_PUBSUBTYPES_H_ + +#include +#include + +#include "StationID.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated StationID is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace StationID_Constants + { + + + } + /*! + * @brief This class represents the TopicDataType of the type StationID defined by the user in the IDL file. + * @ingroup STATIONID + */ + class StationIDPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef StationID type; + + eProsima_user_DllExport StationIDPubSubType(); + + eProsima_user_DllExport virtual ~StationIDPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) StationID(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.cxx new file mode 100644 index 00000000000..ada976c13a0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.cxx @@ -0,0 +1,199 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationType.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "StationType.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + + +etsi_its_cam_msgs::msg::StationType::StationType() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4632cfc + m_value = 0; + +} + +etsi_its_cam_msgs::msg::StationType::~StationType() +{ +} + +etsi_its_cam_msgs::msg::StationType::StationType( + const StationType& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::StationType::StationType( + StationType&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::StationType::operator =( + const StationType& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::StationType::operator =( + StationType&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::StationType::operator ==( + const StationType& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::StationType::operator !=( + const StationType& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::StationType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::StationType::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::StationType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::StationType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::StationType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::StationType::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::StationType::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::StationType::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::StationType::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::StationType::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::StationType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.h new file mode 100644 index 00000000000..05d0439663e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.h @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationType.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(StationType_SOURCE) +#define StationType_DllAPI __declspec( dllexport ) +#else +#define StationType_DllAPI __declspec( dllimport ) +#endif // StationType_SOURCE +#else +#define StationType_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define StationType_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace StationType_Constants { + const uint8_t MIN = 0; + const uint8_t MAX = 255; + const uint8_t UNKNOWN = 0; + const uint8_t PEDESTRIAN = 1; + const uint8_t CYCLIST = 2; + const uint8_t MOPED = 3; + const uint8_t MOTORCYCLE = 4; + const uint8_t PASSENGER_CAR = 5; + const uint8_t BUS = 6; + const uint8_t LIGHT_TRUCK = 7; + const uint8_t HEAVY_TRUCK = 8; + const uint8_t TRAILER = 9; + const uint8_t SPECIAL_VEHICLES = 10; + const uint8_t TRAM = 11; + const uint8_t ROAD_SIDE_UNIT = 15; + } // namespace StationType_Constants + /*! + * @brief This class represents the structure StationType defined by the user in the IDL file. + * @ingroup STATIONTYPE + */ + class StationType + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StationType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StationType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. + */ + eProsima_user_DllExport StationType( + const StationType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. + */ + eProsima_user_DllExport StationType( + StationType&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. + */ + eProsima_user_DllExport StationType& operator =( + const StationType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. + */ + eProsima_user_DllExport StationType& operator =( + StationType&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::StationType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StationType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::StationType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StationType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::StationType& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.cxx new file mode 100644 index 00000000000..9efeedb04cd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.cxx @@ -0,0 +1,194 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationTypePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "StationTypePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace StationType_Constants { + + + + + + + + + + + + + + + + + } //End of namespace StationType_Constants + StationTypePubSubType::StationTypePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::StationType_"); + auto type_size = StationType::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = StationType::isKeyDefined(); + size_t keyLength = StationType::getKeyMaxCdrSerializedSize() > 16 ? + StationType::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + StationTypePubSubType::~StationTypePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool StationTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + StationType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool StationTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + StationType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function StationTypePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* StationTypePubSubType::createData() + { + return reinterpret_cast(new StationType()); + } + + void StationTypePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool StationTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + StationType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + StationType::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || StationType::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.h new file mode 100644 index 00000000000..df1af41207c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.h @@ -0,0 +1,125 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationTypePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_PUBSUBTYPES_H_ + +#include +#include + +#include "StationType.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated StationType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace StationType_Constants + { + + + + + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type StationType defined by the user in the IDL file. + * @ingroup STATIONTYPE + */ + class StationTypePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef StationType type; + + eProsima_user_DllExport StationTypePubSubType(); + + eProsima_user_DllExport virtual ~StationTypePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) StationType(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.cxx new file mode 100644 index 00000000000..59e0e867a0d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngle.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SteeringWheelAngle.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::SteeringWheelAngle::SteeringWheelAngle() +{ + // m_steering_wheel_angle_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@89c65d5 + + // m_steering_wheel_angle_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@faa3fed + + +} + +etsi_its_cam_msgs::msg::SteeringWheelAngle::~SteeringWheelAngle() +{ + +} + +etsi_its_cam_msgs::msg::SteeringWheelAngle::SteeringWheelAngle( + const SteeringWheelAngle& x) +{ + m_steering_wheel_angle_value = x.m_steering_wheel_angle_value; + m_steering_wheel_angle_confidence = x.m_steering_wheel_angle_confidence; +} + +etsi_its_cam_msgs::msg::SteeringWheelAngle::SteeringWheelAngle( + SteeringWheelAngle&& x) +{ + m_steering_wheel_angle_value = std::move(x.m_steering_wheel_angle_value); + m_steering_wheel_angle_confidence = std::move(x.m_steering_wheel_angle_confidence); +} + +etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::SteeringWheelAngle::operator =( + const SteeringWheelAngle& x) +{ + + m_steering_wheel_angle_value = x.m_steering_wheel_angle_value; + m_steering_wheel_angle_confidence = x.m_steering_wheel_angle_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::SteeringWheelAngle::operator =( + SteeringWheelAngle&& x) +{ + + m_steering_wheel_angle_value = std::move(x.m_steering_wheel_angle_value); + m_steering_wheel_angle_confidence = std::move(x.m_steering_wheel_angle_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngle::operator ==( + const SteeringWheelAngle& x) const +{ + + return (m_steering_wheel_angle_value == x.m_steering_wheel_angle_value && m_steering_wheel_angle_confidence == x.m_steering_wheel_angle_confidence); +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngle::operator !=( + const SteeringWheelAngle& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngle::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngle::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SteeringWheelAngle& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getCdrSerializedSize(data.steering_wheel_angle_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getCdrSerializedSize(data.steering_wheel_angle_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngle::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_steering_wheel_angle_value; + scdr << m_steering_wheel_angle_confidence; + +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngle::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_steering_wheel_angle_value; + dcdr >> m_steering_wheel_angle_confidence; +} + +/*! + * @brief This function copies the value in member steering_wheel_angle_value + * @param _steering_wheel_angle_value New value to be copied in member steering_wheel_angle_value + */ +void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value( + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& _steering_wheel_angle_value) +{ + m_steering_wheel_angle_value = _steering_wheel_angle_value; +} + +/*! + * @brief This function moves the value in member steering_wheel_angle_value + * @param _steering_wheel_angle_value New value to be moved in member steering_wheel_angle_value + */ +void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value( + etsi_its_cam_msgs::msg::SteeringWheelAngleValue&& _steering_wheel_angle_value) +{ + m_steering_wheel_angle_value = std::move(_steering_wheel_angle_value); +} + +/*! + * @brief This function returns a constant reference to member steering_wheel_angle_value + * @return Constant reference to member steering_wheel_angle_value + */ +const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value() const +{ + return m_steering_wheel_angle_value; +} + +/*! + * @brief This function returns a reference to member steering_wheel_angle_value + * @return Reference to member steering_wheel_angle_value + */ +etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value() +{ + return m_steering_wheel_angle_value; +} +/*! + * @brief This function copies the value in member steering_wheel_angle_confidence + * @param _steering_wheel_angle_confidence New value to be copied in member steering_wheel_angle_confidence + */ +void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence( + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& _steering_wheel_angle_confidence) +{ + m_steering_wheel_angle_confidence = _steering_wheel_angle_confidence; +} + +/*! + * @brief This function moves the value in member steering_wheel_angle_confidence + * @param _steering_wheel_angle_confidence New value to be moved in member steering_wheel_angle_confidence + */ +void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence( + etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence&& _steering_wheel_angle_confidence) +{ + m_steering_wheel_angle_confidence = std::move(_steering_wheel_angle_confidence); +} + +/*! + * @brief This function returns a constant reference to member steering_wheel_angle_confidence + * @return Constant reference to member steering_wheel_angle_confidence + */ +const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence() const +{ + return m_steering_wheel_angle_confidence; +} + +/*! + * @brief This function returns a reference to member steering_wheel_angle_confidence + * @return Reference to member steering_wheel_angle_confidence + */ +etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence() +{ + return m_steering_wheel_angle_confidence; +} + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngle::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngle::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngle::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.h new file mode 100644 index 00000000000..6287e887d4b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngle.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_H_ + +#include "SteeringWheelAngleConfidence.h" +#include "SteeringWheelAngleValue.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SteeringWheelAngle_SOURCE) +#define SteeringWheelAngle_DllAPI __declspec( dllexport ) +#else +#define SteeringWheelAngle_DllAPI __declspec( dllimport ) +#endif // SteeringWheelAngle_SOURCE +#else +#define SteeringWheelAngle_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SteeringWheelAngle_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure SteeringWheelAngle defined by the user in the IDL file. + * @ingroup STEERINGWHEELANGLE + */ + class SteeringWheelAngle + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SteeringWheelAngle(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SteeringWheelAngle(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngle( + const SteeringWheelAngle& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngle( + SteeringWheelAngle&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngle& operator =( + const SteeringWheelAngle& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngle& operator =( + SteeringWheelAngle&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngle object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SteeringWheelAngle& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngle object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SteeringWheelAngle& x) const; + + /*! + * @brief This function copies the value in member steering_wheel_angle_value + * @param _steering_wheel_angle_value New value to be copied in member steering_wheel_angle_value + */ + eProsima_user_DllExport void steering_wheel_angle_value( + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& _steering_wheel_angle_value); + + /*! + * @brief This function moves the value in member steering_wheel_angle_value + * @param _steering_wheel_angle_value New value to be moved in member steering_wheel_angle_value + */ + eProsima_user_DllExport void steering_wheel_angle_value( + etsi_its_cam_msgs::msg::SteeringWheelAngleValue&& _steering_wheel_angle_value); + + /*! + * @brief This function returns a constant reference to member steering_wheel_angle_value + * @return Constant reference to member steering_wheel_angle_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& steering_wheel_angle_value() const; + + /*! + * @brief This function returns a reference to member steering_wheel_angle_value + * @return Reference to member steering_wheel_angle_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngleValue& steering_wheel_angle_value(); + /*! + * @brief This function copies the value in member steering_wheel_angle_confidence + * @param _steering_wheel_angle_confidence New value to be copied in member steering_wheel_angle_confidence + */ + eProsima_user_DllExport void steering_wheel_angle_confidence( + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& _steering_wheel_angle_confidence); + + /*! + * @brief This function moves the value in member steering_wheel_angle_confidence + * @param _steering_wheel_angle_confidence New value to be moved in member steering_wheel_angle_confidence + */ + eProsima_user_DllExport void steering_wheel_angle_confidence( + etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence&& _steering_wheel_angle_confidence); + + /*! + * @brief This function returns a constant reference to member steering_wheel_angle_confidence + * @return Constant reference to member steering_wheel_angle_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& steering_wheel_angle_confidence() const; + + /*! + * @brief This function returns a reference to member steering_wheel_angle_confidence + * @return Reference to member steering_wheel_angle_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& steering_wheel_angle_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SteeringWheelAngle& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::SteeringWheelAngleValue m_steering_wheel_angle_value; + etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence m_steering_wheel_angle_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.cxx new file mode 100644 index 00000000000..d9cee4202da --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleConfidence.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SteeringWheelAngleConfidence.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::SteeringWheelAngleConfidence() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@400d912a + m_value = 0; + +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::~SteeringWheelAngleConfidence() +{ +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::SteeringWheelAngleConfidence( + const SteeringWheelAngleConfidence& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::SteeringWheelAngleConfidence( + SteeringWheelAngleConfidence&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::operator =( + const SteeringWheelAngleConfidence& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::operator =( + SteeringWheelAngleConfidence&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::operator ==( + const SteeringWheelAngleConfidence& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::operator !=( + const SteeringWheelAngleConfidence& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.h new file mode 100644 index 00000000000..d582bf820f0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleConfidence.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SteeringWheelAngleConfidence_SOURCE) +#define SteeringWheelAngleConfidence_DllAPI __declspec( dllexport ) +#else +#define SteeringWheelAngleConfidence_DllAPI __declspec( dllimport ) +#endif // SteeringWheelAngleConfidence_SOURCE +#else +#define SteeringWheelAngleConfidence_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SteeringWheelAngleConfidence_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SteeringWheelAngleConfidence_Constants { + const uint8_t MIN = 1; + const uint8_t MAX = 127; + const uint8_t EQUAL_OR_WITHIN_ONE_POINT_FIVE_DEGREE = 1; + const uint8_t OUT_OF_RANGE = 126; + const uint8_t UNAVAILABLE = 127; + } // namespace SteeringWheelAngleConfidence_Constants + /*! + * @brief This class represents the structure SteeringWheelAngleConfidence defined by the user in the IDL file. + * @ingroup STEERINGWHEELANGLECONFIDENCE + */ + class SteeringWheelAngleConfidence + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SteeringWheelAngleConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence( + const SteeringWheelAngleConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence( + SteeringWheelAngleConfidence&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence& operator =( + const SteeringWheelAngleConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence& operator =( + SteeringWheelAngleConfidence&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SteeringWheelAngleConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SteeringWheelAngleConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.cxx new file mode 100644 index 00000000000..2b5fe2baaad --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleConfidencePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SteeringWheelAngleConfidencePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SteeringWheelAngleConfidence_Constants { + + + + + + + } //End of namespace SteeringWheelAngleConfidence_Constants + SteeringWheelAngleConfidencePubSubType::SteeringWheelAngleConfidencePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngleConfidence_"); + auto type_size = SteeringWheelAngleConfidence::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SteeringWheelAngleConfidence::isKeyDefined(); + size_t keyLength = SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize() > 16 ? + SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SteeringWheelAngleConfidencePubSubType::~SteeringWheelAngleConfidencePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SteeringWheelAngleConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SteeringWheelAngleConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SteeringWheelAngleConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SteeringWheelAngleConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SteeringWheelAngleConfidencePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SteeringWheelAngleConfidencePubSubType::createData() + { + return reinterpret_cast(new SteeringWheelAngleConfidence()); + } + + void SteeringWheelAngleConfidencePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SteeringWheelAngleConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SteeringWheelAngleConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.h new file mode 100644 index 00000000000..f294f5cc3a0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleConfidencePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_PUBSUBTYPES_H_ + +#include +#include + +#include "SteeringWheelAngleConfidence.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SteeringWheelAngleConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace SteeringWheelAngleConfidence_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type SteeringWheelAngleConfidence defined by the user in the IDL file. + * @ingroup STEERINGWHEELANGLECONFIDENCE + */ + class SteeringWheelAngleConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SteeringWheelAngleConfidence type; + + eProsima_user_DllExport SteeringWheelAngleConfidencePubSubType(); + + eProsima_user_DllExport virtual ~SteeringWheelAngleConfidencePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SteeringWheelAngleConfidence(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.cxx new file mode 100644 index 00000000000..543b4a07415 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAnglePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SteeringWheelAnglePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + SteeringWheelAnglePubSubType::SteeringWheelAnglePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngle_"); + auto type_size = SteeringWheelAngle::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SteeringWheelAngle::isKeyDefined(); + size_t keyLength = SteeringWheelAngle::getKeyMaxCdrSerializedSize() > 16 ? + SteeringWheelAngle::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SteeringWheelAnglePubSubType::~SteeringWheelAnglePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SteeringWheelAnglePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SteeringWheelAngle* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SteeringWheelAnglePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SteeringWheelAngle* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SteeringWheelAnglePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SteeringWheelAnglePubSubType::createData() + { + return reinterpret_cast(new SteeringWheelAngle()); + } + + void SteeringWheelAnglePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SteeringWheelAnglePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SteeringWheelAngle* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SteeringWheelAngle::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SteeringWheelAngle::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.h new file mode 100644 index 00000000000..e68a26c4288 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAnglePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_PUBSUBTYPES_H_ + +#include +#include + +#include "SteeringWheelAngle.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SteeringWheelAngle is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type SteeringWheelAngle defined by the user in the IDL file. + * @ingroup STEERINGWHEELANGLE + */ + class SteeringWheelAnglePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SteeringWheelAngle type; + + eProsima_user_DllExport SteeringWheelAnglePubSubType(); + + eProsima_user_DllExport virtual ~SteeringWheelAnglePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SteeringWheelAngle(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.cxx new file mode 100644 index 00000000000..d742c6602cc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.cxx @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SteeringWheelAngleValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + +etsi_its_cam_msgs::msg::SteeringWheelAngleValue::SteeringWheelAngleValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@456be73c + m_value = 0; + +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleValue::~SteeringWheelAngleValue() +{ +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleValue::SteeringWheelAngleValue( + const SteeringWheelAngleValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleValue::SteeringWheelAngleValue( + SteeringWheelAngleValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::SteeringWheelAngleValue::operator =( + const SteeringWheelAngleValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::SteeringWheelAngleValue::operator =( + SteeringWheelAngleValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngleValue::operator ==( + const SteeringWheelAngleValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngleValue::operator !=( + const SteeringWheelAngleValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::value( + int16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int16_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int16_t& etsi_its_cam_msgs::msg::SteeringWheelAngleValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SteeringWheelAngleValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.h new file mode 100644 index 00000000000..a7702bff64d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.h @@ -0,0 +1,218 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SteeringWheelAngleValue_SOURCE) +#define SteeringWheelAngleValue_DllAPI __declspec( dllexport ) +#else +#define SteeringWheelAngleValue_DllAPI __declspec( dllimport ) +#endif // SteeringWheelAngleValue_SOURCE +#else +#define SteeringWheelAngleValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SteeringWheelAngleValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SteeringWheelAngleValue_Constants { + const int16_t MIN = -511; + const int16_t MAX = 512; + const int16_t STRAIGHT = 0; + const int16_t ONE_POINT_FIVE_DEGREES_TO_RIGHT = -1; + const int16_t ONE_POINT_FIVE_DEGREES_TO_LEFT = 1; + const int16_t UNAVAILABLE = 512; + } // namespace SteeringWheelAngleValue_Constants + /*! + * @brief This class represents the structure SteeringWheelAngleValue defined by the user in the IDL file. + * @ingroup STEERINGWHEELANGLEVALUE + */ + class SteeringWheelAngleValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SteeringWheelAngleValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SteeringWheelAngleValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleValue( + const SteeringWheelAngleValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleValue( + SteeringWheelAngleValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleValue& operator =( + const SteeringWheelAngleValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleValue& operator =( + SteeringWheelAngleValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SteeringWheelAngleValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SteeringWheelAngleValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.cxx new file mode 100644 index 00000000000..ad25606f66a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.cxx @@ -0,0 +1,185 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SteeringWheelAngleValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SteeringWheelAngleValue_Constants { + + + + + + + + } //End of namespace SteeringWheelAngleValue_Constants + SteeringWheelAngleValuePubSubType::SteeringWheelAngleValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngleValue_"); + auto type_size = SteeringWheelAngleValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SteeringWheelAngleValue::isKeyDefined(); + size_t keyLength = SteeringWheelAngleValue::getKeyMaxCdrSerializedSize() > 16 ? + SteeringWheelAngleValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SteeringWheelAngleValuePubSubType::~SteeringWheelAngleValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SteeringWheelAngleValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SteeringWheelAngleValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SteeringWheelAngleValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SteeringWheelAngleValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SteeringWheelAngleValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SteeringWheelAngleValuePubSubType::createData() + { + return reinterpret_cast(new SteeringWheelAngleValue()); + } + + void SteeringWheelAngleValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SteeringWheelAngleValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SteeringWheelAngleValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SteeringWheelAngleValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SteeringWheelAngleValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.h new file mode 100644 index 00000000000..96b5b2f7d8e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.h @@ -0,0 +1,116 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "SteeringWheelAngleValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SteeringWheelAngleValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace SteeringWheelAngleValue_Constants + { + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type SteeringWheelAngleValue defined by the user in the IDL file. + * @ingroup STEERINGWHEELANGLEVALUE + */ + class SteeringWheelAngleValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SteeringWheelAngleValue type; + + eProsima_user_DllExport SteeringWheelAngleValuePubSubType(); + + eProsima_user_DllExport virtual ~SteeringWheelAngleValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SteeringWheelAngleValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.cxx new file mode 100644 index 00000000000..d709f6c4764 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.cxx @@ -0,0 +1,186 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SubCauseCodeType.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SubCauseCodeType.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + +etsi_its_cam_msgs::msg::SubCauseCodeType::SubCauseCodeType() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@8ab78bc + m_value = 0; + +} + +etsi_its_cam_msgs::msg::SubCauseCodeType::~SubCauseCodeType() +{ +} + +etsi_its_cam_msgs::msg::SubCauseCodeType::SubCauseCodeType( + const SubCauseCodeType& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SubCauseCodeType::SubCauseCodeType( + SubCauseCodeType&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::SubCauseCodeType::operator =( + const SubCauseCodeType& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::SubCauseCodeType::operator =( + SubCauseCodeType&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::SubCauseCodeType::operator ==( + const SubCauseCodeType& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::SubCauseCodeType::operator !=( + const SubCauseCodeType& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::SubCauseCodeType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::SubCauseCodeType::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SubCauseCodeType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::SubCauseCodeType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::SubCauseCodeType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::SubCauseCodeType::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::SubCauseCodeType::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::SubCauseCodeType::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::SubCauseCodeType::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::SubCauseCodeType::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::SubCauseCodeType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.h new file mode 100644 index 00000000000..a9660bba5a7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.h @@ -0,0 +1,214 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SubCauseCodeType.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SubCauseCodeType_SOURCE) +#define SubCauseCodeType_DllAPI __declspec( dllexport ) +#else +#define SubCauseCodeType_DllAPI __declspec( dllimport ) +#endif // SubCauseCodeType_SOURCE +#else +#define SubCauseCodeType_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SubCauseCodeType_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SubCauseCodeType_Constants { + const uint8_t MIN = 0; + const uint8_t MAX = 255; + } // namespace SubCauseCodeType_Constants + /*! + * @brief This class represents the structure SubCauseCodeType defined by the user in the IDL file. + * @ingroup SUBCAUSECODETYPE + */ + class SubCauseCodeType + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SubCauseCodeType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SubCauseCodeType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. + */ + eProsima_user_DllExport SubCauseCodeType( + const SubCauseCodeType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. + */ + eProsima_user_DllExport SubCauseCodeType( + SubCauseCodeType&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. + */ + eProsima_user_DllExport SubCauseCodeType& operator =( + const SubCauseCodeType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. + */ + eProsima_user_DllExport SubCauseCodeType& operator =( + SubCauseCodeType&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SubCauseCodeType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SubCauseCodeType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SubCauseCodeType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SubCauseCodeType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::SubCauseCodeType& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.cxx new file mode 100644 index 00000000000..13465ad99bc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.cxx @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SubCauseCodeTypePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SubCauseCodeTypePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace SubCauseCodeType_Constants { + + + + } //End of namespace SubCauseCodeType_Constants + SubCauseCodeTypePubSubType::SubCauseCodeTypePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::SubCauseCodeType_"); + auto type_size = SubCauseCodeType::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SubCauseCodeType::isKeyDefined(); + size_t keyLength = SubCauseCodeType::getKeyMaxCdrSerializedSize() > 16 ? + SubCauseCodeType::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SubCauseCodeTypePubSubType::~SubCauseCodeTypePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SubCauseCodeTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SubCauseCodeType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SubCauseCodeTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SubCauseCodeType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SubCauseCodeTypePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SubCauseCodeTypePubSubType::createData() + { + return reinterpret_cast(new SubCauseCodeType()); + } + + void SubCauseCodeTypePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SubCauseCodeTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SubCauseCodeType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SubCauseCodeType::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SubCauseCodeType::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.h new file mode 100644 index 00000000000..8e93c1cde2e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.h @@ -0,0 +1,112 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SubCauseCodeTypePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_PUBSUBTYPES_H_ + +#include +#include + +#include "SubCauseCodeType.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated SubCauseCodeType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace SubCauseCodeType_Constants + { + + + } + /*! + * @brief This class represents the TopicDataType of the type SubCauseCodeType defined by the user in the IDL file. + * @ingroup SUBCAUSECODETYPE + */ + class SubCauseCodeTypePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef SubCauseCodeType type; + + eProsima_user_DllExport SubCauseCodeTypePubSubType(); + + eProsima_user_DllExport virtual ~SubCauseCodeTypePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) SubCauseCodeType(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.cxx new file mode 100644 index 00000000000..0e3a486c4ab --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.cxx @@ -0,0 +1,188 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimestampIts.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "TimestampIts.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + +etsi_its_cam_msgs::msg::TimestampIts::TimestampIts() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4163f1cd + m_value = 0; + +} + +etsi_its_cam_msgs::msg::TimestampIts::~TimestampIts() +{ +} + +etsi_its_cam_msgs::msg::TimestampIts::TimestampIts( + const TimestampIts& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::TimestampIts::TimestampIts( + TimestampIts&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::TimestampIts::operator =( + const TimestampIts& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::TimestampIts::operator =( + TimestampIts&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::TimestampIts::operator ==( + const TimestampIts& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::TimestampIts::operator !=( + const TimestampIts& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::TimestampIts::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::TimestampIts::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::TimestampIts& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::TimestampIts::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::TimestampIts::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::TimestampIts::value( + uint64_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint64_t etsi_its_cam_msgs::msg::TimestampIts::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint64_t& etsi_its_cam_msgs::msg::TimestampIts::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::TimestampIts::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::TimestampIts::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::TimestampIts::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.h new file mode 100644 index 00000000000..03a4a76a376 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.h @@ -0,0 +1,216 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimestampIts.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TimestampIts_SOURCE) +#define TimestampIts_DllAPI __declspec( dllexport ) +#else +#define TimestampIts_DllAPI __declspec( dllimport ) +#endif // TimestampIts_SOURCE +#else +#define TimestampIts_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TimestampIts_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace TimestampIts_Constants { + const uint64_t MIN = 0; + const uint64_t MAX = 4398046511103; + const uint64_t UTC_START_OF_2004 = 0; + const uint64_t ONE_MILLISEC_AFTER_UTC_START_OF_2004 = 1; + } // namespace TimestampIts_Constants + /*! + * @brief This class represents the structure TimestampIts defined by the user in the IDL file. + * @ingroup TIMESTAMPITS + */ + class TimestampIts + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TimestampIts(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TimestampIts(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. + */ + eProsima_user_DllExport TimestampIts( + const TimestampIts& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. + */ + eProsima_user_DllExport TimestampIts( + TimestampIts&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. + */ + eProsima_user_DllExport TimestampIts& operator =( + const TimestampIts& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. + */ + eProsima_user_DllExport TimestampIts& operator =( + TimestampIts&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::TimestampIts object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TimestampIts& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::TimestampIts object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TimestampIts& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint64_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint64_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint64_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::TimestampIts& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint64_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.cxx new file mode 100644 index 00000000000..30a817f4b8c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.cxx @@ -0,0 +1,183 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimestampItsPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "TimestampItsPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace TimestampIts_Constants { + + + + + + } //End of namespace TimestampIts_Constants + TimestampItsPubSubType::TimestampItsPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::TimestampIts_"); + auto type_size = TimestampIts::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = TimestampIts::isKeyDefined(); + size_t keyLength = TimestampIts::getKeyMaxCdrSerializedSize() > 16 ? + TimestampIts::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TimestampItsPubSubType::~TimestampItsPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TimestampItsPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + TimestampIts* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool TimestampItsPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + TimestampIts* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function TimestampItsPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* TimestampItsPubSubType::createData() + { + return reinterpret_cast(new TimestampIts()); + } + + void TimestampItsPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TimestampItsPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TimestampIts* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + TimestampIts::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || TimestampIts::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.h new file mode 100644 index 00000000000..56f04f21f6e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.h @@ -0,0 +1,114 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimestampItsPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_PUBSUBTYPES_H_ + +#include +#include + +#include "TimestampIts.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated TimestampIts is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace TimestampIts_Constants + { + + + + + } + /*! + * @brief This class represents the TopicDataType of the type TimestampIts defined by the user in the IDL file. + * @ingroup TIMESTAMPITS + */ + class TimestampItsPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TimestampIts type; + + eProsima_user_DllExport TimestampItsPubSubType(); + + eProsima_user_DllExport virtual ~TimestampItsPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) TimestampIts(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.cxx new file mode 100644 index 00000000000..3e5fcc040a9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.cxx @@ -0,0 +1,188 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TrafficRule.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "TrafficRule.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + +etsi_its_cam_msgs::msg::TrafficRule::TrafficRule() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@44c79f32 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::TrafficRule::~TrafficRule() +{ +} + +etsi_its_cam_msgs::msg::TrafficRule::TrafficRule( + const TrafficRule& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::TrafficRule::TrafficRule( + TrafficRule&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::TrafficRule::operator =( + const TrafficRule& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::TrafficRule::operator =( + TrafficRule&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::TrafficRule::operator ==( + const TrafficRule& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::TrafficRule::operator !=( + const TrafficRule& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::TrafficRule::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::TrafficRule::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::TrafficRule& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::TrafficRule::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::TrafficRule::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::TrafficRule::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::TrafficRule::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::TrafficRule::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::TrafficRule::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::TrafficRule::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::TrafficRule::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.h new file mode 100644 index 00000000000..1c74abe5183 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.h @@ -0,0 +1,216 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TrafficRule.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TrafficRule_SOURCE) +#define TrafficRule_DllAPI __declspec( dllexport ) +#else +#define TrafficRule_DllAPI __declspec( dllimport ) +#endif // TrafficRule_SOURCE +#else +#define TrafficRule_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TrafficRule_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace TrafficRule_Constants { + const uint8_t NO_PASSING = 0; + const uint8_t NO_PASSING_FOR_TRUCKS = 1; + const uint8_t PASS_TO_RIGHT = 2; + const uint8_t PASS_TO_LEFT = 3; + } // namespace TrafficRule_Constants + /*! + * @brief This class represents the structure TrafficRule defined by the user in the IDL file. + * @ingroup TRAFFICRULE + */ + class TrafficRule + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TrafficRule(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TrafficRule(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. + */ + eProsima_user_DllExport TrafficRule( + const TrafficRule& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. + */ + eProsima_user_DllExport TrafficRule( + TrafficRule&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. + */ + eProsima_user_DllExport TrafficRule& operator =( + const TrafficRule& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. + */ + eProsima_user_DllExport TrafficRule& operator =( + TrafficRule&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::TrafficRule object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TrafficRule& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::TrafficRule object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TrafficRule& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::TrafficRule& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.cxx new file mode 100644 index 00000000000..279cfd5846c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.cxx @@ -0,0 +1,183 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TrafficRulePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "TrafficRulePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace TrafficRule_Constants { + + + + + + } //End of namespace TrafficRule_Constants + TrafficRulePubSubType::TrafficRulePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::TrafficRule_"); + auto type_size = TrafficRule::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = TrafficRule::isKeyDefined(); + size_t keyLength = TrafficRule::getKeyMaxCdrSerializedSize() > 16 ? + TrafficRule::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TrafficRulePubSubType::~TrafficRulePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TrafficRulePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + TrafficRule* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool TrafficRulePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + TrafficRule* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function TrafficRulePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* TrafficRulePubSubType::createData() + { + return reinterpret_cast(new TrafficRule()); + } + + void TrafficRulePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TrafficRulePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TrafficRule* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + TrafficRule::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || TrafficRule::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.h new file mode 100644 index 00000000000..a5dc3e8de11 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.h @@ -0,0 +1,114 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TrafficRulePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_PUBSUBTYPES_H_ + +#include +#include + +#include "TrafficRule.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated TrafficRule is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace TrafficRule_Constants + { + + + + + } + /*! + * @brief This class represents the TopicDataType of the type TrafficRule defined by the user in the IDL file. + * @ingroup TRAFFICRULE + */ + class TrafficRulePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TrafficRule type; + + eProsima_user_DllExport TrafficRulePubSubType(); + + eProsima_user_DllExport virtual ~TrafficRulePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) TrafficRule(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.cxx new file mode 100644 index 00000000000..c6c9e1236cf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLength.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "VehicleLength.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::VehicleLength::VehicleLength() +{ + // m_vehicle_length_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@48b0e701 + + // m_vehicle_length_confidence_indication com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@241a0c3a + + +} + +etsi_its_cam_msgs::msg::VehicleLength::~VehicleLength() +{ + +} + +etsi_its_cam_msgs::msg::VehicleLength::VehicleLength( + const VehicleLength& x) +{ + m_vehicle_length_value = x.m_vehicle_length_value; + m_vehicle_length_confidence_indication = x.m_vehicle_length_confidence_indication; +} + +etsi_its_cam_msgs::msg::VehicleLength::VehicleLength( + VehicleLength&& x) +{ + m_vehicle_length_value = std::move(x.m_vehicle_length_value); + m_vehicle_length_confidence_indication = std::move(x.m_vehicle_length_confidence_indication); +} + +etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::VehicleLength::operator =( + const VehicleLength& x) +{ + + m_vehicle_length_value = x.m_vehicle_length_value; + m_vehicle_length_confidence_indication = x.m_vehicle_length_confidence_indication; + + return *this; +} + +etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::VehicleLength::operator =( + VehicleLength&& x) +{ + + m_vehicle_length_value = std::move(x.m_vehicle_length_value); + m_vehicle_length_confidence_indication = std::move(x.m_vehicle_length_confidence_indication); + + return *this; +} + +bool etsi_its_cam_msgs::msg::VehicleLength::operator ==( + const VehicleLength& x) const +{ + + return (m_vehicle_length_value == x.m_vehicle_length_value && m_vehicle_length_confidence_indication == x.m_vehicle_length_confidence_indication); +} + +bool etsi_its_cam_msgs::msg::VehicleLength::operator !=( + const VehicleLength& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::VehicleLength::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::VehicleLengthValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::VehicleLength::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleLength& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::VehicleLengthValue::getCdrSerializedSize(data.vehicle_length_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getCdrSerializedSize(data.vehicle_length_confidence_indication(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::VehicleLength::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_vehicle_length_value; + scdr << m_vehicle_length_confidence_indication; + +} + +void etsi_its_cam_msgs::msg::VehicleLength::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_vehicle_length_value; + dcdr >> m_vehicle_length_confidence_indication; +} + +/*! + * @brief This function copies the value in member vehicle_length_value + * @param _vehicle_length_value New value to be copied in member vehicle_length_value + */ +void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value( + const etsi_its_cam_msgs::msg::VehicleLengthValue& _vehicle_length_value) +{ + m_vehicle_length_value = _vehicle_length_value; +} + +/*! + * @brief This function moves the value in member vehicle_length_value + * @param _vehicle_length_value New value to be moved in member vehicle_length_value + */ +void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value( + etsi_its_cam_msgs::msg::VehicleLengthValue&& _vehicle_length_value) +{ + m_vehicle_length_value = std::move(_vehicle_length_value); +} + +/*! + * @brief This function returns a constant reference to member vehicle_length_value + * @return Constant reference to member vehicle_length_value + */ +const etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value() const +{ + return m_vehicle_length_value; +} + +/*! + * @brief This function returns a reference to member vehicle_length_value + * @return Reference to member vehicle_length_value + */ +etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value() +{ + return m_vehicle_length_value; +} +/*! + * @brief This function copies the value in member vehicle_length_confidence_indication + * @param _vehicle_length_confidence_indication New value to be copied in member vehicle_length_confidence_indication + */ +void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication( + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& _vehicle_length_confidence_indication) +{ + m_vehicle_length_confidence_indication = _vehicle_length_confidence_indication; +} + +/*! + * @brief This function moves the value in member vehicle_length_confidence_indication + * @param _vehicle_length_confidence_indication New value to be moved in member vehicle_length_confidence_indication + */ +void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication( + etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication&& _vehicle_length_confidence_indication) +{ + m_vehicle_length_confidence_indication = std::move(_vehicle_length_confidence_indication); +} + +/*! + * @brief This function returns a constant reference to member vehicle_length_confidence_indication + * @return Constant reference to member vehicle_length_confidence_indication + */ +const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication() const +{ + return m_vehicle_length_confidence_indication; +} + +/*! + * @brief This function returns a reference to member vehicle_length_confidence_indication + * @return Reference to member vehicle_length_confidence_indication + */ +etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication() +{ + return m_vehicle_length_confidence_indication; +} + +size_t etsi_its_cam_msgs::msg::VehicleLength::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::VehicleLength::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::VehicleLength::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.h new file mode 100644 index 00000000000..87e83045daa --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLength.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_H_ + +#include "VehicleLengthValue.h" +#include "VehicleLengthConfidenceIndication.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VehicleLength_SOURCE) +#define VehicleLength_DllAPI __declspec( dllexport ) +#else +#define VehicleLength_DllAPI __declspec( dllimport ) +#endif // VehicleLength_SOURCE +#else +#define VehicleLength_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VehicleLength_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure VehicleLength defined by the user in the IDL file. + * @ingroup VEHICLELENGTH + */ + class VehicleLength + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleLength(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleLength(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. + */ + eProsima_user_DllExport VehicleLength( + const VehicleLength& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. + */ + eProsima_user_DllExport VehicleLength( + VehicleLength&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. + */ + eProsima_user_DllExport VehicleLength& operator =( + const VehicleLength& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. + */ + eProsima_user_DllExport VehicleLength& operator =( + VehicleLength&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLength object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleLength& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLength object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleLength& x) const; + + /*! + * @brief This function copies the value in member vehicle_length_value + * @param _vehicle_length_value New value to be copied in member vehicle_length_value + */ + eProsima_user_DllExport void vehicle_length_value( + const etsi_its_cam_msgs::msg::VehicleLengthValue& _vehicle_length_value); + + /*! + * @brief This function moves the value in member vehicle_length_value + * @param _vehicle_length_value New value to be moved in member vehicle_length_value + */ + eProsima_user_DllExport void vehicle_length_value( + etsi_its_cam_msgs::msg::VehicleLengthValue&& _vehicle_length_value); + + /*! + * @brief This function returns a constant reference to member vehicle_length_value + * @return Constant reference to member vehicle_length_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLengthValue& vehicle_length_value() const; + + /*! + * @brief This function returns a reference to member vehicle_length_value + * @return Reference to member vehicle_length_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLengthValue& vehicle_length_value(); + /*! + * @brief This function copies the value in member vehicle_length_confidence_indication + * @param _vehicle_length_confidence_indication New value to be copied in member vehicle_length_confidence_indication + */ + eProsima_user_DllExport void vehicle_length_confidence_indication( + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& _vehicle_length_confidence_indication); + + /*! + * @brief This function moves the value in member vehicle_length_confidence_indication + * @param _vehicle_length_confidence_indication New value to be moved in member vehicle_length_confidence_indication + */ + eProsima_user_DllExport void vehicle_length_confidence_indication( + etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication&& _vehicle_length_confidence_indication); + + /*! + * @brief This function returns a constant reference to member vehicle_length_confidence_indication + * @return Constant reference to member vehicle_length_confidence_indication + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& vehicle_length_confidence_indication() const; + + /*! + * @brief This function returns a reference to member vehicle_length_confidence_indication + * @return Reference to member vehicle_length_confidence_indication + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& vehicle_length_confidence_indication(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleLength& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::VehicleLengthValue m_vehicle_length_value; + etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication m_vehicle_length_confidence_indication; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.cxx new file mode 100644 index 00000000000..3cab8baacdd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthConfidenceIndication.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "VehicleLengthConfidenceIndication.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4d7e7435 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::~VehicleLengthConfidenceIndication() +{ +} + +etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication( + const VehicleLengthConfidenceIndication& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication( + VehicleLengthConfidenceIndication&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::operator =( + const VehicleLengthConfidenceIndication& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::operator =( + VehicleLengthConfidenceIndication&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::operator ==( + const VehicleLengthConfidenceIndication& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::operator !=( + const VehicleLengthConfidenceIndication& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.h new file mode 100644 index 00000000000..42f3fb4cd8a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthConfidenceIndication.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VehicleLengthConfidenceIndication_SOURCE) +#define VehicleLengthConfidenceIndication_DllAPI __declspec( dllexport ) +#else +#define VehicleLengthConfidenceIndication_DllAPI __declspec( dllimport ) +#endif // VehicleLengthConfidenceIndication_SOURCE +#else +#define VehicleLengthConfidenceIndication_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VehicleLengthConfidenceIndication_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VehicleLengthConfidenceIndication_Constants { + const uint8_t NO_TRAILER_PRESENT = 0; + const uint8_t TRAILER_PRESENT_WITH_KNOWN_LENGTH = 1; + const uint8_t TRAILER_PRESENT_WITH_UNKNOWN_LENGTH = 2; + const uint8_t TRAILER_PRESENCE_IS_UNKNOWN = 3; + const uint8_t UNAVAILABLE = 4; + } // namespace VehicleLengthConfidenceIndication_Constants + /*! + * @brief This class represents the structure VehicleLengthConfidenceIndication defined by the user in the IDL file. + * @ingroup VEHICLELENGTHCONFIDENCEINDICATION + */ + class VehicleLengthConfidenceIndication + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleLengthConfidenceIndication(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication( + const VehicleLengthConfidenceIndication& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication( + VehicleLengthConfidenceIndication&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication& operator =( + const VehicleLengthConfidenceIndication& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication& operator =( + VehicleLengthConfidenceIndication&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleLengthConfidenceIndication& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleLengthConfidenceIndication& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.cxx new file mode 100644 index 00000000000..6ece85a29e1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthConfidenceIndicationPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "VehicleLengthConfidenceIndicationPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VehicleLengthConfidenceIndication_Constants { + + + + + + + } //End of namespace VehicleLengthConfidenceIndication_Constants + VehicleLengthConfidenceIndicationPubSubType::VehicleLengthConfidenceIndicationPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::VehicleLengthConfidenceIndication_"); + auto type_size = VehicleLengthConfidenceIndication::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = VehicleLengthConfidenceIndication::isKeyDefined(); + size_t keyLength = VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize() > 16 ? + VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + VehicleLengthConfidenceIndicationPubSubType::~VehicleLengthConfidenceIndicationPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool VehicleLengthConfidenceIndicationPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + VehicleLengthConfidenceIndication* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool VehicleLengthConfidenceIndicationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + VehicleLengthConfidenceIndication* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function VehicleLengthConfidenceIndicationPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* VehicleLengthConfidenceIndicationPubSubType::createData() + { + return reinterpret_cast(new VehicleLengthConfidenceIndication()); + } + + void VehicleLengthConfidenceIndicationPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VehicleLengthConfidenceIndicationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + VehicleLengthConfidenceIndication* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.h new file mode 100644 index 00000000000..e256a7a8097 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthConfidenceIndicationPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_PUBSUBTYPES_H_ + +#include +#include + +#include "VehicleLengthConfidenceIndication.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated VehicleLengthConfidenceIndication is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace VehicleLengthConfidenceIndication_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type VehicleLengthConfidenceIndication defined by the user in the IDL file. + * @ingroup VEHICLELENGTHCONFIDENCEINDICATION + */ + class VehicleLengthConfidenceIndicationPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef VehicleLengthConfidenceIndication type; + + eProsima_user_DllExport VehicleLengthConfidenceIndicationPubSubType(); + + eProsima_user_DllExport virtual ~VehicleLengthConfidenceIndicationPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) VehicleLengthConfidenceIndication(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.cxx new file mode 100644 index 00000000000..cf09e754801 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "VehicleLengthPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + VehicleLengthPubSubType::VehicleLengthPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::VehicleLength_"); + auto type_size = VehicleLength::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = VehicleLength::isKeyDefined(); + size_t keyLength = VehicleLength::getKeyMaxCdrSerializedSize() > 16 ? + VehicleLength::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + VehicleLengthPubSubType::~VehicleLengthPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool VehicleLengthPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + VehicleLength* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool VehicleLengthPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + VehicleLength* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function VehicleLengthPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* VehicleLengthPubSubType::createData() + { + return reinterpret_cast(new VehicleLength()); + } + + void VehicleLengthPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VehicleLengthPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + VehicleLength* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + VehicleLength::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || VehicleLength::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.h new file mode 100644 index 00000000000..b80d91d3f61 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_PUBSUBTYPES_H_ + +#include +#include + +#include "VehicleLength.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated VehicleLength is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type VehicleLength defined by the user in the IDL file. + * @ingroup VEHICLELENGTH + */ + class VehicleLengthPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef VehicleLength type; + + eProsima_user_DllExport VehicleLengthPubSubType(); + + eProsima_user_DllExport virtual ~VehicleLengthPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) VehicleLength(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.cxx new file mode 100644 index 00000000000..8a9a1fa74a4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "VehicleLengthValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::VehicleLengthValue::VehicleLengthValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5f212d84 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::VehicleLengthValue::~VehicleLengthValue() +{ +} + +etsi_its_cam_msgs::msg::VehicleLengthValue::VehicleLengthValue( + const VehicleLengthValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VehicleLengthValue::VehicleLengthValue( + VehicleLengthValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::VehicleLengthValue::operator =( + const VehicleLengthValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::VehicleLengthValue::operator =( + VehicleLengthValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::VehicleLengthValue::operator ==( + const VehicleLengthValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::VehicleLengthValue::operator !=( + const VehicleLengthValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::VehicleLengthValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::VehicleLengthValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleLengthValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::VehicleLengthValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::VehicleLengthValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::VehicleLengthValue::value( + uint16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint16_t etsi_its_cam_msgs::msg::VehicleLengthValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint16_t& etsi_its_cam_msgs::msg::VehicleLengthValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::VehicleLengthValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::VehicleLengthValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::VehicleLengthValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.h new file mode 100644 index 00000000000..3fc1974de2d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VehicleLengthValue_SOURCE) +#define VehicleLengthValue_DllAPI __declspec( dllexport ) +#else +#define VehicleLengthValue_DllAPI __declspec( dllimport ) +#endif // VehicleLengthValue_SOURCE +#else +#define VehicleLengthValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VehicleLengthValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VehicleLengthValue_Constants { + const uint16_t MIN = 1; + const uint16_t MAX = 1023; + const uint16_t TEN_CENTIMETERS = 1; + const uint16_t OUT_OF_RANGE = 1022; + const uint16_t UNAVAILABLE = 1023; + } // namespace VehicleLengthValue_Constants + /*! + * @brief This class represents the structure VehicleLengthValue defined by the user in the IDL file. + * @ingroup VEHICLELENGTHVALUE + */ + class VehicleLengthValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleLengthValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleLengthValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. + */ + eProsima_user_DllExport VehicleLengthValue( + const VehicleLengthValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. + */ + eProsima_user_DllExport VehicleLengthValue( + VehicleLengthValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. + */ + eProsima_user_DllExport VehicleLengthValue& operator =( + const VehicleLengthValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. + */ + eProsima_user_DllExport VehicleLengthValue& operator =( + VehicleLengthValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLengthValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleLengthValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLengthValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleLengthValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleLengthValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.cxx new file mode 100644 index 00000000000..0123f5caa87 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "VehicleLengthValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VehicleLengthValue_Constants { + + + + + + + } //End of namespace VehicleLengthValue_Constants + VehicleLengthValuePubSubType::VehicleLengthValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::VehicleLengthValue_"); + auto type_size = VehicleLengthValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = VehicleLengthValue::isKeyDefined(); + size_t keyLength = VehicleLengthValue::getKeyMaxCdrSerializedSize() > 16 ? + VehicleLengthValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + VehicleLengthValuePubSubType::~VehicleLengthValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool VehicleLengthValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + VehicleLengthValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool VehicleLengthValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + VehicleLengthValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function VehicleLengthValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* VehicleLengthValuePubSubType::createData() + { + return reinterpret_cast(new VehicleLengthValue()); + } + + void VehicleLengthValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VehicleLengthValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + VehicleLengthValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + VehicleLengthValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || VehicleLengthValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.h new file mode 100644 index 00000000000..00923b86fe1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "VehicleLengthValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated VehicleLengthValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace VehicleLengthValue_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type VehicleLengthValue defined by the user in the IDL file. + * @ingroup VEHICLELENGTHVALUE + */ + class VehicleLengthValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef VehicleLengthValue type; + + eProsima_user_DllExport VehicleLengthValuePubSubType(); + + eProsima_user_DllExport virtual ~VehicleLengthValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) VehicleLengthValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.cxx new file mode 100644 index 00000000000..e4f2f9b7378 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.cxx @@ -0,0 +1,200 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleRole.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "VehicleRole.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + + + +etsi_its_cam_msgs::msg::VehicleRole::VehicleRole() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@51a06cbe + m_value = 0; + +} + +etsi_its_cam_msgs::msg::VehicleRole::~VehicleRole() +{ +} + +etsi_its_cam_msgs::msg::VehicleRole::VehicleRole( + const VehicleRole& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VehicleRole::VehicleRole( + VehicleRole&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::VehicleRole::operator =( + const VehicleRole& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::VehicleRole::operator =( + VehicleRole&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::VehicleRole::operator ==( + const VehicleRole& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::VehicleRole::operator !=( + const VehicleRole& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::VehicleRole::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::VehicleRole::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleRole& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::VehicleRole::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::VehicleRole::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::VehicleRole::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::VehicleRole::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::VehicleRole::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::VehicleRole::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::VehicleRole::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::VehicleRole::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.h new file mode 100644 index 00000000000..030657b2f71 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.h @@ -0,0 +1,228 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleRole.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VehicleRole_SOURCE) +#define VehicleRole_DllAPI __declspec( dllexport ) +#else +#define VehicleRole_DllAPI __declspec( dllimport ) +#endif // VehicleRole_SOURCE +#else +#define VehicleRole_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VehicleRole_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VehicleRole_Constants { + const uint8_t DEFAULT = 0; + const uint8_t PUBLIC_TRANSPORT = 1; + const uint8_t SPECIAL_TRANSPORT = 2; + const uint8_t DANGEROUS_GOODS = 3; + const uint8_t ROAD_WORK = 4; + const uint8_t RESCUE = 5; + const uint8_t EMERGENCY = 6; + const uint8_t SAFETY_CAR = 7; + const uint8_t AGRICULTURE = 8; + const uint8_t COMMERCIAL = 9; + const uint8_t MILITARY = 10; + const uint8_t ROAD_OPERATOR = 11; + const uint8_t TAXI = 12; + const uint8_t RESERVED_1 = 13; + const uint8_t RESERVED_2 = 14; + const uint8_t RESERVED_3 = 15; + } // namespace VehicleRole_Constants + /*! + * @brief This class represents the structure VehicleRole defined by the user in the IDL file. + * @ingroup VEHICLEROLE + */ + class VehicleRole + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleRole(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleRole(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. + */ + eProsima_user_DllExport VehicleRole( + const VehicleRole& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. + */ + eProsima_user_DllExport VehicleRole( + VehicleRole&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. + */ + eProsima_user_DllExport VehicleRole& operator =( + const VehicleRole& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. + */ + eProsima_user_DllExport VehicleRole& operator =( + VehicleRole&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleRole object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleRole& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleRole object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleRole& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleRole& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.cxx new file mode 100644 index 00000000000..cec30c7dd14 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.cxx @@ -0,0 +1,195 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleRolePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "VehicleRolePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VehicleRole_Constants { + + + + + + + + + + + + + + + + + + } //End of namespace VehicleRole_Constants + VehicleRolePubSubType::VehicleRolePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::VehicleRole_"); + auto type_size = VehicleRole::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = VehicleRole::isKeyDefined(); + size_t keyLength = VehicleRole::getKeyMaxCdrSerializedSize() > 16 ? + VehicleRole::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + VehicleRolePubSubType::~VehicleRolePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool VehicleRolePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + VehicleRole* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool VehicleRolePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + VehicleRole* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function VehicleRolePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* VehicleRolePubSubType::createData() + { + return reinterpret_cast(new VehicleRole()); + } + + void VehicleRolePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VehicleRolePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + VehicleRole* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + VehicleRole::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || VehicleRole::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.h new file mode 100644 index 00000000000..6f60c5fce1e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.h @@ -0,0 +1,126 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleRolePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_PUBSUBTYPES_H_ + +#include +#include + +#include "VehicleRole.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated VehicleRole is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace VehicleRole_Constants + { + + + + + + + + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type VehicleRole defined by the user in the IDL file. + * @ingroup VEHICLEROLE + */ + class VehicleRolePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef VehicleRole type; + + eProsima_user_DllExport VehicleRolePubSubType(); + + eProsima_user_DllExport virtual ~VehicleRolePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) VehicleRole(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.cxx new file mode 100644 index 00000000000..b6e0f93b52f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleWidth.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "VehicleWidth.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::VehicleWidth::VehicleWidth() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@29d37757 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::VehicleWidth::~VehicleWidth() +{ +} + +etsi_its_cam_msgs::msg::VehicleWidth::VehicleWidth( + const VehicleWidth& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VehicleWidth::VehicleWidth( + VehicleWidth&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::VehicleWidth::operator =( + const VehicleWidth& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::VehicleWidth::operator =( + VehicleWidth&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::VehicleWidth::operator ==( + const VehicleWidth& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::VehicleWidth::operator !=( + const VehicleWidth& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::VehicleWidth::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::VehicleWidth::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleWidth& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::VehicleWidth::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::VehicleWidth::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::VehicleWidth::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::VehicleWidth::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::VehicleWidth::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::VehicleWidth::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::VehicleWidth::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::VehicleWidth::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.h new file mode 100644 index 00000000000..fdcd6b7a244 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleWidth.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VehicleWidth_SOURCE) +#define VehicleWidth_DllAPI __declspec( dllexport ) +#else +#define VehicleWidth_DllAPI __declspec( dllimport ) +#endif // VehicleWidth_SOURCE +#else +#define VehicleWidth_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VehicleWidth_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VehicleWidth_Constants { + const uint8_t MIN = 1; + const uint8_t MAX = 62; + const uint8_t TEN_CENTIMETERS = 1; + const uint8_t OUT_OF_RANGE = 61; + const uint8_t UNAVAILABLE = 62; + } // namespace VehicleWidth_Constants + /*! + * @brief This class represents the structure VehicleWidth defined by the user in the IDL file. + * @ingroup VEHICLEWIDTH + */ + class VehicleWidth + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleWidth(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleWidth(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. + */ + eProsima_user_DllExport VehicleWidth( + const VehicleWidth& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. + */ + eProsima_user_DllExport VehicleWidth( + VehicleWidth&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. + */ + eProsima_user_DllExport VehicleWidth& operator =( + const VehicleWidth& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. + */ + eProsima_user_DllExport VehicleWidth& operator =( + VehicleWidth&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleWidth object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleWidth& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleWidth object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleWidth& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VehicleWidth& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.cxx new file mode 100644 index 00000000000..006e32dc819 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleWidthPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "VehicleWidthPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VehicleWidth_Constants { + + + + + + + } //End of namespace VehicleWidth_Constants + VehicleWidthPubSubType::VehicleWidthPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::VehicleWidth_"); + auto type_size = VehicleWidth::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = VehicleWidth::isKeyDefined(); + size_t keyLength = VehicleWidth::getKeyMaxCdrSerializedSize() > 16 ? + VehicleWidth::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + VehicleWidthPubSubType::~VehicleWidthPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool VehicleWidthPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + VehicleWidth* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool VehicleWidthPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + VehicleWidth* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function VehicleWidthPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* VehicleWidthPubSubType::createData() + { + return reinterpret_cast(new VehicleWidth()); + } + + void VehicleWidthPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VehicleWidthPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + VehicleWidth* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + VehicleWidth::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || VehicleWidth::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.h new file mode 100644 index 00000000000..fbeb1df502c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleWidthPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_PUBSUBTYPES_H_ + +#include +#include + +#include "VehicleWidth.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated VehicleWidth is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace VehicleWidth_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type VehicleWidth defined by the user in the IDL file. + * @ingroup VEHICLEWIDTH + */ + class VehicleWidthPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef VehicleWidth type; + + eProsima_user_DllExport VehicleWidthPubSubType(); + + eProsima_user_DllExport virtual ~VehicleWidthPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) VehicleWidth(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.cxx new file mode 100644 index 00000000000..c384c790c1d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAcceleration.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "VerticalAcceleration.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::VerticalAcceleration::VerticalAcceleration() +{ + // m_vertical_acceleration_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6e4ea0bd + + // m_vertical_acceleration_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@56f2bbea + + +} + +etsi_its_cam_msgs::msg::VerticalAcceleration::~VerticalAcceleration() +{ + +} + +etsi_its_cam_msgs::msg::VerticalAcceleration::VerticalAcceleration( + const VerticalAcceleration& x) +{ + m_vertical_acceleration_value = x.m_vertical_acceleration_value; + m_vertical_acceleration_confidence = x.m_vertical_acceleration_confidence; +} + +etsi_its_cam_msgs::msg::VerticalAcceleration::VerticalAcceleration( + VerticalAcceleration&& x) +{ + m_vertical_acceleration_value = std::move(x.m_vertical_acceleration_value); + m_vertical_acceleration_confidence = std::move(x.m_vertical_acceleration_confidence); +} + +etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::VerticalAcceleration::operator =( + const VerticalAcceleration& x) +{ + + m_vertical_acceleration_value = x.m_vertical_acceleration_value; + m_vertical_acceleration_confidence = x.m_vertical_acceleration_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::VerticalAcceleration::operator =( + VerticalAcceleration&& x) +{ + + m_vertical_acceleration_value = std::move(x.m_vertical_acceleration_value); + m_vertical_acceleration_confidence = std::move(x.m_vertical_acceleration_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::VerticalAcceleration::operator ==( + const VerticalAcceleration& x) const +{ + + return (m_vertical_acceleration_value == x.m_vertical_acceleration_value && m_vertical_acceleration_confidence == x.m_vertical_acceleration_confidence); +} + +bool etsi_its_cam_msgs::msg::VerticalAcceleration::operator !=( + const VerticalAcceleration& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::VerticalAcceleration::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::VerticalAccelerationValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::VerticalAcceleration::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VerticalAcceleration& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::VerticalAccelerationValue::getCdrSerializedSize(data.vertical_acceleration_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getCdrSerializedSize(data.vertical_acceleration_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::VerticalAcceleration::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_vertical_acceleration_value; + scdr << m_vertical_acceleration_confidence; + +} + +void etsi_its_cam_msgs::msg::VerticalAcceleration::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_vertical_acceleration_value; + dcdr >> m_vertical_acceleration_confidence; +} + +/*! + * @brief This function copies the value in member vertical_acceleration_value + * @param _vertical_acceleration_value New value to be copied in member vertical_acceleration_value + */ +void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value( + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& _vertical_acceleration_value) +{ + m_vertical_acceleration_value = _vertical_acceleration_value; +} + +/*! + * @brief This function moves the value in member vertical_acceleration_value + * @param _vertical_acceleration_value New value to be moved in member vertical_acceleration_value + */ +void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value( + etsi_its_cam_msgs::msg::VerticalAccelerationValue&& _vertical_acceleration_value) +{ + m_vertical_acceleration_value = std::move(_vertical_acceleration_value); +} + +/*! + * @brief This function returns a constant reference to member vertical_acceleration_value + * @return Constant reference to member vertical_acceleration_value + */ +const etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value() const +{ + return m_vertical_acceleration_value; +} + +/*! + * @brief This function returns a reference to member vertical_acceleration_value + * @return Reference to member vertical_acceleration_value + */ +etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value() +{ + return m_vertical_acceleration_value; +} +/*! + * @brief This function copies the value in member vertical_acceleration_confidence + * @param _vertical_acceleration_confidence New value to be copied in member vertical_acceleration_confidence + */ +void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _vertical_acceleration_confidence) +{ + m_vertical_acceleration_confidence = _vertical_acceleration_confidence; +} + +/*! + * @brief This function moves the value in member vertical_acceleration_confidence + * @param _vertical_acceleration_confidence New value to be moved in member vertical_acceleration_confidence + */ +void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _vertical_acceleration_confidence) +{ + m_vertical_acceleration_confidence = std::move(_vertical_acceleration_confidence); +} + +/*! + * @brief This function returns a constant reference to member vertical_acceleration_confidence + * @return Constant reference to member vertical_acceleration_confidence + */ +const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confidence() const +{ + return m_vertical_acceleration_confidence; +} + +/*! + * @brief This function returns a reference to member vertical_acceleration_confidence + * @return Reference to member vertical_acceleration_confidence + */ +etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confidence() +{ + return m_vertical_acceleration_confidence; +} + +size_t etsi_its_cam_msgs::msg::VerticalAcceleration::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::VerticalAcceleration::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::VerticalAcceleration::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.h new file mode 100644 index 00000000000..0d256bb7d7c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAcceleration.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_H_ + +#include "AccelerationConfidence.h" +#include "VerticalAccelerationValue.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VerticalAcceleration_SOURCE) +#define VerticalAcceleration_DllAPI __declspec( dllexport ) +#else +#define VerticalAcceleration_DllAPI __declspec( dllimport ) +#endif // VerticalAcceleration_SOURCE +#else +#define VerticalAcceleration_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VerticalAcceleration_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure VerticalAcceleration defined by the user in the IDL file. + * @ingroup VERTICALACCELERATION + */ + class VerticalAcceleration + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VerticalAcceleration(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VerticalAcceleration(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. + */ + eProsima_user_DllExport VerticalAcceleration( + const VerticalAcceleration& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. + */ + eProsima_user_DllExport VerticalAcceleration( + VerticalAcceleration&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. + */ + eProsima_user_DllExport VerticalAcceleration& operator =( + const VerticalAcceleration& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. + */ + eProsima_user_DllExport VerticalAcceleration& operator =( + VerticalAcceleration&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VerticalAcceleration object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VerticalAcceleration& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VerticalAcceleration object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VerticalAcceleration& x) const; + + /*! + * @brief This function copies the value in member vertical_acceleration_value + * @param _vertical_acceleration_value New value to be copied in member vertical_acceleration_value + */ + eProsima_user_DllExport void vertical_acceleration_value( + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& _vertical_acceleration_value); + + /*! + * @brief This function moves the value in member vertical_acceleration_value + * @param _vertical_acceleration_value New value to be moved in member vertical_acceleration_value + */ + eProsima_user_DllExport void vertical_acceleration_value( + etsi_its_cam_msgs::msg::VerticalAccelerationValue&& _vertical_acceleration_value); + + /*! + * @brief This function returns a constant reference to member vertical_acceleration_value + * @return Constant reference to member vertical_acceleration_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VerticalAccelerationValue& vertical_acceleration_value() const; + + /*! + * @brief This function returns a reference to member vertical_acceleration_value + * @return Reference to member vertical_acceleration_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VerticalAccelerationValue& vertical_acceleration_value(); + /*! + * @brief This function copies the value in member vertical_acceleration_confidence + * @param _vertical_acceleration_confidence New value to be copied in member vertical_acceleration_confidence + */ + eProsima_user_DllExport void vertical_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _vertical_acceleration_confidence); + + /*! + * @brief This function moves the value in member vertical_acceleration_confidence + * @param _vertical_acceleration_confidence New value to be moved in member vertical_acceleration_confidence + */ + eProsima_user_DllExport void vertical_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _vertical_acceleration_confidence); + + /*! + * @brief This function returns a constant reference to member vertical_acceleration_confidence + * @return Constant reference to member vertical_acceleration_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& vertical_acceleration_confidence() const; + + /*! + * @brief This function returns a reference to member vertical_acceleration_confidence + * @return Reference to member vertical_acceleration_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& vertical_acceleration_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VerticalAcceleration& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::VerticalAccelerationValue m_vertical_acceleration_value; + etsi_its_cam_msgs::msg::AccelerationConfidence m_vertical_acceleration_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.cxx new file mode 100644 index 00000000000..641e64c0966 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "VerticalAccelerationPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + VerticalAccelerationPubSubType::VerticalAccelerationPubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::VerticalAcceleration_"); + auto type_size = VerticalAcceleration::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = VerticalAcceleration::isKeyDefined(); + size_t keyLength = VerticalAcceleration::getKeyMaxCdrSerializedSize() > 16 ? + VerticalAcceleration::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + VerticalAccelerationPubSubType::~VerticalAccelerationPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool VerticalAccelerationPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + VerticalAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool VerticalAccelerationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + VerticalAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function VerticalAccelerationPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* VerticalAccelerationPubSubType::createData() + { + return reinterpret_cast(new VerticalAcceleration()); + } + + void VerticalAccelerationPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VerticalAccelerationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + VerticalAcceleration* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + VerticalAcceleration::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || VerticalAcceleration::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.h new file mode 100644 index 00000000000..7d48f81ee84 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_PUBSUBTYPES_H_ + +#include +#include + +#include "VerticalAcceleration.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated VerticalAcceleration is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type VerticalAcceleration defined by the user in the IDL file. + * @ingroup VERTICALACCELERATION + */ + class VerticalAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef VerticalAcceleration type; + + eProsima_user_DllExport VerticalAccelerationPubSubType(); + + eProsima_user_DllExport virtual ~VerticalAccelerationPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) VerticalAcceleration(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.cxx new file mode 100644 index 00000000000..b42614299c2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.cxx @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "VerticalAccelerationValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + +etsi_its_cam_msgs::msg::VerticalAccelerationValue::VerticalAccelerationValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e411d81 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::VerticalAccelerationValue::~VerticalAccelerationValue() +{ +} + +etsi_its_cam_msgs::msg::VerticalAccelerationValue::VerticalAccelerationValue( + const VerticalAccelerationValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VerticalAccelerationValue::VerticalAccelerationValue( + VerticalAccelerationValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg::VerticalAccelerationValue::operator =( + const VerticalAccelerationValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg::VerticalAccelerationValue::operator =( + VerticalAccelerationValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::VerticalAccelerationValue::operator ==( + const VerticalAccelerationValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::VerticalAccelerationValue::operator !=( + const VerticalAccelerationValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::VerticalAccelerationValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::VerticalAccelerationValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::VerticalAccelerationValue::value( + int16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int16_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int16_t& etsi_its_cam_msgs::msg::VerticalAccelerationValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::VerticalAccelerationValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::VerticalAccelerationValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.h new file mode 100644 index 00000000000..7d547cafde5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(VerticalAccelerationValue_SOURCE) +#define VerticalAccelerationValue_DllAPI __declspec( dllexport ) +#else +#define VerticalAccelerationValue_DllAPI __declspec( dllimport ) +#endif // VerticalAccelerationValue_SOURCE +#else +#define VerticalAccelerationValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define VerticalAccelerationValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VerticalAccelerationValue_Constants { + const int16_t MIN = -160; + const int16_t MAX = 161; + const int16_t POINT_ONE_METER_PER_SEC_SQUARED_UP = 1; + const int16_t POINT_ONE_METER_PER_SEC_SQUARED_DOWN = -1; + const int16_t UNAVAILABLE = 161; + } // namespace VerticalAccelerationValue_Constants + /*! + * @brief This class represents the structure VerticalAccelerationValue defined by the user in the IDL file. + * @ingroup VERTICALACCELERATIONVALUE + */ + class VerticalAccelerationValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VerticalAccelerationValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VerticalAccelerationValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. + */ + eProsima_user_DllExport VerticalAccelerationValue( + const VerticalAccelerationValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. + */ + eProsima_user_DllExport VerticalAccelerationValue( + VerticalAccelerationValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. + */ + eProsima_user_DllExport VerticalAccelerationValue& operator =( + const VerticalAccelerationValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. + */ + eProsima_user_DllExport VerticalAccelerationValue& operator =( + VerticalAccelerationValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VerticalAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VerticalAccelerationValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VerticalAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VerticalAccelerationValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.cxx new file mode 100644 index 00000000000..57fc138db1d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "VerticalAccelerationValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace VerticalAccelerationValue_Constants { + + + + + + + } //End of namespace VerticalAccelerationValue_Constants + VerticalAccelerationValuePubSubType::VerticalAccelerationValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::VerticalAccelerationValue_"); + auto type_size = VerticalAccelerationValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = VerticalAccelerationValue::isKeyDefined(); + size_t keyLength = VerticalAccelerationValue::getKeyMaxCdrSerializedSize() > 16 ? + VerticalAccelerationValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + VerticalAccelerationValuePubSubType::~VerticalAccelerationValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool VerticalAccelerationValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + VerticalAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool VerticalAccelerationValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + VerticalAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function VerticalAccelerationValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* VerticalAccelerationValuePubSubType::createData() + { + return reinterpret_cast(new VerticalAccelerationValue()); + } + + void VerticalAccelerationValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VerticalAccelerationValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + VerticalAccelerationValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + VerticalAccelerationValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || VerticalAccelerationValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.h new file mode 100644 index 00000000000..217790a0fc6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.h @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "VerticalAccelerationValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated VerticalAccelerationValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace VerticalAccelerationValue_Constants + { + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type VerticalAccelerationValue defined by the user in the IDL file. + * @ingroup VERTICALACCELERATIONVALUE + */ + class VerticalAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef VerticalAccelerationValue type; + + eProsima_user_DllExport VerticalAccelerationValuePubSubType(); + + eProsima_user_DllExport virtual ~VerticalAccelerationValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) VerticalAccelerationValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.cxx new file mode 100644 index 00000000000..4a061f251d6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRate.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "YawRate.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +etsi_its_cam_msgs::msg::YawRate::YawRate() +{ + // m_yaw_rate_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1654a892 + + // m_yaw_rate_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2577d6c8 + + +} + +etsi_its_cam_msgs::msg::YawRate::~YawRate() +{ + +} + +etsi_its_cam_msgs::msg::YawRate::YawRate( + const YawRate& x) +{ + m_yaw_rate_value = x.m_yaw_rate_value; + m_yaw_rate_confidence = x.m_yaw_rate_confidence; +} + +etsi_its_cam_msgs::msg::YawRate::YawRate( + YawRate&& x) +{ + m_yaw_rate_value = std::move(x.m_yaw_rate_value); + m_yaw_rate_confidence = std::move(x.m_yaw_rate_confidence); +} + +etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::YawRate::operator =( + const YawRate& x) +{ + + m_yaw_rate_value = x.m_yaw_rate_value; + m_yaw_rate_confidence = x.m_yaw_rate_confidence; + + return *this; +} + +etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::YawRate::operator =( + YawRate&& x) +{ + + m_yaw_rate_value = std::move(x.m_yaw_rate_value); + m_yaw_rate_confidence = std::move(x.m_yaw_rate_confidence); + + return *this; +} + +bool etsi_its_cam_msgs::msg::YawRate::operator ==( + const YawRate& x) const +{ + + return (m_yaw_rate_value == x.m_yaw_rate_value && m_yaw_rate_confidence == x.m_yaw_rate_confidence); +} + +bool etsi_its_cam_msgs::msg::YawRate::operator !=( + const YawRate& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::YawRate::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::YawRateValue::getMaxCdrSerializedSize(current_alignment); + current_alignment += etsi_its_cam_msgs::msg::YawRateConfidence::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::YawRate::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::YawRate& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += etsi_its_cam_msgs::msg::YawRateValue::getCdrSerializedSize(data.yaw_rate_value(), current_alignment); + current_alignment += etsi_its_cam_msgs::msg::YawRateConfidence::getCdrSerializedSize(data.yaw_rate_confidence(), current_alignment); + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::YawRate::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_yaw_rate_value; + scdr << m_yaw_rate_confidence; + +} + +void etsi_its_cam_msgs::msg::YawRate::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_yaw_rate_value; + dcdr >> m_yaw_rate_confidence; +} + +/*! + * @brief This function copies the value in member yaw_rate_value + * @param _yaw_rate_value New value to be copied in member yaw_rate_value + */ +void etsi_its_cam_msgs::msg::YawRate::yaw_rate_value( + const etsi_its_cam_msgs::msg::YawRateValue& _yaw_rate_value) +{ + m_yaw_rate_value = _yaw_rate_value; +} + +/*! + * @brief This function moves the value in member yaw_rate_value + * @param _yaw_rate_value New value to be moved in member yaw_rate_value + */ +void etsi_its_cam_msgs::msg::YawRate::yaw_rate_value( + etsi_its_cam_msgs::msg::YawRateValue&& _yaw_rate_value) +{ + m_yaw_rate_value = std::move(_yaw_rate_value); +} + +/*! + * @brief This function returns a constant reference to member yaw_rate_value + * @return Constant reference to member yaw_rate_value + */ +const etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRate::yaw_rate_value() const +{ + return m_yaw_rate_value; +} + +/*! + * @brief This function returns a reference to member yaw_rate_value + * @return Reference to member yaw_rate_value + */ +etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRate::yaw_rate_value() +{ + return m_yaw_rate_value; +} +/*! + * @brief This function copies the value in member yaw_rate_confidence + * @param _yaw_rate_confidence New value to be copied in member yaw_rate_confidence + */ +void etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence( + const etsi_its_cam_msgs::msg::YawRateConfidence& _yaw_rate_confidence) +{ + m_yaw_rate_confidence = _yaw_rate_confidence; +} + +/*! + * @brief This function moves the value in member yaw_rate_confidence + * @param _yaw_rate_confidence New value to be moved in member yaw_rate_confidence + */ +void etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence( + etsi_its_cam_msgs::msg::YawRateConfidence&& _yaw_rate_confidence) +{ + m_yaw_rate_confidence = std::move(_yaw_rate_confidence); +} + +/*! + * @brief This function returns a constant reference to member yaw_rate_confidence + * @return Constant reference to member yaw_rate_confidence + */ +const etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence() const +{ + return m_yaw_rate_confidence; +} + +/*! + * @brief This function returns a reference to member yaw_rate_confidence + * @return Reference to member yaw_rate_confidence + */ +etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence() +{ + return m_yaw_rate_confidence; +} + +size_t etsi_its_cam_msgs::msg::YawRate::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::YawRate::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::YawRate::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.h new file mode 100644 index 00000000000..fd230133b32 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRate.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_H_ + +#include "YawRateConfidence.h" +#include "YawRateValue.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(YawRate_SOURCE) +#define YawRate_DllAPI __declspec( dllexport ) +#else +#define YawRate_DllAPI __declspec( dllimport ) +#endif // YawRate_SOURCE +#else +#define YawRate_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define YawRate_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + /*! + * @brief This class represents the structure YawRate defined by the user in the IDL file. + * @ingroup YAWRATE + */ + class YawRate + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport YawRate(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~YawRate(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. + */ + eProsima_user_DllExport YawRate( + const YawRate& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. + */ + eProsima_user_DllExport YawRate( + YawRate&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. + */ + eProsima_user_DllExport YawRate& operator =( + const YawRate& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. + */ + eProsima_user_DllExport YawRate& operator =( + YawRate&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRate object to compare. + */ + eProsima_user_DllExport bool operator ==( + const YawRate& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRate object to compare. + */ + eProsima_user_DllExport bool operator !=( + const YawRate& x) const; + + /*! + * @brief This function copies the value in member yaw_rate_value + * @param _yaw_rate_value New value to be copied in member yaw_rate_value + */ + eProsima_user_DllExport void yaw_rate_value( + const etsi_its_cam_msgs::msg::YawRateValue& _yaw_rate_value); + + /*! + * @brief This function moves the value in member yaw_rate_value + * @param _yaw_rate_value New value to be moved in member yaw_rate_value + */ + eProsima_user_DllExport void yaw_rate_value( + etsi_its_cam_msgs::msg::YawRateValue&& _yaw_rate_value); + + /*! + * @brief This function returns a constant reference to member yaw_rate_value + * @return Constant reference to member yaw_rate_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRateValue& yaw_rate_value() const; + + /*! + * @brief This function returns a reference to member yaw_rate_value + * @return Reference to member yaw_rate_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRateValue& yaw_rate_value(); + /*! + * @brief This function copies the value in member yaw_rate_confidence + * @param _yaw_rate_confidence New value to be copied in member yaw_rate_confidence + */ + eProsima_user_DllExport void yaw_rate_confidence( + const etsi_its_cam_msgs::msg::YawRateConfidence& _yaw_rate_confidence); + + /*! + * @brief This function moves the value in member yaw_rate_confidence + * @param _yaw_rate_confidence New value to be moved in member yaw_rate_confidence + */ + eProsima_user_DllExport void yaw_rate_confidence( + etsi_its_cam_msgs::msg::YawRateConfidence&& _yaw_rate_confidence); + + /*! + * @brief This function returns a constant reference to member yaw_rate_confidence + * @return Constant reference to member yaw_rate_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRateConfidence& yaw_rate_confidence() const; + + /*! + * @brief This function returns a reference to member yaw_rate_confidence + * @return Reference to member yaw_rate_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRateConfidence& yaw_rate_confidence(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::YawRate& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + etsi_its_cam_msgs::msg::YawRateValue m_yaw_rate_value; + etsi_its_cam_msgs::msg::YawRateConfidence m_yaw_rate_confidence; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.cxx new file mode 100644 index 00000000000..a6e6e176577 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.cxx @@ -0,0 +1,193 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateConfidence.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "YawRateConfidence.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + +etsi_its_cam_msgs::msg::YawRateConfidence::YawRateConfidence() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@654c1a54 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::YawRateConfidence::~YawRateConfidence() +{ +} + +etsi_its_cam_msgs::msg::YawRateConfidence::YawRateConfidence( + const YawRateConfidence& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::YawRateConfidence::YawRateConfidence( + YawRateConfidence&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRateConfidence::operator =( + const YawRateConfidence& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRateConfidence::operator =( + YawRateConfidence&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::YawRateConfidence::operator ==( + const YawRateConfidence& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::YawRateConfidence::operator !=( + const YawRateConfidence& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::YawRateConfidence::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::YawRateConfidence::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::YawRateConfidence& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::YawRateConfidence::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::YawRateConfidence::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::YawRateConfidence::value( + uint8_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +uint8_t etsi_its_cam_msgs::msg::YawRateConfidence::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +uint8_t& etsi_its_cam_msgs::msg::YawRateConfidence::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::YawRateConfidence::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::YawRateConfidence::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::YawRateConfidence::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.h new file mode 100644 index 00000000000..6f9b788e944 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.h @@ -0,0 +1,221 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateConfidence.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(YawRateConfidence_SOURCE) +#define YawRateConfidence_DllAPI __declspec( dllexport ) +#else +#define YawRateConfidence_DllAPI __declspec( dllimport ) +#endif // YawRateConfidence_SOURCE +#else +#define YawRateConfidence_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define YawRateConfidence_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace YawRateConfidence_Constants { + const uint8_t DEG_SEC_000_01 = 0; + const uint8_t DEG_SEC_000_05 = 1; + const uint8_t DEG_SEC_000_10 = 2; + const uint8_t DEG_SEC_001_00 = 3; + const uint8_t DEG_SEC_005_00 = 4; + const uint8_t DEG_SEC_010_00 = 5; + const uint8_t DEG_SEC_100_00 = 6; + const uint8_t OUT_OF_RANGE = 7; + const uint8_t UNAVAILABLE = 8; + } // namespace YawRateConfidence_Constants + /*! + * @brief This class represents the structure YawRateConfidence defined by the user in the IDL file. + * @ingroup YAWRATECONFIDENCE + */ + class YawRateConfidence + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport YawRateConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~YawRateConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. + */ + eProsima_user_DllExport YawRateConfidence( + const YawRateConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. + */ + eProsima_user_DllExport YawRateConfidence( + YawRateConfidence&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. + */ + eProsima_user_DllExport YawRateConfidence& operator =( + const YawRateConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. + */ + eProsima_user_DllExport YawRateConfidence& operator =( + YawRateConfidence&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRateConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const YawRateConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRateConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const YawRateConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::YawRateConfidence& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + uint8_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.cxx new file mode 100644 index 00000000000..e987bf872ca --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.cxx @@ -0,0 +1,188 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateConfidencePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "YawRateConfidencePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace YawRateConfidence_Constants { + + + + + + + + + + + } //End of namespace YawRateConfidence_Constants + YawRateConfidencePubSubType::YawRateConfidencePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::YawRateConfidence_"); + auto type_size = YawRateConfidence::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = YawRateConfidence::isKeyDefined(); + size_t keyLength = YawRateConfidence::getKeyMaxCdrSerializedSize() > 16 ? + YawRateConfidence::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + YawRateConfidencePubSubType::~YawRateConfidencePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool YawRateConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + YawRateConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool YawRateConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + YawRateConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function YawRateConfidencePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* YawRateConfidencePubSubType::createData() + { + return reinterpret_cast(new YawRateConfidence()); + } + + void YawRateConfidencePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool YawRateConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + YawRateConfidence* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + YawRateConfidence::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || YawRateConfidence::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.h new file mode 100644 index 00000000000..cbf8227f0a6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.h @@ -0,0 +1,119 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateConfidencePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_PUBSUBTYPES_H_ + +#include +#include + +#include "YawRateConfidence.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated YawRateConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace YawRateConfidence_Constants + { + + + + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type YawRateConfidence defined by the user in the IDL file. + * @ingroup YAWRATECONFIDENCE + */ + class YawRateConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef YawRateConfidence type; + + eProsima_user_DllExport YawRateConfidencePubSubType(); + + eProsima_user_DllExport virtual ~YawRateConfidencePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) YawRateConfidence(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.cxx new file mode 100644 index 00000000000..b0bca8db5da --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRatePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "YawRatePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + YawRatePubSubType::YawRatePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::YawRate_"); + auto type_size = YawRate::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = YawRate::isKeyDefined(); + size_t keyLength = YawRate::getKeyMaxCdrSerializedSize() > 16 ? + YawRate::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + YawRatePubSubType::~YawRatePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool YawRatePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + YawRate* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool YawRatePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + YawRate* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function YawRatePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* YawRatePubSubType::createData() + { + return reinterpret_cast(new YawRate()); + } + + void YawRatePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool YawRatePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + YawRate* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + YawRate::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || YawRate::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.h new file mode 100644 index 00000000000..7f1e2ba702f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRatePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_PUBSUBTYPES_H_ + +#include +#include + +#include "YawRate.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated YawRate is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type YawRate defined by the user in the IDL file. + * @ingroup YAWRATE + */ + class YawRatePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef YawRate type; + + eProsima_user_DllExport YawRatePubSubType(); + + eProsima_user_DllExport virtual ~YawRatePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) YawRate(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.cxx new file mode 100644 index 00000000000..d775473d2a2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.cxx @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateValue.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "YawRateValue.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + +etsi_its_cam_msgs::msg::YawRateValue::YawRateValue() +{ + // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1adb7478 + m_value = 0; + +} + +etsi_its_cam_msgs::msg::YawRateValue::~YawRateValue() +{ +} + +etsi_its_cam_msgs::msg::YawRateValue::YawRateValue( + const YawRateValue& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::YawRateValue::YawRateValue( + YawRateValue&& x) +{ + m_value = x.m_value; +} + +etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRateValue::operator =( + const YawRateValue& x) +{ + + m_value = x.m_value; + + return *this; +} + +etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRateValue::operator =( + YawRateValue&& x) +{ + + m_value = x.m_value; + + return *this; +} + +bool etsi_its_cam_msgs::msg::YawRateValue::operator ==( + const YawRateValue& x) const +{ + + return (m_value == x.m_value); +} + +bool etsi_its_cam_msgs::msg::YawRateValue::operator !=( + const YawRateValue& x) const +{ + return !(*this == x); +} + +size_t etsi_its_cam_msgs::msg::YawRateValue::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +size_t etsi_its_cam_msgs::msg::YawRateValue::getCdrSerializedSize( + const etsi_its_cam_msgs::msg::YawRateValue& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + +void etsi_its_cam_msgs::msg::YawRateValue::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_value; + +} + +void etsi_its_cam_msgs::msg::YawRateValue::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_value; +} + +/*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ +void etsi_its_cam_msgs::msg::YawRateValue::value( + int16_t _value) +{ + m_value = _value; +} + +/*! + * @brief This function returns the value of member value + * @return Value of member value + */ +int16_t etsi_its_cam_msgs::msg::YawRateValue::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +int16_t& etsi_its_cam_msgs::msg::YawRateValue::value() +{ + return m_value; +} + + +size_t etsi_its_cam_msgs::msg::YawRateValue::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool etsi_its_cam_msgs::msg::YawRateValue::isKeyDefined() +{ + return false; +} + +void etsi_its_cam_msgs::msg::YawRateValue::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.h new file mode 100644 index 00000000000..52b3fbbcc9f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.h @@ -0,0 +1,218 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateValue.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(YawRateValue_SOURCE) +#define YawRateValue_DllAPI __declspec( dllexport ) +#else +#define YawRateValue_DllAPI __declspec( dllimport ) +#endif // YawRateValue_SOURCE +#else +#define YawRateValue_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define YawRateValue_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace etsi_its_cam_msgs { + namespace msg { + namespace YawRateValue_Constants { + const int16_t MIN = -32766; + const int16_t MAX = 32767; + const int16_t STRAIGHT = 0; + const int16_t DEG_SEC_000_01_TO_RIGHT = -1; + const int16_t DEG_SEC_000_01_TO_LEFT = 1; + const int16_t UNAVAILABLE = 32767; + } // namespace YawRateValue_Constants + /*! + * @brief This class represents the structure YawRateValue defined by the user in the IDL file. + * @ingroup YAWRATEVALUE + */ + class YawRateValue + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport YawRateValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~YawRateValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. + */ + eProsima_user_DllExport YawRateValue( + const YawRateValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. + */ + eProsima_user_DllExport YawRateValue( + YawRateValue&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. + */ + eProsima_user_DllExport YawRateValue& operator =( + const YawRateValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. + */ + eProsima_user_DllExport YawRateValue& operator =( + YawRateValue&& x); + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRateValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const YawRateValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRateValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const YawRateValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const etsi_its_cam_msgs::msg::YawRateValue& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + int16_t m_value; + }; + } // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.cxx new file mode 100644 index 00000000000..9769e0d6495 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.cxx @@ -0,0 +1,185 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateValuePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "YawRateValuePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace etsi_its_cam_msgs { + namespace msg { + namespace YawRateValue_Constants { + + + + + + + + } //End of namespace YawRateValue_Constants + YawRateValuePubSubType::YawRateValuePubSubType() + { + setName("etsi_its_cam_msgs::msg::dds_::YawRateValue_"); + auto type_size = YawRateValue::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = YawRateValue::isKeyDefined(); + size_t keyLength = YawRateValue::getKeyMaxCdrSerializedSize() > 16 ? + YawRateValue::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + YawRateValuePubSubType::~YawRateValuePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool YawRateValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + YawRateValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool YawRateValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + YawRateValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function YawRateValuePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* YawRateValuePubSubType::createData() + { + return reinterpret_cast(new YawRateValue()); + } + + void YawRateValuePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool YawRateValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + YawRateValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + YawRateValue::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || YawRateValue::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace etsi_its_cam_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.h new file mode 100644 index 00000000000..54504cc5def --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.h @@ -0,0 +1,116 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateValuePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_PUBSUBTYPES_H_ + +#include +#include + +#include "YawRateValue.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated YawRateValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace etsi_its_cam_msgs +{ + namespace msg + { + namespace YawRateValue_Constants + { + + + + + + + } + /*! + * @brief This class represents the TopicDataType of the type YawRateValue defined by the user in the IDL file. + * @ingroup YAWRATEVALUE + */ + class YawRateValuePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef YawRateValue type; + + eProsima_user_DllExport YawRateValuePubSubType(); + + eProsima_user_DllExport virtual ~YawRateValuePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) YawRateValue(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/fastcdr/Cdr.h b/LibCarla/source/carla/ros2/fastdds/fastcdr/Cdr.h new file mode 100644 index 00000000000..f9e2d9e52f3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/fastcdr/Cdr.h @@ -0,0 +1,3065 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTCDR_CDR_H_ +#define _FASTCDR_CDR_H_ + +#include +#include +#include +#include +#include +#include "fastcdr/FastBuffer.h" +#include "fastcdr/exceptions/NotEnoughMemoryException.h" +#include "fastcdr/fastcdr_dll.h" + +#if !__APPLE__ && !__FreeBSD__ && !__VXWORKS__ +#include +#else +#include +#endif // if !__APPLE__ && !__FreeBSD__ && !__VXWORKS__ + +#include + +namespace eprosima { +namespace fastcdr { +/*! + * @brief This class offers an interface to serialize/deserialize some basic types using CDR protocol inside an + * eprosima::fastcdr::FastBuffer. + * @ingroup FASTCDRAPIREFERENCE + */ +class Cdr_DllAPI Cdr { +public: + //! @brief This enumeration represents the two kinds of CDR serialization supported by eprosima::fastcdr::CDR. + typedef enum { + //! @brief Common CORBA CDR serialization. + CORBA_CDR, + //! @brief DDS CDR serialization. + DDS_CDR + } CdrType; + + //! @brief This enumeration represents the two posible values of the flag that points if the content is a parameter + //! list (only in DDS CDR). + + typedef enum : uint8_t { + //! @brief Specifies that the content is not a parameter list. + DDS_CDR_WITHOUT_PL = 0x0, + //! @brief Specifies that the content is a parameter list. + DDS_CDR_WITH_PL = 0x2 + } DDSCdrPlFlag; + + /*! + * @brief This enumeration represents endianness types. + */ + typedef enum : uint8_t { + //! @brief Big endianness. + BIG_ENDIANNESS = 0x0, + //! @brief Little endianness. + LITTLE_ENDIANNESS = 0x1 + } Endianness; + + //! @brief Default endiness in the system. + static const Endianness DEFAULT_ENDIAN; + + /*! + * @brief This class stores the current state of a CDR serialization. + */ + class Cdr_DllAPI state { + friend class Cdr; + + public: + /*! + * @brief Default constructor. + */ + state(const Cdr& cdr); + + /*! + * @brief Copy constructor. + */ + state(const state&); + + private: + state& operator=(const state&) = delete; + + //! @brief The position in the buffer when the state was created. + const FastBuffer::iterator m_currentPosition; + + //! @brief The position from the aligment is calculated, when the state was created.. + const FastBuffer::iterator m_alignPosition; + + //! @brief This attribute specified if it is needed to swap the bytes when the state was created.. + bool m_swapBytes; + + //! @brief Stores the last datasize serialized/deserialized when the state was created. + size_t m_lastDataSize; + }; + + /*! + * @brief This constructor creates an eprosima::fastcdr::Cdr object that can serialize/deserialize + * the assigned buffer. + * + * @param cdrBuffer A reference to the buffer that contains (or will contain) the CDR representation. + * @param endianness The initial endianness that will be used. The default value is the endianness of the system. + * @param cdrType Represents the type of CDR that will be used in serialization/deserialization. The default value is + * CORBA CDR. + */ + Cdr(FastBuffer& cdrBuffer, const Endianness endianness = DEFAULT_ENDIAN, const CdrType cdrType = CORBA_CDR); + + /*! + * @brief This function reads the encapsulation of the CDR stream. + * If the CDR stream contains an encapsulation, then this function should be called before starting to + * deserialize. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. + */ + Cdr& read_encapsulation(); + + /*! + * @brief This function writes the encapsulation of the CDR stream. + * If the CDR stream should contain an encapsulation, then this function should be called before starting to + * serialize. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize_encapsulation(); + + /*! + * @brief This function returns the parameter list flag when the CDR type is eprosima::fastcdr::DDS_CDR. + * @return The flag that specifies if the content is a parameter list. + */ + DDSCdrPlFlag getDDSCdrPlFlag() const; + + /*! + * @brief This function sets the parameter list flag when the CDR type is eprosima::fastcdr::DDS_CDR. + * @param plFlag New value for the flag that specifies if the content is a parameter list. + */ + void setDDSCdrPlFlag(DDSCdrPlFlag plFlag); + + /*! + * @brief This function returns the option flags when the CDR type is eprosima::fastcdr::DDS_CDR. + * @return The option flags. + */ + uint16_t getDDSCdrOptions() const; + + /*! + * @brief This function sets the option flags when the CDR type is eprosima::fastcdr::DDS_CDR. + * @param options New value for the option flags. + */ + void setDDSCdrOptions(uint16_t options); + + /*! + * @brief This function sets the current endianness used by the CDR type. + * @param endianness The new endianness value. + */ + void changeEndianness(Endianness endianness); + + /*! + * @brief This function returns the current endianness used by the CDR type. + * @return The endianness. + */ + Endianness endianness() const { + return static_cast(m_endianness); + } + + /*! + * @brief This function skips a number of bytes in the CDR stream buffer. + * @param numBytes The number of bytes that will be jumped. + * @return True is returned when it works successfully. Otherwise, false is returned. + */ + bool jump(size_t numBytes); + + /*! + * @brief This function resets the current position in the buffer to the beginning. + */ + void reset(); + + /*! + * @brief This function returns the pointer to the current used buffer. + * @return Pointer to the starting position of the buffer. + */ + char* getBufferPointer(); + + /*! + * @brief This function returns the current position in the CDR stream. + * @return Pointer to the current position in the buffer. + */ + char* getCurrentPosition(); + + /*! + * @brief This function returns the length of the serialized data inside the stream. + * @return The length of the serialized data. + */ + inline size_t getSerializedDataLength() const { + return m_currentPosition - m_cdrBuffer.begin(); + } + + /*! + * @brief Get the number of bytes needed to align a position to certain data size. + * @param current_alignment Position to be aligned. + * @param dataSize Size of next data to process (should be power of two). + * @return Number of required alignment bytes. + */ + inline static size_t alignment(size_t current_alignment, size_t dataSize) { + return (dataSize - (current_alignment % dataSize)) & (dataSize - 1); + } + + /*! + * @brief This function returns the current state of the CDR serialization process. + * @return The current state of the CDR serialization process. + */ + state getState(); + + /*! + * @brief This function sets a previous state of the CDR serialization process; + * @param state Previous state that will be set. + */ + void setState(state& state); + + /*! + * @brief This function moves the alignment forward. + * @param numBytes The number of bytes the alignment should advance. + * @return True If alignment was moved successfully. + */ + bool moveAlignmentForward(size_t numBytes); + + /*! + * @brief This function resets the alignment to the current position in the buffer. + */ + inline void resetAlignment() { + m_alignPosition = m_currentPosition; + } + + /*! + * @brief This operator serializes an octet. + * @param octet_t The value of the octet that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const uint8_t octet_t) { + return serialize(octet_t); + } + + /*! + * @brief This operator serializes a character. + * @param char_t The value of the character that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const char char_t) { + return serialize(char_t); + } + + /*! + * @brief This operator serializes a int8_t. + * @param int8 The value of the int8_t that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const int8_t int8) { + return serialize(int8); + } + + /*! + * @brief This operator serializes an unsigned short. + * @param ushort_t The value of the unsigned short that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const uint16_t ushort_t) { + return serialize(ushort_t); + } + + /*! + * @brief This operator serializes a short. + * @param short_t The value of the short that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const int16_t short_t) { + return serialize(short_t); + } + + /*! + * @brief This operator serializes an unsigned long. + * @param ulong_t The value of the unsigned long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const uint32_t ulong_t) { + return serialize(ulong_t); + } + + /*! + * @brief This operator serializes a long. + * @param long_t The value of the long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const int32_t long_t) { + return serialize(long_t); + } + + /*! + * @brief This operator serializes a wide-char. + * @param wchar The value of the wide-char that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const wchar_t wchar) { + return serialize(wchar); + } + + /*! + * @brief This operator serializes an unsigned long long. + * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const uint64_t ulonglong_t) { + return serialize(ulonglong_t); + } + + /*! + * @brief This operator serializes a long long. + * @param longlong_t The value of the long long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const int64_t longlong_t) { + return serialize(longlong_t); + } + + /*! + * @brief This operator serializes a float. + * @param float_t The value of the float that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const float float_t) { + return serialize(float_t); + } + + /*! + * @brief This operator serializes a double. + * @param double_t The value of the double that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const double double_t) { + return serialize(double_t); + } + + /*! + * @brief This operator serializes a long double. + * @param ldouble_t The value of the long double that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const long double ldouble_t) { + return serialize(ldouble_t); + } + + /*! + * @brief This operator serializes a boolean. + * @param bool_t The value of the boolean that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const bool bool_t) { + return serialize(bool_t); + } + + /*! + * @brief This operator serializes a null-terminated c-string. + * @param string_t Pointer to the begining of the string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const char* string_t) { + return serialize(string_t); + } + + /*! + * @brief This operator serializes a null-terminated c-string. + * @param string_t Pointer to the begining of the string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(char* string_t) { + return serialize(string_t); + } + + /*! + * @brief This operator serializes a string. + * @param string_t The string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const std::string& string_t) { + return serialize(string_t); + } + + /*! + * @brief This operator serializes a wstring. + * @param string_t The wstring that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator<<(const std::wstring& string_t) { + return serialize(string_t); + } + + /*! + * @brief This operator template is used to serialize arrays. + * @param array_t The array that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& operator<<(const std::array<_T, _Size>& array_t) { + return serialize<_T, _Size>(array_t); + } + + /*! + * @brief This operator template is used to serialize sequences. + * @param vector_t The sequence that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& operator<<(const std::vector<_T, _Alloc>& vector_t) { + return serialize<_T>(vector_t); + } + + /*! + * @brief This operator template is used to serialize maps. + * @param map_t The map that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& operator<<(const std::map<_K, _T>& map_t) { + return serialize<_K, _T>(map_t); + } + + /*! + * @brief This operator template is used to serialize any other non-basic type. + * @param type_t A reference to the object that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& operator<<(const _T& type_t) { + type_t.serialize(*this); + return *this; + } + + /*! + * @brief This operator deserializes an octet. + * @param octet_t The variable that will store the octet read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(uint8_t& octet_t) { + return deserialize(octet_t); + } + + /*! + * @brief This operator deserializes a character. + * @param char_t The variable that will store the character read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(char& char_t) { + return deserialize(char_t); + } + + /*! + * @brief This operator deserializes a int8_t. + * @param int8 The variable that will store the int8_t read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(int8_t& int8) { + return deserialize(int8); + } + + /*! + * @brief This operator deserializes an unsigned short. + * @param ushort_t The variable that will store the unsigned short read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(uint16_t& ushort_t) { + return deserialize(ushort_t); + } + + /*! + * @brief This operator deserializes a short. + * @param short_t The variable that will store the short read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(int16_t& short_t) { + return deserialize(short_t); + } + + /*! + * @brief This operator deserializes an unsigned long. + * @param ulong_t The variable that will store the unsigned long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(uint32_t& ulong_t) { + return deserialize(ulong_t); + } + + /*! + * @brief This operator deserializes a long. + * @param long_t The variable that will store the long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(int32_t& long_t) { + return deserialize(long_t); + } + + // TODO in FastCdr + /*! + * @brief This operator deserializes a wide-char. + * @param wchar The variable that will store the wide-char read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(wchar_t& wchar) { + return deserialize(wchar); + } + + /*! + * @brief This operator deserializes a unsigned long long. + * @param ulonglong_t The variable that will store the unsigned long long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(uint64_t& ulonglong_t) { + return deserialize(ulonglong_t); + } + + /*! + * @brief This operator deserializes a long long. + * @param longlong_t The variable that will store the long long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(int64_t& longlong_t) { + return deserialize(longlong_t); + } + + /*! + * @brief This operator deserializes a float. + * @param float_t The variable that will store the float read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(float& float_t) { + return deserialize(float_t); + } + + /*! + * @brief This operator deserializes a double. + * @param double_t The variable that will store the double read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(double& double_t) { + return deserialize(double_t); + } + + /*! + * @brief This operator deserializes a long double. + * @param ldouble_t The variable that will store the long double read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(long double& ldouble_t) { + return deserialize(ldouble_t); + } + + /*! + * @brief This operator deserializes a boolean. + * @param bool_t The variable that will store the boolean read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. + */ + inline Cdr& operator>>(bool& bool_t) { + return deserialize(bool_t); + } + + /*! + * @brief This operator deserializes a null-terminated c-string. + * @param string_t The variable that will store the c-string read from the buffer. + * Please note that a newly allocated string will be returned. + * The caller should free the returned pointer when appropiate. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. + */ + inline Cdr& operator>>(char*& string_t) { + return deserialize(string_t); + } + + /*! + * @brief This operator deserializes a string. + * @param string_t The variable that will store the string read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(std::string& string_t) { + return deserialize(string_t); + } + + /*! + * @brief This operator deserializes a string. + * @param string_t The variable that will store the string read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& operator>>(std::wstring& string_t) { + return deserialize(string_t); + } + + /*! + * @brief This operator template is used to deserialize arrays. + * @param array_t The variable that will store the array read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& operator>>(std::array<_T, _Size>& array_t) { + return deserialize<_T, _Size>(array_t); + } + + /*! + * @brief This operator template is used to deserialize sequences. + * @param vector_t The variable that will store the sequence read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& operator>>(std::vector<_T, _Alloc>& vector_t) { + return deserialize<_T>(vector_t); + } + + /*! + * @brief This operator template is used to deserialize maps. + * @param map_t The variable that will store the map read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& operator>>(std::map<_K, _T>& map_t) { + return deserialize<_K, _T>(map_t); + } + + /*! + * @brief This operator template is used to deserialize any other non-basic type. + * @param type_t The variable that will store the object read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& operator>>(_T& type_t) { + type_t.deserialize(*this); + return *this; + } + + /*! + * @brief This function serializes an octet. + * @param octet_t The value of the octet that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const uint8_t octet_t) { + return serialize(static_cast(octet_t)); + } + + /*! + * @brief This function serializes an octet with a different endianness. + * @param octet_t The value of the octet that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const uint8_t octet_t, Endianness endianness) { + return serialize(static_cast(octet_t), endianness); + } + + /*! + * @brief This function serializes a character. + * @param char_t The value of the character that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const char char_t); + + /*! + * @brief This function serializes a character with a different endianness. + * @param char_t The value of the character that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const char char_t, Endianness endianness) { + (void)endianness; + return serialize(char_t); + } + + /*! + * @brief This function serializes an int8_t. + * @param int8 The value of the int8_t that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const int8_t int8) { + return serialize(static_cast(int8)); + } + + /*! + * @brief This function serializes an int8_t with a different endianness. + * @param int8 The value of the int8_t that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const int8_t int8, Endianness endianness) { + return serialize(static_cast(int8), endianness); + } + + /*! + * @brief This function serializes an unsigned short. + * @param ushort_t The value of the unsigned short that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const uint16_t ushort_t) { + return serialize(static_cast(ushort_t)); + } + + /*! + * @brief This function serializes an unsigned short with a different endianness. + * @param ushort_t The value of the unsigned short that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const uint16_t ushort_t, Endianness endianness) { + return serialize(static_cast(ushort_t), endianness); + } + + /*! + * @brief This function serializes a short. + * @param short_t The value of the short that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const int16_t short_t); + + /*! + * @brief This function serializes a short with a different endianness. + * @param short_t The value of the short that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const int16_t short_t, Endianness endianness); + + /*! + * @brief This function serializes an unsigned long. + * @param ulong_t The value of the unsigned long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const uint32_t ulong_t) { + return serialize(static_cast(ulong_t)); + } + + /*! + * @brief This function serializes an unsigned long with a different endianness. + * @param ulong_t The value of the unsigned long that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const uint32_t ulong_t, Endianness endianness) { + return serialize(static_cast(ulong_t), endianness); + } + + /*! + * @brief This function serializes a long. + * @param long_t The value of the long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const int32_t long_t); + + /*! + * @brief This function serializes a long with a different endianness. + * @param long_t The value of the long that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const int32_t long_t, Endianness endianness); + + /*! + * @brief This function serializes a wide-char. + * @param wchar The value of the wide-char that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const wchar_t wchar) { + return serialize(static_cast(wchar)); + } + + /*! + * @brief This function serializes a wide-char with a different endianness. + * @param wchar The value of the wide-char that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const wchar_t wchar, Endianness endianness) { + return serialize(static_cast(wchar), endianness); + } + + /*! + * @brief This function serializes an unsigned long long. + * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const uint64_t ulonglong_t) { + return serialize(static_cast(ulonglong_t)); + } + + /*! + * @brief This function serializes an unsigned long long with a different endianness. + * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const uint64_t ulonglong_t, Endianness endianness) { + return serialize(static_cast(ulonglong_t), endianness); + } + + /*! + * @brief This function serializes a long long. + * @param longlong_t The value of the long long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const int64_t longlong_t); + + /*! + * @brief This function serializes a long long with a different endianness. + * @param longlong_t The value of the long long that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const int64_t longlong_t, Endianness endianness); + + /*! + * @brief This function serializes a float. + * @param float_t The value of the float that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const float float_t); + + /*! + * @brief This function serializes a float with a different endianness. + * @param float_t The value of the float that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const float float_t, Endianness endianness); + + /*! + * @brief This function serializes a double. + * @param double_t The value of the double that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const double double_t); + + /*! + * @brief This function serializes a double with a different endianness. + * @param double_t The value of the double that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const double double_t, Endianness endianness); + + /*! + * @brief This function serializes a long double. + * @param ldouble_t The value of the long double that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. + */ + Cdr& serialize(const long double ldouble_t); + + /*! + * @brief This function serializes a long double with a different endianness. + * @param ldouble_t The value of the long double that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. + */ + Cdr& serialize(const long double ldouble_t, Endianness endianness); + + /*! + * @brief This function serializes a boolean. + * @param bool_t The value of the boolean that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const bool bool_t); + + /*! + * @brief This function serializes a boolean with a different endianness. + * @param bool_t The value of the boolean that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const bool bool_t, Endianness endianness) { + (void)endianness; + return serialize(bool_t); + } + + /*! + * @brief This function serializes a string. + * @param string_t The pointer to the string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(char* string_t) { + return serialize(static_cast(string_t)); + } + + /*! + * @brief This function serializes a string. + * @param string_t The pointer to the string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const char* string_t); + + /*! + * @brief This function serializes a wstring. + * @param string_t The pointer to the wstring that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const wchar_t* string_t); + + /*! + * @brief This function serializes a string with a different endianness. + * @param string_t The pointer to the string that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const char* string_t, Endianness endianness); + + /*! + * @brief This function serializes a wstring with a different endianness. + * @param string_t The pointer to the wstring that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serialize(const wchar_t* string_t, Endianness endianness); + + /*! + * @brief This function serializes a std::string. + * @param string_t The string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const std::string& string_t) { + return serialize(string_t.c_str()); + } + + /*! + * @brief This function serializes a std::wstring. + * @param string_t The wstring that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const std::wstring& string_t) { + return serialize(string_t.c_str()); + } + + /*! + * @brief This function serializes a std::string with a different endianness. + * @param string_t The string that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serialize(const std::string& string_t, Endianness endianness) { + return serialize(string_t.c_str(), endianness); + } + + /*! + * @brief This function template serializes an array. + * @param array_t The array that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& serialize(const std::array<_T, _Size>& array_t) { + return serializeArray(array_t.data(), array_t.size()); + } + + /*! + * @brief This function template serializes an array with a different endianness. + * @param array_t The array that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& serialize(const std::array<_T, _Size>& array_t, Endianness endianness) { + return serializeArray(array_t.data(), array_t.size(), endianness); + } + + /*! + * @brief This function template serializes a sequence of booleans. + * @param vector_t The sequence that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serialize(const std::vector& vector_t) { + return serializeBoolSequence(vector_t); + } + + /*! + * @brief This function template serializes a sequence. + * @param vector_t The sequence that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serialize(const std::vector<_T, _Alloc>& vector_t) { + state state_before_error(*this); + + *this << static_cast(vector_t.size()); + + try { + return serializeArray(vector_t.data(), vector_t.size()); + } catch (eprosima::fastcdr::exception::Exception& ex) { + setState(state_before_error); + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template serializes a map. + * @param map_t The map that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serialize(const std::map<_K, _T>& map_t) { + state state_(*this); + + *this << static_cast(map_t.size()); + + try { + for (auto it_pair = map_t.begin(); it_pair != map_t.end(); ++it_pair) { + *this << it_pair->first; + *this << it_pair->second; + } + // return serializeArray(map_t.data(), map_t.size()); + } catch (eprosima::fastcdr::exception::Exception& ex) { + setState(state_); + ex.raise(); + } + + return *this; + } + +#ifdef _MSC_VER + /*! + * @brief This function template serializes a sequence of booleans. + * @param vector_t The sequence that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template <> + Cdr& serialize(const std::vector& vector_t) { + return serializeBoolSequence(vector_t); + } + +#endif // ifdef _MSC_VER + + /*! + * @brief This function template serializes a sequence with a different endianness. + * @param vector_t The sequence that will be serialized in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serialize(const std::vector<_T, _Alloc>& vector_t, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + serialize(vector_t); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template serializes a non-basic object. + * @param type_t The object that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& serialize(const _T& type_t) { + type_t.serialize(*this); + return *this; + } + + /*! + * @brief This function serializes an array of octets. + * @param octet_t The sequence of octets that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const uint8_t* octet_t, size_t numElements) { + return serializeArray(reinterpret_cast(octet_t), numElements); + } + + /*! + * @brief This function serializes an array of octets with a different endianness. + * @param octet_t The array of octets that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const uint8_t* octet_t, size_t numElements, Endianness endianness) { + (void)endianness; + return serializeArray(reinterpret_cast(octet_t), numElements); + } + + /*! + * @brief This function serializes an array of characters. + * @param char_t The array of characters that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const char* char_t, size_t numElements); + + /*! + * @brief This function serializes an array of characters with a different endianness. + * @param char_t The array of characters that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const char* char_t, size_t numElements, Endianness endianness) { + (void)endianness; + return serializeArray(char_t, numElements); + } + + /*! + * @brief This function serializes an array of int8_t. + * @param int8 The sequence of int8_t that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const int8_t* int8, size_t numElements) { + return serializeArray(reinterpret_cast(int8), numElements); + } + + /*! + * @brief This function serializes an array of int8_t with a different endianness. + * @param int8 The array of int8_t that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const int8_t* int8, size_t numElements, Endianness endianness) { + (void)endianness; + return serializeArray(reinterpret_cast(int8), numElements); + } + + /*! + * @brief This function serializes an array of unsigned shorts. + * @param ushort_t The array of unsigned shorts that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const uint16_t* ushort_t, size_t numElements) { + return serializeArray(reinterpret_cast(ushort_t), numElements); + } + + /*! + * @brief This function serializes an array of unsigned shorts with a different endianness. + * @param ushort_t The array of unsigned shorts that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const uint16_t* ushort_t, size_t numElements, Endianness endianness) { + return serializeArray(reinterpret_cast(ushort_t), numElements, endianness); + } + + /*! + * @brief This function serializes an array of shorts. + * @param short_t The array of shorts that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const int16_t* short_t, size_t numElements); + + /*! + * @brief This function serializes an array of shorts with a different endianness. + * @param short_t The array of shorts that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const int16_t* short_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function serializes an array of unsigned longs. + * @param ulong_t The array of unsigned longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const uint32_t* ulong_t, size_t numElements) { + return serializeArray(reinterpret_cast(ulong_t), numElements); + } + + /*! + * @brief This function serializes an array of unsigned longs with a different endianness. + * @param ulong_t The array of unsigned longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const uint32_t* ulong_t, size_t numElements, Endianness endianness) { + return serializeArray(reinterpret_cast(ulong_t), numElements, endianness); + } + + /*! + * @brief This function serializes an array of longs. + * @param long_t The array of longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const int32_t* long_t, size_t numElements); + + /*! + * @brief This function serializes an array of longs with a different endianness. + * @param long_t The array of longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const int32_t* long_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function serializes an array of wide-chars. + * @param wchar The array of wide-chars that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const wchar_t* wchar, size_t numElements); + + /*! + * @brief This function serializes an array of wide-chars with a different endianness. + * @param wchar The array of longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const wchar_t* wchar, size_t numElements, Endianness endianness); + + /*! + * @brief This function serializes an array of unsigned long longs. + * @param ulonglong_t The array of unsigned long longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const uint64_t* ulonglong_t, size_t numElements) { + return serializeArray(reinterpret_cast(ulonglong_t), numElements); + } + + /*! + * @brief This function serializes an array of unsigned long longs with a different endianness. + * @param ulonglong_t The array of unsigned long longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const uint64_t* ulonglong_t, size_t numElements, Endianness endianness) { + return serializeArray(reinterpret_cast(ulonglong_t), numElements, endianness); + } + + /*! + * @brief This function serializes an array of long longs. + * @param longlong_t The array of long longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const int64_t* longlong_t, size_t numElements); + + /*! + * @brief This function serializes an array of long longs with a different endianness. + * @param longlong_t The array of long longs that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const int64_t* longlong_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function serializes an array of floats. + * @param float_t The array of floats that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const float* float_t, size_t numElements); + + /*! + * @brief This function serializes an array of floats with a different endianness. + * @param float_t The array of floats that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const float* float_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function serializes an array of doubles. + * @param double_t The array of doubles that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const double* double_t, size_t numElements); + + /*! + * @brief This function serializes an array of doubles with a different endianness. + * @param double_t The array of doubles that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const double* double_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function serializes an array of long doubles. + * @param ldouble_t The array of long doubles that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const long double* ldouble_t, size_t numElements); + + /*! + * @brief This function serializes an array of long doubles with a different endianness. + * @param ldouble_t The array of long doubles that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const long double* ldouble_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function serializes an array of booleans. + * @param bool_t The array of booleans that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + Cdr& serializeArray(const bool* bool_t, size_t numElements); + + /*! + * @brief This function serializes an array of booleans with a different endianness. + * @param bool_t The array of booleans that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const bool* bool_t, size_t numElements, Endianness endianness) { + (void)endianness; + return serializeArray(bool_t, numElements); + } + + /*! + * @brief This function serializes an array of strings. + * @param string_t The array of strings that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const std::string* string_t, size_t numElements) { + for (size_t count = 0; count < numElements; ++count) { + serialize(string_t[count].c_str()); + } + return *this; + } + + /*! + * @brief This function serializes an array of wide-strings. + * @param string_t The array of wide-strings that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const std::wstring* string_t, size_t numElements) { + for (size_t count = 0; count < numElements; ++count) { + serialize(string_t[count].c_str()); + } + return *this; + } + + /*! + * @brief This function serializes an array of strings with a different endianness. + * @param string_t The array of strings that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const std::string* string_t, size_t numElements, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + serializeArray(string_t, numElements); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function serializes an array of wide-strings with a different endianness. + * @param string_t The array of wide-strings that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + inline Cdr& serializeArray(const std::wstring* string_t, size_t numElements, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + serializeArray(string_t, numElements); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template serializes an array of sequences of objects. + * @param vector_t The array of sequences of objects that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serializeArray(const std::vector<_T, _Alloc>* vector_t, size_t numElements) { + for (size_t count = 0; count < numElements; ++count) { + serialize(vector_t[count]); + } + return *this; + } + + /*! + * @brief This function template serializes an array of non-basic objects. + * @param type_t The array of objects that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serializeArray(const _T* type_t, size_t numElements) { + for (size_t count = 0; count < numElements; ++count) { + type_t[count].serialize(*this); + } + return *this; + } + + /*! + * @brief This function template serializes an array of non-basic objects with a different endianness. + * @param type_t The array of objects that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serializeArray(const _T* type_t, size_t numElements, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + serializeArray(type_t, numElements); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template serializes a raw sequence. + * @param sequence_t Pointer to the sequence that will be serialized in the buffer. + * @param numElements The number of elements contained in the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serializeSequence(const _T* sequence_t, size_t numElements) { + state state_before_error(*this); + + serialize(static_cast(numElements)); + + try { + return serializeArray(sequence_t, numElements); + } catch (eprosima::fastcdr::exception::Exception& ex) { + setState(state_before_error); + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template serializes a raw sequence with a different endianness. + * @param sequence_t Pointer to the sequence that will be serialized in the buffer. + * @param numElements The number of elements contained in the sequence. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serializeSequence(const _T* sequence_t, size_t numElements, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + serializeSequence(sequence_t, numElements); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function deserializes an octet. + * @param octet_t The variable that will store the octet read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(uint8_t& octet_t) { + return deserialize(reinterpret_cast(octet_t)); + } + + /*! + * @brief This function deserializes an octet with a different endianness. + * @param octet_t The variable that will store the octet read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(uint8_t& octet_t, Endianness endianness) { + return deserialize(reinterpret_cast(octet_t), endianness); + } + + /*! + * @brief This function deserializes a character. + * @param char_t The variable that will store the character read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(char& char_t); + + /*! + * @brief This function deserializes a character with a different endianness. + * @param char_t The variable that will store the character read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(char& char_t, Endianness endianness) { + (void)endianness; + return deserialize(char_t); + } + + /*! + * @brief This function deserializes an int8_t. + * @param int8 The variable that will store the int8_t read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(int8_t& int8) { + return deserialize(reinterpret_cast(int8)); + } + + /*! + * @brief This function deserializes an int8_t with a different endianness. + * @param int8 The variable that will store the int8_t read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(int8_t& int8, Endianness endianness) { + return deserialize(reinterpret_cast(int8), endianness); + } + + /*! + * @brief This function deserializes an unsigned short. + * @param ushort_t The variable that will store the unsigned short read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(uint16_t& ushort_t) { + return deserialize(reinterpret_cast(ushort_t)); + } + + /*! + * @brief This function deserializes an unsigned short with a different endianness. + * @param ushort_t The variable that will store the unsigned short read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(uint16_t& ushort_t, Endianness endianness) { + return deserialize(reinterpret_cast(ushort_t), endianness); + } + + /*! + * @brief This function deserializes a short. + * @param short_t The variable that will store the short read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(int16_t& short_t); + + /*! + * @brief This function deserializes a short with a different endianness. + * @param short_t The variable that will store the short read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(int16_t& short_t, Endianness endianness); + + /*! + * @brief This function deserializes an unsigned long. + * @param ulong_t The variable that will store the unsigned long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(uint32_t& ulong_t) { + return deserialize(reinterpret_cast(ulong_t)); + } + + /*! + * @brief This function deserializes an unsigned long with a different endianness. + * @param ulong_t The variable that will store the unsigned long read from the buffer.. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(uint32_t& ulong_t, Endianness endianness) { + return deserialize(reinterpret_cast(ulong_t), endianness); + } + + /*! + * @brief This function deserializes a long. + * @param long_t The variable that will store the long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(int32_t& long_t); + + /*! + * @brief This function deserializes a long with a different endianness. + * @param long_t The variable that will store the long read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(int32_t& long_t, Endianness endianness); + + /*! + * @brief This function deserializes a wide-char. + * @param wchar The variable that will store the wide-char read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(wchar_t& wchar) { + uint32_t ret; + deserialize(ret); + wchar = static_cast(ret); + return *this; + } + + /*! + * @brief This function deserializes a wide-char with a different endianness. + * @param wchar The variable that will store the wide-char read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(wchar_t& wchar, Endianness endianness) { + uint32_t ret; + deserialize(ret, endianness); + wchar = static_cast(ret); + return *this; + } + + /*! + * @brief This function deserializes an unsigned long long. + * @param ulonglong_t The variable that will store the unsigned long long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(uint64_t& ulonglong_t) { + return deserialize(reinterpret_cast(ulonglong_t)); + } + + /*! + * @brief This function deserializes an unsigned long long with a different endianness. + * @param ulonglong_t The variable that will store the unsigned long long read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(uint64_t& ulonglong_t, Endianness endianness) { + return deserialize(reinterpret_cast(ulonglong_t), endianness); + } + + /*! + * @brief This function deserializes a long long. + * @param longlong_t The variable that will store the long long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(int64_t& longlong_t); + + /*! + * @brief This function deserializes a long long with a different endianness. + * @param longlong_t The variable that will store the long long read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(int64_t& longlong_t, Endianness endianness); + + /*! + * @brief This function deserializes a float. + * @param float_t The variable that will store the float read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(float& float_t); + + /*! + * @brief This function deserializes a float with a different endianness. + * @param float_t The variable that will store the float read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(float& float_t, Endianness endianness); + + /*! + * @brief This function deserializes a double. + * @param double_t The variable that will store the double read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(double& double_t); + + /*! + * @brief This function deserializes a double with a different endianness. + * @param double_t The variable that will store the double read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(double& double_t, Endianness endianness); + + /*! + * @brief This function deserializes a long double. + * @param ldouble_t The variable that will store the long double read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. + */ + Cdr& deserialize(long double& ldouble_t); + + /*! + * @brief This function deserializes a long double with a different endianness. + * @param ldouble_t The variable that will store the long double read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. + */ + Cdr& deserialize(long double& ldouble_t, Endianness endianness); + + /*! + * @brief This function deserializes a boolean. + * @param bool_t The variable that will store the boolean read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. + */ + Cdr& deserialize(bool& bool_t); + + /*! + * @brief This function deserializes a boolean with a different endianness. + * @param bool_t The variable that will store the boolean read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. + */ + inline Cdr& deserialize(bool& bool_t, Endianness endianness) { + (void)endianness; + return deserialize(bool_t); + } + + /*! + * @brief This function deserializes a string. + * This function allocates memory to store the string. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param string_t The pointer that will point to the string read from the buffer. + * The user will have to free the allocated memory using free() + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(char*& string_t); + + /*! + * @brief This function deserializes a wide string. + * This function allocates memory to store the wide string. The user pointer will be set to point this allocated + * memory. The user will have to free this allocated memory using free() + * @param string_t The pointer that will point to the wide string read from the buffer. + * The user will have to free the allocated memory using free() + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(wchar_t*& string_t); + + /*! + * @brief This function deserializes a string with a different endianness. + * This function allocates memory to store the string. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param string_t The pointer that will point to the string read from the buffer. + * @param endianness Endianness that will be used in the deserialization of this value. + * The user will have to free the allocated memory using free() + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(char*& string_t, Endianness endianness); + + /*! + * @brief This function deserializes a wide string with a different endianness. + * This function allocates memory to store the wide string. The user pointer will be set to point this allocated + * memory. The user will have to free this allocated memory using free() + * @param string_t The pointer that will point to the wide string read from the buffer. + * @param endianness Endianness that will be used in the deserialization of this value. + * The user will have to free the allocated memory using free() + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserialize(wchar_t*& string_t, Endianness endianness); + + /*! + * @brief This function deserializes a std::string. + * @param string_t The variable that will store the string read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(std::string& string_t) { + uint32_t length = 0; + const char* str = readString(length); + string_t.assign(str, length); + return *this; + } + + /*! + * @brief This function deserializes a std::string. + * @param string_t The variable that will store the string read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(std::wstring& string_t) { + uint32_t length = 0; + string_t = readWString(length); + return *this; + } + + /*! + * @brief This function deserializes a string with a different endianness. + * @param string_t The variable that will store the string read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(std::string& string_t, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + deserialize(string_t); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function deserializes a string with a different endianness. + * @param string_t The variable that will store the string read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserialize(std::wstring& string_t, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + deserialize(string_t); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template deserializes an array. + * @param array_t The variable that will store the array read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& deserialize(std::array<_T, _Size>& array_t) { + return deserializeArray(array_t.data(), array_t.size()); + } + + /*! + * @brief This function template deserializes an array with a different endianness. + * @param array_t The variable that will store the array read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& deserialize(std::array<_T, _Size>& array_t, Endianness endianness) { + return deserializeArray(array_t.data(), array_t.size(), endianness); + } + + /*! + * @brief This function template deserializes a sequence. + * @param vector_t The variable that will store the sequence read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserialize(std::vector& vector_t) { + return deserializeBoolSequence(vector_t); + } + + /*! + * @brief This function template deserializes a sequence. + * @param vector_t The variable that will store the sequence read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserialize(std::vector<_T, _Alloc>& vector_t) { + uint32_t seqLength = 0; + state state_before_error(*this); + + *this >> seqLength; + + if (seqLength == 0) { + vector_t.clear(); + return *this; + } + + if ((m_lastPosition - m_currentPosition) < seqLength) { + setState(state_before_error); + throw eprosima::fastcdr::exception::NotEnoughMemoryException( + eprosima::fastcdr::exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); + } + + try { + vector_t.resize(seqLength); + return deserializeArray(vector_t.data(), vector_t.size()); + } catch (eprosima::fastcdr::exception::Exception& ex) { + setState(state_before_error); + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template deserializes a map. + * @param map_t The variable that will store the map read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserialize(std::map<_K, _T>& map_t) { + uint32_t seqLength = 0; + state state_(*this); + + *this >> seqLength; + + try { + for (uint32_t i = 0; i < seqLength; ++i) { + _K key; + _T value; + *this >> key; + *this >> value; + map_t.emplace(std::pair<_K, _T>(std::move(key), std::move(value))); + } + } catch (eprosima::fastcdr::exception::Exception& ex) { + setState(state_); + ex.raise(); + } + + return *this; + } + +#ifdef _MSC_VER + /*! + * @brief This function template deserializes a sequence. + * @param vector_t The variable that will store the sequence read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template <> + Cdr& deserialize(std::vector& vector_t) { + return deserializeBoolSequence(vector_t); + } + +#endif // ifdef _MSC_VER + + /*! + * @brief This function template deserializes a sequence with a different endianness. + * @param vector_t The variable that will store the sequence read from the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserialize(std::vector<_T, _Alloc>& vector_t, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + deserialize(vector_t); + m_swapBytes = auxSwap; + } catch (exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template deserializes a non-basic object. + * @param type_t The variable that will store the object read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + inline Cdr& deserialize(_T& type_t) { + type_t.deserialize(*this); + return *this; + } + + /*! + * @brief This function deserializes an array of octets. + * @param octet_t The variable that will store the array of octets read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(uint8_t* octet_t, size_t numElements) { + return deserializeArray(reinterpret_cast(octet_t), numElements); + } + + /*! + * @brief This function deserializes an array of octets with a different endianness. + * @param octet_t The variable that will store the array of octets read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(uint8_t* octet_t, size_t numElements, Endianness endianness) { + return deserializeArray(reinterpret_cast(octet_t), numElements, endianness); + } + + /*! + * @brief This function deserializes an array of characters. + * @param char_t The variable that will store the array of characters read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(char* char_t, size_t numElements); + + /*! + * @brief This function deserializes an array of characters with a different endianness. + * @param char_t The variable that will store the array of characters read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(char* char_t, size_t numElements, Endianness endianness) { + (void)endianness; + return deserializeArray(char_t, numElements); + } + + /*! + * @brief This function deserializes an array of int8_t. + * @param int8 The variable that will store the array of int8_t read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(int8_t* int8, size_t numElements) { + return deserializeArray(reinterpret_cast(int8), numElements); + } + + /*! + * @brief This function deserializes an array of int8_t with a different endianness. + * @param int8 The variable that will store the array of int8_t read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(int8_t* int8, size_t numElements, Endianness endianness) { + return deserializeArray(reinterpret_cast(int8), numElements, endianness); + } + + /*! + * @brief This function deserializes an array of unsigned shorts. + * @param ushort_t The variable that will store the array of unsigned shorts read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(uint16_t* ushort_t, size_t numElements) { + return deserializeArray(reinterpret_cast(ushort_t), numElements); + } + + /*! + * @brief This function deserializes an array of unsigned shorts with a different endianness. + * @param ushort_t The variable that will store the array of unsigned shorts read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(uint16_t* ushort_t, size_t numElements, Endianness endianness) { + return deserializeArray(reinterpret_cast(ushort_t), numElements, endianness); + } + + /*! + * @brief This function deserializes an array of shorts. + * @param short_t The variable that will store the array of shorts read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(int16_t* short_t, size_t numElements); + + /*! + * @brief This function deserializes an array of shorts with a different endianness. + * @param short_t The variable that will store the array of shorts read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(int16_t* short_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function deserializes an array of unsigned longs. + * @param ulong_t The variable that will store the array of unsigned longs read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(uint32_t* ulong_t, size_t numElements) { + return deserializeArray(reinterpret_cast(ulong_t), numElements); + } + + /*! + * @brief This function deserializes an array of unsigned longs with a different endianness. + * @param ulong_t The variable that will store the array of unsigned longs read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(uint32_t* ulong_t, size_t numElements, Endianness endianness) { + return deserializeArray(reinterpret_cast(ulong_t), numElements, endianness); + } + + /*! + * @brief This function deserializes an array of longs. + * @param long_t The variable that will store the array of longs read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(int32_t* long_t, size_t numElements); + + /*! + * @brief This function deserializes an array of longs with a different endianness. + * @param long_t The variable that will store the array of longs read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(int32_t* long_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function deserializes an array of wide-chars. + * @param wchar The variable that will store the array of wide-chars read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(wchar_t* wchar, size_t numElements); + + /*! + * @brief This function deserializes an array of wide-chars with a different endianness. + * @param wchar The variable that will store the array of wide-chars read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(wchar_t* wchar, size_t numElements, Endianness endianness); + + /*! + * @brief This function deserializes an array of unsigned long longs. + * @param ulonglong_t The variable that will store the array of unsigned long longs read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(uint64_t* ulonglong_t, size_t numElements) { + return deserializeArray(reinterpret_cast(ulonglong_t), numElements); + } + + /*! + * @brief This function deserializes an array of unsigned long longs with a different endianness. + * @param ulonglong_t The variable that will store the array of unsigned long longs read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(uint64_t* ulonglong_t, size_t numElements, Endianness endianness) { + return deserializeArray(reinterpret_cast(ulonglong_t), numElements, endianness); + } + + /*! + * @brief This function deserializes an array of long longs. + * @param longlong_t The variable that will store the array of long longs read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(int64_t* longlong_t, size_t numElements); + + /*! + * @brief This function deserializes an array of long longs with a different endianness. + * @param longlong_t The variable that will store the array of long longs read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(int64_t* longlong_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function deserializes an array of floats. + * @param float_t The variable that will store the array of floats read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(float* float_t, size_t numElements); + + /*! + * @brief This function deserializes an array of floats with a different endianness. + * @param float_t The variable that will store the array of floats read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(float* float_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function deserializes an array of doubles. + * @param double_t The variable that will store the array of doubles read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(double* double_t, size_t numElements); + + /*! + * @brief This function deserializes an array of doubles with a different endianness. + * @param double_t The variable that will store the array of doubles read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(double* double_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function deserializes an array of long doubles. + * @param ldouble_t The variable that will store the array of long doubles read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(long double* ldouble_t, size_t numElements); + + /*! + * @brief This function deserializes an array of long doubles with a different endianness. + * @param ldouble_t The variable that will store the array of long doubles read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(long double* ldouble_t, size_t numElements, Endianness endianness); + + /*! + * @brief This function deserializes an array of booleans. + * @param bool_t The variable that will store the array of booleans read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + Cdr& deserializeArray(bool* bool_t, size_t numElements); + + /*! + * @brief This function deserializes an array of booleans with a different endianness. + * @param bool_t The variable that will store the array of booleans read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(bool* bool_t, size_t numElements, Endianness endianness) { + (void)endianness; + return deserializeArray(bool_t, numElements); + } + + /*! + * @brief This function deserializes an array of strings. + * @param string_t The variable that will store the array of strings read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(std::string* string_t, size_t numElements) { + for (size_t count = 0; count < numElements; ++count) { + deserialize(string_t[count]); + } + return *this; + } + + /*! + * @brief This function deserializes an array of wide-strings. + * @param string_t The variable that will store the array of wide-strings read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(std::wstring* string_t, size_t numElements) { + for (size_t count = 0; count < numElements; ++count) { + deserialize(string_t[count]); + } + return *this; + } + + /*! + * @brief This function deserializes an array of strings with a different endianness. + * @param string_t The variable that will store the array of strings read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(std::string* string_t, size_t numElements, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + deserializeArray(string_t, numElements); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function deserializes an array of wide-strings with a different endianness. + * @param string_t The variable that will store the array of wide-strings read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + inline Cdr& deserializeArray(std::wstring* string_t, size_t numElements, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + deserializeArray(string_t, numElements); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function deserializes an array of sequences of objects. + * @param vector_t The variable that will store the array of sequences of objects read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeArray(std::vector<_T, _Alloc>* vector_t, size_t numElements) { + for (size_t count = 0; count < numElements; ++count) { + deserialize(vector_t[count]); + } + return *this; + } + + /*! + * @brief This function template deserializes an array of non-basic objects. + * @param type_t The variable that will store the array of objects read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeArray(_T* type_t, size_t numElements) { + for (size_t count = 0; count < numElements; ++count) { + type_t[count].deserialize(*this); + } + return *this; + } + + /*! + * @brief This function template deserializes an array of non-basic objects with a different endianness. + * @param type_t The variable that will store the array of objects read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeArray(_T* type_t, size_t numElements, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + deserializeArray(type_t, numElements); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template deserializes a string sequence. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param numElements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeSequence(std::string*& sequence_t, size_t& numElements) { + return deserializeStringSequence(sequence_t, numElements); + } + + /*! + * @brief This function template deserializes a wide-string sequence. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param numElements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeSequence(std::wstring*& sequence_t, size_t& numElements) { + return deserializeWStringSequence(sequence_t, numElements); + } + + /*! + * @brief This function template deserializes a raw sequence. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param numElements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeSequence(_T*& sequence_t, size_t& numElements) { + uint32_t seqLength = 0; + state state_before_error(*this); + + deserialize(seqLength); + + try { + sequence_t = reinterpret_cast<_T*>(calloc(seqLength, sizeof(_T))); + deserializeArray(sequence_t, seqLength); + } catch (eprosima::fastcdr::exception::Exception& ex) { + free(sequence_t); + sequence_t = NULL; + setState(state_before_error); + ex.raise(); + } + + numElements = seqLength; + return *this; + } + +#ifdef _MSC_VER + /*! + * @brief This function template deserializes a string sequence. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param numElements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template <> + Cdr& deserializeSequence(std::string*& sequence_t, size_t& numElements) { + return deserializeStringSequence(sequence_t, numElements); + } + + /*! + * @brief This function template deserializes a wide-string sequence. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param numElements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template <> + Cdr& deserializeSequence(std::wstring*& sequence_t, size_t& numElements) { + return deserializeWStringSequence(sequence_t, numElements); + } + +#endif // ifdef _MSC_VER + + /*! + * @brief This function template deserializes a raw sequence with a different endianness. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param numElements This variable return the number of elements of the sequence. + * @param endianness Endianness that will be used in the deserialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeSequence(_T*& sequence_t, size_t& numElements, Endianness endianness) { + bool auxSwap = m_swapBytes; + m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || + (!m_swapBytes && (static_cast(m_endianness) != endianness)); + + try { + deserializeSequence(sequence_t, numElements); + m_swapBytes = auxSwap; + } catch (eprosima::fastcdr::exception::Exception& ex) { + m_swapBytes = auxSwap; + ex.raise(); + } + + return *this; + } + +private: + Cdr(const Cdr&) = delete; + + Cdr& operator=(const Cdr&) = delete; + + Cdr& serializeBoolSequence(const std::vector& vector_t); + + Cdr& deserializeBoolSequence(std::vector& vector_t); + + Cdr& deserializeStringSequence(std::string*& sequence_t, size_t& numElements); + + Cdr& deserializeWStringSequence(std::wstring*& sequence_t, size_t& numElements); + + /*! + * @brief This function template detects the content type of the STD container array and serializes the array. + * @param array_t The array that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serializeArray(const std::array<_T, _Size>* array_t, size_t numElements) { + return serializeArray(array_t->data(), numElements * array_t->size()); + } + + /*! + * @brief This function template detects the content type of the STD container array and serializes the array with a + * different endianness. + * @param array_t The array that will be serialized in the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that + * exceeds the internal memory size. + */ + template + Cdr& serializeArray(const std::array<_T, _Size>* array_t, size_t numElements, Endianness endianness) { + return serializeArray(array_t->data(), numElements * array_t->size(), endianness); + } + + /*! + * @brief This function template detects the content type of the STD container array and deserializes the array. + * @param array_t The variable that will store the array read from the buffer. + * @param numElements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeArray(std::array<_T, _Size>* array_t, size_t numElements) { + return deserializeArray(array_t->data(), numElements * array_t->size()); + } + + /*! + * @brief This function template detects the content type of STD container array and deserializes the array with a + * different endianness. + * @param array_t The variable that will store the array read from the buffer. + * @param numElements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that + * exceeds the internal memory size. + */ + template + Cdr& deserializeArray(std::array<_T, _Size>* array_t, size_t numElements, Endianness endianness) { + return deserializeArray(array_t->data(), numElements * array_t->size(), endianness); + } + + /*! + * @brief This function returns the extra bytes regarding the allignment. + * @param dataSize The size of the data that will be serialized. + * @return The size needed for the aligment. + */ + inline size_t alignment(size_t dataSize) const { + return dataSize > m_lastDataSize ? (dataSize - ((m_currentPosition - m_alignPosition) % dataSize)) & (dataSize - 1) + : 0; + } + + /*! + * @brief This function jumps the number of bytes of the alignment. These bytes should be calculated with the function + * eprosima::fastcdr::Cdr::alignment. + * @param align The number of bytes to be skipped. + */ + inline void makeAlign(size_t align) { + m_currentPosition += align; + } + + /*! + * @brief This function resizes the internal buffer. It only applies if the FastBuffer object was created with the + * default constructor. + * @param minSizeInc Minimun size increase for the internal buffer + * @return True if the resize was succesful, false if it was not + */ + bool resize(size_t minSizeInc); + + // TODO + const char* readString(uint32_t& length); + const std::wstring readWString(uint32_t& length); + + //! @brief Reference to the buffer that will be serialized/deserialized. + FastBuffer& m_cdrBuffer; + + //! @brief The type of CDR that will be use in serialization/deserialization. + CdrType m_cdrType; + + //! @brief Using DDS_CDR type, this attribute stores if the stream buffer contains a parameter list or not. + DDSCdrPlFlag m_plFlag; + + //! @brief This attribute stores the option flags when the CDR type is DDS_CDR; + uint16_t m_options; + + //! @brief The endianness that will be applied over the buffer. + uint8_t m_endianness; + + //! @brief This attribute specifies if it is needed to swap the bytes. + bool m_swapBytes; + + //! @brief Stores the last datasize serialized/deserialized. It's used to optimize. + size_t m_lastDataSize; + + //! @brief The current position in the serialization/deserialization process. + FastBuffer::iterator m_currentPosition; + + //! @brief The position from where the aligment is calculated. + FastBuffer::iterator m_alignPosition; + + //! @brief The last position in the buffer; + FastBuffer::iterator m_lastPosition; +}; +} // namespace fastcdr +} // namespace eprosima + +#endif // _CDR_CDR_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.cxx new file mode 100644 index 00000000000..10c74e1e912 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Accel.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Accel.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +geometry_msgs::msg::Accel::Accel() +{ + // m_linear com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7d0b7e3c + + // m_angular com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7d0b7e3c + + +} + +geometry_msgs::msg::Accel::~Accel() +{ + +} + +geometry_msgs::msg::Accel::Accel( + const Accel& x) +{ + m_linear = x.m_linear; + m_angular = x.m_angular; +} + +geometry_msgs::msg::Accel::Accel( + Accel&& x) +{ + m_linear = std::move(x.m_linear); + m_angular = std::move(x.m_angular); +} + +geometry_msgs::msg::Accel& geometry_msgs::msg::Accel::operator =( + const Accel& x) +{ + + m_linear = x.m_linear; + m_angular = x.m_angular; + + return *this; +} + +geometry_msgs::msg::Accel& geometry_msgs::msg::Accel::operator =( + Accel&& x) +{ + + m_linear = std::move(x.m_linear); + m_angular = std::move(x.m_angular); + + return *this; +} + +bool geometry_msgs::msg::Accel::operator ==( + const Accel& x) const +{ + + return (m_linear == x.m_linear && m_angular == x.m_angular); +} + +bool geometry_msgs::msg::Accel::operator !=( + const Accel& x) const +{ + return !(*this == x); +} + +size_t geometry_msgs::msg::Accel::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t geometry_msgs::msg::Accel::getCdrSerializedSize( + const geometry_msgs::msg::Accel& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.linear(), current_alignment); + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.angular(), current_alignment); + + return current_alignment - initial_alignment; +} + +void geometry_msgs::msg::Accel::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_linear; + scdr << m_angular; + +} + +void geometry_msgs::msg::Accel::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_linear; + dcdr >> m_angular; +} + +/*! + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear + */ +void geometry_msgs::msg::Accel::linear( + const geometry_msgs::msg::Vector3& _linear) +{ + m_linear = _linear; +} + +/*! + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear + */ +void geometry_msgs::msg::Accel::linear( + geometry_msgs::msg::Vector3&& _linear) +{ + m_linear = std::move(_linear); +} + +/*! + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear + */ +const geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::linear() const +{ + return m_linear; +} + +/*! + * @brief This function returns a reference to member linear + * @return Reference to member linear + */ +geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::linear() +{ + return m_linear; +} +/*! + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular + */ +void geometry_msgs::msg::Accel::angular( + const geometry_msgs::msg::Vector3& _angular) +{ + m_angular = _angular; +} + +/*! + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular + */ +void geometry_msgs::msg::Accel::angular( + geometry_msgs::msg::Vector3&& _angular) +{ + m_angular = std::move(_angular); +} + +/*! + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular + */ +const geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::angular() const +{ + return m_angular; +} + +/*! + * @brief This function returns a reference to member angular + * @return Reference to member angular + */ +geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::angular() +{ + return m_angular; +} + +size_t geometry_msgs::msg::Accel::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool geometry_msgs::msg::Accel::isKeyDefined() +{ + return false; +} + +void geometry_msgs::msg::Accel::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/Header.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.h similarity index 56% rename from LibCarla/source/carla/ros2/types/Header.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.h index 81a050caca3..eb08dbd8aad 100644 --- a/LibCarla/source/carla/ros2/types/Header.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.h @@ -13,18 +13,16 @@ // limitations under the License. /*! - * @file Header.h + * @file Accel.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_H_ -#include "Time.h" - -#include +#include "Vector3.h" #include #include @@ -45,16 +43,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Header_SOURCE) -#define Header_DllAPI __declspec( dllexport ) +#if defined(Accel_SOURCE) +#define Accel_DllAPI __declspec( dllexport ) #else -#define Header_DllAPI __declspec( dllimport ) -#endif // Header_SOURCE +#define Accel_DllAPI __declspec( dllimport ) +#endif // Accel_SOURCE #else -#define Header_DllAPI +#define Accel_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Header_DllAPI +#define Accel_DllAPI #endif // _WIN32 namespace eprosima { @@ -63,125 +61,126 @@ class Cdr; } // namespace fastcdr } // namespace eprosima -namespace std_msgs { + +namespace geometry_msgs { namespace msg { /*! - * @brief This class represents the structure Header defined by the user in the IDL file. - * @ingroup HEADER + * @brief This class represents the structure Accel defined by the user in the IDL file. + * @ingroup ACCEL */ - class Header + class Accel { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport Header(); + eProsima_user_DllExport Accel(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Header(); + eProsima_user_DllExport ~Accel(); /*! * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::Header that will be copied. + * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. */ - eProsima_user_DllExport Header( - const Header& x); + eProsima_user_DllExport Accel( + const Accel& x); /*! * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::Header that will be copied. + * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. */ - eProsima_user_DllExport Header( - Header&& x) noexcept; + eProsima_user_DllExport Accel( + Accel&& x); /*! * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::Header that will be copied. + * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. */ - eProsima_user_DllExport Header& operator =( - const Header& x); + eProsima_user_DllExport Accel& operator =( + const Accel& x); /*! * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::Header that will be copied. + * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. */ - eProsima_user_DllExport Header& operator =( - Header&& x) noexcept; + eProsima_user_DllExport Accel& operator =( + Accel&& x); /*! * @brief Comparison operator. - * @param x std_msgs::msg::Header object to compare. + * @param x geometry_msgs::msg::Accel object to compare. */ eProsima_user_DllExport bool operator ==( - const Header& x) const; + const Accel& x) const; /*! * @brief Comparison operator. - * @param x std_msgs::msg::Header object to compare. + * @param x geometry_msgs::msg::Accel object to compare. */ eProsima_user_DllExport bool operator !=( - const Header& x) const; + const Accel& x) const; /*! - * @brief This function copies the value in member stamp - * @param _stamp New value to be copied in member stamp + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear */ - eProsima_user_DllExport void stamp( - const builtin_interfaces::msg::Time& _stamp); + eProsima_user_DllExport void linear( + const geometry_msgs::msg::Vector3& _linear); /*! - * @brief This function moves the value in member stamp - * @param _stamp New value to be moved in member stamp + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear */ - eProsima_user_DllExport void stamp( - builtin_interfaces::msg::Time&& _stamp); + eProsima_user_DllExport void linear( + geometry_msgs::msg::Vector3&& _linear); /*! - * @brief This function returns a constant reference to member stamp - * @return Constant reference to member stamp + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear */ - eProsima_user_DllExport const builtin_interfaces::msg::Time& stamp() const; + eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear() const; /*! - * @brief This function returns a reference to member stamp - * @return Reference to member stamp + * @brief This function returns a reference to member linear + * @return Reference to member linear */ - eProsima_user_DllExport builtin_interfaces::msg::Time& stamp(); + eProsima_user_DllExport geometry_msgs::msg::Vector3& linear(); /*! - * @brief This function copies the value in member frame_id - * @param _frame_id New value to be copied in member frame_id + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular */ - eProsima_user_DllExport void frame_id( - const std::string& _frame_id); + eProsima_user_DllExport void angular( + const geometry_msgs::msg::Vector3& _angular); /*! - * @brief This function moves the value in member frame_id - * @param _frame_id New value to be moved in member frame_id + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular */ - eProsima_user_DllExport void frame_id( - std::string&& _frame_id); + eProsima_user_DllExport void angular( + geometry_msgs::msg::Vector3&& _angular); /*! - * @brief This function returns a constant reference to member frame_id - * @return Constant reference to member frame_id + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular */ - eProsima_user_DllExport const std::string& frame_id() const; + eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular() const; /*! - * @brief This function returns a reference to member frame_id - * @return Reference to member frame_id + * @brief This function returns a reference to member angular + * @return Reference to member angular */ - eProsima_user_DllExport std::string& frame_id(); + eProsima_user_DllExport geometry_msgs::msg::Vector3& angular(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -192,9 +191,10 @@ namespace std_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const std_msgs::msg::Header& data, + const geometry_msgs::msg::Accel& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -209,6 +209,8 @@ namespace std_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -231,10 +233,11 @@ namespace std_msgs { eprosima::fastcdr::Cdr& cdr) const; private: - builtin_interfaces::msg::Time m_stamp; - std::string m_frame_id; + + geometry_msgs::msg::Vector3 m_linear; + geometry_msgs::msg::Vector3 m_angular; }; } // namespace msg -} // namespace std_msgs +} // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.cxx new file mode 100644 index 00000000000..ab7bd76ee39 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "AccelPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace geometry_msgs { + namespace msg { + AccelPubSubType::AccelPubSubType() + { + setName("geometry_msgs::msg::dds_::Accel_"); + auto type_size = Accel::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Accel::isKeyDefined(); + size_t keyLength = Accel::getKeyMaxCdrSerializedSize() > 16 ? + Accel::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + AccelPubSubType::~AccelPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool AccelPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Accel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool AccelPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Accel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function AccelPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* AccelPubSubType::createData() + { + return reinterpret_cast(new Accel()); + } + + void AccelPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool AccelPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Accel* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Accel::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Accel::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/types/ImagePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.h similarity index 78% rename from LibCarla/source/carla/ros2/types/ImagePubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.h index 499844880ac..4e7a852de6f 100644 --- a/LibCarla/source/carla/ros2/types/ImagePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.h @@ -13,42 +13,43 @@ // limitations under the License. /*! - * @file ImagePubSubTypes.h + * @file AccelPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_PUBSUBTYPES_H_ #include #include -#include "Image.h" +#include "Accel.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated Image is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated Accel is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace sensor_msgs +namespace geometry_msgs { namespace msg { /*! - * @brief This class represents the TopicDataType of the type Image defined by the user in the IDL file. - * @ingroup IMAGE + * @brief This class represents the TopicDataType of the type Accel defined by the user in the IDL file. + * @ingroup ACCEL */ - class ImagePubSubType : public eprosima::fastdds::dds::TopicDataType + class AccelPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef Image type; + typedef Accel type; - eProsima_user_DllExport ImagePubSubType(); + eProsima_user_DllExport AccelPubSubType(); - eProsima_user_DllExport virtual ~ImagePubSubType() override; + eProsima_user_DllExport virtual ~AccelPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -74,7 +75,7 @@ namespace sensor_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -82,7 +83,7 @@ namespace sensor_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return false; + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -91,15 +92,16 @@ namespace sensor_msgs eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - (void)memory; - return false; + new (memory) Accel(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.cxx new file mode 100644 index 00000000000..a00aa4ca240 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.cxx @@ -0,0 +1,247 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelWithCovariance.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "AccelWithCovariance.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + +geometry_msgs::msg::AccelWithCovariance::AccelWithCovariance() +{ + // m_accel com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@738dc9b + + // m_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@3c77d488 + memset(&m_covariance, 0, (36) * 8); + +} + +geometry_msgs::msg::AccelWithCovariance::~AccelWithCovariance() +{ + +} + +geometry_msgs::msg::AccelWithCovariance::AccelWithCovariance( + const AccelWithCovariance& x) +{ + m_accel = x.m_accel; + m_covariance = x.m_covariance; +} + +geometry_msgs::msg::AccelWithCovariance::AccelWithCovariance( + AccelWithCovariance&& x) +{ + m_accel = std::move(x.m_accel); + m_covariance = std::move(x.m_covariance); +} + +geometry_msgs::msg::AccelWithCovariance& geometry_msgs::msg::AccelWithCovariance::operator =( + const AccelWithCovariance& x) +{ + + m_accel = x.m_accel; + m_covariance = x.m_covariance; + + return *this; +} + +geometry_msgs::msg::AccelWithCovariance& geometry_msgs::msg::AccelWithCovariance::operator =( + AccelWithCovariance&& x) +{ + + m_accel = std::move(x.m_accel); + m_covariance = std::move(x.m_covariance); + + return *this; +} + +bool geometry_msgs::msg::AccelWithCovariance::operator ==( + const AccelWithCovariance& x) const +{ + + return (m_accel == x.m_accel && m_covariance == x.m_covariance); +} + +bool geometry_msgs::msg::AccelWithCovariance::operator !=( + const AccelWithCovariance& x) const +{ + return !(*this == x); +} + +size_t geometry_msgs::msg::AccelWithCovariance::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Accel::getMaxCdrSerializedSize(current_alignment); + current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; +} + +size_t geometry_msgs::msg::AccelWithCovariance::getCdrSerializedSize( + const geometry_msgs::msg::AccelWithCovariance& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Accel::getCdrSerializedSize(data.accel(), current_alignment); + if ((36) > 0) + { + current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + return current_alignment - initial_alignment; +} + +void geometry_msgs::msg::AccelWithCovariance::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_accel; + scdr << m_covariance; + + +} + +void geometry_msgs::msg::AccelWithCovariance::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_accel; + dcdr >> m_covariance; + +} + +/*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ +void geometry_msgs::msg::AccelWithCovariance::accel( + const geometry_msgs::msg::Accel& _accel) +{ + m_accel = _accel; +} + +/*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ +void geometry_msgs::msg::AccelWithCovariance::accel( + geometry_msgs::msg::Accel&& _accel) +{ + m_accel = std::move(_accel); +} + +/*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ +const geometry_msgs::msg::Accel& geometry_msgs::msg::AccelWithCovariance::accel() const +{ + return m_accel; +} + +/*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ +geometry_msgs::msg::Accel& geometry_msgs::msg::AccelWithCovariance::accel() +{ + return m_accel; +} +/*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ +void geometry_msgs::msg::AccelWithCovariance::covariance( + const geometry_msgs::msg::double_accel_36& _covariance) +{ + m_covariance = _covariance; +} + +/*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ +void geometry_msgs::msg::AccelWithCovariance::covariance( + geometry_msgs::msg::double_accel_36&& _covariance) +{ + m_covariance = std::move(_covariance); +} + +/*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ +const geometry_msgs::msg::double_accel_36& geometry_msgs::msg::AccelWithCovariance::covariance() const +{ + return m_covariance; +} + +/*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ +geometry_msgs::msg::double_accel_36& geometry_msgs::msg::AccelWithCovariance::covariance() +{ + return m_covariance; +} + +size_t geometry_msgs::msg::AccelWithCovariance::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool geometry_msgs::msg::AccelWithCovariance::isKeyDefined() +{ + return false; +} + +void geometry_msgs::msg::AccelWithCovariance::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.h new file mode 100644 index 00000000000..ff059f65813 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.h @@ -0,0 +1,244 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelWithCovariance.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_H_ + +#include "Accel.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(AccelWithCovariance_SOURCE) +#define AccelWithCovariance_DllAPI __declspec( dllexport ) +#else +#define AccelWithCovariance_DllAPI __declspec( dllimport ) +#endif // AccelWithCovariance_SOURCE +#else +#define AccelWithCovariance_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define AccelWithCovariance_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace geometry_msgs { + namespace msg { + typedef std::array double_accel_36; + /*! + * @brief This class represents the structure AccelWithCovariance defined by the user in the IDL file. + * @ingroup ACCELWITHCOVARIANCE + */ + class AccelWithCovariance + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AccelWithCovariance(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AccelWithCovariance(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. + */ + eProsima_user_DllExport AccelWithCovariance( + const AccelWithCovariance& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. + */ + eProsima_user_DllExport AccelWithCovariance( + AccelWithCovariance&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. + */ + eProsima_user_DllExport AccelWithCovariance& operator =( + const AccelWithCovariance& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. + */ + eProsima_user_DllExport AccelWithCovariance& operator =( + AccelWithCovariance&& x); + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::AccelWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AccelWithCovariance& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::AccelWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AccelWithCovariance& x) const; + + /*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ + eProsima_user_DllExport void accel( + const geometry_msgs::msg::Accel& _accel); + + /*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ + eProsima_user_DllExport void accel( + geometry_msgs::msg::Accel&& _accel); + + /*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ + eProsima_user_DllExport const geometry_msgs::msg::Accel& accel() const; + + /*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ + eProsima_user_DllExport geometry_msgs::msg::Accel& accel(); + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const geometry_msgs::msg::double_accel_36& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + geometry_msgs::msg::double_accel_36&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const geometry_msgs::msg::double_accel_36& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport geometry_msgs::msg::double_accel_36& covariance(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::AccelWithCovariance& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + geometry_msgs::msg::Accel m_accel; + geometry_msgs::msg::double_accel_36 m_covariance; + }; + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.cxx new file mode 100644 index 00000000000..0447b9326fc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.cxx @@ -0,0 +1,177 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelWithCovariancePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "AccelWithCovariancePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace geometry_msgs { + namespace msg { + + AccelWithCovariancePubSubType::AccelWithCovariancePubSubType() + { + setName("geometry_msgs::msg::dds_::AccelWithCovariance_"); + auto type_size = AccelWithCovariance::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = AccelWithCovariance::isKeyDefined(); + size_t keyLength = AccelWithCovariance::getKeyMaxCdrSerializedSize() > 16 ? + AccelWithCovariance::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + AccelWithCovariancePubSubType::~AccelWithCovariancePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool AccelWithCovariancePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + AccelWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool AccelWithCovariancePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + AccelWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function AccelWithCovariancePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* AccelWithCovariancePubSubType::createData() + { + return reinterpret_cast(new AccelWithCovariance()); + } + + void AccelWithCovariancePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool AccelWithCovariancePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + AccelWithCovariance* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + AccelWithCovariance::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || AccelWithCovariance::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.h new file mode 100644 index 00000000000..15c87c82c78 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.h @@ -0,0 +1,108 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include + +#include "AccelWithCovariance.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated AccelWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + typedef std::array double_accel_36; + /*! + * @brief This class represents the TopicDataType of the type AccelWithCovariance defined by the user in the IDL file. + * @ingroup ACCELWITHCOVARIANCE + */ + class AccelWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef AccelWithCovariance type; + + eProsima_user_DllExport AccelWithCovariancePubSubType(); + + eProsima_user_DllExport virtual ~AccelWithCovariancePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) AccelWithCovariance(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Point.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.cxx similarity index 86% rename from LibCarla/source/carla/ros2/types/Point.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.cxx index ddb8fba9d85..b160f59cd8c 100644 --- a/LibCarla/source/carla/ros2/types/Point.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.cxx @@ -34,21 +34,21 @@ using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Point_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Point_max_key_cdr_typesize 0ULL; - geometry_msgs::msg::Point::Point() { - // double m_x + // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e1a0406 m_x = 0.0; - // double m_y + // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@290222c1 m_y = 0.0; - // double m_z + // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@67f639d3 m_z = 0.0; + } geometry_msgs::msg::Point::~Point() { + + } geometry_msgs::msg::Point::Point( @@ -60,7 +60,7 @@ geometry_msgs::msg::Point::Point( } geometry_msgs::msg::Point::Point( - Point&& x) noexcept + Point&& x) { m_x = x.m_x; m_y = x.m_y; @@ -70,6 +70,7 @@ geometry_msgs::msg::Point::Point( geometry_msgs::msg::Point& geometry_msgs::msg::Point::operator =( const Point& x) { + m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; @@ -78,8 +79,9 @@ geometry_msgs::msg::Point& geometry_msgs::msg::Point::operator =( } geometry_msgs::msg::Point& geometry_msgs::msg::Point::operator =( - Point&& x) noexcept + Point&& x) { + m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; @@ -90,6 +92,7 @@ geometry_msgs::msg::Point& geometry_msgs::msg::Point::operator =( bool geometry_msgs::msg::Point::operator ==( const Point& x) const { + return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z); } @@ -102,8 +105,20 @@ bool geometry_msgs::msg::Point::operator !=( size_t geometry_msgs::msg::Point::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Point_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; } size_t geometry_msgs::msg::Point::getCdrSerializedSize( @@ -112,24 +127,35 @@ size_t geometry_msgs::msg::Point::getCdrSerializedSize( { (void)data; size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + return current_alignment - initial_alignment; } void geometry_msgs::msg::Point::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_x; scdr << m_y; scdr << m_z; + } void geometry_msgs::msg::Point::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_x; dcdr >> m_y; dcdr >> m_z; @@ -219,11 +245,15 @@ double& geometry_msgs::msg::Point::z() return m_z; } + size_t geometry_msgs::msg::Point::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Point_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool geometry_msgs::msg::Point::isKeyDefined() @@ -235,4 +265,7 @@ void geometry_msgs::msg::Point::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/types/Point.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.h similarity index 94% rename from LibCarla/source/carla/ros2/types/Point.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.h index 016955ff318..38cea0c8f44 100644 --- a/LibCarla/source/carla/ros2/types/Point.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.h @@ -22,7 +22,6 @@ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_H_ -#include #include #include @@ -61,6 +60,7 @@ class Cdr; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { namespace msg { /*! @@ -93,7 +93,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::Point that will be copied. */ eProsima_user_DllExport Point( - Point&& x) noexcept; + Point&& x); /*! * @brief Copy assignment. @@ -107,7 +107,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::Point that will be copied. */ eProsima_user_DllExport Point& operator =( - Point&& x) noexcept; + Point&& x); /*! * @brief Comparison operator. @@ -180,12 +180,13 @@ namespace geometry_msgs { */ eProsima_user_DllExport double& z(); + /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -199,6 +200,7 @@ namespace geometry_msgs { const geometry_msgs::msg::Point& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -213,6 +215,8 @@ namespace geometry_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -235,6 +239,7 @@ namespace geometry_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + double m_x; double m_y; double m_z; @@ -242,4 +247,4 @@ namespace geometry_msgs { } // namespace msg } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Point32.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.cxx similarity index 86% rename from LibCarla/source/carla/ros2/types/Point32.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.cxx index 0aa824cb038..9d779321703 100644 --- a/LibCarla/source/carla/ros2/types/Point32.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.cxx @@ -34,21 +34,21 @@ using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Point32_max_cdr_typesize 12ULL; -#define geometry_msgs_msg_Point32_max_key_cdr_typesize 0ULL; - geometry_msgs::msg::Point32::Point32() { - // float m_x + // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3012646b m_x = 0.0; - // float m_y + // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4a883b15 m_y = 0.0; - // float m_z + // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@25641d39 m_z = 0.0; + } geometry_msgs::msg::Point32::~Point32() { + + } geometry_msgs::msg::Point32::Point32( @@ -60,7 +60,7 @@ geometry_msgs::msg::Point32::Point32( } geometry_msgs::msg::Point32::Point32( - Point32&& x) noexcept + Point32&& x) { m_x = x.m_x; m_y = x.m_y; @@ -70,6 +70,7 @@ geometry_msgs::msg::Point32::Point32( geometry_msgs::msg::Point32& geometry_msgs::msg::Point32::operator =( const Point32& x) { + m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; @@ -78,8 +79,9 @@ geometry_msgs::msg::Point32& geometry_msgs::msg::Point32::operator =( } geometry_msgs::msg::Point32& geometry_msgs::msg::Point32::operator =( - Point32&& x) noexcept + Point32&& x) { + m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; @@ -90,6 +92,7 @@ geometry_msgs::msg::Point32& geometry_msgs::msg::Point32::operator =( bool geometry_msgs::msg::Point32::operator ==( const Point32& x) const { + return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z); } @@ -102,8 +105,20 @@ bool geometry_msgs::msg::Point32::operator !=( size_t geometry_msgs::msg::Point32::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Point32_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; } size_t geometry_msgs::msg::Point32::getCdrSerializedSize( @@ -112,24 +127,35 @@ size_t geometry_msgs::msg::Point32::getCdrSerializedSize( { (void)data; size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + return current_alignment - initial_alignment; } void geometry_msgs::msg::Point32::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_x; scdr << m_y; scdr << m_z; + } void geometry_msgs::msg::Point32::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_x; dcdr >> m_y; dcdr >> m_z; @@ -219,11 +245,15 @@ float& geometry_msgs::msg::Point32::z() return m_z; } + size_t geometry_msgs::msg::Point32::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Point32_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool geometry_msgs::msg::Point32::isKeyDefined() @@ -235,4 +265,7 @@ void geometry_msgs::msg::Point32::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/types/Point32.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.h similarity index 94% rename from LibCarla/source/carla/ros2/types/Point32.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.h index fbadcc6da30..8117cf9950c 100644 --- a/LibCarla/source/carla/ros2/types/Point32.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.h @@ -22,7 +22,6 @@ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_H_ -#include #include #include @@ -61,6 +60,7 @@ class Cdr; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { namespace msg { /*! @@ -93,7 +93,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. */ eProsima_user_DllExport Point32( - Point32&& x) noexcept; + Point32&& x); /*! * @brief Copy assignment. @@ -107,7 +107,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. */ eProsima_user_DllExport Point32& operator =( - Point32&& x) noexcept; + Point32&& x); /*! * @brief Comparison operator. @@ -180,12 +180,13 @@ namespace geometry_msgs { */ eProsima_user_DllExport float& z(); + /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -199,6 +200,7 @@ namespace geometry_msgs { const geometry_msgs::msg::Point32& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -213,6 +215,8 @@ namespace geometry_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -235,6 +239,7 @@ namespace geometry_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + float m_x; float m_y; float m_z; @@ -242,4 +247,4 @@ namespace geometry_msgs { } // namespace msg } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Point32PubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/Point32PubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.cxx index 8d852bee7c9..979bddb197e 100644 --- a/LibCarla/source/carla/ros2/types/Point32PubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -83,21 +84,21 @@ namespace geometry_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - Point32* p_type = static_cast(data); + //Convert DATA to pointer of your type + Point32* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -168,5 +169,8 @@ namespace geometry_msgs { } return true; } + + } //End of namespace msg + } //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/types/Point32PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.h similarity index 76% rename from LibCarla/source/carla/ros2/types/Point32PubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.h index 17e59244c6e..346f91f5d4d 100644 --- a/LibCarla/source/carla/ros2/types/Point32PubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.h @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_PUBSUBTYPES_H_ @@ -36,35 +37,6 @@ namespace geometry_msgs { namespace msg { - #ifndef SWIG - namespace detail { - - template - struct Point32_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Point32_f - { - typedef float Point32::* type; - friend constexpr type get( - Point32_f); - }; - - template struct Point32_rob; - - template - inline size_t constexpr Point32_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - /*! * @brief This class represents the TopicDataType of the type Point32 defined by the user in the IDL file. * @ingroup POINT32 @@ -77,7 +49,7 @@ namespace geometry_msgs eProsima_user_DllExport Point32PubSubType(); - eProsima_user_DllExport virtual ~Point32PubSubType() override; + eProsima_user_DllExport virtual ~Point32PubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -111,7 +83,7 @@ namespace geometry_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -125,14 +97,11 @@ namespace geometry_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 12ULL == (detail::Point32_offset_of() + sizeof(float)); - }}; + }; } } -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/PointPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/PointPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.cxx index cd97d27192d..6c69a36b12a 100644 --- a/LibCarla/source/carla/ros2/types/PointPubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -83,21 +84,21 @@ namespace geometry_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - Point* p_type = static_cast(data); + //Convert DATA to pointer of your type + Point* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -168,5 +169,8 @@ namespace geometry_msgs { } return true; } + + } //End of namespace msg + } //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/types/PointPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.h similarity index 75% rename from LibCarla/source/carla/ros2/types/PointPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.h index f6c2900f980..241f4d4b9e9 100644 --- a/LibCarla/source/carla/ros2/types/PointPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.h @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_ @@ -36,35 +37,6 @@ namespace geometry_msgs { namespace msg { - #ifndef SWIG - namespace detail { - - template - struct Point_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Point_f - { - typedef double Point::* type; - friend constexpr type get( - Point_f); - }; - - template struct Point_rob; - - template - inline size_t constexpr Point_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - /*! * @brief This class represents the TopicDataType of the type Point defined by the user in the IDL file. * @ingroup POINT @@ -77,7 +49,7 @@ namespace geometry_msgs eProsima_user_DllExport PointPubSubType(); - eProsima_user_DllExport virtual ~PointPubSubType() override; + eProsima_user_DllExport virtual ~PointPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -111,7 +83,7 @@ namespace geometry_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -128,15 +100,8 @@ namespace geometry_msgs MD5 m_md5; unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_impl() - { - return 24ULL == (detail::Point_offset_of() + sizeof(double)); - - }}; + }; } } -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.cxx new file mode 100644 index 00000000000..7f3821c9019 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.cxx @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Polygon.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Polygon.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +geometry_msgs::msg::Polygon::Polygon() +{ + // m_points com.eprosima.idl.parser.typecode.SequenceTypeCode@b9b00e0 + + +} + +geometry_msgs::msg::Polygon::~Polygon() +{ +} + +geometry_msgs::msg::Polygon::Polygon( + const Polygon& x) +{ + m_points = x.m_points; +} + +geometry_msgs::msg::Polygon::Polygon( + Polygon&& x) +{ + m_points = std::move(x.m_points); +} + +geometry_msgs::msg::Polygon& geometry_msgs::msg::Polygon::operator =( + const Polygon& x) +{ + + m_points = x.m_points; + + return *this; +} + +geometry_msgs::msg::Polygon& geometry_msgs::msg::Polygon::operator =( + Polygon&& x) +{ + + m_points = std::move(x.m_points); + + return *this; +} + +bool geometry_msgs::msg::Polygon::operator ==( + const Polygon& x) const +{ + + return (m_points == x.m_points); +} + +bool geometry_msgs::msg::Polygon::operator !=( + const Polygon& x) const +{ + return !(*this == x); +} + +size_t geometry_msgs::msg::Polygon::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < 100; ++a) + { + current_alignment += geometry_msgs::msg::Point32::getMaxCdrSerializedSize(current_alignment);} + + return current_alignment - initial_alignment; +} + +size_t geometry_msgs::msg::Polygon::getCdrSerializedSize( + const geometry_msgs::msg::Polygon& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.points().size(); ++a) + { + current_alignment += geometry_msgs::msg::Point32::getCdrSerializedSize(data.points().at(a), current_alignment);} + + return current_alignment - initial_alignment; +} + +void geometry_msgs::msg::Polygon::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_points; +} + +void geometry_msgs::msg::Polygon::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_points;} + +/*! + * @brief This function copies the value in member points + * @param _points New value to be copied in member points + */ +void geometry_msgs::msg::Polygon::points( + const std::vector& _points) +{ + m_points = _points; +} + +/*! + * @brief This function moves the value in member points + * @param _points New value to be moved in member points + */ +void geometry_msgs::msg::Polygon::points( + std::vector&& _points) +{ + m_points = std::move(_points); +} + +/*! + * @brief This function returns a constant reference to member points + * @return Constant reference to member points + */ +const std::vector& geometry_msgs::msg::Polygon::points() const +{ + return m_points; +} + +/*! + * @brief This function returns a reference to member points + * @return Reference to member points + */ +std::vector& geometry_msgs::msg::Polygon::points() +{ + return m_points; +} + +size_t geometry_msgs::msg::Polygon::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool geometry_msgs::msg::Polygon::isKeyDefined() +{ + return false; +} + +void geometry_msgs::msg::Polygon::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/TFMessage.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.h similarity index 60% rename from LibCarla/source/carla/ros2/types/TFMessage.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.h index adb9e9a7954..fe1202ebf6b 100644 --- a/LibCarla/source/carla/ros2/types/TFMessage.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.h @@ -13,18 +13,16 @@ // limitations under the License. /*! - * @file TFMessage.h + * @file Polygon.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ -#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_H_ -#include "TransformStamped.h" - -#include +#include "Point32.h" #include #include @@ -45,16 +43,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TFMessage_SOURCE) -#define TFMessage_DllAPI __declspec( dllexport ) +#if defined(Polygon_SOURCE) +#define Polygon_DllAPI __declspec( dllexport ) #else -#define TFMessage_DllAPI __declspec( dllimport ) -#endif // TFMessage_SOURCE +#define Polygon_DllAPI __declspec( dllimport ) +#endif // Polygon_SOURCE #else -#define TFMessage_DllAPI +#define Polygon_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TFMessage_DllAPI +#define Polygon_DllAPI #endif // _WIN32 namespace eprosima { @@ -64,100 +62,100 @@ class Cdr; } // namespace eprosima -namespace tf2_msgs { +namespace geometry_msgs { namespace msg { /*! - * @brief This class represents the structure TFMessage defined by the user in the IDL file. - * @ingroup TFMESSAGE + * @brief This class represents the structure Polygon defined by the user in the IDL file. + * @ingroup POLYGON */ - class TFMessage + class Polygon { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport TFMessage(); + eProsima_user_DllExport Polygon(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~TFMessage(); + eProsima_user_DllExport ~Polygon(); /*! * @brief Copy constructor. - * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. */ - eProsima_user_DllExport TFMessage( - const TFMessage& x); + eProsima_user_DllExport Polygon( + const Polygon& x); /*! * @brief Move constructor. - * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. */ - eProsima_user_DllExport TFMessage( - TFMessage&& x) noexcept; + eProsima_user_DllExport Polygon( + Polygon&& x); /*! * @brief Copy assignment. - * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. */ - eProsima_user_DllExport TFMessage& operator =( - const TFMessage& x); + eProsima_user_DllExport Polygon& operator =( + const Polygon& x); /*! * @brief Move assignment. - * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. */ - eProsima_user_DllExport TFMessage& operator =( - TFMessage&& x) noexcept; + eProsima_user_DllExport Polygon& operator =( + Polygon&& x); /*! * @brief Comparison operator. - * @param x tf2_msgs::msg::TFMessage object to compare. + * @param x geometry_msgs::msg::Polygon object to compare. */ eProsima_user_DllExport bool operator ==( - const TFMessage& x) const; + const Polygon& x) const; /*! * @brief Comparison operator. - * @param x tf2_msgs::msg::TFMessage object to compare. + * @param x geometry_msgs::msg::Polygon object to compare. */ eProsima_user_DllExport bool operator !=( - const TFMessage& x) const; + const Polygon& x) const; /*! - * @brief This function copies the value in member transforms - * @param _transforms New value to be copied in member transforms + * @brief This function copies the value in member points + * @param _points New value to be copied in member points */ - eProsima_user_DllExport void transforms( - const std::vector& _transforms); + eProsima_user_DllExport void points( + const std::vector& _points); /*! - * @brief This function moves the value in member transforms - * @param _transforms New value to be moved in member transforms + * @brief This function moves the value in member points + * @param _points New value to be moved in member points */ - eProsima_user_DllExport void transforms( - std::vector&& _transforms); + eProsima_user_DllExport void points( + std::vector&& _points); /*! - * @brief This function returns a constant reference to member transforms - * @return Constant reference to member transforms + * @brief This function returns a constant reference to member points + * @return Constant reference to member points */ - eProsima_user_DllExport const std::vector& transforms() const; + eProsima_user_DllExport const std::vector& points() const; /*! - * @brief This function returns a reference to member transforms - * @return Reference to member transforms + * @brief This function returns a reference to member points + * @return Reference to member points */ - eProsima_user_DllExport std::vector& transforms(); + eProsima_user_DllExport std::vector& points(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -168,9 +166,10 @@ namespace tf2_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const tf2_msgs::msg::TFMessage& data, + const geometry_msgs::msg::Polygon& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -185,6 +184,8 @@ namespace tf2_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -207,10 +208,10 @@ namespace tf2_msgs { eprosima::fastcdr::Cdr& cdr) const; private: - std::vector m_transforms; + std::vector m_points; }; } // namespace msg -} // namespace tf2_msgs +} // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.cxx new file mode 100644 index 00000000000..671dbdfd821 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PolygonPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "PolygonPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace geometry_msgs { + namespace msg { + PolygonPubSubType::PolygonPubSubType() + { + setName("geometry_msgs::msg::dds_::Polygon_"); + auto type_size = Polygon::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Polygon::isKeyDefined(); + size_t keyLength = Polygon::getKeyMaxCdrSerializedSize() > 16 ? + Polygon::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + PolygonPubSubType::~PolygonPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool PolygonPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Polygon* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool PolygonPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Polygon* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function PolygonPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* PolygonPubSubType::createData() + { + return reinterpret_cast(new Polygon()); + } + + void PolygonPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool PolygonPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Polygon* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Polygon::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Polygon::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/types/TF2ErrorPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.h similarity index 80% rename from LibCarla/source/carla/ros2/types/TF2ErrorPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.h index c160a65e4d5..f621ad859dd 100644 --- a/LibCarla/source/carla/ros2/types/TF2ErrorPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.h @@ -13,42 +13,43 @@ // limitations under the License. /*! - * @file TF2ErrorPubSubTypes.h + * @file PolygonPubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_PUBSUBTYPES_H_ #include #include -#include "TF2Error.h" +#include "Polygon.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated TF2Error is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated Polygon is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace tf2_msgs +namespace geometry_msgs { namespace msg { /*! - * @brief This class represents the TopicDataType of the type TF2Error defined by the user in the IDL file. - * @ingroup TF2ERROR + * @brief This class represents the TopicDataType of the type Polygon defined by the user in the IDL file. + * @ingroup POLYGON */ - class TF2ErrorPubSubType : public eprosima::fastdds::dds::TopicDataType + class PolygonPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef TF2Error type; + typedef Polygon type; - eProsima_user_DllExport TF2ErrorPubSubType(); + eProsima_user_DllExport PolygonPubSubType(); - eProsima_user_DllExport virtual ~TF2ErrorPubSubType() override; + eProsima_user_DllExport virtual ~PolygonPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -96,10 +97,11 @@ namespace tf2_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Pose.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/Pose.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.cxx index d643cd126ec..04a4cccfc48 100644 --- a/LibCarla/source/carla/ros2/types/Pose.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.cxx @@ -34,19 +34,18 @@ using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Pose_max_cdr_typesize 56ULL; -#define geometry_msgs_msg_Point_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL; -#define geometry_msgs_msg_Pose_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Point_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL; - geometry_msgs::msg::Pose::Pose() { + // m_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6cd28fa7 + + // m_orientation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@614ca7df + + } geometry_msgs::msg::Pose::~Pose() { + } geometry_msgs::msg::Pose::Pose( @@ -57,7 +56,7 @@ geometry_msgs::msg::Pose::Pose( } geometry_msgs::msg::Pose::Pose( - Pose&& x) noexcept + Pose&& x) { m_position = std::move(x.m_position); m_orientation = std::move(x.m_orientation); @@ -66,6 +65,7 @@ geometry_msgs::msg::Pose::Pose( geometry_msgs::msg::Pose& geometry_msgs::msg::Pose::operator =( const Pose& x) { + m_position = x.m_position; m_orientation = x.m_orientation; @@ -73,8 +73,9 @@ geometry_msgs::msg::Pose& geometry_msgs::msg::Pose::operator =( } geometry_msgs::msg::Pose& geometry_msgs::msg::Pose::operator =( - Pose&& x) noexcept + Pose&& x) { + m_position = std::move(x.m_position); m_orientation = std::move(x.m_orientation); @@ -84,6 +85,7 @@ geometry_msgs::msg::Pose& geometry_msgs::msg::Pose::operator =( bool geometry_msgs::msg::Pose::operator ==( const Pose& x) const { + return (m_position == x.m_position && m_orientation == x.m_orientation); } @@ -96,15 +98,23 @@ bool geometry_msgs::msg::Pose::operator !=( size_t geometry_msgs::msg::Pose::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Pose_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Point::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Quaternion::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; } size_t geometry_msgs::msg::Pose::getCdrSerializedSize( const geometry_msgs::msg::Pose& data, size_t current_alignment) { + (void)data; size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::Point::getCdrSerializedSize(data.position(), current_alignment); current_alignment += geometry_msgs::msg::Quaternion::getCdrSerializedSize(data.orientation(), current_alignment); @@ -114,13 +124,16 @@ size_t geometry_msgs::msg::Pose::getCdrSerializedSize( void geometry_msgs::msg::Pose::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_position; scdr << m_orientation; + } void geometry_msgs::msg::Pose::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_position; dcdr >> m_orientation; } @@ -162,7 +175,6 @@ geometry_msgs::msg::Point& geometry_msgs::msg::Pose::position() { return m_position; } - /*! * @brief This function copies the value in member orientation * @param _orientation New value to be copied in member orientation @@ -201,12 +213,14 @@ geometry_msgs::msg::Quaternion& geometry_msgs::msg::Pose::orientation() return m_orientation; } - size_t geometry_msgs::msg::Pose::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Pose_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool geometry_msgs::msg::Pose::isKeyDefined() @@ -218,4 +232,7 @@ void geometry_msgs::msg::Pose::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/types/Pose.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.h similarity index 94% rename from LibCarla/source/carla/ros2/types/Pose.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.h index 87060b15e47..d21efb6beb3 100644 --- a/LibCarla/source/carla/ros2/types/Pose.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.h @@ -22,10 +22,8 @@ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_H_ -#include "Point.h" #include "Quaternion.h" - -#include +#include "Point.h" #include #include @@ -64,6 +62,7 @@ class Cdr; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { namespace msg { /*! @@ -96,7 +95,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. */ eProsima_user_DllExport Pose( - Pose&& x) noexcept; + Pose&& x); /*! * @brief Copy assignment. @@ -110,7 +109,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. */ eProsima_user_DllExport Pose& operator =( - Pose&& x) noexcept; + Pose&& x); /*! * @brief Comparison operator. @@ -178,11 +177,11 @@ namespace geometry_msgs { eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -196,6 +195,7 @@ namespace geometry_msgs { const geometry_msgs::msg::Pose& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -210,6 +210,8 @@ namespace geometry_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -232,10 +234,11 @@ namespace geometry_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + geometry_msgs::msg::Point m_position; geometry_msgs::msg::Quaternion m_orientation; }; } // namespace msg } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/PosePubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/PosePubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.cxx index a4587eb82c4..9cc1f414fb7 100644 --- a/LibCarla/source/carla/ros2/types/PosePubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -83,21 +84,21 @@ namespace geometry_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - Pose* p_type = static_cast(data); + //Convert DATA to pointer of your type + Pose* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -168,5 +169,8 @@ namespace geometry_msgs { } return true; } + + } //End of namespace msg + } //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/types/TimePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.h similarity index 80% rename from LibCarla/source/carla/ros2/types/TimePubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.h index 9a2a4d9a8c8..3cdddb9946d 100644 --- a/LibCarla/source/carla/ros2/types/TimePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.h @@ -13,42 +13,43 @@ // limitations under the License. /*! - * @file TimePubSubTypes.h + * @file PosePubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ #include #include -#include "Time.h" +#include "Pose.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated Pose is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace builtin_interfaces +namespace geometry_msgs { namespace msg { /*! - * @brief This class represents the TopicDataType of the type Time defined by the user in the IDL file. - * @ingroup TIME + * @brief This class represents the TopicDataType of the type Pose defined by the user in the IDL file. + * @ingroup POSE */ - class TimePubSubType : public eprosima::fastdds::dds::TopicDataType + class PosePubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef Time type; + typedef Pose type; - eProsima_user_DllExport TimePubSubType(); + eProsima_user_DllExport PosePubSubType(); - eProsima_user_DllExport virtual ~TimePubSubType() override; + eProsima_user_DllExport virtual ~PosePubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -91,15 +92,16 @@ namespace builtin_interfaces eProsima_user_DllExport inline bool construct_sample( void* memory) const override { - new (memory) Time(); + new (memory) Pose(); return true; } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; }; } } -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/PoseWithCovariance.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.cxx similarity index 78% rename from LibCarla/source/carla/ros2/types/PoseWithCovariance.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.cxx index 83e52a52539..0e89095fd2a 100644 --- a/LibCarla/source/carla/ros2/types/PoseWithCovariance.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.cxx @@ -34,25 +34,19 @@ using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Pose_max_cdr_typesize 56ULL; -#define geometry_msgs_msg_Point_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_PoseWithCovariance_max_cdr_typesize 344ULL; -#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL; -#define geometry_msgs_msg_Pose_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Point_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_PoseWithCovariance_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL; geometry_msgs::msg::PoseWithCovariance::PoseWithCovariance() { - // geometry_msgs::msg::Pose m_pose + // m_pose com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4efc180e - // geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36 m_covariance + // m_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@bd4dc25 memset(&m_covariance, 0, (36) * 8); + } geometry_msgs::msg::PoseWithCovariance::~PoseWithCovariance() { + } geometry_msgs::msg::PoseWithCovariance::PoseWithCovariance( @@ -63,7 +57,7 @@ geometry_msgs::msg::PoseWithCovariance::PoseWithCovariance( } geometry_msgs::msg::PoseWithCovariance::PoseWithCovariance( - PoseWithCovariance&& x) noexcept + PoseWithCovariance&& x) { m_pose = std::move(x.m_pose); m_covariance = std::move(x.m_covariance); @@ -72,6 +66,7 @@ geometry_msgs::msg::PoseWithCovariance::PoseWithCovariance( geometry_msgs::msg::PoseWithCovariance& geometry_msgs::msg::PoseWithCovariance::operator =( const PoseWithCovariance& x) { + m_pose = x.m_pose; m_covariance = x.m_covariance; @@ -79,8 +74,9 @@ geometry_msgs::msg::PoseWithCovariance& geometry_msgs::msg::PoseWithCovariance:: } geometry_msgs::msg::PoseWithCovariance& geometry_msgs::msg::PoseWithCovariance::operator =( - PoseWithCovariance&& x) noexcept + PoseWithCovariance&& x) { + m_pose = std::move(x.m_pose); m_covariance = std::move(x.m_covariance); @@ -90,6 +86,7 @@ geometry_msgs::msg::PoseWithCovariance& geometry_msgs::msg::PoseWithCovariance:: bool geometry_msgs::msg::PoseWithCovariance::operator ==( const PoseWithCovariance& x) const { + return (m_pose == x.m_pose && m_covariance == x.m_covariance); } @@ -102,17 +99,31 @@ bool geometry_msgs::msg::PoseWithCovariance::operator !=( size_t geometry_msgs::msg::PoseWithCovariance::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_PoseWithCovariance_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Pose::getMaxCdrSerializedSize(current_alignment); + current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; } size_t geometry_msgs::msg::PoseWithCovariance::getCdrSerializedSize( const geometry_msgs::msg::PoseWithCovariance& data, size_t current_alignment) { + (void)data; size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.pose(), current_alignment); - current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + if ((36) > 0) + { + current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + return current_alignment - initial_alignment; } @@ -120,15 +131,20 @@ size_t geometry_msgs::msg::PoseWithCovariance::getCdrSerializedSize( void geometry_msgs::msg::PoseWithCovariance::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_pose; scdr << m_covariance; + + } void geometry_msgs::msg::PoseWithCovariance::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_pose; dcdr >> m_covariance; + } /*! @@ -173,7 +189,7 @@ geometry_msgs::msg::Pose& geometry_msgs::msg::PoseWithCovariance::pose() * @param _covariance New value to be copied in member covariance */ void geometry_msgs::msg::PoseWithCovariance::covariance( - const geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36& _covariance) + const geometry_msgs::msg::double_pose_36& _covariance) { m_covariance = _covariance; } @@ -183,7 +199,7 @@ void geometry_msgs::msg::PoseWithCovariance::covariance( * @param _covariance New value to be moved in member covariance */ void geometry_msgs::msg::PoseWithCovariance::covariance( - geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36&& _covariance) + geometry_msgs::msg::double_pose_36&& _covariance) { m_covariance = std::move(_covariance); } @@ -192,7 +208,7 @@ void geometry_msgs::msg::PoseWithCovariance::covariance( * @brief This function returns a constant reference to member covariance * @return Constant reference to member covariance */ -const geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36& geometry_msgs::msg::PoseWithCovariance::covariance() const +const geometry_msgs::msg::double_pose_36& geometry_msgs::msg::PoseWithCovariance::covariance() const { return m_covariance; } @@ -201,17 +217,19 @@ const geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36& ge * @brief This function returns a reference to member covariance * @return Reference to member covariance */ -geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36& geometry_msgs::msg::PoseWithCovariance::covariance() +geometry_msgs::msg::double_pose_36& geometry_msgs::msg::PoseWithCovariance::covariance() { return m_covariance; } - size_t geometry_msgs::msg::PoseWithCovariance::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_PoseWithCovariance_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool geometry_msgs::msg::PoseWithCovariance::isKeyDefined() @@ -223,4 +241,7 @@ void geometry_msgs::msg::PoseWithCovariance::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/types/PoseWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.h similarity index 88% rename from LibCarla/source/carla/ros2/types/PoseWithCovariance.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.h index 25b061ded4f..dd98e464e18 100644 --- a/LibCarla/source/carla/ros2/types/PoseWithCovariance.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.h @@ -24,8 +24,6 @@ #include "Pose.h" -#include - #include #include #include @@ -66,7 +64,7 @@ class Cdr; namespace geometry_msgs { namespace msg { - typedef std::array geometry_msgs__PoseWithCovariance__double_array_36; + typedef std::array double_pose_36; /*! * @brief This class represents the structure PoseWithCovariance defined by the user in the IDL file. * @ingroup POSEWITHCOVARIANCE @@ -97,7 +95,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. */ eProsima_user_DllExport PoseWithCovariance( - PoseWithCovariance&& x) noexcept; + PoseWithCovariance&& x); /*! * @brief Copy assignment. @@ -111,7 +109,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. */ eProsima_user_DllExport PoseWithCovariance& operator =( - PoseWithCovariance&& x) noexcept; + PoseWithCovariance&& x); /*! * @brief Comparison operator. @@ -157,33 +155,33 @@ namespace geometry_msgs { * @param _covariance New value to be copied in member covariance */ eProsima_user_DllExport void covariance( - const geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36& _covariance); + const geometry_msgs::msg::double_pose_36& _covariance); /*! * @brief This function moves the value in member covariance * @param _covariance New value to be moved in member covariance */ eProsima_user_DllExport void covariance( - geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36&& _covariance); + geometry_msgs::msg::double_pose_36&& _covariance); /*! * @brief This function returns a constant reference to member covariance * @return Constant reference to member covariance */ - eProsima_user_DllExport const geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36& covariance() const; + eProsima_user_DllExport const geometry_msgs::msg::double_pose_36& covariance() const; /*! * @brief This function returns a reference to member covariance * @return Reference to member covariance */ - eProsima_user_DllExport geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36& covariance(); + eProsima_user_DllExport geometry_msgs::msg::double_pose_36& covariance(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -197,6 +195,7 @@ namespace geometry_msgs { const geometry_msgs::msg::PoseWithCovariance& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -211,6 +210,8 @@ namespace geometry_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -233,10 +234,11 @@ namespace geometry_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + geometry_msgs::msg::Pose m_pose; - geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36 m_covariance; + geometry_msgs::msg::double_pose_36 m_covariance; }; } // namespace msg } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/PoseWithCovariancePubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/PoseWithCovariancePubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.cxx index fe7a781d6a0..5757f76168d 100644 --- a/LibCarla/source/carla/ros2/types/PoseWithCovariancePubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -84,21 +85,21 @@ namespace geometry_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - PoseWithCovariance* p_type = static_cast(data); + //Convert DATA to pointer of your type + PoseWithCovariance* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -169,5 +170,8 @@ namespace geometry_msgs { } return true; } + + } //End of namespace msg + } //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.h new file mode 100644 index 00000000000..afe95d852f9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.h @@ -0,0 +1,108 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include + +#include "PoseWithCovariance.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated PoseWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + typedef std::array double_pose_36; + /*! + * @brief This class represents the TopicDataType of the type PoseWithCovariance defined by the user in the IDL file. + * @ingroup POSEWITHCOVARIANCE + */ + class PoseWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PoseWithCovariance type; + + eProsima_user_DllExport PoseWithCovariancePubSubType(); + + eProsima_user_DllExport virtual ~PoseWithCovariancePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) PoseWithCovariance(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Quaternion.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.cxx similarity index 85% rename from LibCarla/source/carla/ros2/types/Quaternion.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.cxx index 4858a84b251..8146a4ad617 100644 --- a/LibCarla/source/carla/ros2/types/Quaternion.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.cxx @@ -34,23 +34,24 @@ using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL; -#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL; - geometry_msgs::msg::Quaternion::Quaternion() { - // double m_x + // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@593aaf41 m_x = 0.0; - // double m_y + // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5a56cdac m_y = 0.0; - // double m_z + // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7c711375 m_z = 0.0; - // double m_w + // m_w com.eprosima.idl.parser.typecode.PrimitiveTypeCode@57cf54e1 m_w = 1.0; + } geometry_msgs::msg::Quaternion::~Quaternion() { + + + } geometry_msgs::msg::Quaternion::Quaternion( @@ -63,7 +64,7 @@ geometry_msgs::msg::Quaternion::Quaternion( } geometry_msgs::msg::Quaternion::Quaternion( - Quaternion&& x) noexcept + Quaternion&& x) { m_x = x.m_x; m_y = x.m_y; @@ -74,6 +75,7 @@ geometry_msgs::msg::Quaternion::Quaternion( geometry_msgs::msg::Quaternion& geometry_msgs::msg::Quaternion::operator =( const Quaternion& x) { + m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; @@ -83,8 +85,9 @@ geometry_msgs::msg::Quaternion& geometry_msgs::msg::Quaternion::operator =( } geometry_msgs::msg::Quaternion& geometry_msgs::msg::Quaternion::operator =( - Quaternion&& x) noexcept + Quaternion&& x) { + m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; @@ -96,6 +99,7 @@ geometry_msgs::msg::Quaternion& geometry_msgs::msg::Quaternion::operator =( bool geometry_msgs::msg::Quaternion::operator ==( const Quaternion& x) const { + return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z && m_w == x.m_w); } @@ -108,8 +112,23 @@ bool geometry_msgs::msg::Quaternion::operator !=( size_t geometry_msgs::msg::Quaternion::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Quaternion_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; } size_t geometry_msgs::msg::Quaternion::getCdrSerializedSize( @@ -118,26 +137,39 @@ size_t geometry_msgs::msg::Quaternion::getCdrSerializedSize( { (void)data; size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + return current_alignment - initial_alignment; } void geometry_msgs::msg::Quaternion::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_x; scdr << m_y; scdr << m_z; scdr << m_w; + } void geometry_msgs::msg::Quaternion::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_x; dcdr >> m_y; dcdr >> m_z; @@ -256,11 +288,15 @@ double& geometry_msgs::msg::Quaternion::w() return m_w; } + size_t geometry_msgs::msg::Quaternion::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Quaternion_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool geometry_msgs::msg::Quaternion::isKeyDefined() @@ -272,4 +308,7 @@ void geometry_msgs::msg::Quaternion::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.h new file mode 100644 index 00000000000..bc793f05b18 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.h @@ -0,0 +1,270 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Quaternion.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ + + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Quaternion_SOURCE) +#define Quaternion_DllAPI __declspec( dllexport ) +#else +#define Quaternion_DllAPI __declspec( dllimport ) +#endif // Quaternion_SOURCE +#else +#define Quaternion_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Quaternion_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace geometry_msgs { + namespace msg { + /*! + * @brief This class represents the structure Quaternion defined by the user in the IDL file. + * @ingroup QUATERNION + */ + class Quaternion + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Quaternion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Quaternion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. + */ + eProsima_user_DllExport Quaternion( + const Quaternion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. + */ + eProsima_user_DllExport Quaternion( + Quaternion&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. + */ + eProsima_user_DllExport Quaternion& operator =( + const Quaternion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. + */ + eProsima_user_DllExport Quaternion& operator =( + Quaternion&& x); + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Quaternion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Quaternion& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Quaternion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Quaternion& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + + /*! + * @brief This function sets a value in member w + * @param _w New value for member w + */ + eProsima_user_DllExport void w( + double _w); + + /*! + * @brief This function returns the value of member w + * @return Value of member w + */ + eProsima_user_DllExport double w() const; + + /*! + * @brief This function returns a reference to member w + * @return Reference to member w + */ + eProsima_user_DllExport double& w(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::Quaternion& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + double m_x; + double m_y; + double m_z; + double m_w; + }; + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/QuaternionPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/QuaternionPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.cxx index 8b4581a39a8..f3f6fc8873a 100644 --- a/LibCarla/source/carla/ros2/types/QuaternionPubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -83,21 +84,21 @@ namespace geometry_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - Quaternion* p_type = static_cast(data); + //Convert DATA to pointer of your type + Quaternion* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -168,5 +169,8 @@ namespace geometry_msgs { } return true; } + + } //End of namespace msg + } //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/types/QuaternionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.h similarity index 76% rename from LibCarla/source/carla/ros2/types/QuaternionPubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.h index 17057b049d2..df71e2249c9 100644 --- a/LibCarla/source/carla/ros2/types/QuaternionPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.h @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_PUBSUBTYPES_H_ @@ -36,36 +37,6 @@ namespace geometry_msgs { namespace msg { - - #ifndef SWIG - namespace detail { - - template - struct Quaternion_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Quaternion_f - { - typedef double Quaternion::* type; - friend constexpr type get( - Quaternion_f); - }; - - template struct Quaternion_rob; - - template - inline size_t constexpr Quaternion_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - /*! * @brief This class represents the TopicDataType of the type Quaternion defined by the user in the IDL file. * @ingroup QUATERNION @@ -78,7 +49,7 @@ namespace geometry_msgs eProsima_user_DllExport QuaternionPubSubType(); - eProsima_user_DllExport virtual ~QuaternionPubSubType() override; + eProsima_user_DllExport virtual ~QuaternionPubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -112,7 +83,7 @@ namespace geometry_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -126,15 +97,11 @@ namespace geometry_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 32ULL == (detail::Quaternion_offset_of() + sizeof(double)); - - }}; + }; } } -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Transform.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/Transform.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.h new file mode 100644 index 00000000000..2d84f30f040 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.h @@ -0,0 +1,223 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Transform.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ + +#include "Quaternion.h" +#include "Vector3.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Transform_SOURCE) +#define Transform_DllAPI __declspec(dllexport) +#else +#define Transform_DllAPI __declspec(dllimport) +#endif // Transform_SOURCE +#else +#define Transform_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Transform_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace geometry_msgs { +namespace msg { +/*! + * @brief This class represents the structure Transform defined by the user in the IDL file. + * @ingroup TRANSFORM + */ +class Transform { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Transform(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Transform(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. + */ + eProsima_user_DllExport Transform(const Transform& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. + */ + eProsima_user_DllExport Transform(Transform&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. + */ + eProsima_user_DllExport Transform& operator=(const Transform& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. + */ + eProsima_user_DllExport Transform& operator=(Transform&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Transform object to compare. + */ + eProsima_user_DllExport bool operator==(const Transform& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Transform object to compare. + */ + eProsima_user_DllExport bool operator!=(const Transform& x) const; + + /*! + * @brief This function copies the value in member translation + * @param _translation New value to be copied in member translation + */ + eProsima_user_DllExport void translation(const geometry_msgs::msg::Vector3& _translation); + + /*! + * @brief This function moves the value in member translation + * @param _translation New value to be moved in member translation + */ + eProsima_user_DllExport void translation(geometry_msgs::msg::Vector3&& _translation); + + /*! + * @brief This function returns a constant reference to member translation + * @return Constant reference to member translation + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& translation() const; + + /*! + * @brief This function returns a reference to member translation + * @return Reference to member translation + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& translation(); + /*! + * @brief This function copies the value in member rotation + * @param _rotation New value to be copied in member rotation + */ + eProsima_user_DllExport void rotation(const geometry_msgs::msg::Quaternion& _rotation); + + /*! + * @brief This function moves the value in member rotation + * @param _rotation New value to be moved in member rotation + */ + eProsima_user_DllExport void rotation(geometry_msgs::msg::Quaternion&& _rotation); + + /*! + * @brief This function returns a constant reference to member rotation + * @return Constant reference to member rotation + */ + eProsima_user_DllExport const geometry_msgs::msg::Quaternion& rotation() const; + + /*! + * @brief This function returns a reference to member rotation + * @return Reference to member rotation + */ + eProsima_user_DllExport geometry_msgs::msg::Quaternion& rotation(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const geometry_msgs::msg::Transform& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + geometry_msgs::msg::Vector3 m_translation; + geometry_msgs::msg::Quaternion m_rotation; +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ diff --git a/LibCarla/source/carla/ros2/types/TransformPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/TransformPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.h new file mode 100644 index 00000000000..6f463271b55 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.h @@ -0,0 +1,124 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TransformPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ + +#include +#include + +#include "Transform.h" + +#include "QuaternionPubSubTypes.h" +#include "Vector3PubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Transform is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs { +namespace msg { + +#ifndef SWIG +namespace detail { + +template +struct Transform_rob { + friend constexpr typename Tag::type get(Tag) { + return M; + } +}; + +struct Transform_f { + typedef geometry_msgs::msg::Quaternion Transform::*type; + friend constexpr type get(Transform_f); +}; + +template struct Transform_rob; + +template +inline size_t constexpr Transform_offset_of() { + return ((::size_t) & reinterpret_cast((((T*)0)->*get(Tag())))); +} +} // namespace detail +#endif + +/*! + * @brief This class represents the TopicDataType of the type Transform defined by the user in the IDL file. + * @ingroup TRANSFORM + */ +class TransformPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef Transform type; + + eProsima_user_DllExport TransformPubSubType(); + + eProsima_user_DllExport virtual ~TransformPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return is_plain_impl(); + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + new (memory) Transform(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + static constexpr bool is_plain_impl() { + return 56ULL == + (detail::Transform_offset_of() + sizeof(geometry_msgs::msg::Quaternion)); + } +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/TransformStamped.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/TransformStamped.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.h new file mode 100644 index 00000000000..07821eb4179 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.h @@ -0,0 +1,247 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TransformStamped.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ + +#include "Transform.h" +#include "std_msgs/msg/Header.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TransformStamped_SOURCE) +#define TransformStamped_DllAPI __declspec(dllexport) +#else +#define TransformStamped_DllAPI __declspec(dllimport) +#endif // TransformStamped_SOURCE +#else +#define TransformStamped_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TransformStamped_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace geometry_msgs { +namespace msg { +/*! + * @brief This class represents the structure TransformStamped defined by the user in the IDL file. + * @ingroup TRANSFORMSTAMPED + */ +class TransformStamped { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TransformStamped(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TransformStamped(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + */ + eProsima_user_DllExport TransformStamped(const TransformStamped& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + */ + eProsima_user_DllExport TransformStamped(TransformStamped&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + */ + eProsima_user_DllExport TransformStamped& operator=(const TransformStamped& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + */ + eProsima_user_DllExport TransformStamped& operator=(TransformStamped&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::TransformStamped object to compare. + */ + eProsima_user_DllExport bool operator==(const TransformStamped& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::TransformStamped object to compare. + */ + eProsima_user_DllExport bool operator!=(const TransformStamped& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function copies the value in member child_frame_id + * @param _child_frame_id New value to be copied in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id(const std::string& _child_frame_id); + + /*! + * @brief This function moves the value in member child_frame_id + * @param _child_frame_id New value to be moved in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id(std::string&& _child_frame_id); + + /*! + * @brief This function returns a constant reference to member child_frame_id + * @return Constant reference to member child_frame_id + */ + eProsima_user_DllExport const std::string& child_frame_id() const; + + /*! + * @brief This function returns a reference to member child_frame_id + * @return Reference to member child_frame_id + */ + eProsima_user_DllExport std::string& child_frame_id(); + /*! + * @brief This function copies the value in member transform + * @param _transform New value to be copied in member transform + */ + eProsima_user_DllExport void transform(const geometry_msgs::msg::Transform& _transform); + + /*! + * @brief This function moves the value in member transform + * @param _transform New value to be moved in member transform + */ + eProsima_user_DllExport void transform(geometry_msgs::msg::Transform&& _transform); + + /*! + * @brief This function returns a constant reference to member transform + * @return Constant reference to member transform + */ + eProsima_user_DllExport const geometry_msgs::msg::Transform& transform() const; + + /*! + * @brief This function returns a reference to member transform + * @return Reference to member transform + */ + eProsima_user_DllExport geometry_msgs::msg::Transform& transform(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const geometry_msgs::msg::TransformStamped& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + std::string m_child_frame_id; + geometry_msgs::msg::Transform m_transform; +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ diff --git a/LibCarla/source/carla/ros2/types/TransformStampedPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/TransformStampedPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.h new file mode 100644 index 00000000000..c8fcaba9ce3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.h @@ -0,0 +1,95 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TransformStampedPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ + +#include +#include + +#include "TransformStamped.h" + +#include "TransformPubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated TransformStamped is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs { +namespace msg { + +/*! + * @brief This class represents the TopicDataType of the type TransformStamped defined by the user in the IDL file. + * @ingroup TRANSFORMSTAMPED + */ +class TransformStampedPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef TransformStamped type; + + eProsima_user_DllExport TransformStampedPubSubType(); + + eProsima_user_DllExport virtual ~TransformStampedPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/Twist.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/Twist.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.cxx index 553921f89c8..1e4ea4150d7 100644 --- a/LibCarla/source/carla/ros2/types/Twist.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.cxx @@ -34,17 +34,18 @@ using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Twist_max_cdr_typesize 48ULL; -#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Twist_max_key_cdr_typesize 0ULL; - geometry_msgs::msg::Twist::Twist() { + // m_linear com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2b48a640 + + // m_angular com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2b48a640 + + } geometry_msgs::msg::Twist::~Twist() { + } geometry_msgs::msg::Twist::Twist( @@ -55,7 +56,7 @@ geometry_msgs::msg::Twist::Twist( } geometry_msgs::msg::Twist::Twist( - Twist&& x) noexcept + Twist&& x) { m_linear = std::move(x.m_linear); m_angular = std::move(x.m_angular); @@ -64,6 +65,7 @@ geometry_msgs::msg::Twist::Twist( geometry_msgs::msg::Twist& geometry_msgs::msg::Twist::operator =( const Twist& x) { + m_linear = x.m_linear; m_angular = x.m_angular; @@ -71,8 +73,9 @@ geometry_msgs::msg::Twist& geometry_msgs::msg::Twist::operator =( } geometry_msgs::msg::Twist& geometry_msgs::msg::Twist::operator =( - Twist&& x) noexcept + Twist&& x) { + m_linear = std::move(x.m_linear); m_angular = std::move(x.m_angular); @@ -82,6 +85,7 @@ geometry_msgs::msg::Twist& geometry_msgs::msg::Twist::operator =( bool geometry_msgs::msg::Twist::operator ==( const Twist& x) const { + return (m_linear == x.m_linear && m_angular == x.m_angular); } @@ -94,15 +98,23 @@ bool geometry_msgs::msg::Twist::operator !=( size_t geometry_msgs::msg::Twist::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Twist_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; } size_t geometry_msgs::msg::Twist::getCdrSerializedSize( const geometry_msgs::msg::Twist& data, size_t current_alignment) { + (void)data; size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.linear(), current_alignment); current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.angular(), current_alignment); @@ -112,13 +124,16 @@ size_t geometry_msgs::msg::Twist::getCdrSerializedSize( void geometry_msgs::msg::Twist::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_linear; scdr << m_angular; + } void geometry_msgs::msg::Twist::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_linear; dcdr >> m_angular; } @@ -160,7 +175,6 @@ geometry_msgs::msg::Vector3& geometry_msgs::msg::Twist::linear() { return m_linear; } - /*! * @brief This function copies the value in member angular * @param _angular New value to be copied in member angular @@ -199,12 +213,14 @@ geometry_msgs::msg::Vector3& geometry_msgs::msg::Twist::angular() return m_angular; } - size_t geometry_msgs::msg::Twist::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Twist_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool geometry_msgs::msg::Twist::isKeyDefined() @@ -216,4 +232,7 @@ void geometry_msgs::msg::Twist::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.h new file mode 100644 index 00000000000..48cca0f1b1f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Twist.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ + +#include "Vector3.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Twist_SOURCE) +#define Twist_DllAPI __declspec( dllexport ) +#else +#define Twist_DllAPI __declspec( dllimport ) +#endif // Twist_SOURCE +#else +#define Twist_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Twist_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + +namespace geometry_msgs { + namespace msg { + /*! + * @brief This class represents the structure Twist defined by the user in the IDL file. + * @ingroup TWIST + */ + class Twist + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Twist(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Twist(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. + */ + eProsima_user_DllExport Twist( + const Twist& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. + */ + eProsima_user_DllExport Twist( + Twist&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. + */ + eProsima_user_DllExport Twist& operator =( + const Twist& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. + */ + eProsima_user_DllExport Twist& operator =( + Twist&& x); + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Twist object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Twist& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Twist object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Twist& x) const; + + /*! + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear + */ + eProsima_user_DllExport void linear( + const geometry_msgs::msg::Vector3& _linear); + + /*! + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear + */ + eProsima_user_DllExport void linear( + geometry_msgs::msg::Vector3&& _linear); + + /*! + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear() const; + + /*! + * @brief This function returns a reference to member linear + * @return Reference to member linear + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& linear(); + /*! + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular + */ + eProsima_user_DllExport void angular( + const geometry_msgs::msg::Vector3& _angular); + + /*! + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular + */ + eProsima_user_DllExport void angular( + geometry_msgs::msg::Vector3&& _angular); + + /*! + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular() const; + + /*! + * @brief This function returns a reference to member angular + * @return Reference to member angular + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& angular(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const geometry_msgs::msg::Twist& data, + size_t current_alignment = 0); + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + private: + + geometry_msgs::msg::Vector3 m_linear; + geometry_msgs::msg::Vector3 m_angular; + }; + } // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/TwistPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/TwistPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.cxx index 5cabda52668..853ad47461f 100644 --- a/LibCarla/source/carla/ros2/types/TwistPubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -83,21 +84,21 @@ namespace geometry_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - Twist* p_type = static_cast(data); + //Convert DATA to pointer of your type + Twist* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -168,5 +169,8 @@ namespace geometry_msgs { } return true; } + + } //End of namespace msg + } //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.h new file mode 100644 index 00000000000..4a8a641bb88 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ + +#include +#include + +#include "Twist.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated Twist is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type Twist defined by the user in the IDL file. + * @ingroup TWIST + */ + class TwistPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Twist type; + + eProsima_user_DllExport TwistPubSubType(); + + eProsima_user_DllExport virtual ~TwistPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Twist(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/TwistWithCovariance.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.cxx similarity index 80% rename from LibCarla/source/carla/ros2/types/TwistWithCovariance.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.cxx index 332f228efba..ce9eb6c2531 100644 --- a/LibCarla/source/carla/ros2/types/TwistWithCovariance.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.cxx @@ -34,23 +34,19 @@ using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_TwistWithCovariance_max_cdr_typesize 336ULL; -#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Twist_max_cdr_typesize 48ULL; -#define geometry_msgs_msg_TwistWithCovariance_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Twist_max_key_cdr_typesize 0ULL; geometry_msgs::msg::TwistWithCovariance::TwistWithCovariance() { - // geometry_msgs::msg::Twist m_twist + // m_twist com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@10163d6 - // geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36 m_covariance + // m_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@2dde1bff memset(&m_covariance, 0, (36) * 8); + } geometry_msgs::msg::TwistWithCovariance::~TwistWithCovariance() { + } geometry_msgs::msg::TwistWithCovariance::TwistWithCovariance( @@ -61,7 +57,7 @@ geometry_msgs::msg::TwistWithCovariance::TwistWithCovariance( } geometry_msgs::msg::TwistWithCovariance::TwistWithCovariance( - TwistWithCovariance&& x) noexcept + TwistWithCovariance&& x) { m_twist = std::move(x.m_twist); m_covariance = std::move(x.m_covariance); @@ -70,6 +66,7 @@ geometry_msgs::msg::TwistWithCovariance::TwistWithCovariance( geometry_msgs::msg::TwistWithCovariance& geometry_msgs::msg::TwistWithCovariance::operator =( const TwistWithCovariance& x) { + m_twist = x.m_twist; m_covariance = x.m_covariance; @@ -77,8 +74,9 @@ geometry_msgs::msg::TwistWithCovariance& geometry_msgs::msg::TwistWithCovariance } geometry_msgs::msg::TwistWithCovariance& geometry_msgs::msg::TwistWithCovariance::operator =( - TwistWithCovariance&& x) noexcept + TwistWithCovariance&& x) { + m_twist = std::move(x.m_twist); m_covariance = std::move(x.m_covariance); @@ -88,6 +86,7 @@ geometry_msgs::msg::TwistWithCovariance& geometry_msgs::msg::TwistWithCovariance bool geometry_msgs::msg::TwistWithCovariance::operator ==( const TwistWithCovariance& x) const { + return (m_twist == x.m_twist && m_covariance == x.m_covariance); } @@ -100,17 +99,31 @@ bool geometry_msgs::msg::TwistWithCovariance::operator !=( size_t geometry_msgs::msg::TwistWithCovariance::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_TwistWithCovariance_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += geometry_msgs::msg::Twist::getMaxCdrSerializedSize(current_alignment); + current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; } size_t geometry_msgs::msg::TwistWithCovariance::getCdrSerializedSize( const geometry_msgs::msg::TwistWithCovariance& data, size_t current_alignment) { + (void)data; size_t initial_alignment = current_alignment; + + current_alignment += geometry_msgs::msg::Twist::getCdrSerializedSize(data.twist(), current_alignment); - current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + if ((36) > 0) + { + current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + return current_alignment - initial_alignment; } @@ -118,15 +131,20 @@ size_t geometry_msgs::msg::TwistWithCovariance::getCdrSerializedSize( void geometry_msgs::msg::TwistWithCovariance::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_twist; scdr << m_covariance; + + } void geometry_msgs::msg::TwistWithCovariance::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_twist; dcdr >> m_covariance; + } /*! @@ -166,13 +184,12 @@ geometry_msgs::msg::Twist& geometry_msgs::msg::TwistWithCovariance::twist() { return m_twist; } - /*! * @brief This function copies the value in member covariance * @param _covariance New value to be copied in member covariance */ void geometry_msgs::msg::TwistWithCovariance::covariance( - const geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36& _covariance) + const geometry_msgs::msg::double_twist_36& _covariance) { m_covariance = _covariance; } @@ -182,7 +199,7 @@ void geometry_msgs::msg::TwistWithCovariance::covariance( * @param _covariance New value to be moved in member covariance */ void geometry_msgs::msg::TwistWithCovariance::covariance( - geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36&& _covariance) + geometry_msgs::msg::double_twist_36&& _covariance) { m_covariance = std::move(_covariance); } @@ -191,7 +208,7 @@ void geometry_msgs::msg::TwistWithCovariance::covariance( * @brief This function returns a constant reference to member covariance * @return Constant reference to member covariance */ -const geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36& geometry_msgs::msg::TwistWithCovariance::covariance() const +const geometry_msgs::msg::double_twist_36& geometry_msgs::msg::TwistWithCovariance::covariance() const { return m_covariance; } @@ -200,7 +217,7 @@ const geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36& g * @brief This function returns a reference to member covariance * @return Reference to member covariance */ -geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36& geometry_msgs::msg::TwistWithCovariance::covariance() +geometry_msgs::msg::double_twist_36& geometry_msgs::msg::TwistWithCovariance::covariance() { return m_covariance; } @@ -208,8 +225,11 @@ geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36& geometr size_t geometry_msgs::msg::TwistWithCovariance::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_TwistWithCovariance_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool geometry_msgs::msg::TwistWithCovariance::isKeyDefined() @@ -221,4 +241,7 @@ void geometry_msgs::msg::TwistWithCovariance::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/types/TwistWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.h similarity index 88% rename from LibCarla/source/carla/ros2/types/TwistWithCovariance.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.h index 4aa2477567d..40c89bab4fd 100644 --- a/LibCarla/source/carla/ros2/types/TwistWithCovariance.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.h @@ -24,8 +24,6 @@ #include "Twist.h" -#include - #include #include #include @@ -66,7 +64,7 @@ class Cdr; namespace geometry_msgs { namespace msg { - typedef std::array geometry_msgs__TwistWithCovariance__double_array_36; + typedef std::array double_twist_36; /*! * @brief This class represents the structure TwistWithCovariance defined by the user in the IDL file. * @ingroup TWISTWITHCOVARIANCE @@ -97,7 +95,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. */ eProsima_user_DllExport TwistWithCovariance( - TwistWithCovariance&& x) noexcept; + TwistWithCovariance&& x); /*! * @brief Copy assignment. @@ -111,7 +109,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. */ eProsima_user_DllExport TwistWithCovariance& operator =( - TwistWithCovariance&& x) noexcept; + TwistWithCovariance&& x); /*! * @brief Comparison operator. @@ -157,33 +155,33 @@ namespace geometry_msgs { * @param _covariance New value to be copied in member covariance */ eProsima_user_DllExport void covariance( - const geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36& _covariance); + const geometry_msgs::msg::double_twist_36& _covariance); /*! * @brief This function moves the value in member covariance * @param _covariance New value to be moved in member covariance */ eProsima_user_DllExport void covariance( - geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36&& _covariance); + geometry_msgs::msg::double_twist_36&& _covariance); /*! * @brief This function returns a constant reference to member covariance * @return Constant reference to member covariance */ - eProsima_user_DllExport const geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36& covariance() const; + eProsima_user_DllExport const geometry_msgs::msg::double_twist_36& covariance() const; /*! * @brief This function returns a reference to member covariance * @return Reference to member covariance */ - eProsima_user_DllExport geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36& covariance(); + eProsima_user_DllExport geometry_msgs::msg::double_twist_36& covariance(); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -197,6 +195,7 @@ namespace geometry_msgs { const geometry_msgs::msg::TwistWithCovariance& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -211,6 +210,8 @@ namespace geometry_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -233,10 +234,11 @@ namespace geometry_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + geometry_msgs::msg::Twist m_twist; - geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36 m_covariance; + geometry_msgs::msg::double_twist_36 m_covariance; }; } // namespace msg } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/TwistWithCovariancePubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/TwistWithCovariancePubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.cxx index e9c062decfa..a992128aef0 100644 --- a/LibCarla/source/carla/ros2/types/TwistWithCovariancePubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -84,21 +85,21 @@ namespace geometry_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - TwistWithCovariance* p_type = static_cast(data); + //Convert DATA to pointer of your type + TwistWithCovariance* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -169,5 +170,8 @@ namespace geometry_msgs { } return true; } + + } //End of namespace msg + } //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.h new file mode 100644 index 00000000000..6113b33320f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.h @@ -0,0 +1,108 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovariancePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ + +#include +#include + +#include "TwistWithCovariance.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated TwistWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace geometry_msgs +{ + namespace msg + { + typedef std::array double_twist_36; + /*! + * @brief This class represents the TopicDataType of the type TwistWithCovariance defined by the user in the IDL file. + * @ingroup TWISTWITHCOVARIANCE + */ + class TwistWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TwistWithCovariance type; + + eProsima_user_DllExport TwistWithCovariancePubSubType(); + + eProsima_user_DllExport virtual ~TwistWithCovariancePubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) TwistWithCovariance(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Vector3.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.cxx similarity index 86% rename from LibCarla/source/carla/ros2/types/Vector3.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.cxx index 2890489abfc..b1ea662638d 100644 --- a/LibCarla/source/carla/ros2/types/Vector3.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.cxx @@ -34,21 +34,21 @@ using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; - geometry_msgs::msg::Vector3::Vector3() { - // double m_x + // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@74d1dc36 m_x = 0.0; - // double m_y + // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7161d8d1 m_y = 0.0; - // double m_z + // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@663c9e7a m_z = 0.0; + } geometry_msgs::msg::Vector3::~Vector3() { + + } geometry_msgs::msg::Vector3::Vector3( @@ -60,7 +60,7 @@ geometry_msgs::msg::Vector3::Vector3( } geometry_msgs::msg::Vector3::Vector3( - Vector3&& x) noexcept + Vector3&& x) { m_x = x.m_x; m_y = x.m_y; @@ -79,8 +79,9 @@ geometry_msgs::msg::Vector3& geometry_msgs::msg::Vector3::operator =( } geometry_msgs::msg::Vector3& geometry_msgs::msg::Vector3::operator =( - Vector3&& x) noexcept + Vector3&& x) { + m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; @@ -91,6 +92,7 @@ geometry_msgs::msg::Vector3& geometry_msgs::msg::Vector3::operator =( bool geometry_msgs::msg::Vector3::operator ==( const Vector3& x) const { + return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z); } @@ -103,8 +105,20 @@ bool geometry_msgs::msg::Vector3::operator !=( size_t geometry_msgs::msg::Vector3::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Vector3_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; } size_t geometry_msgs::msg::Vector3::getCdrSerializedSize( @@ -113,24 +127,35 @@ size_t geometry_msgs::msg::Vector3::getCdrSerializedSize( { (void)data; size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + return current_alignment - initial_alignment; } void geometry_msgs::msg::Vector3::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_x; scdr << m_y; scdr << m_z; + } void geometry_msgs::msg::Vector3::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_x; dcdr >> m_y; dcdr >> m_z; @@ -220,11 +245,15 @@ double& geometry_msgs::msg::Vector3::z() return m_z; } + size_t geometry_msgs::msg::Vector3::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return geometry_msgs_msg_Vector3_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool geometry_msgs::msg::Vector3::isKeyDefined() @@ -236,4 +265,7 @@ void geometry_msgs::msg::Vector3::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/types/Vector3.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.h similarity index 94% rename from LibCarla/source/carla/ros2/types/Vector3.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.h index cb96d7843a0..4323f7f1aed 100644 --- a/LibCarla/source/carla/ros2/types/Vector3.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.h @@ -22,7 +22,6 @@ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_H_ -#include #include #include @@ -94,7 +93,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. */ eProsima_user_DllExport Vector3( - Vector3&& x) noexcept; + Vector3&& x); /*! * @brief Copy assignment. @@ -108,7 +107,7 @@ namespace geometry_msgs { * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. */ eProsima_user_DllExport Vector3& operator =( - Vector3&& x) noexcept; + Vector3&& x); /*! * @brief Comparison operator. @@ -181,12 +180,13 @@ namespace geometry_msgs { */ eProsima_user_DllExport double& z(); + /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -200,6 +200,7 @@ namespace geometry_msgs { const geometry_msgs::msg::Vector3& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -214,6 +215,8 @@ namespace geometry_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -236,6 +239,7 @@ namespace geometry_msgs { eprosima::fastcdr::Cdr& cdr) const; private: + double m_x; double m_y; double m_z; @@ -243,4 +247,4 @@ namespace geometry_msgs { } // namespace msg } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Vector3PubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.cxx similarity index 89% rename from LibCarla/source/carla/ros2/types/Vector3PubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.cxx index 2a568e23a3f..d54cdd679ff 100644 --- a/LibCarla/source/carla/ros2/types/Vector3PubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.cxx @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #include #include @@ -83,21 +84,21 @@ namespace geometry_msgs { SerializedPayload_t* payload, void* data) { - try - { - //Convert DATA to pointer of your type - Vector3* p_type = static_cast(data); + //Convert DATA to pointer of your type + Vector3* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { // Deserialize the object. p_type->deserialize(deser); } @@ -168,5 +169,8 @@ namespace geometry_msgs { } return true; } + + } //End of namespace msg + } //End of namespace geometry_msgs diff --git a/LibCarla/source/carla/ros2/types/Vector3PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.h similarity index 76% rename from LibCarla/source/carla/ros2/types/Vector3PubSubTypes.h rename to LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.h index 7a5080e9445..505a56ec972 100644 --- a/LibCarla/source/carla/ros2/types/Vector3PubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.h @@ -19,6 +19,7 @@ * This file was generated by the tool fastcdrgen. */ + #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_PUBSUBTYPES_H_ @@ -36,36 +37,6 @@ namespace geometry_msgs { namespace msg { - - #ifndef SWIG - namespace detail { - - template - struct Vector3_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Vector3_f - { - typedef double Vector3::* type; - friend constexpr type get( - Vector3_f); - }; - - template struct Vector3_rob; - - template - inline size_t constexpr Vector3_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - /*! * @brief This class represents the TopicDataType of the type Vector3 defined by the user in the IDL file. * @ingroup VECTOR3 @@ -78,7 +49,7 @@ namespace geometry_msgs eProsima_user_DllExport Vector3PubSubType(); - eProsima_user_DllExport virtual ~Vector3PubSubType() override; + eProsima_user_DllExport virtual ~Vector3PubSubType(); eProsima_user_DllExport virtual bool serialize( void* data, @@ -112,7 +83,7 @@ namespace geometry_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); + return true; } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -126,15 +97,11 @@ namespace geometry_msgs } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 24ULL == (detail::Vector3_offset_of() + sizeof(double)); - - }}; + }; } } -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Odometry.cpp b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/Odometry.cpp rename to LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.h b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.h new file mode 100644 index 00000000000..d7bcf1499b5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.h @@ -0,0 +1,272 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Odometry.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ +#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ + +#include "geometry_msgs/msg/PoseWithCovariance.h" +#include "geometry_msgs/msg/TwistWithCovariance.h" +#include "std_msgs/msg/Header.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Odometry_SOURCE) +#define Odometry_DllAPI __declspec(dllexport) +#else +#define Odometry_DllAPI __declspec(dllimport) +#endif // Odometry_SOURCE +#else +#define Odometry_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Odometry_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace nav_msgs { +namespace msg { +/*! + * @brief This class represents the structure Odometry defined by the user in the IDL file. + * @ingroup ODOMETRY + */ +class Odometry { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Odometry(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Odometry(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + */ + eProsima_user_DllExport Odometry(const Odometry& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + */ + eProsima_user_DllExport Odometry(Odometry&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + */ + eProsima_user_DllExport Odometry& operator=(const Odometry& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + */ + eProsima_user_DllExport Odometry& operator=(Odometry&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x nav_msgs::msg::Odometry object to compare. + */ + eProsima_user_DllExport bool operator==(const Odometry& x) const; + + /*! + * @brief Comparison operator. + * @param x nav_msgs::msg::Odometry object to compare. + */ + eProsima_user_DllExport bool operator!=(const Odometry& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function copies the value in member child_frame_id + * @param _child_frame_id New value to be copied in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id(const std::string& _child_frame_id); + + /*! + * @brief This function moves the value in member child_frame_id + * @param _child_frame_id New value to be moved in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id(std::string&& _child_frame_id); + + /*! + * @brief This function returns a constant reference to member child_frame_id + * @return Constant reference to member child_frame_id + */ + eProsima_user_DllExport const std::string& child_frame_id() const; + + /*! + * @brief This function returns a reference to member child_frame_id + * @return Reference to member child_frame_id + */ + eProsima_user_DllExport std::string& child_frame_id(); + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose(const geometry_msgs::msg::PoseWithCovariance& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose(geometry_msgs::msg::PoseWithCovariance&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::PoseWithCovariance& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::PoseWithCovariance& pose(); + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist(const geometry_msgs::msg::TwistWithCovariance& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist(geometry_msgs::msg::TwistWithCovariance&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::TwistWithCovariance& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::TwistWithCovariance& twist(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const nav_msgs::msg::Odometry& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + std::string m_child_frame_id; + geometry_msgs::msg::PoseWithCovariance m_pose; + geometry_msgs::msg::TwistWithCovariance m_twist; +}; +} // namespace msg +} // namespace nav_msgs + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ diff --git a/LibCarla/source/carla/ros2/types/OdometryPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/OdometryPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.h new file mode 100644 index 00000000000..faafa5dfa36 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.h @@ -0,0 +1,94 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OdometryPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ + +#include +#include + +#include "Odometry.h" +#include "geometry_msgs/msg/PoseWithCovariancePubSubTypes.h" +#include "geometry_msgs/msg/TwistWithCovariancePubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Odometry is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace nav_msgs { +namespace msg { + +/*! + * @brief This class represents the TopicDataType of the type Odometry defined by the user in the IDL file. + * @ingroup ODOMETRY + */ +class OdometryPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef Odometry type; + + eProsima_user_DllExport OdometryPubSubType(); + + eProsima_user_DllExport virtual ~OdometryPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace nav_msgs + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/Clock.cpp b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/Clock.cpp rename to LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.h b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.h new file mode 100644 index 00000000000..88cd6b74253 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.h @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Clock.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ +#define _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ + +#include "builtin_interfaces/msg/Time.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CLOCK_SOURCE) +#define CLOCK_DllAPI __declspec(dllexport) +#else +#define CLOCK_DllAPI __declspec(dllimport) +#endif // CLOCK_SOURCE +#else +#define CLOCK_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CLOCK_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace rosgraph { +namespace msg { +/*! + * @brief This class represents the structure Clock defined by the user in the IDL file. + * @ingroup Clock + */ +class Clock { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Clock(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Clock(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object rosgraph::msg::Clock that will be copied. + */ + eProsima_user_DllExport Clock(const Clock& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object rosgraph::msg::Clock that will be copied. + */ + eProsima_user_DllExport Clock(Clock&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object rosgraph::msg::Clock that will be copied. + */ + eProsima_user_DllExport Clock& operator=(const Clock& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object rosgraph::msg::Clock that will be copied. + */ + eProsima_user_DllExport Clock& operator=(Clock&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x rosgraph::msg::Clock object to compare. + */ + eProsima_user_DllExport bool operator==(const Clock& x) const; + + /*! + * @brief Comparison operator. + * @param x rosgraph::msg::Clock object to compare. + */ + eProsima_user_DllExport bool operator!=(const Clock& x) const; + + /*! + * @brief This function copies the value in member clock + * @param _clock New value to be copied in member clock + */ + eProsima_user_DllExport void clock(const builtin_interfaces::msg::Time& _clock); + + /*! + * @brief This function moves the value in member clock + * @param _clock New value to be moved in member clock + */ + eProsima_user_DllExport void clock(builtin_interfaces::msg::Time&& _clock); + + /*! + * @brief This function returns a constant reference to member clock + * @return Constant reference to member clock + */ + eProsima_user_DllExport const builtin_interfaces::msg::Time& clock() const; + + /*! + * @brief This function returns a reference to member clock + * @return Reference to member clock + */ + eProsima_user_DllExport builtin_interfaces::msg::Time& clock(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const rosgraph::msg::Clock& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + builtin_interfaces::msg::Time m_clock; +}; +} // namespace msg +} // namespace rosgraph + +#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ diff --git a/LibCarla/source/carla/ros2/types/ClockPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/ClockPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.h new file mode 100644 index 00000000000..ea836ebdca0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.h @@ -0,0 +1,90 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ClockPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ + +#include +#include + +#include "Clock.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Clock is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace rosgraph { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type Clock defined by the user in the IDL file. + * @ingroup Clock + */ +class ClockPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef Clock type; + + eProsima_user_DllExport ClockPubSubType(); + + eProsima_user_DllExport virtual ~ClockPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace rosgraph + +#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/CameraInfo.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.cxx similarity index 98% rename from LibCarla/source/carla/ros2/types/CameraInfo.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.cxx index 058e88d3bd3..e6893ee2aff 100644 --- a/LibCarla/source/carla/ros2/types/CameraInfo.cpp +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.cxx @@ -19,6 +19,9 @@ * This file was generated by the tool gen. */ +#define _USE_MATH_DEFINES +#include + #ifdef _WIN32 // Remove linker warning LNK4221 on Visual Studio namespace { @@ -26,6 +29,10 @@ char dummy; } // namespace #endif // _WIN32 +// ensure that cmath header is not included elsewhere before to enable the math definitions on Win32 +#define _USE_MATH_DEFINES +#include + #include "CameraInfo.h" #include @@ -33,7 +40,6 @@ char dummy; using namespace eprosima::fastcdr::exception; #include -#include #define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; #define sensor_msgs_msg_CameraInfo_max_cdr_typesize 3793ULL; diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.h new file mode 100644 index 00000000000..39016b4d3ca --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.h @@ -0,0 +1,419 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CameraInfo.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ + +#include "sensor_msgs/msg/RegionOfInterest.h" +#include "std_msgs/msg/Header.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CAMERAINFO_SOURCE) +#define CAMERAINFO_DllAPI __declspec(dllexport) +#else +#define CAMERAINFO_DllAPI __declspec(dllimport) +#endif // CAMERAINFO_SOURCE +#else +#define CAMERAINFO_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CAMERAINFO_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace sensor_msgs { +namespace msg { +/*! + * @brief This class represents the structure CameraInfo defined by the user in the IDL file. + * @ingroup CameraInfo + */ +class CameraInfo { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CameraInfo(uint32_t height = 0, uint32_t width = 0, double fov = 0.0); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CameraInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. + */ + eProsima_user_DllExport CameraInfo(const CameraInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. + */ + eProsima_user_DllExport CameraInfo(CameraInfo&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. + */ + eProsima_user_DllExport CameraInfo& operator=(const CameraInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. + */ + eProsima_user_DllExport CameraInfo& operator=(CameraInfo&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::CameraInfo object to compare. + */ + eProsima_user_DllExport bool operator==(const CameraInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::CameraInfo object to compare. + */ + eProsima_user_DllExport bool operator!=(const CameraInfo& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ + eProsima_user_DllExport void height(uint32_t _height); + + /*! + * @brief This function returns the value of member height + * @return Value of member height + */ + eProsima_user_DllExport uint32_t height() const; + + /*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ + eProsima_user_DllExport uint32_t& height(); + + /*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ + eProsima_user_DllExport void width(uint32_t _width); + + /*! + * @brief This function returns the value of member width + * @return Value of member width + */ + eProsima_user_DllExport uint32_t width() const; + + /*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ + eProsima_user_DllExport uint32_t& width(); + + /*! + * @brief This function copies the value in member distortion_model + * @param _distortion_model New value to be copied in member distortion_model + */ + eProsima_user_DllExport void distortion_model(const std::string& _distortion_model); + + /*! + * @brief This function moves the value in member distortion_model + * @param _distortion_model New value to be moved in member distortion_model + */ + eProsima_user_DllExport void distortion_model(std::string&& _distortion_model); + + /*! + * @brief This function returns a constant reference to member distortion_model + * @return Constant reference to member distortion_model + */ + eProsima_user_DllExport const std::string& distortion_model() const; + + /*! + * @brief This function returns a reference to member distortion_model + * @return Reference to member distortion_model + */ + eProsima_user_DllExport std::string& distortion_model(); + /*! + * @brief This function copies the value in member D + * @param _D New value to be copied in member D + */ + eProsima_user_DllExport void D(const std::vector& _D); + + /*! + * @brief This function moves the value in member D + * @param _D New value to be moved in member D + */ + eProsima_user_DllExport void D(std::vector&& _D); + + /*! + * @brief This function returns a constant reference to member D + * @return Constant reference to member D + */ + eProsima_user_DllExport const std::vector& D() const; + + /*! + * @brief This function returns a reference to member D + * @return Reference to member D + */ + eProsima_user_DllExport std::vector& D(); + /*! + * @brief This function copies the value in member K + * @param _K New value to be copied in member K + */ + eProsima_user_DllExport void k(const std::array& _k); + + /*! + * @brief This function moves the value in member k + * @param _k New value to be moved in member k + */ + eProsima_user_DllExport void k(std::array&& _k); + + /*! + * @brief This function returns a constant reference to member k + * @return Constant reference to member k + */ + eProsima_user_DllExport const std::array& k() const; + + /*! + * @brief This function returns a reference to member k + * @return Reference to member k + */ + eProsima_user_DllExport std::array& k(); + /*! + * @brief This function copies the value in member r + * @param _r New value to be copied in member r + */ + eProsima_user_DllExport void r(const std::array& _r); + + /*! + * @brief This function moves the value in member r + * @param _r New value to be moved in member r + */ + eProsima_user_DllExport void r(std::array&& _r); + + /*! + * @brief This function returns a constant reference to member r + * @return Constant reference to member r + */ + eProsima_user_DllExport const std::array& r() const; + + /*! + * @brief This function returns a reference to member r + * @return Reference to member r + */ + eProsima_user_DllExport std::array& r(); + /*! + * @brief This function copies the value in member p + * @param _p New value to be copied in member p + */ + eProsima_user_DllExport void p(const std::array& _p); + + /*! + * @brief This function moves the value in member p + * @param _p New value to be moved in member p + */ + eProsima_user_DllExport void p(std::array&& _p); + + /*! + * @brief This function returns a constant reference to member p + * @return Constant reference to member p + */ + eProsima_user_DllExport const std::array& p() const; + + /*! + * @brief This function returns a reference to member p + * @return Reference to member p + */ + eProsima_user_DllExport std::array& p(); + /*! + * @brief This function sets a value in member binning_x + * @param _binning_x New value for member binning_x + */ + eProsima_user_DllExport void binning_x(uint32_t _binning_x); + + /*! + * @brief This function returns the value of member binning_x + * @return Value of member binning_x + */ + eProsima_user_DllExport uint32_t binning_x() const; + + /*! + * @brief This function returns a reference to member binning_x + * @return Reference to member binning_x + */ + eProsima_user_DllExport uint32_t& binning_x(); + + /*! + * @brief This function sets a value in member binning_y + * @param _binning_y New value for member binning_y + */ + eProsima_user_DllExport void binning_y(uint32_t _binning_y); + + /*! + * @brief This function returns the value of member binning_y + * @return Value of member binning_y + */ + eProsima_user_DllExport uint32_t binning_y() const; + + /*! + * @brief This function returns a reference to member binning_y + * @return Reference to member binning_y + */ + eProsima_user_DllExport uint32_t& binning_y(); + + /*! + * @brief This function copies the value in member roi + * @param _roi New value to be copied in member roi + */ + eProsima_user_DllExport void roi(const sensor_msgs::msg::RegionOfInterest& _roi); + + /*! + * @brief This function moves the value in member roi + * @param _roi New value to be moved in member roi + */ + eProsima_user_DllExport void roi(sensor_msgs::msg::RegionOfInterest&& _roi); + + /*! + * @brief This function returns a constant reference to member roi + * @return Constant reference to member roi + */ + eProsima_user_DllExport const sensor_msgs::msg::RegionOfInterest& roi() const; + + /*! + * @brief This function returns a reference to member roi + * @return Reference to member roi + */ + eProsima_user_DllExport sensor_msgs::msg::RegionOfInterest& roi(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::CameraInfo& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + uint32_t m_height; + uint32_t m_width; + std::string m_distortion_model; + std::vector m_d; + std::array m_k; + std::array m_r; + std::array m_p; + uint32_t m_binning_x; + uint32_t m_binning_y; + sensor_msgs::msg::RegionOfInterest m_roi; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ diff --git a/LibCarla/source/carla/ros2/types/CameraInfoPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/CameraInfoPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.h new file mode 100644 index 00000000000..50d03342fad --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.h @@ -0,0 +1,93 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CameraInfoPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ + +#include +#include + +#include "CameraInfo.h" + +#include "RegionOfInterestPubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated CameraInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace sensor_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type CameraInfo defined by the user in the IDL file. + * @ingroup CameraInfo + */ +class CameraInfoPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef CameraInfo type; + + eProsima_user_DllExport CameraInfoPubSubType(); + + eProsima_user_DllExport virtual ~CameraInfoPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.cc b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.cc new file mode 100644 index 00000000000..e607e9f9e40 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.cc @@ -0,0 +1,397 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Image.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +// char dummy; +} // namespace +#endif // _WIN32 + +#include "Image.h" +#include + +#include + +#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; +#define sensor_msgs_msg_Image_max_cdr_typesize 648ULL; +#define std_msgs_msg_Header_max_cdr_typesize 268ULL; +#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; +#define sensor_msgs_msg_Image_max_key_cdr_typesize 0ULL; +#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; + +template +sensor_msgs::msg::ImageT::ImageT() { + // std_msgs::msg::Header m_header + + // unsigned long m_height + m_height = 0; + // unsigned long m_width + m_width = 0; + // string m_encoding + m_encoding = ""; + // uint8 m_is_bigendian + m_is_bigendian = 0; + // unsigned long m_step + m_step = 0; + // sequence m_data +} + +template +sensor_msgs::msg::ImageT::~ImageT() {} + +template +sensor_msgs::msg::ImageT::ImageT(const ImageT& x) { + m_header = x.m_header; + m_height = x.m_height; + m_width = x.m_width; + m_encoding = x.m_encoding; + m_is_bigendian = x.m_is_bigendian; + m_step = x.m_step; + m_data = x.m_data; +} + +template +sensor_msgs::msg::ImageT::ImageT(ImageT&& x) noexcept { + m_header = std::move(x.m_header); + m_height = x.m_height; + m_width = x.m_width; + m_encoding = std::move(x.m_encoding); + m_is_bigendian = x.m_is_bigendian; + m_step = x.m_step; + m_data = std::move(x.m_data); +} + +template +sensor_msgs::msg::ImageT& sensor_msgs::msg::ImageT::operator=(const ImageT& x) { + m_header = x.m_header; + m_height = x.m_height; + m_width = x.m_width; + m_encoding = x.m_encoding; + m_is_bigendian = x.m_is_bigendian; + m_step = x.m_step; + m_data = x.m_data; + + return *this; +} + +template +sensor_msgs::msg::ImageT& sensor_msgs::msg::ImageT::operator=(ImageT&& x) noexcept { + m_header = std::move(x.m_header); + m_height = x.m_height; + m_width = x.m_width; + m_encoding = std::move(x.m_encoding); + m_is_bigendian = x.m_is_bigendian; + m_step = x.m_step; + m_data = std::move(x.m_data); + + return *this; +} + +template +bool sensor_msgs::msg::ImageT::operator==(const ImageT& x) const { + return (m_header == x.m_header && m_height == x.m_height && m_width == x.m_width && m_encoding == x.m_encoding && + m_is_bigendian == x.m_is_bigendian && m_step == x.m_step && m_data == x.m_data); +} + +template +bool sensor_msgs::msg::ImageT::operator!=(const ImageT& x) const { + return !(*this == x); +} + +template +size_t sensor_msgs::msg::ImageT::getMaxCdrSerializedSize(size_t current_alignment) { + static_cast(current_alignment); + return sensor_msgs_msg_Image_max_cdr_typesize; +} + +template +size_t sensor_msgs::msg::ImageT::getCdrSerializedSize(const sensor_msgs::msg::ImageT& data, + size_t current_alignment) { + size_t initial_alignment = current_alignment; + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.encoding().size() + 1; + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.data().size() > 0) { + current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + return current_alignment - initial_alignment; +} + +template +void sensor_msgs::msg::ImageT::serialize(eprosima::fastcdr::Cdr& scdr) const { + scdr << m_header; + scdr << m_height; + scdr << m_width; + scdr << m_encoding.c_str(); + scdr << m_is_bigendian; + scdr << m_step; + scdr << m_data; +} + +template +void sensor_msgs::msg::ImageT::deserialize(eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_header; + dcdr >> m_height; + dcdr >> m_width; + dcdr >> m_encoding; + dcdr >> m_is_bigendian; + dcdr >> m_step; + dcdr >> m_data; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +template +void sensor_msgs::msg::ImageT::header(const std_msgs::msg::Header& _header) { + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +template +void sensor_msgs::msg::ImageT::header(std_msgs::msg::Header&& _header) { + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +template +const std_msgs::msg::Header& sensor_msgs::msg::ImageT::header() const { + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +template +std_msgs::msg::Header& sensor_msgs::msg::ImageT::header() { + return m_header; +} + +/*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ +template +void sensor_msgs::msg::ImageT::height(uint32_t _height) { + m_height = _height; +} + +/*! + * @brief This function returns the value of member height + * @return Value of member height + */ +template +uint32_t sensor_msgs::msg::ImageT::height() const { + return m_height; +} + +/*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ +template +uint32_t& sensor_msgs::msg::ImageT::height() { + return m_height; +} + +/*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ +template +void sensor_msgs::msg::ImageT::width(uint32_t _width) { + m_width = _width; +} + +/*! + * @brief This function returns the value of member width + * @return Value of member width + */ +template +uint32_t sensor_msgs::msg::ImageT::width() const { + return m_width; +} + +/*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ +template +uint32_t& sensor_msgs::msg::ImageT::width() { + return m_width; +} + +/*! + * @brief This function copies the value in member encoding + * @param _encoding New value to be copied in member encoding + */ +template +void sensor_msgs::msg::ImageT::encoding(const std::string& _encoding) { + m_encoding = _encoding; +} + +/*! + * @brief This function moves the value in member encoding + * @param _encoding New value to be moved in member encoding + */ +template +void sensor_msgs::msg::ImageT::encoding(std::string&& _encoding) { + m_encoding = std::move(_encoding); +} + +/*! + * @brief This function returns a constant reference to member encoding + * @return Constant reference to member encoding + */ +template +const std::string& sensor_msgs::msg::ImageT::encoding() const { + return m_encoding; +} + +/*! + * @brief This function returns a reference to member encoding + * @return Reference to member encoding + */ +template +std::string& sensor_msgs::msg::ImageT::encoding() { + return m_encoding; +} + +/*! + * @brief This function sets a value in member is_bigendian + * @param _is_bigendian New value for member is_bigendian + */ +template +void sensor_msgs::msg::ImageT::is_bigendian(uint8_t _is_bigendian) { + m_is_bigendian = _is_bigendian; +} + +/*! + * @brief This function returns the value of member is_bigendian + * @return Value of member is_bigendian + */ +template +uint8_t sensor_msgs::msg::ImageT::is_bigendian() const { + return m_is_bigendian; +} + +/*! + * @brief This function returns a reference to member is_bigendian + * @return Reference to member is_bigendian + */ +template +uint8_t& sensor_msgs::msg::ImageT::is_bigendian() { + return m_is_bigendian; +} + +/*! + * @brief This function sets a value in member step + * @param _step New value for member step + */ +template +void sensor_msgs::msg::ImageT::step(uint32_t _step) { + m_step = _step; +} + +/*! + * @brief This function returns the value of member step + * @return Value of member step + */ +template +uint32_t sensor_msgs::msg::ImageT::step() const { + return m_step; +} + +/*! + * @brief This function returns a reference to member step + * @return Reference to member step + */ +template +uint32_t& sensor_msgs::msg::ImageT::step() { + return m_step; +} + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +template +void sensor_msgs::msg::ImageT::data(const typename sensor_msgs::msg::ImageT::vector_type& _data) { + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +template +void sensor_msgs::msg::ImageT::data(typename sensor_msgs::msg::ImageT::vector_type&& _data) { + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +template +const typename sensor_msgs::msg::ImageT::vector_type& sensor_msgs::msg::ImageT::data() const { + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +template +typename sensor_msgs::msg::ImageT::vector_type& sensor_msgs::msg::ImageT::data() { + return m_data; +} + +template +size_t sensor_msgs::msg::ImageT::getKeyMaxCdrSerializedSize(size_t current_alignment) { + static_cast(current_alignment); + return sensor_msgs_msg_Image_max_key_cdr_typesize; +} + +template +bool sensor_msgs::msg::ImageT::isKeyDefined() { + return false; +} + +template +void sensor_msgs::msg::ImageT::serializeKey(eprosima::fastcdr::Cdr& scdr) const { + (void)scdr; +} diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.h new file mode 100644 index 00000000000..56482e3eb90 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.h @@ -0,0 +1,335 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImageT.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_ImageT_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_ImageT_H_ + +#include "std_msgs/msg/Header.h" + +#include + +#include +#include +#include +#include +#include +#include + +#include "carla/sensor/data/SerializerVectorAllocator.h" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ImageT_SOURCE) +#define ImageT_DllAPI __declspec(dllexport) +#else +#define ImageT_DllAPI __declspec(dllimport) +#endif // ImageT_SOURCE +#else +#define ImageT_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ImageT_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace sensor_msgs { +namespace msg { +/*! + * @brief This class represents the structure ImageT defined by the user in the IDL file. + * @ingroup ImageT + */ +template +class ImageT { +public: + using base_type = uint8_t; + using allocator_type = ALLOCATOR; + using vector_type = std::vector; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ImageT(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ImageT(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. + */ + eProsima_user_DllExport ImageT(const ImageT& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. + */ + eProsima_user_DllExport ImageT(ImageT&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. + */ + eProsima_user_DllExport ImageT& operator=(const ImageT& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. + */ + eProsima_user_DllExport ImageT& operator=(ImageT&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::ImageT object to compare. + */ + eProsima_user_DllExport bool operator==(const ImageT& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::ImageT object to compare. + */ + eProsima_user_DllExport bool operator!=(const ImageT& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ + eProsima_user_DllExport void height(uint32_t _height); + + /*! + * @brief This function returns the value of member height + * @return Value of member height + */ + eProsima_user_DllExport uint32_t height() const; + + /*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ + eProsima_user_DllExport uint32_t& height(); + + /*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ + eProsima_user_DllExport void width(uint32_t _width); + + /*! + * @brief This function returns the value of member width + * @return Value of member width + */ + eProsima_user_DllExport uint32_t width() const; + + /*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ + eProsima_user_DllExport uint32_t& width(); + + /*! + * @brief This function copies the value in member encoding + * @param _encoding New value to be copied in member encoding + */ + eProsima_user_DllExport void encoding(const std::string& _encoding); + + /*! + * @brief This function moves the value in member encoding + * @param _encoding New value to be moved in member encoding + */ + eProsima_user_DllExport void encoding(std::string&& _encoding); + + /*! + * @brief This function returns a constant reference to member encoding + * @return Constant reference to member encoding + */ + eProsima_user_DllExport const std::string& encoding() const; + + /*! + * @brief This function returns a reference to member encoding + * @return Reference to member encoding + */ + eProsima_user_DllExport std::string& encoding(); + /*! + * @brief This function sets a value in member is_bigendian + * @param _is_bigendian New value for member is_bigendian + */ + eProsima_user_DllExport void is_bigendian(uint8_t _is_bigendian); + + /*! + * @brief This function returns the value of member is_bigendian + * @return Value of member is_bigendian + */ + eProsima_user_DllExport uint8_t is_bigendian() const; + + /*! + * @brief This function returns a reference to member is_bigendian + * @return Reference to member is_bigendian + */ + eProsima_user_DllExport uint8_t& is_bigendian(); + + /*! + * @brief This function sets a value in member step + * @param _step New value for member step + */ + eProsima_user_DllExport void step(uint32_t _step); + + /*! + * @brief This function returns the value of member step + * @return Value of member step + */ + eProsima_user_DllExport uint32_t step() const; + + /*! + * @brief This function returns a reference to member step + * @return Reference to member step + */ + eProsima_user_DllExport uint32_t& step(); + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data(const vector_type& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data(vector_type&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const vector_type& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport vector_type& data(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::ImageT& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + uint32_t m_height; + uint32_t m_width; + std::string m_encoding; + uint8_t m_is_bigendian; + uint32_t m_step; + vector_type m_data; +}; + +using ImageFromBuffer = ImageT>; +using Image = ImageT>; + +} // namespace msg +} // namespace sensor_msgs + +#include "Image.cc" + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_ImageT_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.cc b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.cc new file mode 100644 index 00000000000..e806b137209 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.cc @@ -0,0 +1,135 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImagePubSubTypeTs.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#include +#include + +#include "ImagePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace sensor_msgs { +namespace msg { + +template +ImagePubSubTypeT::ImagePubSubTypeT() { + setName("sensor_msgs::msg::dds_::Image_"); + auto type_size = type::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = type::isKeyDefined(); + size_t keyLength = type::getKeyMaxCdrSerializedSize() > 16 ? type::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +template +ImagePubSubTypeT::~ImagePubSubTypeT() { + if (m_keyBuffer != nullptr) { + free(m_keyBuffer); + } +} + +template +bool ImagePubSubTypeT::serialize(void* data, SerializedPayload_t* payload) { + type* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + p_type->serialize(ser); + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; +} + +template +bool ImagePubSubTypeT::deserialize(SerializedPayload_t* payload, void* data) { + // Convert DATA to pointer of your type + type* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + p_type->deserialize(deser); + return true; +} + +template +std::function ImagePubSubTypeT::getSerializedSizeProvider(void* data) { + return [data]() -> uint32_t { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + 4u /*encapsulation*/; + }; +} + +template +void* ImagePubSubTypeT::createData() { + return reinterpret_cast(new type()); +} + +template +void ImagePubSubTypeT::deleteData(void* data) { + delete (reinterpret_cast(data)); +} + +template +bool ImagePubSubTypeT::getKey(void* data, InstanceHandle_t* handle, bool force_md5) { + if (!m_isGetKeyDefined) { + return false; + } + + type* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), type::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || type::getKeyMaxCdrSerializedSize() > 16) { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) { + handle->value[i] = m_md5.digest[i]; + } + } else { + for (uint8_t i = 0; i < 16; ++i) { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; +} +} // End of namespace msg +} // End of namespace sensor_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.h new file mode 100644 index 00000000000..ce3b3026495 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.h @@ -0,0 +1,96 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImagePubSubTypeTs.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ + +#include +#include + +#include "Image.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Image is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace sensor_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type Image defined by the user in the IDL file. + * @ingroup IMAGE + */ +template +class ImagePubSubTypeT : public eprosima::fastdds::dds::TopicDataType { +public: + typedef ImageT type; + + eProsima_user_DllExport ImagePubSubTypeT(); + + eProsima_user_DllExport virtual ~ImagePubSubTypeT() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; + +using ImagePubSubTypeFromBuffer = ImagePubSubTypeT>; +using ImagePubSubType = ImagePubSubTypeT>; +} // namespace msg +} // namespace sensor_msgs + +#include "ImagePubSubTypes.cc" + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/Imu.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/Imu.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.h new file mode 100644 index 00000000000..59a1a5ec242 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.h @@ -0,0 +1,352 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Imu.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ + +#include "geometry_msgs/msg/Quaternion.h" +#include "geometry_msgs/msg/Vector3.h" +#include "std_msgs/msg/Header.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Imu_SOURCE) +#define Imu_DllAPI __declspec(dllexport) +#else +#define Imu_DllAPI __declspec(dllimport) +#endif // Imu_SOURCE +#else +#define Imu_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Imu_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace sensor_msgs { +namespace msg { +typedef std::array sensor_msgs__Imu__double_array_9; +/*! + * @brief This class represents the structure Imu defined by the user in the IDL file. + * @ingroup IMU + */ +class Imu { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Imu(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Imu(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. + */ + eProsima_user_DllExport Imu(const Imu& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. + */ + eProsima_user_DllExport Imu(Imu&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. + */ + eProsima_user_DllExport Imu& operator=(const Imu& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. + */ + eProsima_user_DllExport Imu& operator=(Imu&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::Imu object to compare. + */ + eProsima_user_DllExport bool operator==(const Imu& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::Imu object to compare. + */ + eProsima_user_DllExport bool operator!=(const Imu& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ + eProsima_user_DllExport void orientation(const geometry_msgs::msg::Quaternion& _orientation); + + /*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ + eProsima_user_DllExport void orientation(geometry_msgs::msg::Quaternion&& _orientation); + + /*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ + eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; + + /*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ + eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); + /*! + * @brief This function copies the value in member orientation_covariance + * @param _orientation_covariance New value to be copied in member orientation_covariance + */ + eProsima_user_DllExport void orientation_covariance( + const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _orientation_covariance); + + /*! + * @brief This function moves the value in member orientation_covariance + * @param _orientation_covariance New value to be moved in member orientation_covariance + */ + eProsima_user_DllExport void orientation_covariance( + sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _orientation_covariance); + + /*! + * @brief This function returns a constant reference to member orientation_covariance + * @return Constant reference to member orientation_covariance + */ + eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& orientation_covariance() const; + + /*! + * @brief This function returns a reference to member orientation_covariance + * @return Reference to member orientation_covariance + */ + eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& orientation_covariance(); + /*! + * @brief This function copies the value in member angular_velocity + * @param _angular_velocity New value to be copied in member angular_velocity + */ + eProsima_user_DllExport void angular_velocity(const geometry_msgs::msg::Vector3& _angular_velocity); + + /*! + * @brief This function moves the value in member angular_velocity + * @param _angular_velocity New value to be moved in member angular_velocity + */ + eProsima_user_DllExport void angular_velocity(geometry_msgs::msg::Vector3&& _angular_velocity); + + /*! + * @brief This function returns a constant reference to member angular_velocity + * @return Constant reference to member angular_velocity + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular_velocity() const; + + /*! + * @brief This function returns a reference to member angular_velocity + * @return Reference to member angular_velocity + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& angular_velocity(); + /*! + * @brief This function copies the value in member angular_velocity_covariance + * @param _angular_velocity_covariance New value to be copied in member angular_velocity_covariance + */ + eProsima_user_DllExport void angular_velocity_covariance( + const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _angular_velocity_covariance); + + /*! + * @brief This function moves the value in member angular_velocity_covariance + * @param _angular_velocity_covariance New value to be moved in member angular_velocity_covariance + */ + eProsima_user_DllExport void angular_velocity_covariance( + sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _angular_velocity_covariance); + + /*! + * @brief This function returns a constant reference to member angular_velocity_covariance + * @return Constant reference to member angular_velocity_covariance + */ + eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& angular_velocity_covariance() const; + + /*! + * @brief This function returns a reference to member angular_velocity_covariance + * @return Reference to member angular_velocity_covariance + */ + eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& angular_velocity_covariance(); + /*! + * @brief This function copies the value in member linear_acceleration + * @param _linear_acceleration New value to be copied in member linear_acceleration + */ + eProsima_user_DllExport void linear_acceleration(const geometry_msgs::msg::Vector3& _linear_acceleration); + + /*! + * @brief This function moves the value in member linear_acceleration + * @param _linear_acceleration New value to be moved in member linear_acceleration + */ + eProsima_user_DllExport void linear_acceleration(geometry_msgs::msg::Vector3&& _linear_acceleration); + + /*! + * @brief This function returns a constant reference to member linear_acceleration + * @return Constant reference to member linear_acceleration + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear_acceleration() const; + + /*! + * @brief This function returns a reference to member linear_acceleration + * @return Reference to member linear_acceleration + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& linear_acceleration(); + /*! + * @brief This function copies the value in member linear_acceleration_covariance + * @param _linear_acceleration_covariance New value to be copied in member linear_acceleration_covariance + */ + eProsima_user_DllExport void linear_acceleration_covariance( + const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _linear_acceleration_covariance); + + /*! + * @brief This function moves the value in member linear_acceleration_covariance + * @param _linear_acceleration_covariance New value to be moved in member linear_acceleration_covariance + */ + eProsima_user_DllExport void linear_acceleration_covariance( + sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _linear_acceleration_covariance); + + /*! + * @brief This function returns a constant reference to member linear_acceleration_covariance + * @return Constant reference to member linear_acceleration_covariance + */ + eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& linear_acceleration_covariance() + const; + + /*! + * @brief This function returns a reference to member linear_acceleration_covariance + * @return Reference to member linear_acceleration_covariance + */ + eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& linear_acceleration_covariance(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::Imu& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + geometry_msgs::msg::Quaternion m_orientation; + sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_orientation_covariance; + geometry_msgs::msg::Vector3 m_angular_velocity; + sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_angular_velocity_covariance; + geometry_msgs::msg::Vector3 m_linear_acceleration; + sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_linear_acceleration_covariance; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ diff --git a/LibCarla/source/carla/ros2/types/ImuPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/ImuPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.h new file mode 100644 index 00000000000..b4ecc2150df --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.h @@ -0,0 +1,96 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImuPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ + +#include +#include + +#include "Imu.h" + +#include "geometry_msgs/msg/QuaternionPubSubTypes.h" +#include "geometry_msgs/msg/Vector3PubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Imu is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace sensor_msgs { +namespace msg { +typedef std::array sensor_msgs__Imu__double_array_9; + +/*! + * @brief This class represents the TopicDataType of the type Imu defined by the user in the IDL file. + * @ingroup IMU + */ +class ImuPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef Imu type; + + eProsima_user_DllExport ImuPubSubType(); + + eProsima_user_DllExport virtual ~ImuPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/NavSatFix.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/NavSatFix.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.h new file mode 100644 index 00000000000..64985f357b4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.h @@ -0,0 +1,329 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file NavSatFix.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ + +#include "NavSatStatus.h" +#include "std_msgs/msg/Header.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(NavSatFix_SOURCE) +#define NavSatFix_DllAPI __declspec(dllexport) +#else +#define NavSatFix_DllAPI __declspec(dllimport) +#endif // NavSatFix_SOURCE +#else +#define NavSatFix_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define NavSatFix_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace sensor_msgs { +namespace msg { +const uint8_t NavSatFix__COVARIANCE_TYPE_UNKNOWN = 0; +const uint8_t NavSatFix__COVARIANCE_TYPE_APPROXIMATED = 1; +const uint8_t NavSatFix__COVARIANCE_TYPE_DIAGONAL_KNOWN = 2; +const uint8_t NavSatFix__COVARIANCE_TYPE_KNOWN = 3; +typedef std::array sensor_msgs__NavSatFix__double_array_9; +/*! + * @brief This class represents the structure NavSatFix defined by the user in the IDL file. + * @ingroup NAVSATFIX + */ +class NavSatFix { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport NavSatFix(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~NavSatFix(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. + */ + eProsima_user_DllExport NavSatFix(const NavSatFix& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. + */ + eProsima_user_DllExport NavSatFix(NavSatFix&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. + */ + eProsima_user_DllExport NavSatFix& operator=(const NavSatFix& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. + */ + eProsima_user_DllExport NavSatFix& operator=(NavSatFix&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::NavSatFix object to compare. + */ + eProsima_user_DllExport bool operator==(const NavSatFix& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::NavSatFix object to compare. + */ + eProsima_user_DllExport bool operator!=(const NavSatFix& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function copies the value in member status + * @param _status New value to be copied in member status + */ + eProsima_user_DllExport void status(const sensor_msgs::msg::NavSatStatus& _status); + + /*! + * @brief This function moves the value in member status + * @param _status New value to be moved in member status + */ + eProsima_user_DllExport void status(sensor_msgs::msg::NavSatStatus&& _status); + + /*! + * @brief This function returns a constant reference to member status + * @return Constant reference to member status + */ + eProsima_user_DllExport const sensor_msgs::msg::NavSatStatus& status() const; + + /*! + * @brief This function returns a reference to member status + * @return Reference to member status + */ + eProsima_user_DllExport sensor_msgs::msg::NavSatStatus& status(); + /*! + * @brief This function sets a value in member latitude + * @param _latitude New value for member latitude + */ + eProsima_user_DllExport void latitude(double _latitude); + + /*! + * @brief This function returns the value of member latitude + * @return Value of member latitude + */ + eProsima_user_DllExport double latitude() const; + + /*! + * @brief This function returns a reference to member latitude + * @return Reference to member latitude + */ + eProsima_user_DllExport double& latitude(); + + /*! + * @brief This function sets a value in member longitude + * @param _longitude New value for member longitude + */ + eProsima_user_DllExport void longitude(double _longitude); + + /*! + * @brief This function returns the value of member longitude + * @return Value of member longitude + */ + eProsima_user_DllExport double longitude() const; + + /*! + * @brief This function returns a reference to member longitude + * @return Reference to member longitude + */ + eProsima_user_DllExport double& longitude(); + + /*! + * @brief This function sets a value in member altitude + * @param _altitude New value for member altitude + */ + eProsima_user_DllExport void altitude(double _altitude); + + /*! + * @brief This function returns the value of member altitude + * @return Value of member altitude + */ + eProsima_user_DllExport double altitude() const; + + /*! + * @brief This function returns a reference to member altitude + * @return Reference to member altitude + */ + eProsima_user_DllExport double& altitude(); + + /*! + * @brief This function copies the value in member position_covariance + * @param _position_covariance New value to be copied in member position_covariance + */ + eProsima_user_DllExport void position_covariance( + const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& _position_covariance); + + /*! + * @brief This function moves the value in member position_covariance + * @param _position_covariance New value to be moved in member position_covariance + */ + eProsima_user_DllExport void position_covariance( + sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9&& _position_covariance); + + /*! + * @brief This function returns a constant reference to member position_covariance + * @return Constant reference to member position_covariance + */ + eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& position_covariance() const; + + /*! + * @brief This function returns a reference to member position_covariance + * @return Reference to member position_covariance + */ + eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& position_covariance(); + /*! + * @brief This function sets a value in member position_covariance_type + * @param _position_covariance_type New value for member position_covariance_type + */ + eProsima_user_DllExport void position_covariance_type(uint8_t _position_covariance_type); + + /*! + * @brief This function returns the value of member position_covariance_type + * @return Value of member position_covariance_type + */ + eProsima_user_DllExport uint8_t position_covariance_type() const; + + /*! + * @brief This function returns a reference to member position_covariance_type + * @return Reference to member position_covariance_type + */ + eProsima_user_DllExport uint8_t& position_covariance_type(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::NavSatFix& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + sensor_msgs::msg::NavSatStatus m_status; + double m_latitude; + double m_longitude; + double m_altitude; + sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9 m_position_covariance; + uint8_t m_position_covariance_type; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ diff --git a/LibCarla/source/carla/ros2/types/NavSatFixPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/NavSatFixPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.h new file mode 100644 index 00000000000..5a41522e6e1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.h @@ -0,0 +1,95 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file NavSatFixPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ + +#include +#include + +#include "NavSatFix.h" + +#include "NavSatStatusPubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated NavSatFix is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace sensor_msgs { +namespace msg { +typedef std::array sensor_msgs__NavSatFix__double_array_9; + +/*! + * @brief This class represents the TopicDataType of the type NavSatFix defined by the user in the IDL file. + * @ingroup NAVSATFIX + */ +class NavSatFixPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef NavSatFix type; + + eProsima_user_DllExport NavSatFixPubSubType(); + + eProsima_user_DllExport virtual ~NavSatFixPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/NavSatStatus.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/NavSatStatus.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.h new file mode 100644 index 00000000000..183499cf74c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file NavSatStatus.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(NavSatStatus_SOURCE) +#define NavSatStatus_DllAPI __declspec(dllexport) +#else +#define NavSatStatus_DllAPI __declspec(dllimport) +#endif // NavSatStatus_SOURCE +#else +#define NavSatStatus_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define NavSatStatus_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace sensor_msgs { +namespace msg { +const uint8_t NavSatStatus__STATUS_NO_FIX = 255; +const uint8_t NavSatStatus__STATUS_FIX = 0; +const uint8_t NavSatStatus__STATUS_SBAS_FIX = 1; +const uint8_t NavSatStatus__STATUS_GBAS_FIX = 2; +const uint16_t NavSatStatus__SERVICE_GPS = 1; +const uint16_t NavSatStatus__SERVICE_GLONASS = 2; +const uint16_t NavSatStatus__SERVICE_COMPASS = 4; +const uint16_t NavSatStatus__SERVICE_GALILEO = 8; +/*! + * @brief This class represents the structure NavSatStatus defined by the user in the IDL file. + * @ingroup NAVSATSTATUS + */ +class NavSatStatus { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport NavSatStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~NavSatStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + */ + eProsima_user_DllExport NavSatStatus(const NavSatStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + */ + eProsima_user_DllExport NavSatStatus(NavSatStatus&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + */ + eProsima_user_DllExport NavSatStatus& operator=(const NavSatStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + */ + eProsima_user_DllExport NavSatStatus& operator=(NavSatStatus&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::NavSatStatus object to compare. + */ + eProsima_user_DllExport bool operator==(const NavSatStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::NavSatStatus object to compare. + */ + eProsima_user_DllExport bool operator!=(const NavSatStatus& x) const; + + /*! + * @brief This function sets a value in member status + * @param _status New value for member status + */ + eProsima_user_DllExport void status(uint8_t _status); + + /*! + * @brief This function returns the value of member status + * @return Value of member status + */ + eProsima_user_DllExport uint8_t status() const; + + /*! + * @brief This function returns a reference to member status + * @return Reference to member status + */ + eProsima_user_DllExport uint8_t& status(); + + /*! + * @brief This function sets a value in member service + * @param _service New value for member service + */ + eProsima_user_DllExport void service(uint16_t _service); + + /*! + * @brief This function returns the value of member service + * @return Value of member service + */ + eProsima_user_DllExport uint16_t service() const; + + /*! + * @brief This function returns a reference to member service + * @return Reference to member service + */ + eProsima_user_DllExport uint16_t& service(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::NavSatStatus& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + uint8_t m_status; + uint16_t m_service; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ diff --git a/LibCarla/source/carla/ros2/types/NavSatStatusPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/NavSatStatusPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.h new file mode 100644 index 00000000000..ec4276146a3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.h @@ -0,0 +1,119 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file NavSatStatusPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ + +#include +#include + +#include "NavSatStatus.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated NavSatStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace sensor_msgs { +namespace msg { +#ifndef SWIG +namespace detail { + +template +struct NavSatStatus_rob { + friend constexpr typename Tag::type get(Tag) { + return M; + } +}; + +struct NavSatStatus_f { + typedef uint16_t NavSatStatus::*type; + friend constexpr type get(NavSatStatus_f); +}; + +template struct NavSatStatus_rob; + +template +inline size_t constexpr NavSatStatus_offset_of() { + return ((::size_t) & reinterpret_cast((((T*)0)->*get(Tag())))); +} +} // namespace detail +#endif + +/*! + * @brief This class represents the TopicDataType of the type NavSatStatus defined by the user in the IDL file. + * @ingroup NAVSATSTATUS + */ +class NavSatStatusPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef NavSatStatus type; + + eProsima_user_DllExport NavSatStatusPubSubType(); + + eProsima_user_DllExport virtual ~NavSatStatusPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return is_plain_impl(); + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + new (memory) NavSatStatus(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + static constexpr bool is_plain_impl() { + return 4ULL == (detail::NavSatStatus_offset_of() + sizeof(uint16_t)); + } +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cc b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cc new file mode 100644 index 00000000000..27919c778b1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cc @@ -0,0 +1,487 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCloud2.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PointCloud2.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +#define sensor_msgs_msg_PointField_max_cdr_typesize 272ULL; +#define std_msgs_msg_Time_max_cdr_typesize 8ULL; +#define sensor_msgs_msg_PointCloud2_max_cdr_typesize 27597ULL; +#define std_msgs_msg_Header_max_cdr_typesize 268ULL; +#define sensor_msgs_msg_PointField_max_key_cdr_typesize 0ULL; +#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL; +#define sensor_msgs_msg_PointCloud2_max_key_cdr_typesize 0ULL; +#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; + +template +sensor_msgs::msg::PointCloud2T::PointCloud2T() { + // std_msgs::msg::Header m_header + + // unsigned long m_height + m_height = 0; + // unsigned long m_width + m_width = 0; + // sequence m_fields + + // boolean m_is_bigendian + m_is_bigendian = false; + // unsigned long m_point_step + m_point_step = 0; + // unsigned long m_row_step + m_row_step = 0; + // sequence m_data + + // boolean m_is_dense + m_is_dense = false; +} + +template +sensor_msgs::msg::PointCloud2T::~PointCloud2T() {} + +template +sensor_msgs::msg::PointCloud2T::PointCloud2T(const PointCloud2T& x) { + m_header = x.m_header; + m_height = x.m_height; + m_width = x.m_width; + m_fields = x.m_fields; + m_is_bigendian = x.m_is_bigendian; + m_point_step = x.m_point_step; + m_row_step = x.m_row_step; + m_data = x.m_data; + m_is_dense = x.m_is_dense; +} + +template +sensor_msgs::msg::PointCloud2T::PointCloud2T(PointCloud2T&& x) noexcept { + m_header = std::move(x.m_header); + m_height = x.m_height; + m_width = x.m_width; + m_fields = std::move(x.m_fields); + m_is_bigendian = x.m_is_bigendian; + m_point_step = x.m_point_step; + m_row_step = x.m_row_step; + m_data = std::move(x.m_data); + m_is_dense = x.m_is_dense; +} + +template +sensor_msgs::msg::PointCloud2T& sensor_msgs::msg::PointCloud2T::operator=( + const PointCloud2T& x) { + m_header = x.m_header; + m_height = x.m_height; + m_width = x.m_width; + m_fields = x.m_fields; + m_is_bigendian = x.m_is_bigendian; + m_point_step = x.m_point_step; + m_row_step = x.m_row_step; + m_data = x.m_data; + m_is_dense = x.m_is_dense; + + return *this; +} + +template +sensor_msgs::msg::PointCloud2T& sensor_msgs::msg::PointCloud2T::operator=( + PointCloud2T&& x) noexcept { + m_header = std::move(x.m_header); + m_height = x.m_height; + m_width = x.m_width; + m_fields = std::move(x.m_fields); + m_is_bigendian = x.m_is_bigendian; + m_point_step = x.m_point_step; + m_row_step = x.m_row_step; + m_data = std::move(x.m_data); + m_is_dense = x.m_is_dense; + + return *this; +} + +template +bool sensor_msgs::msg::PointCloud2T::operator==(const PointCloud2T& x) const { + return (m_header == x.m_header && m_height == x.m_height && m_width == x.m_width && m_fields == x.m_fields && + m_is_bigendian == x.m_is_bigendian && m_point_step == x.m_point_step && m_row_step == x.m_row_step && + m_data == x.m_data && m_is_dense == x.m_is_dense); +} + +template +bool sensor_msgs::msg::PointCloud2T::operator!=(const PointCloud2T& x) const { + return !(*this == x); +} + +template +size_t sensor_msgs::msg::PointCloud2T::getMaxCdrSerializedSize(size_t current_alignment) { + static_cast(current_alignment); + return sensor_msgs_msg_PointCloud2_max_cdr_typesize; +} + +template +size_t sensor_msgs::msg::PointCloud2T::getCdrSerializedSize( + const sensor_msgs::msg::PointCloud2T& data, size_t current_alignment) { + size_t initial_alignment = current_alignment; + current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for (size_t a = 0; a < data.fields().size(); ++a) { + current_alignment += sensor_msgs::msg::PointField::getCdrSerializedSize(data.fields().at(a), current_alignment); + } + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.data().size() > 0) { + current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + return current_alignment - initial_alignment; +} + +template +void sensor_msgs::msg::PointCloud2T::serialize(eprosima::fastcdr::Cdr& scdr) const { + scdr << m_header; + scdr << m_height; + scdr << m_width; + scdr << m_fields; + scdr << m_is_bigendian; + scdr << m_point_step; + scdr << m_row_step; + scdr << m_data; + scdr << m_is_dense; +} + +template +void sensor_msgs::msg::PointCloud2T::deserialize(eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_header; + dcdr >> m_height; + dcdr >> m_width; + dcdr >> m_fields; + dcdr >> m_is_bigendian; + dcdr >> m_point_step; + dcdr >> m_row_step; + dcdr >> m_data; + dcdr >> m_is_dense; +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +template +void sensor_msgs::msg::PointCloud2T::header(const std_msgs::msg::Header& _header) { + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +template +void sensor_msgs::msg::PointCloud2T::header(std_msgs::msg::Header&& _header) { + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +template +const std_msgs::msg::Header& sensor_msgs::msg::PointCloud2T::header() const { + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +template +std_msgs::msg::Header& sensor_msgs::msg::PointCloud2T::header() { + return m_header; +} + +/*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ +template +void sensor_msgs::msg::PointCloud2T::height(uint32_t _height) { + m_height = _height; +} + +/*! + * @brief This function returns the value of member height + * @return Value of member height + */ +template +uint32_t sensor_msgs::msg::PointCloud2T::height() const { + return m_height; +} + +/*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ +template +uint32_t& sensor_msgs::msg::PointCloud2T::height() { + return m_height; +} + +/*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ +template +void sensor_msgs::msg::PointCloud2T::width(uint32_t _width) { + m_width = _width; +} + +/*! + * @brief This function returns the value of member width + * @return Value of member width + */ +template +uint32_t sensor_msgs::msg::PointCloud2T::width() const { + return m_width; +} + +/*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ +template +uint32_t& sensor_msgs::msg::PointCloud2T::width() { + return m_width; +} + +/*! + * @brief This function copies the value in member fields + * @param _fields New value to be copied in member fields + */ +template +void sensor_msgs::msg::PointCloud2T::fields(const std::vector& _fields) { + m_fields = _fields; +} + +/*! + * @brief This function moves the value in member fields + * @param _fields New value to be moved in member fields + */ +template +void sensor_msgs::msg::PointCloud2T::fields(std::vector&& _fields) { + m_fields = std::move(_fields); +} + +/*! + * @brief This function returns a constant reference to member fields + * @return Constant reference to member fields + */ +template +const std::vector& sensor_msgs::msg::PointCloud2T::fields() const { + return m_fields; +} + +/*! + * @brief This function returns a reference to member fields + * @return Reference to member fields + */ +template +std::vector& sensor_msgs::msg::PointCloud2T::fields() { + return m_fields; +} + +/*! + * @brief This function sets a value in member is_bigendian + * @param _is_bigendian New value for member is_bigendian + */ +template +void sensor_msgs::msg::PointCloud2T::is_bigendian(bool _is_bigendian) { + m_is_bigendian = _is_bigendian; +} + +/*! + * @brief This function returns the value of member is_bigendian + * @return Value of member is_bigendian + */ +template +bool sensor_msgs::msg::PointCloud2T::is_bigendian() const { + return m_is_bigendian; +} + +/*! + * @brief This function returns a reference to member is_bigendian + * @return Reference to member is_bigendian + */ +template +bool& sensor_msgs::msg::PointCloud2T::is_bigendian() { + return m_is_bigendian; +} + +/*! + * @brief This function sets a value in member point_step + * @param _point_step New value for member point_step + */ +template +void sensor_msgs::msg::PointCloud2T::point_step(uint32_t _point_step) { + m_point_step = _point_step; +} + +/*! + * @brief This function returns the value of member point_step + * @return Value of member point_step + */ +template +uint32_t sensor_msgs::msg::PointCloud2T::point_step() const { + return m_point_step; +} + +/*! + * @brief This function returns a reference to member point_step + * @return Reference to member point_step + */ +template +uint32_t& sensor_msgs::msg::PointCloud2T::point_step() { + return m_point_step; +} + +/*! + * @brief This function sets a value in member row_step + * @param _row_step New value for member row_step + */ +template +void sensor_msgs::msg::PointCloud2T::row_step(uint32_t _row_step) { + m_row_step = _row_step; +} + +/*! + * @brief This function returns the value of member row_step + * @return Value of member row_step + */ +template +uint32_t sensor_msgs::msg::PointCloud2T::row_step() const { + return m_row_step; +} + +/*! + * @brief This function returns a reference to member row_step + * @return Reference to member row_step + */ +template +uint32_t& sensor_msgs::msg::PointCloud2T::row_step() { + return m_row_step; +} + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +template +void sensor_msgs::msg::PointCloud2T::data( + const typename sensor_msgs::msg::PointCloud2T::vector_type& _data) { + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +template +void sensor_msgs::msg::PointCloud2T::data( + typename sensor_msgs::msg::PointCloud2T::vector_type&& _data) { + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +template +const typename sensor_msgs::msg::PointCloud2T::vector_type& sensor_msgs::msg::PointCloud2T::data() + const { + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +template +typename sensor_msgs::msg::PointCloud2T::vector_type& sensor_msgs::msg::PointCloud2T::data() { + return m_data; +} + +/*! + * @brief This function sets a value in member is_dense + * @param _is_dense New value for member is_dense + */ +template +void sensor_msgs::msg::PointCloud2T::is_dense(bool _is_dense) { + m_is_dense = _is_dense; +} + +/*! + * @brief This function returns the value of member is_dense + * @return Value of member is_dense + */ +template +bool sensor_msgs::msg::PointCloud2T::is_dense() const { + return m_is_dense; +} + +/*! + * @brief This function returns a reference to member is_dense + * @return Reference to member is_dense + */ +template +bool& sensor_msgs::msg::PointCloud2T::is_dense() { + return m_is_dense; +} + +template +size_t sensor_msgs::msg::PointCloud2T::getKeyMaxCdrSerializedSize(size_t current_alignment) { + static_cast(current_alignment); + return sensor_msgs_msg_PointCloud2_max_key_cdr_typesize; +} + +template +bool sensor_msgs::msg::PointCloud2T::isKeyDefined() { + return false; +} + +template +void sensor_msgs::msg::PointCloud2T::serializeKey(eprosima::fastcdr::Cdr& scdr) const { + (void)scdr; +} diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.h new file mode 100644 index 00000000000..2cbfba0f4f3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.h @@ -0,0 +1,372 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCloud2.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ + +#include "PointField.h" +#include "std_msgs/msg/Header.h" + +#include + +#include +#include +#include +#include +#include +#include + +#include "carla/sensor/data/SerializerVectorAllocator.h" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PointCloud2_SOURCE) +#define PointCloud2_DllAPI __declspec(dllexport) +#else +#define PointCloud2_DllAPI __declspec(dllimport) +#endif // PointCloud2_SOURCE +#else +#define PointCloud2_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PointCloud2_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace sensor_msgs { +namespace msg { +/*! + * @brief This class represents the structure PointCloud2T defined by the user in the IDL file. + * @ingroup POINTCLOUD2 + */ +template +class PointCloud2T { +public: + using base_type = uint8_t; + using allocator_type = ALLOCATOR; + using vector_type = std::vector; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PointCloud2T(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PointCloud2T(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::PointCloud2T that will be copied. + */ + eProsima_user_DllExport PointCloud2T(const PointCloud2T& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::PointCloud2T that will be copied. + */ + eProsima_user_DllExport PointCloud2T(PointCloud2T&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::PointCloud2T that will be copied. + */ + eProsima_user_DllExport PointCloud2T& operator=(const PointCloud2T& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::PointCloud2T that will be copied. + */ + eProsima_user_DllExport PointCloud2T& operator=(PointCloud2T&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::PointCloud2T object to compare. + */ + eProsima_user_DllExport bool operator==(const PointCloud2T& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::PointCloud2T object to compare. + */ + eProsima_user_DllExport bool operator!=(const PointCloud2T& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + /*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ + eProsima_user_DllExport void height(uint32_t _height); + + /*! + * @brief This function returns the value of member height + * @return Value of member height + */ + eProsima_user_DllExport uint32_t height() const; + + /*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ + eProsima_user_DllExport uint32_t& height(); + + /*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ + eProsima_user_DllExport void width(uint32_t _width); + + /*! + * @brief This function returns the value of member width + * @return Value of member width + */ + eProsima_user_DllExport uint32_t width() const; + + /*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ + eProsima_user_DllExport uint32_t& width(); + + /*! + * @brief This function copies the value in member fields + * @param _fields New value to be copied in member fields + */ + eProsima_user_DllExport void fields(const std::vector& _fields); + + /*! + * @brief This function moves the value in member fields + * @param _fields New value to be moved in member fields + */ + eProsima_user_DllExport void fields(std::vector&& _fields); + + /*! + * @brief This function returns a constant reference to member fields + * @return Constant reference to member fields + */ + eProsima_user_DllExport const std::vector& fields() const; + + /*! + * @brief This function returns a reference to member fields + * @return Reference to member fields + */ + eProsima_user_DllExport std::vector& fields(); + /*! + * @brief This function sets a value in member is_bigendian + * @param _is_bigendian New value for member is_bigendian + */ + eProsima_user_DllExport void is_bigendian(bool _is_bigendian); + + /*! + * @brief This function returns the value of member is_bigendian + * @return Value of member is_bigendian + */ + eProsima_user_DllExport bool is_bigendian() const; + + /*! + * @brief This function returns a reference to member is_bigendian + * @return Reference to member is_bigendian + */ + eProsima_user_DllExport bool& is_bigendian(); + + /*! + * @brief This function sets a value in member point_step + * @param _point_step New value for member point_step + */ + eProsima_user_DllExport void point_step(uint32_t _point_step); + + /*! + * @brief This function returns the value of member point_step + * @return Value of member point_step + */ + eProsima_user_DllExport uint32_t point_step() const; + + /*! + * @brief This function returns a reference to member point_step + * @return Reference to member point_step + */ + eProsima_user_DllExport uint32_t& point_step(); + + /*! + * @brief This function sets a value in member row_step + * @param _row_step New value for member row_step + */ + eProsima_user_DllExport void row_step(uint32_t _row_step); + + /*! + * @brief This function returns the value of member row_step + * @return Value of member row_step + */ + eProsima_user_DllExport uint32_t row_step() const; + + /*! + * @brief This function returns a reference to member row_step + * @return Reference to member row_step + */ + eProsima_user_DllExport uint32_t& row_step(); + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data(const vector_type& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data(vector_type&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const vector_type& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport vector_type& data(); + /*! + * @brief This function sets a value in member is_dense + * @param _is_dense New value for member is_dense + */ + eProsima_user_DllExport void is_dense(bool _is_dense); + + /*! + * @brief This function returns the value of member is_dense + * @return Value of member is_dense + */ + eProsima_user_DllExport bool is_dense() const; + + /*! + * @brief This function returns a reference to member is_dense + * @return Reference to member is_dense + */ + eProsima_user_DllExport bool& is_dense(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::PointCloud2T& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std_msgs::msg::Header m_header; + uint32_t m_height; + uint32_t m_width; + std::vector m_fields; + bool m_is_bigendian; + uint32_t m_point_step; + uint32_t m_row_step; + vector_type m_data; + bool m_is_dense; +}; + +using PointCloud2 = PointCloud2T>; + +} // namespace msg +} // namespace sensor_msgs + +#include "PointCloud2.cc" + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cc b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cc new file mode 100644 index 00000000000..3ed3d81e7f2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cc @@ -0,0 +1,150 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCloud2PubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#include +#include + +#include "PointCloud2PubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace sensor_msgs { +namespace msg { +template +PointCloud2PubSubTypeT::PointCloud2PubSubTypeT() { + setName("sensor_msgs::msg::dds_::PointCloud2_"); + auto type_size = PointCloud2T::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = PointCloud2T::isKeyDefined(); + size_t keyLength = PointCloud2T::getKeyMaxCdrSerializedSize() > 16 + ? PointCloud2T::getKeyMaxCdrSerializedSize() + : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +template +PointCloud2PubSubTypeT::~PointCloud2PubSubTypeT() { + if (m_keyBuffer != nullptr) { + free(m_keyBuffer); + } +} + +template +bool PointCloud2PubSubTypeT::serialize(void* data, SerializedPayload_t* payload) { + PointCloud2T* p_type = static_cast*>(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try { + // Serialize the object. + p_type->serialize(ser); + } catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; +} + +template +bool PointCloud2PubSubTypeT::deserialize(SerializedPayload_t* payload, void* data) { + try { + // Convert DATA to pointer of your type + PointCloud2T* p_type = static_cast*>(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + p_type->deserialize(deser); + } catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) { + return false; + } + + return true; +} + +template +std::function PointCloud2PubSubTypeT::getSerializedSizeProvider(void* data) { + return [data]() -> uint32_t { + return static_cast(type::getCdrSerializedSize(*static_cast*>(data))) + + 4u /*encapsulation*/; + }; +} + +template +void* PointCloud2PubSubTypeT::createData() { + return reinterpret_cast(new PointCloud2T()); +} + +template +void PointCloud2PubSubTypeT::deleteData(void* data) { + delete (reinterpret_cast*>(data)); +} + +template +bool PointCloud2PubSubTypeT::getKey(void* data, InstanceHandle_t* handle, bool force_md5) { + if (!m_isGetKeyDefined) { + return false; + } + + PointCloud2T* p_type = static_cast*>(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + PointCloud2T::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || PointCloud2T::getKeyMaxCdrSerializedSize() > 16) { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) { + handle->value[i] = m_md5.digest[i]; + } + } else { + for (uint8_t i = 0; i < 16; ++i) { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; +} +} // End of namespace msg +} // End of namespace sensor_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.h new file mode 100644 index 00000000000..bc992c03d29 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.h @@ -0,0 +1,99 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCloud2PubSubTypeTs.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ + +#include +#include + +#include "PointCloud2.h" + +#include "PointFieldPubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated PointCloud2 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace sensor_msgs { +namespace msg { + +/*! + * @brief This class represents the TopicDataType of the type PointCloud2 defined by the user in the IDL file. + * @ingroup POINTCLOUD2 + */ +template +class PointCloud2PubSubTypeT : public eprosima::fastdds::dds::TopicDataType { +public: + typedef PointCloud2T type; + + eProsima_user_DllExport PointCloud2PubSubTypeT(); + + eProsima_user_DllExport virtual ~PointCloud2PubSubTypeT() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; + +using PointCloud2PubSubType = PointCloud2PubSubTypeT>; +} // namespace msg +} // namespace sensor_msgs + +#include "PointCloud2PubSubTypes.cc" + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/PointField.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/PointField.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.h new file mode 100644 index 00000000000..ba12c86785c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.h @@ -0,0 +1,261 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointField.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(PointField_SOURCE) +#define PointField_DllAPI __declspec(dllexport) +#else +#define PointField_DllAPI __declspec(dllimport) +#endif // PointField_SOURCE +#else +#define PointField_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define PointField_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace sensor_msgs { +namespace msg { +const uint8_t PointField__INT8 = 1; +const uint8_t PointField__UINT8 = 2; +const uint8_t PointField__INT16 = 3; +const uint8_t PointField__UINT16 = 4; +const uint8_t PointField__INT32 = 5; +const uint8_t PointField__UINT32 = 6; +const uint8_t PointField__FLOAT32 = 7; +const uint8_t PointField__FLOAT64 = 8; + +/*! + * @brief This class represents the structure PointField defined by the user in the IDL file. + * @ingroup POINTFIELD + */ +class PointField { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PointField(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PointField(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + */ + eProsima_user_DllExport PointField(const PointField& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + */ + eProsima_user_DllExport PointField(PointField&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + */ + eProsima_user_DllExport PointField& operator=(const PointField& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + */ + eProsima_user_DllExport PointField& operator=(PointField&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::PointField object to compare. + */ + eProsima_user_DllExport bool operator==(const PointField& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::PointField object to compare. + */ + eProsima_user_DllExport bool operator!=(const PointField& x) const; + + /*! + * @brief This function copies the value in member name + * @param _name New value to be copied in member name + */ + eProsima_user_DllExport void name(const std::string& _name); + + /*! + * @brief This function moves the value in member name + * @param _name New value to be moved in member name + */ + eProsima_user_DllExport void name(std::string&& _name); + + /*! + * @brief This function returns a constant reference to member name + * @return Constant reference to member name + */ + eProsima_user_DllExport const std::string& name() const; + + /*! + * @brief This function returns a reference to member name + * @return Reference to member name + */ + eProsima_user_DllExport std::string& name(); + /*! + * @brief This function sets a value in member offset + * @param _offset New value for member offset + */ + eProsima_user_DllExport void offset(uint32_t _offset); + + /*! + * @brief This function returns the value of member offset + * @return Value of member offset + */ + eProsima_user_DllExport uint32_t offset() const; + + /*! + * @brief This function returns a reference to member offset + * @return Reference to member offset + */ + eProsima_user_DllExport uint32_t& offset(); + + /*! + * @brief This function sets a value in member datatype + * @param _datatype New value for member datatype + */ + eProsima_user_DllExport void datatype(uint8_t _datatype); + + /*! + * @brief This function returns the value of member datatype + * @return Value of member datatype + */ + eProsima_user_DllExport uint8_t datatype() const; + + /*! + * @brief This function returns a reference to member datatype + * @return Reference to member datatype + */ + eProsima_user_DllExport uint8_t& datatype(); + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count(uint32_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint32_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint32_t& count(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::PointField& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std::string m_name; + uint32_t m_offset; + uint8_t m_datatype; + uint32_t m_count; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ diff --git a/LibCarla/source/carla/ros2/types/PointFieldPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/PointFieldPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.h new file mode 100644 index 00000000000..f787d0a7080 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.h @@ -0,0 +1,90 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointFieldPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ + +#include +#include + +#include "PointField.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated PointField is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace sensor_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type PointField defined by the user in the IDL file. + * @ingroup POINTFIELD + */ +class PointFieldPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef PointField type; + + eProsima_user_DllExport PointFieldPubSubType(); + + eProsima_user_DllExport virtual ~PointFieldPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/RegionOfInterest.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/RegionOfInterest.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.h new file mode 100644 index 00000000000..c36d1ddbafb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.h @@ -0,0 +1,266 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RegionOfInterest.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(REGIONOFINTEREST_SOURCE) +#define REGIONOFINTEREST_DllAPI __declspec(dllexport) +#else +#define REGIONOFINTEREST_DllAPI __declspec(dllimport) +#endif // REGIONOFINTEREST_SOURCE +#else +#define REGIONOFINTEREST_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define REGIONOFINTEREST_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace sensor_msgs { +namespace msg { +/*! + * @brief This class represents the structure RegionOfInterest defined by the user in the IDL file. + * @ingroup RegionOfInterest + */ +class RegionOfInterest { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RegionOfInterest(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RegionOfInterest(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. + */ + eProsima_user_DllExport RegionOfInterest(const RegionOfInterest& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. + */ + eProsima_user_DllExport RegionOfInterest(RegionOfInterest&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. + */ + eProsima_user_DllExport RegionOfInterest& operator=(const RegionOfInterest& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. + */ + eProsima_user_DllExport RegionOfInterest& operator=(RegionOfInterest&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::RegionOfInterest object to compare. + */ + eProsima_user_DllExport bool operator==(const RegionOfInterest& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::RegionOfInterest object to compare. + */ + eProsima_user_DllExport bool operator!=(const RegionOfInterest& x) const; + + /*! + * @brief This function sets a value in member x_offset + * @param _x_offset New value for member x_offset + */ + eProsima_user_DllExport void x_offset(uint32_t _x_offset); + + /*! + * @brief This function returns the value of member x_offset + * @return Value of member x_offset + */ + eProsima_user_DllExport uint32_t x_offset() const; + + /*! + * @brief This function returns a reference to member x_offset + * @return Reference to member x_offset + */ + eProsima_user_DllExport uint32_t& x_offset(); + + /*! + * @brief This function sets a value in member y_offset + * @param _y_offset New value for member y_offset + */ + eProsima_user_DllExport void y_offset(uint32_t _y_offset); + + /*! + * @brief This function returns the value of member y_offset + * @return Value of member y_offset + */ + eProsima_user_DllExport uint32_t y_offset() const; + + /*! + * @brief This function returns a reference to member y_offset + * @return Reference to member y_offset + */ + eProsima_user_DllExport uint32_t& y_offset(); + + /*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ + eProsima_user_DllExport void height(uint32_t _height); + + /*! + * @brief This function returns the value of member height + * @return Value of member height + */ + eProsima_user_DllExport uint32_t height() const; + + /*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ + eProsima_user_DllExport uint32_t& height(); + + /*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ + eProsima_user_DllExport void width(uint32_t _width); + + /*! + * @brief This function returns the value of member width + * @return Value of member width + */ + eProsima_user_DllExport uint32_t width() const; + + /*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ + eProsima_user_DllExport uint32_t& width(); + + /*! + * @brief This function sets a value in member do_rectify + * @param _do_rectify New value for member do_rectify + */ + eProsima_user_DllExport void do_rectify(bool _do_rectify); + + /*! + * @brief This function returns the value of member do_rectify + * @return Value of member do_rectify + */ + eProsima_user_DllExport bool do_rectify() const; + + /*! + * @brief This function returns a reference to member do_rectify + * @return Reference to member do_rectify + */ + eProsima_user_DllExport bool& do_rectify(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::RegionOfInterest& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + uint32_t m_x_offset; + uint32_t m_y_offset; + uint32_t m_height; + uint32_t m_width; + bool m_do_rectify; +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ diff --git a/LibCarla/source/carla/ros2/types/RegionOfInterestPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/RegionOfInterestPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.h new file mode 100644 index 00000000000..51dffdf9b7f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.h @@ -0,0 +1,122 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RegionOfInterestPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ + +#include +#include + +#include "RegionOfInterest.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated RegionOfInterest is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace sensor_msgs { +namespace msg { + +#ifndef SWIG +namespace detail { + +template +struct RegionOfInterest_rob { + friend constexpr typename Tag::type get(Tag) { + return M; + } +}; + +struct RegionOfInterest_f { + typedef bool RegionOfInterest::*type; + friend constexpr type get(RegionOfInterest_f); +}; + +template struct RegionOfInterest_rob; + +template +inline size_t constexpr RegionOfInterest_offset_of() { + return ((::size_t) & reinterpret_cast((((T*)0)->*get(Tag())))); +} +} // namespace detail +#endif + +/*! + * @brief This class represents the TopicDataType of the type RegionOfInterest defined by the user in the IDL file. + * @ingroup RegionOfInterest + */ +class RegionOfInterestPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef RegionOfInterest type; + + eProsima_user_DllExport RegionOfInterestPubSubType(); + + eProsima_user_DllExport virtual ~RegionOfInterestPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return is_plain_impl(); + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + new (memory) RegionOfInterest(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + static constexpr bool is_plain_impl() { + return 17ULL == (detail::RegionOfInterest_offset_of() + sizeof(bool)); + } +}; +} // namespace msg +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.cxx b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.cxx new file mode 100644 index 00000000000..a1e4f2dfeec --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.cxx @@ -0,0 +1,309 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitive.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "SolidPrimitive.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + + + + + + + + + + + + + + + + +shape_msgs::msg::SolidPrimitive::SolidPrimitive() +{ + // m_type com.eprosima.idl.parser.typecode.PrimitiveTypeCode@43b9fd5 + m_type = 0; + // m_dimensions com.eprosima.idl.parser.typecode.SequenceTypeCode@79dc5318 + + // m_polygon com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@8e50104 + + +} + +shape_msgs::msg::SolidPrimitive::~SolidPrimitive() +{ + + +} + +shape_msgs::msg::SolidPrimitive::SolidPrimitive( + const SolidPrimitive& x) +{ + m_type = x.m_type; + m_dimensions = x.m_dimensions; + m_polygon = x.m_polygon; +} + +shape_msgs::msg::SolidPrimitive::SolidPrimitive( + SolidPrimitive&& x) +{ + m_type = x.m_type; + m_dimensions = std::move(x.m_dimensions); + m_polygon = std::move(x.m_polygon); +} + +shape_msgs::msg::SolidPrimitive& shape_msgs::msg::SolidPrimitive::operator =( + const SolidPrimitive& x) +{ + + m_type = x.m_type; + m_dimensions = x.m_dimensions; + m_polygon = x.m_polygon; + + return *this; +} + +shape_msgs::msg::SolidPrimitive& shape_msgs::msg::SolidPrimitive::operator =( + SolidPrimitive&& x) +{ + + m_type = x.m_type; + m_dimensions = std::move(x.m_dimensions); + m_polygon = std::move(x.m_polygon); + + return *this; +} + +bool shape_msgs::msg::SolidPrimitive::operator ==( + const SolidPrimitive& x) const +{ + + return (m_type == x.m_type && m_dimensions == x.m_dimensions && m_polygon == x.m_polygon); +} + +bool shape_msgs::msg::SolidPrimitive::operator !=( + const SolidPrimitive& x) const +{ + return !(*this == x); +} + +size_t shape_msgs::msg::SolidPrimitive::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (3 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + current_alignment += geometry_msgs::msg::Polygon::getMaxCdrSerializedSize(current_alignment); + + return current_alignment - initial_alignment; +} + +size_t shape_msgs::msg::SolidPrimitive::getCdrSerializedSize( + const shape_msgs::msg::SolidPrimitive& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.dimensions().size() > 0) + { + current_alignment += (data.dimensions().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + current_alignment += geometry_msgs::msg::Polygon::getCdrSerializedSize(data.polygon(), current_alignment); + + return current_alignment - initial_alignment; +} + +void shape_msgs::msg::SolidPrimitive::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_type; + scdr << m_dimensions; + scdr << m_polygon; + +} + +void shape_msgs::msg::SolidPrimitive::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_type; + dcdr >> m_dimensions; + dcdr >> m_polygon; +} + +/*! + * @brief This function sets a value in member type + * @param _type New value for member type + */ +void shape_msgs::msg::SolidPrimitive::type( + uint8_t _type) +{ + m_type = _type; +} + +/*! + * @brief This function returns the value of member type + * @return Value of member type + */ +uint8_t shape_msgs::msg::SolidPrimitive::type() const +{ + return m_type; +} + +/*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ +uint8_t& shape_msgs::msg::SolidPrimitive::type() +{ + return m_type; +} + +/*! + * @brief This function copies the value in member dimensions + * @param _dimensions New value to be copied in member dimensions + */ +void shape_msgs::msg::SolidPrimitive::dimensions( + const std::vector& _dimensions) +{ + m_dimensions = _dimensions; +} + +/*! + * @brief This function moves the value in member dimensions + * @param _dimensions New value to be moved in member dimensions + */ +void shape_msgs::msg::SolidPrimitive::dimensions( + std::vector&& _dimensions) +{ + m_dimensions = std::move(_dimensions); +} + +/*! + * @brief This function returns a constant reference to member dimensions + * @return Constant reference to member dimensions + */ +const std::vector& shape_msgs::msg::SolidPrimitive::dimensions() const +{ + return m_dimensions; +} + +/*! + * @brief This function returns a reference to member dimensions + * @return Reference to member dimensions + */ +std::vector& shape_msgs::msg::SolidPrimitive::dimensions() +{ + return m_dimensions; +} +/*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ +void shape_msgs::msg::SolidPrimitive::polygon( + const geometry_msgs::msg::Polygon& _polygon) +{ + m_polygon = _polygon; +} + +/*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ +void shape_msgs::msg::SolidPrimitive::polygon( + geometry_msgs::msg::Polygon&& _polygon) +{ + m_polygon = std::move(_polygon); +} + +/*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ +const geometry_msgs::msg::Polygon& shape_msgs::msg::SolidPrimitive::polygon() const +{ + return m_polygon; +} + +/*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ +geometry_msgs::msg::Polygon& shape_msgs::msg::SolidPrimitive::polygon() +{ + return m_polygon; +} + +size_t shape_msgs::msg::SolidPrimitive::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool shape_msgs::msg::SolidPrimitive::isKeyDefined() +{ + return false; +} + +void shape_msgs::msg::SolidPrimitive::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.h b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.h new file mode 100644 index 00000000000..69d227167d0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.h @@ -0,0 +1,255 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitive.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_H_ +#define _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_H_ + +#include "geometry_msgs/msg/Polygon.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SolidPrimitive_SOURCE) +#define SolidPrimitive_DllAPI __declspec(dllexport) +#else +#define SolidPrimitive_DllAPI __declspec(dllimport) +#endif // SolidPrimitive_SOURCE +#else +#define SolidPrimitive_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SolidPrimitive_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace shape_msgs { +namespace msg { +namespace SolidPrimitive_Constants { +const uint8_t BOX = 1; +const uint8_t SPHERE = 2; +const uint8_t CYLINDER = 3; +const uint8_t CONE = 4; +const uint8_t PRISM = 5; +const uint8_t BOX_X = 0; +const uint8_t BOX_Y = 1; +const uint8_t BOX_Z = 2; +const uint8_t SPHERE_RADIUS = 0; +const uint8_t CYLINDER_HEIGHT = 0; +const uint8_t CYLINDER_RADIUS = 1; +const uint8_t CONE_HEIGHT = 0; +const uint8_t CONE_RADIUS = 1; +const uint8_t PRISM_HEIGHT = 0; +} // namespace SolidPrimitive_Constants +/*! + * @brief This class represents the structure SolidPrimitive defined by the user in the IDL file. + * @ingroup SOLIDPRIMITIVE + */ +class SolidPrimitive { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SolidPrimitive(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SolidPrimitive(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. + */ + eProsima_user_DllExport SolidPrimitive(const SolidPrimitive& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. + */ + eProsima_user_DllExport SolidPrimitive(SolidPrimitive&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. + */ + eProsima_user_DllExport SolidPrimitive& operator=(const SolidPrimitive& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. + */ + eProsima_user_DllExport SolidPrimitive& operator=(SolidPrimitive&& x); + + /*! + * @brief Comparison operator. + * @param x shape_msgs::msg::SolidPrimitive object to compare. + */ + eProsima_user_DllExport bool operator==(const SolidPrimitive& x) const; + + /*! + * @brief Comparison operator. + * @param x shape_msgs::msg::SolidPrimitive object to compare. + */ + eProsima_user_DllExport bool operator!=(const SolidPrimitive& x) const; + + /*! + * @brief This function sets a value in member type + * @param _type New value for member type + */ + eProsima_user_DllExport void type(uint8_t _type); + + /*! + * @brief This function returns the value of member type + * @return Value of member type + */ + eProsima_user_DllExport uint8_t type() const; + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport uint8_t& type(); + + /*! + * @brief This function copies the value in member dimensions + * @param _dimensions New value to be copied in member dimensions + */ + eProsima_user_DllExport void dimensions(const std::vector& _dimensions); + + /*! + * @brief This function moves the value in member dimensions + * @param _dimensions New value to be moved in member dimensions + */ + eProsima_user_DllExport void dimensions(std::vector&& _dimensions); + + /*! + * @brief This function returns a constant reference to member dimensions + * @return Constant reference to member dimensions + */ + eProsima_user_DllExport const std::vector& dimensions() const; + + /*! + * @brief This function returns a reference to member dimensions + * @return Reference to member dimensions + */ + eProsima_user_DllExport std::vector& dimensions(); + /*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ + eProsima_user_DllExport void polygon(const geometry_msgs::msg::Polygon& _polygon); + + /*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ + eProsima_user_DllExport void polygon(geometry_msgs::msg::Polygon&& _polygon); + + /*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ + eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; + + /*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ + eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const shape_msgs::msg::SolidPrimitive& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + uint8_t m_type; + std::vector m_dimensions; + geometry_msgs::msg::Polygon m_polygon; +}; +} // namespace msg +} // namespace shape_msgs + +#endif // _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.cxx new file mode 100644 index 00000000000..d2903a0ff85 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.cxx @@ -0,0 +1,193 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitivePubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "SolidPrimitivePubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace shape_msgs { + namespace msg { + namespace SolidPrimitive_Constants { + + + + + + + + + + + + + + + + } //End of namespace SolidPrimitive_Constants + SolidPrimitivePubSubType::SolidPrimitivePubSubType() + { + setName("shape_msgs::msg::dds_::SolidPrimitive_"); + auto type_size = SolidPrimitive::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = SolidPrimitive::isKeyDefined(); + size_t keyLength = SolidPrimitive::getKeyMaxCdrSerializedSize() > 16 ? + SolidPrimitive::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + SolidPrimitivePubSubType::~SolidPrimitivePubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool SolidPrimitivePubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + SolidPrimitive* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool SolidPrimitivePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + SolidPrimitive* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function SolidPrimitivePubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* SolidPrimitivePubSubType::createData() + { + return reinterpret_cast(new SolidPrimitive()); + } + + void SolidPrimitivePubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool SolidPrimitivePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + SolidPrimitive* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + SolidPrimitive::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || SolidPrimitive::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace shape_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.h new file mode 100644 index 00000000000..3db282002a6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.h @@ -0,0 +1,92 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitivePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_PUBSUBTYPES_H_ + +#include +#include + +#include "SolidPrimitive.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated SolidPrimitive is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace shape_msgs { +namespace msg { +namespace SolidPrimitive_Constants {} +/*! + * @brief This class represents the TopicDataType of the type SolidPrimitive defined by the user in the IDL file. + * @ingroup SOLIDPRIMITIVE + */ +class SolidPrimitivePubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef SolidPrimitive type; + + eProsima_user_DllExport SolidPrimitivePubSubType(); + + eProsima_user_DllExport virtual ~SolidPrimitivePubSubType(); + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace shape_msgs + +#endif // _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.cxx new file mode 100644 index 00000000000..e179cf51609 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.cxx @@ -0,0 +1,183 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Bool.cpp + * This source file contains the definition of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Bool.h" +#include + +#include +using namespace eprosima::fastcdr::exception; + +#include + +std_msgs::msg::Bool::Bool() +{ + // m_data com.eprosima.idl.parser.typecode.PrimitiveTypeCode@69a10787 + m_data = false; + +} + +std_msgs::msg::Bool::~Bool() +{ +} + +std_msgs::msg::Bool::Bool( + const Bool& x) +{ + m_data = x.m_data; +} + +std_msgs::msg::Bool::Bool( + Bool&& x) +{ + m_data = x.m_data; +} + +std_msgs::msg::Bool& std_msgs::msg::Bool::operator =( + const Bool& x) +{ + + m_data = x.m_data; + + return *this; +} + +std_msgs::msg::Bool& std_msgs::msg::Bool::operator =( + Bool&& x) +{ + + m_data = x.m_data; + + return *this; +} + +bool std_msgs::msg::Bool::operator ==( + const Bool& x) const +{ + + return (m_data == x.m_data); +} + +bool std_msgs::msg::Bool::operator !=( + const Bool& x) const +{ + return !(*this == x); +} + +size_t std_msgs::msg::Bool::getMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +size_t std_msgs::msg::Bool::getCdrSerializedSize( + const std_msgs::msg::Bool& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + +void std_msgs::msg::Bool::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + + scdr << m_data; + +} + +void std_msgs::msg::Bool::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_data; +} + +/*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ +void std_msgs::msg::Bool::data( + bool _data) +{ + m_data = _data; +} + +/*! + * @brief This function returns the value of member data + * @return Value of member data + */ +bool std_msgs::msg::Bool::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +bool& std_msgs::msg::Bool::data() +{ + return m_data; +} + + +size_t std_msgs::msg::Bool::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + size_t current_align = current_alignment; + + + + return current_align; +} + +bool std_msgs::msg::Bool::isKeyDefined() +{ + return false; +} + +void std_msgs::msg::Bool::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + +} + + diff --git a/LibCarla/source/carla/ros2/types/Float32.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.h similarity index 69% rename from LibCarla/source/carla/ros2/types/Float32.h rename to LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.h index e857e2c10a3..21c453b0fd0 100644 --- a/LibCarla/source/carla/ros2/types/Float32.h +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.h @@ -13,16 +13,15 @@ // limitations under the License. /*! - * @file Float32.h + * @file Bool.h * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_H_ -#include #include #include @@ -43,16 +42,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Float32_SOURCE) -#define Float32_DllAPI __declspec( dllexport ) +#if defined(Bool_SOURCE) +#define Bool_DllAPI __declspec( dllexport ) #else -#define Float32_DllAPI __declspec( dllimport ) -#endif // Float32_SOURCE +#define Bool_DllAPI __declspec( dllimport ) +#endif // Bool_SOURCE #else -#define Float32_DllAPI +#define Bool_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Float32_DllAPI +#define Bool_DllAPI #endif // _WIN32 namespace eprosima { @@ -61,92 +60,95 @@ class Cdr; } // namespace fastcdr } // namespace eprosima + namespace std_msgs { namespace msg { /*! - * @brief This class represents the structure Float32 defined by the user in the IDL file. - * @ingroup FLOAT32 + * @brief This class represents the structure Bool defined by the user in the IDL file. + * @ingroup BOOL */ - class Float32 + class Bool { public: + /*! * @brief Default constructor. */ - eProsima_user_DllExport Float32(); + eProsima_user_DllExport Bool(); /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Float32(); + eProsima_user_DllExport ~Bool(); /*! * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + * @param x Reference to the object std_msgs::msg::Bool that will be copied. */ - eProsima_user_DllExport Float32( - const Float32& x); + eProsima_user_DllExport Bool( + const Bool& x); /*! * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + * @param x Reference to the object std_msgs::msg::Bool that will be copied. */ - eProsima_user_DllExport Float32( - Float32&& x) noexcept; + eProsima_user_DllExport Bool( + Bool&& x); /*! * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + * @param x Reference to the object std_msgs::msg::Bool that will be copied. */ - eProsima_user_DllExport Float32& operator =( - const Float32& x); + eProsima_user_DllExport Bool& operator =( + const Bool& x); /*! * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + * @param x Reference to the object std_msgs::msg::Bool that will be copied. */ - eProsima_user_DllExport Float32& operator =( - Float32&& x) noexcept; + eProsima_user_DllExport Bool& operator =( + Bool&& x); /*! * @brief Comparison operator. - * @param x std_msgs::msg::Float32 object to compare. + * @param x std_msgs::msg::Bool object to compare. */ eProsima_user_DllExport bool operator ==( - const Float32& x) const; + const Bool& x) const; /*! * @brief Comparison operator. - * @param x std_msgs::msg::Float32 object to compare. + * @param x std_msgs::msg::Bool object to compare. */ eProsima_user_DllExport bool operator !=( - const Float32& x) const; + const Bool& x) const; /*! * @brief This function sets a value in member data * @param _data New value for member data */ eProsima_user_DllExport void data( - float _data); + bool _data); /*! * @brief This function returns the value of member data * @return Value of member data */ - eProsima_user_DllExport float data() const; + eProsima_user_DllExport bool data() const; /*! * @brief This function returns a reference to member data * @return Reference to member data */ - eProsima_user_DllExport float& data(); + eProsima_user_DllExport bool& data(); + /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -157,9 +159,10 @@ namespace std_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const std_msgs::msg::Float32& data, + const std_msgs::msg::Bool& data, size_t current_alignment = 0); + /*! * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. @@ -174,6 +177,8 @@ namespace std_msgs { eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr); + + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. @@ -196,9 +201,10 @@ namespace std_msgs { eprosima::fastcdr::Cdr& cdr) const; private: - float m_data; + + bool m_data; }; } // namespace msg } // namespace std_msgs -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.cxx new file mode 100644 index 00000000000..4bc16493adc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.cxx @@ -0,0 +1,176 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BoolPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#include +#include + +#include "BoolPubSubTypes.h" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; + +namespace std_msgs { + namespace msg { + BoolPubSubType::BoolPubSubType() + { + setName("std_msgs::msg::dds_::Bool_"); + auto type_size = Bool::getMaxCdrSerializedSize(); + type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ + m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ + m_isGetKeyDefined = Bool::isKeyDefined(); + size_t keyLength = Bool::getKeyMaxCdrSerializedSize() > 16 ? + Bool::getKeyMaxCdrSerializedSize() : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + BoolPubSubType::~BoolPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool BoolPubSubType::serialize( + void* data, + SerializedPayload_t* payload) + { + Bool* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Serialize encapsulation + ser.serialize_encapsulation(); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + // Get the serialized length + payload->length = static_cast(ser.getSerializedDataLength()); + return true; + } + + bool BoolPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + //Convert DATA to pointer of your type + Bool* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + + return true; + } + + std::function BoolPubSubType::getSerializedSizeProvider( + void* data) + { + return [data]() -> uint32_t + { + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + }; + } + + void* BoolPubSubType::createData() + { + return reinterpret_cast(new Bool()); + } + + void BoolPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool BoolPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Bool* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + Bool::getKeyMaxCdrSerializedSize()); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + p_type->serializeKey(ser); + if (force_md5 || Bool::getKeyMaxCdrSerializedSize() > 16) + { + m_md5.init(); + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + m_md5.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_md5.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = m_keyBuffer[i]; + } + } + return true; + } + + + } //End of namespace msg + +} //End of namespace std_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.h new file mode 100644 index 00000000000..78a1771e781 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.h @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BoolPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_PUBSUBTYPES_H_ + +#include +#include + +#include "Bool.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error \ + Generated Bool is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace std_msgs +{ + namespace msg + { + /*! + * @brief This class represents the TopicDataType of the type Bool defined by the user in the IDL file. + * @ingroup BOOL + */ + class BoolPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Bool type; + + eProsima_user_DllExport BoolPubSubType(); + + eProsima_user_DllExport virtual ~BoolPubSubType(); + + eProsima_user_DllExport virtual bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider( + void* data) override; + + eProsima_user_DllExport virtual bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData( + void* data) override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) Bool(); + return true; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + }; + } +} + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Float32.cpp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/Float32.cpp rename to LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.h new file mode 100644 index 00000000000..6ce054fac44 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.h @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Float32.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Float32_SOURCE) +#define Float32_DllAPI __declspec(dllexport) +#else +#define Float32_DllAPI __declspec(dllimport) +#endif // Float32_SOURCE +#else +#define Float32_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Float32_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace std_msgs { +namespace msg { +/*! + * @brief This class represents the structure Float32 defined by the user in the IDL file. + * @ingroup FLOAT32 + */ +class Float32 { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Float32(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Float32(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + */ + eProsima_user_DllExport Float32(const Float32& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + */ + eProsima_user_DllExport Float32(Float32&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + */ + eProsima_user_DllExport Float32& operator=(const Float32& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + */ + eProsima_user_DllExport Float32& operator=(Float32&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::Float32 object to compare. + */ + eProsima_user_DllExport bool operator==(const Float32& x) const; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::Float32 object to compare. + */ + eProsima_user_DllExport bool operator!=(const Float32& x) const; + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data(float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const std_msgs::msg::Float32& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + float m_data; +}; +} // namespace msg +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ diff --git a/LibCarla/source/carla/ros2/types/Float32PubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/Float32PubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.h new file mode 100644 index 00000000000..f99d6d14933 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.h @@ -0,0 +1,118 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Float32PubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ + +#include +#include + +#include "Float32.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Float32 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace std_msgs { +namespace msg { +#ifndef SWIG +namespace detail { +template +struct Float32_rob { + friend constexpr typename Tag::type get(Tag) { + return M; + } +}; + +struct Float32_f { + typedef float Float32::*type; + friend constexpr type get(Float32_f); +}; + +template struct Float32_rob; + +template +inline size_t constexpr Float32_offset_of() { + return ((::size_t) & reinterpret_cast((((T*)0)->*get(Tag())))); +} +} // namespace detail +#endif + +/*! + * @brief This class represents the TopicDataType of the type Float32 defined by the user in the IDL file. + * @ingroup FLOAT32 + */ +class Float32PubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef Float32 type; + + eProsima_user_DllExport Float32PubSubType(); + + eProsima_user_DllExport virtual ~Float32PubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return is_plain_impl(); + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + new (memory) Float32(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + static constexpr bool is_plain_impl() { + return 4ULL == (detail::Float32_offset_of() + sizeof(float)); + } +}; +} // namespace msg +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/Header.cpp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.cxx similarity index 87% rename from LibCarla/source/carla/ros2/types/Header.cpp rename to LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.cxx index 04d098fe866..9311644b3f5 100644 --- a/LibCarla/source/carla/ros2/types/Header.cpp +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.cxx @@ -26,7 +26,7 @@ char dummy; } // namespace #endif // _WIN32 -#include "Header.h" +#include "std_msgs/msg/Header.h" #include #include @@ -34,18 +34,18 @@ using namespace eprosima::fastcdr::exception; #include -#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - std_msgs::msg::Header::Header() { + // m_stamp com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@58e1d9d + + // m_frame_id com.eprosima.idl.parser.typecode.StringTypeCode@446a1e84 m_frame_id =""; + } std_msgs::msg::Header::~Header() { + } std_msgs::msg::Header::Header( @@ -56,7 +56,7 @@ std_msgs::msg::Header::Header( } std_msgs::msg::Header::Header( - Header&& x) noexcept + Header&& x) { m_stamp = std::move(x.m_stamp); m_frame_id = std::move(x.m_frame_id); @@ -65,6 +65,7 @@ std_msgs::msg::Header::Header( std_msgs::msg::Header& std_msgs::msg::Header::operator =( const Header& x) { + m_stamp = x.m_stamp; m_frame_id = x.m_frame_id; @@ -72,8 +73,9 @@ std_msgs::msg::Header& std_msgs::msg::Header::operator =( } std_msgs::msg::Header& std_msgs::msg::Header::operator =( - Header&& x) noexcept + Header&& x) { + m_stamp = std::move(x.m_stamp); m_frame_id = std::move(x.m_frame_id); @@ -83,6 +85,7 @@ std_msgs::msg::Header& std_msgs::msg::Header::operator =( bool std_msgs::msg::Header::operator ==( const Header& x) const { + return (m_stamp == x.m_stamp && m_frame_id == x.m_frame_id); } @@ -95,31 +98,44 @@ bool std_msgs::msg::Header::operator !=( size_t std_msgs::msg::Header::getMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return std_msgs_msg_Header_max_cdr_typesize; + size_t initial_alignment = current_alignment; + + + current_alignment += builtin_interfaces::msg::Time::getMaxCdrSerializedSize(current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + + return current_alignment - initial_alignment; } size_t std_msgs::msg::Header::getCdrSerializedSize( const std_msgs::msg::Header& data, size_t current_alignment) { + (void)data; size_t initial_alignment = current_alignment; + + current_alignment += builtin_interfaces::msg::Time::getCdrSerializedSize(data.stamp(), current_alignment); current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; + return current_alignment - initial_alignment; } void std_msgs::msg::Header::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_stamp; - scdr << m_frame_id.c_str(); + scdr << m_frame_id; + } void std_msgs::msg::Header::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_stamp; dcdr >> m_frame_id; } @@ -199,12 +215,14 @@ std::string& std_msgs::msg::Header::frame_id() return m_frame_id; } - size_t std_msgs::msg::Header::getKeyMaxCdrSerializedSize( size_t current_alignment) { - static_cast(current_alignment); - return std_msgs_msg_Header_max_key_cdr_typesize; + size_t current_align = current_alignment; + + + + return current_align; } bool std_msgs::msg::Header::isKeyDefined() @@ -216,4 +234,7 @@ void std_msgs::msg::Header::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; + } + + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.h new file mode 100644 index 00000000000..15c0b45c5af --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.h @@ -0,0 +1,220 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Header.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ + +#include "builtin_interfaces/msg/Time.h" + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(Header_SOURCE) +#define Header_DllAPI __declspec(dllexport) +#else +#define Header_DllAPI __declspec(dllimport) +#endif // Header_SOURCE +#else +#define Header_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define Header_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace std_msgs { +namespace msg { +/*! + * @brief This class represents the structure Header defined by the user in the IDL file. + * @ingroup HEADER + */ +class Header { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Header(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Header(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object std_msgs::msg::Header that will be copied. + */ + eProsima_user_DllExport Header(const Header& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object std_msgs::msg::Header that will be copied. + */ + eProsima_user_DllExport Header(Header&& x); + + /*! + * @brief Copy assignment. + * @param x Reference to the object std_msgs::msg::Header that will be copied. + */ + eProsima_user_DllExport Header& operator=(const Header& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object std_msgs::msg::Header that will be copied. + */ + eProsima_user_DllExport Header& operator=(Header&& x); + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::Header object to compare. + */ + eProsima_user_DllExport bool operator==(const Header& x) const; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::Header object to compare. + */ + eProsima_user_DllExport bool operator!=(const Header& x) const; + + /*! + * @brief This function copies the value in member stamp + * @param _stamp New value to be copied in member stamp + */ + eProsima_user_DllExport void stamp(const builtin_interfaces::msg::Time& _stamp); + + /*! + * @brief This function moves the value in member stamp + * @param _stamp New value to be moved in member stamp + */ + eProsima_user_DllExport void stamp(builtin_interfaces::msg::Time&& _stamp); + + /*! + * @brief This function returns a constant reference to member stamp + * @return Constant reference to member stamp + */ + eProsima_user_DllExport const builtin_interfaces::msg::Time& stamp() const; + + /*! + * @brief This function returns a reference to member stamp + * @return Reference to member stamp + */ + eProsima_user_DllExport builtin_interfaces::msg::Time& stamp(); + /*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ + eProsima_user_DllExport void frame_id(const std::string& _frame_id); + + /*! + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ + eProsima_user_DllExport void frame_id(std::string&& _frame_id); + + /*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ + eProsima_user_DllExport const std::string& frame_id() const; + + /*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ + eProsima_user_DllExport std::string& frame_id(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const std_msgs::msg::Header& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + builtin_interfaces::msg::Time m_stamp; + std::string m_frame_id; +}; +} // namespace msg +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/HeaderPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.cxx similarity index 90% rename from LibCarla/source/carla/ros2/types/HeaderPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.cxx index e61f4ee873c..119a111258f 100644 --- a/LibCarla/source/carla/ros2/types/HeaderPubSubTypes.cpp +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.cxx @@ -19,10 +19,11 @@ * This file was generated by the tool fastcdrgen. */ + #include #include -#include "HeaderPubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; @@ -63,7 +64,17 @@ namespace std_msgs { payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Serialize encapsulation ser.serialize_encapsulation(); - p_type->serialize(ser); + + try + { + // Serialize the object. + p_type->serialize(ser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + // Get the serialized length payload->length = static_cast(ser.getSerializedDataLength()); return true; @@ -86,8 +97,16 @@ namespace std_msgs { deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Deserialize the object. - p_type->deserialize(deser); + try + { + // Deserialize the object. + p_type->deserialize(deser); + } + catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + { + return false; + } + return true; } @@ -150,5 +169,8 @@ namespace std_msgs { } return true; } + + } //End of namespace msg + } //End of namespace std_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.h new file mode 100644 index 00000000000..5a1aeecb15b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.h @@ -0,0 +1,91 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ + +#include +#include + +#include "std_msgs/msg/Header.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated Header is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace std_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type Header defined by the user in the IDL file. + * @ingroup HEADER + */ +class HeaderPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef Header type; + + eProsima_user_DllExport HeaderPubSubType(); + + eProsima_user_DllExport virtual ~HeaderPubSubType(); + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/String.cpp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/String.cpp rename to LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.h new file mode 100644 index 00000000000..b50251f6a8e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.h @@ -0,0 +1,196 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file String.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(String_SOURCE) +#define String_DllAPI __declspec(dllexport) +#else +#define String_DllAPI __declspec(dllimport) +#endif // String_SOURCE +#else +#define String_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define String_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace std_msgs { +namespace msg { +/*! + * @brief This class represents the structure String defined by the user in the IDL file. + * @ingroup STRING + */ +class String { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport String(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~String(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object std_msgs::msg::String that will be copied. + */ + eProsima_user_DllExport String(const String& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object std_msgs::msg::String that will be copied. + */ + eProsima_user_DllExport String(String&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object std_msgs::msg::String that will be copied. + */ + eProsima_user_DllExport String& operator=(const String& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object std_msgs::msg::String that will be copied. + */ + eProsima_user_DllExport String& operator=(String&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::String object to compare. + */ + eProsima_user_DllExport bool operator==(const String& x) const; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::String object to compare. + */ + eProsima_user_DllExport bool operator!=(const String& x) const; + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data(const std::string& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data(std::string&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::string& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::string& data(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const std_msgs::msg::String& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std::string m_data; +}; +} // namespace msg +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ diff --git a/LibCarla/source/carla/ros2/types/StringPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/StringPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.h new file mode 100644 index 00000000000..40561ef040f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.h @@ -0,0 +1,91 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StringPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ + +#include +#include + +#include "String.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated String is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace std_msgs { +namespace msg { + +/*! + * @brief This class represents the TopicDataType of the type String defined by the user in the IDL file. + * @ingroup STRING + */ +class StringPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef String type; + + eProsima_user_DllExport StringPubSubType(); + + eProsima_user_DllExport virtual ~StringPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/TF2Error.cpp b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/TF2Error.cpp rename to LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.h b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.h new file mode 100644 index 00000000000..ca688329403 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.h @@ -0,0 +1,222 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TF2Error.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ +#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TF2Error_SOURCE) +#define TF2Error_DllAPI __declspec(dllexport) +#else +#define TF2Error_DllAPI __declspec(dllimport) +#endif // TF2Error_SOURCE +#else +#define TF2Error_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TF2Error_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace tf2_msgs { +namespace msg { +const uint8_t TF2Error__NO_ERROR = 0; +const uint8_t TF2Error__LOOKUP_ERROR = 1; +const uint8_t TF2Error__CONNECTIVITY_ERROR = 2; +const uint8_t TF2Error__EXTRAPOLATION_ERROR = 3; +const uint8_t TF2Error__INVALID_ARGUMENT_ERROR = 4; +const uint8_t TF2Error__TIMEOUT_ERROR = 5; +const uint8_t TF2Error__TRANSFORM_ERROR = 6; +/*! + * @brief This class represents the structure TF2Error defined by the user in the IDL file. + * @ingroup TF2ERROR + */ +class TF2Error { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TF2Error(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TF2Error(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. + */ + eProsima_user_DllExport TF2Error(const TF2Error& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. + */ + eProsima_user_DllExport TF2Error(TF2Error&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. + */ + eProsima_user_DllExport TF2Error& operator=(const TF2Error& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. + */ + eProsima_user_DllExport TF2Error& operator=(TF2Error&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x tf2_msgs::msg::TF2Error object to compare. + */ + eProsima_user_DllExport bool operator==(const TF2Error& x) const; + + /*! + * @brief Comparison operator. + * @param x tf2_msgs::msg::TF2Error object to compare. + */ + eProsima_user_DllExport bool operator!=(const TF2Error& x) const; + + /*! + * @brief This function sets a value in member error + * @param _error New value for member error + */ + eProsima_user_DllExport void error(uint8_t _error); + + /*! + * @brief This function returns the value of member error + * @return Value of member error + */ + eProsima_user_DllExport uint8_t error() const; + + /*! + * @brief This function returns a reference to member error + * @return Reference to member error + */ + eProsima_user_DllExport uint8_t& error(); + + /*! + * @brief This function copies the value in member error_string + * @param _error_string New value to be copied in member error_string + */ + eProsima_user_DllExport void error_string(const std::string& _error_string); + + /*! + * @brief This function moves the value in member error_string + * @param _error_string New value to be moved in member error_string + */ + eProsima_user_DllExport void error_string(std::string&& _error_string); + + /*! + * @brief This function returns a constant reference to member error_string + * @return Constant reference to member error_string + */ + eProsima_user_DllExport const std::string& error_string() const; + + /*! + * @brief This function returns a reference to member error_string + * @return Reference to member error_string + */ + eProsima_user_DllExport std::string& error_string(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const tf2_msgs::msg::TF2Error& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + uint8_t m_error; + std::string m_error_string; +}; +} // namespace msg +} // namespace tf2_msgs + +#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ diff --git a/LibCarla/source/carla/ros2/types/TF2ErrorPubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/TF2ErrorPubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.h new file mode 100644 index 00000000000..c63c7bd3fc9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.h @@ -0,0 +1,90 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TF2ErrorPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ + +#include +#include + +#include "TF2Error.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated TF2Error is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace tf2_msgs { +namespace msg { +/*! + * @brief This class represents the TopicDataType of the type TF2Error defined by the user in the IDL file. + * @ingroup TF2ERROR + */ +class TF2ErrorPubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef TF2Error type; + + eProsima_user_DllExport TF2ErrorPubSubType(); + + eProsima_user_DllExport virtual ~TF2ErrorPubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace tf2_msgs + +#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/TFMessage.cpp b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/TFMessage.cpp rename to LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.h b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.h new file mode 100644 index 00000000000..f10efd2114e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.h @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TFMessage.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool gen. + */ + +#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ +#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ + +#include "geometry_msgs/msg/TransformStamped.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec(dllexport) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TFMessage_SOURCE) +#define TFMessage_DllAPI __declspec(dllexport) +#else +#define TFMessage_DllAPI __declspec(dllimport) +#endif // TFMessage_SOURCE +#else +#define TFMessage_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TFMessage_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + +namespace tf2_msgs { +namespace msg { +/*! + * @brief This class represents the structure TFMessage defined by the user in the IDL file. + * @ingroup TFMESSAGE + */ +class TFMessage { +public: + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TFMessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TFMessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + */ + eProsima_user_DllExport TFMessage(const TFMessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + */ + eProsima_user_DllExport TFMessage(TFMessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + */ + eProsima_user_DllExport TFMessage& operator=(const TFMessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + */ + eProsima_user_DllExport TFMessage& operator=(TFMessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x tf2_msgs::msg::TFMessage object to compare. + */ + eProsima_user_DllExport bool operator==(const TFMessage& x) const; + + /*! + * @brief Comparison operator. + * @param x tf2_msgs::msg::TFMessage object to compare. + */ + eProsima_user_DllExport bool operator!=(const TFMessage& x) const; + + /*! + * @brief This function copies the value in member transforms + * @param _transforms New value to be copied in member transforms + */ + eProsima_user_DllExport void transforms(const std::vector& _transforms); + + /*! + * @brief This function moves the value in member transforms + * @param _transforms New value to be moved in member transforms + */ + eProsima_user_DllExport void transforms(std::vector&& _transforms); + + /*! + * @brief This function returns a constant reference to member transforms + * @return Constant reference to member transforms + */ + eProsima_user_DllExport const std::vector& transforms() const; + + /*! + * @brief This function returns a reference to member transforms + * @return Reference to member transforms + */ + eProsima_user_DllExport std::vector& transforms(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize(const tf2_msgs::msg::TFMessage& data, + size_t current_alignment = 0); + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); + + /*! + * @brief This function returns the maximum serialized size of the Key of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + +private: + std::vector m_transforms; +}; +} // namespace msg +} // namespace tf2_msgs + +#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ diff --git a/LibCarla/source/carla/ros2/types/TFMessagePubSubTypes.cpp b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.cxx similarity index 100% rename from LibCarla/source/carla/ros2/types/TFMessagePubSubTypes.cpp rename to LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.cxx diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.h new file mode 100644 index 00000000000..8d1749ce5df --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.h @@ -0,0 +1,93 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TFMessagePubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastcdrgen. + */ + +#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ + +#include +#include + +#include "TFMessage.h" + +#include "geometry_msgs/msg/TransformStampedPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#error Generated TFMessage is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace tf2_msgs { +namespace msg { + +/*! + * @brief This class represents the TopicDataType of the type TFMessage defined by the user in the IDL file. + * @ingroup TFMESSAGE + */ +class TFMessagePubSubType : public eprosima::fastdds::dds::TopicDataType { +public: + typedef TFMessage type; + + eProsima_user_DllExport TFMessagePubSubType(); + + eProsima_user_DllExport virtual ~TFMessagePubSubType() override; + + eProsima_user_DllExport virtual bool serialize(void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + + eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + + eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport virtual void* createData() override; + + eProsima_user_DllExport virtual void deleteData(void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample(void* memory) const override { + (void)memory; + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + MD5 m_md5; + unsigned char* m_keyBuffer; +}; +} // namespace msg +} // namespace tf2_msgs + +#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/publishers/BasePublisher.h b/LibCarla/source/carla/ros2/publishers/BasePublisher.h deleted file mode 100644 index 0e1462d61b5..00000000000 --- a/LibCarla/source/carla/ros2/publishers/BasePublisher.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -namespace carla { -namespace ros2 { - - class BasePublisher { - public: - - BasePublisher() {} - - BasePublisher(std::string base_topic_name) : - _base_topic_name(base_topic_name) {} - - BasePublisher(std::string base_topic_name, std::string frame_id) : - _base_topic_name(base_topic_name), - _frame_id(frame_id) {} - - BasePublisher(void* actor, std::string base_topic_name, std::string frame_id) : - _actor(actor), - _base_topic_name(base_topic_name), - _frame_id(frame_id) {} - - const std::string GetBaseTopicName() {return _base_topic_name; } - const std::string GetFrameId() { return _frame_id; } - - virtual bool Publish() = 0; - - void* GetActor() { return _actor; } - - protected: - std::string _frame_id = ""; - std::string _base_topic_name = ""; - - void* _actor { nullptr }; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp new file mode 100644 index 00000000000..d1a9a5a761f --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp @@ -0,0 +1,35 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "CarlaActorListPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +CarlaActorListPublisher::CarlaActorListPublisher(std::string const &role_name) + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName(role_name)), + _impl(std::make_shared()) {} + +bool CarlaActorListPublisher::Init(std::shared_ptr domain_participant) { + auto topic_qos = get_topic_qos(); + topic_qos.transient_local(); + return _impl->Init(domain_participant, get_topic_name(), topic_qos); +} + +bool CarlaActorListPublisher::Publish() { + return _impl->Publish(); +} + +bool CarlaActorListPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void CarlaActorListPublisher::UpdateCarlaActorList(const carla_msgs::msg::CarlaActorList& status) { + _impl->Message() = status; + _impl->SetMessageUpdated(); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.h new file mode 100644 index 00000000000..1309e70ee83 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.h @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBase.h" +#include "carla_msgs/msg/CarlaActorListPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using CarlaActorListPublisherImpl = + DdsPublisherImpl; + +class CarlaActorListPublisher : public PublisherBase { +public: + CarlaActorListPublisher(std::string const &role_name); + virtual ~CarlaActorListPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateCarlaActorList(const carla_msgs::msg::CarlaActorList& actor_list); + +private: + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaCameraPublisher.cpp deleted file mode 100644 index d11bbe7471c..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaCameraPublisher.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaCameraPublisher.h" - -namespace carla { -namespace ros2 { - -std::vector CarlaCameraPublisher::ComputeImage(uint32_t height, uint32_t width, const uint8_t *data) { - const size_t size = height * width * this->GetChannels() * sizeof(uint8_t); - std::vector vector_data(data, data + size); - return vector_data; -} - -bool CarlaCameraPublisher::WriteCameraInfo(int32_t seconds, uint32_t nanoseconds, uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify) { - - _impl_camera_info->GetMessage()->header().stamp().sec(seconds); - _impl_camera_info->GetMessage()->header().stamp().nanosec(nanoseconds); - _impl_camera_info->GetMessage()->header().frame_id(GetFrameId()); - - const double cx = static_cast(width) / 2.0; - const double cy = static_cast(height) / 2.0; - const double fx = static_cast(width) / (2.0 * std::tan(fov) * M_PI / 360.0); - const double fy = fx; - - _impl_camera_info->GetMessage()->height(height); - _impl_camera_info->GetMessage()->width(width); - _impl_camera_info->GetMessage()->distortion_model("plumb_bob"); - _impl_camera_info->GetMessage()->D({ 0.0, 0.0, 0.0, 0.0, 0.0 }); - _impl_camera_info->GetMessage()->k({fx, 0.0, cx, 0.0, fy, cy, 0.0, 0.0, 1.0}); - _impl_camera_info->GetMessage()->r({ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 }); - _impl_camera_info->GetMessage()->p({fx, 0.0, cx, 0.0, 0.0, fy, cy, 0.0, 0.0, 0.0, 1.0, 0.0}); - _impl_camera_info->GetMessage()->binning_x(0); - _impl_camera_info->GetMessage()->binning_y(0); - - _impl_camera_info->GetMessage()->roi().x_offset(x_offset); - _impl_camera_info->GetMessage()->roi().y_offset(y_offset); - _impl_camera_info->GetMessage()->roi().height(height); - _impl_camera_info->GetMessage()->roi().width(width); - _impl_camera_info->GetMessage()->roi().do_rectify(do_rectify); - - return true; -} - -bool CarlaCameraPublisher::WriteImage(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, std::vector data) { - _impl_image->GetMessage()->header().stamp().sec(seconds); - _impl_image->GetMessage()->header().stamp().nanosec(nanoseconds); - _impl_image->GetMessage()->header().frame_id(this->GetFrameId()); - - _impl_image->GetMessage()->width(width); - _impl_image->GetMessage()->height(height); - _impl_image->GetMessage()->encoding(this->GetEncoding()); - _impl_image->GetMessage()->is_bigendian(0); - _impl_image->GetMessage()->step(width * this->GetChannels() * sizeof(uint8_t)); - - _impl_image->GetMessage()->data(std::move(data)); // https://github.com/eProsima/Fast-DDS/issues/2330 - - return true; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaCameraPublisher.h deleted file mode 100644 index 523b152a5c7..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaCameraPublisher.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include -#include - -#include "carla/ros2/publishers/BasePublisher.h" -#include "carla/ros2/publishers/PublisherImpl.h" - -#include "carla/ros2/types/Image.h" -#include "carla/ros2/types/ImagePubSubTypes.h" -#include "carla/ros2/types/CameraInfo.h" -#include "carla/ros2/types/CameraInfoPubSubTypes.h" - -namespace carla { -namespace ros2 { - - class CarlaCameraPublisher : public BasePublisher { - public: - struct ImageMsgTraits { - using msg_type = sensor_msgs::msg::Image; - using msg_pubsub_type = sensor_msgs::msg::ImagePubSubType; - }; - - struct CameraInfoMsgTraits { - using msg_type = sensor_msgs::msg::CameraInfo; - using msg_pubsub_type = sensor_msgs::msg::CameraInfoPubSubType; - }; - - CarlaCameraPublisher(std::string base_topic_name, std::string frame_id) : - BasePublisher(base_topic_name, frame_id), - _impl_image(std::make_shared>()), - _impl_camera_info(std::make_shared>()) { - _impl_image->Init(GetBaseTopicName() + "/image"); - _impl_camera_info->Init(GetBaseTopicName() + "/camera_info"); - } - - virtual uint8_t GetChannels() = 0; - - bool Publish() { - return _impl_camera_info->Publish() && _impl_image->Publish(); - } - - bool WriteCameraInfo(int32_t seconds, uint32_t nanoseconds, uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify); - bool WriteImage(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, const uint8_t* data) { - return WriteImage(seconds, nanoseconds, height, width, ComputeImage(height, width, data)); - } - bool WriteImage(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, std::vector data); - - private: - virtual std::string GetEncoding() = 0; - - virtual std::vector ComputeImage(uint32_t height, uint32_t width, const uint8_t* data); - - private: - std::shared_ptr> _impl_image; - std::shared_ptr> _impl_camera_info; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaClockPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaClockPublisher.cpp deleted file mode 100644 index 2f287c25776..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaClockPublisher.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaClockPublisher.h" - -namespace carla { -namespace ros2 { - -bool CarlaClockPublisher::Write(int32_t seconds, uint32_t nanoseconds) { - _impl->GetMessage()->clock().sec(seconds); - _impl->GetMessage()->clock().nanosec(nanoseconds); - - return true; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaClockPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaClockPublisher.h deleted file mode 100644 index 85dca7e225f..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaClockPublisher.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#include "carla/ros2/publishers/BasePublisher.h" -#include "carla/ros2/publishers/PublisherImpl.h" - -#include "carla/ros2/types/Clock.h" -#include "carla/ros2/types/ClockPubSubTypes.h" - -namespace carla { -namespace ros2 { - - class CarlaClockPublisher : public BasePublisher { - public: - struct ClockMsgTraits { - using msg_type = rosgraph::msg::Clock; - using msg_pubsub_type = rosgraph::msg::ClockPubSubType; - }; - - CarlaClockPublisher() : - BasePublisher("rt/clock"), - _impl(std::make_shared>()) { - _impl->Init(GetBaseTopicName()); - } - - bool Publish() { - return _impl->Publish(); - } - - bool Write(int32_t seconds, uint32_t nanoseconds); - - private: - std::shared_ptr> _impl; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaCollisionPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaCollisionPublisher.cpp deleted file mode 100644 index c5879c9d7ed..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaCollisionPublisher.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaCollisionPublisher.h" - -namespace carla { -namespace ros2 { - -bool CarlaCollisionPublisher::Write(int32_t seconds, uint32_t nanoseconds, uint32_t actor_id, geom::Vector3D impulse) { - - _impl->GetMessage()->header().stamp().sec(seconds); - _impl->GetMessage()->header().stamp().nanosec(nanoseconds); - _impl->GetMessage()->header().frame_id(GetFrameId()); - - _impl->GetMessage()->other_actor_id(actor_id); - - _impl->GetMessage()->normal_impulse().x(impulse.x); - _impl->GetMessage()->normal_impulse().y(impulse.y); - _impl->GetMessage()->normal_impulse().z(impulse.z); - - return true; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaCollisionPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaCollisionPublisher.h deleted file mode 100644 index 081eda3dfe4..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaCollisionPublisher.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#include "carla/geom/Vector3D.h" - -#include "carla/ros2/publishers/BasePublisher.h" -#include "carla/ros2/publishers/PublisherImpl.h" - -#include "carla/ros2/types/CarlaCollisionEvent.h" -#include "carla/ros2/types/CarlaCollisionEventPubSubTypes.h" - -namespace carla { -namespace ros2 { - - class CarlaCollisionPublisher : public BasePublisher { - public: - struct CollisionMsgTraits { - using msg_type = carla_msgs::msg::CarlaCollisionEvent; - using msg_pubsub_type = carla_msgs::msg::CarlaCollisionEventPubSubType; - }; - - CarlaCollisionPublisher(std::string base_topic_name, std::string frame_id) : - BasePublisher(base_topic_name, frame_id), - _impl(std::make_shared>()) { - _impl->Init(this->GetBaseTopicName()); - } - - bool Publish() { - return _impl->Publish(); - } - - bool Write(int32_t seconds, uint32_t nanoseconds, uint32_t actor_id, geom::Vector3D impulse); - - private: - std::shared_ptr> _impl; - }; - -} // namespace ros2 -} // namespace carla - diff --git a/LibCarla/source/carla/ros2/publishers/CarlaDVSPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaDVSPublisher.cpp deleted file mode 100644 index 6df3190d62e..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaDVSPublisher.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaDVSPublisher.h" - -#include "carla/sensor/data/DVSEvent.h" - -namespace carla { -namespace ros2 { - -const size_t CarlaDVSPointCloudPublisher::GetPointSize() { - return sizeof(sensor::data::DVSEvent); -} - -std::vector CarlaDVSPointCloudPublisher::GetFields() { - - sensor_msgs::msg::PointField descriptor1; - descriptor1.name("x"); - descriptor1.offset(0); - descriptor1.datatype(sensor_msgs::msg::PointField__UINT16); - descriptor1.count(1); - sensor_msgs::msg::PointField descriptor2; - descriptor2.name("y"); - descriptor2.offset(2); - descriptor2.datatype(sensor_msgs::msg::PointField__UINT16); - descriptor2.count(1); - sensor_msgs::msg::PointField descriptor3; - descriptor3.name("t"); - descriptor3.offset(4); - descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT64); - descriptor3.count(1); - sensor_msgs::msg::PointField descriptor4; - descriptor3.name("pol"); - descriptor3.offset(12); - descriptor3.datatype(sensor_msgs::msg::PointField__INT8); - descriptor3.count(1); - - return {descriptor1, descriptor2, descriptor3, descriptor4}; -} - -std::vector CarlaDVSPointCloudPublisher::ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) { - - sensor::data::DVSEvent* events = reinterpret_cast(data); - const size_t total_points = height * width; - for (size_t i = 0; i < total_points; ++i) { - events[i].y *= -1.0f; - } - - const size_t total_bytes = total_points * sizeof(sensor::data::DVSEvent); - std::vector vector_data(reinterpret_cast(events), - reinterpret_cast(events) + total_bytes); - return vector_data; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaDVSPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaDVSPublisher.h deleted file mode 100644 index bb0ed58767d..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaDVSPublisher.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include -#include -#include - -#include "carla/ros2/publishers/BasePublisher.h" - -#include "CarlaCameraPublisher.h" -#include "CarlaPointCloudPublisher.h" - -#include "carla/sensor/data/DVSEvent.h" - -namespace carla { -namespace ros2 { - - class CarlaDVSCameraPublisher : public CarlaCameraPublisher { - public: - CarlaDVSCameraPublisher(std::string base_topic_name, std::string frame_id): - CarlaCameraPublisher(base_topic_name, frame_id) {} - - uint8_t GetChannels() override { return 3; } - - private: - std::string GetEncoding() override { return "bgr8"; } - }; - - class CarlaDVSPointCloudPublisher : public CarlaPointCloudPublisher { - public: - CarlaDVSPointCloudPublisher(std::string base_topic_name, std::string frame_id): - CarlaPointCloudPublisher(base_topic_name, frame_id) {} - - private: - const size_t GetPointSize() override; - std::vector GetFields() override; - - std::vector ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) override; - }; - - class CarlaDVSPublisher : public BasePublisher { - public: - - CarlaDVSPublisher(std::string base_topic_name, std::string frame_id) : - BasePublisher(base_topic_name, frame_id) { - _camera_pub = std::make_shared(base_topic_name, frame_id); - _point_cloud_pub = std::make_shared(base_topic_name, frame_id); - } - - bool Publish() { - return _camera_pub->Publish() && _point_cloud_pub->Publish(); - } - - bool WriteCameraInfo(int32_t seconds, uint32_t nanoseconds, uint32_t x_offset, uint32_t y_offset, uint32_t height, uint32_t width, float fov, bool do_rectify) { - return _camera_pub->WriteCameraInfo(seconds, nanoseconds, x_offset, y_offset, height, width, fov, do_rectify); - } - bool WriteImage(int32_t seconds, uint32_t nanoseconds, uint32_t elements, uint32_t im_height, uint32_t im_width, const uint8_t *data) { - const size_t im_size = im_width * im_height * _camera_pub->GetChannels(); - std::vector im_data(im_size, 0); - - const carla::sensor::data::DVSEvent* events = reinterpret_cast(data); - for (size_t i = 0; i < elements; ++i) { - const auto& event = events[i]; - size_t index = (event.y * im_width + event.x) * 3 + (static_cast(event.pol) * 2); - im_data[index] = 255; - } - - return _camera_pub->WriteImage(seconds, nanoseconds, im_height, im_width, std::move(im_data)); - } - bool WritePointCloud(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, uint8_t* data) { - return _point_cloud_pub->WritePointCloud(seconds, nanoseconds, height, width, data); - } - - private: - std::shared_ptr _camera_pub; - std::shared_ptr _point_cloud_pub; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaDepthCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaDepthCameraPublisher.h deleted file mode 100644 index 3bf1b894e87..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaDepthCameraPublisher.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/ros2/publishers/CarlaRGBCameraPublisher.h" - -namespace carla { -namespace ros2 { - - using CarlaDepthCameraPublisher = CarlaRGBCameraPublisher; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaGNSSPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaGNSSPublisher.cpp deleted file mode 100644 index bb79bb56fa8..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaGNSSPublisher.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaGNSSPublisher.h" - -namespace carla { -namespace ros2 { - -bool CarlaGNSSPublisher::Write(int32_t seconds, uint32_t nanoseconds, const geom::GeoLocation data) { - - _impl->GetMessage()->header().stamp().sec(seconds); - _impl->GetMessage()->header().stamp().nanosec(nanoseconds); - _impl->GetMessage()->header().frame_id(GetFrameId()); - - _impl->GetMessage()->latitude(data.latitude); - _impl->GetMessage()->longitude(data.longitude); - _impl->GetMessage()->altitude(data.altitude); - - return true; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaGNSSPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaGNSSPublisher.h deleted file mode 100644 index abcc0217ac6..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaGNSSPublisher.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#include "carla/geom/GeoLocation.h" - -#include "carla/ros2/publishers/BasePublisher.h" -#include "carla/ros2/publishers/PublisherImpl.h" - -#include "carla/ros2/types/NavSatFix.h" -#include "carla/ros2/types/NavSatFixPubSubTypes.h" - -namespace carla { -namespace ros2 { - - class CarlaGNSSPublisher : public BasePublisher { - public: - struct GnssMsgTraits { - using msg_type = sensor_msgs::msg::NavSatFix; - using msg_pubsub_type = sensor_msgs::msg::NavSatFixPubSubType; - }; - - CarlaGNSSPublisher(std::string base_topic_name, std::string frame_id): - BasePublisher(base_topic_name, frame_id), - _impl(std::make_shared>()) { - _impl->Init(this->GetBaseTopicName()); - } - - bool Publish() { - return _impl->Publish(); - } - - bool Write(int32_t seconds, uint32_t nanoseconds, const geom::GeoLocation data); - - private: - std::shared_ptr> _impl; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaIMUPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaIMUPublisher.cpp deleted file mode 100644 index 3a2afa170b7..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaIMUPublisher.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaIMUPublisher.h" - -namespace carla { -namespace ros2 { - -bool CarlaIMUPublisher::Write(int32_t seconds, uint32_t nanoseconds, geom::Vector3D accelerometer, geom::Vector3D gyroscope, float compass) { - - _impl->GetMessage()->header().stamp().sec(seconds); - _impl->GetMessage()->header().stamp().nanosec(nanoseconds); - _impl->GetMessage()->header().frame_id(GetFrameId()); - - _impl->GetMessage()->linear_acceleration().x(accelerometer.x); - _impl->GetMessage()->linear_acceleration().y(-accelerometer.y); - _impl->GetMessage()->linear_acceleration().z(accelerometer.z); - - _impl->GetMessage()->angular_velocity().x(-gyroscope.x); - _impl->GetMessage()->angular_velocity().y(gyroscope.y); - _impl->GetMessage()->angular_velocity().z(-gyroscope.z); - - const float rx = 0.0f; // pitch - const float ry = (float(M_PI_2) / 2.0f) - compass; // yaw - const float rz = 0.0f; // roll - - const float cr = cosf(rz * 0.5f); - const float sr = sinf(rz * 0.5f); - const float cp = cosf(rx * 0.5f); - const float sp = sinf(rx * 0.5f); - const float cy = cosf(ry * 0.5f); - const float sy = sinf(ry * 0.5f); - - const float w = cr * cp * cy + sr * sp * sy; - const float x = sr * cp * cy - cr * sp * sy; - const float y = cr * sp * cy + sr * cp * sy; - const float z = cr * cp * sy - sr * sp * cy; - - _impl->GetMessage()->orientation().w(w); - _impl->GetMessage()->orientation().x(x); - _impl->GetMessage()->orientation().y(y); - _impl->GetMessage()->orientation().z(z); - - return true; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaIMUPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaIMUPublisher.h deleted file mode 100644 index e9d70472ed3..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaIMUPublisher.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#include "carla/geom/Vector3D.h" - -#include "carla/ros2/publishers/BasePublisher.h" -#include "carla/ros2/publishers/PublisherImpl.h" - -#include "carla/ros2/types/Imu.h" -#include "carla/ros2/types/ImuPubSubTypes.h" - -namespace carla { -namespace ros2 { - - class CarlaIMUPublisher : public BasePublisher { - public: - struct ImuMsgTraits { - using msg_type = sensor_msgs::msg::Imu; - using msg_pubsub_type = sensor_msgs::msg::ImuPubSubType; - }; - - CarlaIMUPublisher(std::string base_topic_name, std::string frame_id) : - BasePublisher(base_topic_name, frame_id), - _impl(std::make_shared>()) { - _impl->Init(this->GetBaseTopicName()); - } - - bool Publish() { - return _impl->Publish(); - } - - bool Write(int32_t seconds, uint32_t nanoseconds, geom::Vector3D accelerometer, geom::Vector3D gyroscope, float compass); - - private: - std::shared_ptr> _impl; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaISCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaISCameraPublisher.h deleted file mode 100644 index 379ac1a868d..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaISCameraPublisher.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/ros2/publishers/CarlaRGBCameraPublisher.h" - -namespace carla { -namespace ros2 { - - using CarlaISCameraPublisher = CarlaRGBCameraPublisher; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaLidarPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaLidarPublisher.cpp deleted file mode 100644 index 3a9fec01b56..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaLidarPublisher.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaLidarPublisher.h" - -#include "carla/sensor/data/LidarData.h" - -namespace carla { -namespace ros2 { - -const size_t CarlaLidarPublisher::GetPointSize() { - return sizeof(sensor::data::LidarDetection); -} - -std::vector CarlaLidarPublisher::GetFields() { - - sensor_msgs::msg::PointField descriptor1; - descriptor1.name("x"); - descriptor1.offset(0); - descriptor1.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor1.count(1); - - sensor_msgs::msg::PointField descriptor2; - descriptor2.name("y"); - descriptor2.offset(4); - descriptor2.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor2.count(1); - - sensor_msgs::msg::PointField descriptor3; - descriptor3.name("z"); - descriptor3.offset(8); - descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor3.count(1); - - sensor_msgs::msg::PointField descriptor4; - descriptor4.name("intensity"); - descriptor4.offset(12); - descriptor4.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor4.count(1); - - return {descriptor1, descriptor2, descriptor3, descriptor4}; -} - -std::vector CarlaLidarPublisher::ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) { - - sensor::data::LidarDetection* detections = reinterpret_cast(data); - - const size_t total_points = height * width; - for (size_t i = 0; i < total_points; ++i) { - detections[i].point.y *= -1.0f; - } - - const size_t total_bytes = total_points * sizeof(sensor::data::LidarDetection); - std::vector vector_data(reinterpret_cast(detections), - reinterpret_cast(detections) + total_bytes); - return vector_data; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaLidarPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaLidarPublisher.h deleted file mode 100644 index d8a7e923c39..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaLidarPublisher.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#include "CarlaPointCloudPublisher.h" - -namespace carla { -namespace ros2 { - - class CarlaLidarPublisher : public CarlaPointCloudPublisher { - public: - CarlaLidarPublisher(std::string base_topic_name, std::string frame_id) : - CarlaPointCloudPublisher(base_topic_name, frame_id) {} - - private: - const size_t GetPointSize() override; - std::vector GetFields() override; - - std::vector ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) override; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaNormalsCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaNormalsCameraPublisher.h deleted file mode 100644 index 96d3adb0fa7..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaNormalsCameraPublisher.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/ros2/publishers/CarlaRGBCameraPublisher.h" - -namespace carla { -namespace ros2 { - - using CarlaNormalsCameraPublisher = CarlaRGBCameraPublisher; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaOpticalFlowCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaOpticalFlowCameraPublisher.h deleted file mode 100644 index d66a7712153..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaOpticalFlowCameraPublisher.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/ros2/publishers/CarlaRGBCameraPublisher.h" - -namespace carla { -namespace ros2 { - - using CarlaOpticalFlowCameraPublisher = CarlaRGBCameraPublisher; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaPointCloudPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaPointCloudPublisher.cpp deleted file mode 100644 index 8e51a8a3b09..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaPointCloudPublisher.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaPointCloudPublisher.h" - -namespace carla { -namespace ros2 { - -bool CarlaPointCloudPublisher::WritePointCloud(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, std::vector data) { - - _impl->GetMessage()->header().stamp().sec(seconds); - _impl->GetMessage()->header().stamp().nanosec(nanoseconds); - _impl->GetMessage()->header().frame_id(GetFrameId()); - - auto fields = GetFields(); - const size_t point_size = GetPointSize(); - - _impl->GetMessage()->width(width); - _impl->GetMessage()->height(height); - _impl->GetMessage()->is_bigendian(false); - _impl->GetMessage()->fields(fields); - _impl->GetMessage()->point_step(point_size); - _impl->GetMessage()->row_step(width * point_size); - _impl->GetMessage()->is_dense(false); // True if there are not invalid points - _impl->GetMessage()->data(std::move(data)); - - return true; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaPointCloudPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaPointCloudPublisher.h deleted file mode 100644 index b8b27d1a816..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaPointCloudPublisher.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include -#include - -#include "carla/ros2/publishers/BasePublisher.h" -#include "carla/ros2/publishers/PublisherImpl.h" - -#include "carla/ros2/types/PointCloud2.h" -#include "carla/ros2/types/PointCloud2PubSubTypes.h" - -namespace carla { -namespace ros2 { - - class CarlaPointCloudPublisher : public BasePublisher { - public: - struct PointCloudMsgTraits { - using msg_type = sensor_msgs::msg::PointCloud2; - using msg_pubsub_type = sensor_msgs::msg::PointCloud2PubSubType; - }; - - CarlaPointCloudPublisher(std::string base_topic_name, std::string frame_id) : - BasePublisher(base_topic_name, frame_id), - _impl(std::make_shared>()) { - _impl->Init(GetBaseTopicName() + "/point_cloud"); - } - - bool Publish() { - return _impl->Publish(); - } - - bool WritePointCloud(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, uint8_t* data) { - return WritePointCloud(seconds, nanoseconds, height, width, ComputePointCloud(height, width, data)); - } - bool WritePointCloud(int32_t seconds, uint32_t nanoseconds, uint32_t height, uint32_t width, std::vector data); - - private: - virtual const size_t GetPointSize() = 0; - virtual std::vector GetFields() = 0; - - virtual std::vector ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) = 0; - - - private: - std::shared_ptr> _impl; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaRGBCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaRGBCameraPublisher.h deleted file mode 100644 index 3eead95ebc3..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaRGBCameraPublisher.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/ros2/publishers/CarlaCameraPublisher.h" - -namespace carla { -namespace ros2 { - -class CarlaRGBCameraPublisher : public CarlaCameraPublisher { - public: - CarlaRGBCameraPublisher(std::string base_topic_name, std::string frame_id): - CarlaCameraPublisher(base_topic_name, frame_id) {} - - uint8_t GetChannels() override { return 4; } - - private: - std::string GetEncoding() override { return "bgra8"; } -}; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaRadarPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaRadarPublisher.cpp deleted file mode 100644 index 0670464130b..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaRadarPublisher.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaRadarPublisher.h" - -#include "carla/sensor/data/RadarData.h" - -namespace carla { -namespace ros2 { - -struct RadarDetectionWithPosition { - float x; - float y; - float z; - carla::sensor::data::RadarDetection detection; -}; - -const size_t CarlaRadarPublisher::GetPointSize() { - return sizeof(RadarDetectionWithPosition); -} - -std::vector CarlaRadarPublisher::GetFields() { - - sensor_msgs::msg::PointField descriptor1; - descriptor1.name("x"); - descriptor1.offset(0); - descriptor1.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor1.count(1); - - sensor_msgs::msg::PointField descriptor2; - descriptor2.name("y"); - descriptor2.offset(4); - descriptor2.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor2.count(1); - - sensor_msgs::msg::PointField descriptor3; - descriptor3.name("z"); - descriptor3.offset(8); - descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor3.count(1); - - sensor_msgs::msg::PointField descriptor4; - descriptor4.name("velocity"); - descriptor4.offset(12); - descriptor4.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor4.count(1); - - sensor_msgs::msg::PointField descriptor5; - descriptor5.name("azimuth"); - descriptor5.offset(16); - descriptor5.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor5.count(1); - - sensor_msgs::msg::PointField descriptor6; - descriptor6.name("altitude"); - descriptor6.offset(20); - descriptor6.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor6.count(1); - - sensor_msgs::msg::PointField descriptor7; - descriptor7.name("depth"); - descriptor7.offset(24); - descriptor7.datatype(sensor_msgs::msg::PointField__FLOAT32); - descriptor7.count(1); - - return {descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7}; -} - -std::vector CarlaRadarPublisher::ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) { - - carla::sensor::data::RadarDetection* detections = reinterpret_cast(data); - const size_t total_bytes = height * width * sizeof(sensor::data::RadarDetection); - const size_t total_points = total_bytes / sizeof(sensor::data::RadarDetection); - - std::vector radar_points(total_points); - for (size_t i = 0; i < total_points; ++i) { - const auto& det = detections[i]; - auto& point = radar_points[i]; - - point.x = det.depth * std::cos(det.azimuth) * std::cos(-det.altitude); - point.y = det.depth * std::sin(-det.azimuth) * std::cos(det.altitude); - point.z = det.depth * std::sin(det.altitude); - point.detection = det; - } - - const uint8_t* byte_ptr = reinterpret_cast(radar_points.data()); - return std::vector(byte_ptr, byte_ptr + radar_points.size() * sizeof(RadarDetectionWithPosition)); -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaRadarPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaRadarPublisher.h deleted file mode 100644 index 402046eb2da..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaRadarPublisher.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include -#include - -#include "CarlaPointCloudPublisher.h" - -namespace carla { -namespace ros2 { - - class CarlaRadarPublisher : public CarlaPointCloudPublisher { - public: - CarlaRadarPublisher(std::string base_topic_name, std::string frame_id) : - CarlaPointCloudPublisher(base_topic_name, frame_id) {} - - private: - const size_t GetPointSize() override; - std::vector GetFields() override; - - std::vector ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) override; - }; -} -} diff --git a/LibCarla/source/carla/ros2/publishers/CarlaSSCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaSSCameraPublisher.h deleted file mode 100644 index 202f53a002e..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaSSCameraPublisher.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/ros2/publishers/CarlaRGBCameraPublisher.h" - -namespace carla { -namespace ros2 { - - using CarlaSSCameraPublisher = CarlaRGBCameraPublisher; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaSemanticLidarPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaSemanticLidarPublisher.h deleted file mode 100644 index 5959771c4cd..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaSemanticLidarPublisher.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include -#include - -#include "CarlaPointCloudPublisher.h" - -namespace carla { -namespace ros2 { - - class CarlaSemanticLidarPublisher : public CarlaPointCloudPublisher { - public: - CarlaSemanticLidarPublisher(std::string base_topic_name, std::string frame_id) : - CarlaPointCloudPublisher(base_topic_name, frame_id) {} - - private: - const size_t GetPointSize() override; - std::vector GetFields() override; - - std::vector ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) override; - }; -} -} diff --git a/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp new file mode 100644 index 00000000000..612221d2417 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp @@ -0,0 +1,37 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "CarlaStatusPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +CarlaStatusPublisher::CarlaStatusPublisher() + : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("status")), + _impl(std::make_shared()) {} + +bool CarlaStatusPublisher::Init(std::shared_ptr domain_participant) { + // provide the status transient local to ensure if CARLA is stuck and someone wants to query the synchronization status, + // then the last published state is still available and one is able to detect for what CARLA is waiting + auto topic_qos = get_topic_qos(); + topic_qos.transient_local(); + return _impl->Init(domain_participant, get_topic_name(), topic_qos); +} + +bool CarlaStatusPublisher::Publish() { + return _impl->Publish(); +} + +bool CarlaStatusPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void CarlaStatusPublisher::UpdateCarlaStatus(const carla_msgs::msg::CarlaStatus& status) { + _impl->Message() = status; + _impl->SetMessageUpdated(); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.h new file mode 100644 index 00000000000..505eb7524fa --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.h @@ -0,0 +1,40 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla_msgs/msg/CarlaStatusPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using CarlaStatusPublisherImpl = DdsPublisherImpl; + +class CarlaStatusPublisher : public PublisherBaseSensor { +public: + CarlaStatusPublisher(); + virtual ~CarlaStatusPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateCarlaStatus(const carla_msgs::msg::CarlaStatus& status); + +private: + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaTransformPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaTransformPublisher.cpp deleted file mode 100644 index 6fc05aa0966..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaTransformPublisher.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "CarlaTransformPublisher.h" - -namespace carla { -namespace ros2 { - -constexpr double EPSILON = 1e-4; - -geometry_msgs::msg::Transform CarlaTransformPublisher::ComputeTransform(std::string frame_id, geom::Transform transform) { - - // Avoid recomputing the transform if it hasn't changed. - // This is common for static sensors that are typically attached to other actors. - auto it = _last_transforms.find(frame_id); - if (it != _last_transforms.end()) { - const auto& [last_transform, last_tf] = it->second; - - // Do not use operator== directly on transforms. - // Floating-point errors can cause two transforms that are equal to compare as different. - if (std::abs(last_transform.location.x - transform.location.x) < EPSILON - && std::abs(last_transform.location.y - transform.location.y) < EPSILON - && std::abs(last_transform.location.z - transform.location.z) < EPSILON - && std::abs(last_transform.rotation.roll - transform.rotation.roll) < EPSILON - && std::abs(last_transform.rotation.pitch - transform.rotation.pitch) < EPSILON - && std::abs(last_transform.rotation.yaw - transform.rotation.yaw) < EPSILON - ) { - return last_tf; - } - } - - // Better readability - const float tx = transform.location.x; - const float ty = transform.location.y * -1.0f; - const float tz = transform.location.z; - - // Rotations was not correctly computed Radians = Degrees * (Ï€ / 180) - const float DEG_TO_RAD = float(M_PI) / 180.0f; - const float rx = (transform.rotation.pitch * -1.0f) * DEG_TO_RAD; - const float ry = (transform.rotation.yaw * -1.0f) * DEG_TO_RAD; - const float rz = transform.rotation.roll * DEG_TO_RAD; - - const float cr = cosf(rz * 0.5f); - const float sr = sinf(rz * 0.5f); - const float cp = cosf(rx * 0.5f); - const float sp = sinf(rx * 0.5f); - const float cy = cosf(ry * 0.5f); - const float sy = sinf(ry * 0.5f); - - geometry_msgs::msg::Transform tf; - - tf.translation().x(tx); - tf.translation().y(ty); - tf.translation().z(tz); - - tf.rotation().w(cr * cp * cy + sr * sp * sy); - tf.rotation().x(sr * cp * cy - cr * sp * sy); - tf.rotation().y(cr * sp * cy + sr * cp * sy); - tf.rotation().z(cr * cp * sy - sr * sp * cy); - - return tf; -} - -bool CarlaTransformPublisher::Write(int32_t seconds, uint32_t nanoseconds, std::string frame_id, std::string child_frame_id, geom::Transform transform) { - - - geometry_msgs::msg::TransformStamped ts; - - ts.header().stamp().sec(seconds); - ts.header().stamp().nanosec(nanoseconds); - ts.header().frame_id(frame_id); - - auto tf = ComputeTransform(child_frame_id, transform); - ts.transform(tf); - - ts.child_frame_id(child_frame_id); - - _impl->GetMessage()->transforms({ts}); - - // Update last transform information - _last_transforms.insert({child_frame_id, {transform, tf}}); - - return true; -} - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaTransformPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaTransformPublisher.h deleted file mode 100644 index 82bbe9125c8..00000000000 --- a/LibCarla/source/carla/ros2/publishers/CarlaTransformPublisher.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include -#include - -#include "carla/geom/Transform.h" - -#include "carla/ros2/publishers/BasePublisher.h" -#include "carla/ros2/publishers/PublisherImpl.h" - -#include "carla/ros2/types/TFMessage.h" -#include "carla/ros2/types/TFMessagePubSubTypes.h" - -namespace carla { -namespace ros2 { - - class CarlaTransformPublisher : public BasePublisher { - public: - struct TransformMsgTraits { - using msg_type = tf2_msgs::msg::TFMessage; - using msg_pubsub_type = tf2_msgs::msg::TFMessagePubSubType; - }; - - CarlaTransformPublisher() : - BasePublisher("rt/tf"), - _impl(std::make_shared>()) { - _impl->Init(GetBaseTopicName()); - } - - bool Publish() { - return _impl->Publish(); - } - - bool Write(int32_t seconds, uint32_t nanoseconds, std::string frame_id, std::string child_frame_id, geom::Transform transform); - - private: - geometry_msgs::msg::Transform ComputeTransform(std::string frame_id, geom::Transform current_transform); - - private: - std::shared_ptr> _impl; - - std::unordered_map> _last_transforms; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ClockPublisher.cpp b/LibCarla/source/carla/ros2/publishers/ClockPublisher.cpp new file mode 100644 index 00000000000..53f696abaff --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ClockPublisher.cpp @@ -0,0 +1,33 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "ClockPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +ClockPublisher::ClockPublisher() + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("clock")), + _impl(std::make_shared()) {} + +bool ClockPublisher::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, "rt/clock", get_topic_qos()); +} + +bool ClockPublisher::Publish() { + return _impl->Publish(); +} + +bool ClockPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void ClockPublisher::UpdateData(const builtin_interfaces::msg::Time &stamp) { + _impl->Message().clock(stamp); + _impl->SetMessageUpdated(); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ClockPublisher.h b/LibCarla/source/carla/ros2/publishers/ClockPublisher.h new file mode 100644 index 00000000000..75ba52e5246 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ClockPublisher.h @@ -0,0 +1,44 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBase.h" +#include "rosgraph_msgs/msg/ClockPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using ClockPublisherImpl = DdsPublisherImpl; + +class ClockPublisher : public PublisherBase { +public: + ClockPublisher(); + virtual ~ClockPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + + /** + * Implement PublisherInterface::SubscribersConnected() interface + */ + bool SubscribersConnected() const override; + + /** + * UpdateData() + */ + void UpdateData(const builtin_interfaces::msg::Time &stamp); + +private: + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/MapPublisher.cpp b/LibCarla/source/carla/ros2/publishers/MapPublisher.cpp new file mode 100644 index 00000000000..c3ba7d5e6ea --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/MapPublisher.cpp @@ -0,0 +1,33 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "MapPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +MapPublisher::MapPublisher() + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("map")), + _impl(std::make_shared()) {} + +bool MapPublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); +} + +bool MapPublisher::Publish() { + return _impl->Publish(); +} + +bool MapPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void MapPublisher::UpdateData(std::string const &data) { + _impl->Message().data(data); + _impl->SetMessageUpdated(); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/MapPublisher.h b/LibCarla/source/carla/ros2/publishers/MapPublisher.h new file mode 100644 index 00000000000..2bfeb5e10a2 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/MapPublisher.h @@ -0,0 +1,42 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/ros2/publishers/PublisherBase.h" +#include "std_msgs/msg/StringPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using MapPublisherImpl = DdsPublisherImpl; + +class MapPublisher : public PublisherBase { +public: + MapPublisher(); + virtual ~MapPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateData(std::string const &data); + +private: + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectPublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectPublisher.cpp new file mode 100644 index 00000000000..881a3ecbdce --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ObjectPublisher.cpp @@ -0,0 +1,39 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "ObjectPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +ObjectPublisher::ObjectPublisher(ROS2NameRecord &parent_publisher, std::shared_ptr objects_publisher) + : _parent_publisher(parent_publisher), + _impl(std::make_shared()), + _objects_publisher(objects_publisher) {} + +bool ObjectPublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode( + domain_participant, _parent_publisher.get_topic_name("object"), DEFAULT_SENSOR_DATA_QOS); +} + +bool ObjectPublisher::Publish() { + return _impl->Publish(); +} + +bool ObjectPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void ObjectPublisher::UpdateObject(std::shared_ptr &object) { + // forward the data to the objects publisher + _objects_publisher->AddObject(object); + derived_object_msgs::msg::Object ros_object = object->object(); + _impl->Message() = ros_object; + _impl->SetMessageHeader(ros_object.header().stamp(), _parent_publisher.frame_id()); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectPublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectPublisher.h new file mode 100644 index 00000000000..228f195f7a4 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ObjectPublisher.h @@ -0,0 +1,45 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/ObjectsPublisher.h" +#include "carla/ros2/publishers/PublisherInterface.h" +#include "carla/ros2/types/Object.h" +#include "derived_object_msgs/msg/ObjectPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using ObjectPublisherImpl = + DdsPublisherImpl; + +class ObjectPublisher : public PublisherInterface { +public: + ObjectPublisher(ROS2NameRecord &parent_publisher, std::shared_ptr objects_publisher); + virtual ~ObjectPublisher() = default; + + /** + * Implements Init() function + */ + bool Init(std::shared_ptr domain_participant); + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateObject(std::shared_ptr &object); + +private: + ROS2NameRecord &_parent_publisher; + std::shared_ptr _impl; + std::shared_ptr _objects_publisher; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.cpp new file mode 100644 index 00000000000..c1f393b2c0e --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.cpp @@ -0,0 +1,39 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "ObjectWithCovariancePublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +ObjectWithCovariancePublisher::ObjectWithCovariancePublisher(ROS2NameRecord &parent_publisher, std::shared_ptr objects_publisher) + : _parent_publisher(parent_publisher), + _impl(std::make_shared()), + _objects_publisher(objects_publisher) {} + +bool ObjectWithCovariancePublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode( + domain_participant, _parent_publisher.get_topic_name("object_with_covariance"), DEFAULT_SENSOR_DATA_QOS); +} + +bool ObjectWithCovariancePublisher::Publish() { + return _impl->Publish(); +} + +bool ObjectWithCovariancePublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void ObjectWithCovariancePublisher::UpdateObject(std::shared_ptr &object) { + // forward the data to the objects publisher + _objects_publisher->AddObject(object); + derived_object_msgs::msg::ObjectWithCovariance ros_object_with_covariance = object->object_with_covariance(); + _impl->Message() = ros_object_with_covariance; + _impl->SetMessageHeader(ros_object_with_covariance.header().stamp(), _parent_publisher.frame_id()); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.h new file mode 100644 index 00000000000..75c81effa3e --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.h @@ -0,0 +1,45 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/ObjectsWithCovariancePublisher.h" +#include "carla/ros2/publishers/PublisherInterface.h" +#include "carla/ros2/types/Object.h" +#include "derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h" + +namespace carla { +namespace ros2 { + +using ObjectWithCovariancePublisherImpl = + DdsPublisherImpl; + +class ObjectWithCovariancePublisher : public PublisherInterface { +public: + ObjectWithCovariancePublisher(ROS2NameRecord &parent_publisher, std::shared_ptr objects_publisher); + virtual ~ObjectWithCovariancePublisher() = default; + + /** + * Implements Init() function + */ + bool Init(std::shared_ptr domain_participant); + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateObject(std::shared_ptr &object); + +private: + ROS2NameRecord &_parent_publisher; + std::shared_ptr _impl; + std::shared_ptr _objects_publisher; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp new file mode 100644 index 00000000000..1b39465bdb7 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "ObjectsPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +ObjectsPublisher::ObjectsPublisher() + : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("objects")), + _impl(std::make_shared()) {} + +bool ObjectsPublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); +} + +bool ObjectsPublisher::Publish() { + bool result = _impl->Publish(); + // after every frame clear the objects + _impl->Message().objects().clear(); + return result; +} + +bool ObjectsPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void ObjectsPublisher::UpdateHeader(const builtin_interfaces::msg::Time &stamp) { + _impl->SetMessageHeader(stamp, "map"); +} + +void ObjectsPublisher::AddObject(std::shared_ptr &object) { + derived_object_msgs::msg::Object ros_object = object->object(); + _impl->Message().objects().emplace_back(ros_object); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h new file mode 100644 index 00000000000..b7d149b08fd --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h @@ -0,0 +1,44 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/types/Object.h" +#include "derived_object_msgs/msg/ObjectArrayPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using ObjectsPublisherImpl = + DdsPublisherImpl; + +class ObjectsPublisher : public PublisherBaseSensor { +public: + ObjectsPublisher(); + virtual ~ObjectsPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateHeader(const builtin_interfaces::msg::Time &stamp); + + void AddObject(std::shared_ptr &object); + +private: + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp new file mode 100644 index 00000000000..39d3140a656 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "ObjectsWithCovariancePublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +ObjectsWithCovariancePublisher::ObjectsWithCovariancePublisher() + : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("objects_with_covariance")), + _impl(std::make_shared()) {} + +bool ObjectsWithCovariancePublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); +} + +bool ObjectsWithCovariancePublisher::Publish() { + bool result = _impl->Publish(); + // after every frame clear the objects + _impl->Message().objects().clear(); + return result; +} + +bool ObjectsWithCovariancePublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void ObjectsWithCovariancePublisher::UpdateHeader(const builtin_interfaces::msg::Time &stamp) { + _impl->SetMessageHeader(stamp, "map"); +} + +void ObjectsWithCovariancePublisher::AddObject(std::shared_ptr &object) { + derived_object_msgs::msg::ObjectWithCovariance ros_object_with_covariance = object->object_with_covariance(); + _impl->Message().objects().emplace_back(ros_object_with_covariance); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h new file mode 100644 index 00000000000..d5016fa82ef --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h @@ -0,0 +1,44 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/types/Object.h" +#include "derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using ObjectsWithCovariancePublisherImpl = + DdsPublisherImpl; + +class ObjectsWithCovariancePublisher : public PublisherBaseSensor { +public: + ObjectsWithCovariancePublisher(); + virtual ~ObjectsWithCovariancePublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateHeader(const builtin_interfaces::msg::Time &stamp); + + void AddObject(std::shared_ptr &object); + +private: + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBase.h b/LibCarla/source/carla/ros2/publishers/PublisherBase.h new file mode 100644 index 00000000000..13d5b23d8d6 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/PublisherBase.h @@ -0,0 +1,77 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/ROS2NameRecord.h" +#include "carla/ros2/ROS2QoS.h" +#include "carla/ros2/publishers/PublisherInterface.h" + +namespace carla { +namespace ros2 { + +template +class DdsPublisherImpl; + +/** + A Publisher base class for general publisher using default publishing qos. + Use this class for publisher that need a transform conversion for the TF tree in addition. + */ +class PublisherBase : public PublisherInterface, public ROS2NameRecord { +public: + PublisherBase(std::shared_ptr actor_name_definition) + : ROS2NameRecord(actor_name_definition) { + log_debug("PublisherBase created for topic {}", actor_name_definition->ros_name); + } + virtual ~PublisherBase() { + log_debug("PublisherBase destroyed for topic {}", _actor_name_definition->ros_name); + }; + + /** + * Initialze the publisher + */ + virtual bool Init(std::shared_ptr domain_participant) = 0; + + /* + * @brief Default get_topic_qos() for publishers + * + * Be aware: The default selection for publishers is NOT as done default in ROS2 (which aims compatibility to ROS1)! + * Per default, we want to achieve the most compatible combination within ROS2 world in the sense, + * that receiption is possible for all possible subscriber configurations. + * https://docs.ros.org/en/humble/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-compatibilities + * + * Reliability::RELIABLE + * Durability::TRANSIENT_LOCAL + * History::KEEP_LAST, depth: 10u + */ + ROS2QoS get_topic_qos() const { + return DEFAULT_PUBLISHER_QOS; + } + + /* + * @brief enable actor ROS publication + */ + virtual void enable_for_ros(carla::streaming::detail::actor_id_type actor_id=0) { + (void) actor_id; + _actor_name_definition->enabled_for_ros = true; + } + + /* + * @brief disable actor ROS publication + */ + virtual void disable_for_ros(carla::streaming::detail::actor_id_type actor_id=0) { + (void) actor_id; + _actor_name_definition->enabled_for_ros = false; + } + + /* + * @brief is the publisher actually enabled for ROS publication + */ + virtual bool is_enabled_for_ros(carla::streaming::detail::actor_id_type actor_id=0) const { + (void) actor_id; + return _actor_name_definition->enabled_for_ros; + } +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h b/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h new file mode 100644 index 00000000000..55238416f5c --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h @@ -0,0 +1,36 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBase.h" +#include "carla/ros2/types/SensorActorDefinition.h" + +namespace carla { +namespace ros2 { + +/** + A Publisher base class for publisher that provide data similiar or equal to sensors. + Extends PublisherBase by specialized sensor get_topic_qos(). +*/ +class PublisherBaseSensor : public PublisherBase { +public: + PublisherBaseSensor(std::shared_ptr actor_name_definition) + : PublisherBase(actor_name_definition) {} + virtual ~PublisherBaseSensor() = default; + + /* + * @brief Override ROS2NameRecord::get_topic_qos() for (pseudo) sensor publishers. + * I.e. deploy the rclcpp::SensorDataQoS. + * + * Reliability::BEST_EFFORT + * Durability::VOLATILE + * History::KEEP_LAST, depth: 5u + */ + ROS2QoS get_topic_qos() const { + return DEFAULT_SENSOR_DATA_QOS; + } +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h b/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h new file mode 100644 index 00000000000..14104e0a775 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h @@ -0,0 +1,76 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBaseSensor.h" + +#include "carla/ros2/publishers/TransformPublisher.h" +#include "carla/ros2/types/CoordinateSystemTransform.h" +#include "carla/ros2/types/Timestamp.h" +#include "carla/ros2/types/Transform.h" +#include "carla/sensor/s11n/SensorHeaderSerializer.h" + +namespace carla { +namespace ros2 { + +/** + A Publisher base class that is extended to store an internal Transform. + Use this class for publisher that need a transform conversion for the TF tree in addition. + */ +class PublisherBaseTransform : public PublisherBaseSensor { +public: + using CoordinateSystemTransform = carla::ros2::types::CoordinateSystemTransform; + + PublisherBaseTransform(std::shared_ptr actor_name_definition, + std::shared_ptr transform_publisher) + : PublisherBaseSensor(actor_name_definition), _transform_publisher(transform_publisher) {} + virtual ~PublisherBaseTransform() = default; + + /** + * Update the internal transform state with the new transform. + */ + void UpdateTransform(std::shared_ptr sensor_header) { + UpdateTransform(ros2::types::Timestamp(sensor_header->timestamp), + ros2::types::Transform(sensor_header->sensor_relative_transform, + sensor_header->sensor_relative_transform_quaternion)); + } + + /** + * Update the internal transform state with the new transform. + */ + void UpdateTransform(ros2::types::Timestamp const &ros_timestamp, ros2::types::Transform const &ros_transform) { + _timestamp = ros_timestamp; + _transform = ros_transform; + _transform_publisher->AddTransform(_timestamp.time(), frame_id(), parent_frame_id(), _transform.transform()); + } + + /** + * The resulting ROS geometry_msgs::msg::Accel + */ + geometry_msgs::msg::Transform transform() const { + return _transform.transform(); + } + + /** + * The input carla location + */ + carla::geom::Location const &GetLocation() const { + return _transform.GetLocation(); + } + + /** + * The input carla quaternion + */ + carla::geom::Quaternion const &GetQuaternion() const { + return _transform.GetQuaternion(); + } + +protected: + carla::ros2::types::Timestamp _timestamp; + carla::ros2::types::Transform _transform; + std::shared_ptr _transform_publisher; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/PublisherImpl.h b/LibCarla/source/carla/ros2/publishers/PublisherImpl.h deleted file mode 100644 index 87dcd45787b..00000000000 --- a/LibCarla/source/carla/ros2/publishers/PublisherImpl.h +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include - -#include - -#include -#include - -#include "carla/Logging.h" - -namespace carla { -namespace ros2 { - - namespace efd = eprosima::fastdds::dds; - using erc = eprosima::fastrtps::types::ReturnCode_t; - - template - class PublisherImpl : public eprosima::fastdds::dds::DataWriterListener { - public: - using msg_type = typename T::msg_type; - using msg_pubsub_type = typename T::msg_pubsub_type; - - efd::DomainParticipant* _participant { nullptr }; - efd::Publisher* _publisher { nullptr }; - efd::Topic* _topic { nullptr }; - efd::DataWriter* _datawriter { nullptr }; - efd::TypeSupport _type { new msg_pubsub_type() }; - - void on_publication_matched(efd::DataWriter* writer, const efd::PublicationMatchedStatus& info) override { - _alive = (info.total_count > 0) ? true : false; - } - - ~PublisherImpl() { - if (_datawriter) - _publisher->delete_datawriter(_datawriter); - - if (_publisher) - _participant->delete_publisher(_publisher); - - if (_topic) - _participant->delete_topic(_topic); - - if (_participant) - efd::DomainParticipantFactory::get_instance()->delete_participant(_participant); - } - - bool Init(std::string topic_name) { - if (_type == nullptr) { - log_error("Invalid TypeSupport"); - return false; - } - - efd::DomainParticipantQos pqos = efd::PARTICIPANT_QOS_DEFAULT; - auto factory = efd::DomainParticipantFactory::get_instance(); - _participant = factory->create_participant(0, pqos); - if (_participant == nullptr) { - log_error("Failed to create DomainParticipant"); - return false; - } - _type.register_type(_participant); - - efd::PublisherQos pubqos = efd::PUBLISHER_QOS_DEFAULT; - _publisher = _participant->create_publisher(pubqos, nullptr); - if (_publisher == nullptr) { - log_error("Failed to create Publisher"); - return false; - } - - efd::TopicQos tqos = efd::TOPIC_QOS_DEFAULT; - _topic = _participant->create_topic(topic_name, _type->getName(), tqos); - if (_topic == nullptr) { - log_error("Failed to create Topic"); - return false; - } - - efd::DataWriterQos wqos = efd::DATAWRITER_QOS_DEFAULT; - wqos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - efd::DataWriterListener* listener = (efd::DataWriterListener*)(this); - _datawriter = _publisher->create_datawriter(_topic, wqos, listener); - if (_datawriter == nullptr) { - std::cerr << "Failed to create DataWriter" << std::endl; - return false; - } - - _topic_name = topic_name; - return true; - } - - std::string GetTopicName() { - return _topic_name; - } - - bool IsAlive() { - return _alive; - } - - msg_type* GetMessage() { - return &_message; - } - - bool Publish() { - eprosima::fastrtps::rtps::InstanceHandle_t instance_handle; - eprosima::fastrtps::types::ReturnCode_t rcode = _datawriter->write(&_message, instance_handle); - if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { - return true; - } else { - log_error("PublisherImpl::Publish (", this->GetTopicName(), ") failed with code:", rcode()); - return false; - } - } - - private: - std::string _topic_name; - - bool _alive { false }; - msg_type _message; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/PublisherInterface.h b/LibCarla/source/carla/ros2/publishers/PublisherInterface.h new file mode 100644 index 00000000000..8a8440476b8 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/PublisherInterface.h @@ -0,0 +1,54 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "builtin_interfaces/msg/Time.h" +#include "carla/BufferView.h" +#include "carla/ros2/ROS2NameRecord.h" +#include "carla/ros2/types/Transform.h" +#include "carla/sensor/data/SerializerVectorAllocator.h" + +namespace carla { +namespace ros2 { + +/** + * @brief Generic publisher interface. + * + * This interface is used to hide the implementation part of publishers Publish() function. + * The Publisher inherits this and usually forwards this to the respective publisher impl's it's providing. + */ +class PublisherInterface { +public: + PublisherInterface() = default; + virtual ~PublisherInterface() = default; + /** + * Copy operation not allowed due to active publisher + */ + PublisherInterface(const PublisherInterface&) = delete; + /** + * Assignment operation not allowed due to active publisher + */ + PublisherInterface& operator=(const PublisherInterface&) = delete; + /** + * Move constructor not allowed due to active publisher. + */ + PublisherInterface(PublisherInterface&&) = delete; + /** + * Move assignment operation not allowed due to active publisher. + */ + PublisherInterface& operator=(PublisherInterface&&) = delete; + + /** + * Publish the message + */ + virtual bool Publish() = 0; + + /** + * Should return \c true in case there are subscribers connected to the publisher. + */ + virtual bool SubscribersConnected() const = 0; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp new file mode 100644 index 00000000000..07cf94803bf --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp @@ -0,0 +1,76 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "TrafficLightPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +TrafficLightPublisher::TrafficLightPublisher( + std::shared_ptr traffic_light_actor_definition, + std::shared_ptr objects_publisher, + std::shared_ptr objects_with_covariance_publisher, + std::shared_ptr traffic_lights_publisher) + : PublisherBaseSensor( + std::static_pointer_cast(traffic_light_actor_definition)), + _traffic_light_info(std::make_shared()), + _traffic_light_status(std::make_shared()), + _traffic_light_object_publisher(std::make_shared(*this, objects_publisher)), + _traffic_light_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)), + _traffic_lights_publisher(traffic_lights_publisher) { + // prefill some traffic_light info data + _traffic_light_info->Message().id(traffic_light_actor_definition->id); + // TODO: add respective data to actor definitions + // _traffic_light_info->Message().trigger_volume(??); +} + +bool TrafficLightPublisher::Init(std::shared_ptr domain_participant) { + return _traffic_light_info->Init(domain_participant, get_topic_name("traffic_light_info"), + PublisherBase::get_topic_qos()) && + _traffic_light_status->Init(domain_participant, get_topic_name("traffic_light_status"), + PublisherBase::get_topic_qos()) && + _traffic_light_object_publisher->Init(domain_participant) && + _traffic_light_object_with_covariance_publisher->Init(domain_participant); +} + +bool TrafficLightPublisher::Publish() { + if (_traffic_light_info_initialized && (!_traffic_light_info_published)) { + _traffic_light_info_published = _traffic_light_info->Publish(); + } + bool success = _traffic_light_info_published; + success &= _traffic_light_status->Publish(); + success &= _traffic_light_object_publisher->Publish(); + success &= _traffic_light_object_with_covariance_publisher->Publish(); + return success; +} + +bool TrafficLightPublisher::SubscribersConnected() const { + return _traffic_light_info->SubscribersConnected() || _traffic_light_status->SubscribersConnected() || + _traffic_light_object_publisher->SubscribersConnected() || _traffic_light_object_with_covariance_publisher->SubscribersConnected(); +} + +void TrafficLightPublisher::UpdateTrafficLight(std::shared_ptr &object, + carla::sensor::data::ActorDynamicState const &actor_dynamic_state) { + if (!_traffic_light_info_initialized) { + _traffic_light_info_initialized = true; + _traffic_light_info->Message().transform(object->Transform().pose()); + _traffic_light_info->SetMessageUpdated(); + _traffic_lights_publisher->UpdateTrafficLightInfo(_traffic_light_info->Message()); + } + + if (_traffic_light_status->Message().state() != carla::ros2::types::GetTrafficLightState(actor_dynamic_state)) { + _traffic_light_status->SetMessageHeader(object->Timestamp().time(), "map"); + _traffic_light_status->Message().id(_traffic_light_info->Message().id()); + _traffic_light_status->Message().state(carla::ros2::types::GetTrafficLightState(actor_dynamic_state)); + } + + _traffic_light_object_publisher->UpdateObject(object); + _traffic_light_object_with_covariance_publisher->UpdateObject(object); + _traffic_lights_publisher->UpdateTrafficLightStatus(_traffic_light_status->Message()); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h new file mode 100644 index 00000000000..72d6794a4d0 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h @@ -0,0 +1,60 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/ObjectPublisher.h" +#include "carla/ros2/publishers/ObjectWithCovariancePublisher.h" +#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/publishers/TrafficLightsPublisher.h" +#include "carla/ros2/types/Object.h" +#include "carla/ros2/types/TrafficLightActorDefinition.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h" +#include "carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using TrafficLightInfoPublisherImpl = + DdsPublisherImpl; +using TrafficLightStatusPublisherImpl = + DdsPublisherImpl; + +class TrafficLightPublisher : public PublisherBaseSensor { +public: + TrafficLightPublisher(std::shared_ptr traffic_light_actor_definition, + std::shared_ptr objects_publisher, + std::shared_ptr objects_with_covariance_publisher, + std::shared_ptr traffic_lights_publisher); + virtual ~TrafficLightPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateTrafficLight(std::shared_ptr &object, + carla::sensor::data::ActorDynamicState const &actor_dynamic_state); + +private: + std::shared_ptr _traffic_light_info; + bool _traffic_light_info_initialized{false}; + bool _traffic_light_info_published{false}; + std::shared_ptr _traffic_light_status; + std::shared_ptr _traffic_light_object_publisher; + std::shared_ptr _traffic_light_object_with_covariance_publisher; + std::shared_ptr _traffic_lights_publisher; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp new file mode 100644 index 00000000000..cde99429d3a --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp @@ -0,0 +1,73 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "TrafficLightsPublisher.h" + +#include +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +TrafficLightsPublisher::TrafficLightsPublisher() + : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("traffic_lights")), + _traffic_light_info(std::make_shared()), + _traffic_light_status(std::make_shared()) {} + +bool TrafficLightsPublisher::Init(std::shared_ptr domain_participant) { + return _traffic_light_info->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name("info"), + PublisherBase::get_topic_qos()) && + _traffic_light_status->InitHistoryPreallocatedWithReallocMemoryMode( + domain_participant, get_topic_name("status"), PublisherBase::get_topic_qos()); +} + +bool TrafficLightsPublisher::Publish() { + return _traffic_light_info->Publish() && _traffic_light_status->Publish(); +} + +bool TrafficLightsPublisher::SubscribersConnected() const { + return _traffic_light_info->SubscribersConnected() || _traffic_light_status->SubscribersConnected(); +} + +void TrafficLightsPublisher::UpdateTrafficLightStatus( + carla_msgs::msg::CarlaTrafficLightStatus const &traffic_light_status) { + bool traffic_light_found = false; + for (auto &traffic_light : _traffic_light_status->Message().traffic_lights()) { + if (traffic_light.id() == traffic_light_status.id()) { + traffic_light_found = true; + traffic_light = traffic_light_status; + } + } + if (!traffic_light_found) { + _traffic_light_status->Message().traffic_lights().push_back(traffic_light_status); + } + _traffic_light_status->SetMessageUpdated(); +} + +void TrafficLightsPublisher::UpdateTrafficLightInfo(carla_msgs::msg::CarlaTrafficLightInfo const &traffic_light_info) { + bool traffic_light_found = false; + for (auto &traffic_light : _traffic_light_info->Message().traffic_lights()) { + if (traffic_light.id() == traffic_light_info.id()) { + traffic_light_found = true; + traffic_light = traffic_light_info; + } + } + if (!traffic_light_found) { + _traffic_light_info->Message().traffic_lights().push_back(traffic_light_info); + } + _traffic_light_info->SetMessageUpdated(); +} + +void TrafficLightsPublisher::RemoveTrafficLight(carla::streaming::detail::actor_id_type actor) { + (void)std::remove_if( + _traffic_light_status->Message().traffic_lights().begin(), + _traffic_light_status->Message().traffic_lights().end(), + [actor](carla_msgs::msg::CarlaTrafficLightStatus const traffic_light) { return traffic_light.id() == actor; }); + (void)std::remove_if( + _traffic_light_info->Message().traffic_lights().begin(), _traffic_light_info->Message().traffic_lights().end(), + [actor](carla_msgs::msg::CarlaTrafficLightInfo const traffic_light) { return traffic_light.id() == actor; }); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.h b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.h new file mode 100644 index 00000000000..caf0df7e8bc --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.h @@ -0,0 +1,48 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/rpc/ActorId.h" +#include "carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h" +#include "carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using TrafficLightsInfoPublisherImpl = + DdsPublisherImpl; +using TrafficLightsStatusPublisherImpl = DdsPublisherImpl; + +class TrafficLightsPublisher : public PublisherBaseSensor { +public: + TrafficLightsPublisher(); + virtual ~TrafficLightsPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateTrafficLightStatus(carla_msgs::msg::CarlaTrafficLightStatus const &traffic_light_status); + void UpdateTrafficLightInfo(carla_msgs::msg::CarlaTrafficLightInfo const &traffic_light_info); + void RemoveTrafficLight(carla::streaming::detail::actor_id_type id); + +private: + std::shared_ptr _traffic_light_info; + std::shared_ptr _traffic_light_status; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.cpp new file mode 100644 index 00000000000..7f1b58bc15c --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.cpp @@ -0,0 +1,40 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "TrafficSignPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +TrafficSignPublisher::TrafficSignPublisher( + std::shared_ptr traffic_sign_actor_definition, + std::shared_ptr objects_publisher, + std::shared_ptr objects_with_covariance_publisher) + : PublisherBase( + std::static_pointer_cast(traffic_sign_actor_definition)), + _traffic_sign_object_publisher(std::make_shared(*this, objects_publisher)), + _traffic_sign_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)) {} + +bool TrafficSignPublisher::Init(std::shared_ptr domain_participant) { + return _traffic_sign_object_publisher->Init(domain_participant) && _traffic_sign_object_with_covariance_publisher->Init(domain_participant); +} + +bool TrafficSignPublisher::Publish() { + return _traffic_sign_object_publisher->Publish() && _traffic_sign_object_with_covariance_publisher->Publish(); +} + +bool TrafficSignPublisher::SubscribersConnected() const { + return _traffic_sign_object_publisher->SubscribersConnected() || _traffic_sign_object_with_covariance_publisher->SubscribersConnected(); +} + +void TrafficSignPublisher::UpdateTrafficSign(std::shared_ptr &object, + carla::sensor::data::ActorDynamicState const &) { + _traffic_sign_object_publisher->UpdateObject(object); + _traffic_sign_object_with_covariance_publisher->UpdateObject(object); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.h b/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.h new file mode 100644 index 00000000000..7237651b364 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.h @@ -0,0 +1,46 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/ObjectPublisher.h" +#include "carla/ros2/publishers/ObjectWithCovariancePublisher.h" +#include "carla/ros2/publishers/PublisherBase.h" +#include "carla/ros2/types/Object.h" +#include "carla/ros2/types/TrafficSignActorDefinition.h" +#include "carla/sensor/data/ActorDynamicState.h" + +namespace carla { +namespace ros2 { + +class TrafficSignPublisher : public PublisherBase { +public: + TrafficSignPublisher(std::shared_ptr traffic_sign_actor_definition, + std::shared_ptr objects_publisher, + std::shared_ptr objects_with_covariance_publisher); + virtual ~TrafficSignPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateTrafficSign(std::shared_ptr &object, + carla::sensor::data::ActorDynamicState const &actor_dynamic_state); + +private: + std::shared_ptr _traffic_sign_object_publisher; + std::shared_ptr _traffic_sign_object_with_covariance_publisher; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp new file mode 100644 index 00000000000..7a9c51914aa --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#define _USE_MATH_DEFINES +#include + +#include "TransformPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +TransformPublisher::TransformPublisher() + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("tf")), + _impl(std::make_shared()) {} + +bool TransformPublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, "rt/tf", get_topic_qos()); +} + +bool TransformPublisher::Publish() { + auto const success = _impl->Publish(); + // after every frame clear the tf tree + _impl->Message().transforms().clear(); + return success; +} +bool TransformPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void TransformPublisher::AddTransform(const builtin_interfaces::msg::Time &stamp, std::string name, std::string parent, + geometry_msgs::msg::Transform const &transform) { + geometry_msgs::msg::TransformStamped ts; + ts.header().stamp(stamp); + ts.header().frame_id(parent); + ts.transform(transform); + ts.child_frame_id(name); + _impl->Message().transforms().push_back(ts); + _impl->SetMessageUpdated(); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TransformPublisher.h b/LibCarla/source/carla/ros2/publishers/TransformPublisher.h new file mode 100644 index 00000000000..1a66b1ce87d --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/TransformPublisher.h @@ -0,0 +1,42 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBase.h" + +#include "carla/ros2/types/Transform.h" +#include "tf2_msgs/msg/TFMessagePubSubTypes.h" + +namespace carla { +namespace ros2 { + +using TransformPublisherImpl = DdsPublisherImpl; + +class TransformPublisher : public PublisherBase { +public: + TransformPublisher(); + virtual ~TransformPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void AddTransform(const builtin_interfaces::msg::Time &stamp, std::string name, std::string parent, + geometry_msgs::msg::Transform const &transform); + +private: + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.cpp new file mode 100644 index 00000000000..bc4030d02e3 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.cpp @@ -0,0 +1,42 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeCollisionPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/ros2/types/CoordinateSystemTransform.h" +#include "carla/sensor/s11n/CollisionEventSerializer.h" + +namespace carla { +namespace ros2 { + +UeCollisionPublisher::UeCollisionPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + _impl(std::make_shared()) {} + +bool UeCollisionPublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); +} + +bool UeCollisionPublisher::Publish() { + return _impl->Publish(); +} + +bool UeCollisionPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void UeCollisionPublisher::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + auto collision_event_data = data(buffer_view); + _impl->SetMessageHeader(GetTime(sensor_header), frame_id()); + _impl->Message().other_actor_id(collision_event_data.other_actor.id); + _impl->Message().normal_impulse() = + CoordinateSystemTransform::TransformLinearAxisMsg(collision_event_data.normal_impulse); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.h b/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.h new file mode 100644 index 00000000000..5a92d9f1ed6 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.h @@ -0,0 +1,52 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/sensor/s11n/CollisionEventSerializer.h" +#include "carla_msgs/msg/CarlaCollisionEventPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using UeCollisionPublisherImpl = + DdsPublisherImpl; + +class UeCollisionPublisher : public UePublisherBaseSensor { +public: + UeCollisionPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeCollisionPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Implements UePublisherBaseSensor::UpdateSensorData() interface + */ + void UpdateSensorData(std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) override; + +private: + + carla::sensor::s11n::CollisionEventSerializer::Data data(carla::SharedBufferView buffer_view) { + return MsgPack::UnPack(buffer_view->data(), buffer_view->size()); + } + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.cpp new file mode 100644 index 00000000000..b088fa6c83f --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.cpp @@ -0,0 +1,123 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeDVSCameraPublisher.h" + +#include + +#include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/sensor/s11n/DVSEventArraySerializer.h" + +namespace carla { +namespace ros2 { + +UeDVSCameraPublisher::UeDVSCameraPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseCamera(sensor_actor_definition, transform_publisher), + _point_cloud(std::make_shared()) {} + +bool UeDVSCameraPublisher::Init(std::shared_ptr domain_participant) { + return UePublisherBaseCamera::Init(domain_participant) && + _point_cloud->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name("point_cloud"), + get_topic_qos()); +} + +bool UeDVSCameraPublisher::Publish() { + return UePublisherBaseCamera::Publish() && _point_cloud->Publish(); +} + +bool UeDVSCameraPublisher::SubscribersConnected() const { + return UePublisherBaseCamera::SubscribersConnected() || _point_cloud->SubscribersConnected(); +} + +void UeDVSCameraPublisher::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + // TODO: we have to overwrite the camera basic stuff, because we don't have a buffer of Image type at hand, + // but rather DVSEventArraySerializer + auto header_view = this->header_view(buffer_view); + auto data_vector_view = this->vector_view(buffer_view); + + const sensor_msgs::msg::CameraInfo camera_info(header_view->height, header_view->width, header_view->fov_angle); + auto const stamp = GetTime(sensor_header); + UpdateCameraInfo(stamp, camera_info); + UpdateImageHeader(stamp, camera_info); + + SetImageData(data_vector_view); + SetPointCloudData(data_vector_view); +} + +void UeDVSCameraPublisher::SetImageData(std::vector &data_vector_view) { + std::vector im_data(image_size(), 0u); + for (size_t i = 0; i < data_vector_view.size(); ++i) { + uint32_t index = (data_vector_view[i].y * width() + data_vector_view[i].x) * num_channels() + + (static_cast(data_vector_view[i].pol) * 2u); + im_data[index] = 255u; + } + _image->Message().data(std::move(im_data)); +} + +void UeDVSCameraPublisher::SetPointCloudData(std::vector &data_vector_view) { + _point_cloud->Message().header(_image->Message().header()); + _point_cloud->SetMessageUpdated(); + + sensor_msgs::msg::PointField descriptor1; + descriptor1.name("x"); + descriptor1.offset(offsetof(DVSEvent, x)); + descriptor1.datatype(sensor_msgs::msg::PointField__UINT16); + descriptor1.count(1); + sensor_msgs::msg::PointField descriptor2; + descriptor2.name("y"); + descriptor2.offset(offsetof(DVSEvent, y)); + descriptor2.datatype(sensor_msgs::msg::PointField__UINT16); + descriptor2.count(1); + sensor_msgs::msg::PointField descriptor3; + descriptor3.name("t"); + descriptor3.offset(offsetof(DVSEvent, t)); + descriptor3.datatype( + sensor_msgs::msg::PointField__FLOAT64); // PointField__INT64 is not existing, but would be required here!! + descriptor3.count(1); + sensor_msgs::msg::PointField descriptor4; + descriptor4.name("pol"); + descriptor4.offset(offsetof(DVSEvent, pol)); + descriptor4.datatype(sensor_msgs::msg::PointField__INT8); + descriptor4.count(1); + + +#pragma pack(push, 1) + // definition of the actual data type to be put into the point_cloud (which is different to DVSEvent!!) + struct DVSPointCloudData { + explicit DVSPointCloudData(DVSEvent event) + : x (event.x) + , y (event.y) + , t (event.t) + , pol (event.pol) + {} + std::uint16_t x; + std::uint16_t y; + double t; + std::int8_t pol; + }; +#pragma pack(pop) + + DEBUG_ASSERT_EQ(num_channels(), 4); + const uint32_t point_size = sizeof(DVSPointCloudData); + _point_cloud->Message().width(width()); + _point_cloud->Message().height(height()); + _point_cloud->Message().is_bigendian(false); + _point_cloud->Message().fields({descriptor1, descriptor2, descriptor3, descriptor4}); + _point_cloud->Message().point_step(point_size); + _point_cloud->Message().row_step(width() * point_size); + _point_cloud->Message().is_dense(false); + std::vector pcl_data_uint8_t; + pcl_data_uint8_t.resize(data_vector_view.size()*point_size); + for (size_t i = 0; i < data_vector_view.size(); ++i) { + // convert the DVSEvent format to DVSPointCloudData putting it directly into the desired array to be sent out + *(reinterpret_cast(pcl_data_uint8_t.data()+i*point_size)) = DVSPointCloudData(data_vector_view[i]); + } + _point_cloud->Message().data(std::move(pcl_data_uint8_t)); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.h new file mode 100644 index 00000000000..08257856c21 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.h @@ -0,0 +1,71 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBaseCamera.h" +#include "carla/sensor/s11n/DVSEventArraySerializer.h" +#include "sensor_msgs/msg/PointCloud2PubSubTypes.h" + +namespace carla { +namespace ros2 { + +using UePointCloudFromBufferPublisherImpl = + DdsPublisherImpl; + +class UeDVSCameraPublisher : public UePublisherBaseCamera { +public: + UeDVSCameraPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeDVSCameraPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Implements UePublisherBaseSensor::UpdateSensorData() interface + */ + void UpdateSensorData(std::shared_ptr sensor_header, + const carla::SharedBufferView buffer_view) override; + +protected: + /** + * Overrides UePublisherBaseCamera::encoding() + */ + Encoding encoding() const override { + return Encoding::BGR8; + } + +private: + using DVSEvent = carla::sensor::data::DVSEvent; + using DVSHeaderConst = carla::sensor::s11n::DVSEventArraySerializer::DVSHeader const; + using DVSEventVectorAllocator = carla::sensor::data::SerializerVectorAllocator; + + std::shared_ptr header_view(const carla::SharedBufferView buffer_view) { + return std::shared_ptr(buffer_view, reinterpret_cast(buffer_view.get()->data())); + } + + std::vector vector_view(const carla::SharedBufferView buffer_view) { + return carla::sensor::data::buffer_data_accessed_by_vector( + buffer_view, carla::sensor::s11n::DVSEventArraySerializer::header_offset); + } + + void SetImageData(std::vector &data_vector_view); + void SetPointCloudData(std::vector &data_vector_view); + + std::shared_ptr _point_cloud; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeDepthCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeDepthCameraPublisher.cpp new file mode 100644 index 00000000000..67e18f46e53 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeDepthCameraPublisher.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeDepthCameraPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeDepthCameraPublisher::UeDepthCameraPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseCamera(sensor_actor_definition, transform_publisher) {} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeDepthCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeDepthCameraPublisher.h new file mode 100644 index 00000000000..fcaf4b7886f --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeDepthCameraPublisher.h @@ -0,0 +1,21 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBaseCamera.h" +#include "sensor_msgs/msg/CameraInfoPubSubTypes.h" +#include "sensor_msgs/msg/ImagePubSubTypes.h" + +namespace carla { +namespace ros2 { + +class UeDepthCameraPublisher : public UePublisherBaseCamera { +public: + UeDepthCameraPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeDepthCameraPublisher() = default; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp new file mode 100644 index 00000000000..24da9afd913 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp @@ -0,0 +1,39 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeGNSSPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeGNSSPublisher::UeGNSSPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + _impl(std::make_shared()) {} + +bool UeGNSSPublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); +} + +bool UeGNSSPublisher::Publish() { + return _impl->Publish(); +} +bool UeGNSSPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void UeGNSSPublisher::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + auto gnss_data = data(buffer_view); + + _impl->SetMessageHeader(GetTime(sensor_header), frame_id()); + _impl->Message().latitude(gnss_data.latitude); + _impl->Message().longitude(gnss_data.longitude); + _impl->Message().altitude(gnss_data.altitude); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h new file mode 100644 index 00000000000..b86d0c03a9c --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h @@ -0,0 +1,53 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/sensor/s11n/GnssSerializer.h" +#include "sensor_msgs/msg/NavSatFixPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using UeGNSSPublisherImpl = DdsPublisherImpl; + +class UeGNSSPublisher : public UePublisherBaseSensor { +public: + UeGNSSPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeGNSSPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Implements UePublisherBaseSensor::UpdateSensorData() interface + */ + void UpdateSensorData(std::shared_ptr sensor_header, + const carla::SharedBufferView buffer_view) override; + +private: + + carla::geom::GeoLocation data(carla::SharedBufferView buffer_view) { + return MsgPack::UnPack(buffer_view->data(), buffer_view->size()); + } + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp new file mode 100644 index 00000000000..2d7e69fe50c --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp @@ -0,0 +1,67 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#define _USE_MATH_DEFINES +#include + +#include "UeIMUPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/ros2/types/Acceleration.h" +#include "carla/ros2/types/AngularVelocity.h" + +namespace carla { +namespace ros2 { + +UeIMUPublisher::UeIMUPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + _impl(std::make_shared()) {} + +bool UeIMUPublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); +} + +bool UeIMUPublisher::Publish() { + return _impl->Publish(); +} +bool UeIMUPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void UeIMUPublisher::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + auto imu_data = data(buffer_view); + _impl->SetMessageHeader(GetTime(sensor_header), frame_id()); + _impl->Message().angular_velocity(carla::ros2::types::AngularVelocity(imu_data.gyroscope).angular_velocity()); + _impl->Message().linear_acceleration(carla::ros2::types::Acceleration(imu_data.accelerometer).accel().linear()); + + /* + TODO: original ROS bridge had taken the transform to provide a correct 3D orientation + The question is how this should be implemented by the IMU accoringly + Regardless, the transform of the IMU sensor can still be used within ROS in case the quaternion resulting in the 1D + compass value is not sufficient + */ + + // optimized rotation calculation + /*const float rp = 0.0f; // pitch*/ + const float ry = float(M_PI_2) - imu_data.compass; // -yaw + /*const float rr = 0.0f; // roll*/ + + const float cr = 1.f; + const float sr = 0.f; + const float cp = 1.f; + ; + const float sp = 0.f; + const float cy = cosf(ry * 0.5f); + const float sy = sinf(ry * 0.5f); + + _impl->Message().orientation().w(cr * cp * cy + sr * sp * sy); + _impl->Message().orientation().x(sr * cp * cy - cr * sp * sy); + _impl->Message().orientation().y(cr * sp * cy + sr * cp * sy); + _impl->Message().orientation().z(cr * cp * sy - sr * sp * cy); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.h b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.h new file mode 100644 index 00000000000..bc1618d5d82 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.h @@ -0,0 +1,51 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/sensor/s11n/IMUSerializer.h" +#include "geometry_msgs/msg/Accel.h" +#include "sensor_msgs/msg/ImuPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using UeIMUPublisherImpl = DdsPublisherImpl; + +class UeIMUPublisher : public UePublisherBaseSensor { +public: + UeIMUPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeIMUPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Implements UePublisherBaseSensor::UpdateSensorData() interface + */ + void UpdateSensorData(std::shared_ptr sensor_header, + const carla::SharedBufferView buffer_view) override; + +private: + carla::sensor::s11n::IMUSerializer::Data data(carla::SharedBufferView buffer_view) { + return MsgPack::UnPack(buffer_view->data(), buffer_view->size()); + } + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeISCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeISCameraPublisher.cpp new file mode 100644 index 00000000000..0c131b76903 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeISCameraPublisher.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeISCameraPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeISCameraPublisher::UeISCameraPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseCamera(sensor_actor_definition, transform_publisher) {} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeISCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeISCameraPublisher.h new file mode 100644 index 00000000000..b4ba17f7509 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeISCameraPublisher.h @@ -0,0 +1,22 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/publishers/UePublisherBaseCamera.h" + +namespace carla { +namespace ros2 { + +class UeISCameraPublisher : public UePublisherBaseCamera { +public: + UeISCameraPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeISCameraPublisher() = default; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeLidarPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeLidarPublisher.cpp new file mode 100644 index 00000000000..4d8632ae89c --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeLidarPublisher.cpp @@ -0,0 +1,56 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeLidarPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeLidarPublisher::UeLidarPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBasePointCloud(sensor_actor_definition, transform_publisher) {} + +std::vector UeLidarPublisher::GetPointFields() const { + sensor_msgs::msg::PointField descriptor1; + descriptor1.name("x"); + descriptor1.offset(0); + descriptor1.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor1.count(1); + sensor_msgs::msg::PointField descriptor2; + descriptor2.name("y"); + descriptor2.offset(4); + descriptor2.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor2.count(1); + sensor_msgs::msg::PointField descriptor3; + descriptor3.name("z"); + descriptor3.offset(8); + descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor3.count(1); + sensor_msgs::msg::PointField descriptor4; + descriptor4.name("intensity"); + descriptor4.offset(12); + descriptor4.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor4.count(1); + + return {descriptor1, descriptor2, descriptor3, descriptor4}; +} + +void UeLidarPublisher::SetPointCloudDataFromBuffer(std::shared_ptr header_view, + std::vector data_vector_view) { + DEBUG_ASSERT_EQ(header_view->GetChannelCount(), 4); + DEBUG_ASSERT_EQ(sizeof(LidarDetection), 4 * sizeof(float)); + + _point_cloud->Message().data().resize(data_vector_view.size() * sizeof(LidarDetection) / sizeof(uint8_t)); + auto point_clound_data_iter = reinterpret_cast(_point_cloud->Message().data().data()); + for (auto const &data_view : data_vector_view) { + LidarDetection ros_data(CoordinateSystemTransform::TransformLinearAxixVector3D(data_view.point), + data_view.intensity); + *point_clound_data_iter = ros_data; + ++point_clound_data_iter; + } +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeLidarPublisher.h b/LibCarla/source/carla/ros2/publishers/UeLidarPublisher.h new file mode 100644 index 00000000000..955470afdcf --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeLidarPublisher.h @@ -0,0 +1,29 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBasePointCloud.h" +#include "carla/sensor/s11n/LidarSerializer.h" + +namespace carla { +namespace ros2 { + +class UeLidarPublisher + : public UePublisherBasePointCloud { +public: + UeLidarPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeLidarPublisher() = default; + +protected: + using LidarDetection = DataType; + + std::vector GetPointFields() const override; + + void SetPointCloudDataFromBuffer(std::shared_ptr header_view, + std::vector vector_view) override; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeNormalsCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeNormalsCameraPublisher.cpp new file mode 100644 index 00000000000..2d991d0292c --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeNormalsCameraPublisher.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeNormalsCameraPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeNormalsCameraPublisher::UeNormalsCameraPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseCamera(sensor_actor_definition, transform_publisher) {} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeNormalsCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeNormalsCameraPublisher.h new file mode 100644 index 00000000000..a3154f28c9c --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeNormalsCameraPublisher.h @@ -0,0 +1,24 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/publishers/UePublisherBaseCamera.h" +#include "sensor_msgs/msg/CameraInfoPubSubTypes.h" +#include "sensor_msgs/msg/ImagePubSubTypes.h" + +namespace carla { +namespace ros2 { + +class UeNormalsCameraPublisher : public UePublisherBaseCamera { +public: + UeNormalsCameraPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeNormalsCameraPublisher() = default; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeOpticalFlowCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeOpticalFlowCameraPublisher.cpp new file mode 100644 index 00000000000..00a54be2860 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeOpticalFlowCameraPublisher.cpp @@ -0,0 +1,110 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeOpticalFlowCameraPublisher.h" + +#include + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +template +T CLAMP(const T& value, const T& low, const T& high) { + return value < low ? low : (value > high ? high : value); +} + +namespace carla { +namespace ros2 { + +UeOpticalFlowCameraPublisher::UeOpticalFlowCameraPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseCamera(sensor_actor_definition, transform_publisher) {} + +void UeOpticalFlowCameraPublisher::SetImageDataFromBuffer(const carla::SharedBufferView buffer_view) { + constexpr float pi = 3.1415f; + constexpr float rad2ang = 360.0f / (2.0f * pi); + auto data = carla::sensor::data::buffer_data_accessed_by_vector( + buffer_view, carla::sensor::s11n::ImageSerializer::header_offset); + + std::vector image_data(image_size()); + size_t data_index = 0; + for (size_t index = 0; index < data.size() && data_index < image_data.size() - 4; index += 2) { + const float vx = data[index]; + const float vy = data[index + 1]; + float angle = 180.0f + std::atan2(vy, vx) * rad2ang; + if (angle < 0) { + angle = 360.0f + angle; + } + angle = std::fmod(angle, 360.0f); + + const float norm = std::sqrt(vx * vx + vy * vy); + const float shift = 0.999f; + const float a = 1.0f / std::log(0.1f + shift); + const float intensity = CLAMP(a * std::log(norm + shift), 0.0f, 1.0f); + + const float& H = angle; + const float S = 1.0f; + const float V = intensity; + const float H_60 = H * (1.0f / 60.0f); + + const float C = V * S; + const float X = C * (1.0f - std::abs(std::fmod(H_60, 2.0f) - 1.0f)); + const float m = V - C; + + float r = 0; + float g = 0; + float b = 0; + const unsigned int angle_case = static_cast(H_60); + switch (angle_case) { + case 0: + r = C; + g = X; + b = 0; + break; + case 1: + r = X; + g = C; + b = 0; + break; + case 2: + r = 0; + g = C; + b = X; + break; + case 3: + r = 0; + g = X; + b = C; + break; + case 4: + r = X; + g = 0; + b = C; + break; + case 5: + r = C; + g = 0; + b = X; + break; + default: + r = 1; + g = 1; + b = 1; + break; + } + + const uint8_t R = static_cast((r + m) * 255.0f); + const uint8_t G = static_cast((g + m) * 255.0f); + const uint8_t B = static_cast((b + m) * 255.0f); + + image_data[data_index++] = B; + image_data[data_index++] = G; + image_data[data_index++] = R; + image_data[data_index++] = 0; + } + DEBUG_ASSERT_EQ(data_index, image_data.size()); + _image->Message().data(std::move(image_data)); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeOpticalFlowCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeOpticalFlowCameraPublisher.h new file mode 100644 index 00000000000..76a1dc25aad --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeOpticalFlowCameraPublisher.h @@ -0,0 +1,25 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBaseCamera.h" + +namespace carla { +namespace ros2 { + +class UeOpticalFlowCameraPublisher : public UePublisherBaseCamera { +public: + UeOpticalFlowCameraPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeOpticalFlowCameraPublisher() = default; + +protected: + /** + * Overrides UePublisherBaseCamera::SetImageDataFromBuffer() + */ + void SetImageDataFromBuffer(const carla::SharedBufferView buffer_view) override; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc new file mode 100644 index 00000000000..de9e5653765 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc @@ -0,0 +1,96 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/publishers/UePublisherBaseCamera.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/sensor/s11n/ImageSerializer.h" + +namespace carla { +namespace ros2 { + +template +UePublisherBaseCamera::UePublisherBaseCamera( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + _image(std::make_shared >()), + _camera_info(std::make_shared()) {} + +template +bool UePublisherBaseCamera::Init(std::shared_ptr domain_participant) { + return _image->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name("image"), + get_topic_qos()) && + // camera info uses standard publisher qos + _camera_info->Init(domain_participant, get_topic_name("camera_info"), PublisherBase::get_topic_qos()); +} + +template +bool UePublisherBaseCamera::Publish() { + return _camera_info_initialized && _image->Publish() && _camera_info->Publish(); +} + +template +bool UePublisherBaseCamera::SubscribersConnected() const { + return _image->SubscribersConnected() || _camera_info->SubscribersConnected(); +} + +template +void UePublisherBaseCamera::UpdateCameraInfo(const builtin_interfaces::msg::Time &stamp, + sensor_msgs::msg::CameraInfo const &camera_info) { + _camera_info->SetMessageHeader(stamp, frame_id()); + _camera_info->Message() = camera_info; + _camera_info->Message().roi().x_offset(0); // up-to-data: constantly 0 + _camera_info->Message().roi().y_offset(0); // up-to-data: constantly 0 + _camera_info->Message().roi().height(camera_info.height()); + _camera_info->Message().roi().width(camera_info.width()); + _camera_info->Message().roi().do_rectify(true); // up-to-data: constantly true + _camera_info_initialized = true; +} + +template +void UePublisherBaseCamera::UpdateImageHeader(const builtin_interfaces::msg::Time &stamp, + sensor_msgs::msg::CameraInfo const &camera_info) { + // Handle image data + _image->SetMessageHeader(stamp, frame_id()); + _image->Message().width(camera_info.width()); + _image->Message().height(camera_info.height()); + _image->Message().encoding(encoding_as_string()); + _image->Message().is_bigendian(0); + _image->Message().step(line_stride()); +} + +template +void UePublisherBaseCamera::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + auto header_view = UePublisherBaseCamera::header_view(buffer_view); + if (!header_view) { + return; + } + + const sensor_msgs::msg::CameraInfo camera_info(header_view->height, header_view->width, header_view->fov_angle); + auto const stamp = GetTime(sensor_header); + UpdateCameraInfo(stamp, camera_info); + UpdateImageHeader(stamp, _camera_info->Message()); + + SetImageDataFromBuffer(buffer_view); +} + +template +void UePublisherBaseCamera::SetImageDataFromBuffer(const carla::SharedBufferView buffer_view) { + _image->Message().data(buffer_data_2_vector(buffer_view)); +} + +template +uint32_t UePublisherBaseCamera::width() const { + return _image->Message().width(); +} + +template +uint32_t UePublisherBaseCamera::height() const { + return _image->Message().height(); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h new file mode 100644 index 00000000000..aa4de97e840 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h @@ -0,0 +1,210 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/Exception.h" +#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/sensor/s11n/ImageSerializer.h" +#include "sensor_msgs/msg/CameraInfoPubSubTypes.h" +#include "sensor_msgs/msg/ImagePubSubTypes.h" + +namespace carla { +namespace ros2 { + +template +using UeImagePublisherImpl = + DdsPublisherImpl, sensor_msgs::msg::ImagePubSubTypeT>; +using UeCameraInfoPublisherImpl = + DdsPublisherImpl; + +/** +A Publisher base class for camera sensors. +Extends UePublisherBaseSensor by an image and camera_info publisher providing default implemenations for sending the +camera data from the rendering buffer copyless via DDS +*/ +template +class UePublisherBaseCamera : public UePublisherBaseSensor { +public: + using allocator_type = ALLOCATOR; + + UePublisherBaseCamera(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UePublisherBaseCamera() = default; + + /** + * Some Encodings from + * https://github.com/ros/common_msgs/blob/846bfcb/sensor_msgs/include/sensor_msgs/image_encodings.h Extend this list + * (and the corresponding implementations of to_string(), num_channels(), bit_depth() + */ + enum class Encoding { RGB8, RGBA8, RGB16, RGBA16, BGR8, BGRA8, BGR16, BGRA16, MONO8, MONO16 }; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Implements UePublisherBaseSensor::UpdateSensorData() interface + */ + void UpdateSensorData(std::shared_ptr sensor_header, + const carla::SharedBufferView buffer_view) override; + +protected: + void UpdateCameraInfo(const builtin_interfaces::msg::Time &stamp, sensor_msgs::msg::CameraInfo const &camera_info); + void UpdateImageHeader(const builtin_interfaces::msg::Time &stamp, sensor_msgs::msg::CameraInfo const &camera_info); + + virtual void SetImageDataFromBuffer(const carla::SharedBufferView buffer_view); + + /** + * encoding of the stream, defaults to Encoding::BGRA8 + */ + virtual Encoding encoding() const { + return Encoding::BGRA8; + } + + using ImageHeaderConst = carla::sensor::s11n::ImageSerializer::ImageHeader const; + + /** + * @brief provides access to the image header stored at the start of the buffer + */ + std::shared_ptr header_view(const carla::SharedBufferView buffer_view) { + return std::shared_ptr(buffer_view, + reinterpret_cast(buffer_view.get()->data())); + } + + /** + * @brief calculates the number of elements of the buffer view by reducing the buffer size by the + * carla::sensor::s11n::ImageSerializer::header_offset and division by sizeof(T) + */ + template + std::size_t number_of_elements(const carla::SharedBufferView buffer_view) const { + return carla::sensor::data::number_of_elements(buffer_view, carla::sensor::s11n::ImageSerializer::header_offset); + } + + /** + * @brief the vector creation method matching the ALLOCATOR type of this class + * + * This function is called for sensor_msgs::msg::Image types + */ + template ::value, bool> = true > + std::vector buffer_data_2_vector(const carla::SharedBufferView buffer_view) const { + return carla::sensor::data::buffer_data_copy_to_std_vector(buffer_view, + carla::sensor::s11n::ImageSerializer::header_offset); + } + + /** + * @brief the vector creation method matching the ALLOCATOR type of this class + * + * This function is called for sensor_msgs::msg::ImageFromBuffer types + */ + template ::value, bool> = true > + std::vector> buffer_data_2_vector( + const carla::SharedBufferView buffer_view) const { + return carla::sensor::data::buffer_data_accessed_by_vector(buffer_view, + carla::sensor::s11n::ImageSerializer::header_offset); + } + + std::string encoding_as_string() const { + switch (encoding()) { + case UePublisherBaseCamera::Encoding::RGB8: + return "rgb8"; + case UePublisherBaseCamera::Encoding::RGBA8: + return "rgba8"; + case UePublisherBaseCamera::Encoding::RGB16: + return "rgb16"; + case UePublisherBaseCamera::Encoding::RGBA16: + return "rgba16"; + case UePublisherBaseCamera::Encoding::BGR8: + return "bgr8"; + case UePublisherBaseCamera::Encoding::BGRA8: + return "bgra8"; + case UePublisherBaseCamera::Encoding::BGR16: + return "bgr16"; + case UePublisherBaseCamera::Encoding::BGRA16: + return "bgra16"; + case UePublisherBaseCamera::Encoding::MONO8: + return "mono8"; + case UePublisherBaseCamera::Encoding::MONO16: + return "mono16"; + default: + carla::throw_exception(std::invalid_argument("UePublisherBaseCamera::to_string encoding " + + std::to_string(int(encoding())) + " not found")); + } + } + + uint32_t num_channels() const { + switch (encoding()) { + case UePublisherBaseCamera::Encoding::MONO8: + case UePublisherBaseCamera::Encoding::MONO16: + return 1u; + case UePublisherBaseCamera::Encoding::RGB8: + case UePublisherBaseCamera::Encoding::BGR8: + case UePublisherBaseCamera::Encoding::RGB16: + case UePublisherBaseCamera::Encoding::BGR16: + return 3u; + case UePublisherBaseCamera::Encoding::RGBA8: + case UePublisherBaseCamera::Encoding::BGRA8: + case UePublisherBaseCamera::Encoding::RGBA16: + case UePublisherBaseCamera::Encoding::BGRA16: + return 4u; + default: + carla::throw_exception(std::invalid_argument("UePublisherBaseCamera::pixel_size_in_byte encoding " + + std::to_string(int(encoding())) + " not found")); + } + } + + uint32_t bit_depth() const { + switch (encoding()) { + case UePublisherBaseCamera::Encoding::RGB8: + case UePublisherBaseCamera::Encoding::RGBA8: + case UePublisherBaseCamera::Encoding::BGR8: + case UePublisherBaseCamera::Encoding::BGRA8: + case UePublisherBaseCamera::Encoding::MONO8: + return 1u; + case UePublisherBaseCamera::Encoding::RGB16: + case UePublisherBaseCamera::Encoding::RGBA16: + case UePublisherBaseCamera::Encoding::BGR16: + case UePublisherBaseCamera::Encoding::BGRA16: + case UePublisherBaseCamera::Encoding::MONO16: + return 2u; + default: + carla::throw_exception(std::invalid_argument("UePublisherBaseCamera::pixel_size_in_byte encoding " + + std::to_string(int(encoding())) + " not found")); + } + } + + uint32_t pixel_stride() const { + return bit_depth() * num_channels(); + } + + uint32_t line_stride() const { + return bit_depth() * num_channels() * width(); + } + + uint32_t image_size() const { + return line_stride() * height(); + } + uint32_t width() const; + uint32_t height() const; + + std::shared_ptr> _image; + std::shared_ptr _camera_info; + bool _camera_info_initialized{false}; +}; +} // namespace ros2 +} // namespace carla + +#include "UePublisherBaseCamera.cc" diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.cc b/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.cc new file mode 100644 index 00000000000..9661b21b899 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.cc @@ -0,0 +1,55 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/publishers/UePublisherBasePointCloud.h" +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +template +UePublisherBasePointCloud::UePublisherBasePointCloud( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + _point_cloud(std::make_shared()) {} + +template +bool UePublisherBasePointCloud::Init( + std::shared_ptr domain_participant) { + return _point_cloud->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), + get_topic_qos()); +} + +template +bool UePublisherBasePointCloud::Publish() { + return _point_cloud->Publish(); +} + +template +bool UePublisherBasePointCloud::SubscribersConnected() const { + return _point_cloud->SubscribersConnected(); +} + +template +void UePublisherBasePointCloud::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + auto header_view = this->header_view(buffer_view); + auto data_vector_view = this->vector_view(buffer_view); + + _point_cloud->SetMessageHeader(GetTime(sensor_header), frame_id()); + const uint32_t point_size = static_cast(GetMessagePointSize()); + _point_cloud->Message().width(1); + _point_cloud->Message().height(uint32_t(data_vector_view.size())); + _point_cloud->Message().is_bigendian(false); + _point_cloud->Message().fields(GetPointFields()); + _point_cloud->Message().point_step(point_size); + _point_cloud->Message().row_step(_point_cloud->Message().width() * point_size); + _point_cloud->Message().is_dense(false); // True if there are not invalid points + + SetPointCloudDataFromBuffer(header_view, data_vector_view); +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.h b/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.h new file mode 100644 index 00000000000..7195e16e39d --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.h @@ -0,0 +1,74 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "sensor_msgs/msg/PointCloud2PubSubTypes.h" + +namespace carla { +namespace ros2 { + +using UePublisherPointCloudImpl = + DdsPublisherImpl; + +/** + A Publisher base class for point cloud publisher sensors. + Extends UePublisherBaseSensor by an point cloud publisher. +*/ +template +class UePublisherBasePointCloud : public UePublisherBaseSensor { +public: + UePublisherBasePointCloud(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UePublisherBasePointCloud() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Implements UePublisherBaseSensor::UpdateSensorData() interface + */ + void UpdateSensorData(std::shared_ptr sensor_header, + const carla::SharedBufferView buffer_view) override; + +protected: + using DataType = DATA_TYPE; + using HeaderTypeConst = HEADER_TYPE const; + using DataVectorAllocator = carla::sensor::data::SerializerVectorAllocator; + + std::shared_ptr header_view(const carla::SharedBufferView buffer_view) const { + return std::shared_ptr( + buffer_view, new HeaderTypeConst(reinterpret_cast(buffer_view.get()->data()))); + } + + std::vector vector_view(const carla::SharedBufferView buffer_view) const { + auto header_view = UePublisherBasePointCloud::header_view(buffer_view); + auto const header_offset = header_view->GetHeaderOffset(); + return carla::sensor::data::buffer_data_accessed_by_vector(buffer_view, header_offset); + } + + virtual std::vector GetPointFields() const = 0; + virtual size_t GetMessagePointSize() const { return sizeof(DataType); } + + virtual void SetPointCloudDataFromBuffer(std::shared_ptr header_view, + std::vector vector_view) = 0; + + std::shared_ptr _point_cloud; +}; +} // namespace ros2 +} // namespace carla + +#include "UePublisherBasePointCloud.cc" \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h b/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h new file mode 100644 index 00000000000..affd975d63c --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h @@ -0,0 +1,49 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBaseTransform.h" +#include "carla/rpc/ActorId.h" + +namespace carla { +namespace ros2 { + +/** + A Publisher base class for sensors receiving their data directly from UE4 via buffers. + Extends PublisherBaseTransform by UpdateSensorData() function. + */ +class UePublisherBaseSensor : public PublisherBaseTransform { +public: + UePublisherBaseSensor(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : PublisherBaseTransform(sensor_actor_definition, transform_publisher) {} + virtual ~UePublisherBaseSensor() = default; + + /** + * Implement actions before sensor data updates + */ + virtual void UpdateSensorDataPreAction() {}; + /** + * Function to update the data for this sensor + */ + virtual void UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) = 0; + /** + * Implement actions after sensor data updates + */ + virtual void UpdateSensorDataPostAction() {}; + + builtin_interfaces::msg::Time GetTime( + std::shared_ptr sensor_header) const { + return carla::ros2::types::Timestamp(sensor_header->timestamp).time(); + } + + std::shared_ptr GetSensorActorDefinition() const { + return std::static_pointer_cast(_actor_name_definition); + } +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.cpp new file mode 100644 index 00000000000..da61449a45d --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.cpp @@ -0,0 +1,39 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeRGBCameraPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeRGBCameraPublisher::UeRGBCameraPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher, + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback) + : UePublisherBaseCamera(sensor_actor_definition, transform_publisher) + , actor_set_transform_subscriber(std::make_shared( + *this, actor_set_transform_callback)) + {} + +bool UeRGBCameraPublisher::Init(std::shared_ptr domain_participant) { + _initialized = UePublisherBaseCamera::Init(domain_participant); + _initialized &= actor_set_transform_subscriber->Init(domain_participant); + return _initialized; +} + +void UeRGBCameraPublisher::UpdateSensorDataPreAction() { + if (!_initialized) { + return; + } + actor_set_transform_subscriber->ProcessMessages(); +} + + + + + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.h new file mode 100644 index 00000000000..079785b7b8e --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.h @@ -0,0 +1,38 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBaseCamera.h" +#include "carla/ros2/subscribers/ActorSetTransformSubscriber.h" +#include "carla/ros2/types/SensorActorDefinition.h" +#include "sensor_msgs/msg/CameraInfoPubSubTypes.h" +#include "sensor_msgs/msg/ImagePubSubTypes.h" + +namespace carla { +namespace ros2 { + +class UeRGBCameraPublisher : public UePublisherBaseCamera { +public: + UeRGBCameraPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher, + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback); + virtual ~UeRGBCameraPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement UePublisherBaseSensor::UpdateSensorDataPreAction() + */ + void UpdateSensorDataPreAction() override; + +private: + std::shared_ptr actor_set_transform_subscriber; + bool _initialized{false}; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.cpp new file mode 100644 index 00000000000..1697fe09785 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.cpp @@ -0,0 +1,84 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeRadarPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/sensor/data/RadarData.h" + +namespace carla { +namespace ros2 { + + struct RadarDetectionWithPosition { + float x; + float y; + float z; + carla::sensor::data::RadarDetection detection; + }; + + + +UeRadarPublisher::UeRadarPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBasePointCloud(sensor_actor_definition, transform_publisher) {} + +std::vector UeRadarPublisher::GetPointFields() const { + sensor_msgs::msg::PointField descriptor1; + descriptor1.name("x"); + descriptor1.offset(0); + descriptor1.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor1.count(1); + sensor_msgs::msg::PointField descriptor2; + descriptor2.name("y"); + descriptor2.offset(4); + descriptor2.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor2.count(1); + sensor_msgs::msg::PointField descriptor3; + descriptor3.name("z"); + descriptor3.offset(8); + descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor3.count(1); + sensor_msgs::msg::PointField descriptor4; + descriptor4.name("velocity"); + descriptor4.offset(12); + descriptor4.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor4.count(1); + sensor_msgs::msg::PointField descriptor5; + descriptor5.name("azimuth"); + descriptor5.offset(16); + descriptor5.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor5.count(1); + sensor_msgs::msg::PointField descriptor6; + descriptor6.name("altitude"); + descriptor6.offset(20); + descriptor6.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor6.count(1); + sensor_msgs::msg::PointField descriptor7; + descriptor7.name("depth"); + descriptor7.offset(24); + descriptor7.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor7.count(1); + return {descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7}; +} + +size_t UeRadarPublisher::GetMessagePointSize() const { + return sizeof(RadarDetectionWithPosition); +} + +void UeRadarPublisher::SetPointCloudDataFromBuffer(std::shared_ptr, + std::vector data_vector_view) { + _point_cloud->Message().data().resize(data_vector_view.size() * sizeof(RadarDetectionWithPosition) / sizeof(uint8_t)); + auto point_clound_data_iter = reinterpret_cast(_point_cloud->Message().data().data()); + for (auto const &data_view : data_vector_view) { + RadarDetectionWithPosition ros_data; + ros_data.x = data_view.depth * cosf(data_view.azimuth) * cosf(-data_view.altitude); + ros_data.y = data_view.depth * sinf(-data_view.azimuth) * cosf(data_view.altitude); + ros_data.z = data_view.depth * sinf(data_view.altitude); + ros_data.detection = data_view; + *point_clound_data_iter = ros_data; + ++point_clound_data_iter; + } +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.h b/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.h new file mode 100644 index 00000000000..2248e3a2559 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.h @@ -0,0 +1,51 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBasePointCloud.h" +#include "carla/sensor/s11n/RadarSerializer.h" + +namespace carla { +namespace ros2 { + +/// A view over the header of a Lidar measurement. +class RadarDummyHeaderView { +public: + size_t GetHeaderOffset() const { + return 0u; + } + float GetHorizontalAngle() const { + return 0.f; + } + uint32_t GetChannelCount() const { + return 0u; + } + + uint32_t GetPointCount(size_t) const { + return 0u; + } + + size_t GetDataSize() const { + return 0u; + } + + RadarDummyHeaderView(const uint32_t *) {} +}; + +class UeRadarPublisher : public UePublisherBasePointCloud { +public: + UeRadarPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeRadarPublisher() = default; + +protected: + std::vector GetPointFields() const override; + size_t GetMessagePointSize() const override; + + void SetPointCloudDataFromBuffer(std::shared_ptr header_view, + std::vector vector_view) override; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeSSCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeSSCameraPublisher.cpp new file mode 100644 index 00000000000..98590d33682 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeSSCameraPublisher.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeSSCameraPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeSSCameraPublisher::UeSSCameraPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseCamera(sensor_actor_definition, transform_publisher) {} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeSSCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeSSCameraPublisher.h new file mode 100644 index 00000000000..b7d76c5505a --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeSSCameraPublisher.h @@ -0,0 +1,21 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBaseCamera.h" +#include "sensor_msgs/msg/CameraInfoPubSubTypes.h" +#include "sensor_msgs/msg/ImagePubSubTypes.h" + +namespace carla { +namespace ros2 { + +class UeSSCameraPublisher : public UePublisherBaseCamera { +public: + UeSSCameraPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeSSCameraPublisher() = default; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/CarlaSemanticLidarPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.cpp similarity index 51% rename from LibCarla/source/carla/ros2/publishers/CarlaSemanticLidarPublisher.cpp rename to LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.cpp index 256f3d8171a..f017ed2d5d4 100644 --- a/LibCarla/source/carla/ros2/publishers/CarlaSemanticLidarPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.cpp @@ -2,49 +2,45 @@ // This work is licensed under the terms of the MIT license. // For a copy, see . -#include "CarlaSemanticLidarPublisher.h" +#include "UeSemanticLidarPublisher.h" -#include "carla/sensor/data/SemanticLidarData.h" +#include "carla/Debug.h" +#include "carla/ros2/impl/DdsPublisherImpl.h" namespace carla { namespace ros2 { -const size_t CarlaSemanticLidarPublisher::GetPointSize() { - return sizeof(sensor::data::SemanticLidarDetection); -} - -std::vector CarlaSemanticLidarPublisher::GetFields() { +UeSemanticLidarPublisher::UeSemanticLidarPublisher( + std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBasePointCloud(sensor_actor_definition, transform_publisher) {} +std::vector UeSemanticLidarPublisher::GetPointFields() const { sensor_msgs::msg::PointField descriptor1; descriptor1.name("x"); descriptor1.offset(0); descriptor1.datatype(sensor_msgs::msg::PointField__FLOAT32); descriptor1.count(1); - sensor_msgs::msg::PointField descriptor2; descriptor2.name("y"); descriptor2.offset(4); descriptor2.datatype(sensor_msgs::msg::PointField__FLOAT32); descriptor2.count(1); - sensor_msgs::msg::PointField descriptor3; descriptor3.name("z"); descriptor3.offset(8); descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT32); descriptor3.count(1); - sensor_msgs::msg::PointField descriptor4; descriptor4.name("cos_inc_angle"); descriptor4.offset(12); descriptor4.datatype(sensor_msgs::msg::PointField__FLOAT32); descriptor4.count(1); - sensor_msgs::msg::PointField descriptor5; descriptor5.name("object_idx"); descriptor5.offset(16); descriptor5.datatype(sensor_msgs::msg::PointField__UINT32); descriptor5.count(1); - sensor_msgs::msg::PointField descriptor6; descriptor6.name("object_tag"); descriptor6.offset(20); @@ -54,20 +50,19 @@ std::vector CarlaSemanticLidarPublisher::GetFields return {descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6}; } -std::vector CarlaSemanticLidarPublisher::ComputePointCloud(uint32_t height, uint32_t width, uint8_t *data) { - - sensor::data::SemanticLidarDetection* detections = reinterpret_cast(data); - - const size_t total_points = height * width; - for (size_t i = 0; i < total_points; ++i) { - detections[i].point.y *= -1.0f; +void UeSemanticLidarPublisher::SetPointCloudDataFromBuffer(std::shared_ptr header_view, + std::vector vector_view) { + DEBUG_ASSERT_EQ(header_view->GetChannelCount(), 6); + DEBUG_ASSERT_EQ(sizeof(SemanticLidarDetection), 4 * sizeof(float) + 2 * sizeof(uint32_t)); + + _point_cloud->Message().data().resize(vector_view.size() * sizeof(SemanticLidarDetection) / sizeof(uint8_t)); + auto point_clound_data_iter = reinterpret_cast(_point_cloud->Message().data().data()); + for (auto const &data_view : vector_view) { + SemanticLidarDetection ros_data(CoordinateSystemTransform::TransformLinearAxixVector3D(data_view.point), + data_view.cos_inc_angle, data_view.object_idx, data_view.object_tag); + *point_clound_data_iter = ros_data; + ++point_clound_data_iter; } - - const size_t total_bytes = total_points * sizeof(sensor::data::SemanticLidarDetection); - std::vector vector_data(reinterpret_cast(detections), - reinterpret_cast(detections) + total_bytes); - return vector_data; } - } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.h b/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.h new file mode 100644 index 00000000000..b8ac5c465dd --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.h @@ -0,0 +1,28 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/UePublisherBasePointCloud.h" +#include "carla/sensor/s11n/SemanticLidarSerializer.h" + +namespace carla { +namespace ros2 { + +class UeSemanticLidarPublisher : public UePublisherBasePointCloud { +public: + UeSemanticLidarPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeSemanticLidarPublisher() = default; + +protected: + using SemanticLidarDetection = DataType; + std::vector GetPointFields() const override; + + void SetPointCloudDataFromBuffer(std::shared_ptr header_view, + std::vector vector_view) override; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.cpp new file mode 100644 index 00000000000..b25f8ea1d76 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.cpp @@ -0,0 +1,64 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeV2XCustomPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeV2XCustomPublisher::UeV2XCustomPublisher(std::shared_ptr sensor_actor_definition, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback, + std::shared_ptr transform_publisher) + : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + _subscriber(std::make_shared(*this, v2x_custom_send_callback)), + _impl(std::make_shared()) {} + +bool UeV2XCustomPublisher::Init(std::shared_ptr domain_participant) { + _initialized = _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos().reliable()) && _subscriber->Init(domain_participant); + return _initialized; +} + +bool UeV2XCustomPublisher::Publish() { + auto const success = _impl->Publish(); + // clear old data after publishing + _impl->Message().data().clear(); + return success; +} +bool UeV2XCustomPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void UeV2XCustomPublisher::UpdateSensorDataPreAction() +{ + if (!_initialized) { + return; + } + _subscriber->ProcessMessages(); +} + +void UeV2XCustomPublisher::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + + auto custom_v2x_data_vector = vector_view(buffer_view); + + for (carla::sensor::data::CustomV2XData const &custom_v2x_data: custom_v2x_data_vector) { + carla_msgs::msg::CarlaV2XCustomData carla_v2x_custom_data; + carla_v2x_custom_data.power(custom_v2x_data.Power); + carla_msgs::msg::CarlaV2XCustomMessage carla_v2x_custom_message; + carla_v2x_custom_message.header().protocol_version() = custom_v2x_data.Message.header.protocolVersion; + carla_v2x_custom_message.header().message_id() = custom_v2x_data.Message.header.messageID; + carla_v2x_custom_message.header().station_id().value() = custom_v2x_data.Message.header.stationID; + carla_v2x_custom_message.data().data_size() = custom_v2x_data.Message.data.data_size; + carla_v2x_custom_message.data().bytes() = custom_v2x_data.Message.data.bytes; + carla_v2x_custom_data.message() = carla_v2x_custom_message; + _impl->Message().data().push_back(carla_v2x_custom_data); + } + _impl->SetMessageUpdated(); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.h b/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.h new file mode 100644 index 00000000000..71679588ddb --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.h @@ -0,0 +1,65 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/subscribers/UeV2XCustomSubscriber.h" +#include "carla/sensor/data/V2XEvent.h" +#include "carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using UeV2XCustomPublisherImpl = DdsPublisherImpl; + +class UeV2XCustomPublisher : public UePublisherBaseSensor { +public: + UeV2XCustomPublisher(std::shared_ptr sensor_actor_definition, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback, + std::shared_ptr transform_publisher); + virtual ~UeV2XCustomPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Implement UePublisherBaseSensor::UpdateSensorDataPreAction() + */ + void UpdateSensorDataPreAction() override; + /** + * Implements UePublisherBaseSensor::UpdateSensorData() interface + */ + void UpdateSensorData(std::shared_ptr sensor_header, + const carla::SharedBufferView buffer_view) override; + +private: + using CustomV2XData = carla::sensor::data::CustomV2XData; + using CustomV2XDataVectorAllocator = carla::sensor::data::SerializerVectorAllocator; + + std::vector vector_view(const carla::SharedBufferView buffer_view) { + return carla::sensor::data::buffer_data_accessed_by_vector( + buffer_view, 0); + } + + + bool _initialized{false}; + std::shared_ptr _subscriber; + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.cpp new file mode 100644 index 00000000000..8888edb2583 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.cpp @@ -0,0 +1,158 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeV2XPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +UeV2XPublisher::UeV2XPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher) + : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + _impl(std::make_shared()) {} + +bool UeV2XPublisher::Init(std::shared_ptr domain_participant) { + _initialized = _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos().reliable()); + return _initialized; +} + +bool UeV2XPublisher::Publish() { + auto const success = _impl->Publish(); + // clear old data after publishing + _impl->Message().data().clear(); + return success; +} +bool UeV2XPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +void UeV2XPublisher::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + + auto cam_v2x_data_vector = vector_view(buffer_view); + + for (carla::sensor::data::CAMData const &cam_v2x_data: cam_v2x_data_vector) { + // General data and header + carla_msgs::msg::CarlaV2XData carla_v2x_data; + carla_v2x_data.power(cam_v2x_data.Power); + carla_v2x_data.message().header().protocol_version() = cam_v2x_data.Message.header.protocolVersion; + carla_v2x_data.message().header().message_id() = cam_v2x_data.Message.header.messageID; + carla_v2x_data.message().header().station_id().value() = cam_v2x_data.Message.header.stationID; + carla_v2x_data.message().cam().generation_delta_time().value() = cam_v2x_data.Message.cam.generationDeltaTime; + + // BasicContainer + carla_v2x_data.message().cam().cam_parameters().basic_container().reference_position().altitude().altitude_value().value() = cam_v2x_data.Message.cam.camParameters.basicContainer.referencePosition.altitude.altitudeValue; + carla_v2x_data.message().cam().cam_parameters().basic_container().reference_position().altitude().altitude_confidence().value() = cam_v2x_data.Message.cam.camParameters.basicContainer.referencePosition.altitude.altitudeConfidence; + carla_v2x_data.message().cam().cam_parameters().basic_container().reference_position().latitude().value() = cam_v2x_data.Message.cam.camParameters.basicContainer.referencePosition.latitude; + carla_v2x_data.message().cam().cam_parameters().basic_container().reference_position().longitude().value() = cam_v2x_data.Message.cam.camParameters.basicContainer.referencePosition.longitude; + carla_v2x_data.message().cam().cam_parameters().basic_container().reference_position().position_confidence_ellipse().semi_major_confidence().value() = cam_v2x_data.Message.cam.camParameters.basicContainer.referencePosition.positionConfidenceEllipse.semiMajorConfidence; + carla_v2x_data.message().cam().cam_parameters().basic_container().reference_position().position_confidence_ellipse().semi_major_orientation().value() = cam_v2x_data.Message.cam.camParameters.basicContainer.referencePosition.positionConfidenceEllipse.semiMajorOrientation; + carla_v2x_data.message().cam().cam_parameters().basic_container().reference_position().position_confidence_ellipse().semi_minor_confidence().value() = cam_v2x_data.Message.cam.camParameters.basicContainer.referencePosition.positionConfidenceEllipse.semiMinorConfidence; + carla_v2x_data.message().cam().cam_parameters().basic_container().station_type().value() = cam_v2x_data.Message.cam.camParameters.basicContainer.stationType; + + // HighFrequencyContainer + switch (cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.present) { + case CAMContainer::HighFrequencyContainer_PR::HighFrequencyContainer_PR_basicVehicleContainerHighFrequency: + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().choice() = etsi_its_cam_msgs::msg::HighFrequencyContainer_Constants::CHOICE_BASIC_VEHICLE_CONTAINER_HIGH_FREQUENCY; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().heading().heading_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.heading.headingValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().heading().heading_confidence().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.heading.headingConfidence; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().speed().speed_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.speed.speedValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().speed().speed_confidence().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.speed.speedConfidence; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().drive_direction().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.driveDirection; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().vehicle_length().vehicle_length_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.vehicleLength.vehicleLengthValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().vehicle_length().vehicle_length_confidence_indication().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.vehicleLength.vehicleLengthConfidenceIndication; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().vehicle_width().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.vehicleWidth; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().longitudinal_acceleration().longitudinal_acceleration_confidence().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.longitudinalAcceleration.longitudinalAccelerationConfidence; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().longitudinal_acceleration().longitudinal_acceleration_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.longitudinalAcceleration.longitudinalAccelerationValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().curvature().curvature_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.curvature.curvatureValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().curvature().curvature_confidence().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.curvature.curvatureConfidence; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().curvature_calculation_mode().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.curvatureCalculationMode; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().yaw_rate().yaw_rate_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.yawRate.yawRateValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().yaw_rate().yaw_rate_confidence().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.yawRate.yawRateConfidence; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().acceleration_control_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.accelerationControlAvailable; + // TODO: carla implemenation differs from CAM definition, since ASN.1 defines a list + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().acceleration_control().value().push_back(cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.accelerationControl); + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().lane_position_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.lanePositionAvailable; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().lane_position().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.lanePosition; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().steering_wheel_angle_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.steeringWheelAngleAvailable; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().steering_wheel_angle().steering_wheel_angle_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.steeringWheelAngle.steeringWheelAngleValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().steering_wheel_angle().steering_wheel_angle_confidence().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.steeringWheelAngle.steeringWheelAngleConfidence; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().lateral_acceleration_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.lateralAccelerationAvailable; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().lateral_acceleration().lateral_acceleration_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.lateralAcceleration.lateralAccelerationValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().lateral_acceleration().lateral_acceleration_confidence().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.lateralAcceleration.lateralAccelerationConfidence; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().vertical_acceleration_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.verticalAccelerationAvailable; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().vertical_acceleration().vertical_acceleration_value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.verticalAcceleration.verticalAccelerationValue; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().vertical_acceleration().vertical_acceleration_confidence().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.verticalAcceleration.verticalAccelerationConfidence; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().performance_class_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.performanceClassAvailable; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().performance_class().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.performanceClass; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().cen_dsrc_tolling_zone_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.cenDsrcTollingZoneAvailable; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().cen_dsrc_tolling_zone().cen_dsrc_tolling_zone_id_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.cenDsrcTollingZone.cenDsrcTollingZoneIDAvailable; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().cen_dsrc_tolling_zone().cen_dsrc_tolling_zone_id().value().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.cenDsrcTollingZone.cenDsrcTollingZoneID; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().cen_dsrc_tolling_zone().protected_zone_latitude().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.cenDsrcTollingZone.protectedZoneLatitude; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().basic_vehicle_container_high_frequency().cen_dsrc_tolling_zone().protected_zone_longitude().value() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.cenDsrcTollingZone.protectedZoneLongitude; + break; + case CAMContainer::HighFrequencyContainer_PR::HighFrequencyContainer_PR_rsuContainerHighFrequency: + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().choice() = etsi_its_cam_msgs::msg::HighFrequencyContainer_Constants::CHOICE_BASIC_VEHICLE_CONTAINER_HIGH_FREQUENCY; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().rsu_container_high_frequency().protected_communication_zones_rsu_is_present() = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.rsuContainerHighFrequency.protectedCommunicationZonesRSU.ProtectedCommunicationZoneCount > 0u; + for (auto i=0u; i< cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.rsuContainerHighFrequency.protectedCommunicationZonesRSU.ProtectedCommunicationZoneCount; ++i) { + auto const &protectedCommunicationZoneRSU = cam_v2x_data.Message.cam.camParameters.highFrequencyContainer.rsuContainerHighFrequency.protectedCommunicationZonesRSU.data[i]; + etsi_its_cam_msgs::msg::ProtectedCommunicationZone protectedCommunicationZone; + protectedCommunicationZone.expiry_time_is_present() = protectedCommunicationZoneRSU.expiryTimeAvailable; + protectedCommunicationZone.expiry_time().value() = protectedCommunicationZoneRSU.expiryTime; + protectedCommunicationZone.protected_zone_id_is_present() = protectedCommunicationZoneRSU.protectedZoneIDAvailable; + protectedCommunicationZone.protected_zone_id().value() = protectedCommunicationZoneRSU.protectedZoneID; + protectedCommunicationZone.protected_zone_latitude().value() = protectedCommunicationZoneRSU.protectedZoneLatitude; + protectedCommunicationZone.protected_zone_longitude().value() = protectedCommunicationZoneRSU.protectedZoneLongitude; + protectedCommunicationZone.protected_zone_radius_is_present() = protectedCommunicationZoneRSU.protectedZoneRadiusAvailable; + protectedCommunicationZone.protected_zone_radius().value() = protectedCommunicationZoneRSU.protectedZoneRadius; + protectedCommunicationZone.protected_zone_type().value() = protectedCommunicationZoneRSU.protectedZoneType; + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().rsu_container_high_frequency().protected_communication_zones_rsu().array().push_back(protectedCommunicationZone); + } + break; + case CAMContainer::HighFrequencyContainer_PR::HighFrequencyContainer_PR_NOTHING: + // theorectically must not happen, since in the protocol Nothing is not defined and is translated into high_fequency_container_is_present, which is also not defined by the actual protocol! + carla_v2x_data.message().cam().cam_parameters().high_frequency_container().choice() = etsi_its_cam_msgs::msg::HighFrequencyContainer_Constants::CHOICE_BASIC_VEHICLE_CONTAINER_HIGH_FREQUENCY; + break; + } + + // LowFrequencyContainer + switch (cam_v2x_data.Message.cam.camParameters.lowFrequencyContainer.present) { + case CAMContainer::LowFrequencyContainer_PR::LowFrequencyContainer_PR_NOTHING: + carla_v2x_data.message().cam().cam_parameters().low_frequency_container_is_present() = false; + break; + case CAMContainer::LowFrequencyContainer_PR::LowFrequencyContainer_PR_basicVehicleContainerLowFrequency: + carla_v2x_data.message().cam().cam_parameters().low_frequency_container_is_present() = true; + carla_v2x_data.message().cam().cam_parameters().low_frequency_container().choice() = etsi_its_cam_msgs::msg::LowFrequencyContainer_Constants::CHOICE_BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY; + // TODO: carla implemenation differs from CAM definition, since ASN.1 defines a list + carla_v2x_data.message().cam().cam_parameters().low_frequency_container().basic_vehicle_container_low_frequency().exterior_lights().value().push_back(cam_v2x_data.Message.cam.camParameters.lowFrequencyContainer.basicVehicleContainerLowFrequency.exteriorLights); + for (auto i=0u; i< cam_v2x_data.Message.cam.camParameters.lowFrequencyContainer.basicVehicleContainerLowFrequency.pathHistory.NumberOfPathPoint; ++i) { + auto const &pathPointCarla = cam_v2x_data.Message.cam.camParameters.lowFrequencyContainer.basicVehicleContainerLowFrequency.pathHistory.data[i]; + etsi_its_cam_msgs::msg::PathPoint pathPoint; + pathPoint.path_delta_time_is_present() = false; + if (pathPointCarla.pathDeltaTime != nullptr) { + pathPoint.path_delta_time_is_present() = true; + pathPoint.path_delta_time().value() = *pathPointCarla.pathDeltaTime; + } + pathPoint.path_position().delta_longitude().value() = pathPointCarla.pathPosition.deltaLongitude; + pathPoint.path_position().delta_latitude().value() = pathPointCarla.pathPosition.deltaLatitude; + pathPoint.path_position().delta_altitude().value() = pathPointCarla.pathPosition.deltaAltitude; + carla_v2x_data.message().cam().cam_parameters().low_frequency_container().basic_vehicle_container_low_frequency().path_history().array().push_back(pathPoint); + } + carla_v2x_data.message().cam().cam_parameters().low_frequency_container().basic_vehicle_container_low_frequency().vehicle_role().value() = cam_v2x_data.Message.cam.camParameters.lowFrequencyContainer.basicVehicleContainerLowFrequency.vehicleRole; + } + + // TODO: SpecialVehiclesContainer + carla_v2x_data.message().cam().cam_parameters().special_vehicle_container_is_present() = false; + + // Finally send out + _impl->Message().data().push_back(carla_v2x_data); + } + _impl->SetMessageUpdated(); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.h b/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.h new file mode 100644 index 00000000000..de511c3a4b3 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.h @@ -0,0 +1,58 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/sensor/data/V2XEvent.h" +#include "carla_msgs/msg/CarlaV2XDataListPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using UeV2XPublisherImpl = DdsPublisherImpl; + +class UeV2XPublisher : public UePublisherBaseSensor { +public: + UeV2XPublisher(std::shared_ptr sensor_actor_definition, + std::shared_ptr transform_publisher); + virtual ~UeV2XPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Implements UePublisherBaseSensor::UpdateSensorData() interface + */ + void UpdateSensorData(std::shared_ptr sensor_header, + const carla::SharedBufferView buffer_view) override; + +private: + using CAMData = carla::sensor::data::CAMData; + using CAMDataVectorAllocator = carla::sensor::data::SerializerVectorAllocator; + + std::vector vector_view(const carla::SharedBufferView buffer_view) { + return carla::sensor::data::buffer_data_accessed_by_vector( + buffer_view, 0); + } + + + bool _initialized{false}; + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp new file mode 100644 index 00000000000..76a59a3d3f0 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -0,0 +1,445 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "UeWorldPublisher.h" + +#include "carla/sensor/data/RawEpisodeState.h" +#include "carla/ros2/types/EpisodeSettings.h" + +namespace carla { +namespace ros2 { + +UeWorldPublisher::UeWorldPublisher(carla::rpc::RpcServerInterface& carla_server, + std::shared_ptr name_registry, + std::shared_ptr sensor_actor_definition) + : UePublisherBaseSensor(sensor_actor_definition, std::make_shared()), + _carla_server(carla_server), + _name_registry(name_registry), + _carla_status_publisher(std::make_shared()), + _carla_actor_list_publisher(std::make_shared("actor_list")), + _clock_publisher(std::make_shared()), + _map_publisher(std::make_shared()), + _objects_publisher(std::make_shared()), + _objects_with_covariance_publisher(std::make_shared()), + _traffic_lights_publisher(std::make_shared()), + _carla_control_subscriber(std::make_shared(*this, _carla_server)), + _sync_subscriber(std::make_shared(*this, _carla_server)) { +} + +bool UeWorldPublisher::Init(std::shared_ptr domain_participant) { + _domain_participant_impl = domain_participant; + _initialized = _carla_status_publisher->Init(domain_participant) && + _carla_actor_list_publisher->Init(domain_participant) && _clock_publisher->Init(domain_participant) && + _map_publisher->Init(domain_participant) && _objects_publisher->Init(domain_participant) && + _objects_with_covariance_publisher->Init(domain_participant) && _traffic_lights_publisher->Init(domain_participant) && + _transform_publisher->Init(domain_participant) && + _carla_control_subscriber->Init(domain_participant) && _sync_subscriber->Init(domain_participant); + return _initialized; +} + +bool UeWorldPublisher::Publish() { + if (!_initialized) { + return false; + } + return _clock_publisher->Publish() && _map_publisher->Publish(); +} + +void UeWorldPublisher::ProcessMessages() { + if (!_initialized) { + return; + } + + _carla_control_subscriber->ProcessMessages(); + _sync_subscriber->ProcessMessages(); + for (auto& vehicle : _vehicles) { + vehicle.second._vehicle_controller->ProcessMessages(); + vehicle.second._vehicle_ackermann_controller->ProcessMessages(); + vehicle.second._actor_set_transform_subscriber->ProcessMessages(); + } + for (auto& walker : _walkers) { + walker.second._walker_controller->ProcessMessages(); + } + + UpdateAndPublishStatus(); +} + +void UeWorldPublisher::UpdateSensorDataPostAction() { + if (!_initialized) { + return; + } + + UpdateAndPublishStatus(); + + _transform_publisher->Publish(); + _carla_actor_list_publisher->Publish(); + _objects_publisher->Publish(); + _objects_with_covariance_publisher->Publish(); + _traffic_lights_publisher->Publish(); +} + +void UeWorldPublisher::AddVehicleUe( + std::shared_ptr vehicle_actor_definition, + carla::ros2::types::VehicleControlCallback vehicle_control_callback, + carla::ros2::types::VehicleAckermannControlCallback vehicle_ackermann_control_callback, + carla::ros2::types::ActorSetTransformCallback vehicle_set_transform_callback) { + if (!_initialized) { + return; + } + + auto object = std::make_shared(vehicle_actor_definition); + auto object_result = _objects.insert({vehicle_actor_definition->id, object}); + if (!object_result.second) { + object_result.first->second = object; + } + _objects_changed = true; + + auto vehicle_publisher = + std::make_shared(vehicle_actor_definition, _transform_publisher, _objects_publisher, _objects_with_covariance_publisher); + UeVehicle ue_vehicle(vehicle_publisher); + ue_vehicle._vehicle_controller = + std::make_shared(*vehicle_publisher, std::move(vehicle_control_callback)); + ue_vehicle._vehicle_ackermann_controller = + std::make_shared(*vehicle_publisher, std::move(vehicle_ackermann_control_callback)); + ue_vehicle._actor_set_transform_subscriber = + std::make_shared(*vehicle_publisher, std::move(vehicle_set_transform_callback)); + + auto vehicle_result = _vehicles.insert({vehicle_actor_definition->id, ue_vehicle}); + if (!vehicle_result.second) { + vehicle_result.first->second = std::move(ue_vehicle); + } + vehicle_result.first->second.Init(_domain_participant_impl); +} + +void UeWorldPublisher::UeVehicle::Init(std::shared_ptr domain_participant) +{ + if ( _vehicle_publisher->is_enabled_for_ros() ) { + _vehicle_publisher->Init(domain_participant); + _vehicle_controller->Init(domain_participant); + _vehicle_ackermann_controller->Init(domain_participant); + _actor_set_transform_subscriber->Init(domain_participant); + } +} + +void UeWorldPublisher::AddWalkerUe(std::shared_ptr walker_actor_definition, + carla::ros2::types::WalkerControlCallback walker_control_callback) { + if (!_initialized) { + return; + } + auto object = std::make_shared(walker_actor_definition); + auto object_result = _objects.insert({walker_actor_definition->id, object}); + if (!object_result.second) { + object_result.first->second = object; + } + _objects_changed = true; + + auto walker_publisher = + std::make_shared(walker_actor_definition, _transform_publisher, _objects_publisher, _objects_with_covariance_publisher); + UeWalker ue_walker(walker_publisher); + ue_walker._walker_controller = + std::make_shared(*walker_publisher, std::move(walker_control_callback)); + + auto walker_result = _walkers.insert({walker_actor_definition->id, ue_walker}); + if (!walker_result.second) { + walker_result.first->second = std::move(ue_walker); + } + + walker_result.first->second.Init(_domain_participant_impl); +} + +void UeWorldPublisher::UeWalker::Init(std::shared_ptr domain_participant) +{ + if ( _walker_publisher->is_enabled_for_ros() ) { + _walker_publisher->Init(domain_participant); + _walker_controller->Init(domain_participant); + } +} + +void UeWorldPublisher::AddTrafficLightUe( + std::shared_ptr traffic_light_actor_definition) { + auto object = std::make_shared(traffic_light_actor_definition); + if (!_initialized) { + return; + } + auto object_result = _objects.insert({traffic_light_actor_definition->id, object}); + if (!object_result.second) { + object_result.first->second = object; + } + _objects_changed = true; + + auto traffic_light_publisher = std::make_shared(traffic_light_actor_definition, + _objects_publisher, _objects_with_covariance_publisher, _traffic_lights_publisher); + UeTrafficLight ue_traffic_light(traffic_light_publisher); + auto traffic_light_result = _traffic_lights.insert({traffic_light_actor_definition->id, ue_traffic_light}); + if (!traffic_light_result.second) { + traffic_light_result.first->second = std::move(ue_traffic_light); + } + + traffic_light_result.first->second.Init(_domain_participant_impl); +} + +void UeWorldPublisher::UeTrafficLight::Init(std::shared_ptr domain_participant) +{ + if ( _traffic_light_publisher->is_enabled_for_ros() ) { + _traffic_light_publisher->Init(domain_participant); + } +} + +void UeWorldPublisher::AddTrafficSignUe( + std::shared_ptr traffic_sign_actor_definition) { + if (!_initialized) { + return; + } + auto object = std::make_shared(traffic_sign_actor_definition); + auto object_result = _objects.insert({traffic_sign_actor_definition->id, object}); + if (!object_result.second) { + object_result.first->second = object; + } + _objects_changed = true; + + auto traffic_sign_publisher = + std::make_shared(traffic_sign_actor_definition, _objects_publisher, _objects_with_covariance_publisher); + UeTrafficSign ue_traffic_sign(traffic_sign_publisher); + auto traffic_sign_result = _traffic_signs.insert({traffic_sign_actor_definition->id, ue_traffic_sign}); + if (!traffic_sign_result.second) { + traffic_sign_result.first->second = std::move(ue_traffic_sign); + } + + traffic_sign_result.first->second.Init(_domain_participant_impl); +} + +void UeWorldPublisher::UeTrafficSign::Init(std::shared_ptr domain_participant) +{ + if ( _traffic_sign_publisher->is_enabled_for_ros() ) { + _traffic_sign_publisher->Init(domain_participant); + } +} + +void UeWorldPublisher::RemoveActor(ActorId actor) { + if (!_initialized) { + return; + } + _objects.erase(actor); + _objects_changed = true; + auto vehicle_iter = _vehicles.find(actor); + if ( vehicle_iter != _vehicles.end() ) { + log_debug("ROS2::RemoveVehicleUe(", std::to_string( + *std::static_pointer_cast(vehicle_iter->second._vehicle_publisher->_actor_name_definition)), ")"); + _vehicles.erase(vehicle_iter); + } + auto walker_iter = _walkers.find(actor); + if ( walker_iter != _walkers.end() ) { + log_debug("ROS2::RemoveWalkerUe(", std::to_string( + *std::static_pointer_cast(walker_iter->second._walker_publisher->_actor_name_definition)), ")"); + _walkers.erase(walker_iter); + } + auto traffic_light_iter = _traffic_lights.find(actor); + if ( traffic_light_iter != _traffic_lights.end() ) { + log_debug("ROS2::RemoveTrafficLightUe(", std::to_string( + *std::static_pointer_cast(traffic_light_iter->second._traffic_light_publisher->_actor_name_definition)), ")"); + _traffic_lights.erase(traffic_light_iter); + } + _traffic_lights_publisher->RemoveTrafficLight(actor); + + auto traffic_sign_iter = _traffic_signs.find(actor); + if ( traffic_sign_iter != _traffic_signs.end() ) { + log_debug("ROS2::RemoveTrafficSignUe(", std::to_string( + *std::static_pointer_cast(traffic_sign_iter->second._traffic_sign_publisher->_actor_name_definition)), ")"); + _traffic_signs.erase(traffic_sign_iter); + } +} + +void UeWorldPublisher::UpdateAndPublishStatus() { + auto const synchronization_window_status = _carla_server.call_get_synchronization_window_status(); + if (_frame_changed || synchronization_window_status.Get().first) { + _frame_changed = false; + carla_msgs::msg::CarlaStatus status; + status.frame(_frame); + carla::ros2::types::EpisodeSettings carla_episode_settings(_carla_server.call_get_episode_settings().Get()); + status.episode_settings( carla_episode_settings.episode_settings()); + status.header().stamp(_timestamp.time()); + status.header().frame_id(""); + status.synchronous_mode_participant_states().reserve(synchronization_window_status.Get().second.size()); + double synchronization_target_game_time_min = std::numeric_limits::max(); + for ( auto const &synchronization_window_participant_state: synchronization_window_status.Get().second) { + carla_msgs::msg::CarlaSynchronizationWindowParticipantState participant_state; + participant_state.client_id(synchronization_window_participant_state.client_id); + participant_state.participant_id(synchronization_window_participant_state.participant_id); + carla::ros2::types::Timestamp target_game_time(synchronization_window_participant_state.target_game_time); + participant_state.target_game_time(target_game_time.Stamp()); + status.synchronous_mode_participant_states().push_back(participant_state); + if ( target_game_time.Stamp() > 0. ) { + synchronization_target_game_time_min = std::min(synchronization_target_game_time_min, target_game_time.Stamp()); + } + } + + status.game_running(synchronization_target_game_time_min > _timestamp.Stamp()); + _carla_status_publisher->UpdateCarlaStatus(status); + + _carla_status_publisher->Publish(); + } +} + +void UeWorldPublisher::UpdateSensorData( + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + if (!_initialized) { + return; + } + _frame_changed = true; + _frame = sensor_header->frame; + _timestamp = carla::ros2::types::Timestamp(sensor_header->timestamp); + _clock_publisher->UpdateData(_timestamp.time()); + _objects_publisher->UpdateHeader(_timestamp.time()); + _objects_with_covariance_publisher->UpdateHeader(_timestamp.time()); + + _episode_header = *header_view(buffer_view); + + if (_episode_header.simulation_state & carla::sensor::s11n::EpisodeStateSerializer::MapChange) { + _map_publisher->UpdateData(_carla_server.call_get_map_data().Get()); + } + + for (auto const& actor_dynamic_state : buffer_data_2_vector(buffer_view)) { + auto object_it = _objects.find(actor_dynamic_state.id); + std::shared_ptr object = nullptr; + bool object_enabled_for_ros = false; + if (object_it != _objects.end()) { + object = object_it->second; + } + + if (object != nullptr) { + carla::ros2::types::Transform transform(actor_dynamic_state.transform, actor_dynamic_state.quaternion); + auto vehicle_it = _vehicles.find(actor_dynamic_state.id); + if (vehicle_it != _vehicles.end()) { + UeVehicle& ue_vehicle = vehicle_it->second; + auto publisher = ue_vehicle._vehicle_publisher; + if ( publisher->is_enabled_for_ros() ) { + object_enabled_for_ros = true; + publisher->UpdateTransform(_timestamp, transform); + publisher->UpdateVehicle(object, actor_dynamic_state, _carla_server); + publisher->Publish(); + } + } + + auto walker_it = _walkers.find(actor_dynamic_state.id); + if (walker_it != _walkers.end()) { + UeWalker& ue_walker = walker_it->second; + auto publisher = ue_walker._walker_publisher; + if ( publisher->is_enabled_for_ros() ) { + object_enabled_for_ros = true; + publisher->UpdateTransform(_timestamp, transform); + publisher->UpdateWalker(object, actor_dynamic_state); + publisher->Publish(); + } + } + + auto traffic_sign_it = _traffic_signs.find(actor_dynamic_state.id); + if (traffic_sign_it != _traffic_signs.end()) { + UeTrafficSign& ue_traffic_sign = traffic_sign_it->second; + auto publisher = ue_traffic_sign._traffic_sign_publisher; + if ( publisher->is_enabled_for_ros() ) { + object_enabled_for_ros = true; + publisher->UpdateTrafficSign(object, actor_dynamic_state); + publisher->Publish(); + } + } + + auto traffic_light_it = _traffic_lights.find(actor_dynamic_state.id); + if (traffic_light_it != _traffic_lights.end()) { + UeTrafficLight& ue_traffic_light = traffic_light_it->second; + auto publisher = ue_traffic_light._traffic_light_publisher; + if ( publisher->is_enabled_for_ros() ) { + object_enabled_for_ros = true; + publisher->UpdateTrafficLight(object, actor_dynamic_state); + publisher->Publish(); + } + } + } + + if ( object_enabled_for_ros ) { + object->UpdateObject(_timestamp, actor_dynamic_state); + } + } + + if (_objects_changed) { + _objects_changed = false; + carla_msgs::msg::CarlaActorList actor_list; + for (auto const& object : _objects) { + actor_list.actors().push_back(object.second->carla_actor_info(_name_registry)); + } + _carla_actor_list_publisher->UpdateCarlaActorList(actor_list); + } +} + +void UeWorldPublisher::enable_for_ros(carla::streaming::detail::actor_id_type actor_id) { + if ( actor_id == _actor_name_definition->id ) { + // the world publisher itself always enabled + return; + } + auto vehicle_it = _vehicles.find(actor_id); + if (vehicle_it != _vehicles.end()) { + vehicle_it->second._vehicle_publisher->enable_for_ros(); + } + auto walker_it = _walkers.find(actor_id); + if (walker_it != _walkers.end()) { + walker_it->second._walker_publisher->enable_for_ros(); + } + auto traffic_sign_it = _traffic_signs.find(actor_id); + if (traffic_sign_it != _traffic_signs.end()) { + traffic_sign_it->second._traffic_sign_publisher->enable_for_ros(); + } + auto traffic_light_it = _traffic_lights.find(actor_id); + if (traffic_light_it != _traffic_lights.end()) { + traffic_light_it->second._traffic_light_publisher->enable_for_ros(); + } +} + +void UeWorldPublisher::disable_for_ros(carla::streaming::detail::actor_id_type actor_id) { + if ( actor_id == _actor_name_definition->id ) { + // the world publisher itself always enabled + return; + } + auto vehicle_it = _vehicles.find(actor_id); + if (vehicle_it != _vehicles.end()) { + vehicle_it->second._vehicle_publisher->disable_for_ros(); + } + auto walker_it = _walkers.find(actor_id); + if (walker_it != _walkers.end()) { + walker_it->second._walker_publisher->disable_for_ros(); + } + auto traffic_sign_it = _traffic_signs.find(actor_id); + if (traffic_sign_it != _traffic_signs.end()) { + traffic_sign_it->second._traffic_sign_publisher->disable_for_ros(); + } + auto traffic_light_it = _traffic_lights.find(actor_id); + if (traffic_light_it != _traffic_lights.end()) { + traffic_light_it->second._traffic_light_publisher->disable_for_ros(); + } +} + +bool UeWorldPublisher::is_enabled_for_ros(carla::streaming::detail::actor_id_type actor_id) const { + if ( actor_id == _actor_name_definition->id ) { + // the world publisher itself always enabled + return true; + } + auto vehicle_it = _vehicles.find(actor_id); + if (vehicle_it != _vehicles.end()) { + return vehicle_it->second._vehicle_publisher->is_enabled_for_ros(); + } + auto walker_it = _walkers.find(actor_id); + if (walker_it != _walkers.end()) { + return walker_it->second._walker_publisher->is_enabled_for_ros(); + } + auto traffic_sign_it = _traffic_signs.find(actor_id); + if (traffic_sign_it != _traffic_signs.end()) { + return traffic_sign_it->second._traffic_sign_publisher->is_enabled_for_ros(); + } + auto traffic_light_it = _traffic_lights.find(actor_id); + if (traffic_light_it != _traffic_lights.end()) { + return traffic_light_it->second._traffic_light_publisher->is_enabled_for_ros(); + } + return false; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h new file mode 100644 index 00000000000..21155d07340 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h @@ -0,0 +1,216 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/ROS2NameRegistry.h" +#include "carla/ros2/publishers/CarlaActorListPublisher.h" +#include "carla/ros2/publishers/CarlaStatusPublisher.h" +#include "carla/ros2/publishers/ClockPublisher.h" +#include "carla/ros2/publishers/MapPublisher.h" +#include "carla/ros2/publishers/ObjectsPublisher.h" +#include "carla/ros2/publishers/ObjectsWithCovariancePublisher.h" +#include "carla/ros2/publishers/TrafficLightPublisher.h" +#include "carla/ros2/publishers/TrafficLightsPublisher.h" +#include "carla/ros2/publishers/TrafficSignPublisher.h" +#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/VehiclePublisher.h" +#include "carla/ros2/publishers/WalkerPublisher.h" +#include "carla/ros2/subscribers/AckermannControlSubscriber.h" +#include "carla/ros2/subscribers/ActorSetTransformSubscriber.h" +#include "carla/ros2/subscribers/CarlaControlSubscriber.h" +#include "carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.h" +#include "carla/ros2/subscribers/VehicleControlSubscriber.h" +#include "carla/ros2/subscribers/WalkerControlSubscriber.h" +#include "carla/ros2/types/Object.h" +#include "carla/ros2/types/VehicleActorDefinition.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "carla/sensor/s11n/EpisodeStateSerializer.h" + +namespace carla { +namespace ros2 { + +/** + * The publisher collecting all world related publishing activities that are not explicitly defined as + * The publisher collecting all world related publishing activities that are not explicitly defined as + * - clock + * - transform + * - sensor + * - vehicle + * - traffic_light + * - traffic_sign + * + */ +class UeWorldPublisher : public UePublisherBaseSensor { +public: + UeWorldPublisher(carla::rpc::RpcServerInterface &carla_server, std::shared_ptr name_registry, + std::shared_ptr sensor_actor_definition); + virtual ~UeWorldPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + + /** + * Implement PublisherInterface::SubscribersConnected() interface + */ + bool SubscribersConnected() const override { + return true; + } + + /** + * Process incoming messages + */ + void ProcessMessages(); + + /** + * Implement actions on actors removed + */ + void RemoveActor(ActorId actor); + + /** + * Implement UePublisherBaseSensor::UpdateSensorData() + */ + void UpdateSensorData(std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) override; + /** + * Implement UePublisherBaseSensor::UpdateSensorDataPostAction() + */ + void UpdateSensorDataPostAction() override; + + + void AddVehicleUe(std::shared_ptr vehicle_actor_definition, + carla::ros2::types::VehicleControlCallback vehicle_control_callback, + carla::ros2::types::VehicleAckermannControlCallback vehicle_ackermann_control_callback, + carla::ros2::types::ActorSetTransformCallback vehicle_set_transform_callback); + void AddWalkerUe(std::shared_ptr walker_actor_definition, + carla::ros2::types::WalkerControlCallback walker_control_callback); + void AddTrafficLightUe( + std::shared_ptr traffic_light_actor_definition); + void AddTrafficSignUe(std::shared_ptr traffic_sign_actor_definition); + + uint64_t CurrentFrame() const { + return _frame; + } + carla::ros2::types::Timestamp const &CurrentTimestamp() const { + return _timestamp; + } + + auto GetTransformPublisher() const { + return _transform_publisher; + } + + /* + * @brief enable actor ROS publication + */ + void enable_for_ros(carla::streaming::detail::actor_id_type actor_id) override; + + /* + * @brief disable actor ROS publication + */ + void disable_for_ros(carla::streaming::detail::actor_id_type actor_id) override; + + /* + * @brief is the actor publisher actually enabled for ROS publication + */ + bool is_enabled_for_ros(carla::streaming::detail::actor_id_type actor_id) const override; + +private: + void UpdateAndPublishStatus(); + + using EpisodeHeaderConst = carla::sensor::s11n::EpisodeStateSerializer::Header const; + + /** + * @brief provides access to the image header stored at the start of the buffer + */ + std::shared_ptr header_view(const carla::SharedBufferView buffer_view) { + return std::shared_ptr(buffer_view, + reinterpret_cast(buffer_view.get()->data())); + } + + /** + * @brief access the buffer data as vector + */ + std::vector> + buffer_data_2_vector(const carla::SharedBufferView buffer_view) const { + return carla::sensor::data::buffer_data_accessed_by_vector( + buffer_view, carla::sensor::s11n::EpisodeStateSerializer::header_offset); + } + + carla::ros2::types::Timestamp _timestamp{}; + uint64_t _frame{0u}; + carla::sensor::s11n::EpisodeStateSerializer::Header _episode_header; + bool _frame_changed{false}; + // ensure to send out at least one message with empty object list + bool _objects_changed{true}; + std::unordered_map> _objects; + + struct UeVehicle { + explicit UeVehicle(std::shared_ptr carla_vehicle_publisher) + : _vehicle_publisher(carla_vehicle_publisher) {} + std::shared_ptr _vehicle_publisher; + std::shared_ptr _vehicle_controller; + std::shared_ptr _vehicle_ackermann_controller; + std::shared_ptr _actor_set_transform_subscriber; + + void Init(std::shared_ptr domain_participant); + }; + std::unordered_map _vehicles; + + struct UeWalker { + explicit UeWalker(std::shared_ptr carla_walker_publisher) + : _walker_publisher(carla_walker_publisher) {} + std::shared_ptr _walker_publisher; + std::shared_ptr _walker_controller; + carla::ros2::types::WalkerControlCallback _walker_control_callback; + void Init(std::shared_ptr domain_participant); + }; + std::unordered_map _walkers; + + struct UeTrafficLight { + explicit UeTrafficLight(std::shared_ptr carla_traffic_light_publisher) + : _traffic_light_publisher(carla_traffic_light_publisher) {} + std::shared_ptr _traffic_light_publisher; + + void Init(std::shared_ptr domain_participant); + }; + std::unordered_map _traffic_lights; + + struct UeTrafficSign { + explicit UeTrafficSign(std::shared_ptr carla_traffic_sign_publisher) + : _traffic_sign_publisher(carla_traffic_sign_publisher) {} + std::shared_ptr _traffic_sign_publisher; + + void Init(std::shared_ptr domain_participant); + }; + std::unordered_map _traffic_signs; + + std::shared_ptr _domain_participant_impl; + + carla::rpc::RpcServerInterface &_carla_server; + std::shared_ptr _name_registry; + // publisher + std::shared_ptr _carla_status_publisher; + std::shared_ptr _carla_actor_list_publisher; + std::shared_ptr _clock_publisher; + std::shared_ptr _map_publisher; + std::shared_ptr _objects_publisher; + std::shared_ptr _objects_with_covariance_publisher; + std::shared_ptr _traffic_lights_publisher; + // subscriber + std::shared_ptr _carla_control_subscriber; + std::shared_ptr _sync_subscriber; + + bool _initialized{false}; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp new file mode 100644 index 00000000000..b3e62985ccd --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -0,0 +1,161 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "VehiclePublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/ros2/types/Speed.h" +#include "carla/ros2/types/VehicleAckermannControl.h" +#include "carla/ros2/types/VehicleControl.h" + +namespace carla { +namespace ros2 { + +VehiclePublisher::VehiclePublisher(std::shared_ptr vehicle_actor_definition, + std::shared_ptr transform_publisher, + std::shared_ptr objects_publisher, + std::shared_ptr objects_with_covariance_publisher) + : PublisherBaseTransform(std::static_pointer_cast(vehicle_actor_definition), + transform_publisher), + _vehicle_info_publisher(std::make_shared()), + _vehicle_status_publisher(std::make_shared()), + _vehicle_odometry_publisher(std::make_shared()), + _vehicle_speed_publisher(std::make_shared()), + _vehicle_telemetry_publisher(std::make_shared()), + _vehicle_object_publisher(std::make_shared(*this, objects_publisher)), + _vehicle_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)) { + // prefill some vehicle info data + _vehicle_info_publisher->Message().id(vehicle_actor_definition->id); + _vehicle_info_publisher->Message().type(vehicle_actor_definition->type_id); + _vehicle_info_publisher->Message().rolename(vehicle_actor_definition->role_name); + _vehicle_info_publisher->Message().shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); + auto const ros_extent = vehicle_actor_definition->bounding_box.extent * 2.f; + _vehicle_info_publisher->Message().shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); + _vehicle_info_publisher->Message().shape().polygon().points(*vehicle_actor_definition->vertex_polygon.polygon()); + for (auto wheel : vehicle_actor_definition->vehicle_physics_control.GetWheels()) { + auto wheel_info = carla_msgs::msg::CarlaEgoVehicleInfoWheel(); + wheel_info.tire_friction(wheel.tire_friction); + wheel_info.damping_rate(wheel.damping_rate); + wheel_info.max_steer_angle(carla::geom::Math::ToRadians(wheel.max_steer_angle)); + wheel_info.radius(wheel.radius); + wheel_info.max_brake_torque(wheel.max_brake_torque); + wheel_info.max_handbrake_torque(wheel.max_handbrake_torque); + + auto wheel_position = wheel.position; + // TODO: do we have to divide here by 100? (such was in ros brigde, but to my undertanding and search in the source + // code, it might be already correct. If not, then better to switch type of wheel_position from Vector3D to Location + // to have automatic cm -> m conversion object->Transform().GetTransform().InverseTransformPoint(wheel_position); + wheel_info.position(CoordinateSystemTransform::TransformLocationToVector3Msg(wheel_position)); + _vehicle_info_publisher->Message().wheels().push_back(wheel_info); + } + _vehicle_info_publisher->Message().max_rpm(vehicle_actor_definition->vehicle_physics_control.max_rpm); + _vehicle_info_publisher->Message().moi(vehicle_actor_definition->vehicle_physics_control.moi); + _vehicle_info_publisher->Message().damping_rate_full_throttle( + vehicle_actor_definition->vehicle_physics_control.damping_rate_full_throttle); + _vehicle_info_publisher->Message().damping_rate_zero_throttle_clutch_engaged( + vehicle_actor_definition->vehicle_physics_control.damping_rate_zero_throttle_clutch_engaged); + _vehicle_info_publisher->Message().damping_rate_zero_throttle_clutch_disengaged( + vehicle_actor_definition->vehicle_physics_control.damping_rate_zero_throttle_clutch_disengaged); + _vehicle_info_publisher->Message().use_gear_autobox(vehicle_actor_definition->vehicle_physics_control.use_gear_autobox); + _vehicle_info_publisher->Message().gear_switch_time(vehicle_actor_definition->vehicle_physics_control.gear_switch_time); + _vehicle_info_publisher->Message().clutch_strength(vehicle_actor_definition->vehicle_physics_control.clutch_strength); + _vehicle_info_publisher->Message().mass(vehicle_actor_definition->vehicle_physics_control.mass); + _vehicle_info_publisher->Message().drag_coefficient(vehicle_actor_definition->vehicle_physics_control.drag_coefficient); + _vehicle_info_publisher->Message().center_of_mass(CoordinateSystemTransform::TransformLocationToVector3Msg( + vehicle_actor_definition->vehicle_physics_control.center_of_mass)); + _vehicle_info_publisher->SetMessageUpdated(); +} + +bool VehiclePublisher::Init(std::shared_ptr domain_participant) { + return _vehicle_info_publisher->Init(domain_participant, get_topic_name("vehicle_info"), PublisherBase::get_topic_qos()) && + _vehicle_status_publisher->Init(domain_participant, get_topic_name("vehicle_status"), get_topic_qos()) && + _vehicle_odometry_publisher->Init(domain_participant, get_topic_name("odometry"), get_topic_qos()) && + _vehicle_speed_publisher->Init(domain_participant, get_topic_name("speed"), get_topic_qos()) && + _vehicle_telemetry_publisher->Init(domain_participant, get_topic_name("vehicle_telemetry"), get_topic_qos()) && + _vehicle_object_publisher->Init(domain_participant) && + _vehicle_object_with_covariance_publisher->Init(domain_participant); +} + +bool VehiclePublisher::Publish() { + if (!_vehicle_info_published) { + _vehicle_info_published = _vehicle_info_publisher->Publish(); + } + bool success = _vehicle_info_published; + success &= _vehicle_status_publisher->Publish(); + success &= _vehicle_odometry_publisher->Publish(); + success &= _vehicle_speed_publisher->Publish(); + success &= _vehicle_telemetry_publisher->Publish(); + success &= _vehicle_object_publisher->Publish(); + success &= _vehicle_object_with_covariance_publisher->Publish(); + return success; +} + +bool VehiclePublisher::SubscribersConnected() const { + return _vehicle_info_publisher->SubscribersConnected() || _vehicle_status_publisher->SubscribersConnected() || + _vehicle_odometry_publisher->SubscribersConnected() || _vehicle_speed_publisher->SubscribersConnected() || + _vehicle_telemetry_publisher->SubscribersConnected() || + _vehicle_object_publisher->SubscribersConnected() || + _vehicle_object_with_covariance_publisher->SubscribersConnected(); +} + +void VehiclePublisher::UpdateVehicle(std::shared_ptr &object, + carla::sensor::data::ActorDynamicState const &actor_dynamic_state, + carla::rpc::RpcServerInterface &carla_server) { + _vehicle_odometry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); + _vehicle_odometry_publisher->Message().child_frame_id(frame_id()); + _vehicle_odometry_publisher->Message().pose(object->Transform().pose_with_covariance()); + _vehicle_odometry_publisher->Message().twist(object->AcceleratedMovement().twist_with_covariance()); + + _vehicle_speed_publisher->Message().data(object->Speed().speed().data()); + + auto response = carla_server.call_get_telemetry_data(_actor_name_definition->id); + if (!response) { + carla::log_warning("VehiclePublisher: Failed to get telemetry data for actor id ", + std::to_string(_actor_name_definition->id), ": ", response.GetError().What()); + } + else { + auto telemetry_data = response.Get(); + _vehicle_telemetry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); + _vehicle_telemetry_publisher->Message().throttle(telemetry_data.throttle); + _vehicle_telemetry_publisher->Message().steer(telemetry_data.steer); + _vehicle_telemetry_publisher->Message().brake(telemetry_data.brake); + _vehicle_telemetry_publisher->Message().engine_rpm(telemetry_data.engine_rpm); + _vehicle_telemetry_publisher->Message().gear(telemetry_data.gear); + _vehicle_telemetry_publisher->Message().drag(telemetry_data.drag); + _vehicle_telemetry_publisher->Message().wheels().clear(); + for (auto const &wheel: telemetry_data.wheels) { + carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel wheel_msg; + wheel_msg.tire_friction(wheel.tire_friction); + wheel_msg.lat_slip(wheel.lat_slip); + wheel_msg.long_slip(wheel.long_slip); + wheel_msg.omega(wheel.omega); + wheel_msg.tire_load(wheel.tire_load); + wheel_msg.normalized_tire_load(wheel.normalized_tire_load); + wheel_msg.torque(wheel.torque); + wheel_msg.long_force(wheel.long_force); + wheel_msg.lat_force(wheel.lat_force); + wheel_msg.normalized_long_force(wheel.normalized_long_force); + wheel_msg.normalized_lat_force(wheel.normalized_lat_force); + _vehicle_telemetry_publisher->Message().wheels().push_back(wheel_msg); + } + } + + _vehicle_status_publisher->SetMessageHeader(object->Timestamp().time(), frame_id()); + _vehicle_status_publisher->Message().velocity(object->Speed().speed().data()); + _vehicle_status_publisher->Message().acceleration(object->AcceleratedMovement().accel()); + _vehicle_status_publisher->Message().orientation(object->Transform().pose().orientation()); + _vehicle_status_publisher->Message().active_control_type(carla::ros2::types::GetVehicleControlType(actor_dynamic_state)); + _vehicle_status_publisher->Message().last_applied_vehicle_control( + carla::ros2::types::VehicleControl(actor_dynamic_state.state.vehicle_data.GetVehicleControl()) + .carla_vehicle_control()); + _vehicle_status_publisher->Message().last_applied_ackermann_control( + carla::ros2::types::VehicleAckermannControl(actor_dynamic_state.state.vehicle_data.GetAckermannControl()) + .carla_vehicle_ackermann_control()); + + _vehicle_object_publisher->UpdateObject(object); + _vehicle_object_with_covariance_publisher->UpdateObject(object); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h new file mode 100644 index 00000000000..20ab8da65fe --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h @@ -0,0 +1,74 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/ObjectPublisher.h" +#include "carla/ros2/publishers/ObjectWithCovariancePublisher.h" +#include "carla/ros2/publishers/PublisherBaseTransform.h" +#include "carla/ros2/types/Object.h" +#include "carla/ros2/types/Transform.h" +#include "carla/ros2/types/VehicleActorDefinition.h" +#include "carla/rpc/VehiclePhysicsControl.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h" +#include "carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h" +#include "carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h" +#include "nav_msgs/msg/OdometryPubSubTypes.h" +#include "std_msgs/msg/Float32PubSubTypes.h" + +namespace carla { +namespace ros2 { + +using VehicleInfoPublisherImpl = + DdsPublisherImpl; +using EgoVehicleStatusPublisherImpl = + DdsPublisherImpl; +using VehicleSpeedPublisherImpl = + DdsPublisherImpl; +using VehicleOdometryPublisherImpl = + DdsPublisherImpl; +using VehicleTelemetryDataPublisherImpl = + DdsPublisherImpl; + + +class VehiclePublisher : public PublisherBaseTransform { +public: + VehiclePublisher(std::shared_ptr vehicle_actor_definition, + std::shared_ptr transform_publisher, + std::shared_ptr objects_publisher, + std::shared_ptr objects_with_covariance_publisher); + virtual ~VehiclePublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateVehicle(std::shared_ptr &object, + carla::sensor::data::ActorDynamicState const &actor_dynamic_state, + carla::rpc::RpcServerInterface &carla_server); + +private: + std::shared_ptr _vehicle_info_publisher; + bool _vehicle_info_published{false}; + std::shared_ptr _vehicle_status_publisher; + std::shared_ptr _vehicle_odometry_publisher; + std::shared_ptr _vehicle_speed_publisher; + std::shared_ptr _vehicle_telemetry_publisher; + std::shared_ptr _vehicle_object_publisher; + std::shared_ptr _vehicle_object_with_covariance_publisher; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp new file mode 100644 index 00000000000..c47f3361276 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp @@ -0,0 +1,55 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "WalkerPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/ros2/types/Speed.h" +#include "carla/ros2/types/WalkerControl.h" + +namespace carla { +namespace ros2 { + +WalkerPublisher::WalkerPublisher(std::shared_ptr walker_actor_definition, + std::shared_ptr transform_publisher, + std::shared_ptr objects_publisher, + std::shared_ptr objects_with_covariance_publisher) + : PublisherBaseTransform(std::static_pointer_cast(walker_actor_definition), + transform_publisher), + _walker_odometry_publisher(std::make_shared()), + _walker_object_publisher(std::make_shared(*this, objects_publisher)), + _walker_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)) {} + +bool WalkerPublisher::Init(std::shared_ptr domain_participant) { + return _walker_odometry_publisher->Init(domain_participant, get_topic_name("odometry"), get_topic_qos()) && + _walker_object_publisher->Init(domain_participant) && + _walker_object_with_covariance_publisher->Init(domain_participant); +} + +bool WalkerPublisher::Publish() { + auto success = _walker_odometry_publisher->Publish(); + success &= _walker_object_publisher->Publish(); + success &= _walker_object_with_covariance_publisher->Publish(); + return success; +} + +bool WalkerPublisher::SubscribersConnected() const { + return _walker_odometry_publisher->SubscribersConnected() || + _walker_object_publisher->SubscribersConnected() || + _walker_object_with_covariance_publisher->SubscribersConnected(); +} + +void WalkerPublisher::UpdateWalker(std::shared_ptr &object, + carla::sensor::data::ActorDynamicState const &) { + _walker_odometry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); + _walker_odometry_publisher->Message().child_frame_id(frame_id()); + _walker_odometry_publisher->Message().pose(object->Transform().pose_with_covariance()); + _walker_odometry_publisher->Message().twist(object->AcceleratedMovement().twist_with_covariance()); + + _walker_object_publisher->UpdateObject(object); + _walker_object_with_covariance_publisher->UpdateObject(object); +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.h b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.h new file mode 100644 index 00000000000..1f865be100f --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.h @@ -0,0 +1,53 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/ObjectPublisher.h" +#include "carla/ros2/publishers/ObjectWithCovariancePublisher.h" +#include "carla/ros2/publishers/PublisherBaseTransform.h" +#include "carla/ros2/types/Object.h" +#include "carla/ros2/types/Transform.h" +#include "carla/ros2/types/WalkerActorDefinition.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "nav_msgs/msg/OdometryPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using WalkerOdometryPublisherImpl = + DdsPublisherImpl; + +class WalkerPublisher : public PublisherBaseTransform { +public: + WalkerPublisher(std::shared_ptr walker_actor_definition, + std::shared_ptr transform_publisher, + std::shared_ptr objects_publisher, + std::shared_ptr objects_with_covariance_publisher); + virtual ~WalkerPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + void UpdateWalker(std::shared_ptr &object, + carla::sensor::data::ActorDynamicState const &actor_dynamic_state); + +private: + std::shared_ptr _walker_odometry_publisher; + std::shared_ptr _walker_object_publisher; + std::shared_ptr _walker_object_with_covariance_publisher; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/DestroyObjectService.cpp b/LibCarla/source/carla/ros2/services/DestroyObjectService.cpp new file mode 100644 index 00000000000..d6940305462 --- /dev/null +++ b/LibCarla/source/carla/ros2/services/DestroyObjectService.cpp @@ -0,0 +1,34 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/services/DestroyObjectService.h" + +#include "carla/ros2/impl/DdsServiceImpl.h" + +namespace carla { +namespace ros2 { + +DestroyObjectService::DestroyObjectService( + carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition) + : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} + +bool DestroyObjectService::Init(std::shared_ptr domain_participant) { + _impl->SetServiceCallback(std::bind(&DestroyObjectService::DestroyObject, this, std::placeholders::_1)); + return _impl->Init(domain_participant, get_topic_name()); +} + +void DestroyObjectService::CheckRequest() { + _impl->CheckRequest(); +} + +carla_msgs::srv::DestroyObject_Response DestroyObjectService::DestroyObject( + carla_msgs::srv::DestroyObject_Request const &request) { + carla_msgs::srv::DestroyObject_Response response; + response.success(_carla_server.call_destroy_actor(carla::streaming::detail::actor_id_type(request.id()))); + return response; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/DestroyObjectService.h b/LibCarla/source/carla/ros2/services/DestroyObjectService.h new file mode 100644 index 00000000000..d2051f21b12 --- /dev/null +++ b/LibCarla/source/carla/ros2/services/DestroyObjectService.h @@ -0,0 +1,43 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/services/ServiceBase.h" +#include "carla_msgs/srv/DestroyObjectPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using DestroyObjectServiceImpl = + DdsServiceImpl; + +class DestroyObjectService + : public ServiceBase { +public: + DestroyObjectService(carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition); + virtual ~DestroyObjectService() = default; + + /** + * Implements ServiceInterface::CheckRequest() interface + */ + void CheckRequest() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + carla_msgs::srv::DestroyObject_Response DestroyObject(carla_msgs::srv::DestroyObject_Request const &request); + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/GetAvailableMapsService.cpp b/LibCarla/source/carla/ros2/services/GetAvailableMapsService.cpp new file mode 100644 index 00000000000..5f410a0bab5 --- /dev/null +++ b/LibCarla/source/carla/ros2/services/GetAvailableMapsService.cpp @@ -0,0 +1,40 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/services/GetAvailableMapsService.h" + +#include + +#include "carla/actors/BlueprintLibrary.h" +#include "carla/ros2/impl/DdsServiceImpl.h" + +namespace carla { +namespace ros2 { + +GetAvailableMapsService::GetAvailableMapsService( + carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition) + : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} + +bool GetAvailableMapsService::Init(std::shared_ptr domain_participant) { + _impl->SetServiceCallback(std::bind(&GetAvailableMapsService::GetAvailableMaps, this, std::placeholders::_1)); + return _impl->Init(domain_participant, get_topic_name()); +} + +void GetAvailableMapsService::CheckRequest() { + _impl->CheckRequest(); +} + +carla_msgs::srv::GetAvailableMaps_Response GetAvailableMapsService::GetAvailableMaps( + carla_msgs::srv::GetAvailableMaps_Request const &request) { + carla_msgs::srv::GetAvailableMaps_Response response; + + for ( auto const &map_name: _carla_server.call_get_available_maps().Get()) { + response.maps().push_back(map_name); + } + return response; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/GetAvailableMapsService.h b/LibCarla/source/carla/ros2/services/GetAvailableMapsService.h new file mode 100644 index 00000000000..04082b5095f --- /dev/null +++ b/LibCarla/source/carla/ros2/services/GetAvailableMapsService.h @@ -0,0 +1,43 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/services/ServiceBase.h" +#include "carla_msgs/srv/GetAvailableMapsPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using GetAvailableMapsServiceImpl = + DdsServiceImpl; + +class GetAvailableMapsService + : public ServiceBase { +public: + GetAvailableMapsService(carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition); + virtual ~GetAvailableMapsService() = default; + + /** + * Implements ServiceInterface::CheckRequest() interface + */ + void CheckRequest() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + carla_msgs::srv::GetAvailableMaps_Response GetAvailableMaps(carla_msgs::srv::GetAvailableMaps_Request const &request); + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/GetBlueprintsService.cpp b/LibCarla/source/carla/ros2/services/GetBlueprintsService.cpp new file mode 100644 index 00000000000..06e96f4749e --- /dev/null +++ b/LibCarla/source/carla/ros2/services/GetBlueprintsService.cpp @@ -0,0 +1,57 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/services/GetBlueprintsService.h" + +#include + +#include "carla/actors/BlueprintLibrary.h" +#include "carla/ros2/impl/DdsServiceImpl.h" + +namespace carla { +namespace ros2 { + +GetBlueprintsService::GetBlueprintsService( + carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition) + : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} + +bool GetBlueprintsService::Init(std::shared_ptr domain_participant) { + _impl->SetServiceCallback(std::bind(&GetBlueprintsService::GetBlueprints, this, std::placeholders::_1)); + return _impl->Init(domain_participant, get_topic_name()); +} + +void GetBlueprintsService::CheckRequest() { + _impl->CheckRequest(); +} + +carla_msgs::srv::GetBlueprints_Response GetBlueprintsService::GetBlueprints( + carla_msgs::srv::GetBlueprints_Request const &request) { + carla_msgs::srv::GetBlueprints_Response response; + + auto filter = request.filter(); + if (filter == "") { + filter = "*"; + } + auto blueprints = carla::actors::BlueprintLibrary(_carla_server.call_get_actor_definitions().Get()).Filter(filter); + response.blueprints().reserve(blueprints->size()); + for (auto const &blueprint : *blueprints) { + carla_msgs::msg::CarlaActorBlueprint ros_blueprint; + ros_blueprint.id(blueprint.GetId()); + for (auto const &tag: blueprint.GetTags()) { + ros_blueprint.tags().push_back(tag); + } + for (auto const &attribute: blueprint) { + diagnostic_msgs::msg::KeyValue key_value; + key_value.key(attribute.GetId()); + key_value.value(attribute.GetValue()); + ros_blueprint.attributes().push_back(key_value); + } + response.blueprints().push_back(ros_blueprint); + } + return response; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/GetBlueprintsService.h b/LibCarla/source/carla/ros2/services/GetBlueprintsService.h new file mode 100644 index 00000000000..26007e7451f --- /dev/null +++ b/LibCarla/source/carla/ros2/services/GetBlueprintsService.h @@ -0,0 +1,43 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/services/ServiceBase.h" +#include "carla_msgs/srv/GetBlueprintsPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using GetBlueprintsServiceImpl = + DdsServiceImpl; + +class GetBlueprintsService + : public ServiceBase { +public: + GetBlueprintsService(carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition); + virtual ~GetBlueprintsService() = default; + + /** + * Implements ServiceInterface::CheckRequest() interface + */ + void CheckRequest() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + carla_msgs::srv::GetBlueprints_Response GetBlueprints(carla_msgs::srv::GetBlueprints_Request const &request); + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/LoadMapService.cpp b/LibCarla/source/carla/ros2/services/LoadMapService.cpp new file mode 100644 index 00000000000..e5d99727ca2 --- /dev/null +++ b/LibCarla/source/carla/ros2/services/LoadMapService.cpp @@ -0,0 +1,78 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/services/LoadMapService.h" + +#include + +#include "carla/actors/BlueprintLibrary.h" +#include "carla/ros2/impl/DdsServiceImpl.h" + +namespace carla { +namespace ros2 { + +LoadMapService::LoadMapService( + carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition) + : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) { +} + +bool LoadMapService::Init(std::shared_ptr domain_participant) { + _impl->SetServiceCallback(std::bind(&LoadMapService::LoadMap, this, std::placeholders::_1)); + return _impl->Init(domain_participant, get_topic_name()); +} + +void LoadMapService::CheckRequest() { + _impl->CheckRequest(); +} + +carla_msgs::srv::LoadMap_Response LoadMapService::LoadMap( + carla_msgs::srv::LoadMap_Request const &request) { + carla_msgs::srv::LoadMap_Response response; + + auto new_map_name = request.mapname(); + auto current_map_name = _carla_server.call_get_map_info().Get().name; + std::string map_name_prefix = "Carla/Maps/"; + std::string map_name_without_prefix = request.mapname(); + if (map_name_without_prefix.find(map_name_prefix) == 0) { + map_name_without_prefix.erase(0, map_name_prefix.length()); + } + std::string map_name_with_prefix = map_name_prefix + map_name_without_prefix; + std::string error_reason; + if( request.force_reload() || + (!(map_name_without_prefix == current_map_name) && !(map_name_with_prefix == current_map_name))) { + auto call_response = _carla_server.call_load_new_episode(map_name_without_prefix, request.reset_episode_settings(), static_cast(request.map_layers())); + if ( call_response.HasError() ) { + response.success(false); + error_reason = call_response.GetError().What(); + } + else { + response.success(true); + } + } + else { + response.success(false); + error_reason = "Map already loaded and no reload requested"; + } + if (response.success()) { + log_info("ROS2:LoadMapService(", request.mapname(), + "): request to load new episode '", map_name_without_prefix, + "' with force: ", request.force_reload()?"True":"False", + ", reset_episode_settings: ", request.reset_episode_settings()?"True":"False", + " and map_layers: ", request.map_layers(), + " succeeded"); + } + else { + log_error("ROS2:LoadMapService(", request.mapname(), + "): request to load new episode '", map_name_without_prefix, + "' with force: ", request.force_reload()?"True":"False", + ", reset_episode_settings: ", request.reset_episode_settings()?"True":"False", + " and map_layers: ", request.map_layers(), + " failed: ", error_reason); + } + return response; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/LoadMapService.h b/LibCarla/source/carla/ros2/services/LoadMapService.h new file mode 100644 index 00000000000..7a33014c6c3 --- /dev/null +++ b/LibCarla/source/carla/ros2/services/LoadMapService.h @@ -0,0 +1,43 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/services/ServiceBase.h" +#include "carla_msgs/srv/LoadMapPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using LoadMapServiceImpl = + DdsServiceImpl; + +class LoadMapService + : public ServiceBase { +public: + LoadMapService(carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition); + virtual ~LoadMapService() = default; + + /** + * Implements ServiceInterface::CheckRequest() interface + */ + void CheckRequest() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + carla_msgs::srv::LoadMap_Response LoadMap(carla_msgs::srv::LoadMap_Request const &request); + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/ServiceBase.h b/LibCarla/source/carla/ros2/services/ServiceBase.h new file mode 100644 index 00000000000..396e647861f --- /dev/null +++ b/LibCarla/source/carla/ros2/services/ServiceBase.h @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/ROS2NameRecord.h" +#include "carla/ros2/ROS2QoS.h" +#include "carla/ros2/services/ServiceInterface.h" +#include "carla/rpc/RpcServerInterface.h" + +namespace carla { +namespace ros2 { + +/** + A Service base class. + */ +template +class DdsServiceImpl; + +template +class ServiceBase : public ServiceInterface, public ROS2NameRecord { +public: + ServiceBase(carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition) + : ROS2NameRecord(actor_name_definition), _carla_server(carla_server) {} + virtual ~ServiceBase() = default; + + /** + * Initialze the service + */ + virtual bool Init(std::shared_ptr domain_participant) = 0; + +protected: + carla::rpc::RpcServerInterface &_carla_server; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/ServiceInterface.h b/LibCarla/source/carla/ros2/services/ServiceInterface.h new file mode 100644 index 00000000000..ddbcf0a7fbd --- /dev/null +++ b/LibCarla/source/carla/ros2/services/ServiceInterface.h @@ -0,0 +1,44 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +namespace carla { +namespace ros2 { + +class ServiceInterface { +public: + /** + * Default constructor. + */ + ServiceInterface() = default; + /** + * Copy operation not allowed due to active subscriptions + */ + ServiceInterface(const ServiceInterface&) = delete; + /** + * Assignment operation not allowed due to active subscriptions + */ + ServiceInterface& operator=(const ServiceInterface&) = delete; + /** + * Move operation not allowed due to active subscriptions + */ + ServiceInterface(ServiceInterface&&) = delete; + /** + * Move operation not allowed due to active subscriptions + */ + ServiceInterface& operator=(ServiceInterface&&) = delete; + + /** + * Default destructor. + */ + virtual ~ServiceInterface() = default; + + /** + * Check if there is a new request available and execute callback if required + */ + virtual void CheckRequest() = 0; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp b/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp new file mode 100644 index 00000000000..8c955e0fa88 --- /dev/null +++ b/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/services/SetEpisodeSettingsService.h" + +#include "carla/ros2/impl/DdsServiceImpl.h" +#include "carla/ros2/types/EpisodeSettings.h" + +namespace carla { +namespace ros2 { + +SetEpisodeSettingsService::SetEpisodeSettingsService( + carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition) + : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} + +bool SetEpisodeSettingsService::Init(std::shared_ptr domain_participant) { + _impl->SetServiceCallback(std::bind(&SetEpisodeSettingsService::SetEpisodeSettings, this, std::placeholders::_1)); + return _impl->Init(domain_participant, get_topic_name()); +} + +void SetEpisodeSettingsService::CheckRequest() { + _impl->CheckRequest(); +} + +carla_msgs::srv::SetEpisodeSettings_Response SetEpisodeSettingsService::SetEpisodeSettings( + carla_msgs::srv::SetEpisodeSettings_Request const &request) { + + carla_msgs::srv::SetEpisodeSettings_Response response; + carla::ros2::types::EpisodeSettings episode_settings(request.episode_settings()); + auto result = _carla_server.call_set_episode_settings(episode_settings.GetEpisodeSettings()); + if ( result > 0 ) { + response.success(true); + } + else { + response.success(false); + } + + return response; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.h b/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.h new file mode 100644 index 00000000000..8109e57050a --- /dev/null +++ b/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.h @@ -0,0 +1,43 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/services/ServiceBase.h" +#include "carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using SetEpisodeSettingsServiceImpl = + DdsServiceImpl; + +class SetEpisodeSettingsService + : public ServiceBase { +public: + SetEpisodeSettingsService(carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition); + virtual ~SetEpisodeSettingsService() = default; + + /** + * Implements ServiceInterface::CheckRequest() interface + */ + void CheckRequest() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + carla_msgs::srv::SetEpisodeSettings_Response SetEpisodeSettings(carla_msgs::srv::SetEpisodeSettings_Request const &request); + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp b/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp new file mode 100644 index 00000000000..aa1fa8ac1d4 --- /dev/null +++ b/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp @@ -0,0 +1,128 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/services/SpawnObjectService.h" + +#include +#include + +#include "carla/actors/BlueprintLibrary.h" +#include "carla/ros2/impl/DdsServiceImpl.h" +#include "carla/ros2/types/Transform.h" + +#ifdef LIBCARLA_INCLUDED_FROM_UE4 +#include +#include +#include "Carla/Server/CarlaServer.h" +#endif + +namespace carla { +namespace ros2 { + +SpawnObjectService::SpawnObjectService(carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition) + : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} + +bool SpawnObjectService::Init(std::shared_ptr domain_participant) { + _impl->SetServiceCallback(std::bind(&SpawnObjectService::SpawnObject, this, std::placeholders::_1)); + return _impl->Init(domain_participant, get_topic_name()); +} + +void SpawnObjectService::CheckRequest() { + _impl->CheckRequest(); +} + +carla_msgs::srv::SpawnObject_Response SpawnObjectService::SpawnObject( + carla_msgs::srv::SpawnObject_Request const &request) { + carla_msgs::srv::SpawnObject_Response response; + + log_debug("ROS2:SpawnObjectService processing request for '", request.blueprint().id(), "' Pose: ", request.random_pose()?"random":"provided"); + + int32_t retry_count = 5; + do { + carla::geom::Transform transform; + if (request.random_pose()) { + std::vector spawn_points; + auto map_info = _carla_server.call_get_map_info(); + std::vector result; + std::sample(map_info.Get().recommended_spawn_points.begin(), map_info.Get().recommended_spawn_points.end(), + std::back_inserter(result), 1, std::mt19937{std::random_device{}()}); + if (result.empty()) { + log_error("ROS2:SpawnObjectService failed to retrieve random spawn point"); + response.error_string("SpawnObjectService: failed to retrieve random spawn point"); + response.id(-1); + return response; + } + transform = *result.begin(); + } else { + // no retry if spawn position is explicitly provided + retry_count = 0u; + carla::ros2::types::Transform ros_transform(request.transform()); + transform = ros_transform.GetTransform(); + } + log_debug("ROS2:SpawnObjectService processing request. Pose: (", transform.location.x, ", ", transform.location.y, ", ", transform.location.z, ")"); + auto blueprints = + carla::actors::BlueprintLibrary(_carla_server.call_get_actor_definitions().Get()).Filter(request.blueprint().id()); + if (blueprints->empty()) { + log_error("ROS2:SpawnObjectService failed to retrieve any matching blueprint", request.blueprint().id()); + response.error_string("SpawnObjectService: failed to retrieve matching blueprint"); + response.id(-1); + return response; + } else { + std::vector blueprint_result; + std::sample(blueprints->begin(), blueprints->end(), std::back_inserter(blueprint_result), 1, + std::mt19937{std::random_device{}()}); + if (blueprint_result.size() == 0) { + log_error("ROS2:SpawnObjectService failed to retrieve random matching blueprint", request.blueprint().id()); + response.error_string("SpawnObjectService: failed to retrieve random matching blueprint"); + response.id(-1); + return response; + } + auto blueprint = *blueprint_result.begin(); + for (auto const &attribute : request.blueprint().attributes()) { + blueprint.SetAttribute(attribute.key(), attribute.value()); + } + + auto actor_description = blueprint.MakeActorDescription(); + + carla::rpc::ActorAttributeValue attribute_value; + attribute_value.id = "enabled_for_ros"; + attribute_value.type = carla::rpc::ActorAttributeType::Bool; + attribute_value.value = "true"; + actor_description.attributes.push_back(attribute_value); + + carla::rpc::Response result; + carla::streaming::detail::actor_id_type const parent = request.attach_to(); + if (parent == 0) { + result = _carla_server.call_spawn_actor(actor_description, transform); + } else { + result = _carla_server.call_spawn_actor_with_parent(actor_description, transform, parent, + carla::rpc::AttachmentType::Rigid, ""); + } + if (result.HasError()) { + if ( retry_count > 0 ) { + retry_count--; + } + else { + response.id(-1); + response.error_string(result.GetError().What()); + log_warning("ROS2:SpawnObjectService spawn failed: ", result.GetError().What()); + return response; + } + } else { + response.id(int32_t(result.Get().id)); + log_debug("ROS2:SpawnObjectService spawn succeeded: ", int32_t(result.Get().id)); + return response; + } + } + }while(retry_count > 0); + + log_error("ROS2:SpawnObjectService failed to retrieve random spawn point after retries"); + response.error_string("SpawnObjectService: failed to retrieve random spawn point after retries"); + response.id(-1); + return response; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/services/SpawnObjectService.h b/LibCarla/source/carla/ros2/services/SpawnObjectService.h new file mode 100644 index 00000000000..0a3d3e7601f --- /dev/null +++ b/LibCarla/source/carla/ros2/services/SpawnObjectService.h @@ -0,0 +1,43 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/services/ServiceBase.h" +#include "carla_msgs/srv/SpawnObjectPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using SpawnObjectServiceImpl = + DdsServiceImpl; + +class SpawnObjectService + : public ServiceBase { +public: + SpawnObjectService(carla::rpc::RpcServerInterface &carla_server, + std::shared_ptr actor_name_definition); + virtual ~SpawnObjectService() = default; + + /** + * Implements ServiceInterface::CheckRequest() interface + */ + void CheckRequest() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + carla_msgs::srv::SpawnObject_Response SpawnObject(carla_msgs::srv::SpawnObject_Request const &request); + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/AckermannControlSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/AckermannControlSubscriber.cpp index 5a670c14a60..79b22e46362 100644 --- a/LibCarla/source/carla/ros2/subscribers/AckermannControlSubscriber.cpp +++ b/LibCarla/source/carla/ros2/subscribers/AckermannControlSubscriber.cpp @@ -1,28 +1,29 @@ -#include "AckermannControlSubscriber.h" +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . -#include "carla/ros2/ROS2CallbackData.h" +#include "carla/ros2/subscribers/AckermannControlSubscriber.h" + +#include "carla/ros2/impl/DdsSubscriberImpl.h" namespace carla { namespace ros2 { - ROS2CallbackData AckermannControlSubscriber::GetMessage() { - auto message = _impl->GetMessage(); +AckermannControlSubscriber::AckermannControlSubscriber( + ROS2NameRecord& parent, carla::ros2::types::VehicleAckermannControlCallback vehicle_ackermann_control_callback) + : SubscriberBase(parent), + _impl(std::make_shared(*this)), + _vehicle_ackermann_control_callback(vehicle_ackermann_control_callback) {} - AckermannControl control; - control.steer = message.drive().steering_angle(); - control.steer_speed = message.drive().steering_angle_velocity(); - control.speed = message.drive().speed(); - control.acceleration = message.drive().acceleration(); - control.jerk = message.drive().jerk(); - return control; - } +bool AckermannControlSubscriber::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, get_topic_name("ackermann_cmd"), get_topic_qos()); +} - void AckermannControlSubscriber::ProcessMessages(ActorCallback callback) { - if (_impl->HasNewMessage()) { - auto control = this->GetMessage(); - callback(this->GetActor(), control); - } +void AckermannControlSubscriber::ProcessMessages() { + while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { + _vehicle_ackermann_control_callback(carla::ros2::types::VehicleAckermannControl(_impl->GetMessage())); } +} } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/AckermannControlSubscriber.h b/LibCarla/source/carla/ros2/subscribers/AckermannControlSubscriber.h index 36749b4c098..66d593ae1ae 100644 --- a/LibCarla/source/carla/ros2/subscribers/AckermannControlSubscriber.h +++ b/LibCarla/source/carla/ros2/subscribers/AckermannControlSubscriber.h @@ -5,38 +5,38 @@ #pragma once #include +#include -#include "BaseSubscriber.h" -#include "SubscriberImpl.h" - -#include "carla/ros2/types/AckermannDriveStamped.h" -#include "carla/ros2/types/AckermannDriveStampedPubSubTypes.h" - -#include "carla/ros2/ROS2CallbackData.h" +#include "ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h" +#include "carla/ros2/subscribers/SubscriberBase.h" +#include "carla/ros2/types/VehicleActorDefinition.h" namespace carla { namespace ros2 { - class AckermannControlSubscriber : public BaseSubscriber { - public: - struct AckermannMsgTraits { - using msg_type = ackermann_msgs::msg::AckermannDriveStamped; - using msg_pubsub_type = ackermann_msgs::msg::AckermannDriveStampedPubSubType; - }; - - - AckermannControlSubscriber(void* vehicle, std::string base_topic_name, std::string frame_id) : - BaseSubscriber(vehicle, base_topic_name, frame_id), - _impl(std::make_shared>()) { - _impl->Init(this->GetBaseTopicName() + "/ackermann_control_cmd"); - } - - ROS2CallbackData GetMessage(); - void ProcessMessages(ActorCallback callback); - - private: - std::shared_ptr> _impl; - }; +using AckermannControlSubscriberImpl = + DdsSubscriberImpl; + +class AckermannControlSubscriber : public SubscriberBase { +public: + explicit AckermannControlSubscriber( + ROS2NameRecord& parent, carla::ros2::types::VehicleAckermannControlCallback vehicle_ackermann_control_callback); + virtual ~AckermannControlSubscriber() = default; + + /** + * Implements SubscriberBase::ProcessMessages() + */ + void ProcessMessages() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + std::shared_ptr _impl; + carla::ros2::types::VehicleAckermannControlCallback _vehicle_ackermann_control_callback; +}; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.cpp new file mode 100644 index 00000000000..cb73974ab68 --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.cpp @@ -0,0 +1,34 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/subscribers/ActorSetTransformSubscriber.h" + +#include "carla/ros2/impl/DdsSubscriberImpl.h" + +namespace carla { +namespace ros2 { + +ActorSetTransformSubscriber::ActorSetTransformSubscriber(ROS2NameRecord& parent, + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback) + : SubscriberBase(parent), + _impl(std::make_shared(*this)), + _actor_set_transform_callback(actor_set_transform_callback) {} + +bool ActorSetTransformSubscriber::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, get_topic_name("set_transform"), get_topic_qos()); +} + +void ActorSetTransformSubscriber::ProcessMessages() { + while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { + if (_actor_set_transform_callback != nullptr ) { + _actor_set_transform_callback(carla::ros2::types::Transform(_impl->GetMessage())); + } + else { + carla::log_error("ActorSetTransformSubscriber::ProcessMessages >> set_transform callback is not available!"); + } + } +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.h b/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.h new file mode 100644 index 00000000000..891a55e0cc7 --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.h @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/subscribers/SubscriberBase.h" +#include "carla/ros2/types/ActorDefinition.h" +#include "geometry_msgs/msg/PosePubSubTypes.h" + +namespace carla { +namespace ros2 { + +using ActorSetTransformSubscriberImpl = + DdsSubscriberImpl; + +class ActorSetTransformSubscriber : public SubscriberBase { +public: + explicit ActorSetTransformSubscriber(ROS2NameRecord& parent, + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback); + virtual ~ActorSetTransformSubscriber() = default; + + /** + * Implements SubscriberBase::ProcessMessages() + */ + void ProcessMessages() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + std::shared_ptr _impl; + carla::ros2::types::ActorSetTransformCallback _actor_set_transform_callback; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/BaseSubscriber.h b/LibCarla/source/carla/ros2/subscribers/BaseSubscriber.h deleted file mode 100644 index 0a8f1b72aca..00000000000 --- a/LibCarla/source/carla/ros2/subscribers/BaseSubscriber.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2025Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include -#include - -#include "carla/ros2/ROS2CallbackData.h" - - -namespace carla { -namespace ros2 { - - class BaseSubscriber { - public: - - BaseSubscriber() {} - - BaseSubscriber(std::string base_topic_name) : - _base_topic_name(base_topic_name) {} - - BaseSubscriber(std::string base_topic_name, std::string frame_id) : - _base_topic_name(base_topic_name), - _frame_id(frame_id) {} - - BaseSubscriber(void* actor, std::string base_topic_name, std::string frame_id) : - _actor(actor), - _base_topic_name(base_topic_name), - _frame_id(frame_id) {} - - const std::string GetBaseTopicName() {return _base_topic_name; } - const std::string GetFrameId() { return _frame_id; } - - virtual ROS2CallbackData GetMessage() = 0; - virtual void ProcessMessages(ActorCallback callback) = 0; - - void* GetActor() { return _actor; } - - protected: - std::string _frame_id = ""; - std::string _base_topic_name = ""; - - void* _actor { nullptr }; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/CarlaControlSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/CarlaControlSubscriber.cpp new file mode 100644 index 00000000000..4a42aae219b --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/CarlaControlSubscriber.cpp @@ -0,0 +1,47 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/subscribers/CarlaControlSubscriber.h" + +#include "carla/ros2/impl/DdsSubscriberImpl.h" + +namespace carla { +namespace ros2 { + +CarlaControlSubscriber::CarlaControlSubscriber(ROS2NameRecord &parent, carla::rpc::RpcServerInterface &carla_server) + : SubscriberBaseSynchronizationClient(parent, carla_server), _impl(std::make_shared(*this)) {} + +bool CarlaControlSubscriber::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, get_topic_name("carla_control"), get_topic_qos().reliable()); +} + +CarlaControlSubscriber::~CarlaControlSubscriber() { +} + +void CarlaControlSubscriber::ProcessMessages() { + while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { + + auto const carla_control_msg_entry = _impl->GetMessageEntry(); + auto const command = carla_control_msg_entry.message.command(); + auto const synchronization_participant = GetSynchronizationParticipant(carla_control_msg_entry.publisher); + carla::log_debug("CarlaControlSubscriber[", ThisAsSynchronizationClient(), + "]::ProcessMessages(", carla_control_msg_entry.publisher, ", ", + synchronization_participant, + ") command =", std::to_string(command)); + switch (command) { + case carla_msgs::msg::CarlaControl_Constants::PLAY: + _carla_server.call_update_synchronization_window(ThisAsSynchronizationClient(), + synchronization_participant); + break; + case carla_msgs::msg::CarlaControl_Constants::PAUSE: + case carla_msgs::msg::CarlaControl_Constants::STEP_ONCE: + _carla_server.call_tick(ThisAsSynchronizationClient(), synchronization_participant, + carla::rpc::SynchronizationTickMode::FORCE_ENABLE_SYNC); + break; + } + } +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/CarlaControlSubscriber.h b/LibCarla/source/carla/ros2/subscribers/CarlaControlSubscriber.h new file mode 100644 index 00000000000..ab205180e4f --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/CarlaControlSubscriber.h @@ -0,0 +1,46 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/subscribers/SubscriberBaseSynchronizationClient.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla_msgs/msg/CarlaControlPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using CarlaControlSubscriberImpl = + DdsSubscriberImpl; + +class CarlaControlSubscriber : public SubscriberBaseSynchronizationClient { +public: + explicit CarlaControlSubscriber(ROS2NameRecord &parent, carla::rpc::RpcServerInterface &carla_server); + virtual ~CarlaControlSubscriber(); + + /** + * Implements SubscriberBase::ProcessMessages() + */ + void ProcessMessages() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + /** + * Implements SubscriberBaseSynchronizationClient::ThisAsSynchronizationClient() interface + */ + carla::rpc::synchronization_client_id_type ThisAsSynchronizationClient() override { + return get_topic_name("carla_control"); + } + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/CarlaEgoVehicleControlSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/CarlaEgoVehicleControlSubscriber.cpp deleted file mode 100644 index d3d3e7b646b..00000000000 --- a/LibCarla/source/carla/ros2/subscribers/CarlaEgoVehicleControlSubscriber.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "CarlaEgoVehicleControlSubscriber.h" - -#include "carla/ros2/ROS2CallbackData.h" - -namespace carla { -namespace ros2 { - - ROS2CallbackData CarlaEgoVehicleControlSubscriber::GetMessage() { - auto message = _impl->GetMessage(); - - VehicleControl control; - control.throttle = message.throttle(); - control.steer = message.steer(); - control.brake = message.brake(); - control.hand_brake = message.hand_brake(); - control.reverse = message.reverse(); - control.gear = message.gear(); - control.manual_gear_shift = message.manual_gear_shift(); - return control; - } - - void CarlaEgoVehicleControlSubscriber::ProcessMessages(ActorCallback callback) { - if (_impl->HasNewMessage()) { - auto control = this->GetMessage(); - callback(this->GetActor(), control); - } - } - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/CarlaEgoVehicleControlSubscriber.h b/LibCarla/source/carla/ros2/subscribers/CarlaEgoVehicleControlSubscriber.h deleted file mode 100644 index 39f108fb30d..00000000000 --- a/LibCarla/source/carla/ros2/subscribers/CarlaEgoVehicleControlSubscriber.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#include "BaseSubscriber.h" -#include "SubscriberImpl.h" - -#include "carla/ros2/types/CarlaEgoVehicleControl.h" -#include "carla/ros2/types/CarlaEgoVehicleControlPubSubTypes.h" - -#include "carla/ros2/ROS2CallbackData.h" - -namespace carla { -namespace ros2 { - - class CarlaEgoVehicleControlSubscriber : public BaseSubscriber { - public: - struct ControlMsgTraits { - using msg_type = carla_msgs::msg::CarlaEgoVehicleControl; - using msg_pubsub_type = carla_msgs::msg::CarlaEgoVehicleControlPubSubType; - }; - - - CarlaEgoVehicleControlSubscriber(void* vehicle, std::string base_topic_name, std::string frame_id) : - BaseSubscriber(vehicle, base_topic_name, frame_id), - _impl(std::make_shared>()) { - _impl->Init(this->GetBaseTopicName() + "/vehicle_control_cmd"); - } - - ROS2CallbackData GetMessage(); - void ProcessMessages(ActorCallback callback); - - private: - std::shared_ptr> _impl; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.cpp new file mode 100644 index 00000000000..6e6cc3eba44 --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.h" + +#include "carla/ros2/impl/DdsSubscriberImpl.h" + +namespace carla { +namespace ros2 { + +CarlaSynchronizationWindowSubscriber::CarlaSynchronizationWindowSubscriber(ROS2NameRecord &parent, + carla::rpc::RpcServerInterface &carla_server) + : SubscriberBaseSynchronizationClient(parent, carla_server), + _impl(std::make_shared(*this)) + {} + +bool CarlaSynchronizationWindowSubscriber::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, get_topic_name("synchronization_window"), get_topic_qos().reliable()); +} + +CarlaSynchronizationWindowSubscriber::~CarlaSynchronizationWindowSubscriber() { +} + +void CarlaSynchronizationWindowSubscriber::ProcessMessages() { + while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { + auto const carla_synchronization_window_msg_entry = _impl->GetMessageEntry(); + auto carla_synchronization_target_game_time = + carla_synchronization_window_msg_entry.message.synchronization_window_target_game_time(); + auto const synchronization_participant = GetSynchronizationParticipant(carla_synchronization_window_msg_entry.publisher); + + carla::log_debug("CarlaSynchronizationWindowSubscriber[", ThisAsSynchronizationClient(), + "]::ProcessMessages(", carla_synchronization_window_msg_entry.publisher, ", ", + synchronization_participant, + ")=", carla_synchronization_target_game_time); + _carla_server.call_update_synchronization_window( + ThisAsSynchronizationClient(), + synchronization_participant, + carla_synchronization_target_game_time); + } +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.h b/LibCarla/source/carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.h new file mode 100644 index 00000000000..8572583abaf --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.h @@ -0,0 +1,49 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/subscribers/SubscriberBaseSynchronizationClient.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla/rpc/ServerSynchronizationTypes.h" +#include "carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using CarlaSynchronizationWindowSubscriberImpl = + DdsSubscriberImpl; + +class CarlaSynchronizationWindowSubscriber : public SubscriberBaseSynchronizationClient { +public: + explicit CarlaSynchronizationWindowSubscriber(ROS2NameRecord &parent, carla::rpc::RpcServerInterface &carla_server); + virtual ~CarlaSynchronizationWindowSubscriber(); + + /** + * Implements SubscriberBase::ProcessMessages() + */ + void ProcessMessages() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + + /** + * Implements SubscriberBaseSynchronizationClient::ThisAsSynchronizationClient() interface + */ + carla::rpc::synchronization_client_id_type ThisAsSynchronizationClient() override { + return get_topic_name("synchronization_window"); + } + + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/SubscriberBase.h b/LibCarla/source/carla/ros2/subscribers/SubscriberBase.h new file mode 100644 index 00000000000..85879e19c0e --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/SubscriberBase.h @@ -0,0 +1,87 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/ROS2NameRecord.h" +#include "carla/ros2/ROS2QoS.h" + +namespace carla { +namespace ros2 { + +/** + A Subscriber base class. + */ +template +class DdsSubscriberImpl; + +/** + * Subscriber Base class + */ +template +class SubscriberBase { +public: + SubscriberBase(ROS2NameRecord &parent) : _parent(parent) { + log_debug("SubscriberBase created for topic {}", parent.get_topic_name()); + } + virtual ~SubscriberBase() { + log_debug("SubscriberBase destroyed for topic {}", _parent.get_topic_name()); + }; + + /** + * Initialze the subscriber + */ + virtual bool Init(std::shared_ptr domain_participant) = 0; + + /** + * Process all available messages. + */ + virtual void ProcessMessages() = 0; + + /** + * A new publisher has connected to this subscriber. + */ + virtual void PublisherConnected(std::string const &publisher_guid) { + (void)publisher_guid; + } + + /** + * A publisher has disconnected from this subscriber. + */ + virtual void PublisherDisconnected(std::string const &publisher_guid) { + (void)publisher_guid; + } + + /* + * @brief Default get_topic_qos() for subscribers + * + * Be aware: The default selection for subscribers is NOT as done default in ROS2 (which aims compatibility to ROS1)! + * Per default, we want to achieve the most compatible combination within ROS2 world in the sense, + * that receiption is possible for all possible publisher configurations. + * https://docs.ros.org/en/humble/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-compatibilities + * + * Reliability::BEST_EFFORT + * Durability::VOLATILE + * History::KEEP_LAST, depth: 10u + */ + ROS2QoS get_topic_qos() const { + return DEFAULT_SUBSCRIBER_QOS; + }; + + std::string get_topic_name(std::string postfix = "") const { + return _parent.get_topic_name(postfix); + } + + carla::streaming::detail::actor_id_type get_actor_id() const { + return _parent.get_actor_id(); + } + +protected: + ROS2NameRecord &_parent; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/SubscriberBaseSynchronizationClient.h b/LibCarla/source/carla/ros2/subscribers/SubscriberBaseSynchronizationClient.h new file mode 100644 index 00000000000..2661af79a9c --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/SubscriberBaseSynchronizationClient.h @@ -0,0 +1,85 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/subscribers/SubscriberBase.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla/rpc/ServerSynchronizationTypes.h" + +namespace carla { +namespace ros2 { + + +template +class SubscriberBaseSynchronizationClient : public SubscriberBase { +public: + explicit SubscriberBaseSynchronizationClient(ROS2NameRecord &parent, carla::rpc::RpcServerInterface &carla_server) : + SubscriberBase(parent), + _carla_server(carla_server) { + } + + virtual ~SubscriberBaseSynchronizationClient() { + if ( !_synchronization_client_id.empty() ) { + for (auto [publisher_guid, participant] : _carla_synchronization_window_participants) { + carla::log_debug("~SubscriberBaseSynchronizationClient[", _synchronization_client_id, "]:: disconnect publisher (", + publisher_guid, ", ", participant, ")"); + _carla_server.call_deregister_synchronization_participant(_synchronization_client_id, participant); + } + } + _carla_synchronization_window_participants.clear(); + } + + /** + * Implements SubscriberBase::PublisherConnected() + */ + void PublisherConnected(std::string const &publisher_guid) override { + if ( _synchronization_client_id.empty() ) { + _synchronization_client_id = ThisAsSynchronizationClient(); + } + auto carla_synchronization_window_participant = _carla_server.call_register_synchronization_participant(ThisAsSynchronizationClient()).Get(); + _carla_synchronization_window_participants.insert({publisher_guid, carla_synchronization_window_participant}); + carla::log_debug("SubscriberBaseSynchronizationClient[", ThisAsSynchronizationClient(), "]::PublisherConnected(", + publisher_guid, ", ", carla_synchronization_window_participant, ")"); + } + + /** + * Implements SubscriberBase::PublisherDisconnected() + */ + void PublisherDisconnected(std::string const &publisher_guid) override { + auto carla_synchronization_window_participant = GetSynchronizationParticipant(publisher_guid); + carla::log_debug("SubscriberBaseSynchronizationClient[", ThisAsSynchronizationClient(), "]::PublisherDisconnected(", + publisher_guid, ", ", carla_synchronization_window_participant, ")"); + _carla_server.call_deregister_synchronization_participant(ThisAsSynchronizationClient(), + carla_synchronization_window_participant); + _carla_synchronization_window_participants.erase(publisher_guid); + } + + +protected: + + virtual carla::rpc::synchronization_client_id_type ThisAsSynchronizationClient() = 0; + + carla::rpc::synchronization_participant_id_type GetSynchronizationParticipant(std::string const &participant_guid) { + auto find_result = _carla_synchronization_window_participants.find(participant_guid); + if ( find_result != _carla_synchronization_window_participants.end() ) { + return find_result->second; + } + carla::log_error("SubscriberBaseSynchronizationClient[", ThisAsSynchronizationClient(), "]::GetSynchronizationParticipant(", + participant_guid, ") participant not found."); + return carla::rpc::ALL_PARTICIPANTS; + } + + carla::rpc::RpcServerInterface &_carla_server; + +private: + std::map + _carla_synchronization_window_participants; + carla::rpc::synchronization_client_id_type _synchronization_client_id; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/SubscriberImpl.h b/LibCarla/source/carla/ros2/subscribers/SubscriberImpl.h deleted file mode 100644 index 9baaadd84d9..00000000000 --- a/LibCarla/source/carla/ros2/subscribers/SubscriberImpl.h +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include - -#include "carla/ros2/subscribers/BaseSubscriber.h" - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include "carla/Logging.h" - -namespace carla { -namespace ros2 { - - namespace efd = eprosima::fastdds::dds; - using erc = eprosima::fastrtps::types::ReturnCode_t; - - template - class SubscriberImpl : public eprosima::fastdds::dds::DataReaderListener { - public: - using msg_type = typename S::msg_type; - using msg_pubsub_type = typename S::msg_pubsub_type; - - efd::DomainParticipant* _participant { nullptr }; - efd::Subscriber* _subscriber { nullptr }; - efd::Topic* _topic { nullptr }; - efd::DataReader* _datareader { nullptr }; - efd::TypeSupport _type { new msg_pubsub_type() }; - - void on_subscription_matched(efd::DataReader* reader, const efd::SubscriptionMatchedStatus& info) override { - _alive = (info.total_count > 0) ? true : false; - } - - void on_data_available(efd::DataReader* reader) override { - efd::SampleInfo info; - msg_type message; - - eprosima::fastrtps::types::ReturnCode_t rcode = reader->take_next_sample(&_message, &info); - if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { - // TODO: Process messages directly. - _new_message = true; - } else { - log_error("SubscriberImpl::on_data_available (", this->GetTopicName(), ") failed with code:", rcode()); - } - } - - ~SubscriberImpl() { - if (_datareader) - _subscriber->delete_datareader(_datareader); - - if (_subscriber) - _participant->delete_subscriber(_subscriber); - - if (_topic) - _participant->delete_topic(_topic); - - if (_participant) - efd::DomainParticipantFactory::get_instance()->delete_participant(_participant); - } - - // bool Init(std::string topic_name, S *subscriber) { - bool Init(std::string topic_name) { - if (_type == nullptr) { - log_error("Invalid TypeSupport"); - return false; - } - - efd::DomainParticipantQos pqos = efd::PARTICIPANT_QOS_DEFAULT; - auto factory = efd::DomainParticipantFactory::get_instance(); - _participant = factory->create_participant(0, pqos); - if (_participant == nullptr) { - log_error("Failed to create DomainParticipant"); - return false; - } - _type.register_type(_participant); - - efd::SubscriberQos subqos = efd::SUBSCRIBER_QOS_DEFAULT; - _subscriber = _participant->create_subscriber(subqos, nullptr); - if (_subscriber == nullptr) { - log_error("Failed to create Subscriber"); - return false; - } - - efd::TopicQos tqos = efd::TOPIC_QOS_DEFAULT; - _topic = _participant->create_topic(topic_name, _type->getName(), tqos); - if (_topic == nullptr) { - log_error("Failed to create Topic"); - return false; - } - - efd::DataReaderQos rqos = efd::DATAREADER_QOS_DEFAULT; - efd::DataReaderListener* listener = (efd::DataReaderListener*)(this); - _datareader = _subscriber->create_datareader(_topic, rqos, listener); - if (_datareader == nullptr) { - log_error("Failed to create DataReader"); - return false; - } - - _topic_name = topic_name; - - // _subscriber = subscriber; - return true; - } - - std::string GetTopicName() { - return _topic_name; - } - - bool IsAlive() { - return _alive; - } - - msg_type GetMessage() { - _new_message = false; - return _message; - } - - bool HasNewMessage() { return _new_message; } - - private: - std::string _topic_name; - - bool _alive { false }; - bool _new_message { false }; - msg_type _message; - }; - -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/SubscriberImplBase.h b/LibCarla/source/carla/ros2/subscribers/SubscriberImplBase.h new file mode 100644 index 00000000000..6ed2966dfdd --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/SubscriberImplBase.h @@ -0,0 +1,165 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +namespace carla { +namespace ros2 { + +template +class SubscriberBase; + +/** + * Base class for subscriber implementations + */ +template +class SubscriberImplBase { +public: + /** + * Default constructor. + */ + SubscriberImplBase(SubscriberBase &parent) : _parent(parent) {} + /** + * Copy operation not allowed due to active subscriptions + */ + SubscriberImplBase(const SubscriberImplBase &) = delete; + /** + * Assignment operation not allowed due to active subscriptions + */ + SubscriberImplBase &operator=(const SubscriberImplBase &) = delete; + /** + * Move operation not allowed due to active subscriptions + */ + SubscriberImplBase(SubscriberImplBase &&) = delete; + /** + * Move operation not allowed due to active subscriptions + */ + SubscriberImplBase &operator=(SubscriberImplBase &&) = delete; + + /** + * Default destructor. + */ + virtual ~SubscriberImplBase() = default; + + struct MessageEntry { + // a process local unique identification of the publisher that has sent the message + std::string publisher{}; + // the actual message + MESSAGE_TYPE message{}; + }; + + /** + * Get the list of currently alive publishers in the order of their appearance. + */ + std::list GetConnectedPublishers() const { + std::lock_guard access_lock(_access_mutex); + return _connected_publishers; + } + + /** + * Check if there are publishers connected to this + */ + bool HasPublishersConnected() const { + std::lock_guard access_lock(_access_mutex); + return !_connected_publishers.empty(); + } + + /** + * Report how many publishers are connected to this + */ + std::size_t NumberPublishersConnected() const { + std::lock_guard access_lock(_access_mutex); + return _connected_publishers.size(); + } + + /** + * Check if there is a new message available + */ + bool HasNewMessage() const { + std::lock_guard access_lock(_access_mutex); + return !_messages.empty(); + } + + /** + * Get the list of the current available message entry. + */ + std::list GetMessageEntries() { + std::lock_guard access_lock(_access_mutex); + std::list messages; + messages.swap(_messages); + return messages; + } + + /** + * Implements SubscriberImplBase::GetMessageEntry() interface + */ + MessageEntry GetMessageEntry() { + std::lock_guard access_lock(_access_mutex); + if (_messages.empty()) { + return MessageEntry(); + } + auto message = _messages.front(); + _messages.pop_front(); + return message; + } + + /** + * Get the next message. This is a conventient function for subscribers that don't care on the identification of the + * sender. + */ + const MESSAGE_TYPE GetMessage() { + return GetMessageEntry().message; + } + +protected: + void AddMessage(std::string const &publisher_guid, MESSAGE_TYPE &message) { + std::lock_guard access_lock(_access_mutex); + _messages.push_back({publisher_guid, message}); + carla::log_debug("SubscriberImplBase[", _parent.get_topic_name(), "]::AddMessage(", publisher_guid, + ") number of messages: ", _messages.size()); + } + + void AddPublisher(std::string const &publisher_guid) { + { + std::lock_guard access_lock(_access_mutex); + _connected_publishers.push_back(publisher_guid); + carla::log_debug("SubscriberImplBase[", _parent.get_topic_name(), "]::AddPublisher(", publisher_guid, + ") number of connected publisher: ", _connected_publishers.size()); + } + _parent.PublisherConnected(publisher_guid); + } + + void RemovePublisher(std::string const &publisher_guid) { + _parent.PublisherDisconnected(publisher_guid); + { + std::lock_guard access_lock(_access_mutex); + _connected_publishers.remove_if([publisher_guid](std::string const &element) -> bool { + return publisher_guid == element; + }); + carla::log_debug("SubscriberImplBase[", _parent.get_topic_name(), "]::RemovePublisher(", publisher_guid, + ") number of connected publisher: ", _connected_publishers.size()); + } + } + + void Clear() { + std::lock_guard access_lock(_access_mutex); + for (auto const &publisher_guid: _connected_publishers) { + _parent.PublisherDisconnected(publisher_guid); + } + _connected_publishers.clear(); + _messages.clear(); + } + +private: + // keep the data private to ensure access_mutex is hold while accessing + mutable std::mutex _access_mutex{}; + SubscriberBase &_parent; + std::list _connected_publishers; + std::list _messages; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/UeV2XCustomSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/UeV2XCustomSubscriber.cpp new file mode 100644 index 00000000000..2924659dc9f --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/UeV2XCustomSubscriber.cpp @@ -0,0 +1,35 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/subscribers/UeV2XCustomSubscriber.h" + +#include "carla/ros2/impl/DdsSubscriberImpl.h" + +namespace carla { +namespace ros2 { + +UeV2XCustomSubscriber::UeV2XCustomSubscriber(ROS2NameRecord& parent, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback) + : SubscriberBase(parent), + _impl(std::make_shared(*this)), + _v2x_custom_send_callback(v2x_custom_send_callback) {} + +bool UeV2XCustomSubscriber::Init(std::shared_ptr domain_participant) { + // need to ensure reliable v2x data receiption and allow larger data chuncks (up to 100byte * 1000 = 100 kB) + return _impl->Init(domain_participant, get_topic_name("send"), get_topic_qos().reliable().keep_last(1000)); +} + +void UeV2XCustomSubscriber::ProcessMessages() { + while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { + auto const message = _impl->GetMessage(); + carla::rpc::CustomV2XBytes data; + data.bytes = message.bytes(); + data.data_size = message.data_size(); + + _v2x_custom_send_callback(data); + } +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/UeV2XCustomSubscriber.h b/LibCarla/source/carla/ros2/subscribers/UeV2XCustomSubscriber.h new file mode 100644 index 00000000000..5322b9f420d --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/UeV2XCustomSubscriber.h @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/subscribers/SubscriberBase.h" +#include "carla/ros2/types/SensorActorDefinition.h" +#include "carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using UeV2XCustomSubscriberImpl = + DdsSubscriberImpl; + +class UeV2XCustomSubscriber : public SubscriberBase { +public: + explicit UeV2XCustomSubscriber(ROS2NameRecord& parent, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback); + virtual ~UeV2XCustomSubscriber() = default; + + /** + * Implements SubscriberBase::ProcessMessages() + */ + void ProcessMessages() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + std::shared_ptr _impl; + carla::ros2::types::V2XCustomSendCallback _v2x_custom_send_callback; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/VehicleControlSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/VehicleControlSubscriber.cpp new file mode 100644 index 00000000000..03a6cc39baa --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/VehicleControlSubscriber.cpp @@ -0,0 +1,29 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/subscribers/VehicleControlSubscriber.h" + +#include "carla/ros2/impl/DdsSubscriberImpl.h" + +namespace carla { +namespace ros2 { + +VehicleControlSubscriber::VehicleControlSubscriber(ROS2NameRecord& parent, + carla::ros2::types::VehicleControlCallback vehicle_control_callback) + : SubscriberBase(parent), + _impl(std::make_shared(*this)), + _vehicle_control_callback(vehicle_control_callback) {} + +bool VehicleControlSubscriber::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, get_topic_name("vehicle_control_cmd"), get_topic_qos()); +} + +void VehicleControlSubscriber::ProcessMessages() { + while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { + _vehicle_control_callback(carla::ros2::types::VehicleControl(_impl->GetMessage())); + } +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/VehicleControlSubscriber.h b/LibCarla/source/carla/ros2/subscribers/VehicleControlSubscriber.h new file mode 100644 index 00000000000..87cc0654c0f --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/VehicleControlSubscriber.h @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/subscribers/SubscriberBase.h" +#include "carla/ros2/types/VehicleActorDefinition.h" +#include "carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using VehicleControlSubscriberImpl = + DdsSubscriberImpl; + +class VehicleControlSubscriber : public SubscriberBase { +public: + explicit VehicleControlSubscriber(ROS2NameRecord& parent, + carla::ros2::types::VehicleControlCallback vehicle_control_callback); + virtual ~VehicleControlSubscriber() = default; + + /** + * Implements SubscriberBase::ProcessMessages() + */ + void ProcessMessages() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + std::shared_ptr _impl; + carla::ros2::types::VehicleControlCallback _vehicle_control_callback; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/WalkerControlSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/WalkerControlSubscriber.cpp new file mode 100644 index 00000000000..4e8b44c35ea --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/WalkerControlSubscriber.cpp @@ -0,0 +1,29 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/subscribers/WalkerControlSubscriber.h" + +#include "carla/ros2/impl/DdsSubscriberImpl.h" + +namespace carla { +namespace ros2 { + +WalkerControlSubscriber::WalkerControlSubscriber(ROS2NameRecord& parent, + carla::ros2::types::WalkerControlCallback walker_control_callback) + : SubscriberBase(parent), + _impl(std::make_shared(*this)), + _walker_control_callback(walker_control_callback) {} + +bool WalkerControlSubscriber::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, get_topic_name("walker_control_cmd"), get_topic_qos()); +} + +void WalkerControlSubscriber::ProcessMessages() { + while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { + _walker_control_callback(carla::ros2::types::WalkerControl(_impl->GetMessage())); + } +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/WalkerControlSubscriber.h b/LibCarla/source/carla/ros2/subscribers/WalkerControlSubscriber.h new file mode 100644 index 00000000000..eebbd109af5 --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/WalkerControlSubscriber.h @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/subscribers/SubscriberBase.h" +#include "carla/ros2/types/WalkerActorDefinition.h" +#include "carla_msgs/msg/CarlaWalkerControlPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using WalkerControlSubscriberImpl = + DdsSubscriberImpl; + +class WalkerControlSubscriber : public SubscriberBase { +public: + explicit WalkerControlSubscriber(ROS2NameRecord& parent, + carla::ros2::types::WalkerControlCallback walker_control_callback); + virtual ~WalkerControlSubscriber() = default; + + /** + * Implements SubscriberBase::ProcessMessages() + */ + void ProcessMessages() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + std::shared_ptr _impl; + carla::ros2::types::WalkerControlCallback _walker_control_callback; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/types/AcceleratedMovement.h b/LibCarla/source/carla/ros2/types/AcceleratedMovement.h new file mode 100644 index 00000000000..8d832697968 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/AcceleratedMovement.h @@ -0,0 +1,109 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/Debug.h" +#include "carla/geom/Acceleration.h" +#include "carla/ros2/types/AngularVelocity.h" +#include "carla/ros2/types/Speed.h" +#include "carla/ros2/types/Timestamp.h" +#include "carla/ros2/types/Twist.h" +#include "geometry_msgs/msg/AccelWithCovariance.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Track accelerations based on Speed upates + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS) +*/ +class AcceleratedMovement { +public: + AcceleratedMovement() = default; + ~AcceleratedMovement() = default; + AcceleratedMovement(const AcceleratedMovement&) = default; + AcceleratedMovement& operator=(const AcceleratedMovement&) = default; + AcceleratedMovement(AcceleratedMovement&&) = default; + AcceleratedMovement& operator=(AcceleratedMovement&&) = default; + + void UpdateSpeed(Speed const& speed, AngularVelocity const& angular_velocity, Timestamp const& timestamp) { + float delta_seconds = static_cast(timestamp.Stamp() - _last_timestamp.Stamp()); + if (delta_seconds > 1e-9) { + auto last_linear_velocity_ros = _last_speed.LinearVelocityROS(); + auto current_linear_velocity_ros = speed.LinearVelocityROS(); + auto current_linear_acceleration_ros = (current_linear_velocity_ros - last_linear_velocity_ros) / delta_seconds; + _ros_accel.linear().x(current_linear_acceleration_ros.x); + _ros_accel.linear().y(current_linear_acceleration_ros.y); + _ros_accel.linear().z(current_linear_acceleration_ros.z); + + auto last_angular_velocity_ros = _last_angular_velocity.AngularVelocityROS(); + auto current_angular_velocity_ros = angular_velocity.AngularVelocityROS(); + auto current_angular_acceleration_ros = + (current_angular_velocity_ros - last_angular_velocity_ros) / delta_seconds; + _ros_accel.angular().x(current_angular_acceleration_ros.x); + _ros_accel.angular().y(current_angular_acceleration_ros.y); + _ros_accel.angular().z(current_angular_acceleration_ros.z); + } + _last_speed = speed; + _last_angular_velocity = angular_velocity; + _last_timestamp = timestamp; + } + + /** + * The resulting ROS geometry_msgs::msg::Accel + */ + geometry_msgs::msg::Accel accel() const { + return _ros_accel; + } + + /** + * The resulting ROS geometry_msgs::msg::AccelWithCovariance + */ + geometry_msgs::msg::AccelWithCovariance accel_with_covariance() const { + geometry_msgs::msg::AccelWithCovariance _ros_accel_with_covariance; + _ros_accel_with_covariance.accel(_ros_accel); + return _ros_accel_with_covariance; + } + + /** + * The resulting ROS geometry_msgs::msg::Twist + */ + geometry_msgs::msg::Twist twist() const { + carla::ros2::types::Twist ros_twist(_last_speed, _last_angular_velocity); + return ros_twist.twist(); + } + + /** + * The resulting ROS geometry_msgs::msg::TwistWithCovariance + */ + geometry_msgs::msg::TwistWithCovariance twist_with_covariance() const { + carla::ros2::types::Twist ros_twist(_last_speed, _last_angular_velocity); + return ros_twist.twist_with_covariance(); + } + + carla::ros2::types::Speed const& Speed() const { + return _last_speed; + } + + carla::ros2::types::AngularVelocity const& AngularVelocity() const { + return _last_angular_velocity; + } + + carla::ros2::types::Timestamp const& Timestamp() const { + return _last_timestamp; + } + +private: + carla::ros2::types::Speed _last_speed{carla::geom::Vector3D(), carla::geom::Quaternion()}; + carla::ros2::types::AngularVelocity _last_angular_velocity{carla::geom::AngularVelocity()}; + carla::ros2::types::Timestamp _last_timestamp; + geometry_msgs::msg::Accel _ros_accel; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Acceleration.h b/LibCarla/source/carla/ros2/types/Acceleration.h new file mode 100644 index 00000000000..3820f5ea46d --- /dev/null +++ b/LibCarla/source/carla/ros2/types/Acceleration.h @@ -0,0 +1,48 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/geom/Acceleration.h" +#include "carla/ros2/types/CoordinateSystemTransform.h" +#include "geometry_msgs/msg/Accel.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla (linear) acceleration to a ROS accel (linear part) + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS) +*/ +class Acceleration { +public: + /** + * carla_acceleration: the carla linear acceleration; this is not provided by UE4 + * therefore has to be deduced from the Velocity + */ + Acceleration(carla::geom::Acceleration const& carla_linear_acceleration = carla::geom::Acceleration()) { + _ros_accel.linear() = CoordinateSystemTransform::TransformLinearAxisMsg(carla_linear_acceleration); + } + ~Acceleration() = default; + Acceleration(const Acceleration&) = default; + Acceleration& operator=(const Acceleration&) = default; + Acceleration(Acceleration&&) = default; + Acceleration& operator=(Acceleration&&) = default; + + /** + * The resulting ROS geometry_msgs::msg::Accel + */ + geometry_msgs::msg::Accel accel() const { + return _ros_accel; + } + +private: + geometry_msgs::msg::Accel _ros_accel; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/AckermannDrive.h b/LibCarla/source/carla/ros2/types/AckermannDrive.h deleted file mode 100644 index b7488e1b169..00000000000 --- a/LibCarla/source/carla/ros2/types/AckermannDrive.h +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AckermannDrive.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ -#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ - - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ACKERMANNDRIVE_SOURCE) -#define ACKERMANNDRIVE_DllAPI __declspec( dllexport ) -#else -#define ACKERMANNDRIVE_DllAPI __declspec( dllimport ) -#endif // ACKERMANNDRIVE_SOURCE -#else -#define ACKERMANNDRIVE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define ACKERMANNDRIVE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - -namespace ackermann_msgs { - namespace msg { - /*! - * @brief This class represents the structure AckermannDrive defined by the user in the IDL file. - * @ingroup AckermannDrive - */ - class AckermannDrive - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AckermannDrive(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AckermannDrive(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. - */ - eProsima_user_DllExport AckermannDrive( - const AckermannDrive& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. - */ - eProsima_user_DllExport AckermannDrive( - AckermannDrive&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. - */ - eProsima_user_DllExport AckermannDrive& operator =( - const AckermannDrive& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. - */ - eProsima_user_DllExport AckermannDrive& operator =( - AckermannDrive&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ackermann_msgs::msg::AckermannDrive object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AckermannDrive& x) const; - - /*! - * @brief Comparison operator. - * @param x ackermann_msgs::msg::AckermannDrive object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AckermannDrive& x) const; - - /*! - * @brief This function sets a value in member steering_angle - * @param _steering_angle New value for member steering_angle - */ - eProsima_user_DllExport void steering_angle( - float _steering_angle); - - /*! - * @brief This function returns the value of member steering_angle - * @return Value of member steering_angle - */ - eProsima_user_DllExport float steering_angle() const; - - /*! - * @brief This function returns a reference to member steering_angle - * @return Reference to member steering_angle - */ - eProsima_user_DllExport float& steering_angle(); - - /*! - * @brief This function sets a value in member steering_angle_velocity - * @param _steering_angle_velocity New value for member steering_angle_velocity - */ - eProsima_user_DllExport void steering_angle_velocity( - float _steering_angle_velocity); - - /*! - * @brief This function returns the value of member steering_angle_velocity - * @return Value of member steering_angle_velocity - */ - eProsima_user_DllExport float steering_angle_velocity() const; - - /*! - * @brief This function returns a reference to member steering_angle_velocity - * @return Reference to member steering_angle_velocity - */ - eProsima_user_DllExport float& steering_angle_velocity(); - - /*! - * @brief This function sets a value in member speed - * @param _speed New value for member speed - */ - eProsima_user_DllExport void speed( - float _speed); - - /*! - * @brief This function returns the value of member speed - * @return Value of member speed - */ - eProsima_user_DllExport float speed() const; - - /*! - * @brief This function returns a reference to member speed - * @return Reference to member speed - */ - eProsima_user_DllExport float& speed(); - - /*! - * @brief This function sets a value in member acceleration - * @param _acceleration New value for member acceleration - */ - eProsima_user_DllExport void acceleration( - float _acceleration); - - /*! - * @brief This function returns the value of member acceleration - * @return Value of member acceleration - */ - eProsima_user_DllExport float acceleration() const; - - /*! - * @brief This function returns a reference to member acceleration - * @return Reference to member acceleration - */ - eProsima_user_DllExport float& acceleration(); - - /*! - * @brief This function sets a value in member jerk - * @param _jerk New value for member jerk - */ - eProsima_user_DllExport void jerk( - float _jerk); - - /*! - * @brief This function returns the value of member jerk - * @return Value of member jerk - */ - eProsima_user_DllExport float jerk() const; - - /*! - * @brief This function returns a reference to member jerk - * @return Reference to member jerk - */ - eProsima_user_DllExport float& jerk(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ackermann_msgs::msg::AckermannDrive& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - float m_steering_angle; - float m_steering_angle_velocity; - float m_speed; - float m_acceleration; - float m_jerk; - - }; - } // namespace msg -} // namespace ackermann_msgs - -#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ - diff --git a/LibCarla/source/carla/ros2/types/AckermannDrivePubSubTypes.h b/LibCarla/source/carla/ros2/types/AckermannDrivePubSubTypes.h deleted file mode 100644 index d2db6e7cc6a..00000000000 --- a/LibCarla/source/carla/ros2/types/AckermannDrivePubSubTypes.h +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AckermannDrivePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - - -#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ - -#include -#include - -#include "AckermannDrive.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated AckermannDrive is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace ackermann_msgs -{ - namespace msg - { - - #ifndef SWIG - namespace detail { - - template - struct AckermannDrive_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct AckermannDrive_f - { - typedef float AckermannDrive::* type; - friend constexpr type get( - AckermannDrive_f); - }; - - template struct AckermannDrive_rob; - - template - inline size_t constexpr AckermannDrive_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type AckermannDrive defined by the user in the IDL file. - * @ingroup AckermannDrive - */ - class AckermannDrivePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef AckermannDrive type; - - eProsima_user_DllExport AckermannDrivePubSubType(); - - eProsima_user_DllExport virtual ~AckermannDrivePubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) AckermannDrive(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_impl() - { - return 20ULL == (detail::AckermannDrive_offset_of() + sizeof(float)); - - }}; - } -} - -#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ - diff --git a/LibCarla/source/carla/ros2/types/ActorDefinition.h b/LibCarla/source/carla/ros2/types/ActorDefinition.h new file mode 100644 index 00000000000..234cf2f8d2b --- /dev/null +++ b/LibCarla/source/carla/ros2/types/ActorDefinition.h @@ -0,0 +1,47 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/geom/BoundingBox.h" +#include "carla/ros2/types/ActorNameDefinition.h" +#include "carla/ros2/types/Polygon.h" +#include "carla/ros2/types/Transform.h" + +namespace carla { +namespace ros2 { +namespace types { + +using ActorSetTransformCallback = std::function; + +struct ActorDefinition : public ActorNameDefinition { + ActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox bounding_box_, + carla::ros2::types::Polygon vertex_polygon_) + : ActorNameDefinition(actor_name_definition), bounding_box(bounding_box_), vertex_polygon(vertex_polygon_) + { + if ( std::fpclassify(bounding_box.extent.x) != FP_NORMAL ) + { + bounding_box.extent.x = 0.1f; + bounding_box.extent.y = 0.1f; + bounding_box.extent.z = 0.1f; + } + } + + carla::geom::BoundingBox bounding_box; + carla::ros2::types::Polygon vertex_polygon; +}; + + + +} // namespace types +} // namespace ros2 +} // namespace carla + +namespace std { + +inline std::string to_string(carla::ros2::types::ActorDefinition const &actor_definition) { + return "Actor(" + to_string(static_cast(actor_definition)) + ")"; +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp b/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp new file mode 100644 index 00000000000..b30ad3ed4c4 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp @@ -0,0 +1,33 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/types/ActorNameDefinition.h" + +#include "carla/ros2/ROS2NameRegistry.h" + +namespace carla { +namespace ros2 { +namespace types { + +carla_msgs::msg::CarlaActorInfo ActorNameDefinition::carla_actor_info(std::shared_ptr name_registry) const { + carla_msgs::msg::CarlaActorInfo actor_info; + actor_info.id(id); + actor_info.parent_id(name_registry->ParentActorId(id)); + actor_info.type(type_id); + actor_info.rosname(ros_name); + actor_info.rolename(role_name); + actor_info.object_type(object_type); + actor_info.base_type(base_type); + auto topic_prefix = name_registry->TopicPrefix(id); + if ( topic_prefix.length() >= 3 ) + { + // remove "rt" prefix + actor_info.topic_prefix(topic_prefix.substr(3)); + } + return actor_info; +} + +} // namespace types +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/types/ActorNameDefinition.h b/LibCarla/source/carla/ros2/types/ActorNameDefinition.h new file mode 100644 index 00000000000..3820cb1bbda --- /dev/null +++ b/LibCarla/source/carla/ros2/types/ActorNameDefinition.h @@ -0,0 +1,62 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/streaming/detail/Types.h" +#include "carla_msgs/msg/CarlaActorInfo.h" + +namespace carla { +namespace ros2 { + +class ROS2NameRegistry; + +namespace types { + +struct ActorNameDefinition { + ActorNameDefinition(carla::streaming::detail::actor_id_type id_ = 0u, std::string type_id_ = "", std::string ros_name_ = "", + std::string role_name_ = "", std::string object_type_ = "", std::string base_type_ = "", bool enabled_for_ros_ = false) + : id(id_), + type_id(type_id_), + ros_name(ros_name_), + role_name(role_name_), + object_type(object_type_), + base_type(base_type_), + enabled_for_ros(enabled_for_ros_) {} + + static std::shared_ptr CreateFromRoleName(std::string const &role_name_, bool enabled_for_ros_ = false) { + auto actor_name_definition = std::make_shared(); + actor_name_definition->role_name = role_name_; + actor_name_definition->enabled_for_ros = enabled_for_ros_; + return actor_name_definition; + } + + carla_msgs::msg::CarlaActorInfo carla_actor_info(std::shared_ptr name_registry) const; + + virtual ~ActorNameDefinition() = default; + + carla::streaming::detail::actor_id_type id; + std::string type_id; + std::string ros_name; + std::string role_name; + std::string object_type; + std::string base_type; + bool enabled_for_ros; +}; +} // namespace types +} // namespace ros2 +} // namespace carla + +namespace std { + +inline std::string to_string(carla::ros2::types::ActorNameDefinition const &actor_definition) { + return "ActorName(actor_id=" + std::to_string(actor_definition.id) + " type_id=" + actor_definition.type_id + + " ros_name=" + actor_definition.ros_name + " role_name=" + actor_definition.role_name + + " object_type=" + actor_definition.object_type + " base_type=" + actor_definition.base_type + + " enabled_for_ros=" + std::to_string(actor_definition.enabled_for_ros) + ")"; +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/AngularVelocity.h b/LibCarla/source/carla/ros2/types/AngularVelocity.h new file mode 100644 index 00000000000..e92efbc02ff --- /dev/null +++ b/LibCarla/source/carla/ros2/types/AngularVelocity.h @@ -0,0 +1,68 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/geom/AngularVelocity.h" +#include "carla/geom/Math.h" +#include "geometry_msgs/msg/Accel.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla AngularVelocity to a ROS accel + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS) + +*/ +class AngularVelocity { +public: + AngularVelocity() = default; + ~AngularVelocity() = default; + AngularVelocity(const AngularVelocity&) = default; + AngularVelocity& operator=(const AngularVelocity&) = default; + AngularVelocity(AngularVelocity&&) = default; + AngularVelocity& operator=(AngularVelocity&&) = default; + + /** + * carla_AngularVelocity: the carla linear AngularVelocity + */ + explicit AngularVelocity(const carla::geom::AngularVelocity& carla_angular_velocity) { + _angular_velocity_ros.x = -carla::geom::Math::ToRadians(carla_angular_velocity.x); // -(forward = forward) + _angular_velocity.x(_angular_velocity_ros.x); + _angular_velocity_ros.y = carla::geom::Math::ToRadians(carla_angular_velocity.y); // -( right = -left ) + _angular_velocity.y(_angular_velocity_ros.y); + _angular_velocity_ros.z = -carla::geom::Math::ToRadians(carla_angular_velocity.z); // -( up = up ) + _angular_velocity.z(_angular_velocity_ros.z); + } +#ifdef LIBCARLA_INCLUDED_FROM_UE4 + AngularVelocity(const FVector& carla_angular_velocity) + : AngularVelocity( + carla::geom::Vector3D(carla_angular_velocity.X, carla_angular_velocity.Y, carla_angular_velocity.Z)) {} +#endif // LIBCARLA_INCLUDED_FROM_UE4 + + /** + * The resulting ROS geometry_msgs::msg::Vector3 + */ + geometry_msgs::msg::Vector3 angular_velocity() const { + return _angular_velocity; + } + + /** + * The angular velocity as carla::geom::Vector3D but in ROS coordinates + */ + carla::geom::AngularVelocity AngularVelocityROS() const { + return _angular_velocity_ros; + } + +private: + carla::geom::AngularVelocity _angular_velocity_ros; + geometry_msgs::msg::Vector3 _angular_velocity; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/CameraInfo.h b/LibCarla/source/carla/ros2/types/CameraInfo.h deleted file mode 100644 index b4c4322e82f..00000000000 --- a/LibCarla/source/carla/ros2/types/CameraInfo.h +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CameraInfo.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ - -#include "RegionOfInterest.h" -#include "Header.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CAMERAINFO_SOURCE) -#define CAMERAINFO_DllAPI __declspec( dllexport ) -#else -#define CAMERAINFO_DllAPI __declspec( dllimport ) -#endif // CAMERAINFO_SOURCE -#else -#define CAMERAINFO_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CAMERAINFO_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace sensor_msgs { - namespace msg { - /*! - * @brief This class represents the structure CameraInfo defined by the user in the IDL file. - * @ingroup CameraInfo - */ - class CameraInfo - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CameraInfo(uint32_t height = 0, uint32_t width = 0, double fov = 0.0); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CameraInfo(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. - */ - eProsima_user_DllExport CameraInfo( - const CameraInfo& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. - */ - eProsima_user_DllExport CameraInfo( - CameraInfo&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. - */ - eProsima_user_DllExport CameraInfo& operator =( - const CameraInfo& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. - */ - eProsima_user_DllExport CameraInfo& operator =( - CameraInfo&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::CameraInfo object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CameraInfo& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::CameraInfo object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CameraInfo& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ - eProsima_user_DllExport void height( - uint32_t _height); - - /*! - * @brief This function returns the value of member height - * @return Value of member height - */ - eProsima_user_DllExport uint32_t height() const; - - /*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ - eProsima_user_DllExport uint32_t& height(); - - /*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ - eProsima_user_DllExport void width( - uint32_t _width); - - /*! - * @brief This function returns the value of member width - * @return Value of member width - */ - eProsima_user_DllExport uint32_t width() const; - - /*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ - eProsima_user_DllExport uint32_t& width(); - - /*! - * @brief This function copies the value in member distortion_model - * @param _distortion_model New value to be copied in member distortion_model - */ - eProsima_user_DllExport void distortion_model( - const std::string& _distortion_model); - - /*! - * @brief This function moves the value in member distortion_model - * @param _distortion_model New value to be moved in member distortion_model - */ - eProsima_user_DllExport void distortion_model( - std::string&& _distortion_model); - - /*! - * @brief This function returns a constant reference to member distortion_model - * @return Constant reference to member distortion_model - */ - eProsima_user_DllExport const std::string& distortion_model() const; - - /*! - * @brief This function returns a reference to member distortion_model - * @return Reference to member distortion_model - */ - eProsima_user_DllExport std::string& distortion_model(); - /*! - * @brief This function copies the value in member D - * @param _D New value to be copied in member D - */ - eProsima_user_DllExport void D( - const std::vector& _D); - - /*! - * @brief This function moves the value in member D - * @param _D New value to be moved in member D - */ - eProsima_user_DllExport void D( - std::vector&& _D); - - /*! - * @brief This function returns a constant reference to member D - * @return Constant reference to member D - */ - eProsima_user_DllExport const std::vector& D() const; - - /*! - * @brief This function returns a reference to member D - * @return Reference to member D - */ - eProsima_user_DllExport std::vector& D(); - /*! - * @brief This function copies the value in member K - * @param _K New value to be copied in member K - */ - eProsima_user_DllExport void k( - const std::array& _k); - - /*! - * @brief This function moves the value in member k - * @param _k New value to be moved in member k - */ - eProsima_user_DllExport void k( - std::array&& _k); - - /*! - * @brief This function returns a constant reference to member k - * @return Constant reference to member k - */ - eProsima_user_DllExport const std::array& k() const; - - /*! - * @brief This function returns a reference to member k - * @return Reference to member k - */ - eProsima_user_DllExport std::array& k(); - /*! - * @brief This function copies the value in member r - * @param _r New value to be copied in member r - */ - eProsima_user_DllExport void r( - const std::array& _r); - - /*! - * @brief This function moves the value in member r - * @param _r New value to be moved in member r - */ - eProsima_user_DllExport void r( - std::array&& _r); - - /*! - * @brief This function returns a constant reference to member r - * @return Constant reference to member r - */ - eProsima_user_DllExport const std::array& r() const; - - /*! - * @brief This function returns a reference to member r - * @return Reference to member r - */ - eProsima_user_DllExport std::array& r(); - /*! - * @brief This function copies the value in member p - * @param _p New value to be copied in member p - */ - eProsima_user_DllExport void p( - const std::array& _p); - - /*! - * @brief This function moves the value in member p - * @param _p New value to be moved in member p - */ - eProsima_user_DllExport void p( - std::array&& _p); - - /*! - * @brief This function returns a constant reference to member p - * @return Constant reference to member p - */ - eProsima_user_DllExport const std::array& p() const; - - /*! - * @brief This function returns a reference to member p - * @return Reference to member p - */ - eProsima_user_DllExport std::array& p(); - /*! - * @brief This function sets a value in member binning_x - * @param _binning_x New value for member binning_x - */ - eProsima_user_DllExport void binning_x( - uint32_t _binning_x); - - /*! - * @brief This function returns the value of member binning_x - * @return Value of member binning_x - */ - eProsima_user_DllExport uint32_t binning_x() const; - - /*! - * @brief This function returns a reference to member binning_x - * @return Reference to member binning_x - */ - eProsima_user_DllExport uint32_t& binning_x(); - - /*! - * @brief This function sets a value in member binning_y - * @param _binning_y New value for member binning_y - */ - eProsima_user_DllExport void binning_y( - uint32_t _binning_y); - - /*! - * @brief This function returns the value of member binning_y - * @return Value of member binning_y - */ - eProsima_user_DllExport uint32_t binning_y() const; - - /*! - * @brief This function returns a reference to member binning_y - * @return Reference to member binning_y - */ - eProsima_user_DllExport uint32_t& binning_y(); - - /*! - * @brief This function copies the value in member roi - * @param _roi New value to be copied in member roi - */ - eProsima_user_DllExport void roi( - const sensor_msgs::msg::RegionOfInterest& _roi); - - /*! - * @brief This function moves the value in member roi - * @param _roi New value to be moved in member roi - */ - eProsima_user_DllExport void roi( - sensor_msgs::msg::RegionOfInterest&& _roi); - - /*! - * @brief This function returns a constant reference to member roi - * @return Constant reference to member roi - */ - eProsima_user_DllExport const sensor_msgs::msg::RegionOfInterest& roi() const; - - /*! - * @brief This function returns a reference to member roi - * @return Reference to member roi - */ - eProsima_user_DllExport sensor_msgs::msg::RegionOfInterest& roi(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sensor_msgs::msg::CameraInfo& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - std_msgs::msg::Header m_header; - uint32_t m_height; - uint32_t m_width; - std::string m_distortion_model; - std::vector m_d; - std::array m_k; - std::array m_r; - std::array m_p; - uint32_t m_binning_x; - uint32_t m_binning_y; - sensor_msgs::msg::RegionOfInterest m_roi; - }; - } // namespace msg -} // namespace sensor_msgs - -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ diff --git a/LibCarla/source/carla/ros2/types/CoordinateSystemTransform.h b/LibCarla/source/carla/ros2/types/CoordinateSystemTransform.h new file mode 100644 index 00000000000..562c2d3f904 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/CoordinateSystemTransform.h @@ -0,0 +1,59 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/geom/Vector3D.h" +#include "geometry_msgs/msg/Point32.h" +#include "geometry_msgs/msg/Vector3.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla (linear) CoordinateSystemTransform to a ROS accel (linear part) + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS) +*/ +class CoordinateSystemTransform { +public: + /** + * @param \in carla_linear_values: the carla linear values provided provided by UE4 coordinate system + * @returns values in ROS coordinate system (x:forward = forward, y: right = -left, z; up = up) + */ + static geometry_msgs::msg::Vector3 TransformLinearAxisMsg(carla::geom::Location const &carla_linear_values) { + geometry_msgs::msg::Vector3 result; + result.x(carla_linear_values.x); + result.y(-carla_linear_values.y); + result.z(carla_linear_values.z); + return result; + } + + static geometry_msgs::msg::Point32 TransformLocationToPoint32Msg(carla::geom::Location const &carla_location) { + geometry_msgs::msg::Point32 result; + result.x(carla_location.x); + result.y(-carla_location.y); + result.z(carla_location.z); + return result; + } + + static geometry_msgs::msg::Vector3 TransformLocationToVector3Msg(carla::geom::Location const &carla_location) { + geometry_msgs::msg::Vector3 result; + result.x(carla_location.x); + result.y(-carla_location.y); + result.z(carla_location.z); + return result; + } + + static carla::geom::Location TransformLinearAxixVector3D(carla::geom::Location const &carla_linear_values) { + carla::geom::Location result(carla_linear_values); + result.y = -result.y; + return result; + } +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/EpisodeSettings.h b/LibCarla/source/carla/ros2/types/EpisodeSettings.h new file mode 100644 index 00000000000..d67c3aee2ce --- /dev/null +++ b/LibCarla/source/carla/ros2/types/EpisodeSettings.h @@ -0,0 +1,72 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/rpc/EpisodeSettings.h" +#include "carla_msgs/msg/CarlaEpisodeSettings.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla EpisodeSettings to a ROS CarlaEpisodeSettings and vice-vera +*/ +class EpisodeSettings { +public: + explicit EpisodeSettings(carla::rpc::EpisodeSettings const& rpc_episode_settings = carla::rpc::EpisodeSettings()) { + _ros_episode_settings.synchronous_mode(rpc_episode_settings.synchronous_mode); + _ros_episode_settings.no_rendering_mode(rpc_episode_settings.no_rendering_mode); + if ( rpc_episode_settings.fixed_delta_seconds.has_value() ) { + _ros_episode_settings.fixed_delta_seconds(rpc_episode_settings.fixed_delta_seconds.value()); + } + _ros_episode_settings.substepping(rpc_episode_settings.substepping); + _ros_episode_settings.max_substep_delta_time(rpc_episode_settings.max_substep_delta_time); + _ros_episode_settings.max_substeps(rpc_episode_settings.max_substeps); + _ros_episode_settings.max_culling_distance(rpc_episode_settings.max_culling_distance); + _ros_episode_settings.deterministic_ragdolls(rpc_episode_settings.deterministic_ragdolls); + _ros_episode_settings.tile_stream_distance(rpc_episode_settings.tile_stream_distance); + _ros_episode_settings.actor_active_distance(rpc_episode_settings.actor_active_distance); + _ros_episode_settings.spectator_as_ego(rpc_episode_settings.spectator_as_ego); + } + + explicit EpisodeSettings(carla_msgs::msg::CarlaEpisodeSettings const& carla_episode_settings) { + _ros_episode_settings = carla_episode_settings; + } + ~EpisodeSettings() = default; + EpisodeSettings(const EpisodeSettings&) = default; + EpisodeSettings& operator=(const EpisodeSettings&) = default; + EpisodeSettings(EpisodeSettings&&) = default; + EpisodeSettings& operator=(EpisodeSettings&&) = default; + + /** + * The resulting ROS carla_msgs::msg::CarlaEpisodeSettings + */ + carla_msgs::msg::CarlaEpisodeSettings episode_settings() const { + return _ros_episode_settings; + } + + carla::rpc::EpisodeSettings GetEpisodeSettings() const { + carla::rpc::EpisodeSettings episode_settings; + episode_settings.synchronous_mode = _ros_episode_settings.synchronous_mode(); + episode_settings.no_rendering_mode = _ros_episode_settings.no_rendering_mode(); + episode_settings.fixed_delta_seconds = _ros_episode_settings.fixed_delta_seconds(); + episode_settings.substepping = _ros_episode_settings.substepping(); + episode_settings.max_substep_delta_time = _ros_episode_settings.max_substep_delta_time(); + episode_settings.max_substeps = _ros_episode_settings.max_substeps(); + episode_settings.max_culling_distance = _ros_episode_settings.max_culling_distance(); + episode_settings.deterministic_ragdolls = _ros_episode_settings.deterministic_ragdolls(); + episode_settings.tile_stream_distance = _ros_episode_settings.tile_stream_distance(); + episode_settings.actor_active_distance = _ros_episode_settings.actor_active_distance(); + episode_settings.spectator_as_ego = _ros_episode_settings.spectator_as_ego(); + return episode_settings; + } + +private: + carla_msgs::msg::CarlaEpisodeSettings _ros_episode_settings; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Float32PubSubTypes.h b/LibCarla/source/carla/ros2/types/Float32PubSubTypes.h deleted file mode 100644 index 4915efbbd45..00000000000 --- a/LibCarla/source/carla/ros2/types/Float32PubSubTypes.h +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Float32PubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ - -#include -#include - -#include "Float32.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated Float32 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace std_msgs -{ - namespace msg - { - #ifndef SWIG - namespace detail { - template - struct Float32_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Float32_f - { - typedef float Float32::* type; - friend constexpr type get( - Float32_f); - }; - - template struct Float32_rob; - - template - inline size_t constexpr Float32_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type Float32 defined by the user in the IDL file. - * @ingroup FLOAT32 - */ - class Float32PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Float32 type; - - eProsima_user_DllExport Float32PubSubType(); - - eProsima_user_DllExport virtual ~Float32PubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Float32(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - static constexpr bool is_plain_impl() - { - return 4ULL == (detail::Float32_offset_of() + sizeof(float)); - - }}; - } -} - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/Image.cpp b/LibCarla/source/carla/ros2/types/Image.cpp deleted file mode 100644 index 1946f876695..00000000000 --- a/LibCarla/source/carla/ros2/types/Image.cpp +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Image.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Image.h" -#include - -#include -using namespace eprosima::fastcdr::exception; - -#include - -#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; -#define sensor_msgs_msg_Image_max_cdr_typesize 648ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_Image_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - -sensor_msgs::msg::Image::Image() -{ - // std_msgs::msg::Header m_header - - // unsigned long m_height - m_height = 0; - // unsigned long m_width - m_width = 0; - // string m_encoding - m_encoding =""; - // uint8 m_is_bigendian - m_is_bigendian = 0; - // unsigned long m_step - m_step = 0; - // sequence m_data -} - -sensor_msgs::msg::Image::~Image() -{ -} - -sensor_msgs::msg::Image::Image( - const Image& x) -{ - m_header = x.m_header; - m_height = x.m_height; - m_width = x.m_width; - m_encoding = x.m_encoding; - m_is_bigendian = x.m_is_bigendian; - m_step = x.m_step; - m_data = x.m_data; -} - -sensor_msgs::msg::Image::Image( - Image&& x) noexcept -{ - m_header = std::move(x.m_header); - m_height = x.m_height; - m_width = x.m_width; - m_encoding = std::move(x.m_encoding); - m_is_bigendian = x.m_is_bigendian; - m_step = x.m_step; - m_data = std::move(x.m_data); -} - -sensor_msgs::msg::Image& sensor_msgs::msg::Image::operator =( - const Image& x) -{ - m_header = x.m_header; - m_height = x.m_height; - m_width = x.m_width; - m_encoding = x.m_encoding; - m_is_bigendian = x.m_is_bigendian; - m_step = x.m_step; - m_data = x.m_data; - - return *this; -} - -sensor_msgs::msg::Image& sensor_msgs::msg::Image::operator =( - Image&& x) noexcept -{ - m_header = std::move(x.m_header); - m_height = x.m_height; - m_width = x.m_width; - m_encoding = std::move(x.m_encoding); - m_is_bigendian = x.m_is_bigendian; - m_step = x.m_step; - m_data = std::move(x.m_data); - - return *this; -} - -bool sensor_msgs::msg::Image::operator ==( - const Image& x) const -{ - return (m_header == x.m_header && m_height == x.m_height && m_width == x.m_width && m_encoding == x.m_encoding && m_is_bigendian == x.m_is_bigendian && m_step == x.m_step && m_data == x.m_data); -} - -bool sensor_msgs::msg::Image::operator !=( - const Image& x) const -{ - return !(*this == x); -} - -size_t sensor_msgs::msg::Image::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_Image_max_cdr_typesize; -} - -size_t sensor_msgs::msg::Image::getCdrSerializedSize( - const sensor_msgs::msg::Image& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.encoding().size() + 1; - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.data().size() > 0) - { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - return current_alignment - initial_alignment; -} - -void sensor_msgs::msg::Image::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - scdr << m_height; - scdr << m_width; - scdr << m_encoding.c_str(); - scdr << m_is_bigendian; - scdr << m_step; - scdr << m_data; -} - -void sensor_msgs::msg::Image::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - dcdr >> m_height; - dcdr >> m_width; - dcdr >> m_encoding; - dcdr >> m_is_bigendian; - dcdr >> m_step; - dcdr >> m_data; -} - -/*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ -void sensor_msgs::msg::Image::header( - const std_msgs::msg::Header& _header) -{ - m_header = _header; -} - -/*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ -void sensor_msgs::msg::Image::header( - std_msgs::msg::Header&& _header) -{ - m_header = std::move(_header); -} - -/*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ -const std_msgs::msg::Header& sensor_msgs::msg::Image::header() const -{ - return m_header; -} - -/*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ -std_msgs::msg::Header& sensor_msgs::msg::Image::header() -{ - return m_header; -} - -/*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ -void sensor_msgs::msg::Image::height( - uint32_t _height) -{ - m_height = _height; -} - -/*! - * @brief This function returns the value of member height - * @return Value of member height - */ -uint32_t sensor_msgs::msg::Image::height() const -{ - return m_height; -} - -/*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ -uint32_t& sensor_msgs::msg::Image::height() -{ - return m_height; -} - -/*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ -void sensor_msgs::msg::Image::width( - uint32_t _width) -{ - m_width = _width; -} - -/*! - * @brief This function returns the value of member width - * @return Value of member width - */ -uint32_t sensor_msgs::msg::Image::width() const -{ - return m_width; -} - -/*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ -uint32_t& sensor_msgs::msg::Image::width() -{ - return m_width; -} - -/*! - * @brief This function copies the value in member encoding - * @param _encoding New value to be copied in member encoding - */ -void sensor_msgs::msg::Image::encoding( - const std::string& _encoding) -{ - m_encoding = _encoding; -} - -/*! - * @brief This function moves the value in member encoding - * @param _encoding New value to be moved in member encoding - */ -void sensor_msgs::msg::Image::encoding( - std::string&& _encoding) -{ - m_encoding = std::move(_encoding); -} - -/*! - * @brief This function returns a constant reference to member encoding - * @return Constant reference to member encoding - */ -const std::string& sensor_msgs::msg::Image::encoding() const -{ - return m_encoding; -} - -/*! - * @brief This function returns a reference to member encoding - * @return Reference to member encoding - */ -std::string& sensor_msgs::msg::Image::encoding() -{ - return m_encoding; -} - -/*! - * @brief This function sets a value in member is_bigendian - * @param _is_bigendian New value for member is_bigendian - */ -void sensor_msgs::msg::Image::is_bigendian( - uint8_t _is_bigendian) -{ - m_is_bigendian = _is_bigendian; -} - -/*! - * @brief This function returns the value of member is_bigendian - * @return Value of member is_bigendian - */ -uint8_t sensor_msgs::msg::Image::is_bigendian() const -{ - return m_is_bigendian; -} - -/*! - * @brief This function returns a reference to member is_bigendian - * @return Reference to member is_bigendian - */ -uint8_t& sensor_msgs::msg::Image::is_bigendian() -{ - return m_is_bigendian; -} - -/*! - * @brief This function sets a value in member step - * @param _step New value for member step - */ -void sensor_msgs::msg::Image::step( - uint32_t _step) -{ - m_step = _step; -} - -/*! - * @brief This function returns the value of member step - * @return Value of member step - */ -uint32_t sensor_msgs::msg::Image::step() const -{ - return m_step; -} - -/*! - * @brief This function returns a reference to member step - * @return Reference to member step - */ -uint32_t& sensor_msgs::msg::Image::step() -{ - return m_step; -} - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void sensor_msgs::msg::Image::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void sensor_msgs::msg::Image::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& sensor_msgs::msg::Image::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& sensor_msgs::msg::Image::data() -{ - return m_data; -} - -size_t sensor_msgs::msg::Image::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_Image_max_key_cdr_typesize; -} - -bool sensor_msgs::msg::Image::isKeyDefined() -{ - return false; -} - -void sensor_msgs::msg::Image::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} diff --git a/LibCarla/source/carla/ros2/types/Imu.h b/LibCarla/source/carla/ros2/types/Imu.h deleted file mode 100644 index 4d8f45b02ed..00000000000 --- a/LibCarla/source/carla/ros2/types/Imu.h +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Imu.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ - -#include "Vector3.h" -#include "Quaternion.h" -#include "Header.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Imu_SOURCE) -#define Imu_DllAPI __declspec( dllexport ) -#else -#define Imu_DllAPI __declspec( dllimport ) -#endif // Imu_SOURCE -#else -#define Imu_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define Imu_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace sensor_msgs { - namespace msg { - typedef std::array sensor_msgs__Imu__double_array_9; - /*! - * @brief This class represents the structure Imu defined by the user in the IDL file. - * @ingroup IMU - */ - class Imu - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Imu(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Imu(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. - */ - eProsima_user_DllExport Imu( - const Imu& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. - */ - eProsima_user_DllExport Imu( - Imu&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. - */ - eProsima_user_DllExport Imu& operator =( - const Imu& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. - */ - eProsima_user_DllExport Imu& operator =( - Imu&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::Imu object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Imu& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::Imu object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Imu& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member orientation - * @param _orientation New value to be copied in member orientation - */ - eProsima_user_DllExport void orientation( - const geometry_msgs::msg::Quaternion& _orientation); - - /*! - * @brief This function moves the value in member orientation - * @param _orientation New value to be moved in member orientation - */ - eProsima_user_DllExport void orientation( - geometry_msgs::msg::Quaternion&& _orientation); - - /*! - * @brief This function returns a constant reference to member orientation - * @return Constant reference to member orientation - */ - eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; - - /*! - * @brief This function returns a reference to member orientation - * @return Reference to member orientation - */ - eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); - /*! - * @brief This function copies the value in member orientation_covariance - * @param _orientation_covariance New value to be copied in member orientation_covariance - */ - eProsima_user_DllExport void orientation_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _orientation_covariance); - - /*! - * @brief This function moves the value in member orientation_covariance - * @param _orientation_covariance New value to be moved in member orientation_covariance - */ - eProsima_user_DllExport void orientation_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _orientation_covariance); - - /*! - * @brief This function returns a constant reference to member orientation_covariance - * @return Constant reference to member orientation_covariance - */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& orientation_covariance() const; - - /*! - * @brief This function returns a reference to member orientation_covariance - * @return Reference to member orientation_covariance - */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& orientation_covariance(); - /*! - * @brief This function copies the value in member angular_velocity - * @param _angular_velocity New value to be copied in member angular_velocity - */ - eProsima_user_DllExport void angular_velocity( - const geometry_msgs::msg::Vector3& _angular_velocity); - - /*! - * @brief This function moves the value in member angular_velocity - * @param _angular_velocity New value to be moved in member angular_velocity - */ - eProsima_user_DllExport void angular_velocity( - geometry_msgs::msg::Vector3&& _angular_velocity); - - /*! - * @brief This function returns a constant reference to member angular_velocity - * @return Constant reference to member angular_velocity - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular_velocity() const; - - /*! - * @brief This function returns a reference to member angular_velocity - * @return Reference to member angular_velocity - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& angular_velocity(); - /*! - * @brief This function copies the value in member angular_velocity_covariance - * @param _angular_velocity_covariance New value to be copied in member angular_velocity_covariance - */ - eProsima_user_DllExport void angular_velocity_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _angular_velocity_covariance); - - /*! - * @brief This function moves the value in member angular_velocity_covariance - * @param _angular_velocity_covariance New value to be moved in member angular_velocity_covariance - */ - eProsima_user_DllExport void angular_velocity_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _angular_velocity_covariance); - - /*! - * @brief This function returns a constant reference to member angular_velocity_covariance - * @return Constant reference to member angular_velocity_covariance - */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& angular_velocity_covariance() const; - - /*! - * @brief This function returns a reference to member angular_velocity_covariance - * @return Reference to member angular_velocity_covariance - */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& angular_velocity_covariance(); - /*! - * @brief This function copies the value in member linear_acceleration - * @param _linear_acceleration New value to be copied in member linear_acceleration - */ - eProsima_user_DllExport void linear_acceleration( - const geometry_msgs::msg::Vector3& _linear_acceleration); - - /*! - * @brief This function moves the value in member linear_acceleration - * @param _linear_acceleration New value to be moved in member linear_acceleration - */ - eProsima_user_DllExport void linear_acceleration( - geometry_msgs::msg::Vector3&& _linear_acceleration); - - /*! - * @brief This function returns a constant reference to member linear_acceleration - * @return Constant reference to member linear_acceleration - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear_acceleration() const; - - /*! - * @brief This function returns a reference to member linear_acceleration - * @return Reference to member linear_acceleration - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& linear_acceleration(); - /*! - * @brief This function copies the value in member linear_acceleration_covariance - * @param _linear_acceleration_covariance New value to be copied in member linear_acceleration_covariance - */ - eProsima_user_DllExport void linear_acceleration_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _linear_acceleration_covariance); - - /*! - * @brief This function moves the value in member linear_acceleration_covariance - * @param _linear_acceleration_covariance New value to be moved in member linear_acceleration_covariance - */ - eProsima_user_DllExport void linear_acceleration_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _linear_acceleration_covariance); - - /*! - * @brief This function returns a constant reference to member linear_acceleration_covariance - * @return Constant reference to member linear_acceleration_covariance - */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& linear_acceleration_covariance() const; - - /*! - * @brief This function returns a reference to member linear_acceleration_covariance - * @return Reference to member linear_acceleration_covariance - */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& linear_acceleration_covariance(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sensor_msgs::msg::Imu& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - std_msgs::msg::Header m_header; - geometry_msgs::msg::Quaternion m_orientation; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_orientation_covariance; - geometry_msgs::msg::Vector3 m_angular_velocity; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_angular_velocity_covariance; - geometry_msgs::msg::Vector3 m_linear_acceleration; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_linear_acceleration_covariance; - }; - } // namespace msg -} // namespace sensor_msgs - -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ diff --git a/LibCarla/source/carla/ros2/types/NavSatFix.h b/LibCarla/source/carla/ros2/types/NavSatFix.h deleted file mode 100644 index 3615c99bb5e..00000000000 --- a/LibCarla/source/carla/ros2/types/NavSatFix.h +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file NavSatFix.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ - -#include "Header.h" -#include "NavSatStatus.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(NavSatFix_SOURCE) -#define NavSatFix_DllAPI __declspec( dllexport ) -#else -#define NavSatFix_DllAPI __declspec( dllimport ) -#endif // NavSatFix_SOURCE -#else -#define NavSatFix_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define NavSatFix_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace sensor_msgs { - namespace msg { - const uint8_t NavSatFix__COVARIANCE_TYPE_UNKNOWN = 0; - const uint8_t NavSatFix__COVARIANCE_TYPE_APPROXIMATED = 1; - const uint8_t NavSatFix__COVARIANCE_TYPE_DIAGONAL_KNOWN = 2; - const uint8_t NavSatFix__COVARIANCE_TYPE_KNOWN = 3; - typedef std::array sensor_msgs__NavSatFix__double_array_9; - /*! - * @brief This class represents the structure NavSatFix defined by the user in the IDL file. - * @ingroup NAVSATFIX - */ - class NavSatFix - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport NavSatFix(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~NavSatFix(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. - */ - eProsima_user_DllExport NavSatFix( - const NavSatFix& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. - */ - eProsima_user_DllExport NavSatFix( - NavSatFix&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. - */ - eProsima_user_DllExport NavSatFix& operator =( - const NavSatFix& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. - */ - eProsima_user_DllExport NavSatFix& operator =( - NavSatFix&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::NavSatFix object to compare. - */ - eProsima_user_DllExport bool operator ==( - const NavSatFix& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::NavSatFix object to compare. - */ - eProsima_user_DllExport bool operator !=( - const NavSatFix& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member status - * @param _status New value to be copied in member status - */ - eProsima_user_DllExport void status( - const sensor_msgs::msg::NavSatStatus& _status); - - /*! - * @brief This function moves the value in member status - * @param _status New value to be moved in member status - */ - eProsima_user_DllExport void status( - sensor_msgs::msg::NavSatStatus&& _status); - - /*! - * @brief This function returns a constant reference to member status - * @return Constant reference to member status - */ - eProsima_user_DllExport const sensor_msgs::msg::NavSatStatus& status() const; - - /*! - * @brief This function returns a reference to member status - * @return Reference to member status - */ - eProsima_user_DllExport sensor_msgs::msg::NavSatStatus& status(); - /*! - * @brief This function sets a value in member latitude - * @param _latitude New value for member latitude - */ - eProsima_user_DllExport void latitude( - double _latitude); - - /*! - * @brief This function returns the value of member latitude - * @return Value of member latitude - */ - eProsima_user_DllExport double latitude() const; - - /*! - * @brief This function returns a reference to member latitude - * @return Reference to member latitude - */ - eProsima_user_DllExport double& latitude(); - - /*! - * @brief This function sets a value in member longitude - * @param _longitude New value for member longitude - */ - eProsima_user_DllExport void longitude( - double _longitude); - - /*! - * @brief This function returns the value of member longitude - * @return Value of member longitude - */ - eProsima_user_DllExport double longitude() const; - - /*! - * @brief This function returns a reference to member longitude - * @return Reference to member longitude - */ - eProsima_user_DllExport double& longitude(); - - /*! - * @brief This function sets a value in member altitude - * @param _altitude New value for member altitude - */ - eProsima_user_DllExport void altitude( - double _altitude); - - /*! - * @brief This function returns the value of member altitude - * @return Value of member altitude - */ - eProsima_user_DllExport double altitude() const; - - /*! - * @brief This function returns a reference to member altitude - * @return Reference to member altitude - */ - eProsima_user_DllExport double& altitude(); - - /*! - * @brief This function copies the value in member position_covariance - * @param _position_covariance New value to be copied in member position_covariance - */ - eProsima_user_DllExport void position_covariance( - const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& _position_covariance); - - /*! - * @brief This function moves the value in member position_covariance - * @param _position_covariance New value to be moved in member position_covariance - */ - eProsima_user_DllExport void position_covariance( - sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9&& _position_covariance); - - /*! - * @brief This function returns a constant reference to member position_covariance - * @return Constant reference to member position_covariance - */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& position_covariance() const; - - /*! - * @brief This function returns a reference to member position_covariance - * @return Reference to member position_covariance - */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& position_covariance(); - /*! - * @brief This function sets a value in member position_covariance_type - * @param _position_covariance_type New value for member position_covariance_type - */ - eProsima_user_DllExport void position_covariance_type( - uint8_t _position_covariance_type); - - /*! - * @brief This function returns the value of member position_covariance_type - * @return Value of member position_covariance_type - */ - eProsima_user_DllExport uint8_t position_covariance_type() const; - - /*! - * @brief This function returns a reference to member position_covariance_type - * @return Reference to member position_covariance_type - */ - eProsima_user_DllExport uint8_t& position_covariance_type(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sensor_msgs::msg::NavSatFix& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - std_msgs::msg::Header m_header; - sensor_msgs::msg::NavSatStatus m_status; - double m_latitude; - double m_longitude; - double m_altitude; - sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9 m_position_covariance; - uint8_t m_position_covariance_type; - }; - } // namespace msg -} // namespace sensor_msgs - -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ diff --git a/LibCarla/source/carla/ros2/types/NavSatStatusPubSubTypes.h b/LibCarla/source/carla/ros2/types/NavSatStatusPubSubTypes.h deleted file mode 100644 index 6abf09210de..00000000000 --- a/LibCarla/source/carla/ros2/types/NavSatStatusPubSubTypes.h +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file NavSatStatusPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ - -#include -#include - -#include "NavSatStatus.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated NavSatStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace sensor_msgs -{ - namespace msg - { - #ifndef SWIG - namespace detail { - - template - struct NavSatStatus_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct NavSatStatus_f - { - typedef uint16_t NavSatStatus::* type; - friend constexpr type get( - NavSatStatus_f); - }; - - template struct NavSatStatus_rob; - - template - inline size_t constexpr NavSatStatus_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type NavSatStatus defined by the user in the IDL file. - * @ingroup NAVSATSTATUS - */ - class NavSatStatusPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef NavSatStatus type; - - eProsima_user_DllExport NavSatStatusPubSubType(); - - eProsima_user_DllExport virtual ~NavSatStatusPubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) NavSatStatus(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 4ULL == (detail::NavSatStatus_offset_of() + sizeof(uint16_t)); - }}; - } -} - -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/Object.h b/LibCarla/source/carla/ros2/types/Object.h new file mode 100644 index 00000000000..d06b8be5cb7 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/Object.h @@ -0,0 +1,223 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/geom/BoundingBox.h" +#include "carla/ros2/types/AcceleratedMovement.h" +#include "carla/ros2/types/Polygon.h" +#include "carla/ros2/types/Timestamp.h" +#include "carla/ros2/types/TrafficLightActorDefinition.h" +#include "carla/ros2/types/TrafficSignActorDefinition.h" +#include "carla/ros2/types/Transform.h" +#include "carla/ros2/types/VehicleActorDefinition.h" +#include "carla/ros2/types/WalkerActorDefinition.h" +#include "carla/rpc/VehiclePhysicsControl.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "derived_object_msgs/msg/Object.h" +#include "derived_object_msgs/msg/ObjectWithCovariance.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla (linear) acceleration to a ROS accel (linear part) + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS) +*/ +class Object { +public: + /** + * The representation of an object in the sense of derived_object_msgs::msg::Object. + * + * classification is one of the derived_object_msgs::msg::Object_Constants::CLASSIFICATION_* constants + */ + explicit Object(std::shared_ptr vehicle_actor_definition) + : _actor_name_definition( + std::static_pointer_cast(vehicle_actor_definition)) { + if (_actor_name_definition->base_type == "Bus" || _actor_name_definition->base_type == "Truck") { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_TRUCK; + } else if (_actor_name_definition->base_type == "car" || _actor_name_definition->base_type == "van") { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_CAR; + } else if (_actor_name_definition->base_type == "motorcycle") { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_MOTORCYCLE; + } else if (_actor_name_definition->base_type == "bicycle") { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BIKE; + } else { + // as long as we don't have the concrete information within a blueprint ... + // we estimate the class based on the vehicle mass (motorbikes are also 4wheeled vehicles!) + if (vehicle_actor_definition->vehicle_physics_control.mass > 2000.f) { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_TRUCK; + } + /* microlino has 513kg */ + else if (vehicle_actor_definition->vehicle_physics_control.mass > 500.f) { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_CAR; + } + /* gazelle bike has 150 (ok, when 130kg person is sitting on it ;-), but yamaha 140kg how should that work out?? + TODO: update Blueprint masses to more realistic values */ + else if (vehicle_actor_definition->vehicle_physics_control.mass > 100.f) { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_MOTORCYCLE; + } else { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BIKE; + } + carla::log_warning( + "Unknown Vehicle Object[", _actor_name_definition->type_id, "] id: ", _actor_name_definition->id, + " object_type: ", _actor_name_definition->object_type, " base_type: ", _actor_name_definition->base_type, + " mass: ", vehicle_actor_definition->vehicle_physics_control.mass, " ROS-class: ", _classification); + } + } + /** + * The representation of an object in the sense of derived_object_msgs::msg::Object. + * + * classification is one of the derived_object_msgs::msg::Object_Constants::CLASSIFICATION_* constants + */ + explicit Object(std::shared_ptr walker_actor_definition) + : _actor_name_definition( + std::static_pointer_cast(walker_actor_definition)) { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_PEDESTRIAN; + carla::log_debug("Creating Walker Object[", _actor_name_definition->type_id, "] id: ", _actor_name_definition->id, + " object_type: ", _actor_name_definition->object_type, + " base_type: ", _actor_name_definition->base_type, " ROS-class: ", _classification); + } + /** + * The representation of an object in the sense of derived_object_msgs::msg::Object. + * + * classification is one of the derived_object_msgs::msg::Object_Constants::CLASSIFICATION_* constants + */ + explicit Object(std::shared_ptr traffic_light_actor_definition) + : _actor_name_definition( + std::static_pointer_cast(traffic_light_actor_definition)) { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; + carla::log_debug("Creating Traffic Light Object[", _actor_name_definition->type_id, + "] id: ", _actor_name_definition->id, " object_type: ", _actor_name_definition->object_type, + " base_type: ", _actor_name_definition->base_type, " ROS-class: ", _classification); + } + /** + * The representation of an object in the sense of derived_object_msgs::msg::Object. + * + * classification is one of the derived_object_msgs::msg::Object_Constants::CLASSIFICATION_* constants + */ + explicit Object(std::shared_ptr traffic_sign_actor_definition) + : _actor_name_definition( + std::static_pointer_cast(traffic_sign_actor_definition)) { + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; + carla::log_debug("Creating Traffic Sign Object[", _actor_name_definition->type_id, + "] id: ", _actor_name_definition->id, " object_type: ", _actor_name_definition->object_type, + " base_type: ", _actor_name_definition->base_type, " ROS-class: ", _classification); + } + ~Object() = default; + Object(const Object&) = delete; + Object& operator=(const Object&) = delete; + Object(Object&&) = delete; + Object& operator=(Object&&) = delete; + + void UpdateObject(carla::ros2::types::Timestamp const& timestamp, + carla::sensor::data::ActorDynamicState const& actor_dynamic_state) { + auto actor_definition = std::dynamic_pointer_cast(_actor_name_definition); + if (nullptr != actor_definition) { + _bounding_box.extent = actor_definition->bounding_box.extent; + _bounding_box.location = actor_dynamic_state.transform.location; + _bounding_box.rotation = actor_dynamic_state.transform.rotation; + } + _transform = carla::ros2::types::Transform(actor_dynamic_state.transform, actor_dynamic_state.quaternion); + _accelerated_movement.UpdateSpeed( + carla::ros2::types::Speed(carla::geom::Velocity(actor_dynamic_state.velocity), actor_dynamic_state.quaternion), + carla::ros2::types::AngularVelocity(carla::geom::AngularVelocity(actor_dynamic_state.angular_velocity)), + timestamp); + if (_classification_age < std::numeric_limits::max()) { + ++_classification_age; + } + } + + derived_object_msgs::msg::Object object() const { + derived_object_msgs::msg::Object object; + object.header().stamp(_accelerated_movement.Timestamp().time()); + object.header().frame_id("map"); + object.id(_actor_name_definition->id); + object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); + object.object_classified(true); + object.pose(_transform.pose()); + object.twist(_accelerated_movement.twist()); + object.accel(_accelerated_movement.accel()); + + auto actor_definition = std::dynamic_pointer_cast(_actor_name_definition); + if (nullptr != actor_definition) { + object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); + auto const ros_extent = _bounding_box.extent * 2.f; + object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); + object.shape().polygon().points(*Polygon(_bounding_box.GetLocalVertices()).polygon()); + } else { + object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX_X); + } + object.classification(_classification); + object.classification_certainty(255u); + object.classification_age(_classification_age); + return object; + } + + derived_object_msgs::msg::ObjectWithCovariance object_with_covariance() const { + derived_object_msgs::msg::ObjectWithCovariance object; + object.header().stamp(_accelerated_movement.Timestamp().time()); + object.header().frame_id("map"); + object.id(_actor_name_definition->id); + object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); + object.object_classified(true); + object.pose(_transform.pose_with_covariance()); + object.twist(_accelerated_movement.twist_with_covariance()); + object.accel(_accelerated_movement.accel_with_covariance()); + + auto actor_definition = std::dynamic_pointer_cast(_actor_name_definition); + if (nullptr != actor_definition) { + object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); + auto const ros_extent = _bounding_box.extent * 2.f; + object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); + //object.shape().polygon().points(*Polygon(_bounding_box.GetLocalVertices()).polygon()); + } else { + object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX_X); + } + object.classification(_classification); + object.classification_certainty(255u); + object.classification_age(_classification_age); + return object; + } + + carla::ros2::types::Timestamp const& Timestamp() const { + return _accelerated_movement.Timestamp(); + } + carla::ros2::types::Transform const& Transform() const { + return _transform; + } + carla::ros2::types::Speed const& Speed() const { + return _accelerated_movement.Speed(); + } + carla::ros2::types::AngularVelocity const& AngularVelocity() const { + return _accelerated_movement.AngularVelocity(); + } + carla::ros2::types::AcceleratedMovement const& AcceleratedMovement() const { + return _accelerated_movement; + } + + uint8_t classification() { + return _classification; + } + + carla_msgs::msg::CarlaActorInfo carla_actor_info(std::shared_ptr name_registry) const { + return _actor_name_definition->carla_actor_info(name_registry); + } + +private: + std::shared_ptr _actor_name_definition; + uint8_t _classification; + carla::geom::BoundingBox _bounding_box; + carla::ros2::types::Transform _transform; + carla::ros2::types::AcceleratedMovement _accelerated_movement; + uint32_t _classification_age{0u}; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/PointCloud2.cpp b/LibCarla/source/carla/ros2/types/PointCloud2.cpp deleted file mode 100644 index e89c0412f70..00000000000 --- a/LibCarla/source/carla/ros2/types/PointCloud2.cpp +++ /dev/null @@ -1,507 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointCloud2.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "PointCloud2.h" -#include - -#include -using namespace eprosima::fastcdr::exception; - -#include - -#define sensor_msgs_msg_PointField_max_cdr_typesize 272ULL; -#define std_msgs_msg_Time_max_cdr_typesize 8ULL; -#define sensor_msgs_msg_PointCloud2_max_cdr_typesize 27597ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define sensor_msgs_msg_PointField_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_PointCloud2_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - -sensor_msgs::msg::PointCloud2::PointCloud2() -{ - // std_msgs::msg::Header m_header - - // unsigned long m_height - m_height = 0; - // unsigned long m_width - m_width = 0; - // sequence m_fields - - // boolean m_is_bigendian - m_is_bigendian = false; - // unsigned long m_point_step - m_point_step = 0; - // unsigned long m_row_step - m_row_step = 0; - // sequence m_data - - // boolean m_is_dense - m_is_dense = false; -} - -sensor_msgs::msg::PointCloud2::~PointCloud2() -{ -} - -sensor_msgs::msg::PointCloud2::PointCloud2( - const PointCloud2& x) -{ - m_header = x.m_header; - m_height = x.m_height; - m_width = x.m_width; - m_fields = x.m_fields; - m_is_bigendian = x.m_is_bigendian; - m_point_step = x.m_point_step; - m_row_step = x.m_row_step; - m_data = x.m_data; - m_is_dense = x.m_is_dense; -} - -sensor_msgs::msg::PointCloud2::PointCloud2( - PointCloud2&& x) noexcept -{ - m_header = std::move(x.m_header); - m_height = x.m_height; - m_width = x.m_width; - m_fields = std::move(x.m_fields); - m_is_bigendian = x.m_is_bigendian; - m_point_step = x.m_point_step; - m_row_step = x.m_row_step; - m_data = std::move(x.m_data); - m_is_dense = x.m_is_dense; -} - -sensor_msgs::msg::PointCloud2& sensor_msgs::msg::PointCloud2::operator =( - const PointCloud2& x) -{ - m_header = x.m_header; - m_height = x.m_height; - m_width = x.m_width; - m_fields = x.m_fields; - m_is_bigendian = x.m_is_bigendian; - m_point_step = x.m_point_step; - m_row_step = x.m_row_step; - m_data = x.m_data; - m_is_dense = x.m_is_dense; - - return *this; -} - -sensor_msgs::msg::PointCloud2& sensor_msgs::msg::PointCloud2::operator =( - PointCloud2&& x) noexcept -{ - m_header = std::move(x.m_header); - m_height = x.m_height; - m_width = x.m_width; - m_fields = std::move(x.m_fields); - m_is_bigendian = x.m_is_bigendian; - m_point_step = x.m_point_step; - m_row_step = x.m_row_step; - m_data = std::move(x.m_data); - m_is_dense = x.m_is_dense; - - return *this; -} - -bool sensor_msgs::msg::PointCloud2::operator ==( - const PointCloud2& x) const -{ - return (m_header == x.m_header && m_height == x.m_height && m_width == x.m_width && m_fields == x.m_fields && m_is_bigendian == x.m_is_bigendian && m_point_step == x.m_point_step && m_row_step == x.m_row_step && m_data == x.m_data && m_is_dense == x.m_is_dense); -} - -bool sensor_msgs::msg::PointCloud2::operator !=( - const PointCloud2& x) const -{ - return !(*this == x); -} - -size_t sensor_msgs::msg::PointCloud2::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_PointCloud2_max_cdr_typesize; -} - -size_t sensor_msgs::msg::PointCloud2::getCdrSerializedSize( - const sensor_msgs::msg::PointCloud2& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < data.fields().size(); ++a) - { - current_alignment += sensor_msgs::msg::PointField::getCdrSerializedSize(data.fields().at(a), current_alignment); - } - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.data().size() > 0) - { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; -} - -void sensor_msgs::msg::PointCloud2::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - scdr << m_height; - scdr << m_width; - scdr << m_fields; - scdr << m_is_bigendian; - scdr << m_point_step; - scdr << m_row_step; - scdr << m_data; - scdr << m_is_dense; -} - -void sensor_msgs::msg::PointCloud2::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - dcdr >> m_height; - dcdr >> m_width; - dcdr >> m_fields; - dcdr >> m_is_bigendian; - dcdr >> m_point_step; - dcdr >> m_row_step; - dcdr >> m_data; - dcdr >> m_is_dense; -} - -/*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ -void sensor_msgs::msg::PointCloud2::header( - const std_msgs::msg::Header& _header) -{ - m_header = _header; -} - -/*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ -void sensor_msgs::msg::PointCloud2::header( - std_msgs::msg::Header&& _header) -{ - m_header = std::move(_header); -} - -/*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ -const std_msgs::msg::Header& sensor_msgs::msg::PointCloud2::header() const -{ - return m_header; -} - -/*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ -std_msgs::msg::Header& sensor_msgs::msg::PointCloud2::header() -{ - return m_header; -} - -/*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ -void sensor_msgs::msg::PointCloud2::height( - uint32_t _height) -{ - m_height = _height; -} - -/*! - * @brief This function returns the value of member height - * @return Value of member height - */ -uint32_t sensor_msgs::msg::PointCloud2::height() const -{ - return m_height; -} - -/*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ -uint32_t& sensor_msgs::msg::PointCloud2::height() -{ - return m_height; -} - -/*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ -void sensor_msgs::msg::PointCloud2::width( - uint32_t _width) -{ - m_width = _width; -} - -/*! - * @brief This function returns the value of member width - * @return Value of member width - */ -uint32_t sensor_msgs::msg::PointCloud2::width() const -{ - return m_width; -} - -/*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ -uint32_t& sensor_msgs::msg::PointCloud2::width() -{ - return m_width; -} - -/*! - * @brief This function copies the value in member fields - * @param _fields New value to be copied in member fields - */ -void sensor_msgs::msg::PointCloud2::fields( - const std::vector& _fields) -{ - m_fields = _fields; -} - -/*! - * @brief This function moves the value in member fields - * @param _fields New value to be moved in member fields - */ -void sensor_msgs::msg::PointCloud2::fields( - std::vector&& _fields) -{ - m_fields = std::move(_fields); -} - -/*! - * @brief This function returns a constant reference to member fields - * @return Constant reference to member fields - */ -const std::vector& sensor_msgs::msg::PointCloud2::fields() const -{ - return m_fields; -} - -/*! - * @brief This function returns a reference to member fields - * @return Reference to member fields - */ -std::vector& sensor_msgs::msg::PointCloud2::fields() -{ - return m_fields; -} - -/*! - * @brief This function sets a value in member is_bigendian - * @param _is_bigendian New value for member is_bigendian - */ -void sensor_msgs::msg::PointCloud2::is_bigendian( - bool _is_bigendian) -{ - m_is_bigendian = _is_bigendian; -} - -/*! - * @brief This function returns the value of member is_bigendian - * @return Value of member is_bigendian - */ -bool sensor_msgs::msg::PointCloud2::is_bigendian() const -{ - return m_is_bigendian; -} - -/*! - * @brief This function returns a reference to member is_bigendian - * @return Reference to member is_bigendian - */ -bool& sensor_msgs::msg::PointCloud2::is_bigendian() -{ - return m_is_bigendian; -} - -/*! - * @brief This function sets a value in member point_step - * @param _point_step New value for member point_step - */ -void sensor_msgs::msg::PointCloud2::point_step( - uint32_t _point_step) -{ - m_point_step = _point_step; -} - -/*! - * @brief This function returns the value of member point_step - * @return Value of member point_step - */ -uint32_t sensor_msgs::msg::PointCloud2::point_step() const -{ - return m_point_step; -} - -/*! - * @brief This function returns a reference to member point_step - * @return Reference to member point_step - */ -uint32_t& sensor_msgs::msg::PointCloud2::point_step() -{ - return m_point_step; -} - -/*! - * @brief This function sets a value in member row_step - * @param _row_step New value for member row_step - */ -void sensor_msgs::msg::PointCloud2::row_step( - uint32_t _row_step) -{ - m_row_step = _row_step; -} - -/*! - * @brief This function returns the value of member row_step - * @return Value of member row_step - */ -uint32_t sensor_msgs::msg::PointCloud2::row_step() const -{ - return m_row_step; -} - -/*! - * @brief This function returns a reference to member row_step - * @return Reference to member row_step - */ -uint32_t& sensor_msgs::msg::PointCloud2::row_step() -{ - return m_row_step; -} - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void sensor_msgs::msg::PointCloud2::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void sensor_msgs::msg::PointCloud2::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& sensor_msgs::msg::PointCloud2::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& sensor_msgs::msg::PointCloud2::data() -{ - return m_data; -} - -/*! - * @brief This function sets a value in member is_dense - * @param _is_dense New value for member is_dense - */ -void sensor_msgs::msg::PointCloud2::is_dense( - bool _is_dense) -{ - m_is_dense = _is_dense; -} - -/*! - * @brief This function returns the value of member is_dense - * @return Value of member is_dense - */ -bool sensor_msgs::msg::PointCloud2::is_dense() const -{ - return m_is_dense; -} - -/*! - * @brief This function returns a reference to member is_dense - * @return Reference to member is_dense - */ -bool& sensor_msgs::msg::PointCloud2::is_dense() -{ - return m_is_dense; -} - -size_t sensor_msgs::msg::PointCloud2::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_PointCloud2_max_key_cdr_typesize; -} - -bool sensor_msgs::msg::PointCloud2::isKeyDefined() -{ - return false; -} - -void sensor_msgs::msg::PointCloud2::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} diff --git a/LibCarla/source/carla/ros2/types/Polygon.h b/LibCarla/source/carla/ros2/types/Polygon.h new file mode 100644 index 00000000000..16227c03e07 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/Polygon.h @@ -0,0 +1,66 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include +#include + +#include "carla/geom/Location.h" +#include "carla/ros2/types/CoordinateSystemTransform.h" +#include "geometry_msgs/msg/Point32.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla (linear) acceleration to a ROS accel (linear part) + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS) +*/ +class Polygon { +public: + /** + * The representation of an (dynamic) Polygon in the sense of derived_Polygon_msgs::msg::Polygon. + * + * classification is one of the derived_Polygon_msgs::msg::Polygon_Constants::CLASSIFICATION_* constants + */ + Polygon(std::array const &vertices) + : _ros_polygon(std::make_shared>()) { + _ros_polygon->reserve(vertices.size()); + for (auto const &vertex : vertices) { + _ros_polygon->push_back(CoordinateSystemTransform::TransformLocationToPoint32Msg(vertex)); + } + } +#ifdef LIBCARLA_INCLUDED_FROM_UE4 + Polygon() : _ros_polygon(std::make_shared>()) {} + void SetGlobalVertices(TArray const &vertices) { + _ros_polygon->reserve(vertices.Num()); + for (auto const &vertex : vertices) { + _ros_polygon->push_back(CoordinateSystemTransform::TransformLocationToPoint32Msg(carla::geom::Location(vertex))); + } + } +#endif // LIBCARLA_INCLUDED_FROM_UE4 + + ~Polygon() = default; + Polygon(const Polygon &) = default; + Polygon &operator=(const Polygon &) = default; + Polygon(Polygon &&) = default; + Polygon &operator=(Polygon &&) = default; + + std::shared_ptr> polygon() const { + return _ros_polygon; + } + +private: + // store a shared_ptr to prevent from vector copies + std::shared_ptr> _ros_polygon; +}; + +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/PosePubSubTypes.h b/LibCarla/source/carla/ros2/types/PosePubSubTypes.h deleted file mode 100644 index 6c19d63db60..00000000000 --- a/LibCarla/source/carla/ros2/types/PosePubSubTypes.h +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PosePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ - -#include -#include - -#include "Pose.h" - -#include "PointPubSubTypes.h" -#include "QuaternionPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated Pose is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - #ifndef SWIG - namespace detail { - - template - struct Pose_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Pose_f - { - typedef geometry_msgs::msg::Quaternion Pose::* type; - friend constexpr type get( - Pose_f); - }; - - template struct Pose_rob; - - template - inline size_t constexpr Pose_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type Pose defined by the user in the IDL file. - * @ingroup POSE - */ - class PosePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Pose type; - - eProsima_user_DllExport PosePubSubType(); - - eProsima_user_DllExport virtual ~PosePubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Pose(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 56ULL == (detail::Pose_offset_of() + sizeof(geometry_msgs::msg::Quaternion)); - - }}; - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/PoseWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/types/PoseWithCovariancePubSubTypes.h deleted file mode 100644 index ee02471c2a9..00000000000 --- a/LibCarla/source/carla/ros2/types/PoseWithCovariancePubSubTypes.h +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PoseWithCovariancePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ - -#include -#include - -#include "PoseWithCovariance.h" -#include "PosePubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated PoseWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - typedef std::array geometry_msgs__PoseWithCovariance__double_array_36; - - #ifndef SWIG - namespace detail { - - template - struct PoseWithCovariance_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct PoseWithCovariance_f - { - typedef geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36 PoseWithCovariance::* type; - friend constexpr type get( - PoseWithCovariance_f); - }; - - template struct PoseWithCovariance_rob; - - template - inline size_t constexpr PoseWithCovariance_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type PoseWithCovariance defined by the user in the IDL file. - * @ingroup POSEWITHCOVARIANCE - */ - class PoseWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef PoseWithCovariance type; - - eProsima_user_DllExport PoseWithCovariancePubSubType(); - - eProsima_user_DllExport virtual ~PoseWithCovariancePubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PoseWithCovariance(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 344ULL == (detail::PoseWithCovariance_offset_of() + sizeof(geometry_msgs::msg::geometry_msgs__PoseWithCovariance__double_array_36)); - - }}; - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/PublisherSensorType.h b/LibCarla/source/carla/ros2/types/PublisherSensorType.h new file mode 100644 index 00000000000..89e41b52f74 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/PublisherSensorType.h @@ -0,0 +1,89 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +namespace carla { +namespace ros2 { +namespace types { + +enum class PublisherSensorType { + CollisionSensor, + DepthCamera, + NormalsCamera, + DVSCamera, + GnssSensor, + InertialMeasurementUnit, + LaneInvasionSensor, + ObstacleDetectionSensor, + OpticalFlowCamera, + Radar, + RayCastSemanticLidar, + RayCastLidar, + RssSensor, + SceneCaptureCamera, + SemanticSegmentationCamera, + InstanceSegmentationCamera, + WorldObserver, + CameraGBufferUint8, + CameraGBufferFloat, + V2X, + V2XCustom, + HSSLidar, + Unknown +}; +} +} // namespace ros2 +} // namespace carla + +namespace std { +inline std::string to_string(carla::ros2::types::PublisherSensorType sensor_type) { + switch (sensor_type) { + case carla::ros2::types::PublisherSensorType::CollisionSensor: + return "CollisionSensor"; + case carla::ros2::types::PublisherSensorType::DepthCamera: + return "DepthCamera"; + case carla::ros2::types::PublisherSensorType::NormalsCamera: + return "NormalsCamera"; + case carla::ros2::types::PublisherSensorType::DVSCamera: + return "DVSCamera"; + case carla::ros2::types::PublisherSensorType::GnssSensor: + return "GnssSensor"; + case carla::ros2::types::PublisherSensorType::InertialMeasurementUnit: + return "InertialMeasurementUnit"; + case carla::ros2::types::PublisherSensorType::LaneInvasionSensor: + return "LaneInvasionSensor"; + case carla::ros2::types::PublisherSensorType::ObstacleDetectionSensor: + return "ObstacleDetectionSensor"; + case carla::ros2::types::PublisherSensorType::OpticalFlowCamera: + return "OpticalFlowCamera"; + case carla::ros2::types::PublisherSensorType::Radar: + return "Radar"; + case carla::ros2::types::PublisherSensorType::RayCastSemanticLidar: + return "RayCastSemanticLidar"; + case carla::ros2::types::PublisherSensorType::RayCastLidar: + return "RayCastLidar"; + case carla::ros2::types::PublisherSensorType::RssSensor: + return "RssSensor"; + case carla::ros2::types::PublisherSensorType::SceneCaptureCamera: + return "SceneCaptureCamera"; + case carla::ros2::types::PublisherSensorType::SemanticSegmentationCamera: + return "SemanticSegmentationCamera"; + case carla::ros2::types::PublisherSensorType::InstanceSegmentationCamera: + return "InstanceSegmentationCamera"; + case carla::ros2::types::PublisherSensorType::WorldObserver: + return "WorldObserver"; + case carla::ros2::types::PublisherSensorType::CameraGBufferUint8: + return "CameraGBufferUint8"; + case carla::ros2::types::PublisherSensorType::CameraGBufferFloat: + return "CameraGBufferFloat"; + case carla::ros2::types::PublisherSensorType::V2X: + return "V2X"; + case carla::ros2::types::PublisherSensorType::V2XCustom: + return "V2XCustom"; + default: + return "Unknown"; + } +} +} // namespace std diff --git a/LibCarla/source/carla/ros2/types/Quaternion.h b/LibCarla/source/carla/ros2/types/Quaternion.h index 5e832eff1bd..2c5226a342d 100644 --- a/LibCarla/source/carla/ros2/types/Quaternion.h +++ b/LibCarla/source/carla/ros2/types/Quaternion.h @@ -1,265 +1,69 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Quaternion.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Quaternion_SOURCE) -#define Quaternion_DllAPI __declspec( dllexport ) -#else -#define Quaternion_DllAPI __declspec( dllimport ) -#endif // Quaternion_SOURCE -#else -#define Quaternion_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define Quaternion_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Quaternion defined by the user in the IDL file. - * @ingroup QUATERNION - */ - class Quaternion - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Quaternion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Quaternion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. - */ - eProsima_user_DllExport Quaternion( - const Quaternion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. - */ - eProsima_user_DllExport Quaternion( - Quaternion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. - */ - eProsima_user_DllExport Quaternion& operator =( - const Quaternion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. - */ - eProsima_user_DllExport Quaternion& operator =( - Quaternion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Quaternion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Quaternion& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Quaternion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Quaternion& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - /*! - * @brief This function sets a value in member w - * @param _w New value for member w - */ - eProsima_user_DllExport void w( - double _w); - - /*! - * @brief This function returns the value of member w - * @return Value of member w - */ - eProsima_user_DllExport double w() const; - - /*! - * @brief This function returns a reference to member w - * @return Reference to member w - */ - eProsima_user_DllExport double& w(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Quaternion& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - double m_x; - double m_y; - double m_z; - double m_w; - }; - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/geom/Math.h" +#include "carla/geom/Quaternion.h" +#include "geometry_msgs/msg/Quaternion.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla rotation to a ROS quaternion + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS). + Considers the conversion from degrees (carla) to radians (ROS). +*/ +class Quaternion { +public: + /** + * carla_rotation: the carla Rotation + */ + explicit Quaternion(const geom::Quaternion& carla_quaternion) { + // left-handed to right-handed -> negate the rotation by negating all axis components + // switch y-axis from right to left -> negate y-axis + _ros_quaternion.x(-carla_quaternion.x); // -(forward = forward) + _ros_quaternion.y(carla_quaternion.y); // -( right = -left ) + _ros_quaternion.z(-carla_quaternion.z); // -( up = up ) + _ros_quaternion.w(carla_quaternion.w); + } + /** + * carla_rotation: the carla Rotation + */ + explicit Quaternion(const geometry_msgs::msg::Quaternion& ros_quaternion) : _ros_quaternion(ros_quaternion) {} + + ~Quaternion() = default; + Quaternion(const Quaternion&) = default; + Quaternion& operator=(const Quaternion&) = default; + Quaternion(Quaternion&&) = default; + Quaternion& operator=(Quaternion&&) = default; + + /** + * The resulting ROS geometry_msgs::msg::Quaternion + */ + geometry_msgs::msg::Quaternion quaternion() const { + return _ros_quaternion; + } + + geom::Quaternion GetQuaternion() const { + geom::Quaternion carla_quaternion; + // left-handed to right-handed -> negate the rotation by negating all axis components + // switch y-axis from right to left -> negate y-axis + carla_quaternion.x = float(-_ros_quaternion.x()); // -(forward = forward) + carla_quaternion.y = float(_ros_quaternion.y()); // -( right = -left ) + carla_quaternion.z = float(-_ros_quaternion.z()); // -( up = up ) + carla_quaternion.w = float(_ros_quaternion.w()); + return carla_quaternion; + } + +private: + geometry_msgs::msg::Quaternion _ros_quaternion; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/RegionOfInterest.h b/LibCarla/source/carla/ros2/types/RegionOfInterest.h deleted file mode 100644 index 64c290fa687..00000000000 --- a/LibCarla/source/carla/ros2/types/RegionOfInterest.h +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RegionOfInterest.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(REGIONOFINTEREST_SOURCE) -#define REGIONOFINTEREST_DllAPI __declspec( dllexport ) -#else -#define REGIONOFINTEREST_DllAPI __declspec( dllimport ) -#endif // REGIONOFINTEREST_SOURCE -#else -#define REGIONOFINTEREST_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define REGIONOFINTEREST_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace sensor_msgs { - namespace msg { - /*! - * @brief This class represents the structure RegionOfInterest defined by the user in the IDL file. - * @ingroup RegionOfInterest - */ - class RegionOfInterest - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RegionOfInterest(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RegionOfInterest(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. - */ - eProsima_user_DllExport RegionOfInterest( - const RegionOfInterest& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. - */ - eProsima_user_DllExport RegionOfInterest( - RegionOfInterest&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. - */ - eProsima_user_DllExport RegionOfInterest& operator =( - const RegionOfInterest& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. - */ - eProsima_user_DllExport RegionOfInterest& operator =( - RegionOfInterest&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::RegionOfInterest object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RegionOfInterest& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::RegionOfInterest object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RegionOfInterest& x) const; - - /*! - * @brief This function sets a value in member x_offset - * @param _x_offset New value for member x_offset - */ - eProsima_user_DllExport void x_offset( - uint32_t _x_offset); - - /*! - * @brief This function returns the value of member x_offset - * @return Value of member x_offset - */ - eProsima_user_DllExport uint32_t x_offset() const; - - /*! - * @brief This function returns a reference to member x_offset - * @return Reference to member x_offset - */ - eProsima_user_DllExport uint32_t& x_offset(); - - /*! - * @brief This function sets a value in member y_offset - * @param _y_offset New value for member y_offset - */ - eProsima_user_DllExport void y_offset( - uint32_t _y_offset); - - /*! - * @brief This function returns the value of member y_offset - * @return Value of member y_offset - */ - eProsima_user_DllExport uint32_t y_offset() const; - - /*! - * @brief This function returns a reference to member y_offset - * @return Reference to member y_offset - */ - eProsima_user_DllExport uint32_t& y_offset(); - - /*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ - eProsima_user_DllExport void height( - uint32_t _height); - - /*! - * @brief This function returns the value of member height - * @return Value of member height - */ - eProsima_user_DllExport uint32_t height() const; - - /*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ - eProsima_user_DllExport uint32_t& height(); - - /*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ - eProsima_user_DllExport void width( - uint32_t _width); - - /*! - * @brief This function returns the value of member width - * @return Value of member width - */ - eProsima_user_DllExport uint32_t width() const; - - /*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ - eProsima_user_DllExport uint32_t& width(); - - /*! - * @brief This function sets a value in member do_rectify - * @param _do_rectify New value for member do_rectify - */ - eProsima_user_DllExport void do_rectify( - bool _do_rectify); - - /*! - * @brief This function returns the value of member do_rectify - * @return Value of member do_rectify - */ - eProsima_user_DllExport bool do_rectify() const; - - /*! - * @brief This function returns a reference to member do_rectify - * @return Reference to member do_rectify - */ - eProsima_user_DllExport bool& do_rectify(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sensor_msgs::msg::RegionOfInterest& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - uint32_t m_x_offset; - uint32_t m_y_offset; - uint32_t m_height; - uint32_t m_width; - bool m_do_rectify; - }; - } // namespace msg -} // namespace sensor_msgs - -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ diff --git a/LibCarla/source/carla/ros2/types/RegionOfInterestPubSubTypes.h b/LibCarla/source/carla/ros2/types/RegionOfInterestPubSubTypes.h deleted file mode 100644 index 0d9ea9ec08f..00000000000 --- a/LibCarla/source/carla/ros2/types/RegionOfInterestPubSubTypes.h +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file RegionOfInterestPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ - -#include -#include - -#include "RegionOfInterest.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated RegionOfInterest is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace sensor_msgs -{ - namespace msg - { - - #ifndef SWIG - namespace detail { - - template - struct RegionOfInterest_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct RegionOfInterest_f - { - typedef bool RegionOfInterest::* type; - friend constexpr type get( - RegionOfInterest_f); - }; - - template struct RegionOfInterest_rob; - - template - inline size_t constexpr RegionOfInterest_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type RegionOfInterest defined by the user in the IDL file. - * @ingroup RegionOfInterest - */ - class RegionOfInterestPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef RegionOfInterest type; - - eProsima_user_DllExport RegionOfInterestPubSubType(); - - eProsima_user_DllExport virtual ~RegionOfInterestPubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) RegionOfInterest(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - private: - - static constexpr bool is_plain_impl() - { - return 17ULL == (detail::RegionOfInterest_offset_of() + sizeof(bool)); - - }}; - } -} - -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/SensorActorDefinition.h b/LibCarla/source/carla/ros2/types/SensorActorDefinition.h new file mode 100644 index 00000000000..709b8e88821 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/SensorActorDefinition.h @@ -0,0 +1,42 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/types/ActorNameDefinition.h" +#include "carla/ros2/types/PublisherSensorType.h" +#include "carla/streaming/detail/Types.h" +#include "carla/rpc/CustomV2XBytes.h" +#include "carla/sensor/data/LibITS.h" + +#include + +namespace carla { +namespace ros2 { +namespace types { + +using V2XCustomSendCallback = std::function; + +struct SensorActorDefinition : public ActorNameDefinition { + SensorActorDefinition(ActorNameDefinition const &actor_name_definition, + carla::ros2::types::PublisherSensorType sensor_type_, + carla::streaming::detail::stream_id_type stream_id_) + : ActorNameDefinition(actor_name_definition), sensor_type(sensor_type_), stream_id(stream_id_) {} + + carla::ros2::types::PublisherSensorType sensor_type; + carla::streaming::detail::stream_id_type stream_id; +}; +} // namespace types +} // namespace ros2 +} // namespace carla + +namespace std { + +inline std::string to_string(carla::ros2::types::SensorActorDefinition const &actor_definition) { + return "SensorActor(" + to_string(static_cast(actor_definition)) + + " sensor_type=" + std::to_string(actor_definition.sensor_type) + + " stream_id=" + std::to_string(actor_definition.stream_id) + ")"; +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Speed.h b/LibCarla/source/carla/ros2/types/Speed.h new file mode 100644 index 00000000000..23d42ffa425 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/Speed.h @@ -0,0 +1,65 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/geom/Math.h" +#include "carla/geom/Quaternion.h" +#include "carla/geom/Velocity.h" +#include "std_msgs/msg/Float32.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla linear Speed to a ROS accel + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS) + +*/ +class Speed { +public: + /** + * carla_speed: the carla linear Speed + */ + Speed(carla::geom::Velocity const &carla_linear_velocity, carla::geom::Quaternion const &carla_quat) { + _linear_velocity_ros.x = carla_linear_velocity.x; + _linear_velocity_ros.y = -carla_linear_velocity.y; + _linear_velocity_ros.z = carla_linear_velocity.z; + _ros_speed.data(_linear_velocity_ros.Speed(carla_quat)); + } +#ifdef LIBCARLA_INCLUDED_FROM_UE4 + Speed(const FVector &carla_linear_velocity, const FQuat &carla_quat) + : Speed(carla::geom::Velocity(carla_linear_velocity), carla::geom::Quaternion(carla_quat)) {} +#endif // LIBCARLA_INCLUDED_FROM_UE4 + Speed() = default; + ~Speed() = default; + Speed(const Speed &) = default; + Speed &operator=(const Speed &) = default; + Speed(Speed &&) = default; + Speed &operator=(Speed &&) = default; + + /** + * The resulting ROS std_msgs::msg::Float32 + */ + std_msgs::msg::Float32 speed() const { + return _ros_speed; + } + + /** + * The linear velocity as carla::geom::Vector3D but in ROS coordinates + */ + carla::geom::Velocity LinearVelocityROS() const { + return _linear_velocity_ros; + } + +private: + carla::geom::Velocity _linear_velocity_ros; + std_msgs::msg::Float32 _ros_speed; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Timestamp.h b/LibCarla/source/carla/ros2/types/Timestamp.h new file mode 100644 index 00000000000..ea8ea029202 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/Timestamp.h @@ -0,0 +1,56 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "builtin_interfaces/msg/Time.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla Timestamp to a ROS builtin_interfaces::msg::Time + and holds carla time details +*/ +class Timestamp { +public: + explicit Timestamp(double timestamp = 0.) { + double integral; + const double fractional = std::modf(timestamp, &integral); + _ros_time.sec(static_cast(integral)); + _ros_time.nanosec(static_cast(fractional * 1e9)); + _stamp = double(_ros_time.sec()) + 1e-9 * double(_ros_time.nanosec()); + } + + explicit Timestamp(const builtin_interfaces::msg::Time& time) : _ros_time(time) { + _stamp = double(_ros_time.sec()) + 1e-9 * double(_ros_time.nanosec()); + } + + ~Timestamp() = default; + Timestamp(const Timestamp&) = default; + Timestamp& operator=(const Timestamp&) = default; + Timestamp(Timestamp&&) = default; + Timestamp& operator=(Timestamp&&) = default; + + double Stamp() const { + return _stamp; + } + + /** + * The resulting ROS builtin_interfaces::msg::Time + */ + const builtin_interfaces::msg::Time& time() const { + return _ros_time; + } + +private: + double _stamp{0.}; + builtin_interfaces::msg::Time _ros_time; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h b/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h new file mode 100644 index 00000000000..0c6b8aa5b65 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h @@ -0,0 +1,44 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/types/ActorDefinition.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "carla_msgs/msg/CarlaTrafficLightStatus.h" + +namespace carla { +namespace ros2 { +namespace types { + +inline uint8_t GetTrafficLightState(carla::sensor::data::ActorDynamicState const &actor_dynamic_state) { + switch (actor_dynamic_state.state.traffic_light_data.state) { + case carla::rpc::TrafficLightState::Red: + return carla_msgs::msg::CarlaTrafficLightStatus_Constants::RED; + case carla::rpc::TrafficLightState::Yellow: + return carla_msgs::msg::CarlaTrafficLightStatus_Constants::YELLOW; + case carla::rpc::TrafficLightState::Green: + return carla_msgs::msg::CarlaTrafficLightStatus_Constants::GREEN; + case carla::rpc::TrafficLightState::Off: + return carla_msgs::msg::CarlaTrafficLightStatus_Constants::OFF; + case carla::rpc::TrafficLightState::Unknown: + default: + return carla_msgs::msg::CarlaTrafficLightStatus_Constants::UNKNOWN; + } +} + +struct TrafficLightActorDefinition : public ActorDefinition { + TrafficLightActorDefinition(ActorDefinition const &actor_definitions) : ActorDefinition(actor_definitions) {} +}; +} // namespace types +} // namespace ros2 +} // namespace carla + +namespace std { + +inline std::string to_string(carla::ros2::types::TrafficLightActorDefinition const &actor_definition) { + return "TrafficLightActor(" + to_string(static_cast(actor_definition)) + ")"; +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/TrafficSignActorDefinition.h b/LibCarla/source/carla/ros2/types/TrafficSignActorDefinition.h new file mode 100644 index 00000000000..2a3201d4b68 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/TrafficSignActorDefinition.h @@ -0,0 +1,28 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/types/ActorDefinition.h" + +namespace carla { +namespace ros2 { +namespace types { + +struct TrafficSignActorDefinition : public ActorDefinition { + TrafficSignActorDefinition(ActorDefinition const &actor_definitions) : ActorDefinition(actor_definitions) {} + virtual ~TrafficSignActorDefinition() = default; +}; + +} // namespace types +} // namespace ros2 +} // namespace carla + +namespace std { + +inline std::string to_string(carla::ros2::types::TrafficSignActorDefinition const &actor_definition) { + return "TrafficSignActor(" + to_string(static_cast(actor_definition)) + ")"; +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Transform.h b/LibCarla/source/carla/ros2/types/Transform.h index daca6910321..2d63347309f 100644 --- a/LibCarla/source/carla/ros2/types/Transform.h +++ b/LibCarla/source/carla/ros2/types/Transform.h @@ -1,241 +1,143 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Transform.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ - -#include "Vector3.h" -#include "Quaternion.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Transform_SOURCE) -#define Transform_DllAPI __declspec( dllexport ) -#else -#define Transform_DllAPI __declspec( dllimport ) -#endif // Transform_SOURCE -#else -#define Transform_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define Transform_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Transform defined by the user in the IDL file. - * @ingroup TRANSFORM - */ - class Transform - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Transform(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Transform(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. - */ - eProsima_user_DllExport Transform( - const Transform& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. - */ - eProsima_user_DllExport Transform( - Transform&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. - */ - eProsima_user_DllExport Transform& operator =( - const Transform& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. - */ - eProsima_user_DllExport Transform& operator =( - Transform&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Transform object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Transform& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Transform object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Transform& x) const; - - /*! - * @brief This function copies the value in member translation - * @param _translation New value to be copied in member translation - */ - eProsima_user_DllExport void translation( - const geometry_msgs::msg::Vector3& _translation); - - /*! - * @brief This function moves the value in member translation - * @param _translation New value to be moved in member translation - */ - eProsima_user_DllExport void translation( - geometry_msgs::msg::Vector3&& _translation); - - /*! - * @brief This function returns a constant reference to member translation - * @return Constant reference to member translation - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& translation() const; - - /*! - * @brief This function returns a reference to member translation - * @return Reference to member translation - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& translation(); - /*! - * @brief This function copies the value in member rotation - * @param _rotation New value to be copied in member rotation - */ - eProsima_user_DllExport void rotation( - const geometry_msgs::msg::Quaternion& _rotation); - - /*! - * @brief This function moves the value in member rotation - * @param _rotation New value to be moved in member rotation - */ - eProsima_user_DllExport void rotation( - geometry_msgs::msg::Quaternion&& _rotation); - - /*! - * @brief This function returns a constant reference to member rotation - * @return Constant reference to member rotation - */ - eProsima_user_DllExport const geometry_msgs::msg::Quaternion& rotation() const; - - /*! - * @brief This function returns a reference to member rotation - * @return Reference to member rotation - */ - eProsima_user_DllExport geometry_msgs::msg::Quaternion& rotation(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Transform& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - geometry_msgs::msg::Vector3 m_translation; - geometry_msgs::msg::Quaternion m_rotation; - }; - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/geom/Transform.h" +#include "carla/ros2/types/CoordinateSystemTransform.h" +#include "carla/ros2/types/Quaternion.h" +#include "geometry_msgs/msg/PoseWithCovariance.h" +#include "geometry_msgs/msg/Transform.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla transform to a ROS transform +*/ +class Transform { +public: + Transform() = default; + + /** + * carla_transform: the carla Transform + */ + explicit Transform(const carla::geom::Transform& carla_transform, const carla::geom::Quaternion& carla_quaternion) + : _carla_transform(carla_transform), _carla_quaternion(carla_quaternion) { + init_ros_transform(); + } + + explicit Transform(const geometry_msgs::msg::Pose& pose) { + _ros_transform.translation().x(pose.position().x()); + _ros_transform.translation().y(pose.position().y()); + _ros_transform.translation().z(pose.position().z()); + _ros_transform.rotation(pose.orientation()); + // switch y-axis from right to left -> negate y-axis + carla::geom::Vector3D ros_location; + ros_location.x = float(pose.position().x()); + ros_location.y = float(pose.position().y()); + ros_location.z = float(pose.position().z()); + _carla_transform.location = CoordinateSystemTransform::TransformLinearAxixVector3D(ros_location); + _carla_quaternion = carla::ros2::types::Quaternion(_ros_transform.rotation()).GetQuaternion(); + } + +#ifdef LIBCARLA_INCLUDED_FROM_UE4 + Transform(const FTransform& ue4_transform) + : _carla_transform(ue4_transform), _carla_quaternion(ue4_transform.GetRotation()) { + init_ros_transform(); + } +#endif // LIBCARLA_INCLUDED_FROM_UE4 + + ~Transform() = default; + Transform(const Transform&) = default; + Transform& operator=(const Transform&) = default; + Transform(Transform&&) = default; + Transform& operator=(Transform&&) = default; + + /** + * The resulting ROS geometry_msgs::msg::Transform + * + * Uses ROS naming convention + */ + const geometry_msgs::msg::Transform& transform() const { + return _ros_transform; + } + + /** + * Get the geometry_msgs::msg::Pose that is identical with the geometry_msgs::msg::Transform + * + * Uses ROS naming convention + */ + const geometry_msgs::msg::Pose pose() const { + geometry_msgs::msg::Pose ros_pose; + ros_pose.position().x(_ros_transform.translation().x()); + ros_pose.position().y(_ros_transform.translation().y()); + ros_pose.position().z(_ros_transform.translation().z()); + ros_pose.orientation(_ros_transform.rotation()); + return ros_pose; + } + + /** + * Get the geometry_msgs::msg::PoseWithCovariance that is identical with the geometry_msgs::msg::Transform + * + * Uses ROS naming convention + */ + const geometry_msgs::msg::PoseWithCovariance pose_with_covariance() const { + geometry_msgs::msg::PoseWithCovariance ros_pose_with_covariance; + ros_pose_with_covariance.pose(pose()); + return ros_pose_with_covariance; + } + + /** + * The carla Transform + * + * Uses CARLA naming convention + */ + const carla::geom::Transform& GetTransform() const { + return _carla_transform; + } + + /** + * The carla Location + * + * Uses CARLA naming convention + */ + const carla::geom::Location& GetLocation() const { + return _carla_transform.location; + } + + /** + * The carla Rotator + * + * Uses CARLA naming convention + */ + const carla::geom::Rotation& GetRotator() const { + return _carla_transform.rotation; + } + + /** + * The carla Quaternion + * + * Uses CARLA naming convention + */ + const carla::geom::Quaternion& GetQuaternion() const { + return _carla_quaternion; + } + +private: + void init_ros_transform() { + // switch y-axis from right to left -> negate y-axis + _ros_transform.translation() = CoordinateSystemTransform::TransformLinearAxisMsg(_carla_transform.location); + _ros_transform.rotation(carla::ros2::types::Quaternion(_carla_quaternion).quaternion()); + } + + // keep the carla types for local + carla::geom::Transform _carla_transform; + carla::geom::Quaternion _carla_quaternion; + geometry_msgs::msg::Transform _ros_transform; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/TransformPubSubTypes.h b/LibCarla/source/carla/ros2/types/TransformPubSubTypes.h deleted file mode 100644 index a4d04e45461..00000000000 --- a/LibCarla/source/carla/ros2/types/TransformPubSubTypes.h +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TransformPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ - -#include -#include - -#include "Transform.h" - -#include "Vector3PubSubTypes.h" -#include "QuaternionPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated Transform is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - - #ifndef SWIG - namespace detail { - - template - struct Transform_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Transform_f - { - typedef geometry_msgs::msg::Quaternion Transform::* type; - friend constexpr type get( - Transform_f); - }; - - template struct Transform_rob; - - template - inline size_t constexpr Transform_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type Transform defined by the user in the IDL file. - * @ingroup TRANSFORM - */ - class TransformPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Transform type; - - eProsima_user_DllExport TransformPubSubType(); - - eProsima_user_DllExport virtual ~TransformPubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Transform(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 56ULL == (detail::Transform_offset_of() + sizeof(geometry_msgs::msg::Quaternion)); - - }}; - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/Twist.h b/LibCarla/source/carla/ros2/types/Twist.h index 402ed9845fe..92146515149 100644 --- a/LibCarla/source/carla/ros2/types/Twist.h +++ b/LibCarla/source/carla/ros2/types/Twist.h @@ -1,240 +1,62 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Twist.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ - -#include "Vector3.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Twist_SOURCE) -#define Twist_DllAPI __declspec( dllexport ) -#else -#define Twist_DllAPI __declspec( dllimport ) -#endif // Twist_SOURCE -#else -#define Twist_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define Twist_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Twist defined by the user in the IDL file. - * @ingroup TWIST - */ - class Twist - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Twist(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Twist(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. - */ - eProsima_user_DllExport Twist( - const Twist& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. - */ - eProsima_user_DllExport Twist( - Twist&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. - */ - eProsima_user_DllExport Twist& operator =( - const Twist& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. - */ - eProsima_user_DllExport Twist& operator =( - Twist&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Twist object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Twist& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Twist object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Twist& x) const; - - /*! - * @brief This function copies the value in member linear - * @param _linear New value to be copied in member linear - */ - eProsima_user_DllExport void linear( - const geometry_msgs::msg::Vector3& _linear); - - /*! - * @brief This function moves the value in member linear - * @param _linear New value to be moved in member linear - */ - eProsima_user_DllExport void linear( - geometry_msgs::msg::Vector3&& _linear); - - /*! - * @brief This function returns a constant reference to member linear - * @return Constant reference to member linear - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear() const; - - /*! - * @brief This function returns a reference to member linear - * @return Reference to member linear - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& linear(); - /*! - * @brief This function copies the value in member angular - * @param _angular New value to be copied in member angular - */ - eProsima_user_DllExport void angular( - const geometry_msgs::msg::Vector3& _angular); - - /*! - * @brief This function moves the value in member angular - * @param _angular New value to be moved in member angular - */ - eProsima_user_DllExport void angular( - geometry_msgs::msg::Vector3&& _angular); - - /*! - * @brief This function returns a constant reference to member angular - * @return Constant reference to member angular - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular() const; - - /*! - * @brief This function returns a reference to member angular - * @return Reference to member angular - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& angular(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Twist& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - geometry_msgs::msg::Vector3 m_linear; - geometry_msgs::msg::Vector3 m_angular; - }; - } // namespace msg -} // namespace geometry_msgs - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/geom/Vector3D.h" +#include "carla/ros2/types/AngularVelocity.h" +#include "carla/ros2/types/Speed.h" +#include "geometry_msgs/msg/TwistWithCovariance.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert carla velocities to a ROS twist + + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS). +*/ +class Twist { +public: + /** + * carla_Twist: the carla Twist + */ + Twist(Speed const& speed, AngularVelocity const& angular_velocity) { + _ros_twist.linear().x(speed.LinearVelocityROS().x); + _ros_twist.linear().y(speed.LinearVelocityROS().y); + _ros_twist.linear().z(speed.LinearVelocityROS().z); + _ros_twist.angular().x(angular_velocity.AngularVelocityROS().x); + _ros_twist.angular().y(angular_velocity.AngularVelocityROS().y); + _ros_twist.angular().z(angular_velocity.AngularVelocityROS().z); + } + ~Twist() = default; + Twist(const Twist&) = default; + Twist& operator=(const Twist&) = default; + Twist(Twist&&) = default; + Twist& operator=(Twist&&) = default; + + /** + * The resulting ROS geometry_msgs::msg::twist + */ + geometry_msgs::msg::Twist twist() const { + return _ros_twist; + } + + /** + * The resulting ROS geometry_msgs::msg::twist + */ + geometry_msgs::msg::TwistWithCovariance twist_with_covariance() const { + geometry_msgs::msg::TwistWithCovariance _ros_twist_with_covariance; + _ros_twist_with_covariance.twist(_ros_twist); + return _ros_twist_with_covariance; + } + +private: + geometry_msgs::msg::Twist _ros_twist; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/TwistPubSubTypes.h b/LibCarla/source/carla/ros2/types/TwistPubSubTypes.h deleted file mode 100644 index b4e959e65be..00000000000 --- a/LibCarla/source/carla/ros2/types/TwistPubSubTypes.h +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ - -#include -#include - -#include "Twist.h" - -#include "Vector3PubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated Twist is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - - #ifndef SWIG - namespace detail { - - template - struct Twist_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct Twist_f - { - typedef geometry_msgs::msg::Vector3 Twist::* type; - friend constexpr type get( - Twist_f); - }; - - template struct Twist_rob; - - template - inline size_t constexpr Twist_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type Twist defined by the user in the IDL file. - * @ingroup TWIST - */ - class TwistPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Twist type; - - eProsima_user_DllExport TwistPubSubType(); - - eProsima_user_DllExport virtual ~TwistPubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Twist(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 48ULL == (detail::Twist_offset_of() + sizeof(geometry_msgs::msg::Vector3)); - - }}; - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/TwistWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/types/TwistWithCovariancePubSubTypes.h deleted file mode 100644 index 812d236f643..00000000000 --- a/LibCarla/source/carla/ros2/types/TwistWithCovariancePubSubTypes.h +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TwistWithCovariancePubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ - -#include -#include - -#include "TwistWithCovariance.h" -#include "TwistPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated TwistWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace geometry_msgs -{ - namespace msg - { - typedef std::array geometry_msgs__TwistWithCovariance__double_array_36; - - #ifndef SWIG - namespace detail { - - template - struct TwistWithCovariance_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct TwistWithCovariance_f - { - typedef geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36 TwistWithCovariance::* type; - friend constexpr type get( - TwistWithCovariance_f); - }; - - template struct TwistWithCovariance_rob; - - template - inline size_t constexpr TwistWithCovariance_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - - /*! - * @brief This class represents the TopicDataType of the type TwistWithCovariance defined by the user in the IDL file. - * @ingroup TWISTWITHCOVARIANCE - */ - class TwistWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef TwistWithCovariance type; - - eProsima_user_DllExport TwistWithCovariancePubSubType(); - - eProsima_user_DllExport virtual ~TwistWithCovariancePubSubType() override; - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) TwistWithCovariance(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - private: - static constexpr bool is_plain_impl() - { - return 336ULL == (detail::TwistWithCovariance_offset_of() + sizeof(geometry_msgs::msg::geometry_msgs__TwistWithCovariance__double_array_36)); - - }}; - } -} - -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/types/VehicleAckermannControl.h b/LibCarla/source/carla/ros2/types/VehicleAckermannControl.h new file mode 100644 index 00000000000..89acd74f228 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/VehicleAckermannControl.h @@ -0,0 +1,61 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "ackermann_msgs/msg/AckermannDriveStamped.h" +#include "carla/ros2/types/Timestamp.h" +#include "carla/rpc/VehicleAckermannControl.h" +#include "carla/sensor/data/ActorDynamicState.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + * VehicleAckermannControl: convert ackermann_msgs::msg::AckermannDriveStamped into FVehicleAckermannControl without the + * need of knowing FVehicleAckermannControl class within LibCarla + */ +class VehicleAckermannControl { +public: + explicit VehicleAckermannControl(const ackermann_msgs::msg::AckermannDriveStamped& vehicle_ackermann_control) + : _vehicle_ackermann_control(vehicle_ackermann_control) {} + ~VehicleAckermannControl() = default; + VehicleAckermannControl(const VehicleAckermannControl&) = default; + VehicleAckermannControl& operator=(const VehicleAckermannControl&) = default; + VehicleAckermannControl(VehicleAckermannControl&&) = default; + VehicleAckermannControl& operator=(VehicleAckermannControl&&) = default; + + ackermann_msgs::msg::AckermannDriveStamped const& carla_vehicle_ackermann_control() const { + return _vehicle_ackermann_control; + } + + VehicleAckermannControl(const carla::rpc::VehicleAckermannControl& vehicle_ackermann_control) { + _vehicle_ackermann_control.header().stamp(Timestamp(vehicle_ackermann_control.timestamp).time()); + _vehicle_ackermann_control.drive().steering_angle(vehicle_ackermann_control.steer); + _vehicle_ackermann_control.drive().steering_angle_velocity(vehicle_ackermann_control.steer_speed); + _vehicle_ackermann_control.drive().speed(vehicle_ackermann_control.speed); + _vehicle_ackermann_control.drive().acceleration(vehicle_ackermann_control.acceleration); + _vehicle_ackermann_control.drive().jerk(vehicle_ackermann_control.jerk); + } + +#ifdef LIBCARLA_INCLUDED_FROM_UE4 + + FVehicleAckermannControl GetVehicleAckermannControl() const { + FVehicleAckermannControl vehicle_ackermann_control; + vehicle_ackermann_control.Timestamp = Timestamp(_vehicle_ackermann_control.header().stamp()).Stamp(); + vehicle_ackermann_control.Steer = _vehicle_ackermann_control.drive().steering_angle(); + vehicle_ackermann_control.SteerSpeed = _vehicle_ackermann_control.drive().steering_angle_velocity(); + vehicle_ackermann_control.Speed = _vehicle_ackermann_control.drive().speed(); + vehicle_ackermann_control.Acceleration = _vehicle_ackermann_control.drive().acceleration(); + vehicle_ackermann_control.Jerk = _vehicle_ackermann_control.drive().jerk(); + return vehicle_ackermann_control; + } +#endif // LIBCARLA_INCLUDED_FROM_UE4 +private: + ackermann_msgs::msg::AckermannDriveStamped _vehicle_ackermann_control; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h b/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h new file mode 100644 index 00000000000..d6fdcb6405e --- /dev/null +++ b/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h @@ -0,0 +1,50 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/ros2/types/ActorDefinition.h" +#include "carla/ros2/types/VehicleAckermannControl.h" +#include "carla/ros2/types/VehicleControl.h" +#include "carla/rpc/VehiclePhysicsControl.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "carla_msgs/msg/CarlaEgoVehicleStatus.h" + +namespace carla { +namespace ros2 { +namespace types { + +using VehicleControlCallback = std::function; + +using VehicleAckermannControlCallback = std::function; + +inline uint8_t GetVehicleControlType(carla::sensor::data::ActorDynamicState const &actor_dynamic_state) { + switch (actor_dynamic_state.state.vehicle_data.control_type) { + case carla::rpc::VehicleControlType::AckermannControl: + return carla_msgs::msg::CarlaEgoVehicleStatus_Constants::ACKERMANN_CONTROL; + case carla::rpc::VehicleControlType::VehicleControl: + default: + return carla_msgs::msg::CarlaEgoVehicleStatus_Constants::VEHICLE_CONTROL; + } +} + +struct VehicleActorDefinition : public ActorDefinition { + VehicleActorDefinition(ActorDefinition const &actor_definition, rpc::VehiclePhysicsControl vehicle_physics_control_in) + : ActorDefinition(actor_definition), vehicle_physics_control(vehicle_physics_control_in) {} + + rpc::VehiclePhysicsControl vehicle_physics_control; +}; +} // namespace types +} // namespace ros2 +} // namespace carla + +namespace std { + +inline std::string to_string(carla::ros2::types::VehicleActorDefinition const &actor_definition) { + return "VehicleActor(" + to_string(static_cast(actor_definition)) + ")"; +} + +} // namespace std diff --git a/LibCarla/source/carla/ros2/types/VehicleControl.h b/LibCarla/source/carla/ros2/types/VehicleControl.h new file mode 100644 index 00000000000..5bc4aabdf85 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/VehicleControl.h @@ -0,0 +1,70 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/types/Timestamp.h" +#include "carla/rpc/VehicleControl.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "carla_msgs/msg/CarlaEgoVehicleControl.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + * VehicleControl: convert carla_msgs::msg::CarlaEgoVehicleControl into FVehicleControl without the need of + * knowing FVehicleControl class within LibCarla + */ +class VehicleControl { +public: + explicit VehicleControl(const carla_msgs::msg::CarlaEgoVehicleControl& vehicle_control) + : _vehicle_control(vehicle_control) {} + ~VehicleControl() = default; + VehicleControl(const VehicleControl&) = default; + VehicleControl& operator=(const VehicleControl&) = default; + VehicleControl(VehicleControl&&) = default; + VehicleControl& operator=(VehicleControl&&) = default; + + carla_msgs::msg::CarlaEgoVehicleControl const& carla_vehicle_control() const { + return _vehicle_control; + } + + VehicleControl(const carla::rpc::VehicleControl& vehicle_control, uint8_t control_priority = 0) { + _vehicle_control.header().stamp(Timestamp(vehicle_control.timestamp).time()); + _vehicle_control.throttle(vehicle_control.throttle); + _vehicle_control.steer(vehicle_control.steer); + _vehicle_control.brake(vehicle_control.brake); + _vehicle_control.hand_brake(vehicle_control.hand_brake); + _vehicle_control.reverse(vehicle_control.reverse); + _vehicle_control.gear(vehicle_control.gear); + _vehicle_control.manual_gear_shift(vehicle_control.manual_gear_shift); + _vehicle_control.control_priority(control_priority); + } + +#ifdef LIBCARLA_INCLUDED_FROM_UE4 + FVehicleControl GetVehicleControl() const { + FVehicleControl vehicle_control; + vehicle_control.Timestamp = Timestamp(_vehicle_control.header().stamp()).Stamp(); + vehicle_control.Throttle = _vehicle_control.throttle(); + vehicle_control.Steer = _vehicle_control.steer(); + vehicle_control.Brake = _vehicle_control.brake(); + vehicle_control.bHandBrake = _vehicle_control.hand_brake(); + vehicle_control.bReverse = _vehicle_control.reverse(); + vehicle_control.bManualGearShift = _vehicle_control.manual_gear_shift(); + vehicle_control.Gear = _vehicle_control.gear(); + return vehicle_control; + } + + EVehicleInputPriority ControlPriority() const { + return EVehicleInputPriority(_vehicle_control.control_priority()); + } + +#endif // LIBCARLA_INCLUDED_FROM_UE4 +private: + carla_msgs::msg::CarlaEgoVehicleControl _vehicle_control; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/WalkerActorDefinition.h b/LibCarla/source/carla/ros2/types/WalkerActorDefinition.h new file mode 100644 index 00000000000..2d5be9d5862 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/WalkerActorDefinition.h @@ -0,0 +1,32 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include "carla/ros2/types/ActorDefinition.h" +#include "carla/ros2/types/WalkerControl.h" +#include "carla/rpc/WalkerControl.h" + +namespace carla { +namespace ros2 { +namespace types { + +using WalkerControlCallback = std::function; + +struct WalkerActorDefinition : public ActorDefinition { + WalkerActorDefinition(ActorDefinition const &actor_definition) : ActorDefinition(actor_definition) {} + virtual ~WalkerActorDefinition() = default; +}; +} // namespace types +} // namespace ros2 +} // namespace carla + +namespace std { + +inline std::string to_string(carla::ros2::types::WalkerActorDefinition const &actor_definition) { + return "WalkerActor(" + to_string(static_cast(actor_definition)) + ")"; +} + +} // namespace std diff --git a/LibCarla/source/carla/ros2/types/WalkerControl.h b/LibCarla/source/carla/ros2/types/WalkerControl.h new file mode 100644 index 00000000000..2bf8e12eb06 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/WalkerControl.h @@ -0,0 +1,60 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/types/Timestamp.h" +#include "carla/rpc/WalkerControl.h" +#include "carla/sensor/data/ActorDynamicState.h" +#include "carla_msgs/msg/CarlaWalkerControl.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + * WalkerControl: convert carla_msgs::msg::CarlaWalkerControl into FWalkerControl without the need of + * knowing FWalkerControl class within LibCarla + */ +class WalkerControl { +public: + explicit WalkerControl(const carla_msgs::msg::CarlaWalkerControl& walker_control) : _walker_control(walker_control) {} + ~WalkerControl() = default; + WalkerControl(const WalkerControl&) = default; + WalkerControl& operator=(const WalkerControl&) = default; + WalkerControl(WalkerControl&&) = default; + WalkerControl& operator=(WalkerControl&&) = default; + + carla_msgs::msg::CarlaWalkerControl const& carla_walker_control() const { + return _walker_control; + } + + WalkerControl(const carla::rpc::WalkerControl& walker_control) { + _walker_control.header().stamp(Timestamp(walker_control.timestamp).time()); + _walker_control.direction().x(walker_control.direction.x); + _walker_control.direction().y(walker_control.direction.y); + _walker_control.direction().z(walker_control.direction.z); + _walker_control.speed(walker_control.speed); + _walker_control.jump(walker_control.jump); + } + +#ifdef LIBCARLA_INCLUDED_FROM_UE4 + FWalkerControl GetWalkerControl() const { + FWalkerControl walker_control; + walker_control.Timestamp = Timestamp(_walker_control.header().stamp()).Stamp(); + walker_control.Speed = _walker_control.speed(); + walker_control.Direction.X = _walker_control.direction().x(); + walker_control.Direction.Y = -_walker_control.direction().y(); + walker_control.Direction.Z = _walker_control.direction().z(); + walker_control.Jump = _walker_control.jump(); + return walker_control; + } + +#endif // LIBCARLA_INCLUDED_FROM_UE4 +private: + carla_msgs::msg::CarlaWalkerControl _walker_control; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/sensor/RawData.h b/LibCarla/source/carla/sensor/RawData.h index d9212368e5f..570bd047823 100644 --- a/LibCarla/source/carla/sensor/RawData.h +++ b/LibCarla/source/carla/sensor/RawData.h @@ -14,11 +14,6 @@ #include namespace carla { - -namespace ros2 { - class ROS2; -} - namespace sensor { /// Wrapper around the raw data generated by a sensor plus some useful @@ -95,10 +90,6 @@ namespace sensor { template friend class CompositeSerializer; - #if defined(WITH_ROS2) - friend class carla::ros2::ROS2; - #endif - RawData(Buffer DESERIALIZE_DECL_DATA(buffer)) : _buffer(DESERIALIZE_MOVE_DATA(buffer)) {} #if defined(CARLA_SERVER_BUILD) diff --git a/LibCarla/source/carla/sensor/data/ImageTmpl.h b/LibCarla/source/carla/sensor/data/ImageTmpl.h index bce0fb00da2..fc6a41fd554 100644 --- a/LibCarla/source/carla/sensor/data/ImageTmpl.h +++ b/LibCarla/source/carla/sensor/data/ImageTmpl.h @@ -14,10 +14,6 @@ #include "carla/sensor/s11n/GBufferFloatSerializer.h" #include "carla/sensor/s11n/NormalsImageSerializer.h" -#if defined(WITH_ROS2) -#include "carla/ros2/ROS2.h" -#endif - namespace carla { namespace sensor { namespace data { @@ -26,10 +22,6 @@ namespace data { template class ImageTmpl : public Array { using Super = Array; - #if defined(WITH_ROS2) - friend class carla::ros2::ROS2; - #endif - protected: using Serializer = s11n::ImageSerializer; diff --git a/LibCarla/source/carla/sensor/data/LidarData.h b/LibCarla/source/carla/sensor/data/LidarData.h index 749925edf9c..34e9be7c693 100644 --- a/LibCarla/source/carla/sensor/data/LidarData.h +++ b/LibCarla/source/carla/sensor/data/LidarData.h @@ -14,10 +14,6 @@ namespace carla { -namespace ros2 { - class ROS2; -} - namespace sensor { namespace s11n { @@ -112,7 +108,6 @@ namespace data { friend class s11n::LidarSerializer; friend class s11n::LidarHeaderView; - friend class carla::ros2::ROS2; }; } // namespace s11n diff --git a/LibCarla/source/carla/sensor/data/RadarData.h b/LibCarla/source/carla/sensor/data/RadarData.h index c464530aeb6..63d263193f1 100644 --- a/LibCarla/source/carla/sensor/data/RadarData.h +++ b/LibCarla/source/carla/sensor/data/RadarData.h @@ -12,10 +12,6 @@ namespace carla { -namespace ros2 { - class ROS2; -} - namespace sensor { namespace s11n { @@ -74,7 +70,6 @@ namespace data { std::vector _detections; friend class s11n::RadarSerializer; - friend class carla::ros2::ROS2; }; } // namespace s11n diff --git a/LibCarla/source/carla/sensor/data/SemanticLidarData.h b/LibCarla/source/carla/sensor/data/SemanticLidarData.h index 8fa2204bd9d..00948ca23c8 100644 --- a/LibCarla/source/carla/sensor/data/SemanticLidarData.h +++ b/LibCarla/source/carla/sensor/data/SemanticLidarData.h @@ -14,10 +14,6 @@ namespace carla { -namespace ros2 { - class ROS2; -} - namespace sensor { namespace s11n { @@ -144,7 +140,6 @@ namespace data { friend class s11n::SemanticLidarHeaderView; friend class s11n::SemanticLidarSerializer; - friend class carla::ros2::ROS2; }; diff --git a/LibCarla/source/carla/sensor/data/SerializerVectorAllocator.h b/LibCarla/source/carla/sensor/data/SerializerVectorAllocator.h new file mode 100644 index 00000000000..c4b88447623 --- /dev/null +++ b/LibCarla/source/carla/sensor/data/SerializerVectorAllocator.h @@ -0,0 +1,160 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma +// de Barcelona (UAB). +// +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/Exception.h" +#include "carla/Logging.h" +#include "carla/BufferView.h" + +namespace carla { +namespace sensor { +namespace data { + + /** + * @brief Allocator to allow copyless conversion from an Image Serializer into a std::vector that uses the existing buffer data + * The prevents from calling memcpy() or similar. + */ + template + class SerializerVectorAllocator: public std::allocator + { + public: + using std::allocator::allocator; + using pointer = typename std::allocator_traits>::pointer; + using size_type = typename std::allocator_traits>::size_type; + using const_pointer = typename std::allocator_traits>::const_pointer; + + pointer allocate(size_type n, const void *hint=0) + { + (void)hint; + if (_is_allocated) { + carla::throw_exception(std::range_error("SerializerVectorAllocator:: memory already allocated")); + } + size_type const overall_size = sizeof(T)*n; + if ( overall_size == _buffer->size() - _header_offset ) { + return reinterpret_cast(const_cast(_buffer->data() + _header_offset)); + } + else { + carla::throw_exception(std::range_error("SerializerVectorAllocator::allocate buffer size is " + std::to_string(_buffer->size()) + + " header offset is " + std::to_string(_header_offset) + + " but requested overall size is " + std::to_string(overall_size))); + } + + return nullptr; + } + + void deallocate(pointer p, size_type n) + { + (void)p; + size_type const overall_size = sizeof(T)*n; + if ( overall_size == _buffer->size() - _header_offset ) { + _is_allocated = false; + } + else { + carla::throw_exception(std::range_error("SerializerVectorAllocator::deallocate buffer size is " + std::to_string(_buffer->size()) + + " header offset is " + std::to_string(_header_offset) + + " but requested overall size is " + std::to_string(overall_size))); + } + } + + /** + * nothing is initialized because it would overwrite the buffer data + */ + template void construct(U*, Args&&...) { + } + + SerializerVectorAllocator(const carla::SharedBufferView buffer, size_type header_offset) : + std::allocator(), + _buffer(buffer), + _header_offset(header_offset) { + log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(), "] created"); + } + + SerializerVectorAllocator(SerializerVectorAllocator &&other) : + std::allocator(), + _buffer(std::move(other._buffer)), + _header_offset(std::exchange(other._header_offset, 0u)), + _is_allocated(std::exchange(other._is_allocated, false)) { + log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] created by move from [", &other, "]"); + } + + SerializerVectorAllocator(const SerializerVectorAllocator &other) : + std::allocator(), + _buffer(other._buffer), + _header_offset(other._header_offset), + _is_allocated(other._is_allocated) { + log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] created by copy from [", &other, "]"); + } + + ~SerializerVectorAllocator() { + log_debug("~SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] destroyed"); + } + + SerializerVectorAllocator& operator=(SerializerVectorAllocator &&other) { + log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] move assigned from [", &other, "]"); + _buffer = std::move(other._buffer); + _header_offset = std::exchange(other._header_offset, 0u); + _is_allocated = std::exchange(other._is_allocated, false); + return *this; + } + + SerializerVectorAllocator& operator=(const SerializerVectorAllocator &other) { + log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] assigned from [", &other, "]"); + _buffer = other._buffer; + _header_offset = other._header_offset; + return *this; + } + + private: + carla::SharedBufferView _buffer; + size_type _header_offset {0u}; + bool _is_allocated{false}; + }; + + /** + * @brief calculates the number of elements of the buffer view by reducing the buffer size by the provided header_offset and division by sizeof(T) + */ + template + std::size_t number_of_elements(const carla::SharedBufferView buffer, size_t header_offset) { + return (buffer->size() - header_offset) / sizeof(T); + } + + /** + * @brief create a vector with custom allocator providing the buffer memory + * + * This provides std::vector access to the buffer data while leaving out the header_offset. + * The vector size is deduced from number_of_elements(). + * This is a copyless operation, but the vector data cannot be assigned/moved to a std::vector with standard allocator without copy. + */ + template + std::vector> buffer_data_accessed_by_vector(const carla::SharedBufferView buffer_view, size_t header_offset) { + auto number_of_elements = carla::sensor::data::number_of_elements(buffer_view, header_offset); + std::vector> vector_data( + number_of_elements, + carla::sensor::data::SerializerVectorAllocator(buffer_view, header_offset)); + return vector_data; + } + + + /** + * @brief create a vector with default allocator and copy the data from buffer memory + * + * This provides std::vector copy of the buffer data while leaving out the carla::sensor::s11n::ImageSerializer::header_offset. + * The vector size is deduced from number_of_elements(). + * This is a operation performing copy operation, but the vector data cannot be assigned/moved to a std::vector with standard allocator without copy. + */ + template + std::vector buffer_data_copy_to_std_vector(const carla::SharedBufferView buffer_view, size_t header_offset) { + auto buffer_data = buffer_data_accessed_by_vector(buffer_view, header_offset); + std::vector vector_data(buffer_data.begin(), buffer_data.end()); + return vector_data; + } + +} // namespace data +} // namespace sensor +} // namespace carla diff --git a/LibCarla/source/carla/sensor/s11n/LidarSerializer.h b/LibCarla/source/carla/sensor/s11n/LidarSerializer.h index 87321961e74..19ed5bba3d2 100644 --- a/LibCarla/source/carla/sensor/s11n/LidarSerializer.h +++ b/LibCarla/source/carla/sensor/s11n/LidarSerializer.h @@ -12,6 +12,12 @@ #include "carla/sensor/data/LidarData.h" namespace carla { + +namespace ros2 { + template + class UePublisherBasePointCloud; +} // namespace ros2 + namespace sensor { class SensorData; @@ -54,6 +60,7 @@ namespace s11n { private: friend class LidarSerializer; + friend class carla::ros2::UePublisherBasePointCloud; explicit LidarHeaderView(const uint32_t *begin) : _begin(begin) { DEBUG_ASSERT(_begin != nullptr); diff --git a/LibCarla/source/carla/sensor/s11n/SemanticLidarSerializer.h b/LibCarla/source/carla/sensor/s11n/SemanticLidarSerializer.h index f31a46d4f20..6da058504ae 100644 --- a/LibCarla/source/carla/sensor/s11n/SemanticLidarSerializer.h +++ b/LibCarla/source/carla/sensor/s11n/SemanticLidarSerializer.h @@ -12,6 +12,12 @@ #include "carla/sensor/data/SemanticLidarData.h" namespace carla { + +namespace ros2 { + template + class UePublisherBasePointCloud; +} // namespace ros2 + namespace sensor { class SensorData; @@ -55,6 +61,7 @@ namespace s11n { protected: friend class SemanticLidarSerializer; + friend class carla::ros2::UePublisherBasePointCloud; explicit SemanticLidarHeaderView(const uint32_t *begin) : _begin(begin) { DEBUG_ASSERT(_begin != nullptr); diff --git a/LibCarla/source/carla/streaming/Server.h b/LibCarla/source/carla/streaming/Server.h index f3a17cd221e..5b02e181c4f 100644 --- a/LibCarla/source/carla/streaming/Server.h +++ b/LibCarla/source/carla/streaming/Server.h @@ -75,8 +75,8 @@ namespace streaming { return _server.GetToken(sensor_id); } - void SetROS2TopicVisibilityDefaultEnabled(bool _topic_visibility_default_enabled) { - _server.SetROS2TopicVisibilityDefaultEnabled(_topic_visibility_default_enabled); + void SetROS2TopicVisibilityDefaultEnabled(bool topic_visibility_default_enabled) { + _server.SetROS2TopicVisibilityDefaultEnabled(topic_visibility_default_enabled); } void EnableForROS(detail::stream_actor_id_type stream_actor_id) { diff --git a/LibCarla/source/carla/streaming/detail/Message.h b/LibCarla/source/carla/streaming/detail/Message.h index 245cca7f9a5..bbcfd87c54c 100644 --- a/LibCarla/source/carla/streaming/detail/Message.h +++ b/LibCarla/source/carla/streaming/detail/Message.h @@ -20,6 +20,7 @@ #include #include #include +#include namespace carla { namespace streaming { @@ -59,6 +60,11 @@ namespace detail { : MessageTmpl(sizeof...(Buffers) + 1u, buf, buffers...) { static_assert(sizeof...(Buffers) < max_size(), "Too many buffers!"); _buffer_views[0u] = boost::asio::buffer(&_total_size, sizeof(_total_size)); + log_debug("MessageTmpl[", this, "] Created message with ", _number_of_buffers, " buffers and total size ", _total_size, " bytes. ", GetBufferDetailsAsString()); + } + + ~MessageTmpl(){ + log_debug("MessageTmpl[", this, "] Destroyed.", GetBufferDetailsAsString()); } /// Size in bytes of the message excluding the header. @@ -79,6 +85,14 @@ namespace detail { auto begin = _buffers.begin(); return MakeListView(begin, begin + _number_of_buffers); } + + auto GetBufferDetailsAsString() const { + std::stringstream result; + for (size_t i = 0; i < _number_of_buffers; ++i) { + result << " Buffer[" << i << "|" << static_cast(_buffers[i]->data()) << "]: size=" << _buffers[i]->size() << " bytes | use_count= " << _buffers[i].use_count(); + } + return result.str(); + } private: message_size_type _number_of_buffers = 0u; diff --git a/LibCarla/source/carla/streaming/detail/MultiStreamState.h b/LibCarla/source/carla/streaming/detail/MultiStreamState.h index 928b041367c..1ac559d7835 100644 --- a/LibCarla/source/carla/streaming/detail/MultiStreamState.h +++ b/LibCarla/source/carla/streaming/detail/MultiStreamState.h @@ -36,7 +36,7 @@ namespace detail { if (session != nullptr) { auto message = Session::MakeMessage(buffers...); session->WriteMessage(std::move(message)); - log_debug("sensor ", session->get_stream_id(), " data sent"); + log_debug("MultiStreamState::Write>> sensor ", session->get_stream_id(), " data sent to single session"); // Return here, _session is only valid if we have a // single session. return; @@ -49,9 +49,10 @@ namespace detail { for (auto &s : _sessions) { if (s != nullptr) { s->WriteMessage(message); - log_debug("sensor ", s->get_stream_id(), " data sent "); + log_debug("MultiStreamState::Write>> sensor ", s->get_stream_id(), " data sent to session ", message->GetBufferDetailsAsString()); } } + log_debug("MultiStreamState::Write>> Write finished for multiple sessions"); } } diff --git a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp index a4545690ee7..a3533c4f993 100644 --- a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp +++ b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp @@ -103,12 +103,12 @@ namespace tcp { log_info("session", _session_id, ": error sending data :", ec.message()); CloseNow(ec); } else { - DEBUG_ONLY(log_debug("session", _session_id, ": successfully sent", bytes, "bytes")); + DEBUG_ONLY(log_debug("session", _session_id, ": successfully sent", bytes, "bytes ", message->GetBufferDetailsAsString())); DEBUG_ASSERT_EQ(bytes, sizeof(message_size_type) + message->size()); } }; - log_debug("session", _session_id, ": sending message of", message->size(), "bytes"); + log_debug("session", _session_id, ": sending message of", message->size(), "bytes ", message->GetBufferDetailsAsString()); _deadline.expires_from_now(_timeout); boost::asio::async_write(_socket, message->GetBufferSequence(), diff --git a/LibCarla/source/carla/streaming/low_level/Server.h b/LibCarla/source/carla/streaming/low_level/Server.h index 3d7948c0a94..9b294b048fe 100644 --- a/LibCarla/source/carla/streaming/low_level/Server.h +++ b/LibCarla/source/carla/streaming/low_level/Server.h @@ -81,8 +81,8 @@ namespace low_level { return _dispatcher->GetToken(stream_id); } - void SetROS2TopicVisibilityDefaultEnabled(bool _topic_visibility_default_enabled) { - _dispatcher->SetROS2TopicVisibilityDefaultEnabled(_topic_visibility_default_enabled); + void SetROS2TopicVisibilityDefaultEnabled(bool topic_visibility_default_enabled) { + _dispatcher->SetROS2TopicVisibilityDefaultEnabled(topic_visibility_default_enabled); } void EnableForROS(detail::stream_actor_id_type stream_actor_id) { diff --git a/PythonAPI/carla/setup.py b/PythonAPI/carla/setup.py index 7c6c802082a..d5caf74372c 100755 --- a/PythonAPI/carla/setup.py +++ b/PythonAPI/carla/setup.py @@ -56,7 +56,7 @@ def walk(folder, file_filter='*'): os.path.join(pwd, 'dependencies/lib/libxerces-c.a')] extra_link_args += ['-lz'] extra_compile_args = [ - '-isystem', os.path.join(pwd, 'dependencies/include/system'), '-fPIC', '-std=c++14', + '-isystem', os.path.join(pwd, 'dependencies/include/system'), '-fPIC', '-std=c++17', '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wno-self-assign-overloaded', '-Wdeprecated', '-Wno-shadow', '-Wuninitialized', '-Wunreachable-code', '-Wpessimizing-move', '-Wold-style-cast', '-Wnull-dereference', diff --git a/Unreal/CarlaUE4/Config/DefaultGame.ini b/Unreal/CarlaUE4/Config/DefaultGame.ini index 228cab74957..635adea085a 100644 --- a/Unreal/CarlaUE4/Config/DefaultGame.ini +++ b/Unreal/CarlaUE4/Config/DefaultGame.ini @@ -17,6 +17,8 @@ LowRoadPieceMeshMaxDrawDistance=15000.000000 +EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/WetPavement/WetPavement_Complex_Concrete.WetPavement_Complex_Concrete"',MaterialSlotName="TileRoad_Curb",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000)) +EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/Ground/SideWalks/SidewalkN4/WetPavement_SidewalkN4.WetPavement_SidewalkN4"',MaterialSlotName="Tileroad_Sidewalk",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000)) +EpicRoadMaterials=(MaterialInterface=MaterialInstanceConstant'"/Game/Carla/Static/GenericMaterials/LaneMarking/Lanemarking.Lanemarking"',MaterialSlotName="TileRoad_LaneMarkingSolid",ImportedMaterialSlotName="",UVChannelData=(bInitialized=False,bOverrideDensities=False,LocalUVDensities[0]=0.000000,LocalUVDensities[1]=0.000000,LocalUVDensities[2]=0.000000,LocalUVDensities[3]=0.000000)) +ROS2=True +ROS2TopicVisibility=True [/Script/UnrealEd.ProjectPackagingSettings] Build=IfProjectHasCode diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp index 2cc4821ea01..6bdd201e782 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp @@ -8,17 +8,45 @@ #include "Carla/Actor/ActorDispatcher.h" #include "Carla/Actor/ActorBlueprintFunctionLibrary.h" -#include "Carla/Actor/ActorROS2Handler.h" #include "Carla/Actor/CarlaActorFactory.h" +#include "Carla/Util/BoundingBoxCalculator.h" #include "Carla/Game/Tagger.h" #include "Carla/Vehicle/VehicleControl.h" #include "GameFramework/Controller.h" -#include -#include "carla/ros2/ROS2.h" -#include +#if defined(WITH_ROS2) +# include +# include "carla/ros2/ROS2.h" +# include "carla/ros2/types/PublisherSensorType.h" +# include "carla/ros2/types/SensorActorDefinition.h" +# include "carla/ros2/types/VehicleActorDefinition.h" +# include "carla/ros2/types/WalkerActorDefinition.h" +# include "carla/ros2/types/TrafficSignActorDefinition.h" +# include "carla/ros2/types/TrafficLightActorDefinition.h" +# include + +# include "Carla/Sensor/CollisionSensor.h" +# include "Carla/Sensor/CustomV2XSensor.h" +# include "Carla/Sensor/DepthCamera.h" +# include "Carla/Sensor/NormalsCamera.h" +# include "Carla/Sensor/DVSCamera.h" +# include "Carla/Sensor/GnssSensor.h" +# include "Carla/Sensor/HSSLidar.h" +# include "Carla/Sensor/InertialMeasurementUnit.h" +# include "Carla/Sensor/LaneInvasionSensor.h" +# include "Carla/Sensor/ObstacleDetectionSensor.h" +# include "Carla/Sensor/OpticalFlowCamera.h" +# include "Carla/Sensor/Radar.h" +# include "Carla/Sensor/RayCastLidar.h" +# include "Carla/Sensor/RayCastSemanticLidar.h" +# include "Carla/Sensor/RssSensor.h" +# include "Carla/Sensor/SceneCaptureCamera.h" +# include "Carla/Sensor/SemanticSegmentationCamera.h" +# include "Carla/Sensor/InstanceSegmentationCamera.h" +# include "Carla/Sensor/V2XSensor.h" +#endif void UActorDispatcher::Bind(FActorDefinition Definition, SpawnFunctionType Functor) { @@ -172,6 +200,159 @@ bool UActorDispatcher::DestroyActor(FCarlaActor::IdType ActorId) return true; } +#if defined(WITH_ROS2) +carla::ros2::types::PublisherSensorType GetPublisherSensorType(ASensor * Sensor) { + // map the Ue4 sensors to their ESensor type and stream_id + carla::ros2::types::PublisherSensorType SensorType = carla::ros2::types::PublisherSensorType::Unknown; + if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::CollisionSensor; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::DepthCamera; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::NormalsCamera; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::DVSCamera; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::GnssSensor; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::InertialMeasurementUnit; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::LaneInvasionSensor; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::ObstacleDetectionSensor; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::OpticalFlowCamera; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::Radar; + // BE CAREFUL: FIRST CHECK ARayCastLidar and AHSSLidar, because that's derived from RayCastSemanticLidar!! + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::RayCastLidar; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::HSSLidar; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::RayCastSemanticLidar; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::RssSensor; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::SceneCaptureCamera; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::SemanticSegmentationCamera; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::InstanceSegmentationCamera; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::CameraGBufferUint8; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::CameraGBufferFloat; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::V2XCustom; + } else if ( dynamic_cast(Sensor) ) { + SensorType = carla::ros2::types::PublisherSensorType::V2X; + } else { + // not derived from ASensor, is initialized in each case separately + //carla::ros2::types::PublisherSensorType::WorldObserver + + carla::log_error("Getcarla::ros2::types::PublisherSensorType : invalid sensor type"); + } + return SensorType; +} + +void RegisterActorROS2(std::shared_ptr ROS2, FCarlaActor* CarlaActor, carla::ros2::types::ActorNameDefinition ActorNameDefinition) { + auto *Sensor = Cast(CarlaActor->GetActor()); + auto *Vehicle = Cast(CarlaActor->GetActor()); + auto *Walker = Cast(CarlaActor->GetActor()); + auto *TrafficLight = Cast(CarlaActor->GetActor()); + auto *TrafficSign = Cast(CarlaActor->GetActor()); + if ( Sensor != nullptr ) { + auto SensorActorDefinition = std::make_shared( + ActorNameDefinition, + GetPublisherSensorType(Sensor), + carla::streaming::detail::token_type(Sensor->GetToken()).get_stream_id()); + auto *V2XCustomSensor = Cast(CarlaActor->GetActor()); + auto *SceneCaptureCamera = Cast(CarlaActor->GetActor()); + if (V2XCustomSensor != nullptr) { + carla::ros2::types::V2XCustomSendCallback V2XCustomSendCallback = [V2XCustomSensor](carla::rpc::CustomV2XBytes const &Data) -> void { + V2XCustomSensor->Send(Data); + }; + ROS2->AddV2XCustomSensorUe(SensorActorDefinition, V2XCustomSendCallback); + } + else if (SceneCaptureCamera != nullptr) { + // scene capture cameras are allowed to be moved by external user + carla::ros2::types::ActorSetTransformCallback ActorSetTransformCallback = [Sensor](carla::ros2::types::Transform const &Transform) -> void { + Sensor->SetActorTransform(Transform.GetTransform()); + }; + ROS2->AddSensorUe(SensorActorDefinition, ActorSetTransformCallback); + } + else { + ROS2->AddSensorUe(SensorActorDefinition); + } + } + else if (Vehicle != nullptr ) { + FVehiclePhysicsControl PhysicsControl; + CarlaActor->GetPhysicsControl(PhysicsControl); + + auto VehicleActorDefinition = std::make_shared( + carla::ros2::types::ActorDefinition(ActorNameDefinition, + CarlaActor->GetActorInfo()->BoundingBox, + carla::ros2::types::Polygon()), + PhysicsControl); + auto SkeletalMeshComponent = Vehicle->GetMesh(); + if (SkeletalMeshComponent != nullptr) { + VehicleActorDefinition->vertex_polygon.SetGlobalVertices(UBoundingBoxCalculator::GetSkeletalMeshVertices(SkeletalMeshComponent->SkeletalMesh)); + } + + carla::ros2::types::VehicleControlCallback VehicleControlCallback = [Vehicle](carla::ros2::types::VehicleControl const &Source) -> void { + EVehicleInputPriority InputPriority = EVehicleInputPriority(Source.ControlPriority()); + if ( InputPriority <= EVehicleInputPriority::User) { + // priority at least on User level, but allow multiple input prios to allow e.g. manual overrides + InputPriority = EVehicleInputPriority::User; + } + Vehicle->ApplyVehicleControl(Source.GetVehicleControl(), InputPriority); + }; + + carla::ros2::types::VehicleAckermannControlCallback VehicleAckermannControlCallback = [Vehicle](carla::ros2::types::VehicleAckermannControl const &Source) -> void { + Vehicle->ApplyVehicleAckermannControl(Source.GetVehicleAckermannControl(), EVehicleInputPriority::User); + }; + carla::ros2::types::ActorSetTransformCallback VehicleSetTransformCallback = [Vehicle](carla::ros2::types::Transform const &Transform) -> void { + Vehicle->SetActorTransform(Transform.GetTransform()); + }; + + ROS2->AddVehicleUe(VehicleActorDefinition, VehicleControlCallback, VehicleAckermannControlCallback, VehicleSetTransformCallback); + } + else if ( Walker != nullptr ) { + auto WalkerActorDefinition = std::make_shared( + carla::ros2::types::ActorDefinition(ActorNameDefinition, + CarlaActor->GetActorInfo()->BoundingBox, + carla::ros2::types::Polygon())); + auto SkeletalMeshComponent = Walker->GetMesh(); + if (SkeletalMeshComponent != nullptr) { + WalkerActorDefinition->vertex_polygon.SetGlobalVertices(UBoundingBoxCalculator::GetSkeletalMeshVertices(SkeletalMeshComponent->SkeletalMesh)); + } + + auto WalkerController = Cast(Walker->GetController()); + carla::ros2::types::WalkerControlCallback walker_control_callback = [WalkerController](carla::ros2::types::WalkerControl const &Source) -> void { + WalkerController->ApplyWalkerControl(Source.GetWalkerControl()); + }; + + ROS2->AddWalkerUe(WalkerActorDefinition, walker_control_callback); + } + else if ( TrafficLight != nullptr ) { + auto TrafficLightActorDefinition = std::make_shared( + carla::ros2::types::ActorDefinition(ActorNameDefinition, + CarlaActor->GetActorInfo()->BoundingBox, + carla::ros2::types::Polygon())); + ROS2->AddTrafficLightUe(TrafficLightActorDefinition); + } + else if ( TrafficSign != nullptr ) { + auto TrafficSignActorDefinition = std::make_shared( + carla::ros2::types::ActorDefinition(ActorNameDefinition, + CarlaActor->GetActorInfo()->BoundingBox, + carla::ros2::types::Polygon()) + ); + ROS2->AddTrafficSignUe(TrafficSignActorDefinition); + } +} +#endif + FCarlaActor* UActorDispatcher::RegisterActor( AActor &Actor, FActorDescription Description, FActorRegistry::IdType DesiredId) @@ -186,40 +367,23 @@ FCarlaActor* UActorDispatcher::RegisterActor( auto ROS2 = carla::ros2::ROS2::GetInstance(); if (ROS2->IsEnabled()) { - std::string RosName = std::string(TCHAR_TO_UTF8(*Description.GetAttribute("ros_name").Value)); - // If not specified by the user, set the ActorId as the actor name - if (RosName.empty()) - { - RosName = "actor" + std::to_string(View->GetActorId()); + bool EnabledForRos = false; + if ( (Description.GetAttribute("enabled_for_ros").Value.Equals(TEXT(""))) && (ROS2->VisibilityDefaultMode() == carla::ros2::ROS2::TopicVisibilityDefaultMode::eOn )) { + EnabledForRos = true; } - - std::string FrameId = std::string(TCHAR_TO_UTF8(*Description.GetAttribute("ros_frame_id").Value)); - // If not specified by the user, set the actor name as the frame id - if (FrameId.empty()) - { - FrameId = RosName; + else { + EnabledForRos = Description.GetAttribute("enabled_for_ros").Value.ToBool(); } - bool PublishTF = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToBool( - "ros_publish_tf", - Description.Variations, - true); - - auto *Sensor = Cast(View->GetActor()); - auto *Vehicle = Cast(View->GetActor()); - if (Sensor != nullptr) - { - ROS2->RegisterSensor(static_cast(&Actor), RosName, FrameId, PublishTF); - } - else if (Vehicle != nullptr && Description.GetAttribute("role_name").Value == "hero") - { - ROS2->RegisterVehicle(static_cast(&Actor), RosName, RosName, [RosName](void *Actor, carla::ros2::ROS2CallbackData Data) -> void - { - AActor *UEActor = reinterpret_cast(Actor); - ActorROS2Handler Handler(UEActor, RosName); - boost::variant2::visit(Handler, Data); - }); - } + carla::ros2::types::ActorNameDefinition ActorNameDefinition( + View->GetActorId(), + std::string(TCHAR_TO_UTF8(*View->GetActorInfo()->Description.Id)), + std::string(TCHAR_TO_UTF8(*Description.GetAttribute("ros_name").Value)), + std::string(TCHAR_TO_UTF8(*Description.GetAttribute("role_name").Value)), + std::string(TCHAR_TO_UTF8(*Description.GetAttribute("object_type").Value)), + std::string(TCHAR_TO_UTF8(*Description.GetAttribute("base_type").Value)), + EnabledForRos); + RegisterActorROS2(ROS2, View, ActorNameDefinition); } #endif } @@ -241,27 +405,20 @@ void UActorDispatcher::OnActorDestroyed(AActor *Actor) FCarlaActor* CarlaActor = Registry.FindCarlaActor(Actor); if (CarlaActor) { + auto const ActorId = CarlaActor->GetActorId(); + #if defined(WITH_ROS2) auto ROS2 = carla::ros2::ROS2::GetInstance(); if (ROS2->IsEnabled()) { - auto Description = CarlaActor->GetActorInfo()->Description; - - auto *Sensor = Cast(Actor); - auto *Vehicle = Cast(Actor); - if (Sensor != nullptr) - { - ROS2->UnregisterSensor(static_cast(Actor)); - } - else if (Vehicle != nullptr && Description.GetAttribute("role_name").Value == "hero") { - ROS2->UnregisterVehicle(static_cast(Actor)); - } + ROS2->RemoveActor(ActorId); } #endif if (CarlaActor->IsActive()) { - Registry.Deregister(CarlaActor->GetActorId()); + Registry.Deregister(ActorId); } } + } diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.cpp deleted file mode 100644 index 9e51503dafb..00000000000 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma -// de Barcelona (UAB). -// -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "ActorROS2Handler.h" - -#include "Carla/Vehicle/CarlaWheeledVehicle.h" -#include "Carla/Vehicle/VehicleControl.h" -#include "Carla/Vehicle/VehicleAckermannControl.h" - -void ActorROS2Handler::operator()(carla::ros2::VehicleControl &Source) -{ - if (!_Actor) return; - - ACarlaWheeledVehicle *Vehicle = Cast(_Actor); - if (!Vehicle) return; - - // setup control values - FVehicleControl NewControl; - NewControl.Throttle = Source.throttle; - NewControl.Steer = Source.steer; - NewControl.Brake = Source.brake; - NewControl.bHandBrake = Source.hand_brake; - NewControl.bReverse = Source.reverse; - NewControl.bManualGearShift = Source.manual_gear_shift; - NewControl.Gear = Source.gear; - - Vehicle->ApplyVehicleControl(NewControl, EVehicleInputPriority::User); -} - -void ActorROS2Handler::operator()(carla::ros2::AckermannControl &Source) -{ - if (!_Actor) return; - - ACarlaWheeledVehicle *Vehicle = Cast(_Actor); - if (!Vehicle) return; - - // setup control values - FVehicleAckermannControl NewControl; - NewControl.Steer = Source.steer; - NewControl.SteerSpeed = Source.steer_speed; - NewControl.Speed = Source.speed; - NewControl.Acceleration = Source.acceleration; - NewControl.Jerk = Source.jerk; - - Vehicle->ApplyVehicleAckermannControl(NewControl, EVehicleInputPriority::User); -} diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.h deleted file mode 100644 index dafe5876fcc..00000000000 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorROS2Handler.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma -// de Barcelona (UAB). -// -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include -#include "carla/ros2/ROS2.h" -#include - -/// visitor class -class ActorROS2Handler -{ - public: - ActorROS2Handler() = delete; - ActorROS2Handler(AActor *Actor, std::string RosName) : _Actor(Actor), _RosName(RosName) {}; - - void operator()(carla::ros2::VehicleControl &Source); - void operator()(carla::ros2::AckermannControl &Source); - - private: - AActor *_Actor {nullptr}; - std::string _RosName; -}; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs index 3fc6b7fa333..5a91270d08d 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs @@ -199,10 +199,18 @@ private void AddCarlaServerDependency(ReadOnlyTargetRules Target) if (UseDebugLibs(Target)) { PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server_debug"))); + if (UsingRos2) + { + PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_fastdds_debug"))); + } } else { PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server"))); + if (UsingRos2) + { + PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_fastdds"))); + } } if (UsingChrono) { @@ -230,10 +238,18 @@ private void AddCarlaServerDependency(ReadOnlyTargetRules Target) if (UseDebugLibs(Target)) { PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server_debug"))); + if (UsingRos2) + { + PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_fastdds_debug"))); + } } else { PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server"))); + if (UsingRos2) + { + PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_fastdds"))); + } } if (UsingChrono) { @@ -318,11 +334,8 @@ private void AddCarlaServerDependency(ReadOnlyTargetRules Target) PublicAdditionalLibraries.Add("stdc++"); PublicAdditionalLibraries.Add("/usr/lib/x86_64-linux-gnu/libpython3.9.so"); } - if (UsingRos2) { - PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_fastdds"))); - PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfoonathan_memory-0.7.3.a")); PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfastcdr.a")); PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfastrtps.a")); @@ -345,6 +358,12 @@ private void AddCarlaServerDependency(ReadOnlyTargetRules Target) PublicIncludePaths.Add(LibCarlaIncludePath); PrivateIncludePaths.Add(LibCarlaIncludePath); + if ( UsingRos2 ) + { + PublicIncludePaths.Add(Path.Combine(LibCarlaIncludePath, "carla", "ros2", "ros_types")); + PrivateIncludePaths.Add(Path.Combine(LibCarlaIncludePath, "carla", "ros2", "ros_types")); + } + PublicDefinitions.Add("ASIO_NO_EXCEPTIONS"); PublicDefinitions.Add("BOOST_NO_EXCEPTIONS"); PublicDefinitions.Add("LIBCARLA_NO_EXCEPTIONS"); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp index 738b5372473..f15782c391a 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp @@ -25,7 +25,10 @@ #include #include #include -#include +#if defined(WITH_ROS2) +# include +# include "carla/ros2/types/SensorActorDefinition.h" +#endif #include #include #include @@ -65,8 +68,10 @@ FCarlaEngine::~FCarlaEngine() { #if defined(WITH_ROS2) auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - ROS2->Shutdown(); + if (ROS2->IsEnabled()) { + UE_LOG(LogCarla, Log, TEXT("DISABLE ROS")); + ROS2->Disable(); + } #endif FWorldDelegates::OnWorldTickStart.Remove(OnPreTickHandle); FWorldDelegates::OnWorldPostActorTick.Remove(OnPostTickHandle); @@ -77,7 +82,16 @@ FCarlaEngine::~FCarlaEngine() void FCarlaEngine::NotifyInitGame(const UCarlaSettings &Settings) { TRACE_CPUPROFILER_EVENT_SCOPE_STR(__FUNCTION__); - if (!bIsRunning) + if ( bIsRunning) { + #if defined(WITH_ROS2) + auto ROS2 = carla::ros2::ROS2::GetInstance(); + if (ROS2->IsEnabled()) { + UE_LOG(LogCarla, Log, TEXT("ROS2:: NotifyEndGame")); + ROS2->NotifyEndGame(); + } + #endif + } + else { const auto StreamingPort = Settings.StreamingPort; const auto SecondaryPort = Settings.SecondaryPort; @@ -215,18 +229,28 @@ void FCarlaEngine::NotifyInitGame(const UCarlaSettings &Settings) UE_LOG(LogCarla, Log, TEXT("New secondary connection detected")); }); } + + #if defined(WITH_ROS2) + if (Settings.ROS2) { + // create ROS2 manager + UE_LOG(LogCarla, Log, TEXT("ENABLE ROS: %s"), UTF8_TO_TCHAR(Settings.ROS2TopicVisibility?" Topics visible per default": " Topics invisible")); + auto ROS2 = carla::ros2::ROS2::GetInstance(); + ROS2->Enable(&Server, carla::streaming::detail::token_type(WorldObserver.GetToken()).get_stream_id(), + Settings.ROS2TopicVisibility?carla::ros2::ROS2::TopicVisibilityDefaultMode::eOn:carla::ros2::ROS2::TopicVisibilityDefaultMode::eOff); + Server.SetROS2TopicVisibilityDefaultEnabled(Settings.ROS2TopicVisibility); + } + #endif } - // create ROS2 manager + bMapChanged = true; + #if defined(WITH_ROS2) - if (Settings.ROS2) - { - auto ROS2 = carla::ros2::ROS2::GetInstance(); - ROS2->Enable(true); + auto ROS2 = carla::ros2::ROS2::GetInstance(); + if (ROS2->IsEnabled()) { + UE_LOG(LogCarla, Log, TEXT("ROS2:: NotifyInitGame")); + ROS2->NotifyInitGame(); } #endif - - bMapChanged = true; } void FCarlaEngine::NotifyBeginEpisode(UCarlaEpisode &Episode) @@ -262,29 +286,55 @@ void FCarlaEngine::NotifyBeginEpisode(UCarlaEpisode &Episode) Recorder->GetReplayer()->CheckPlayAfterMapLoaded(); } + #if defined(WITH_ROS2) + auto ROS2 = carla::ros2::ROS2::GetInstance(); + if (ROS2->IsEnabled()) { + UE_LOG(LogCarla, Log, TEXT("ROS2:: NotifyBeginEpisode")); + ROS2->NotifyBeginEpisode(); + } + #endif + Server.NotifyBeginEpisode(Episode); Episode.bIsPrimaryServer = bIsPrimaryServer; + } void FCarlaEngine::NotifyEndEpisode() { + #if defined(WITH_ROS2) + auto ROS2 = carla::ros2::ROS2::GetInstance(); + if (ROS2->IsEnabled()) { + UE_LOG(LogCarla, Log, TEXT("ROS2:: NotifyEndEpisode")); + ROS2->NotifyEndEpisode(); + } + #endif + Server.NotifyEndEpisode(); CurrentEpisode = nullptr; } + void FCarlaEngine::OnPreTick(UWorld *, ELevelTick TickType, float DeltaSeconds) { TRACE_CPUPROFILER_EVENT_SCOPE_STR(__FUNCTION__); if (TickType == ELevelTick::LEVELTICK_All) { - + #if defined(WITH_ROS2) + auto ROS2 = carla::ros2::ROS2::GetInstance(); + #endif if (bIsPrimaryServer) { // process RPC commands do { Server.RunSome(1u); + #if defined(WITH_ROS2) + if (ROS2->IsEnabled()) + { + ROS2->ProcessMessages(); + } + #endif } while (Server.IsSynchronousModeActive() && !Server.TickCueReceived()); @@ -306,6 +356,12 @@ void FCarlaEngine::OnPreTick(UWorld *, ELevelTick TickType, float DeltaSeconds) do { Server.RunSome(1u); + #if defined(WITH_ROS2) + if (ROS2->IsEnabled()) + { + ROS2->ProcessMessages(); + } + #endif } while (!FramesToProcess.size()); } @@ -338,6 +394,13 @@ void FCarlaEngine::OnPostTick(UWorld *World, ELevelTick TickType, float DeltaSec // tick the recorder/replayer system if (GetCurrentEpisode()) { + #if defined(WITH_ROS2) + auto ROS2 = carla::ros2::ROS2::GetInstance(); + if (ROS2->IsEnabled()) + { + ROS2->ProcessDataFromUeSensorPreAction(); + } + #endif if (bIsPrimaryServer) { if (SecondaryServer->HasClientsConnected()) { @@ -377,7 +440,17 @@ void FCarlaEngine::OnPostTick(UWorld *World, ELevelTick TickType, float DeltaSec // send the worldsnapshot WorldObserver.BroadcastTick(*CurrentEpisode, DeltaSeconds, bMapChanged, LightUpdatePending); CurrentEpisode->GetSensorManager().PostPhysTick(World, TickType, DeltaSeconds); + + ResetSimulationState(); + + #if defined(WITH_ROS2) + auto ROS2 = carla::ros2::ROS2::GetInstance(); + if (ROS2->IsEnabled()) + { + ROS2->ProcessDataFromUeSensorPostAction(); + } + #endif } } diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.h index 24638f98956..d201ec3ad21 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -70,22 +69,12 @@ class FCarlaEngine : private NonCopyable static uint64_t UpdateFrameCounter() { FCarlaEngine::FrameCounter += 1; - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - ROS2->SetFrame(FCarlaEngine::FrameCounter); - #endif return FCarlaEngine::FrameCounter; } static void ResetFrameCounter(uint64_t Value = 0) { FCarlaEngine::FrameCounter = Value; - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - ROS2->SetFrame(FCarlaEngine::FrameCounter); - #endif } std::shared_ptr GetSecondaryServer() diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp index 9a2fb0f1555..26a888b5b69 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp @@ -11,6 +11,9 @@ #include #include #include +#if defined(WITH_ROS2) +# include +#endif #include #include "Carla/Sensor/Sensor.h" @@ -311,6 +314,12 @@ void UCarlaEpisode::AttachActors( UActorAttacher::AttachActors(Child, Parent, InAttachmentType, SocketName); + #if defined(WITH_ROS2) + auto ROS2 = carla::ros2::ROS2::GetInstance(); + if (ROS2->IsEnabled()) { + ROS2->AttachActors(FindCarlaActor(Child)->GetActorId(), FindCarlaActor(Parent)->GetActorId()); + } + #endif if (bIsPrimaryServer) { GetFrameData().AddEvent( diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.h index eac80af85f4..ecb4055d5ac 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -362,11 +361,6 @@ class CARLA_API UCarlaEpisode : public UObject { ElapsedGameTime += DeltaSeconds; SetVisualGameTime(VisualGameTime + DeltaSeconds); - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - ROS2->SetTimestamp(GetElapsedGameTime()); - #endif } diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp index 9c04c841ffd..524573c4509 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp @@ -128,24 +128,6 @@ void ACollisionSensor::OnCollisionEvent( } CollisionRegistry.emplace_back(CurrentFrame, Actor, OtherActor); - - // ROS2 -#if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - - // Retrieve the corresponding Carla actor to access its ID for collision processing - FCarlaActor* OtherCarlaActor = CurrentEpisode.FindCarlaActor(OtherActor); - - if (OtherCarlaActor) { - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : GetActorTransform(); - ROS2->ProcessDataFromCollisionSensor(0, Transform, OtherCarlaActor->GetActorId(), carla::geom::Vector3D{NormalImpulse.X, NormalImpulse.Y, NormalImpulse.Z}, this); - } - } -#endif } void ACollisionSensor::OnActorCollisionEvent( diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/DVSCamera.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/DVSCamera.cpp index 42afd61aa40..ea79b74da7d 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/DVSCamera.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/DVSCamera.cpp @@ -15,7 +15,6 @@ #include "Actor/ActorBlueprintFunctionLibrary.h" #include -#include "carla/ros2/ROS2.h" #include #include #include @@ -158,29 +157,21 @@ void ADVSCamera::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTim /** DVS Simulator **/ ADVSCamera::DVSEventArray events = this->Simulation(DeltaTime); - auto Stream = GetDataStream(*this); - auto Buff = Stream.PopBufferFromPool(); - - // serialize data - carla::Buffer BufferReady(carla::sensor::SensorRegistry::Serialize(*this, events, std::move(Buff))); - carla::SharedBufferView BufView = carla::BufferView::CreateFrom(std::move(BufferReady)); - - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : Stream.GetSensorTransform(); - ROS2->ProcessDataFromDVS(Stream.GetSensorType(), Transform, BufView, this); - } - #endif if (events.size() > 0) { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ADVSCamera Stream Send"); - /** Send the events **/ - Stream.Send(*this, BufView); + auto Stream = GetDataStream(*this); + auto Buff = Stream.PopBufferFromPool(); + + // serialize data + carla::Buffer BufferReady(carla::sensor::SensorRegistry::Serialize(*this, events, std::move(Buff))); + carla::SharedBufferView BufView = carla::BufferView::CreateFrom(std::move(BufferReady)); + + if (events.size() > 0) + { + TRACE_CPUPROFILER_EVENT_SCOPE_STR("ADVSCamera Stream Send"); + /** Send the events **/ + Stream.Send(*this, BufView); + } } } diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/GnssSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/GnssSensor.cpp index 61141e04bd7..c52d41e052f 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/GnssSensor.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/GnssSensor.cpp @@ -13,7 +13,6 @@ #include #include "carla/geom/Vector3D.h" -#include "carla/ros2/ROS2.h" #include AGnssSensor::AGnssSensor(const FObjectInitializer &ObjectInitializer) @@ -59,17 +58,6 @@ void AGnssSensor::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSe auto Stream = GetDataStream(*this); - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : GetActorTransform(); - ROS2->ProcessDataFromGNSS(Stream.GetSensorType(), Transform, carla::geom::GeoLocation{Latitude, Longitude, Altitude}, this); - } - #endif { TRACE_CPUPROFILER_EVENT_SCOPE_STR("AGnssSensor Stream Send"); Stream.SerializeAndSend(*this, carla::geom::GeoLocation{Latitude, Longitude, Altitude}); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/HSSLidar.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/HSSLidar.cpp index 136ccfd4b00..1f94857e8b6 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/HSSLidar.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/HSSLidar.cpp @@ -14,7 +14,6 @@ #include #include "carla/geom/Math.h" -#include "carla/ros2/ROS2.h" #include "carla/geom/Location.h" #include @@ -69,19 +68,6 @@ void AHSSLidar::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime TRACE_CPUPROFILER_EVENT_SCOPE_STR("Send Stream"); DataStream.SerializeAndSend(*this, LidarData, DataStream.PopBufferFromPool()); } - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : GetActorTransform(); - ROS2->ProcessDataFromLidar(DataStream.GetSensorType(), Transform, LidarData, this); - } - #endif - - } float AHSSLidar::ComputeIntensity(const FSemanticDetection& RawDetection) const diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp index d6922a92d84..8c0fafba529 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp @@ -13,7 +13,6 @@ #include #include "carla/geom/Math.h" -#include "carla/ros2/ROS2.h" #include #include "Carla/Game/CarlaStatics.h" @@ -192,18 +191,6 @@ void AInertialMeasurementUnit::PostPhysTick(UWorld *World, ELevelTick TickType, auto Stream = GetDataStream(*this); - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : GetActorTransform(); - ROS2->ProcessDataFromIMU(Stream.GetSensorType(), Transform, Accelerometer, Gyroscope, Compass, this); - } - #endif - { TRACE_CPUPROFILER_EVENT_SCOPE(AInertialMeasurementUnit::PostPhysTick); Stream.SerializeAndSend(*this, Accelerometer, Gyroscope, Compass); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp index c74b72bd2cc..54dd5d26ee4 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/ObstacleDetectionSensor.cpp @@ -13,10 +13,6 @@ #include "Carla/Game/CarlaGameInstance.h" #include "Carla/Game/CarlaGameModeBase.h" -#include -#include "carla/ros2/ROS2.h" -#include - AObstacleDetectionSensor::AObstacleDetectionSensor(const FObjectInitializer &ObjectInitializer) : Super(ObjectInitializer) { @@ -142,18 +138,6 @@ void AObstacleDetectionSensor::OnObstacleDetectionEvent( auto DataStream = GetDataStream(*this); - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : GetActorTransform(); - ROS2->ProcessDataFromObstacleDetection(DataStream.GetSensorType(), Transform, Actor, OtherActor, HitDistance/100.0f, this); - } - #endif - DataStream.SerializeAndSend(*this, Episode.SerializeActor(Actor), Episode.SerializeActor(OtherActor), diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/PixelReader.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/PixelReader.h index ac033829643..7d645154a5c 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/PixelReader.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/PixelReader.h @@ -183,22 +183,6 @@ void FPixelReader::SendPixelsInRenderThread(TSensor &Sensor, bool use16BitFormat carla::Buffer BufferReady(std::move(carla::sensor::SensorRegistry::Serialize(Sensor, std::move(Buffer)))); carla::SharedBufferView BufView = carla::BufferView::CreateFrom(std::move(BufferReady)); - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send PixelReader"); - // auto StreamId = carla::streaming::detail::token_type(Sensor.GetToken()).get_stream_id(); - auto Res = std::async(std::launch::async, [&Sensor, ROS2, &Stream, BufView]() - { - AActor* ParentActor = Sensor.GetAttachParentActor(); - auto Transform = (ParentActor) ? Sensor.GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : Stream.GetSensorTransform(); - ROS2->ProcessDataFromCamera(Stream.GetSensorType(), Transform, BufView, &Sensor); - }); - } - #endif - // network SCOPE_CYCLE_COUNTER(STAT_CarlaSensorStreamSend); TRACE_CPUPROFILER_EVENT_SCOPE_STR("Stream Send"); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/Radar.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/Radar.cpp index 3b28a39d3da..b11fa7ad959 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/Radar.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/Radar.cpp @@ -14,7 +14,6 @@ #include #include "carla/geom/Math.h" -#include "carla/ros2/ROS2.h" #include FActorDefinition ARadar::GetSensorDefinition() @@ -79,18 +78,6 @@ void ARadar::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime) auto DataStream = GetDataStream(*this); - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : GetActorTransform(); - ROS2->ProcessDataFromRadar(DataStream.GetSensorType(), Transform, RadarData, this); - } - #endif - { TRACE_CPUPROFILER_EVENT_SCOPE_STR("Send Stream"); DataStream.SerializeAndSend(*this, RadarData, DataStream.PopBufferFromPool()); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastLidar.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastLidar.cpp index db5e2c72810..ee02a11f62c 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastLidar.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastLidar.cpp @@ -13,7 +13,6 @@ #include #include "carla/geom/Math.h" -#include "carla/ros2/ROS2.h" #include "carla/geom/Location.h" #include @@ -67,19 +66,6 @@ void ARayCastLidar::PostPhysTick(UWorld *World, ELevelTick TickType, float Delta TRACE_CPUPROFILER_EVENT_SCOPE_STR("Send Stream"); DataStream.SerializeAndSend(*this, LidarData, DataStream.PopBufferFromPool()); } - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : GetActorTransform(); - ROS2->ProcessDataFromLidar(DataStream.GetSensorType(), Transform, LidarData, this); - } - #endif - - } float ARayCastLidar::ComputeIntensity(const FSemanticDetection& RawDetection) const diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastSemanticLidar.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastSemanticLidar.cpp index e1c58a07b56..40b069dd502 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastSemanticLidar.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/RayCastSemanticLidar.cpp @@ -12,7 +12,6 @@ #include #include "carla/geom/Math.h" -#include "carla/ros2/ROS2.h" #include #include "DrawDebugHelpers.h" @@ -71,22 +70,10 @@ void ARayCastSemanticLidar::PostPhysTick(UWorld *World, ELevelTick TickType, flo SimulateLidar(DeltaTime); auto DataStream = GetDataStream(*this); - auto SensorTransform = DataStream.GetSensorTransform(); { TRACE_CPUPROFILER_EVENT_SCOPE_STR("Send Stream"); DataStream.SerializeAndSend(*this, SemanticLidarData, DataStream.PopBufferFromPool()); } - // ROS2 - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - TRACE_CPUPROFILER_EVENT_SCOPE_STR("ROS2 Send"); - AActor* ParentActor = GetAttachParentActor(); - auto Transform = (ParentActor) ? GetActorTransform().GetRelativeTransform(ParentActor->GetActorTransform()) : GetActorTransform(); - ROS2->ProcessDataFromSemanticLidar(DataStream.GetSensorType(), Transform, SemanticLidarData, this); - } - #endif } void ARayCastSemanticLidar::SimulateLidar(const float DeltaTime) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp index a9bde486a10..7bbd2813a43 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp @@ -3465,26 +3465,6 @@ carla::rpc::Response FCarlaServer::FPimpl::call_spawn_actor_w CarlaActor->SetAttachmentType(InAttachmentType); ParentCarlaActor->AddChildren(CarlaActor->GetActorId()); - #if defined(WITH_ROS2) - auto ROS2 = carla::ros2::ROS2::GetInstance(); - if (ROS2->IsEnabled()) - { - FCarlaActor* CurrentActor = ParentCarlaActor; - while(CurrentActor) - { - for (const auto &Attr : CurrentActor->GetActorInfo()->Description.Variations) - { - if (Attr.Key == "ros_name") - { - const std::string value = std::string(TCHAR_TO_UTF8(*Attr.Value.Value)); - ROS2->RegisterActorParent(static_cast(CarlaActor->GetActor()), static_cast(CurrentActor->GetActor())); - } - } - CurrentActor = Episode->FindCarlaActor(CurrentActor->GetParent()); - } - } - #endif - // Only is possible to attach if the actor has been really spawned and // is not in dormant state if(!ParentCarlaActor->IsDormant()) @@ -3866,9 +3846,8 @@ void FCarlaServer::RunSome(uint32 Milliseconds) Pimpl->Server.SyncRunFor(carla::time_duration::milliseconds(Milliseconds)); } - -void FCarlaServer::SetROS2TopicVisibilityDefaultEnabled(bool _topic_visibility_default_enabled) { - Pimpl->StreamingServer.SetROS2TopicVisibilityDefaultEnabled(_topic_visibility_default_enabled); +void FCarlaServer::SetROS2TopicVisibilityDefaultEnabled(bool topic_visibility_default_enabled) { + Pimpl->StreamingServer.SetROS2TopicVisibilityDefaultEnabled(topic_visibility_default_enabled); } void FCarlaServer::EnableSynchronousMode() { diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h index 9e9d0328443..5a83490a13f 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h @@ -42,7 +42,7 @@ class FCarlaServer: public carla::rpc::RpcServerInterface void RunSome(uint32 Milliseconds); - void SetROS2TopicVisibilityDefaultEnabled(bool _topic_visibility_default_enabled); + void SetROS2TopicVisibilityDefaultEnabled(bool topic_visibility_default_enabled); void EnableSynchronousMode(); void DisableSynchronousMode(); diff --git a/Util/BuildTools/BuildLibCarla.sh b/Util/BuildTools/BuildLibCarla.sh index bec6a9be5e7..a51ea03c2ef 100755 --- a/Util/BuildTools/BuildLibCarla.sh +++ b/Util/BuildTools/BuildLibCarla.sh @@ -112,7 +112,7 @@ if ${REMOVE_INTERMEDIATE} ; then log "Cleaning intermediate files and folders." rm -Rf ${LIBCARLA_BUILD_SERVER_FOLDER}* ${LIBCARLA_BUILD_CLIENT_FOLDER}* - rm -Rf ${LIBCARLA_BUILD_PYTORCH_FOLDER}* ${LIBCARLA_BUILD_PYTORCH_FOLDER}* + rm -Rf ${LIBCARLA_BUILD_PYTORCH_FOLDER}* ${LIBCARLA_BUILD_FASTDDS_FOLDER}* rm -Rf ${LIBCARLA_INSTALL_SERVER_FOLDER} ${LIBCARLA_INSTALL_CLIENT_FOLDER} fi @@ -143,7 +143,7 @@ function build_libcarla { M_INSTALL_FOLDER=${LIBCARLA_INSTALL_SERVER_FOLDER} elif [ $1 == ros2 ] ; then M_TOOLCHAIN=${LIBCPP_TOOLCHAIN_FILE} - M_BUILD_FOLDER=${LIBCARLA_FASTDDS_FOLDER}.$(echo "$2" | tr '[:upper:]' '[:lower:]') + M_BUILD_FOLDER=${LIBCARLA_BUILD_FASTDDS_FOLDER}.$(echo "$2" | tr '[:upper:]' '[:lower:]') M_INSTALL_FOLDER=${LIBCARLA_INSTALL_SERVER_FOLDER} elif [ $1 == ClientRSS ] ; then BUILD_TYPE='Client' diff --git a/Util/BuildTools/BuildUE4Plugins.sh b/Util/BuildTools/BuildUE4Plugins.sh index 76ffadaae2e..2de21500835 100755 --- a/Util/BuildTools/BuildUE4Plugins.sh +++ b/Util/BuildTools/BuildUE4Plugins.sh @@ -86,7 +86,7 @@ if ${BUILD_STREETMAP} ; then git clone -b ${STREETMAP_BRANCH} ${STREETMAP_REPO} ${CARLAUE4_STREETMAP_FOLDER} fi cd ${CARLAUE4_STREETMAP_FOLDER} - git fetch + git fetch || echo "WARNING: checking status of streetmap failed. Ignoring." git checkout ${CURRENT_STREETMAP_COMMIT} fi fi diff --git a/Util/BuildTools/Setup.sh b/Util/BuildTools/Setup.sh index cc4786b6ae2..0bb7ef60e10 100755 --- a/Util/BuildTools/Setup.sh +++ b/Util/BuildTools/Setup.sh @@ -83,7 +83,7 @@ set(CMAKE_C_COMPILER ${CC}) set(CMAKE_CXX_COMPILER ${CXX}) # disable -Werror since the boost 1.72 doesn't compile with ad_rss without warnings (i.e. the geometry headers) -set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -std=c++14 -pthread -fPIC" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -std=c++17 -pthread -fPIC" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wdeprecated -Wshadow -Wuninitialized -Wunreachable-code" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wpessimizing-move -Wold-style-cast -Wnull-dereference" CACHE STRING "" FORCE) @@ -91,7 +91,7 @@ set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wduplicate-enum -Wnon-virtual-dtor -Wh set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wconversion -Wfloat-overflow-conversion" CACHE STRING "" FORCE) # @todo These flags need to be compatible with setup.py compilation. -set(CMAKE_CXX_FLAGS_RELEASE_CLIENT "\${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -std=c++14 -Wno-missing-braces -DBOOST_ERROR_CODE_HEADER_ONLY" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELEASE_CLIENT "\${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -std=c++17 -Wno-missing-braces -DBOOST_ERROR_CODE_HEADER_ONLY" CACHE STRING "" FORCE) EOL # -- LIBCPP_TOOLCHAIN_FILE ----------------------------------------------------- @@ -962,22 +962,24 @@ if ${USE_ROS2} ; then # cp -r ${UE4_ROOT}/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/include/c++/4.8.5/atomic ${FASTDDS_INCLUDE} # cp -r ${UE4_ROOT}/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/lib64/libatomic* ${FASTDDS_LIB} - # we have to tweak the sources a bit to be able to compile with our boost version and without exceptions + # we have to tweak the sources a bit to be able to compile with our boost version if [[ -e ${FAST_DDS_LIB_SOURCE_DIR}/thirdparty/boost/include/boost ]]; then # remove their boost includes, but keep their entry point rm -rf ${FAST_DDS_LIB_SOURCE_DIR}/thirdparty/boost/include/boost - # ensure the find boost compiles without exceptions - sed -i s/"CXX_STANDARD 11"/"CXX_STANDARD 11\n COMPILE_DEFINITIONS \"-DBOOST_NO_EXCEPTIONS\""/ ${FAST_DDS_LIB_SOURCE_DIR}/cmake/modules/FindThirdpartyBoost.cmake - sed -i s/"class ThirdpartyBoostCompileTest"/"#ifdef BOOST_NO_EXCEPTIONS\nnamespace boost {void throw_exception(std::exception const \& e) {}}\n#endif\nclass ThirdpartyBoostCompileTest"/ ${FAST_DDS_LIB_SOURCE_DIR}/thirdparty/boost/test/ThirdpartyBoostCompile_test.cpp fi mkdir -p ${FAST_DDS_LIB_SOURCE_DIR}/build pushd ${FAST_DDS_LIB_SOURCE_DIR}/build >/dev/null - # removed -DASIO_NO_EXCEPTIONS as fastdds makes usage of them. + # removed -DASIO_NO_EXCEPTIONS and -DBOOST_NO_EXCEPTIONS as fastdds makes usage of them. + # ensure to NOT disable ASIO_EXCEPTIONS and BOOST_EXCEPTIONS for DDS build! + # because these exceptions are actively deployed within FastDDS to detect e.g. if socket-addresses are already in use, etc. + # and reacts accordingly + # if we disable expections the exception is forwarded to CARLA server and the program gets finished, which is not desired + # behaviour cmake -G "Ninja" \ -DCMAKE_INSTALL_PREFIX="${FASTDDS_INSTALL_DIR}" \ -DFORCE_CXX="14" \ - -DCMAKE_CXX_FLAGS="-fPIC -std=c++14 -stdlib=libc++ -I${LLVM_INCLUDE} -Wl,-L${LLVM_LIBPATH} -DBOOST_NO_EXCEPTIONS ${UNREAL_HOSTED_CFLAGS}" \ + -DCMAKE_CXX_FLAGS="-fPIC -std=c++14 -stdlib=libc++ -I${LLVM_INCLUDE} -Wl,-L${LLVM_LIBPATH} ${UNREAL_HOSTED_CFLAGS}" \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_TESTING=OFF \ -DCOMPILE_EXAMPLES=OFF \ @@ -1043,8 +1045,6 @@ endif () add_definitions(-DLIBCARLA_TEST_CONTENT_FOLDER="${LIBCARLA_TEST_CONTENT_FOLDER}") set(BOOST_INCLUDE_PATH "${BOOST_INCLUDE}") -set(FASTDDS_INCLUDE_PATH "${FASTDDS_INCLUDE}") -set(FASTDDS_LIB_PATH "${FASTDDS_LIB}") if (CMAKE_BUILD_TYPE STREQUAL "Server") # Here libraries linking libc++. @@ -1055,8 +1055,10 @@ if (CMAKE_BUILD_TYPE STREQUAL "Server") set(GTEST_INCLUDE_PATH "${GTEST_LIBCXX_INCLUDE}") set(GTEST_LIB_PATH "${GTEST_LIBCXX_LIBPATH}") elseif (CMAKE_BUILD_TYPE STREQUAL "ros2") - list(APPEND CMAKE_PREFIX_PATH "${FASTDDS_INSTALL_DIR}") set(RPCLIB_INCLUDE_PATH "${RPCLIB_LIBCXX_INCLUDE}") + set(FASTDDS_INCLUDE_PATH "${FASTDDS_INCLUDE}") + set(FASTDDS_LIB_PATH "${FASTDDS_LIB}") + set(FASTDDS_LIBRARIES "fastrtps fastcdr") elseif (CMAKE_BUILD_TYPE STREQUAL "Pytorch") list(APPEND CMAKE_PREFIX_PATH "${LIBTORCH_PATH}") list(APPEND CMAKE_PREFIX_PATH "${LIBTORCHSCATTER_INSTALL_DIR}") diff --git a/Util/BuildTools/Vars.mk b/Util/BuildTools/Vars.mk index 3cfd5512578..1bc279b6c05 100644 --- a/Util/BuildTools/Vars.mk +++ b/Util/BuildTools/Vars.mk @@ -16,7 +16,7 @@ CARLA_PYTHONAPI_SOURCE_FOLDER=${CARLA_PYTHONAPI_ROOT_FOLDER}/carla LIBCARLA_ROOT_FOLDER=${CURDIR}/LibCarla LIBCARLA_BUILD_SERVER_FOLDER=${CARLA_BUILD_FOLDER}/libcarla-server-build LIBCARLA_BUILD_PYTORCH_FOLDER=${CARLA_BUILD_FOLDER}/libcarla-pytorch-build -LIBCARLA_FASTDDS_FOLDER=${CARLA_BUILD_FOLDER}/libcarla-fastdds-install +LIBCARLA_BUILD_FASTDDS_FOLDER=${CARLA_BUILD_FOLDER}/libcarla-fastdds-build LIBCARLA_BUILD_CLIENT_FOLDER=${CARLA_BUILD_FOLDER}/libcarla-client-build LIBCARLA_INSTALL_SERVER_FOLDER=${CARLAUE4_PLUGIN_ROOT_FOLDER}/CarlaDependencies LIBCARLA_INSTALL_CLIENT_FOLDER=${CARLA_PYTHONAPI_SOURCE_FOLDER}/dependencies From d5af7ed1f942a079c4849d2ef900c498fa8e4e4e Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 2 Dec 2025 17:19:28 +0100 Subject: [PATCH 05/39] Fix merge error --- .../Carla/Source/Carla/Server/CarlaServer.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp index a59469d9ac4..7bbd2813a43 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp @@ -3866,22 +3866,6 @@ double FCarlaServer::GetTickDeltaSeconds() { return Pimpl->GetTickDeltaSeconds(); } -void FCarlaServer::EnableSynchronousMode() { - Pimpl->EnableSynchronousMode(); -} - -void FCarlaServer::DisableSynchronousMode() { - Pimpl->DisableSynchronousMode(); -} - -bool FCarlaServer::IsSynchronousModeActive() { - return Pimpl->ServerSync.IsSynchronousModeActive(); -} - -double FCarlaServer::GetTickDeltaSeconds() { - return Pimpl->GetTickDeltaSeconds(); -} - void FCarlaServer::Tick() { (void)Pimpl->call_tick(Pimpl->SynchronizationClientId(), From 30dd49b2f399799cab575c6db4fada935faa8047 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 3 Dec 2025 12:58:12 +0100 Subject: [PATCH 06/39] Fix ROS2 VehiclePublisher telemetry data update Update telemetry data of VehiclePublisher within process messages step This ensures that the vehicle/wheel data in the engine can not be updated while gathering the data Improve object classification to match existing base-class blueprint patterns. Reduce some ROS2 log output severity --- .../ros2/publishers/UeWorldPublisher.cpp | 5 +- .../ros2/publishers/VehiclePublisher.cpp | 84 +++++++++++-------- .../carla/ros2/publishers/VehiclePublisher.h | 12 ++- LibCarla/source/carla/ros2/types/Object.h | 48 +++++++++-- .../carla/streaming/detail/MultiStreamState.h | 6 +- 5 files changed, 106 insertions(+), 49 deletions(-) diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index 76a59a3d3f0..f0d8ae33e45 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -56,6 +56,7 @@ void UeWorldPublisher::ProcessMessages() { vehicle.second._vehicle_controller->ProcessMessages(); vehicle.second._vehicle_ackermann_controller->ProcessMessages(); vehicle.second._actor_set_transform_subscriber->ProcessMessages(); + vehicle.second._vehicle_publisher->ProcessMessages(); } for (auto& walker : _walkers) { walker.second._walker_controller->ProcessMessages(); @@ -95,7 +96,7 @@ void UeWorldPublisher::AddVehicleUe( _objects_changed = true; auto vehicle_publisher = - std::make_shared(vehicle_actor_definition, _transform_publisher, _objects_publisher, _objects_with_covariance_publisher); + std::make_shared(vehicle_actor_definition, _transform_publisher, _objects_publisher, _objects_with_covariance_publisher, _carla_server); UeVehicle ue_vehicle(vehicle_publisher); ue_vehicle._vehicle_controller = std::make_shared(*vehicle_publisher, std::move(vehicle_control_callback)); @@ -316,7 +317,7 @@ void UeWorldPublisher::UpdateSensorData( if ( publisher->is_enabled_for_ros() ) { object_enabled_for_ros = true; publisher->UpdateTransform(_timestamp, transform); - publisher->UpdateVehicle(object, actor_dynamic_state, _carla_server); + publisher->UpdateVehicle(object, actor_dynamic_state); publisher->Publish(); } } diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp index b3e62985ccd..681ece6c95a 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -15,9 +15,11 @@ namespace ros2 { VehiclePublisher::VehiclePublisher(std::shared_ptr vehicle_actor_definition, std::shared_ptr transform_publisher, std::shared_ptr objects_publisher, - std::shared_ptr objects_with_covariance_publisher) + std::shared_ptr objects_with_covariance_publisher, + carla::rpc::RpcServerInterface &carla_server) : PublisherBaseTransform(std::static_pointer_cast(vehicle_actor_definition), transform_publisher), + _carla_server(carla_server), _vehicle_info_publisher(std::make_shared()), _vehicle_status_publisher(std::make_shared()), _vehicle_odometry_publisher(std::make_shared()), @@ -99,47 +101,59 @@ bool VehiclePublisher::SubscribersConnected() const { _vehicle_object_with_covariance_publisher->SubscribersConnected(); } +bool VehiclePublisher::ProcessMessages() { + // the telemetry data is not transferred by the sensor data stream, + // it has to be requested separately from the server, + // This should happen within the message processing step, when also other calls are expected + // to ensure the simulation internal data is actually locked and its safe to acceess it. + if (_vehicle_telemetry_publisher->SubscribersConnected()) { + auto response = _carla_server.call_get_telemetry_data(_actor_name_definition->id); + if (response.HasError()) { + carla::log_warning("VehiclePublisher: Failed to get telemetry data for actor id ", + std::to_string(_actor_name_definition->id)); + } + else { + auto const telemetry_data = response.Get(); + _vehicle_telemetry_publisher->Message().throttle(telemetry_data.throttle); + _vehicle_telemetry_publisher->Message().steer(telemetry_data.steer); + _vehicle_telemetry_publisher->Message().brake(telemetry_data.brake); + _vehicle_telemetry_publisher->Message().engine_rpm(telemetry_data.engine_rpm); + _vehicle_telemetry_publisher->Message().gear(telemetry_data.gear); + _vehicle_telemetry_publisher->Message().drag(telemetry_data.drag); + + _vehicle_telemetry_publisher->Message().wheels().clear(); + for (auto const &wheel: telemetry_data.wheels) { + carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel wheel_msg; + wheel_msg.tire_friction(wheel.tire_friction); + wheel_msg.lat_slip(wheel.lat_slip); + wheel_msg.long_slip(wheel.long_slip); + wheel_msg.omega(wheel.omega); + wheel_msg.tire_load(wheel.tire_load); + wheel_msg.normalized_tire_load(wheel.normalized_tire_load); + wheel_msg.torque(wheel.torque); + wheel_msg.long_force(wheel.long_force); + wheel_msg.lat_force(wheel.lat_force); + wheel_msg.normalized_long_force(wheel.normalized_long_force); + wheel_msg.normalized_lat_force(wheel.normalized_lat_force); + _vehicle_telemetry_publisher->Message().wheels().push_back(wheel_msg); + } + } + } + return true; +} + void VehiclePublisher::UpdateVehicle(std::shared_ptr &object, - carla::sensor::data::ActorDynamicState const &actor_dynamic_state, - carla::rpc::RpcServerInterface &carla_server) { + carla::sensor::data::ActorDynamicState const &actor_dynamic_state) { _vehicle_odometry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); _vehicle_odometry_publisher->Message().child_frame_id(frame_id()); _vehicle_odometry_publisher->Message().pose(object->Transform().pose_with_covariance()); _vehicle_odometry_publisher->Message().twist(object->AcceleratedMovement().twist_with_covariance()); _vehicle_speed_publisher->Message().data(object->Speed().speed().data()); - - auto response = carla_server.call_get_telemetry_data(_actor_name_definition->id); - if (!response) { - carla::log_warning("VehiclePublisher: Failed to get telemetry data for actor id ", - std::to_string(_actor_name_definition->id), ": ", response.GetError().What()); - } - else { - auto telemetry_data = response.Get(); - _vehicle_telemetry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); - _vehicle_telemetry_publisher->Message().throttle(telemetry_data.throttle); - _vehicle_telemetry_publisher->Message().steer(telemetry_data.steer); - _vehicle_telemetry_publisher->Message().brake(telemetry_data.brake); - _vehicle_telemetry_publisher->Message().engine_rpm(telemetry_data.engine_rpm); - _vehicle_telemetry_publisher->Message().gear(telemetry_data.gear); - _vehicle_telemetry_publisher->Message().drag(telemetry_data.drag); - _vehicle_telemetry_publisher->Message().wheels().clear(); - for (auto const &wheel: telemetry_data.wheels) { - carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel wheel_msg; - wheel_msg.tire_friction(wheel.tire_friction); - wheel_msg.lat_slip(wheel.lat_slip); - wheel_msg.long_slip(wheel.long_slip); - wheel_msg.omega(wheel.omega); - wheel_msg.tire_load(wheel.tire_load); - wheel_msg.normalized_tire_load(wheel.normalized_tire_load); - wheel_msg.torque(wheel.torque); - wheel_msg.long_force(wheel.long_force); - wheel_msg.lat_force(wheel.lat_force); - wheel_msg.normalized_long_force(wheel.normalized_long_force); - wheel_msg.normalized_lat_force(wheel.normalized_lat_force); - _vehicle_telemetry_publisher->Message().wheels().push_back(wheel_msg); - } - } + _vehicle_speed_publisher->SetMessageUpdated(); + + // add the timestamp and frame_id to telemetry data + _vehicle_telemetry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); _vehicle_status_publisher->SetMessageHeader(object->Timestamp().time(), frame_id()); _vehicle_status_publisher->Message().velocity(object->Speed().speed().data()); diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h index 20ab8da65fe..77d5624b783 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h @@ -39,7 +39,8 @@ class VehiclePublisher : public PublisherBaseTransform { VehiclePublisher(std::shared_ptr vehicle_actor_definition, std::shared_ptr transform_publisher, std::shared_ptr objects_publisher, - std::shared_ptr objects_with_covariance_publisher); + std::shared_ptr objects_with_covariance_publisher, + carla::rpc::RpcServerInterface &carla_server); virtual ~VehiclePublisher() = default; /** @@ -56,11 +57,16 @@ class VehiclePublisher : public PublisherBaseTransform { */ bool SubscribersConnected() const override; + /** + * Perform message processing. + */ + bool ProcessMessages(); + void UpdateVehicle(std::shared_ptr &object, - carla::sensor::data::ActorDynamicState const &actor_dynamic_state, - carla::rpc::RpcServerInterface &carla_server); + carla::sensor::data::ActorDynamicState const &actor_dynamic_state); private: + carla::rpc::RpcServerInterface &_carla_server; std::shared_ptr _vehicle_info_publisher; bool _vehicle_info_published{false}; std::shared_ptr _vehicle_status_publisher; diff --git a/LibCarla/source/carla/ros2/types/Object.h b/LibCarla/source/carla/ros2/types/Object.h index d06b8be5cb7..0b2883f85c7 100644 --- a/LibCarla/source/carla/ros2/types/Object.h +++ b/LibCarla/source/carla/ros2/types/Object.h @@ -20,10 +20,12 @@ #include "derived_object_msgs/msg/Object.h" #include "derived_object_msgs/msg/ObjectWithCovariance.h" + namespace carla { namespace ros2 { namespace types { + /** Convert a carla (linear) acceleration to a ROS accel (linear part) @@ -40,7 +42,10 @@ class Object { explicit Object(std::shared_ptr vehicle_actor_definition) : _actor_name_definition( std::static_pointer_cast(vehicle_actor_definition)) { - if (_actor_name_definition->base_type == "Bus" || _actor_name_definition->base_type == "Truck") { + + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_OTHER_VEHICLE; + if (_actor_name_definition->base_type == "Bus" || _actor_name_definition->base_type == "Truck" + || _actor_name_definition->base_type == "bus" || _actor_name_definition->base_type == "truck") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_TRUCK; } else if (_actor_name_definition->base_type == "car" || _actor_name_definition->base_type == "van") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_CAR; @@ -68,7 +73,7 @@ class Object { carla::log_warning( "Unknown Vehicle Object[", _actor_name_definition->type_id, "] id: ", _actor_name_definition->id, " object_type: ", _actor_name_definition->object_type, " base_type: ", _actor_name_definition->base_type, - " mass: ", vehicle_actor_definition->vehicle_physics_control.mass, " ROS-class: ", _classification); + " mass: ", vehicle_actor_definition->vehicle_physics_control.mass, " estimated ROS-class based on mass: ", classification_string()); } } /** @@ -82,7 +87,7 @@ class Object { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_PEDESTRIAN; carla::log_debug("Creating Walker Object[", _actor_name_definition->type_id, "] id: ", _actor_name_definition->id, " object_type: ", _actor_name_definition->object_type, - " base_type: ", _actor_name_definition->base_type, " ROS-class: ", _classification); + " base_type: ", _actor_name_definition->base_type, " ROS-class: ", classification_string()); } /** * The representation of an object in the sense of derived_object_msgs::msg::Object. @@ -95,7 +100,7 @@ class Object { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; carla::log_debug("Creating Traffic Light Object[", _actor_name_definition->type_id, "] id: ", _actor_name_definition->id, " object_type: ", _actor_name_definition->object_type, - " base_type: ", _actor_name_definition->base_type, " ROS-class: ", _classification); + " base_type: ", _actor_name_definition->base_type, " ROS-class: ", classification_string()); } /** * The representation of an object in the sense of derived_object_msgs::msg::Object. @@ -108,7 +113,7 @@ class Object { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; carla::log_debug("Creating Traffic Sign Object[", _actor_name_definition->type_id, "] id: ", _actor_name_definition->id, " object_type: ", _actor_name_definition->object_type, - " base_type: ", _actor_name_definition->base_type, " ROS-class: ", _classification); + " base_type: ", _actor_name_definition->base_type, " ROS-class: ", classification_string()); } ~Object() = default; Object(const Object&) = delete; @@ -206,13 +211,44 @@ class Object { return _classification; } + std::string classification_string() { + switch (_classification) { + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN: + return "UNKNOWN"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN_SMALL: + return "UNKNOWN_SMALL"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN_MEDIUM: + return "UNKNOWN_MEDIUM"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN_BIG: + return "UNKNOWN_BIG"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_PEDESTRIAN: + return "PEDESTRIAN"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BIKE: + return "BIKE"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_CAR: + return "CAR"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_TRUCK: + return "TRUCK"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_MOTORCYCLE: + return "MOTORCYCLE"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_OTHER_VEHICLE: + return "OTHER_VEHICLE"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BARRIER: + return "BARRIER"; + case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN: + return "SIGN"; + default: + return "N/A"; + } + } + carla_msgs::msg::CarlaActorInfo carla_actor_info(std::shared_ptr name_registry) const { return _actor_name_definition->carla_actor_info(name_registry); } private: std::shared_ptr _actor_name_definition; - uint8_t _classification; + uint8_t _classification{derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN}; carla::geom::BoundingBox _bounding_box; carla::ros2::types::Transform _transform; carla::ros2::types::AcceleratedMovement _accelerated_movement; diff --git a/LibCarla/source/carla/streaming/detail/MultiStreamState.h b/LibCarla/source/carla/streaming/detail/MultiStreamState.h index 1ac559d7835..c9043eadea2 100644 --- a/LibCarla/source/carla/streaming/detail/MultiStreamState.h +++ b/LibCarla/source/carla/streaming/detail/MultiStreamState.h @@ -61,12 +61,12 @@ namespace detail { } void EnableForROS(actor_id_type actor_id) { - log_error("MultiStreamState enable for ros. Searching sessions."); + log_info("MultiStreamState enable for ros. Searching sessions."); _enable_for_ros.insert(actor_id); for (auto &s : _sessions) { if (s != nullptr) { s->EnableForROS(actor_id); - log_error("sensor ", s->get_stream_id(), " enable for ros "); + log_info("sensor ", s->get_stream_id(), " enable for ros "); } } } @@ -76,7 +76,7 @@ namespace detail { for (auto &s : _sessions) { if (s != nullptr) { s->DisableForROS(actor_id); - log_error("sensor ", s->get_stream_id(), " disable for ros "); + log_info("sensor ", s->get_stream_id(), " disable for ros "); } } } From 2f427850837e7515b0b1a768c2b9752e6a9c43ed Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 9 Dec 2025 13:21:34 +0100 Subject: [PATCH 07/39] Fix publishing of emtpy child frame --- LibCarla/source/carla/ros2/ROS2NameRegistry.h | 6 +++++- .../carla/ros2/publishers/TransformPublisher.cpp | 13 ++++++++++--- .../carla/ros2/publishers/TransformPublisher.h | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/LibCarla/source/carla/ros2/ROS2NameRegistry.h b/LibCarla/source/carla/ros2/ROS2NameRegistry.h index 8f7aa053dee..32ee0f08672 100644 --- a/LibCarla/source/carla/ros2/ROS2NameRegistry.h +++ b/LibCarla/source/carla/ros2/ROS2NameRegistry.h @@ -56,7 +56,11 @@ class ROS2NameRegistry { std::string FrameId(ROS2NameRecord const* record) { std::lock_guard lock(access_mutex); - return GetTopicAndFrameLocked(record)._frame_id; + std::string frame_id = GetTopicAndFrameLocked(record)._frame_id; + if (frame_id.empty()) { + frame_id = "map"; + } + return frame_id; } std::string TopicName(ROS2NameRecord const* record) { std::lock_guard lock(access_mutex); diff --git a/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp index 7a9c51914aa..9020d32ba7e 100644 --- a/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp @@ -30,13 +30,20 @@ bool TransformPublisher::SubscribersConnected() const { return _impl->SubscribersConnected(); } -void TransformPublisher::AddTransform(const builtin_interfaces::msg::Time &stamp, std::string name, std::string parent, +void TransformPublisher::AddTransform(const builtin_interfaces::msg::Time &stamp, const std::string &name, const std::string &parent, geometry_msgs::msg::Transform const &transform) { + geometry_msgs::msg::TransformStamped ts; - ts.header().stamp(stamp); ts.header().frame_id(parent); + if ( name == parent ) { + // the child frame cannot be its own parent in ROS TF, so replace it with "carla" + ts.child_frame_id("carla"); + } + else { + ts.child_frame_id(name); + } + ts.header().stamp(stamp); ts.transform(transform); - ts.child_frame_id(name); _impl->Message().transforms().push_back(ts); _impl->SetMessageUpdated(); } diff --git a/LibCarla/source/carla/ros2/publishers/TransformPublisher.h b/LibCarla/source/carla/ros2/publishers/TransformPublisher.h index 1a66b1ce87d..76042a00165 100644 --- a/LibCarla/source/carla/ros2/publishers/TransformPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/TransformPublisher.h @@ -32,7 +32,7 @@ class TransformPublisher : public PublisherBase { */ bool SubscribersConnected() const override; - void AddTransform(const builtin_interfaces::msg::Time &stamp, std::string name, std::string parent, + void AddTransform(const builtin_interfaces::msg::Time &stamp, const std::string &name, const std::string &parent, geometry_msgs::msg::Transform const &transform); private: From 4b84a4a2c01be32b596d518beb9fb99a02ca9b98 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 9 Dec 2025 15:57:54 +0100 Subject: [PATCH 08/39] Fix download of libpng --- Util/BuildTools/Setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Util/BuildTools/Setup.sh b/Util/BuildTools/Setup.sh index 0bb7ef60e10..6999f8ca8bb 100755 --- a/Util/BuildTools/Setup.sh +++ b/Util/BuildTools/Setup.sh @@ -422,7 +422,7 @@ unset RECAST_BASENAME # ============================================================================== LIBPNG_VERSION=1.6.37 -LIBPNG_REPO=https://sourceforge.net/projects/libpng/files/libpng16/${LIBPNG_VERSION}/libpng-${LIBPNG_VERSION}.tar.xz +LIBPNG_REPO=https://sourceforge.net/projects/libpng/files/libpng16/older-releases/${LIBPNG_VERSION}/libpng-${LIBPNG_VERSION}.tar.xz LIBPNG_BASENAME=libpng-${LIBPNG_VERSION} LIBPNG_INSTALL=${LIBPNG_BASENAME}-install From 36acd87d475d3c8d6521a9e9a62ac109a8f3d0bb Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 10 Dec 2025 21:51:21 +0100 Subject: [PATCH 09/39] Fix LoadMap service --- LibCarla/source/carla/ros2/ROS2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibCarla/source/carla/ros2/ROS2.cpp b/LibCarla/source/carla/ros2/ROS2.cpp index 7c25f959cf6..1465010b0dc 100644 --- a/LibCarla/source/carla/ros2/ROS2.cpp +++ b/LibCarla/source/carla/ros2/ROS2.cpp @@ -126,7 +126,7 @@ void ROS2::NotifyBeginEpisode() { get_available_maps_service->Init(_domain_participant_impl); _services.push_back(get_available_maps_service); - auto load_map_service = std::make_shared( + auto load_map_service = std::make_shared( *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("load_map")); load_map_service->Init(_domain_participant_impl); _services.push_back(load_map_service); From d28fb75e2579a76f9b4b0d872fa04ef2f20a64b9 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Thu, 11 Dec 2025 09:20:41 +0100 Subject: [PATCH 10/39] Added missing ROS Weather Parameter interface --- .../carla_msgs/msg/CarlaWeatherParameters.cxx | 317 +++++++++++++++--- .../carla_msgs/msg/CarlaWeatherParameters.h | 144 ++++++-- .../ros2/publishers/UeWorldPublisher.cpp | 12 +- .../carla/ros2/publishers/UeWorldPublisher.h | 4 + .../ros2/publishers/VehiclePublisher.cpp | 2 +- .../ros2/publishers/WeatherPublisher.cpp | 52 +++ .../carla/ros2/publishers/WeatherPublisher.h | 46 +++ .../subscribers/WeatherControlSubscriber.cpp | 30 ++ .../subscribers/WeatherControlSubscriber.h | 41 +++ .../carla/ros2/types/WeatherParameters.h | 79 +++++ .../source/carla/rpc/RpcServerInterface.h | 11 + .../Carla/Source/Carla/Server/CarlaServer.cpp | 57 +++- .../Carla/Source/Carla/Server/CarlaServer.h | 11 + 13 files changed, 716 insertions(+), 90 deletions(-) create mode 100644 LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/WeatherPublisher.h create mode 100644 LibCarla/source/carla/ros2/subscribers/WeatherControlSubscriber.cpp create mode 100644 LibCarla/source/carla/ros2/subscribers/WeatherControlSubscriber.h create mode 100644 LibCarla/source/carla/ros2/types/WeatherParameters.h diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx index f06951fcbd5..374a0da076f 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx @@ -36,24 +36,34 @@ using namespace eprosima::fastcdr::exception; carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters() { - // m_cloudiness com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f6745d6 + // m_cloudiness com.eprosima.idl.parser.typecode.PrimitiveTypeCode@32a068d1 m_cloudiness = 0.0; - // m_precipitation com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27508c5d + // m_precipitation com.eprosima.idl.parser.typecode.PrimitiveTypeCode@33cb5951 m_precipitation = 0.0; - // m_precipitation_deposits com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f704591 + // m_precipitation_deposits com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fad8c79 m_precipitation_deposits = 0.0; - // m_wind_intensity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4b5189ac + // m_wind_intensity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71a794e5 m_wind_intensity = 0.0; - // m_fog_density com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e4d3ce5 + // m_sun_azimuth_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@76329302 + m_sun_azimuth_angle = 0.0; + // m_sun_altitude_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e25a92e + m_sun_altitude_angle = 0.0; + // m_fog_density com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4df828d7 m_fog_density = 0.0; - // m_fog_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3ddc6915 + // m_fog_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@b59d31 m_fog_distance = 0.0; - // m_wetness com.eprosima.idl.parser.typecode.PrimitiveTypeCode@704deff2 + // m_fog_falloff com.eprosima.idl.parser.typecode.PrimitiveTypeCode@62fdb4a6 + m_fog_falloff = 0.0; + // m_wetness com.eprosima.idl.parser.typecode.PrimitiveTypeCode@11e21d0e m_wetness = 0.0; - // m_sun_azimuth_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@379614be - m_sun_azimuth_angle = 0.0; - // m_sun_altitude_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@404bbcbd - m_sun_altitude_angle = 0.0; + // m_scattering_intensity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1dd02175 + m_scattering_intensity = 0.0; + // m_mie_scattering_scale com.eprosima.idl.parser.typecode.PrimitiveTypeCode@31206beb + m_mie_scattering_scale = 0.0; + // m_rayleigh_scattering_scale com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3e77a1ed + m_rayleigh_scattering_scale = 0.0331; + // m_dust_storm com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3ffcd140 + m_dust_storm = 0.0; } @@ -67,6 +77,11 @@ carla_msgs::msg::CarlaWeatherParameters::~CarlaWeatherParameters() + + + + + } carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( @@ -76,11 +91,16 @@ carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( m_precipitation = x.m_precipitation; m_precipitation_deposits = x.m_precipitation_deposits; m_wind_intensity = x.m_wind_intensity; + m_sun_azimuth_angle = x.m_sun_azimuth_angle; + m_sun_altitude_angle = x.m_sun_altitude_angle; m_fog_density = x.m_fog_density; m_fog_distance = x.m_fog_distance; + m_fog_falloff = x.m_fog_falloff; m_wetness = x.m_wetness; - m_sun_azimuth_angle = x.m_sun_azimuth_angle; - m_sun_altitude_angle = x.m_sun_altitude_angle; + m_scattering_intensity = x.m_scattering_intensity; + m_mie_scattering_scale = x.m_mie_scattering_scale; + m_rayleigh_scattering_scale = x.m_rayleigh_scattering_scale; + m_dust_storm = x.m_dust_storm; } carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( @@ -90,11 +110,16 @@ carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( m_precipitation = x.m_precipitation; m_precipitation_deposits = x.m_precipitation_deposits; m_wind_intensity = x.m_wind_intensity; + m_sun_azimuth_angle = x.m_sun_azimuth_angle; + m_sun_altitude_angle = x.m_sun_altitude_angle; m_fog_density = x.m_fog_density; m_fog_distance = x.m_fog_distance; + m_fog_falloff = x.m_fog_falloff; m_wetness = x.m_wetness; - m_sun_azimuth_angle = x.m_sun_azimuth_angle; - m_sun_altitude_angle = x.m_sun_altitude_angle; + m_scattering_intensity = x.m_scattering_intensity; + m_mie_scattering_scale = x.m_mie_scattering_scale; + m_rayleigh_scattering_scale = x.m_rayleigh_scattering_scale; + m_dust_storm = x.m_dust_storm; } carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters::operator =( @@ -105,11 +130,16 @@ carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters m_precipitation = x.m_precipitation; m_precipitation_deposits = x.m_precipitation_deposits; m_wind_intensity = x.m_wind_intensity; + m_sun_azimuth_angle = x.m_sun_azimuth_angle; + m_sun_altitude_angle = x.m_sun_altitude_angle; m_fog_density = x.m_fog_density; m_fog_distance = x.m_fog_distance; + m_fog_falloff = x.m_fog_falloff; m_wetness = x.m_wetness; - m_sun_azimuth_angle = x.m_sun_azimuth_angle; - m_sun_altitude_angle = x.m_sun_altitude_angle; + m_scattering_intensity = x.m_scattering_intensity; + m_mie_scattering_scale = x.m_mie_scattering_scale; + m_rayleigh_scattering_scale = x.m_rayleigh_scattering_scale; + m_dust_storm = x.m_dust_storm; return *this; } @@ -122,11 +152,16 @@ carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters m_precipitation = x.m_precipitation; m_precipitation_deposits = x.m_precipitation_deposits; m_wind_intensity = x.m_wind_intensity; + m_sun_azimuth_angle = x.m_sun_azimuth_angle; + m_sun_altitude_angle = x.m_sun_altitude_angle; m_fog_density = x.m_fog_density; m_fog_distance = x.m_fog_distance; + m_fog_falloff = x.m_fog_falloff; m_wetness = x.m_wetness; - m_sun_azimuth_angle = x.m_sun_azimuth_angle; - m_sun_altitude_angle = x.m_sun_altitude_angle; + m_scattering_intensity = x.m_scattering_intensity; + m_mie_scattering_scale = x.m_mie_scattering_scale; + m_rayleigh_scattering_scale = x.m_rayleigh_scattering_scale; + m_dust_storm = x.m_dust_storm; return *this; } @@ -135,7 +170,7 @@ bool carla_msgs::msg::CarlaWeatherParameters::operator ==( const CarlaWeatherParameters& x) const { - return (m_cloudiness == x.m_cloudiness && m_precipitation == x.m_precipitation && m_precipitation_deposits == x.m_precipitation_deposits && m_wind_intensity == x.m_wind_intensity && m_fog_density == x.m_fog_density && m_fog_distance == x.m_fog_distance && m_wetness == x.m_wetness && m_sun_azimuth_angle == x.m_sun_azimuth_angle && m_sun_altitude_angle == x.m_sun_altitude_angle); + return (m_cloudiness == x.m_cloudiness && m_precipitation == x.m_precipitation && m_precipitation_deposits == x.m_precipitation_deposits && m_wind_intensity == x.m_wind_intensity && m_sun_azimuth_angle == x.m_sun_azimuth_angle && m_sun_altitude_angle == x.m_sun_altitude_angle && m_fog_density == x.m_fog_density && m_fog_distance == x.m_fog_distance && m_fog_falloff == x.m_fog_falloff && m_wetness == x.m_wetness && m_scattering_intensity == x.m_scattering_intensity && m_mie_scattering_scale == x.m_mie_scattering_scale && m_rayleigh_scattering_scale == x.m_rayleigh_scattering_scale && m_dust_storm == x.m_dust_storm); } bool carla_msgs::msg::CarlaWeatherParameters::operator !=( @@ -177,6 +212,21 @@ size_t carla_msgs::msg::CarlaWeatherParameters::getMaxCdrSerializedSize( current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + return current_alignment - initial_alignment; } @@ -216,6 +266,21 @@ size_t carla_msgs::msg::CarlaWeatherParameters::getCdrSerializedSize( current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + return current_alignment - initial_alignment; } @@ -228,11 +293,16 @@ void carla_msgs::msg::CarlaWeatherParameters::serialize( scdr << m_precipitation; scdr << m_precipitation_deposits; scdr << m_wind_intensity; + scdr << m_sun_azimuth_angle; + scdr << m_sun_altitude_angle; scdr << m_fog_density; scdr << m_fog_distance; + scdr << m_fog_falloff; scdr << m_wetness; - scdr << m_sun_azimuth_angle; - scdr << m_sun_altitude_angle; + scdr << m_scattering_intensity; + scdr << m_mie_scattering_scale; + scdr << m_rayleigh_scattering_scale; + scdr << m_dust_storm; } @@ -244,11 +314,16 @@ void carla_msgs::msg::CarlaWeatherParameters::deserialize( dcdr >> m_precipitation; dcdr >> m_precipitation_deposits; dcdr >> m_wind_intensity; + dcdr >> m_sun_azimuth_angle; + dcdr >> m_sun_altitude_angle; dcdr >> m_fog_density; dcdr >> m_fog_distance; + dcdr >> m_fog_falloff; dcdr >> m_wetness; - dcdr >> m_sun_azimuth_angle; - dcdr >> m_sun_altitude_angle; + dcdr >> m_scattering_intensity; + dcdr >> m_mie_scattering_scale; + dcdr >> m_rayleigh_scattering_scale; + dcdr >> m_dust_storm; } /*! @@ -363,6 +438,62 @@ float& carla_msgs::msg::CarlaWeatherParameters::wind_intensity() return m_wind_intensity; } +/*! + * @brief This function sets a value in member sun_azimuth_angle + * @param _sun_azimuth_angle New value for member sun_azimuth_angle + */ +void carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle( + float _sun_azimuth_angle) +{ + m_sun_azimuth_angle = _sun_azimuth_angle; +} + +/*! + * @brief This function returns the value of member sun_azimuth_angle + * @return Value of member sun_azimuth_angle + */ +float carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() const +{ + return m_sun_azimuth_angle; +} + +/*! + * @brief This function returns a reference to member sun_azimuth_angle + * @return Reference to member sun_azimuth_angle + */ +float& carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() +{ + return m_sun_azimuth_angle; +} + +/*! + * @brief This function sets a value in member sun_altitude_angle + * @param _sun_altitude_angle New value for member sun_altitude_angle + */ +void carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle( + float _sun_altitude_angle) +{ + m_sun_altitude_angle = _sun_altitude_angle; +} + +/*! + * @brief This function returns the value of member sun_altitude_angle + * @return Value of member sun_altitude_angle + */ +float carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() const +{ + return m_sun_altitude_angle; +} + +/*! + * @brief This function returns a reference to member sun_altitude_angle + * @return Reference to member sun_altitude_angle + */ +float& carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() +{ + return m_sun_altitude_angle; +} + /*! * @brief This function sets a value in member fog_density * @param _fog_density New value for member fog_density @@ -419,6 +550,34 @@ float& carla_msgs::msg::CarlaWeatherParameters::fog_distance() return m_fog_distance; } +/*! + * @brief This function sets a value in member fog_falloff + * @param _fog_falloff New value for member fog_falloff + */ +void carla_msgs::msg::CarlaWeatherParameters::fog_falloff( + float _fog_falloff) +{ + m_fog_falloff = _fog_falloff; +} + +/*! + * @brief This function returns the value of member fog_falloff + * @return Value of member fog_falloff + */ +float carla_msgs::msg::CarlaWeatherParameters::fog_falloff() const +{ + return m_fog_falloff; +} + +/*! + * @brief This function returns a reference to member fog_falloff + * @return Reference to member fog_falloff + */ +float& carla_msgs::msg::CarlaWeatherParameters::fog_falloff() +{ + return m_fog_falloff; +} + /*! * @brief This function sets a value in member wetness * @param _wetness New value for member wetness @@ -448,59 +607,115 @@ float& carla_msgs::msg::CarlaWeatherParameters::wetness() } /*! - * @brief This function sets a value in member sun_azimuth_angle - * @param _sun_azimuth_angle New value for member sun_azimuth_angle + * @brief This function sets a value in member scattering_intensity + * @param _scattering_intensity New value for member scattering_intensity */ -void carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle( - float _sun_azimuth_angle) +void carla_msgs::msg::CarlaWeatherParameters::scattering_intensity( + float _scattering_intensity) { - m_sun_azimuth_angle = _sun_azimuth_angle; + m_scattering_intensity = _scattering_intensity; } /*! - * @brief This function returns the value of member sun_azimuth_angle - * @return Value of member sun_azimuth_angle + * @brief This function returns the value of member scattering_intensity + * @return Value of member scattering_intensity */ -float carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() const +float carla_msgs::msg::CarlaWeatherParameters::scattering_intensity() const { - return m_sun_azimuth_angle; + return m_scattering_intensity; } /*! - * @brief This function returns a reference to member sun_azimuth_angle - * @return Reference to member sun_azimuth_angle + * @brief This function returns a reference to member scattering_intensity + * @return Reference to member scattering_intensity */ -float& carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() +float& carla_msgs::msg::CarlaWeatherParameters::scattering_intensity() { - return m_sun_azimuth_angle; + return m_scattering_intensity; } /*! - * @brief This function sets a value in member sun_altitude_angle - * @param _sun_altitude_angle New value for member sun_altitude_angle + * @brief This function sets a value in member mie_scattering_scale + * @param _mie_scattering_scale New value for member mie_scattering_scale */ -void carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle( - float _sun_altitude_angle) +void carla_msgs::msg::CarlaWeatherParameters::mie_scattering_scale( + float _mie_scattering_scale) { - m_sun_altitude_angle = _sun_altitude_angle; + m_mie_scattering_scale = _mie_scattering_scale; } /*! - * @brief This function returns the value of member sun_altitude_angle - * @return Value of member sun_altitude_angle + * @brief This function returns the value of member mie_scattering_scale + * @return Value of member mie_scattering_scale */ -float carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() const +float carla_msgs::msg::CarlaWeatherParameters::mie_scattering_scale() const { - return m_sun_altitude_angle; + return m_mie_scattering_scale; } /*! - * @brief This function returns a reference to member sun_altitude_angle - * @return Reference to member sun_altitude_angle + * @brief This function returns a reference to member mie_scattering_scale + * @return Reference to member mie_scattering_scale */ -float& carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() +float& carla_msgs::msg::CarlaWeatherParameters::mie_scattering_scale() { - return m_sun_altitude_angle; + return m_mie_scattering_scale; +} + +/*! + * @brief This function sets a value in member rayleigh_scattering_scale + * @param _rayleigh_scattering_scale New value for member rayleigh_scattering_scale + */ +void carla_msgs::msg::CarlaWeatherParameters::rayleigh_scattering_scale( + float _rayleigh_scattering_scale) +{ + m_rayleigh_scattering_scale = _rayleigh_scattering_scale; +} + +/*! + * @brief This function returns the value of member rayleigh_scattering_scale + * @return Value of member rayleigh_scattering_scale + */ +float carla_msgs::msg::CarlaWeatherParameters::rayleigh_scattering_scale() const +{ + return m_rayleigh_scattering_scale; +} + +/*! + * @brief This function returns a reference to member rayleigh_scattering_scale + * @return Reference to member rayleigh_scattering_scale + */ +float& carla_msgs::msg::CarlaWeatherParameters::rayleigh_scattering_scale() +{ + return m_rayleigh_scattering_scale; +} + +/*! + * @brief This function sets a value in member dust_storm + * @param _dust_storm New value for member dust_storm + */ +void carla_msgs::msg::CarlaWeatherParameters::dust_storm( + float _dust_storm) +{ + m_dust_storm = _dust_storm; +} + +/*! + * @brief This function returns the value of member dust_storm + * @return Value of member dust_storm + */ +float carla_msgs::msg::CarlaWeatherParameters::dust_storm() const +{ + return m_dust_storm; +} + +/*! + * @brief This function returns a reference to member dust_storm + * @return Reference to member dust_storm + */ +float& carla_msgs::msg::CarlaWeatherParameters::dust_storm() +{ + return m_dust_storm; } @@ -523,7 +738,7 @@ void carla_msgs::msg::CarlaWeatherParameters::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - + } diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h index fdf671a8cbf..82399313c6c 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h @@ -199,6 +199,44 @@ namespace carla_msgs { */ eProsima_user_DllExport float& wind_intensity(); + /*! + * @brief This function sets a value in member sun_azimuth_angle + * @param _sun_azimuth_angle New value for member sun_azimuth_angle + */ + eProsima_user_DllExport void sun_azimuth_angle( + float _sun_azimuth_angle); + + /*! + * @brief This function returns the value of member sun_azimuth_angle + * @return Value of member sun_azimuth_angle + */ + eProsima_user_DllExport float sun_azimuth_angle() const; + + /*! + * @brief This function returns a reference to member sun_azimuth_angle + * @return Reference to member sun_azimuth_angle + */ + eProsima_user_DllExport float& sun_azimuth_angle(); + + /*! + * @brief This function sets a value in member sun_altitude_angle + * @param _sun_altitude_angle New value for member sun_altitude_angle + */ + eProsima_user_DllExport void sun_altitude_angle( + float _sun_altitude_angle); + + /*! + * @brief This function returns the value of member sun_altitude_angle + * @return Value of member sun_altitude_angle + */ + eProsima_user_DllExport float sun_altitude_angle() const; + + /*! + * @brief This function returns a reference to member sun_altitude_angle + * @return Reference to member sun_altitude_angle + */ + eProsima_user_DllExport float& sun_altitude_angle(); + /*! * @brief This function sets a value in member fog_density * @param _fog_density New value for member fog_density @@ -237,6 +275,25 @@ namespace carla_msgs { */ eProsima_user_DllExport float& fog_distance(); + /*! + * @brief This function sets a value in member fog_falloff + * @param _fog_falloff New value for member fog_falloff + */ + eProsima_user_DllExport void fog_falloff( + float _fog_falloff); + + /*! + * @brief This function returns the value of member fog_falloff + * @return Value of member fog_falloff + */ + eProsima_user_DllExport float fog_falloff() const; + + /*! + * @brief This function returns a reference to member fog_falloff + * @return Reference to member fog_falloff + */ + eProsima_user_DllExport float& fog_falloff(); + /*! * @brief This function sets a value in member wetness * @param _wetness New value for member wetness @@ -257,42 +314,80 @@ namespace carla_msgs { eProsima_user_DllExport float& wetness(); /*! - * @brief This function sets a value in member sun_azimuth_angle - * @param _sun_azimuth_angle New value for member sun_azimuth_angle + * @brief This function sets a value in member scattering_intensity + * @param _scattering_intensity New value for member scattering_intensity */ - eProsima_user_DllExport void sun_azimuth_angle( - float _sun_azimuth_angle); + eProsima_user_DllExport void scattering_intensity( + float _scattering_intensity); /*! - * @brief This function returns the value of member sun_azimuth_angle - * @return Value of member sun_azimuth_angle + * @brief This function returns the value of member scattering_intensity + * @return Value of member scattering_intensity */ - eProsima_user_DllExport float sun_azimuth_angle() const; + eProsima_user_DllExport float scattering_intensity() const; /*! - * @brief This function returns a reference to member sun_azimuth_angle - * @return Reference to member sun_azimuth_angle + * @brief This function returns a reference to member scattering_intensity + * @return Reference to member scattering_intensity */ - eProsima_user_DllExport float& sun_azimuth_angle(); + eProsima_user_DllExport float& scattering_intensity(); /*! - * @brief This function sets a value in member sun_altitude_angle - * @param _sun_altitude_angle New value for member sun_altitude_angle + * @brief This function sets a value in member mie_scattering_scale + * @param _mie_scattering_scale New value for member mie_scattering_scale */ - eProsima_user_DllExport void sun_altitude_angle( - float _sun_altitude_angle); + eProsima_user_DllExport void mie_scattering_scale( + float _mie_scattering_scale); /*! - * @brief This function returns the value of member sun_altitude_angle - * @return Value of member sun_altitude_angle + * @brief This function returns the value of member mie_scattering_scale + * @return Value of member mie_scattering_scale */ - eProsima_user_DllExport float sun_altitude_angle() const; + eProsima_user_DllExport float mie_scattering_scale() const; /*! - * @brief This function returns a reference to member sun_altitude_angle - * @return Reference to member sun_altitude_angle + * @brief This function returns a reference to member mie_scattering_scale + * @return Reference to member mie_scattering_scale */ - eProsima_user_DllExport float& sun_altitude_angle(); + eProsima_user_DllExport float& mie_scattering_scale(); + + /*! + * @brief This function sets a value in member rayleigh_scattering_scale + * @param _rayleigh_scattering_scale New value for member rayleigh_scattering_scale + */ + eProsima_user_DllExport void rayleigh_scattering_scale( + float _rayleigh_scattering_scale); + + /*! + * @brief This function returns the value of member rayleigh_scattering_scale + * @return Value of member rayleigh_scattering_scale + */ + eProsima_user_DllExport float rayleigh_scattering_scale() const; + + /*! + * @brief This function returns a reference to member rayleigh_scattering_scale + * @return Reference to member rayleigh_scattering_scale + */ + eProsima_user_DllExport float& rayleigh_scattering_scale(); + + /*! + * @brief This function sets a value in member dust_storm + * @param _dust_storm New value for member dust_storm + */ + eProsima_user_DllExport void dust_storm( + float _dust_storm); + + /*! + * @brief This function returns the value of member dust_storm + * @return Value of member dust_storm + */ + eProsima_user_DllExport float dust_storm() const; + + /*! + * @brief This function returns a reference to member dust_storm + * @return Reference to member dust_storm + */ + eProsima_user_DllExport float& dust_storm(); /*! @@ -358,11 +453,16 @@ namespace carla_msgs { float m_precipitation; float m_precipitation_deposits; float m_wind_intensity; + float m_sun_azimuth_angle; + float m_sun_altitude_angle; float m_fog_density; float m_fog_distance; + float m_fog_falloff; float m_wetness; - float m_sun_azimuth_angle; - float m_sun_altitude_angle; + float m_scattering_intensity; + float m_mie_scattering_scale; + float m_rayleigh_scattering_scale; + float m_dust_storm; }; } // namespace msg } // namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index f0d8ae33e45..e64fbc891ec 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -17,6 +17,7 @@ UeWorldPublisher::UeWorldPublisher(carla::rpc::RpcServerInterface& carla_server, _carla_server(carla_server), _name_registry(name_registry), _carla_status_publisher(std::make_shared()), + _carla_weather_publisher(std::make_shared(_carla_server)), _carla_actor_list_publisher(std::make_shared("actor_list")), _clock_publisher(std::make_shared()), _map_publisher(std::make_shared()), @@ -24,17 +25,20 @@ UeWorldPublisher::UeWorldPublisher(carla::rpc::RpcServerInterface& carla_server, _objects_with_covariance_publisher(std::make_shared()), _traffic_lights_publisher(std::make_shared()), _carla_control_subscriber(std::make_shared(*this, _carla_server)), - _sync_subscriber(std::make_shared(*this, _carla_server)) { + _sync_subscriber(std::make_shared(*this, _carla_server)), + _weather_control_subscriber(std::make_shared(*this, _carla_server)) { } bool UeWorldPublisher::Init(std::shared_ptr domain_participant) { _domain_participant_impl = domain_participant; _initialized = _carla_status_publisher->Init(domain_participant) && + _carla_weather_publisher->Init(domain_participant) && _carla_actor_list_publisher->Init(domain_participant) && _clock_publisher->Init(domain_participant) && _map_publisher->Init(domain_participant) && _objects_publisher->Init(domain_participant) && _objects_with_covariance_publisher->Init(domain_participant) && _traffic_lights_publisher->Init(domain_participant) && _transform_publisher->Init(domain_participant) && - _carla_control_subscriber->Init(domain_participant) && _sync_subscriber->Init(domain_participant); + _carla_control_subscriber->Init(domain_participant) && _sync_subscriber->Init(domain_participant) && + _weather_control_subscriber->Init(domain_participant); return _initialized; } @@ -42,7 +46,7 @@ bool UeWorldPublisher::Publish() { if (!_initialized) { return false; } - return _clock_publisher->Publish() && _map_publisher->Publish(); + return _clock_publisher->Publish() && _map_publisher->Publish() && _carla_weather_publisher->Publish(); } void UeWorldPublisher::ProcessMessages() { @@ -52,6 +56,8 @@ void UeWorldPublisher::ProcessMessages() { _carla_control_subscriber->ProcessMessages(); _sync_subscriber->ProcessMessages(); + _carla_weather_publisher->ProcessMessages(); + _weather_control_subscriber->ProcessMessages(); for (auto& vehicle : _vehicles) { vehicle.second._vehicle_controller->ProcessMessages(); vehicle.second._vehicle_ackermann_controller->ProcessMessages(); diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h index 21155d07340..a2a60d35fbc 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h @@ -17,12 +17,14 @@ #include "carla/ros2/publishers/UePublisherBaseSensor.h" #include "carla/ros2/publishers/VehiclePublisher.h" #include "carla/ros2/publishers/WalkerPublisher.h" +#include "carla/ros2/publishers/WeatherPublisher.h" #include "carla/ros2/subscribers/AckermannControlSubscriber.h" #include "carla/ros2/subscribers/ActorSetTransformSubscriber.h" #include "carla/ros2/subscribers/CarlaControlSubscriber.h" #include "carla/ros2/subscribers/CarlaSynchronizationWindowSubscriber.h" #include "carla/ros2/subscribers/VehicleControlSubscriber.h" #include "carla/ros2/subscribers/WalkerControlSubscriber.h" +#include "carla/ros2/subscribers/WeatherControlSubscriber.h" #include "carla/ros2/types/Object.h" #include "carla/ros2/types/VehicleActorDefinition.h" #include "carla/rpc/RpcServerInterface.h" @@ -200,6 +202,7 @@ class UeWorldPublisher : public UePublisherBaseSensor { std::shared_ptr _name_registry; // publisher std::shared_ptr _carla_status_publisher; + std::shared_ptr _carla_weather_publisher; std::shared_ptr _carla_actor_list_publisher; std::shared_ptr _clock_publisher; std::shared_ptr _map_publisher; @@ -208,6 +211,7 @@ class UeWorldPublisher : public UePublisherBaseSensor { std::shared_ptr _traffic_lights_publisher; // subscriber std::shared_ptr _carla_control_subscriber; + std::shared_ptr _weather_control_subscriber; std::shared_ptr _sync_subscriber; bool _initialized{false}; diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp index 681ece6c95a..61b20f8ef11 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -110,7 +110,7 @@ bool VehiclePublisher::ProcessMessages() { auto response = _carla_server.call_get_telemetry_data(_actor_name_definition->id); if (response.HasError()) { carla::log_warning("VehiclePublisher: Failed to get telemetry data for actor id ", - std::to_string(_actor_name_definition->id)); + std::to_string(_actor_name_definition->id), ":", response.GetError().What()); } else { auto const telemetry_data = response.Get(); diff --git a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp new file mode 100644 index 00000000000..8a181abb6f1 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp @@ -0,0 +1,52 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "WeatherPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/ros2/types/WeatherParameters.h" + +namespace carla { +namespace ros2 { + +WeatherPublisher::WeatherPublisher(carla::rpc::RpcServerInterface &carla_server) + : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("weather")), + _impl(std::make_shared()), + _carla_server(carla_server) +{} + +bool WeatherPublisher::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, get_topic_name(), get_topic_qos()); +} + +bool WeatherPublisher::Publish() { + return _impl->Publish(); +} + +bool WeatherPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +bool WeatherPublisher::ProcessMessages() { + // the weather data is not transferred by the sensor data stream, + // it has to be requested separately from the server, + // This should happen within the message processing step, when also other calls are expected + // to ensure the simulation internal data is actually locked and its safe to acceess it. + if (_impl->SubscribersConnected()) { + auto response = _carla_server.call_get_weather_parameters(); + if (response.HasError()) { + carla::log_warning("WeatherPublisher: Failed to get weather parameters " + "from CARLA server: ", response.GetError().What()); + } + else { + carla::ros2::types::WeatherParameters weather_parameters(response.Get()); + _impl->Message() = weather_parameters.weather_parameters_msg(); + _impl->SetMessageUpdated(); + } + } + return true; +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h new file mode 100644 index 00000000000..f5f99256fd5 --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h @@ -0,0 +1,46 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using CarlaWeatherParametersPublisherImpl = + DdsPublisherImpl; + +class WeatherPublisher : public PublisherBaseSensor { +public: + WeatherPublisher(carla::rpc::RpcServerInterface &carla_server); + virtual ~WeatherPublisher() = default; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + + /** + * Implement PublisherInterface::Publish interface + */ + bool Publish() override; + /** + * Implement PublisherInterface::SubscribersConnected interface + */ + bool SubscribersConnected() const override; + + /** + * Perform message processing. + */ + bool ProcessMessages(); + +private: + carla::rpc::RpcServerInterface &_carla_server; + std::shared_ptr _impl; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/WeatherControlSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/WeatherControlSubscriber.cpp new file mode 100644 index 00000000000..f7e6c49af97 --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/WeatherControlSubscriber.cpp @@ -0,0 +1,30 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "carla/ros2/subscribers/WeatherControlSubscriber.h" +#include "carla/ros2/types/WeatherParameters.h" +#include "carla/ros2/impl/DdsSubscriberImpl.h" + +namespace carla { +namespace ros2 { + +WeatherControlSubscriber::WeatherControlSubscriber(ROS2NameRecord& parent, + carla::rpc::RpcServerInterface &carla_server) + : SubscriberBase(parent), + _impl(std::make_shared(*this)), + _carla_server(carla_server) {} + +bool WeatherControlSubscriber::Init(std::shared_ptr domain_participant) { + return _impl->Init(domain_participant, get_topic_name("weather_control"), get_topic_qos()); +} + +void WeatherControlSubscriber::ProcessMessages() { + while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { + carla::ros2::types::WeatherParameters weather_parameter(_impl->GetMessage()); + _carla_server.call_set_weather_parameters(weather_parameter.weather_parameters_rpc()); + } +} + +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/subscribers/WeatherControlSubscriber.h b/LibCarla/source/carla/ros2/subscribers/WeatherControlSubscriber.h new file mode 100644 index 00000000000..bfbb00a5b0c --- /dev/null +++ b/LibCarla/source/carla/ros2/subscribers/WeatherControlSubscriber.h @@ -0,0 +1,41 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include +#include + +#include "carla/ros2/subscribers/SubscriberBase.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h" + +namespace carla { +namespace ros2 { + +using WeatherControlSubscriberImpl = + DdsSubscriberImpl; + +class WeatherControlSubscriber : public SubscriberBase { +public: + explicit WeatherControlSubscriber(ROS2NameRecord& parent, + carla::rpc::RpcServerInterface &carla_server); + virtual ~WeatherControlSubscriber() = default; + + /** + * Implements SubscriberBase::ProcessMessages() + */ + void ProcessMessages() override; + + /** + * Implements ROS2NameRecord::Init() interface + */ + bool Init(std::shared_ptr domain_participant) override; + +private: + std::shared_ptr _impl; + carla::rpc::RpcServerInterface &_carla_server; +}; +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/types/WeatherParameters.h b/LibCarla/source/carla/ros2/types/WeatherParameters.h new file mode 100644 index 00000000000..901490f4f49 --- /dev/null +++ b/LibCarla/source/carla/ros2/types/WeatherParameters.h @@ -0,0 +1,79 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +#include + +#include "carla/rpc/WeatherParameters.h" +#include "carla_msgs/msg/CarlaWeatherParameters.h" + +namespace carla { +namespace ros2 { +namespace types { + +/** + Convert a carla rpc WeatherParameters to ROS type + and holds carla time details +*/ +class WeatherParameters { +public: + explicit WeatherParameters(carla::rpc::WeatherParameters const &weather_parameters) { + _weather_parameters.cloudiness(weather_parameters.cloudiness); + _weather_parameters.precipitation(weather_parameters.precipitation); + _weather_parameters.precipitation_deposits(weather_parameters.precipitation_deposits); + _weather_parameters.wind_intensity(weather_parameters.wind_intensity); + _weather_parameters.sun_azimuth_angle(weather_parameters.sun_azimuth_angle); + _weather_parameters.sun_altitude_angle(weather_parameters.sun_altitude_angle); + _weather_parameters.fog_density(weather_parameters.fog_density); + _weather_parameters.fog_distance(weather_parameters.fog_distance); + _weather_parameters.fog_falloff(weather_parameters.fog_falloff); + _weather_parameters.wetness(weather_parameters.wetness); + _weather_parameters.scattering_intensity(weather_parameters.scattering_intensity); + _weather_parameters.mie_scattering_scale(weather_parameters.mie_scattering_scale); + _weather_parameters.rayleigh_scattering_scale(weather_parameters.rayleigh_scattering_scale); + _weather_parameters.dust_storm(weather_parameters.dust_storm); + } + + explicit WeatherParameters(carla_msgs::msg::CarlaWeatherParameters const &weather_parameters) + : _weather_parameters(weather_parameters) {} + + ~WeatherParameters() = default; + WeatherParameters(const WeatherParameters&) = default; + WeatherParameters& operator=(const WeatherParameters&) = default; + WeatherParameters(WeatherParameters&&) = default; + WeatherParameters& operator=(WeatherParameters&&) = default; + + carla::rpc::WeatherParameters weather_parameters_rpc() const { + carla::rpc::WeatherParameters weather_parameters; + weather_parameters.cloudiness = _weather_parameters.cloudiness(); + weather_parameters.precipitation = _weather_parameters.precipitation(); + weather_parameters.precipitation_deposits = _weather_parameters.precipitation_deposits(); + weather_parameters.wind_intensity = _weather_parameters.wind_intensity(); + weather_parameters.sun_azimuth_angle = _weather_parameters.sun_azimuth_angle(); + weather_parameters.sun_altitude_angle = _weather_parameters.sun_altitude_angle(); + weather_parameters.fog_density = _weather_parameters.fog_density(); + weather_parameters.fog_distance = _weather_parameters.fog_distance(); + weather_parameters.fog_falloff = _weather_parameters.fog_falloff(); + weather_parameters.wetness = _weather_parameters.wetness(); + weather_parameters.scattering_intensity = _weather_parameters.scattering_intensity(); + weather_parameters.mie_scattering_scale = _weather_parameters.mie_scattering_scale(); + weather_parameters.rayleigh_scattering_scale = _weather_parameters.rayleigh_scattering_scale(); + weather_parameters.dust_storm = _weather_parameters.dust_storm(); + return weather_parameters; + } + + /** + * The resulting ROS carla_msgs::msg::CarlaWeatherParameters + */ + const carla_msgs::msg::CarlaWeatherParameters& weather_parameters_msg() const { + return _weather_parameters; + } + +private: + carla_msgs::msg::CarlaWeatherParameters _weather_parameters; +}; +} // namespace types +} // namespace ros2 +} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/rpc/RpcServerInterface.h b/LibCarla/source/carla/rpc/RpcServerInterface.h index e4be9944755..22c414729f5 100644 --- a/LibCarla/source/carla/rpc/RpcServerInterface.h +++ b/LibCarla/source/carla/rpc/RpcServerInterface.h @@ -17,6 +17,7 @@ #include "carla/rpc/ServerSynchronizationTypes.h" #include "carla/rpc/Transform.h" #include "carla/rpc/VehicleTelemetryData.h" +#include "carla/rpc/WeatherParameters.h" #include "carla/streaming/detail/Dispatcher.h" namespace carla { @@ -102,6 +103,16 @@ class RpcServerInterface { /** * @} */ + + /** + * @brief weather related calls + * @{ + */ + virtual Response call_get_weather_parameters() = 0; + virtual Response call_set_weather_parameters(WeatherParameters const &weather_parameters) = 0; + /** + * @} + */ }; } // namespace rpc diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp index 7bbd2813a43..f288b1acc46 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp @@ -253,6 +253,18 @@ class FCarlaServer::FPimpl: public carla::rpc::RpcServerInterface /** * @} */ + + /** + * @brief weather related calls + * @{ + */ + carla::rpc::Response call_get_weather_parameters() override; + carla::rpc::Response call_set_weather_parameters(carla::rpc::WeatherParameters const &weather_parameters) override; + /** + * @} + */ + + void OnClientDisconnected(std::shared_ptr server_session); void OnClientConnected(std::shared_ptr server_session); bool IsNextGameTickAllowed(); @@ -875,25 +887,14 @@ void FCarlaServer::FPimpl::BindActions() BIND_SYNC(get_weather_parameters) << [this]() -> R { REQUIRE_CARLA_EPISODE(); - auto *Weather = Episode->GetWeather(); - if (Weather == nullptr) - { - RESPOND_ERROR("internal error: unable to find weather"); - } - return Weather->GetCurrentWeather(); + return call_get_weather_parameters(); }; BIND_SYNC(set_weather_parameters) << [this]( const cr::WeatherParameters &weather) -> R { REQUIRE_CARLA_EPISODE(); - auto *Weather = Episode->GetWeather(); - if (Weather == nullptr) - { - RESPOND_ERROR("internal error: unable to find weather"); - } - Weather->ApplyWeather(weather); - return R::Success(); + return call_set_weather_parameters(weather); }; // -- IMUI Gravity --------------------------------------------------------- @@ -3692,6 +3693,27 @@ carla::rpc::Response FCarlaServer::FPimpl::call_get_weather_parameters() +{ + auto *Weather = Episode->GetWeather(); + if (Weather == nullptr) + { + RESPOND_ERROR("internal error: unable to find weather"); + } + return Weather->GetCurrentWeather(); +} + +carla::rpc::Response FCarlaServer::FPimpl::call_set_weather_parameters(carla::rpc::WeatherParameters const &weather_parameters) +{ + auto *Weather = Episode->GetWeather(); + if (Weather == nullptr) + { + RESPOND_ERROR("internal error: unable to find weather"); + } + Weather->ApplyWeather(weather_parameters); + return R::Success(); +} + void FCarlaServer::FPimpl::OnClientConnected(std::shared_ptr server_session) { auto const RegisterResponse = ServerSync.RegisterSynchronizationParticipant(SynchronizationClientId()); if ( RegisterResponse ) { @@ -4012,3 +4034,12 @@ carla::rpc::Responsecall_get_synchronization_window_status(); } +carla::rpc::Response FCarlaServer::call_get_weather_parameters() +{ + return Pimpl->call_get_weather_parameters(); +} + +carla::rpc::Response FCarlaServer::call_set_weather_parameters(carla::rpc::WeatherParameters const &weather_parameters) +{ + return Pimpl->call_set_weather_parameters(weather_parameters); +} diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h index 5a83490a13f..3020a1fd39f 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h @@ -138,6 +138,17 @@ class FCarlaServer: public carla::rpc::RpcServerInterface /** * @} */ + + /** + * @brief weather related calls + * @{ + */ + carla::rpc::Response call_get_weather_parameters() override; + carla::rpc::Response call_set_weather_parameters(carla::rpc::WeatherParameters const &weather_parameters) override; + /** + * @} + */ + private: class FPimpl; From 641da24bb4672fd5ae495ccd5279b45b2bd6dcb3 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Fri, 2 Jan 2026 12:38:49 +0100 Subject: [PATCH 11/39] Fix empty CameraInfo message header --- LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc index de9e5653765..20352343a9b 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc @@ -39,8 +39,8 @@ bool UePublisherBaseCamera::SubscribersConnected() const { template void UePublisherBaseCamera::UpdateCameraInfo(const builtin_interfaces::msg::Time &stamp, sensor_msgs::msg::CameraInfo const &camera_info) { - _camera_info->SetMessageHeader(stamp, frame_id()); _camera_info->Message() = camera_info; + _camera_info->SetMessageHeader(stamp, frame_id()); _camera_info->Message().roi().x_offset(0); // up-to-data: constantly 0 _camera_info->Message().roi().y_offset(0); // up-to-data: constantly 0 _camera_info->Message().roi().height(camera_info.height()); From 83d10e25c3a7bd6e1358db34739f23769d21ee85 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 30 Dec 2025 18:18:54 +0100 Subject: [PATCH 12/39] Replace MapPublisher by WorldInfoPublisher Instead of /carla/map /carla/world_info is published as was done in original ROS bridge since quite some time. Ensure, that the map data is quieried within ProcessMessages() Limit history size to 1 --- .../carla/ros2/publishers/MapPublisher.cpp | 33 --------------- .../ros2/publishers/UeWorldPublisher.cpp | 9 +++-- .../carla/ros2/publishers/UeWorldPublisher.h | 4 +- .../ros2/publishers/WorldInfoPublisher.cpp | 40 +++++++++++++++++++ .../{MapPublisher.h => WorldInfoPublisher.h} | 25 ++++++++---- 5 files changed, 65 insertions(+), 46 deletions(-) delete mode 100644 LibCarla/source/carla/ros2/publishers/MapPublisher.cpp create mode 100644 LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp rename LibCarla/source/carla/ros2/publishers/{MapPublisher.h => WorldInfoPublisher.h} (51%) diff --git a/LibCarla/source/carla/ros2/publishers/MapPublisher.cpp b/LibCarla/source/carla/ros2/publishers/MapPublisher.cpp deleted file mode 100644 index c3ba7d5e6ea..00000000000 --- a/LibCarla/source/carla/ros2/publishers/MapPublisher.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "MapPublisher.h" - -#include "carla/ros2/impl/DdsPublisherImpl.h" - -namespace carla { -namespace ros2 { - -MapPublisher::MapPublisher() - : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("map")), - _impl(std::make_shared()) {} - -bool MapPublisher::Init(std::shared_ptr domain_participant) { - return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); -} - -bool MapPublisher::Publish() { - return _impl->Publish(); -} - -bool MapPublisher::SubscribersConnected() const { - return _impl->SubscribersConnected(); -} - -void MapPublisher::UpdateData(std::string const &data) { - _impl->Message().data(data); - _impl->SetMessageUpdated(); -} -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index e64fbc891ec..ef81df12ccb 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -20,7 +20,7 @@ UeWorldPublisher::UeWorldPublisher(carla::rpc::RpcServerInterface& carla_server, _carla_weather_publisher(std::make_shared(_carla_server)), _carla_actor_list_publisher(std::make_shared("actor_list")), _clock_publisher(std::make_shared()), - _map_publisher(std::make_shared()), + _world_info_publisher(std::make_shared(_carla_server)), _objects_publisher(std::make_shared()), _objects_with_covariance_publisher(std::make_shared()), _traffic_lights_publisher(std::make_shared()), @@ -34,7 +34,7 @@ bool UeWorldPublisher::Init(std::shared_ptr domain_par _initialized = _carla_status_publisher->Init(domain_participant) && _carla_weather_publisher->Init(domain_participant) && _carla_actor_list_publisher->Init(domain_participant) && _clock_publisher->Init(domain_participant) && - _map_publisher->Init(domain_participant) && _objects_publisher->Init(domain_participant) && + _world_info_publisher->Init(domain_participant) && _objects_publisher->Init(domain_participant) && _objects_with_covariance_publisher->Init(domain_participant) && _traffic_lights_publisher->Init(domain_participant) && _transform_publisher->Init(domain_participant) && _carla_control_subscriber->Init(domain_participant) && _sync_subscriber->Init(domain_participant) && @@ -46,7 +46,7 @@ bool UeWorldPublisher::Publish() { if (!_initialized) { return false; } - return _clock_publisher->Publish() && _map_publisher->Publish() && _carla_weather_publisher->Publish(); + return _clock_publisher->Publish() && _world_info_publisher->Publish() && _carla_weather_publisher->Publish(); } void UeWorldPublisher::ProcessMessages() { @@ -57,6 +57,7 @@ void UeWorldPublisher::ProcessMessages() { _carla_control_subscriber->ProcessMessages(); _sync_subscriber->ProcessMessages(); _carla_weather_publisher->ProcessMessages(); + _world_info_publisher->ProcessMessages(); _weather_control_subscriber->ProcessMessages(); for (auto& vehicle : _vehicles) { vehicle.second._vehicle_controller->ProcessMessages(); @@ -303,7 +304,7 @@ void UeWorldPublisher::UpdateSensorData( _episode_header = *header_view(buffer_view); if (_episode_header.simulation_state & carla::sensor::s11n::EpisodeStateSerializer::MapChange) { - _map_publisher->UpdateData(_carla_server.call_get_map_data().Get()); + _world_info_publisher->SetMapUpdated(); } for (auto const& actor_dynamic_state : buffer_data_2_vector(buffer_view)) { diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h index a2a60d35fbc..3d1b8527879 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h @@ -8,7 +8,7 @@ #include "carla/ros2/publishers/CarlaActorListPublisher.h" #include "carla/ros2/publishers/CarlaStatusPublisher.h" #include "carla/ros2/publishers/ClockPublisher.h" -#include "carla/ros2/publishers/MapPublisher.h" +#include "carla/ros2/publishers/WorldInfoPublisher.h" #include "carla/ros2/publishers/ObjectsPublisher.h" #include "carla/ros2/publishers/ObjectsWithCovariancePublisher.h" #include "carla/ros2/publishers/TrafficLightPublisher.h" @@ -205,7 +205,7 @@ class UeWorldPublisher : public UePublisherBaseSensor { std::shared_ptr _carla_weather_publisher; std::shared_ptr _carla_actor_list_publisher; std::shared_ptr _clock_publisher; - std::shared_ptr _map_publisher; + std::shared_ptr _world_info_publisher; std::shared_ptr _objects_publisher; std::shared_ptr _objects_with_covariance_publisher; std::shared_ptr _traffic_lights_publisher; diff --git a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp new file mode 100644 index 00000000000..907ed8141ad --- /dev/null +++ b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp @@ -0,0 +1,40 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#include "WorldInfoPublisher.h" + +#include "carla/ros2/impl/DdsPublisherImpl.h" + +namespace carla { +namespace ros2 { + +WorldInfoPublisher::WorldInfoPublisher(carla::rpc::RpcServerInterface &carla_server) + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("world_info")), + _impl(std::make_shared()), + _carla_server(carla_server) {} + +bool WorldInfoPublisher::Init(std::shared_ptr domain_participant) { + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos().keep_last(1)); +} + +bool WorldInfoPublisher::Publish() { + return _impl->Publish(); +} + +bool WorldInfoPublisher::SubscribersConnected() const { + return _impl->SubscribersConnected(); +} + +bool WorldInfoPublisher::ProcessMessages() { + if ( _map_updated ) + { + _impl->Message().map_name(_carla_server.call_get_map_info().Get().name); + _impl->Message().opendrive(_carla_server.call_get_map_data().Get()); + _impl->SetMessageUpdated(); + _map_updated = false; + } + return true; +} +} // namespace ros2 +} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/MapPublisher.h b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.h similarity index 51% rename from LibCarla/source/carla/ros2/publishers/MapPublisher.h rename to LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.h index 2bfeb5e10a2..5b0dbf704e9 100644 --- a/LibCarla/source/carla/ros2/publishers/MapPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.h @@ -7,17 +7,18 @@ #include #include "carla/ros2/publishers/PublisherBase.h" -#include "std_msgs/msg/StringPubSubTypes.h" +#include "carla/rpc/RpcServerInterface.h" +#include "carla_msgs/msg/CarlaWorldInfoPubSubTypes.h" namespace carla { namespace ros2 { -using MapPublisherImpl = DdsPublisherImpl; +using WorldInfoPublisherImpl = DdsPublisherImpl; -class MapPublisher : public PublisherBase { +class WorldInfoPublisher : public PublisherBase { public: - MapPublisher(); - virtual ~MapPublisher() = default; + WorldInfoPublisher(carla::rpc::RpcServerInterface &carla_server); + virtual ~WorldInfoPublisher() = default; /** * Implements ROS2NameRecord::Init() interface @@ -33,10 +34,20 @@ class MapPublisher : public PublisherBase { */ bool SubscribersConnected() const override; - void UpdateData(std::string const &data); + /** + * Perform message processing. + */ + bool ProcessMessages(); + + /** + * Indicate that the map has updated and the server should be quieried for map updates. + */ + void SetMapUpdated() { _map_updated=true; } private: - std::shared_ptr _impl; + std::shared_ptr _impl; + bool _map_updated=false; + carla::rpc::RpcServerInterface &_carla_server; }; } // namespace ros2 } // namespace carla From 8d4bb01ea0043586a75c7b80fcde5539bdb606b4 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 30 Dec 2025 18:27:32 +0100 Subject: [PATCH 13/39] Publish weather only on changes Make publisher transient local --- LibCarla/source/carla/ros2/ROS2QoS.h | 20 ++++++++++++++----- .../carla/ros2/publishers/PublisherBase.h | 4 +--- .../ros2/publishers/PublisherBaseSensor.h | 6 +----- .../ros2/publishers/WeatherPublisher.cpp | 13 ++++++++---- .../carla/ros2/publishers/WeatherPublisher.h | 6 +++--- 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/LibCarla/source/carla/ros2/ROS2QoS.h b/LibCarla/source/carla/ros2/ROS2QoS.h index e3ab7436418..bd5ed1f6bed 100644 --- a/LibCarla/source/carla/ros2/ROS2QoS.h +++ b/LibCarla/source/carla/ros2/ROS2QoS.h @@ -11,11 +11,6 @@ namespace ros2 { /* * Struct providing the most prominent ROS2 ROS2QoS parameters - * Default values are selected to be the default used by the ROS2. - * - * Reliability::RELIABLE - * Durability::VOLATILE - * History::KEEP_LAST, depth: 10u */ struct ROS2QoS { ROS2QoS &keep_last(size_t depth) { @@ -58,15 +53,30 @@ struct ROS2QoS { int32_t _history_depth; }; +/** + * Default ROS2 QoS parameters. + */ static constexpr ROS2QoS DEFAULT_ROS2_QOS{ ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::VOLATILE, ROS2QoS::History::KEEP_LAST, 10}; +/** + * Default ROS2 QoS parameters for sensor data publisher: reliable, volatile, keep_last with history size 10. + * Doesn't allow for transient local subscribers and is best used for regularly updated data. + */ static constexpr ROS2QoS DEFAULT_SENSOR_DATA_QOS{ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::VOLATILE, ROS2QoS::History::KEEP_LAST, 10}; +/** + * Default ROS2 QoS parameters for subscribers: best_effort, volatile, keep_last with history size 10. + * Connects to any publisher configuration. + */ static constexpr ROS2QoS DEFAULT_SUBSCRIBER_QOS{ROS2QoS::Reliability::BEST_EFFORT, ROS2QoS::Durability::VOLATILE, ROS2QoS::History::KEEP_LAST, 10}; +/** + * Default ROS2 QoS parameters for publishers: reliable, transient_local, keep_last with history size 10. + * Connects to any subscriber configuration and is best used for data not updated regularly. + */ static constexpr ROS2QoS DEFAULT_PUBLISHER_QOS{ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::TRANSIENT_LOCAL, ROS2QoS::History::KEEP_LAST, 10}; diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBase.h b/LibCarla/source/carla/ros2/publishers/PublisherBase.h index 13d5b23d8d6..37a72f893d2 100644 --- a/LibCarla/source/carla/ros2/publishers/PublisherBase.h +++ b/LibCarla/source/carla/ros2/publishers/PublisherBase.h @@ -41,9 +41,7 @@ class PublisherBase : public PublisherInterface, public ROS2NameRecord { * that receiption is possible for all possible subscriber configurations. * https://docs.ros.org/en/humble/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-compatibilities * - * Reliability::RELIABLE - * Durability::TRANSIENT_LOCAL - * History::KEEP_LAST, depth: 10u + * see carla::ros2::DEFAULT_PUBLISHER_QOS */ ROS2QoS get_topic_qos() const { return DEFAULT_PUBLISHER_QOS; diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h b/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h index 55238416f5c..cd04136dfa4 100644 --- a/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h +++ b/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h @@ -22,11 +22,7 @@ class PublisherBaseSensor : public PublisherBase { /* * @brief Override ROS2NameRecord::get_topic_qos() for (pseudo) sensor publishers. - * I.e. deploy the rclcpp::SensorDataQoS. - * - * Reliability::BEST_EFFORT - * Durability::VOLATILE - * History::KEEP_LAST, depth: 5u + * I.e. deploy carla::ros2::DEFAULT_SENSOR_DATA_QOS */ ROS2QoS get_topic_qos() const { return DEFAULT_SENSOR_DATA_QOS; diff --git a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp index 8a181abb6f1..737ecccd771 100644 --- a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp @@ -11,13 +11,13 @@ namespace carla { namespace ros2 { WeatherPublisher::WeatherPublisher(carla::rpc::RpcServerInterface &carla_server) - : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("weather")), + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("weather")), _impl(std::make_shared()), _carla_server(carla_server) {} bool WeatherPublisher::Init(std::shared_ptr domain_participant) { - return _impl->Init(domain_participant, get_topic_name(), get_topic_qos()); + return _impl->Init(domain_participant, get_topic_name(), get_topic_qos().keep_last(1)); } bool WeatherPublisher::Publish() { @@ -41,8 +41,13 @@ bool WeatherPublisher::ProcessMessages() { } else { carla::ros2::types::WeatherParameters weather_parameters(response.Get()); - _impl->Message() = weather_parameters.weather_parameters_msg(); - _impl->SetMessageUpdated(); + auto const new_weather_parameters = weather_parameters.weather_parameters_msg(); + if ( new_weather_parameters != _impl->Message()) + { + // send only out if parameters change + _impl->Message() = new_weather_parameters; + _impl->SetMessageUpdated(); + } } } return true; diff --git a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h index f5f99256fd5..374428aa6f2 100644 --- a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/publishers/PublisherBase.h" #include "carla/rpc/RpcServerInterface.h" #include "carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h" @@ -14,7 +14,7 @@ namespace ros2 { using CarlaWeatherParametersPublisherImpl = DdsPublisherImpl; -class WeatherPublisher : public PublisherBaseSensor { +class WeatherPublisher : public PublisherBase { public: WeatherPublisher(carla::rpc::RpcServerInterface &carla_server); virtual ~WeatherPublisher() = default; @@ -39,8 +39,8 @@ class WeatherPublisher : public PublisherBaseSensor { bool ProcessMessages(); private: - carla::rpc::RpcServerInterface &_carla_server; std::shared_ptr _impl; + carla::rpc::RpcServerInterface &_carla_server; }; } // namespace ros2 } // namespace carla From d98feb5aa2d427c7edf175f1567c1dad65fda8d2 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 30 Dec 2025 18:34:38 +0100 Subject: [PATCH 14/39] Removed Mesh from EgoVehicleInfo Because it's too large AND incorrect for animated vehicles. Would require more sophisticated handling to make it proper published in a separate topic. Ensure vehicle telemetry publisher publishes updates. Add carla_version to CarlaWorldInfo. Add trigger_volume to TrafficLightPublisher and fix publishing of wrong entry in TrafficLightsPublisher --- .../carla_msgs/msg/CarlaEgoVehicleInfo.cxx | 82 ++++--------------- .../carla_msgs/msg/CarlaEgoVehicleInfo.h | 27 ------ .../fastdds/carla_msgs/msg/CarlaWorldInfo.cxx | 58 ++++++++++++- .../fastdds/carla_msgs/msg/CarlaWorldInfo.h | 26 ++++++ .../ros2/publishers/TrafficLightPublisher.cpp | 28 ++++--- .../publishers/TrafficLightsPublisher.cpp | 4 +- .../ros2/publishers/VehiclePublisher.cpp | 11 +-- .../carla/ros2/publishers/VehiclePublisher.h | 1 - .../ros2/publishers/WorldInfoPublisher.cpp | 2 + .../source/carla/ros2/types/ActorDefinition.h | 6 +- LibCarla/source/carla/ros2/types/Object.h | 2 +- LibCarla/source/carla/ros2/types/Polygon.h | 11 ++- .../ros2/types/TrafficLightActorDefinition.h | 6 +- .../carla/ros2/types/VehicleActorDefinition.h | 7 +- .../Source/Carla/Actor/ActorDispatcher.cpp | 21 ++--- 15 files changed, 145 insertions(+), 147 deletions(-) diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx index 98eb3216e4c..992175d15ff 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx @@ -36,37 +36,35 @@ using namespace eprosima::fastcdr::exception; carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo() { - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2d52216b + // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@45018215 m_id = 0; - // m_type com.eprosima.idl.parser.typecode.StringTypeCode@242b836 + // m_type com.eprosima.idl.parser.typecode.StringTypeCode@65d6b83b m_type =""; - // m_rolename com.eprosima.idl.parser.typecode.StringTypeCode@3f6f6701 + // m_rolename com.eprosima.idl.parser.typecode.StringTypeCode@d706f19 m_rolename =""; - // m_wheels com.eprosima.idl.parser.typecode.SequenceTypeCode@3527942a + // m_wheels com.eprosima.idl.parser.typecode.SequenceTypeCode@30b7c004 - // m_max_rpm com.eprosima.idl.parser.typecode.PrimitiveTypeCode@942a29c + // m_max_rpm com.eprosima.idl.parser.typecode.PrimitiveTypeCode@79efed2d m_max_rpm = 0.0; - // m_moi com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1ed6388a + // m_moi com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2928854b m_moi = 0.0; - // m_damping_rate_full_throttle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5a45133e + // m_damping_rate_full_throttle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27ae2fd0 m_damping_rate_full_throttle = 0.0; - // m_damping_rate_zero_throttle_clutch_engaged com.eprosima.idl.parser.typecode.PrimitiveTypeCode@534a5a98 + // m_damping_rate_zero_throttle_clutch_engaged com.eprosima.idl.parser.typecode.PrimitiveTypeCode@29176cc1 m_damping_rate_zero_throttle_clutch_engaged = 0.0; - // m_damping_rate_zero_throttle_clutch_disengaged com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f80542f + // m_damping_rate_zero_throttle_clutch_disengaged com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2f177a4b m_damping_rate_zero_throttle_clutch_disengaged = 0.0; - // m_use_gear_autobox com.eprosima.idl.parser.typecode.PrimitiveTypeCode@60bd273d + // m_use_gear_autobox com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4278a03f m_use_gear_autobox = false; - // m_gear_switch_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@121314f7 + // m_gear_switch_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61dd025 m_gear_switch_time = 0.0; - // m_clutch_strength com.eprosima.idl.parser.typecode.PrimitiveTypeCode@130c12b7 + // m_clutch_strength com.eprosima.idl.parser.typecode.PrimitiveTypeCode@124c278f m_clutch_strength = 0.0; - // m_mass com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e600dd5 + // m_mass com.eprosima.idl.parser.typecode.PrimitiveTypeCode@15b204a1 m_mass = 0.0; - // m_drag_coefficient com.eprosima.idl.parser.typecode.PrimitiveTypeCode@576d5deb + // m_drag_coefficient com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77167fb7 m_drag_coefficient = 0.0; - // m_center_of_mass com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5d534f5d - - // m_shape com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2e3967ea + // m_center_of_mass com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1fe20588 } @@ -87,7 +85,6 @@ carla_msgs::msg::CarlaEgoVehicleInfo::~CarlaEgoVehicleInfo() - } carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( @@ -108,7 +105,6 @@ carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( m_mass = x.m_mass; m_drag_coefficient = x.m_drag_coefficient; m_center_of_mass = x.m_center_of_mass; - m_shape = x.m_shape; } carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( @@ -129,7 +125,6 @@ carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( m_mass = x.m_mass; m_drag_coefficient = x.m_drag_coefficient; m_center_of_mass = std::move(x.m_center_of_mass); - m_shape = std::move(x.m_shape); } carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::operator =( @@ -151,7 +146,6 @@ carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::oper m_mass = x.m_mass; m_drag_coefficient = x.m_drag_coefficient; m_center_of_mass = x.m_center_of_mass; - m_shape = x.m_shape; return *this; } @@ -175,7 +169,6 @@ carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::oper m_mass = x.m_mass; m_drag_coefficient = x.m_drag_coefficient; m_center_of_mass = std::move(x.m_center_of_mass); - m_shape = std::move(x.m_shape); return *this; } @@ -184,7 +177,7 @@ bool carla_msgs::msg::CarlaEgoVehicleInfo::operator ==( const CarlaEgoVehicleInfo& x) const { - return (m_id == x.m_id && m_type == x.m_type && m_rolename == x.m_rolename && m_wheels == x.m_wheels && m_max_rpm == x.m_max_rpm && m_moi == x.m_moi && m_damping_rate_full_throttle == x.m_damping_rate_full_throttle && m_damping_rate_zero_throttle_clutch_engaged == x.m_damping_rate_zero_throttle_clutch_engaged && m_damping_rate_zero_throttle_clutch_disengaged == x.m_damping_rate_zero_throttle_clutch_disengaged && m_use_gear_autobox == x.m_use_gear_autobox && m_gear_switch_time == x.m_gear_switch_time && m_clutch_strength == x.m_clutch_strength && m_mass == x.m_mass && m_drag_coefficient == x.m_drag_coefficient && m_center_of_mass == x.m_center_of_mass && m_shape == x.m_shape); + return (m_id == x.m_id && m_type == x.m_type && m_rolename == x.m_rolename && m_wheels == x.m_wheels && m_max_rpm == x.m_max_rpm && m_moi == x.m_moi && m_damping_rate_full_throttle == x.m_damping_rate_full_throttle && m_damping_rate_zero_throttle_clutch_engaged == x.m_damping_rate_zero_throttle_clutch_engaged && m_damping_rate_zero_throttle_clutch_disengaged == x.m_damping_rate_zero_throttle_clutch_disengaged && m_use_gear_autobox == x.m_use_gear_autobox && m_gear_switch_time == x.m_gear_switch_time && m_clutch_strength == x.m_clutch_strength && m_mass == x.m_mass && m_drag_coefficient == x.m_drag_coefficient && m_center_of_mass == x.m_center_of_mass); } bool carla_msgs::msg::CarlaEgoVehicleInfo::operator !=( @@ -244,7 +237,6 @@ size_t carla_msgs::msg::CarlaEgoVehicleInfo::getMaxCdrSerializedSize( current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - current_alignment += shape_msgs::msg::SolidPrimitive::getMaxCdrSerializedSize(current_alignment); return current_alignment - initial_alignment; } @@ -302,7 +294,6 @@ size_t carla_msgs::msg::CarlaEgoVehicleInfo::getCdrSerializedSize( current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.center_of_mass(), current_alignment); - current_alignment += shape_msgs::msg::SolidPrimitive::getCdrSerializedSize(data.shape(), current_alignment); return current_alignment - initial_alignment; } @@ -326,7 +317,6 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::serialize( scdr << m_mass; scdr << m_drag_coefficient; scdr << m_center_of_mass; - scdr << m_shape; } @@ -349,7 +339,6 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::deserialize( dcdr >> m_mass; dcdr >> m_drag_coefficient; dcdr >> m_center_of_mass; - dcdr >> m_shape; } /*! @@ -808,43 +797,6 @@ geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mas { return m_center_of_mass; } -/*! - * @brief This function copies the value in member shape - * @param _shape New value to be copied in member shape - */ -void carla_msgs::msg::CarlaEgoVehicleInfo::shape( - const shape_msgs::msg::SolidPrimitive& _shape) -{ - m_shape = _shape; -} - -/*! - * @brief This function moves the value in member shape - * @param _shape New value to be moved in member shape - */ -void carla_msgs::msg::CarlaEgoVehicleInfo::shape( - shape_msgs::msg::SolidPrimitive&& _shape) -{ - m_shape = std::move(_shape); -} - -/*! - * @brief This function returns a constant reference to member shape - * @return Constant reference to member shape - */ -const shape_msgs::msg::SolidPrimitive& carla_msgs::msg::CarlaEgoVehicleInfo::shape() const -{ - return m_shape; -} - -/*! - * @brief This function returns a reference to member shape - * @return Reference to member shape - */ -shape_msgs::msg::SolidPrimitive& carla_msgs::msg::CarlaEgoVehicleInfo::shape() -{ - return m_shape; -} size_t carla_msgs::msg::CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize( size_t current_alignment) @@ -865,7 +817,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - + } diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h index 923e20609b7..3f791f8ded2 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h @@ -23,7 +23,6 @@ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_H_ #include "carla_msgs/msg/CarlaEgoVehicleInfoWheel.h" -#include "shape_msgs/msg/SolidPrimitive.h" #include #include @@ -434,31 +433,6 @@ namespace carla_msgs { * @return Reference to member center_of_mass */ eProsima_user_DllExport geometry_msgs::msg::Vector3& center_of_mass(); - /*! - * @brief This function copies the value in member shape - * @param _shape New value to be copied in member shape - */ - eProsima_user_DllExport void shape( - const shape_msgs::msg::SolidPrimitive& _shape); - - /*! - * @brief This function moves the value in member shape - * @param _shape New value to be moved in member shape - */ - eProsima_user_DllExport void shape( - shape_msgs::msg::SolidPrimitive&& _shape); - - /*! - * @brief This function returns a constant reference to member shape - * @return Constant reference to member shape - */ - eProsima_user_DllExport const shape_msgs::msg::SolidPrimitive& shape() const; - - /*! - * @brief This function returns a reference to member shape - * @return Reference to member shape - */ - eProsima_user_DllExport shape_msgs::msg::SolidPrimitive& shape(); /*! * @brief This function returns the maximum serialized size of an object @@ -534,7 +508,6 @@ namespace carla_msgs { float m_mass; float m_drag_coefficient; geometry_msgs::msg::Vector3 m_center_of_mass; - shape_msgs::msg::SolidPrimitive m_shape; }; } // namespace msg } // namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx index 00c1a7c5422..e7080d1379e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx @@ -36,9 +36,11 @@ using namespace eprosima::fastcdr::exception; carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo() { - // m_map_name com.eprosima.idl.parser.typecode.StringTypeCode@6e15fe2 + // m_carla_version com.eprosima.idl.parser.typecode.StringTypeCode@45afc369 + m_carla_version =""; + // m_map_name com.eprosima.idl.parser.typecode.StringTypeCode@799d4f69 m_map_name =""; - // m_opendrive com.eprosima.idl.parser.typecode.StringTypeCode@68f1b17f + // m_opendrive com.eprosima.idl.parser.typecode.StringTypeCode@49c43f4e m_opendrive =""; } @@ -46,11 +48,13 @@ carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo() carla_msgs::msg::CarlaWorldInfo::~CarlaWorldInfo() { + } carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo( const CarlaWorldInfo& x) { + m_carla_version = x.m_carla_version; m_map_name = x.m_map_name; m_opendrive = x.m_opendrive; } @@ -58,6 +62,7 @@ carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo( carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo( CarlaWorldInfo&& x) { + m_carla_version = std::move(x.m_carla_version); m_map_name = std::move(x.m_map_name); m_opendrive = std::move(x.m_opendrive); } @@ -66,6 +71,7 @@ carla_msgs::msg::CarlaWorldInfo& carla_msgs::msg::CarlaWorldInfo::operator =( const CarlaWorldInfo& x) { + m_carla_version = x.m_carla_version; m_map_name = x.m_map_name; m_opendrive = x.m_opendrive; @@ -76,6 +82,7 @@ carla_msgs::msg::CarlaWorldInfo& carla_msgs::msg::CarlaWorldInfo::operator =( CarlaWorldInfo&& x) { + m_carla_version = std::move(x.m_carla_version); m_map_name = std::move(x.m_map_name); m_opendrive = std::move(x.m_opendrive); @@ -86,7 +93,7 @@ bool carla_msgs::msg::CarlaWorldInfo::operator ==( const CarlaWorldInfo& x) const { - return (m_map_name == x.m_map_name && m_opendrive == x.m_opendrive); + return (m_carla_version == x.m_carla_version && m_map_name == x.m_map_name && m_opendrive == x.m_opendrive); } bool carla_msgs::msg::CarlaWorldInfo::operator !=( @@ -105,6 +112,8 @@ size_t carla_msgs::msg::CarlaWorldInfo::getMaxCdrSerializedSize( current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + return current_alignment - initial_alignment; } @@ -117,6 +126,8 @@ size_t carla_msgs::msg::CarlaWorldInfo::getCdrSerializedSize( size_t initial_alignment = current_alignment; + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.carla_version().size() + 1; + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.map_name().size() + 1; current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.opendrive().size() + 1; @@ -129,6 +140,7 @@ void carla_msgs::msg::CarlaWorldInfo::serialize( eprosima::fastcdr::Cdr& scdr) const { + scdr << m_carla_version; scdr << m_map_name; scdr << m_opendrive; @@ -138,10 +150,48 @@ void carla_msgs::msg::CarlaWorldInfo::deserialize( eprosima::fastcdr::Cdr& dcdr) { + dcdr >> m_carla_version; dcdr >> m_map_name; dcdr >> m_opendrive; } +/*! + * @brief This function copies the value in member carla_version + * @param _carla_version New value to be copied in member carla_version + */ +void carla_msgs::msg::CarlaWorldInfo::carla_version( + const std::string& _carla_version) +{ + m_carla_version = _carla_version; +} + +/*! + * @brief This function moves the value in member carla_version + * @param _carla_version New value to be moved in member carla_version + */ +void carla_msgs::msg::CarlaWorldInfo::carla_version( + std::string&& _carla_version) +{ + m_carla_version = std::move(_carla_version); +} + +/*! + * @brief This function returns a constant reference to member carla_version + * @return Constant reference to member carla_version + */ +const std::string& carla_msgs::msg::CarlaWorldInfo::carla_version() const +{ + return m_carla_version; +} + +/*! + * @brief This function returns a reference to member carla_version + * @return Reference to member carla_version + */ +std::string& carla_msgs::msg::CarlaWorldInfo::carla_version() +{ + return m_carla_version; +} /*! * @brief This function copies the value in member map_name * @param _map_name New value to be copied in member map_name @@ -236,7 +286,7 @@ void carla_msgs::msg::CarlaWorldInfo::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - + } diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h index 2bf1f07a233..26caf4d0810 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h @@ -123,6 +123,31 @@ namespace carla_msgs { eProsima_user_DllExport bool operator !=( const CarlaWorldInfo& x) const; + /*! + * @brief This function copies the value in member carla_version + * @param _carla_version New value to be copied in member carla_version + */ + eProsima_user_DllExport void carla_version( + const std::string& _carla_version); + + /*! + * @brief This function moves the value in member carla_version + * @param _carla_version New value to be moved in member carla_version + */ + eProsima_user_DllExport void carla_version( + std::string&& _carla_version); + + /*! + * @brief This function returns a constant reference to member carla_version + * @return Constant reference to member carla_version + */ + eProsima_user_DllExport const std::string& carla_version() const; + + /*! + * @brief This function returns a reference to member carla_version + * @return Reference to member carla_version + */ + eProsima_user_DllExport std::string& carla_version(); /*! * @brief This function copies the value in member map_name * @param _map_name New value to be copied in member map_name @@ -233,6 +258,7 @@ namespace carla_msgs { private: + std::string m_carla_version; std::string m_map_name; std::string m_opendrive; }; diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp index 07cf94803bf..50f7782deaf 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp @@ -21,10 +21,8 @@ TrafficLightPublisher::TrafficLightPublisher( _traffic_light_object_publisher(std::make_shared(*this, objects_publisher)), _traffic_light_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)), _traffic_lights_publisher(traffic_lights_publisher) { - // prefill some traffic_light info data - _traffic_light_info->Message().id(traffic_light_actor_definition->id); - // TODO: add respective data to actor definitions - // _traffic_light_info->Message().trigger_volume(??); + + _traffic_light_status->Message().state(carla_msgs::msg::CarlaTrafficLightStatus_Constants::UNKNOWN); } bool TrafficLightPublisher::Init(std::shared_ptr domain_participant) { @@ -37,10 +35,7 @@ bool TrafficLightPublisher::Init(std::shared_ptr domai } bool TrafficLightPublisher::Publish() { - if (_traffic_light_info_initialized && (!_traffic_light_info_published)) { - _traffic_light_info_published = _traffic_light_info->Publish(); - } - bool success = _traffic_light_info_published; + bool success = _traffic_light_info->Publish(); success &= _traffic_light_status->Publish(); success &= _traffic_light_object_publisher->Publish(); success &= _traffic_light_object_with_covariance_publisher->Publish(); @@ -54,9 +49,22 @@ bool TrafficLightPublisher::SubscribersConnected() const { void TrafficLightPublisher::UpdateTrafficLight(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &actor_dynamic_state) { - if (!_traffic_light_info_initialized) { + if ( (!_traffic_light_info_initialized) || (_traffic_light_info->Message().transform() != object->Transform().pose())) { _traffic_light_info_initialized = true; + _traffic_light_info->Message().id(object->Id()); _traffic_light_info->Message().transform(object->Transform().pose()); + // trigger volume + auto traffic_light_actor_definition = std::dynamic_pointer_cast(_actor_name_definition); + auto global_location = traffic_light_actor_definition->trigger_volume.location; + object->Transform().GetTransform().TransformPoint(global_location); + _traffic_light_info->Message().trigger_volume().center().x(global_location.x); + _traffic_light_info->Message().trigger_volume().center().y(global_location.y); + _traffic_light_info->Message().trigger_volume().center().z(global_location.z); + auto const ros_extent = traffic_light_actor_definition->trigger_volume.extent * 2.; + _traffic_light_info->Message().trigger_volume().size().x(ros_extent.x); + _traffic_light_info->Message().trigger_volume().size().y(ros_extent.y); + _traffic_light_info->Message().trigger_volume().size().z(ros_extent.z); + _traffic_light_info->SetMessageUpdated(); _traffic_lights_publisher->UpdateTrafficLightInfo(_traffic_light_info->Message()); } @@ -65,11 +73,11 @@ void TrafficLightPublisher::UpdateTrafficLight(std::shared_ptrSetMessageHeader(object->Timestamp().time(), "map"); _traffic_light_status->Message().id(_traffic_light_info->Message().id()); _traffic_light_status->Message().state(carla::ros2::types::GetTrafficLightState(actor_dynamic_state)); + _traffic_lights_publisher->UpdateTrafficLightStatus(_traffic_light_status->Message()); } _traffic_light_object_publisher->UpdateObject(object); _traffic_light_object_with_covariance_publisher->UpdateObject(object); - _traffic_lights_publisher->UpdateTrafficLightStatus(_traffic_light_status->Message()); } } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp index cde99429d3a..67d825acb6c 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp @@ -17,9 +17,9 @@ TrafficLightsPublisher::TrafficLightsPublisher() bool TrafficLightsPublisher::Init(std::shared_ptr domain_participant) { return _traffic_light_info->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name("info"), - PublisherBase::get_topic_qos()) && + PublisherBase::get_topic_qos().keep_last(1)) && _traffic_light_status->InitHistoryPreallocatedWithReallocMemoryMode( - domain_participant, get_topic_name("status"), PublisherBase::get_topic_qos()); + domain_participant, get_topic_name("status"), PublisherBase::get_topic_qos().keep_last(1)); } bool TrafficLightsPublisher::Publish() { diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp index 61b20f8ef11..0c6a376a411 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -31,10 +31,6 @@ VehiclePublisher::VehiclePublisher(std::shared_ptrMessage().id(vehicle_actor_definition->id); _vehicle_info_publisher->Message().type(vehicle_actor_definition->type_id); _vehicle_info_publisher->Message().rolename(vehicle_actor_definition->role_name); - _vehicle_info_publisher->Message().shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); - auto const ros_extent = vehicle_actor_definition->bounding_box.extent * 2.f; - _vehicle_info_publisher->Message().shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); - _vehicle_info_publisher->Message().shape().polygon().points(*vehicle_actor_definition->vertex_polygon.polygon()); for (auto wheel : vehicle_actor_definition->vehicle_physics_control.GetWheels()) { auto wheel_info = carla_msgs::msg::CarlaEgoVehicleInfoWheel(); wheel_info.tire_friction(wheel.tire_friction); @@ -80,10 +76,7 @@ bool VehiclePublisher::Init(std::shared_ptr domain_par } bool VehiclePublisher::Publish() { - if (!_vehicle_info_published) { - _vehicle_info_published = _vehicle_info_publisher->Publish(); - } - bool success = _vehicle_info_published; + bool success = _vehicle_info_publisher->Publish(); success &= _vehicle_status_publisher->Publish(); success &= _vehicle_odometry_publisher->Publish(); success &= _vehicle_speed_publisher->Publish(); @@ -137,6 +130,8 @@ bool VehiclePublisher::ProcessMessages() { wheel_msg.normalized_lat_force(wheel.normalized_lat_force); _vehicle_telemetry_publisher->Message().wheels().push_back(wheel_msg); } + + _vehicle_telemetry_publisher->SetMessageUpdated(); } } return true; diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h index 77d5624b783..97aea7e9b54 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h @@ -68,7 +68,6 @@ class VehiclePublisher : public PublisherBaseTransform { private: carla::rpc::RpcServerInterface &_carla_server; std::shared_ptr _vehicle_info_publisher; - bool _vehicle_info_published{false}; std::shared_ptr _vehicle_status_publisher; std::shared_ptr _vehicle_odometry_publisher; std::shared_ptr _vehicle_speed_publisher; diff --git a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp index 907ed8141ad..68ba9d1f2bb 100644 --- a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp @@ -5,6 +5,7 @@ #include "WorldInfoPublisher.h" #include "carla/ros2/impl/DdsPublisherImpl.h" +#include "carla/Version.h" namespace carla { namespace ros2 { @@ -29,6 +30,7 @@ bool WorldInfoPublisher::SubscribersConnected() const { bool WorldInfoPublisher::ProcessMessages() { if ( _map_updated ) { + _impl->Message().carla_version(carla::version()); _impl->Message().map_name(_carla_server.call_get_map_info().Get().name); _impl->Message().opendrive(_carla_server.call_get_map_data().Get()); _impl->SetMessageUpdated(); diff --git a/LibCarla/source/carla/ros2/types/ActorDefinition.h b/LibCarla/source/carla/ros2/types/ActorDefinition.h index 234cf2f8d2b..bc3dd03e248 100644 --- a/LibCarla/source/carla/ros2/types/ActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/ActorDefinition.h @@ -16,9 +16,8 @@ namespace types { using ActorSetTransformCallback = std::function; struct ActorDefinition : public ActorNameDefinition { - ActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox bounding_box_, - carla::ros2::types::Polygon vertex_polygon_) - : ActorNameDefinition(actor_name_definition), bounding_box(bounding_box_), vertex_polygon(vertex_polygon_) + ActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox bounding_box_) + : ActorNameDefinition(actor_name_definition), bounding_box(bounding_box_) { if ( std::fpclassify(bounding_box.extent.x) != FP_NORMAL ) { @@ -29,7 +28,6 @@ struct ActorDefinition : public ActorNameDefinition { } carla::geom::BoundingBox bounding_box; - carla::ros2::types::Polygon vertex_polygon; }; diff --git a/LibCarla/source/carla/ros2/types/Object.h b/LibCarla/source/carla/ros2/types/Object.h index 0b2883f85c7..5390f7e845d 100644 --- a/LibCarla/source/carla/ros2/types/Object.h +++ b/LibCarla/source/carla/ros2/types/Object.h @@ -181,7 +181,6 @@ class Object { object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); auto const ros_extent = _bounding_box.extent * 2.f; object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); - //object.shape().polygon().points(*Polygon(_bounding_box.GetLocalVertices()).polygon()); } else { object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX_X); } @@ -246,6 +245,7 @@ class Object { return _actor_name_definition->carla_actor_info(name_registry); } + carla::streaming::detail::actor_id_type Id() { return _actor_name_definition->id; } private: std::shared_ptr _actor_name_definition; uint8_t _classification{derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN}; diff --git a/LibCarla/source/carla/ros2/types/Polygon.h b/LibCarla/source/carla/ros2/types/Polygon.h index 16227c03e07..8b90481c927 100644 --- a/LibCarla/source/carla/ros2/types/Polygon.h +++ b/LibCarla/source/carla/ros2/types/Polygon.h @@ -36,15 +36,14 @@ class Polygon { _ros_polygon->push_back(CoordinateSystemTransform::TransformLocationToPoint32Msg(vertex)); } } -#ifdef LIBCARLA_INCLUDED_FROM_UE4 - Polygon() : _ros_polygon(std::make_shared>()) {} - void SetGlobalVertices(TArray const &vertices) { - _ros_polygon->reserve(vertices.Num()); + + Polygon(std::vector const &vertices) + : _ros_polygon(std::make_shared>()) { + _ros_polygon->reserve(vertices.size()); for (auto const &vertex : vertices) { - _ros_polygon->push_back(CoordinateSystemTransform::TransformLocationToPoint32Msg(carla::geom::Location(vertex))); + _ros_polygon->push_back(CoordinateSystemTransform::TransformLocationToPoint32Msg(vertex)); } } -#endif // LIBCARLA_INCLUDED_FROM_UE4 ~Polygon() = default; Polygon(const Polygon &) = default; diff --git a/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h b/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h index 0c6b8aa5b65..42a33ae2d57 100644 --- a/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h @@ -29,7 +29,11 @@ inline uint8_t GetTrafficLightState(carla::sensor::data::ActorDynamicState const } struct TrafficLightActorDefinition : public ActorDefinition { - TrafficLightActorDefinition(ActorDefinition const &actor_definitions) : ActorDefinition(actor_definitions) {} + TrafficLightActorDefinition(ActorDefinition const &actor_definitions, carla::geom::BoundingBox const &trigger_volume_in) + : ActorDefinition(actor_definitions) + , trigger_volume(trigger_volume_in) {} + + carla::geom::BoundingBox trigger_volume; }; } // namespace types } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h b/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h index d6fdcb6405e..08cbc92090c 100644 --- a/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h @@ -7,6 +7,7 @@ #include #include "carla/ros2/types/ActorDefinition.h" +#include "carla/ros2/types/Polygon.h" #include "carla/ros2/types/VehicleAckermannControl.h" #include "carla/ros2/types/VehicleControl.h" #include "carla/rpc/VehiclePhysicsControl.h" @@ -32,8 +33,10 @@ inline uint8_t GetVehicleControlType(carla::sensor::data::ActorDynamicState cons } struct VehicleActorDefinition : public ActorDefinition { - VehicleActorDefinition(ActorDefinition const &actor_definition, rpc::VehiclePhysicsControl vehicle_physics_control_in) - : ActorDefinition(actor_definition), vehicle_physics_control(vehicle_physics_control_in) {} + VehicleActorDefinition(ActorDefinition const &actor_definition, + rpc::VehiclePhysicsControl vehicle_physics_control_in) + : ActorDefinition(actor_definition) + , vehicle_physics_control(vehicle_physics_control_in) {} rpc::VehiclePhysicsControl vehicle_physics_control; }; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp index 6bdd201e782..988f945257a 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp @@ -292,13 +292,8 @@ void RegisterActorROS2(std::shared_ptr ROS2, FCarlaActor* Car auto VehicleActorDefinition = std::make_shared( carla::ros2::types::ActorDefinition(ActorNameDefinition, - CarlaActor->GetActorInfo()->BoundingBox, - carla::ros2::types::Polygon()), + CarlaActor->GetActorInfo()->BoundingBox), PhysicsControl); - auto SkeletalMeshComponent = Vehicle->GetMesh(); - if (SkeletalMeshComponent != nullptr) { - VehicleActorDefinition->vertex_polygon.SetGlobalVertices(UBoundingBoxCalculator::GetSkeletalMeshVertices(SkeletalMeshComponent->SkeletalMesh)); - } carla::ros2::types::VehicleControlCallback VehicleControlCallback = [Vehicle](carla::ros2::types::VehicleControl const &Source) -> void { EVehicleInputPriority InputPriority = EVehicleInputPriority(Source.ControlPriority()); @@ -321,12 +316,7 @@ void RegisterActorROS2(std::shared_ptr ROS2, FCarlaActor* Car else if ( Walker != nullptr ) { auto WalkerActorDefinition = std::make_shared( carla::ros2::types::ActorDefinition(ActorNameDefinition, - CarlaActor->GetActorInfo()->BoundingBox, - carla::ros2::types::Polygon())); - auto SkeletalMeshComponent = Walker->GetMesh(); - if (SkeletalMeshComponent != nullptr) { - WalkerActorDefinition->vertex_polygon.SetGlobalVertices(UBoundingBoxCalculator::GetSkeletalMeshVertices(SkeletalMeshComponent->SkeletalMesh)); - } + CarlaActor->GetActorInfo()->BoundingBox)); auto WalkerController = Cast(Walker->GetController()); carla::ros2::types::WalkerControlCallback walker_control_callback = [WalkerController](carla::ros2::types::WalkerControl const &Source) -> void { @@ -336,17 +326,16 @@ void RegisterActorROS2(std::shared_ptr ROS2, FCarlaActor* Car ROS2->AddWalkerUe(WalkerActorDefinition, walker_control_callback); } else if ( TrafficLight != nullptr ) { + auto TrafficLightTriggerVolume = UBoundingBoxCalculator::GetTrafficSignTriggerVolume(TrafficLight); auto TrafficLightActorDefinition = std::make_shared( carla::ros2::types::ActorDefinition(ActorNameDefinition, - CarlaActor->GetActorInfo()->BoundingBox, - carla::ros2::types::Polygon())); + CarlaActor->GetActorInfo()->BoundingBox), TrafficLightTriggerVolume); ROS2->AddTrafficLightUe(TrafficLightActorDefinition); } else if ( TrafficSign != nullptr ) { auto TrafficSignActorDefinition = std::make_shared( carla::ros2::types::ActorDefinition(ActorNameDefinition, - CarlaActor->GetActorInfo()->BoundingBox, - carla::ros2::types::Polygon()) + CarlaActor->GetActorInfo()->BoundingBox) ); ROS2->AddTrafficSignUe(TrafficSignActorDefinition); } From c9087a71a6fa7e8da438eb512f2db69b48cd218f Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Fri, 2 Jan 2026 18:32:48 +0100 Subject: [PATCH 15/39] Consider update to libfoonathan_memory 0.7.4 --- Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs index 5a91270d08d..d0c4d8ab9ec 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs @@ -336,7 +336,7 @@ private void AddCarlaServerDependency(ReadOnlyTargetRules Target) } if (UsingRos2) { - PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfoonathan_memory-0.7.3.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfoonathan_memory-0.7.4.a")); PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfastcdr.a")); PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfastrtps.a")); } From 18855a3c17be4d562d9ea1534d1f06900d71ab72 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 6 Jan 2026 10:02:14 +0100 Subject: [PATCH 16/39] Revert "Consider update to libfoonathan_memory 0.7.4" This reverts commit c9087a71a6fa7e8da438eb512f2db69b48cd218f. --- Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs index d0c4d8ab9ec..5a91270d08d 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Carla.Build.cs @@ -336,7 +336,7 @@ private void AddCarlaServerDependency(ReadOnlyTargetRules Target) } if (UsingRos2) { - PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfoonathan_memory-0.7.4.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfoonathan_memory-0.7.3.a")); PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfastcdr.a")); PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libfastrtps.a")); } From 166b906d68898d8b79dbc883a3b6980eb1bcc6ee Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Mon, 12 Jan 2026 20:32:18 +0100 Subject: [PATCH 17/39] Fix some publishing issues Fix: Always publish TFs of sensors Previously TFs of sensors were only published if subscribers were connected, because TF publishing for sensors relied on active sensor streams. Moved sensor handling code from ROS2 class to UeWorldPublisher to be able to publish TFs of sensors while updating the actors when required. Fix: Consider rotation on ROS2 SpawnObject calls Fix: Ensure topics (i.e. rarely updated with transient local) are actually published at DDS level, even if no subscribers are connected at publishing time Fix: Publish also the sensor data with transient local to be most compatible with any receiver configuration. I.e. ensure receivers are able to apply a history size to prevent from frame drops on high system loads. Fix: Internal order on object publishing: first update the object data, then publish (previously data of the last frame were published) Fix: Consider ros_frame_id and ros_publish_tf blueprint parameters Added Verbose Logging and moved logs recurring on every frame to verbose Added publishing of EnvironmentObjects. Allow more flexible Object publishing to support dynamic objects, barely changing dynamic objects (traffic signs, lights) as well as static Environment Objects. Replaced publishing of object data of individual traffic_lights/signs by a grouped object publisher for those (commented the old individual publishing behavior by #ifdef) and removed the covariance object publishing version of these. Expand CarlaActorInfo.msg data to give the user more insights into actor configuration. Expand CarlaEgoVehicleTelemetryData.msg to transport the vehicles light state flags --- LibCarla/source/carla/Buffer.cpp | 2 +- LibCarla/source/carla/Buffer.h | 2 +- LibCarla/source/carla/Logging.h | 16 + LibCarla/source/carla/geom/Location.h | 13 + LibCarla/source/carla/geom/Quaternion.h | 11 + LibCarla/source/carla/geom/Rotation.h | 13 +- LibCarla/source/carla/geom/Transform.h | 12 + LibCarla/source/carla/ros2/ROS2.cpp | 334 +--------- LibCarla/source/carla/ros2/ROS2.h | 40 +- LibCarla/source/carla/ros2/ROS2NameRecord.cpp | 4 + LibCarla/source/carla/ros2/ROS2NameRecord.h | 2 + .../source/carla/ros2/ROS2NameRegistry.cpp | 57 +- LibCarla/source/carla/ros2/ROS2NameRegistry.h | 8 +- LibCarla/source/carla/ros2/ROS2QoS.h | 18 +- .../ros2/ROS2TopicVisibilityDefaultMode.h | 19 + .../carla/ros2/impl/DdsPublisherImpl.h | 8 +- .../fastdds/carla_msgs/msg/CarlaActorInfo.cxx | 263 ++++++-- .../fastdds/carla_msgs/msg/CarlaActorInfo.h | 155 ++++- .../msg/CarlaActorInfoPubSubTypes.cxx | 68 +- .../msg/CarlaActorInfoPubSubTypes.h | 46 +- .../msg/CarlaEgoVehicleTelemetryData.cxx | 134 ++-- .../msg/CarlaEgoVehicleTelemetryData.h | 71 ++- ...arlaEgoVehicleTelemetryDataPubSubTypes.cxx | 51 +- .../CarlaEgoVehicleTelemetryDataPubSubTypes.h | 30 +- .../msg/CarlaEgoVehicleTelemetryDataWheel.cxx | 82 +-- .../msg/CarlaEgoVehicleTelemetryDataWheel.h | 36 +- ...goVehicleTelemetryDataWheelPubSubTypes.cxx | 34 +- ...aEgoVehicleTelemetryDataWheelPubSubTypes.h | 51 +- .../carla/ros2/publishers/ObjectPublisher.cpp | 4 +- .../carla/ros2/publishers/ObjectPublisher.h | 2 +- .../ObjectWithCovariancePublisher.cpp | 4 +- .../ObjectWithCovariancePublisher.h | 2 +- .../ros2/publishers/ObjectsPublisher.cpp | 44 +- .../carla/ros2/publishers/ObjectsPublisher.h | 20 +- .../ObjectsWithCovariancePublisher.cpp | 2 +- .../ObjectsWithCovariancePublisher.h | 2 +- .../carla/ros2/publishers/PublisherBase.h | 18 +- .../ros2/publishers/PublisherBaseSensor.h | 8 - .../ros2/publishers/TrafficLightPublisher.cpp | 114 ++-- .../ros2/publishers/TrafficLightPublisher.h | 17 +- .../ros2/publishers/TrafficSignPublisher.cpp | 39 +- .../ros2/publishers/TrafficSignPublisher.h | 13 +- .../ros2/publishers/UeWorldPublisher.cpp | 593 ++++++++++++++++-- .../carla/ros2/publishers/UeWorldPublisher.h | 75 ++- .../ros2/publishers/VehiclePublisher.cpp | 19 +- .../carla/ros2/publishers/VehiclePublisher.h | 2 +- .../carla/ros2/publishers/WalkerPublisher.cpp | 2 +- .../carla/ros2/publishers/WalkerPublisher.h | 2 +- .../ros2/services/SpawnObjectService.cpp | 5 +- .../ActorSetTransformSubscriber.cpp | 3 +- .../source/carla/ros2/types/ActorDefinition.h | 28 +- .../carla/ros2/types/ActorNameDefinition.cpp | 40 +- .../carla/ros2/types/ActorNameDefinition.h | 100 ++- LibCarla/source/carla/ros2/types/Object.h | 172 +++-- .../ros2/types/TrafficLightActorDefinition.h | 4 +- .../ros2/types/TrafficSignActorDefinition.h | 3 +- LibCarla/source/carla/ros2/types/Transform.h | 94 ++- .../carla/ros2/types/VehicleActorDefinition.h | 4 +- .../carla/ros2/types/WalkerActorDefinition.h | 3 +- LibCarla/source/carla/rpc/EnvironmentObject.h | 6 + LibCarla/source/carla/rpc/ObjectLabel.h | 42 +- .../source/carla/rpc/RpcServerInterface.h | 27 +- .../sensor/data/SerializerVectorAllocator.h | 12 +- .../source/carla/streaming/detail/Message.h | 4 +- .../carla/streaming/detail/MultiStreamState.h | 6 +- .../streaming/detail/tcp/ServerSession.cpp | 2 +- .../Source/Carla/Actor/ActorDispatcher.cpp | 42 +- .../Carla/Source/Carla/Game/CarlaEngine.cpp | 2 +- .../Carla/Source/Carla/Server/CarlaServer.cpp | 142 +++-- .../Carla/Source/Carla/Server/CarlaServer.h | 12 + 70 files changed, 2284 insertions(+), 1031 deletions(-) create mode 100644 LibCarla/source/carla/ros2/ROS2TopicVisibilityDefaultMode.h diff --git a/LibCarla/source/carla/Buffer.cpp b/LibCarla/source/carla/Buffer.cpp index 4dedc2badad..e88adada0dd 100644 --- a/LibCarla/source/carla/Buffer.cpp +++ b/LibCarla/source/carla/Buffer.cpp @@ -7,7 +7,7 @@ namespace carla { void Buffer::ReuseThisBuffer() { auto pool = _parent_pool.lock(); if (pool != nullptr) { - log_debug("Buffer[", static_cast(_data.get()), ":", _size, "]::ReuseThisBuffer() returning buffer to pool:", pool.get()); + log_verbose("Buffer[", static_cast(_data.get()), ":", _size, "]::ReuseThisBuffer() returning buffer to pool:", pool.get()); pool->Push(std::move(*this)); } } diff --git a/LibCarla/source/carla/Buffer.h b/LibCarla/source/carla/Buffer.h index ed6baf750d1..3c56f942f23 100644 --- a/LibCarla/source/carla/Buffer.h +++ b/LibCarla/source/carla/Buffer.h @@ -253,7 +253,7 @@ namespace carla { if (_capacity < size) { _data = std::make_unique(size); _capacity = size; - log_debug("Buffer[", static_cast(_data.get()), ":", size, "]::reset() Allocated buffer data (old size: ", _size, ")"); + log_verbose("Buffer[", static_cast(_data.get()), ":", size, "]::reset() Allocated buffer data (old size: ", _size, ")"); } _size = size; } diff --git a/LibCarla/source/carla/Logging.h b/LibCarla/source/carla/Logging.h index 20ac048fb19..05a9daadfd0 100644 --- a/LibCarla/source/carla/Logging.h +++ b/LibCarla/source/carla/Logging.h @@ -8,6 +8,7 @@ #include "carla/Platform.h" +#define LIBCARLA_LOG_LEVEL_VERBOSE 1 #define LIBCARLA_LOG_LEVEL_DEBUG 10 #define LIBCARLA_LOG_LEVEL_INFO 20 #define LIBCARLA_LOG_LEVEL_WARNING 30 @@ -62,6 +63,21 @@ namespace logging { } // namespace logging +#if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_VERBOSE + + template + static inline void log_verbose(Args && ... args) { + logging::write_to_stream(std::cout, "VERBOSE:", std::forward(args) ..., '\n'); + } + +#else + + template + static inline void log_verbose(Args && ...) {} + +#endif + + #if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_DEBUG template diff --git a/LibCarla/source/carla/geom/Location.h b/LibCarla/source/carla/geom/Location.h index 4169e97dd4e..b05705094a9 100644 --- a/LibCarla/source/carla/geom/Location.h +++ b/LibCarla/source/carla/geom/Location.h @@ -6,6 +6,9 @@ #pragma once +#include +#include + #include "carla/geom/Vector3D.h" #include "carla/geom/Vector3DInt.h" #include "carla/geom/Math.h" @@ -108,3 +111,13 @@ namespace geom { } // namespace geom } // namespace carla + +namespace std { + +inline std::string to_string(carla::geom::Location const &location) { + std::stringstream str; + str << location; + return str.str(); +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/geom/Quaternion.h b/LibCarla/source/carla/geom/Quaternion.h index 7c77afc6661..512b7a1b88f 100644 --- a/LibCarla/source/carla/geom/Quaternion.h +++ b/LibCarla/source/carla/geom/Quaternion.h @@ -10,6 +10,7 @@ #include #include +#include #include "carla/MsgPack.h" #include "carla/geom/Math.h" @@ -398,3 +399,13 @@ inline std::ostream &operator<<(std::ostream &out, const Quaternion &quaternion) } // namespace geom } // namespace carla + +namespace std { + +inline std::string to_string(carla::geom::Quaternion const &quaternion) { + std::stringstream str; + str << quaternion; + return str.str(); +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/geom/Rotation.h b/LibCarla/source/carla/geom/Rotation.h index 22791af62c1..ad4a3144ed7 100644 --- a/LibCarla/source/carla/geom/Rotation.h +++ b/LibCarla/source/carla/geom/Rotation.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include "carla/MsgPack.h" #include "carla/geom/Math.h" @@ -170,4 +171,14 @@ namespace geom { } } // namespace geom -} // namespace carla \ No newline at end of file +} // namespace carla + +namespace std { + +inline std::string to_string(carla::geom::Rotation const &rotator) { + std::stringstream str; + str << rotator; + return str.str(); +} + +} // namespace std diff --git a/LibCarla/source/carla/geom/Transform.h b/LibCarla/source/carla/geom/Transform.h index f9181241706..1633562544b 100644 --- a/LibCarla/source/carla/geom/Transform.h +++ b/LibCarla/source/carla/geom/Transform.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include "carla/MsgPack.h" #include "carla/geom/Location.h" @@ -151,3 +152,14 @@ namespace geom { } // namespace geom } // namespace carla + + +namespace std { + +inline std::string to_string(carla::geom::Transform const &transform) { + std::stringstream str; + str << transform; + return str.str(); +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/ROS2.cpp b/LibCarla/source/carla/ros2/ROS2.cpp index 1465010b0dc..2bb9d9a56f3 100644 --- a/LibCarla/source/carla/ros2/ROS2.cpp +++ b/LibCarla/source/carla/ros2/ROS2.cpp @@ -19,26 +19,8 @@ #include "carla/sensor/data/SemanticLidarData.h" #include "carla/sensor/s11n/SensorHeaderSerializer.h" -#include "carla/ros2/publishers/CarlaActorListPublisher.h" -#include "carla/ros2/publishers/TransformPublisher.h" -#include "carla/ros2/publishers/UeCollisionPublisher.h" -#include "carla/ros2/publishers/UeDVSCameraPublisher.h" -#include "carla/ros2/publishers/UeDepthCameraPublisher.h" -#include "carla/ros2/publishers/UeGNSSPublisher.h" -#include "carla/ros2/publishers/UeIMUPublisher.h" -#include "carla/ros2/publishers/UeISCameraPublisher.h" -#include "carla/ros2/publishers/UeLidarPublisher.h" -#include "carla/ros2/publishers/UeNormalsCameraPublisher.h" -#include "carla/ros2/publishers/UeOpticalFlowCameraPublisher.h" -#include "carla/ros2/publishers/UeRGBCameraPublisher.h" -#include "carla/ros2/publishers/UeRadarPublisher.h" -#include "carla/ros2/publishers/UeSSCameraPublisher.h" -#include "carla/ros2/publishers/UeSemanticLidarPublisher.h" +#include "carla/ros2/impl/DdsDomainParticipantImpl.h" #include "carla/ros2/publishers/UeWorldPublisher.h" -#include "carla/ros2/publishers/UeV2XPublisher.h" -#include "carla/ros2/publishers/UeV2XCustomPublisher.h" -#include "carla/ros2/publishers/VehiclePublisher.h" - #include "carla/ros2/services/DestroyObjectService.h" #include "carla/ros2/services/GetAvailableMapsService.h" #include "carla/ros2/services/GetBlueprintsService.h" @@ -46,16 +28,6 @@ #include "carla/ros2/services/SetEpisodeSettingsService.h" #include "carla/ros2/services/SpawnObjectService.h" -#include "carla/ros2/subscribers/AckermannControlSubscriber.h" -#include "carla/ros2/subscribers/VehicleControlSubscriber.h" - -#include "carla/ros2/types/Acceleration.h" -#include "carla/ros2/types/AngularVelocity.h" -#include "carla/ros2/types/Quaternion.h" -#include "carla/ros2/types/Speed.h" -#include "carla/ros2/types/VehicleAckermannControl.h" -#include "carla/ros2/types/VehicleControl.h" - #include namespace carla { @@ -72,15 +44,14 @@ std::shared_ptr ROS2::GetInstance() { void ROS2::Enable(carla::rpc::RpcServerInterface *carla_server, carla::streaming::detail::stream_id_type const world_observer_stream_id, - TopicVisibilityDefaultMode topic_visibility_default_mode) { + ROS2TopicVisibilityDefaultMode topic_visibility_default_mode) { _enabled = true; _topic_visibility_default_mode = topic_visibility_default_mode; _carla_server = carla_server; _name_registry = std::make_shared(); - _dispatcher = _carla_server->GetDispatcher(); _domain_participant_impl = std::make_shared(); // take basic actor role definition as this is acting as naming parent of others with /carla/world - auto world_observer_actor_definition = carla::ros2::types::ActorNameDefinition::CreateFromRoleName("/", true); + auto world_observer_actor_definition = carla::ros2::types::ActorNameDefinition::CreateFromRoleName("/", _topic_visibility_default_mode); _world_observer_sensor_actor_definition = std::make_shared( *world_observer_actor_definition, carla::ros2::types::PublisherSensorType::WorldObserver, @@ -91,16 +62,17 @@ void ROS2::Enable(carla::rpc::RpcServerInterface *carla_server, void ROS2::NotifyInitGame() { log_info("ROS2 NotifyInitGame"); - _carla_sensor_actor_list_publisher = std::make_shared("sensor_list"); - _carla_sensor_actor_list_publisher->Init(_domain_participant_impl); - // The world is crucial and has to be instanciated immediately - if (AddSensorUe(_world_observer_sensor_actor_definition)) { - ProcessDataFromUeSensorPreAction(); - } - if (_world_publisher != nullptr) { - _transform_publisher = _world_publisher->GetTransformPublisher(); + _world_publisher = std::make_shared(*_carla_server, _name_registry, _world_observer_sensor_actor_definition); + if (!_world_publisher->Init(_domain_participant_impl)) { + log_error("ROS2::NotifyInitGame[", std::to_string(*_world_observer_sensor_actor_definition), + "]: Failed to init publisher"); + } else { + log_debug("ROS2::NotifyInitGame[", std::to_string(*_world_observer_sensor_actor_definition), + "]: Publisher initialized"); } + + ProcessDataFromUeSensorPreAction(); } void ROS2::NotifyBeginEpisode() { @@ -140,24 +112,20 @@ void ROS2::NotifyBeginEpisode() { void ROS2::NotifyEndEpisode() { log_info("ROS2 NotifyEndEpisode"); _services.clear(); - _ue_sensors.clear(); _name_registry->Clear(); + _world_publisher->Cleanup(); } void ROS2::NotifyEndGame() { log_info("ROS2 NotifyEndGame"); NotifyEndEpisode(); _world_publisher.reset(); - _transform_publisher.reset(); - _carla_sensor_actor_list_publisher.reset(); } void ROS2::Disable() { NotifyEndEpisode(); NotifyEndGame(); - _carla_sensor_actor_list_publisher.reset(); _world_observer_sensor_actor_definition.reset(); - _dispatcher.reset(); _domain_participant_impl.reset(); _name_registry.reset(); _enabled = false; @@ -191,176 +159,24 @@ void ROS2::AddTrafficSignUe( _world_publisher->AddTrafficSignUe(traffic_sign_actor_definition); } -ROS2::UeSensor* ROS2::AddSensorUeInternal(std::shared_ptr sensor_actor_definition) { - auto insert_result = _ue_sensors.insert({sensor_actor_definition->stream_id, UeSensor(sensor_actor_definition)}); - if (!insert_result.second) { - log_warning("ROS2::AddSensorUe(", std::to_string(*sensor_actor_definition), - "): Sensor already_registered. Ignoring"); - return nullptr; - } - _ue_sensors_changed = true; - return &insert_result.first->second; -} - -bool ROS2::AddSensorUe(std::shared_ptr sensor_actor_definition, +void ROS2::AddSensorUe(std::shared_ptr sensor_actor_definition, carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback) { - auto ue_sensor = AddSensorUeInternal(sensor_actor_definition); - if ( ue_sensor != nullptr ) { - ue_sensor->actor_set_transform_callback = actor_set_transform_callback; - return true; - } - return false; + log_debug("ROS2::AddSensorUe(", std::to_string(*sensor_actor_definition), ")"); + _world_publisher->AddSensorUe(sensor_actor_definition, actor_set_transform_callback); } -bool ROS2::AddV2XCustomSensorUe(std::shared_ptr sensor_actor_definition, - carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback) { - auto ue_sensor = AddSensorUeInternal(sensor_actor_definition); - if ( ue_sensor != nullptr ) { - ue_sensor->v2x_custom_send_callback = v2x_custom_send_callback; - return true; - } - return false; +void ROS2::AddV2XCustomSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback) { + log_debug("ROS2::AddV2XCustomSensorUe(", std::to_string(*sensor_actor_definition), ")"); + _world_publisher->AddV2XCustomSensorUe(sensor_actor_definition, v2x_custom_send_callback); } void ROS2::AttachActors(ActorId const child, ActorId const parent) { log_debug("ROS2::AttachActors[", child, "]: parent=", parent); - _name_registry->AttachActors(child, parent); - for (auto iter = _ue_sensors.begin(); iter != _ue_sensors.end(); ++iter) { - if (iter->second.sensor_actor_definition->id == child) { - UeSensor &sensor = iter->second; - if (sensor.publisher) { - log_error("ROS2::AttachActors[", std::to_string(*sensor.sensor_actor_definition), - "]: Sensor attached to parent ", parent, - ". Sensor has already a running publisher with base topic name ", sensor.publisher->get_topic_name(), - " has to be destroyed due to re-attachment"); - sensor.publisher.reset(); - } - _ue_sensors_changed = true; - break; - } - } -} - -void ROS2::CreateSensorUePublisher(UeSensor &sensor) { - // Create the respective sensor publisher - switch (sensor.sensor_actor_definition->sensor_type) { - case types::PublisherSensorType::CollisionSensor: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::DepthCamera: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::NormalsCamera: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::DVSCamera: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::GnssSensor: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::InertialMeasurementUnit: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::OpticalFlowCamera: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::Radar: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::RayCastSemanticLidar: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::RayCastLidar: - case types::PublisherSensorType::HSSLidar: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::SceneCaptureCamera: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher, sensor.actor_set_transform_callback)); - } break; - case types::PublisherSensorType::SemanticSegmentationCamera: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::InstanceSegmentationCamera: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::WorldObserver: - { - _world_publisher = - std::make_shared(*_carla_server, _name_registry, sensor.sensor_actor_definition); - sensor.publisher = std::static_pointer_cast(_world_publisher); - } break; - case types::PublisherSensorType::V2X: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); - } break; - case types::PublisherSensorType::V2XCustom: - { - sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, sensor.v2x_custom_send_callback, _transform_publisher)); - } break; - case types::PublisherSensorType::RssSensor: - // no server side interface to be implemented: maybe move client based implementation from client to the sensor - // folder for those? in each case should be implemented in a form that the actual calcuations are only performed - // if anyone listening to the topic - case types::PublisherSensorType::CameraGBufferUint8: - case types::PublisherSensorType::CameraGBufferFloat: - case types::PublisherSensorType::LaneInvasionSensor: - case types::PublisherSensorType::ObstacleDetectionSensor: - default: { - sensor.publisher_expected = false; - log_error("ROS2::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), - "]: Not a UE sensor or no publisher implemented yet"); - } - } - if (sensor.publisher != nullptr) { - if (!sensor.publisher->Init(_domain_participant_impl)) { - log_error("ROS2::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), - "]: Failed to init publisher"); - } else { - log_debug("ROS2::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), - "]: Publisher initialized"); - } - } + _world_publisher->AttachActors(child, parent); } void ROS2::RemoveActor(ActorId const actor) { - for (auto iter = _ue_sensors.begin(); iter != _ue_sensors.end(); /*no update of iter*/) { - if (iter->second.sensor_actor_definition->id == actor) { - log_debug("ROS2::RemoveSensorUe(", std::to_string(*iter->second.sensor_actor_definition), ")"); - iter = _ue_sensors.erase(iter); - _ue_sensors_changed = true; - } else { - ++iter; - } - } _world_publisher->RemoveActor(actor); } @@ -372,130 +188,30 @@ void ROS2::ProcessMessages() { } void ROS2::ProcessDataFromUeSensorPreAction() { - for (auto &ue_sensor : _ue_sensors) { - if (ue_sensor.second.publisher_expected && (ue_sensor.second.publisher == nullptr)) { - CreateSensorUePublisher(ue_sensor.second); - } - if (ue_sensor.second.publisher != nullptr) { - if (ue_sensor.second.publisher->SubscribersConnected() && ue_sensor.second.session == nullptr) { - ue_sensor.second.session = std::make_shared(ue_sensor.first); - log_debug("ROS2::ProcessDataFromUeSensorPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition), - "]: Registering session"); - _dispatcher->RegisterSession(ue_sensor.second.session); - } else if (!ue_sensor.second.publisher->SubscribersConnected() && ue_sensor.second.session != nullptr) { - log_debug("ROS2::ProcessDataFromUeSensorPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition), - "]: Deregistering session"); - _dispatcher->DeregisterSession(ue_sensor.second.session); - ue_sensor.second.session.reset(); - } - } - } - - for (auto &ue_sensor : _ue_sensors) { - if ( (ue_sensor.second.publisher != nullptr) ) { - ue_sensor.second.publisher->UpdateSensorDataPreAction(); - } - } - - - if (_ue_sensors_changed) { - _ue_sensors_changed = false; - carla_msgs::msg::CarlaActorList actor_list; - for (auto &ue_sensor : _ue_sensors) { - actor_list.actors().push_back(ue_sensor.second.sensor_actor_definition->carla_actor_info(_name_registry)); - } - _carla_sensor_actor_list_publisher->UpdateCarlaActorList(actor_list); - _carla_sensor_actor_list_publisher->Publish(); - } - - _world_publisher->UpdateSensorDataPreAction(); } - void ROS2::ProcessDataFromUeSensor(carla::streaming::detail::stream_id_type const stream_id, std::shared_ptr message) { - auto ue_sensor = _ue_sensors.find(stream_id); - if (ue_sensor != _ue_sensors.end()) { - auto const &sensor_actor_definition = ue_sensor->second.sensor_actor_definition; - - auto buffer_list_view = message->GetBufferViewSequence(); - // currently we only support sensor header + data buffer - DEBUG_ASSERT_EQ(buffer_list_view.size(), 2u); - carla::SharedBufferView sensor_header_view = *buffer_list_view.begin(); - - auto sensor_header = std::shared_ptr( - sensor_header_view, reinterpret_cast( - sensor_header_view.get()->data())); - - if (ue_sensor->second.publisher) { - if ( ue_sensor->second.publisher->is_enabled_for_ros() ) { - auto data_view_iter = buffer_list_view.begin(); - data_view_iter++; - if (data_view_iter != buffer_list_view.end()) { - ue_sensor->second.publisher->UpdateTransform(sensor_header); - ue_sensor->second.publisher->UpdateSensorData(sensor_header, *data_view_iter); - ue_sensor->second.publisher->Publish(); - } - log_debug("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", - std::to_string(*sensor_actor_definition), " Processed."); - - } else { - log_debug("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", - std::to_string(*sensor_actor_definition), std::to_string(*ue_sensor->second.publisher->_actor_name_definition), " not enabled for ROS. Dropping data."); - } - } else { - log_error("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", - std::to_string(*sensor_actor_definition), " not registered. Dropping data."); - } - - } else { - log_error("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", std::to_string(stream_id), - " not registered. Dropping data."); - } + _world_publisher->ProcessDataFromUeSensor(stream_id, message); } void ROS2::ProcessDataFromUeSensorPostAction() { - for (auto &ue_sensor : _ue_sensors) { - if ( (ue_sensor.second.publisher != nullptr) ) { - ue_sensor.second.publisher->UpdateSensorDataPostAction(); - } - } _world_publisher->UpdateSensorDataPostAction(); } - void ROS2::EnableForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id) { - auto ue_sensor = _ue_sensors.find(stream_actor_id.stream_id); - if (ue_sensor != _ue_sensors.end()) { - if ( !ue_sensor->second.publisher->is_enabled_for_ros(stream_actor_id.actor_id) ) { - log_debug("Enable Sensor for ROS: ", - std::to_string(*ue_sensor->second.publisher->_actor_name_definition)); - ue_sensor->second.publisher->enable_for_ros(stream_actor_id.actor_id); - } - } + _world_publisher->enable_for_ros(stream_actor_id.actor_id); } void ROS2::DisableForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id) { - auto ue_sensor = _ue_sensors.find(stream_actor_id.stream_id); - if (ue_sensor != _ue_sensors.end()) { - if ( ue_sensor->second.publisher->is_enabled_for_ros(stream_actor_id.actor_id) ) { - log_debug("Disable Sensor for ROS: ", - std::to_string(*ue_sensor->second.publisher->_actor_name_definition)); - ue_sensor->second.publisher->disable_for_ros(stream_actor_id.actor_id); - } - } + _world_publisher->disable_for_ros(stream_actor_id.actor_id); } bool ROS2::IsEnabledForROS(carla::streaming::detail::stream_actor_id_type stream_actor_id) { - auto ue_sensor = _ue_sensors.find(stream_actor_id.stream_id); - if (ue_sensor != _ue_sensors.end()) { - return ue_sensor->second.publisher->is_enabled_for_ros(stream_actor_id.actor_id); - } - return false; + return _world_publisher->is_enabled_for_ros(stream_actor_id.actor_id); } - uint64_t ROS2::CurrentFrame() const { return (_world_publisher != nullptr) ? _world_publisher->CurrentFrame() : 0u; } diff --git a/LibCarla/source/carla/ros2/ROS2.h b/LibCarla/source/carla/ros2/ROS2.h index 82a4da16af8..3489ee1582c 100644 --- a/LibCarla/source/carla/ros2/ROS2.h +++ b/LibCarla/source/carla/ros2/ROS2.h @@ -8,7 +8,7 @@ #include "carla/BufferView.h" #include "carla/ros2/ROS2NameRegistry.h" -#include "carla/ros2/ROS2Session.h" +#include "carla/ros2/ROS2TopicVisibilityDefaultMode.h" #include "carla/ros2/types/SensorActorDefinition.h" #include "carla/ros2/types/TrafficLightActorDefinition.h" #include "carla/ros2/types/TrafficSignActorDefinition.h" @@ -30,6 +30,7 @@ class TransformPublisher; class CarlaActorListPublisher; class UeWorldPublisher; class ServiceInterface; + class ROS2 { public: @@ -39,18 +40,14 @@ class ROS2 { static std::shared_ptr GetInstance(); - // starting/stopping - enum class TopicVisibilityDefaultMode { - eOn, - eOff - }; + void Enable(carla::rpc::RpcServerInterface* carla_server, carla::streaming::detail::stream_id_type const world_observer_stream_id, - TopicVisibilityDefaultMode topic_visibility_default_mode); + ROS2TopicVisibilityDefaultMode topic_visibility_default_mode); bool IsEnabled() const { return _enabled; } - TopicVisibilityDefaultMode VisibilityDefaultMode() const { + ROS2TopicVisibilityDefaultMode VisibilityDefaultMode() const { return _topic_visibility_default_mode; } void NotifyInitGame(); @@ -70,9 +67,9 @@ class ROS2 { void AddTrafficLightUe( std::shared_ptr traffic_light_actor_definition); void AddTrafficSignUe(std::shared_ptr traffic_sign_actor_definition); - bool AddSensorUe(std::shared_ptr sensor_actor_definition, + void AddSensorUe(std::shared_ptr sensor_actor_definition, carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback = nullptr); - bool AddV2XCustomSensorUe(std::shared_ptr sensor_actor_definition, + void AddV2XCustomSensorUe(std::shared_ptr sensor_actor_definition, carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback); void RemoveActor(ActorId const actor); @@ -106,36 +103,15 @@ class ROS2 { private: bool _enabled{false}; - TopicVisibilityDefaultMode _topic_visibility_default_mode{TopicVisibilityDefaultMode::eOn}; + ROS2TopicVisibilityDefaultMode _topic_visibility_default_mode{ROS2TopicVisibilityDefaultMode::eOn}; carla::rpc::RpcServerInterface* _carla_server{nullptr}; std::shared_ptr _name_registry{nullptr}; - std::shared_ptr _dispatcher; std::shared_ptr _domain_participant_impl; std::shared_ptr _world_observer_sensor_actor_definition; - struct UeSensor { - UeSensor(std::shared_ptr sensor_actor_definition_) - : sensor_actor_definition(sensor_actor_definition_) {} - std::shared_ptr sensor_actor_definition; - carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback{nullptr}; - bool publisher_expected{true}; - std::shared_ptr publisher; - std::shared_ptr session; - carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback{nullptr}; - }; - std::unordered_map _ue_sensors; - bool _ue_sensors_changed{false}; - std::shared_ptr _transform_publisher; - std::shared_ptr _world_publisher; - std::list> _services; - std::shared_ptr _carla_sensor_actor_list_publisher; - - UeSensor* AddSensorUeInternal(std::shared_ptr sensor_actor_definition); - void CreateSensorUePublisher(UeSensor& sensor); - // sigleton ROS2(){}; }; diff --git a/LibCarla/source/carla/ros2/ROS2NameRecord.cpp b/LibCarla/source/carla/ros2/ROS2NameRecord.cpp index d1a5f459faa..b530e008fae 100644 --- a/LibCarla/source/carla/ros2/ROS2NameRecord.cpp +++ b/LibCarla/source/carla/ros2/ROS2NameRecord.cpp @@ -43,5 +43,9 @@ carla::streaming::detail::actor_id_type ROS2NameRecord::get_actor_id() const { return _actor_name_definition->id; } +carla::streaming::detail::actor_id_type ROS2NameRecord::get_parent_actor_id() const { + return ROS2::GetInstance()->GetNameRegistry()->ParentActorId(_actor_name_definition->id); +} + } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/ROS2NameRecord.h b/LibCarla/source/carla/ros2/ROS2NameRecord.h index c8718899433..0570ac3696f 100644 --- a/LibCarla/source/carla/ros2/ROS2NameRecord.h +++ b/LibCarla/source/carla/ros2/ROS2NameRecord.h @@ -34,6 +34,8 @@ class ROS2NameRecord { carla::streaming::detail::actor_id_type get_actor_id() const; + carla::streaming::detail::actor_id_type get_parent_actor_id() const; + std::shared_ptr _actor_name_definition; }; diff --git a/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp b/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp index 6b1724126d3..837b251679c 100644 --- a/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp +++ b/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp @@ -100,6 +100,19 @@ std::string ROS2NameRegistry::TopicPrefix(ActorId const actor_id) { return result_topic_name; } +std::string ROS2NameRegistry::FrameId(carla::streaming::detail::actor_id_type const actor_id) +{ + std::lock_guard lock(access_mutex); + std::string result_topic_name = ""; + for (auto& record : record_set) { + if (record->_actor_name_definition->id == actor_id) { + auto const frame_id = GetTopicAndFrameLocked(KeyType(record))._frame_id; + return frame_id; + } + } + return ""; +} + ROS2NameRegistry::TopicAndFrame const& ROS2NameRegistry::GetTopicAndFrameLocked(ROS2NameRecord const* record) { return GetTopicAndFrameLocked(KeyType(record)); } @@ -244,9 +257,9 @@ ROS2NameRegistry::CreateTopicAndFrameLocked(ROS2NameRegistry::KeyType const& key // on sensors we use the sensor name as additions type prefix auto pos = actor_definition->ros_name.find_last_of('.'); if (pos != std::string::npos) { - topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name.substr(pos + 1u)); + topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name.substr(pos + 1u), actor_definition->frame_id); } else { - topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name); + topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name, actor_definition->frame_id); } // and use stream id as individualization auto const stream_id_string = "/stream_" + number_to_three_letter_string(sensor_actor_definition->stream_id); @@ -285,26 +298,36 @@ ROS2NameRegistry::CreateTopicAndFrameLocked(ROS2NameRegistry::KeyType const& key } ROS2NameRegistry::TopicAndFrame ROS2NameRegistry::ExpandTopicName(TopicAndFrame const& topic_and_frame, - std::string const& postfix) { - auto postfix_adapted = postfix; - while (postfix_adapted.front() == '/') { - postfix_adapted.erase(postfix_adapted.begin()); + std::string const& postfix_topic, std::string const& postfix_frame) { + auto postfix_topic_adapted = postfix_topic; + while (postfix_topic_adapted.front() == '/') { + postfix_topic_adapted.erase(postfix_topic_adapted.begin()); } - if (postfix_adapted.empty()) { - return topic_and_frame; + std::string postfix_frame_adapted; + if ( postfix_frame.empty()) { + postfix_frame_adapted = postfix_topic_adapted; } - TopicAndFrame expanded_topic_and_frame = topic_and_frame; - if (expanded_topic_and_frame._frame_id.back() != '/') { - expanded_topic_and_frame._frame_id.push_back('/'); + else { + while (postfix_frame_adapted.front() == '/') { + postfix_frame_adapted.erase(postfix_frame_adapted.begin()); + } } - if (expanded_topic_and_frame._frame_id.front() == '/') { - expanded_topic_and_frame._frame_id.erase(0u, 1u); + TopicAndFrame expanded_topic_and_frame = topic_and_frame; + if ( !postfix_frame_adapted.empty() ) { + if (expanded_topic_and_frame._frame_id.back() != '/') { + expanded_topic_and_frame._frame_id.push_back('/'); + } + if (expanded_topic_and_frame._frame_id.front() == '/') { + expanded_topic_and_frame._frame_id.erase(0u, 1u); + } + expanded_topic_and_frame._frame_id += postfix_frame_adapted; } - if (expanded_topic_and_frame._topic_name.back() != '/') { - expanded_topic_and_frame._topic_name.push_back('/'); + if ( !postfix_topic_adapted.empty() ) { + if (expanded_topic_and_frame._topic_name.back() != '/') { + expanded_topic_and_frame._topic_name.push_back('/'); + } + expanded_topic_and_frame._topic_name += postfix_topic_adapted; } - expanded_topic_and_frame._frame_id += postfix_adapted; - expanded_topic_and_frame._topic_name += postfix_adapted; return expanded_topic_and_frame; } diff --git a/LibCarla/source/carla/ros2/ROS2NameRegistry.h b/LibCarla/source/carla/ros2/ROS2NameRegistry.h index 32ee0f08672..54a0aca51e8 100644 --- a/LibCarla/source/carla/ros2/ROS2NameRegistry.h +++ b/LibCarla/source/carla/ros2/ROS2NameRegistry.h @@ -53,6 +53,11 @@ class ROS2NameRegistry { @brief returns the shortest common prefix of all registered topic names for this actor_id */ std::string TopicPrefix(carla::streaming::detail::actor_id_type const actor_id); + + /*! + @brief returns the FrameId for this actor_id + */ + std::string FrameId(carla::streaming::detail::actor_id_type const actor_id); std::string FrameId(ROS2NameRecord const* record) { std::lock_guard lock(access_mutex); @@ -90,7 +95,8 @@ class ROS2NameRegistry { ROS2NameRegistry& operator=(ROS2NameRegistry&&) = delete; bool IsTopicNameAvailable(TopicAndFrame const& topic_and_frame, std::string const& individual_name); - TopicAndFrame ExpandTopicName(TopicAndFrame const& topic_and_frame, std::string const& postfix); + // per default frame and topic postfix are considered to be equal + TopicAndFrame ExpandTopicName(TopicAndFrame const& topic_and_frame, std::string const& postfix_topic, std::string const& postfix_frame=""); struct KeyType { explicit KeyType(ROS2NameRecord const* record) : _record(record), _actor_id(record->_actor_name_definition->id) {} diff --git a/LibCarla/source/carla/ros2/ROS2QoS.h b/LibCarla/source/carla/ros2/ROS2QoS.h index bd5ed1f6bed..4f05590fa14 100644 --- a/LibCarla/source/carla/ros2/ROS2QoS.h +++ b/LibCarla/source/carla/ros2/ROS2QoS.h @@ -53,19 +53,6 @@ struct ROS2QoS { int32_t _history_depth; }; -/** - * Default ROS2 QoS parameters. - */ -static constexpr ROS2QoS DEFAULT_ROS2_QOS{ ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::VOLATILE, - ROS2QoS::History::KEEP_LAST, 10}; - -/** - * Default ROS2 QoS parameters for sensor data publisher: reliable, volatile, keep_last with history size 10. - * Doesn't allow for transient local subscribers and is best used for regularly updated data. - */ -static constexpr ROS2QoS DEFAULT_SENSOR_DATA_QOS{ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::VOLATILE, - ROS2QoS::History::KEEP_LAST, 10}; - /** * Default ROS2 QoS parameters for subscribers: best_effort, volatile, keep_last with history size 10. * Connects to any publisher configuration. @@ -75,7 +62,10 @@ static constexpr ROS2QoS DEFAULT_SUBSCRIBER_QOS{ROS2QoS::Reliability::BEST_EFFOR /** * Default ROS2 QoS parameters for publishers: reliable, transient_local, keep_last with history size 10. - * Connects to any subscriber configuration and is best used for data not updated regularly. + * Connects to any subscriber configuration. + * Note history size>1 are only meaningful for transient_local durability. + * Note history size=10 is a good compromise between memory consumption and data loss in case of high system load or late subscribers. + * Since CARLA subscribers might want to record all simulation frames, we use a larger history depth here. */ static constexpr ROS2QoS DEFAULT_PUBLISHER_QOS{ROS2QoS::Reliability::RELIABLE, ROS2QoS::Durability::TRANSIENT_LOCAL, ROS2QoS::History::KEEP_LAST, 10}; diff --git a/LibCarla/source/carla/ros2/ROS2TopicVisibilityDefaultMode.h b/LibCarla/source/carla/ros2/ROS2TopicVisibilityDefaultMode.h new file mode 100644 index 00000000000..b7953933667 --- /dev/null +++ b/LibCarla/source/carla/ros2/ROS2TopicVisibilityDefaultMode.h @@ -0,0 +1,19 @@ +// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma +// de Barcelona (UAB). +// +// This work is licensed under the terms of the MIT license. +// For a copy, see . + +#pragma once + +namespace carla { +namespace ros2 { + +enum class ROS2TopicVisibilityDefaultMode { + eOn, + eOff +}; + +} // namespace ros2 +} // namespace carla + diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h index f22b5aff74a..e3f18f33775 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h @@ -68,12 +68,8 @@ class DdsPublisherImpl : public PublisherInterface, eprosima::fastdds::dds::Data } bool Publish() override { - if ( !SubscribersConnected() ) { - carla::log_debug("DdsPublisherImpl[", _topic->get_name(), "]::Publish() No subscribers connected, skipping publish"); - return true; - } if (_message_updated) { - carla::log_debug("DdsPublisherImpl[", _topic->get_name(), "]::Publishing() updated message"); + carla::log_verbose("DdsPublisherImpl[", _topic->get_name(), "]::Publishing() updated message"); eprosima::fastrtps::rtps::InstanceHandle_t instance_handle; auto rcode = _datawriter->write(&_message, instance_handle); if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { @@ -82,7 +78,7 @@ class DdsPublisherImpl : public PublisherInterface, eprosima::fastdds::dds::Data carla::log_error("DdsPublisherImpl[", _topic->get_name(), "]::Publish() Failed to write data; Error ", std::to_string(rcode)); } - carla::log_debug("DdsPublisherImpl[", _topic->get_name(), "]::Publishing() done"); + carla::log_verbose("DdsPublisherImpl[", _topic->get_name(), "]::Publishing() done"); } return !_message_updated; } diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx index 7295748ccc0..7e1dfa9450e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx @@ -16,7 +16,7 @@ * @file CarlaActorInfo.cpp * This source file contains the definition of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifdef _WIN32 @@ -33,25 +33,67 @@ char dummy; using namespace eprosima::fastcdr::exception; #include + +#define carla_msgs_msg_CarlaActorInfo_max_cdr_typesize 53844ULL; +#define diagnostic_msgs_msg_KeyValue_max_cdr_typesize 520ULL; +#define carla_msgs_msg_CarlaActorInfo_max_key_cdr_typesize 0ULL; +#define diagnostic_msgs_msg_KeyValue_max_key_cdr_typesize 0ULL; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + carla_msgs::msg::CarlaActorInfo::CarlaActorInfo() { - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@17c1bced + // unsigned long long m_id m_id = 0; - // m_parent_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2d9d4f9d + // unsigned long long m_parent_id m_parent_id = 0; - // m_type com.eprosima.idl.parser.typecode.StringTypeCode@4034c28c + // string m_type m_type =""; - // m_rosname com.eprosima.idl.parser.typecode.StringTypeCode@e50a6f6 + // string m_rosname m_rosname =""; - // m_rolename com.eprosima.idl.parser.typecode.StringTypeCode@358c99f5 + // string m_rolename m_rolename =""; - // m_object_type com.eprosima.idl.parser.typecode.StringTypeCode@3ee0fea4 + // string m_object_type m_object_type =""; - // m_base_type com.eprosima.idl.parser.typecode.StringTypeCode@48524010 + // string m_base_type m_base_type =""; - // m_topic_prefix com.eprosima.idl.parser.typecode.StringTypeCode@4b168fa9 + // string m_topic_prefix m_topic_prefix =""; + // string m_frame_id + m_frame_id =""; + // uint8 m_city_object_label + m_city_object_label = 0; + // sequence m_attributes + } @@ -64,6 +106,10 @@ carla_msgs::msg::CarlaActorInfo::~CarlaActorInfo() + + + + } carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( @@ -77,10 +123,13 @@ carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( m_object_type = x.m_object_type; m_base_type = x.m_base_type; m_topic_prefix = x.m_topic_prefix; + m_frame_id = x.m_frame_id; + m_city_object_label = x.m_city_object_label; + m_attributes = x.m_attributes; } carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( - CarlaActorInfo&& x) + CarlaActorInfo&& x) noexcept { m_id = x.m_id; m_parent_id = x.m_parent_id; @@ -90,6 +139,9 @@ carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( m_object_type = std::move(x.m_object_type); m_base_type = std::move(x.m_base_type); m_topic_prefix = std::move(x.m_topic_prefix); + m_frame_id = std::move(x.m_frame_id); + m_city_object_label = x.m_city_object_label; + m_attributes = std::move(x.m_attributes); } carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( @@ -104,12 +156,15 @@ carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( m_object_type = x.m_object_type; m_base_type = x.m_base_type; m_topic_prefix = x.m_topic_prefix; + m_frame_id = x.m_frame_id; + m_city_object_label = x.m_city_object_label; + m_attributes = x.m_attributes; return *this; } carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( - CarlaActorInfo&& x) + CarlaActorInfo&& x) noexcept { m_id = x.m_id; @@ -120,6 +175,9 @@ carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( m_object_type = std::move(x.m_object_type); m_base_type = std::move(x.m_base_type); m_topic_prefix = std::move(x.m_topic_prefix); + m_frame_id = std::move(x.m_frame_id); + m_city_object_label = x.m_city_object_label; + m_attributes = std::move(x.m_attributes); return *this; } @@ -128,7 +186,7 @@ bool carla_msgs::msg::CarlaActorInfo::operator ==( const CarlaActorInfo& x) const { - return (m_id == x.m_id && m_parent_id == x.m_parent_id && m_type == x.m_type && m_rosname == x.m_rosname && m_rolename == x.m_rolename && m_object_type == x.m_object_type && m_base_type == x.m_base_type && m_topic_prefix == x.m_topic_prefix); + return (m_id == x.m_id && m_parent_id == x.m_parent_id && m_type == x.m_type && m_rosname == x.m_rosname && m_rolename == x.m_rolename && m_object_type == x.m_object_type && m_base_type == x.m_base_type && m_topic_prefix == x.m_topic_prefix && m_frame_id == x.m_frame_id && m_city_object_label == x.m_city_object_label && m_attributes == x.m_attributes); } bool carla_msgs::msg::CarlaActorInfo::operator !=( @@ -140,29 +198,8 @@ bool carla_msgs::msg::CarlaActorInfo::operator !=( size_t carla_msgs::msg::CarlaActorInfo::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return carla_msgs_msg_CarlaActorInfo_max_cdr_typesize; } size_t carla_msgs::msg::CarlaActorInfo::getCdrSerializedSize( @@ -173,10 +210,10 @@ size_t carla_msgs::msg::CarlaActorInfo::getCdrSerializedSize( size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type().size() + 1; @@ -191,6 +228,18 @@ size_t carla_msgs::msg::CarlaActorInfo::getCdrSerializedSize( current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.topic_prefix().size() + 1; + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.attributes().size(); ++a) + { + current_alignment += diagnostic_msgs::msg::KeyValue::getCdrSerializedSize(data.attributes().at(a), current_alignment);} + return current_alignment - initial_alignment; } @@ -201,12 +250,15 @@ void carla_msgs::msg::CarlaActorInfo::serialize( scdr << m_id; scdr << m_parent_id; - scdr << m_type; - scdr << m_rosname; - scdr << m_rolename; - scdr << m_object_type; - scdr << m_base_type; - scdr << m_topic_prefix; + scdr << m_type.c_str(); + scdr << m_rosname.c_str(); + scdr << m_rolename.c_str(); + scdr << m_object_type.c_str(); + scdr << m_base_type.c_str(); + scdr << m_topic_prefix.c_str(); + scdr << m_frame_id.c_str(); + scdr << m_city_object_label; + scdr << m_attributes; } @@ -222,6 +274,9 @@ void carla_msgs::msg::CarlaActorInfo::deserialize( dcdr >> m_object_type; dcdr >> m_base_type; dcdr >> m_topic_prefix; + dcdr >> m_frame_id; + dcdr >> m_city_object_label; + dcdr >> m_attributes; } /*! @@ -229,7 +284,7 @@ void carla_msgs::msg::CarlaActorInfo::deserialize( * @param _id New value for member id */ void carla_msgs::msg::CarlaActorInfo::id( - uint32_t _id) + uint64_t _id) { m_id = _id; } @@ -238,7 +293,7 @@ void carla_msgs::msg::CarlaActorInfo::id( * @brief This function returns the value of member id * @return Value of member id */ -uint32_t carla_msgs::msg::CarlaActorInfo::id() const +uint64_t carla_msgs::msg::CarlaActorInfo::id() const { return m_id; } @@ -247,7 +302,7 @@ uint32_t carla_msgs::msg::CarlaActorInfo::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -uint32_t& carla_msgs::msg::CarlaActorInfo::id() +uint64_t& carla_msgs::msg::CarlaActorInfo::id() { return m_id; } @@ -257,7 +312,7 @@ uint32_t& carla_msgs::msg::CarlaActorInfo::id() * @param _parent_id New value for member parent_id */ void carla_msgs::msg::CarlaActorInfo::parent_id( - uint32_t _parent_id) + uint64_t _parent_id) { m_parent_id = _parent_id; } @@ -266,7 +321,7 @@ void carla_msgs::msg::CarlaActorInfo::parent_id( * @brief This function returns the value of member parent_id * @return Value of member parent_id */ -uint32_t carla_msgs::msg::CarlaActorInfo::parent_id() const +uint64_t carla_msgs::msg::CarlaActorInfo::parent_id() const { return m_parent_id; } @@ -275,7 +330,7 @@ uint32_t carla_msgs::msg::CarlaActorInfo::parent_id() const * @brief This function returns a reference to member parent_id * @return Reference to member parent_id */ -uint32_t& carla_msgs::msg::CarlaActorInfo::parent_id() +uint64_t& carla_msgs::msg::CarlaActorInfo::parent_id() { return m_parent_id; } @@ -502,15 +557,115 @@ std::string& carla_msgs::msg::CarlaActorInfo::topic_prefix() { return m_topic_prefix; } +/*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ +void carla_msgs::msg::CarlaActorInfo::frame_id( + const std::string& _frame_id) +{ + m_frame_id = _frame_id; +} -size_t carla_msgs::msg::CarlaActorInfo::getKeyMaxCdrSerializedSize( - size_t current_alignment) +/*! + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ +void carla_msgs::msg::CarlaActorInfo::frame_id( + std::string&& _frame_id) { - size_t current_align = current_alignment; + m_frame_id = std::move(_frame_id); +} +/*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ +const std::string& carla_msgs::msg::CarlaActorInfo::frame_id() const +{ + return m_frame_id; +} +/*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ +std::string& carla_msgs::msg::CarlaActorInfo::frame_id() +{ + return m_frame_id; +} +/*! + * @brief This function sets a value in member city_object_label + * @param _city_object_label New value for member city_object_label + */ +void carla_msgs::msg::CarlaActorInfo::city_object_label( + uint8_t _city_object_label) +{ + m_city_object_label = _city_object_label; +} - return current_align; +/*! + * @brief This function returns the value of member city_object_label + * @return Value of member city_object_label + */ +uint8_t carla_msgs::msg::CarlaActorInfo::city_object_label() const +{ + return m_city_object_label; +} + +/*! + * @brief This function returns a reference to member city_object_label + * @return Reference to member city_object_label + */ +uint8_t& carla_msgs::msg::CarlaActorInfo::city_object_label() +{ + return m_city_object_label; +} + +/*! + * @brief This function copies the value in member attributes + * @param _attributes New value to be copied in member attributes + */ +void carla_msgs::msg::CarlaActorInfo::attributes( + const std::vector& _attributes) +{ + m_attributes = _attributes; +} + +/*! + * @brief This function moves the value in member attributes + * @param _attributes New value to be moved in member attributes + */ +void carla_msgs::msg::CarlaActorInfo::attributes( + std::vector&& _attributes) +{ + m_attributes = std::move(_attributes); +} + +/*! + * @brief This function returns a constant reference to member attributes + * @return Constant reference to member attributes + */ +const std::vector& carla_msgs::msg::CarlaActorInfo::attributes() const +{ + return m_attributes; +} + +/*! + * @brief This function returns a reference to member attributes + * @return Reference to member attributes + */ +std::vector& carla_msgs::msg::CarlaActorInfo::attributes() +{ + return m_attributes; +} + + +size_t carla_msgs::msg::CarlaActorInfo::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return carla_msgs_msg_CarlaActorInfo_max_key_cdr_typesize; } bool carla_msgs::msg::CarlaActorInfo::isKeyDefined() @@ -522,7 +677,7 @@ void carla_msgs::msg::CarlaActorInfo::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h index ec666938ae6..ec7e7895a2b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h @@ -16,12 +16,15 @@ * @file CarlaActorInfo.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ +#include "diagnostic_msgs/msg/KeyValue.h" + +#include #include #include @@ -42,16 +45,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaActorInfo_SOURCE) -#define CarlaActorInfo_DllAPI __declspec( dllexport ) +#if defined(CARLAACTORINFO_SOURCE) +#define CARLAACTORINFO_DllAPI __declspec( dllexport ) #else -#define CarlaActorInfo_DllAPI __declspec( dllimport ) -#endif // CarlaActorInfo_SOURCE +#define CARLAACTORINFO_DllAPI __declspec( dllimport ) +#endif // CARLAACTORINFO_SOURCE #else -#define CarlaActorInfo_DllAPI +#define CARLAACTORINFO_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaActorInfo_DllAPI +#define CARLAACTORINFO_DllAPI #endif // _WIN32 namespace eprosima { @@ -63,9 +66,41 @@ class Cdr; namespace carla_msgs { namespace msg { + namespace CarlaActorInfo_Constants { + const uint8_t CITYOBJECTLABEL_NONE = 0; + const uint8_t CITYOBJECTLABEL_ROADS = 1; + const uint8_t CITYOBJECTLABEL_SIDEWALKS = 2; + const uint8_t CITYOBJECTLABEL_BUILDINGS = 3; + const uint8_t CITYOBJECTLABEL_WALLS = 4; + const uint8_t CITYOBJECTLABEL_FENCES = 5; + const uint8_t CITYOBJECTLABEL_POLES = 6; + const uint8_t CITYOBJECTLABEL_TRAFFICLIGHT = 7; + const uint8_t CITYOBJECTLABEL_TRAFFICSIGNS = 8; + const uint8_t CITYOBJECTLABEL_VEGETATION = 9; + const uint8_t CITYOBJECTLABEL_TERRAIN = 10; + const uint8_t CITYOBJECTLABEL_SKY = 11; + const uint8_t CITYOBJECTLABEL_PEDESTRIANS = 12; + const uint8_t CITYOBJECTLABEL_RIDER = 13; + const uint8_t CITYOBJECTLABEL_CAR = 14; + const uint8_t CITYOBJECTLABEL_TRUCK = 15; + const uint8_t CITYOBJECTLABEL_BUS = 16; + const uint8_t CITYOBJECTLABEL_TRAIN = 17; + const uint8_t CITYOBJECTLABEL_MOTORCYCLE = 18; + const uint8_t CITYOBJECTLABEL_BICYCLE = 19; + const uint8_t CITYOBJECTLABEL_STATIC = 20; + const uint8_t CITYOBJECTLABEL_DYNAMIC = 21; + const uint8_t CITYOBJECTLABEL_OTHER = 22; + const uint8_t CITYOBJECTLABEL_WATER = 23; + const uint8_t CITYOBJECTLABEL_ROADLINES = 24; + const uint8_t CITYOBJECTLABEL_GROUND = 25; + const uint8_t CITYOBJECTLABEL_BRIDGE = 26; + const uint8_t CITYOBJECTLABEL_RAILTRACK = 27; + const uint8_t CITYOBJECTLABEL_GUARDRAIL = 28; + const uint8_t CITYOBJECTLABEL_ANY = 255; + } // namespace CarlaActorInfo_Constants /*! * @brief This class represents the structure CarlaActorInfo defined by the user in the IDL file. - * @ingroup CARLAACTORINFO + * @ingroup CarlaActorInfo */ class CarlaActorInfo { @@ -93,7 +128,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. */ eProsima_user_DllExport CarlaActorInfo( - CarlaActorInfo&& x); + CarlaActorInfo&& x) noexcept; /*! * @brief Copy assignment. @@ -107,7 +142,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. */ eProsima_user_DllExport CarlaActorInfo& operator =( - CarlaActorInfo&& x); + CarlaActorInfo&& x) noexcept; /*! * @brief Comparison operator. @@ -128,38 +163,38 @@ namespace carla_msgs { * @param _id New value for member id */ eProsima_user_DllExport void id( - uint32_t _id); + uint64_t _id); /*! * @brief This function returns the value of member id * @return Value of member id */ - eProsima_user_DllExport uint32_t id() const; + eProsima_user_DllExport uint64_t id() const; /*! * @brief This function returns a reference to member id * @return Reference to member id */ - eProsima_user_DllExport uint32_t& id(); + eProsima_user_DllExport uint64_t& id(); /*! * @brief This function sets a value in member parent_id * @param _parent_id New value for member parent_id */ eProsima_user_DllExport void parent_id( - uint32_t _parent_id); + uint64_t _parent_id); /*! * @brief This function returns the value of member parent_id * @return Value of member parent_id */ - eProsima_user_DllExport uint32_t parent_id() const; + eProsima_user_DllExport uint64_t parent_id() const; /*! * @brief This function returns a reference to member parent_id * @return Reference to member parent_id */ - eProsima_user_DllExport uint32_t& parent_id(); + eProsima_user_DllExport uint64_t& parent_id(); /*! * @brief This function copies the value in member type @@ -311,13 +346,82 @@ namespace carla_msgs { * @return Reference to member topic_prefix */ eProsima_user_DllExport std::string& topic_prefix(); + /*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ + eProsima_user_DllExport void frame_id( + const std::string& _frame_id); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ + eProsima_user_DllExport void frame_id( + std::string&& _frame_id); + + /*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ + eProsima_user_DllExport const std::string& frame_id() const; + + /*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ + eProsima_user_DllExport std::string& frame_id(); + /*! + * @brief This function sets a value in member city_object_label + * @param _city_object_label New value for member city_object_label + */ + eProsima_user_DllExport void city_object_label( + uint8_t _city_object_label); + + /*! + * @brief This function returns the value of member city_object_label + * @return Value of member city_object_label + */ + eProsima_user_DllExport uint8_t city_object_label() const; + + /*! + * @brief This function returns a reference to member city_object_label + * @return Reference to member city_object_label + */ + eProsima_user_DllExport uint8_t& city_object_label(); + + /*! + * @brief This function copies the value in member attributes + * @param _attributes New value to be copied in member attributes + */ + eProsima_user_DllExport void attributes( + const std::vector& _attributes); + + /*! + * @brief This function moves the value in member attributes + * @param _attributes New value to be moved in member attributes + */ + eProsima_user_DllExport void attributes( + std::vector&& _attributes); + + /*! + * @brief This function returns a constant reference to member attributes + * @return Constant reference to member attributes + */ + eProsima_user_DllExport const std::vector& attributes() const; + + /*! + * @brief This function returns a reference to member attributes + * @return Reference to member attributes */ + eProsima_user_DllExport std::vector& attributes(); + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -371,16 +475,21 @@ namespace carla_msgs { private: - uint32_t m_id; - uint32_t m_parent_id; + uint64_t m_id; + uint64_t m_parent_id; std::string m_type; std::string m_rosname; std::string m_rolename; std::string m_object_type; std::string m_base_type; std::string m_topic_prefix; + std::string m_frame_id; + uint8_t m_city_object_label; + std::vector m_attributes; + }; } // namespace msg } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx index f3432ecb2df..a1c4cc061fe 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx @@ -16,7 +16,7 @@ * @file CarlaActorInfoPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -30,6 +30,40 @@ using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; namespace carla_msgs { namespace msg { + namespace CarlaActorInfo_Constants { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } //End of namespace CarlaActorInfo_Constants + CarlaActorInfoPubSubType::CarlaActorInfoPubSubType() { setName("carla_msgs::msg::dds_::CarlaActorInfo_"); @@ -62,15 +96,15 @@ namespace carla_msgs { // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); // Serialize the object. p_type->serialize(ser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -84,25 +118,25 @@ namespace carla_msgs { SerializedPayload_t* payload, void* data) { - //Convert DATA to pointer of your type - CarlaActorInfo* p_type = static_cast(data); + try + { + // Convert DATA to pointer of your type + CarlaActorInfo* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - try - { // Deserialize the object. p_type->deserialize(deser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -173,4 +207,6 @@ namespace carla_msgs { } //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h index 860bfc85ae4..20764987dc2 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h @@ -16,7 +16,7 @@ * @file CarlaActorInfoPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -28,6 +28,8 @@ #include "CarlaActorInfo.h" +#include "diagnostic_msgs/msg/KeyValuePubSubTypes.h" + #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ Generated CarlaActorInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. @@ -37,9 +39,43 @@ namespace carla_msgs { namespace msg { + namespace CarlaActorInfo_Constants + { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + /*! * @brief This class represents the TopicDataType of the type CarlaActorInfo defined by the user in the IDL file. - * @ingroup CARLAACTORINFO + * @ingroup CarlaActorInfo */ class CarlaActorInfoPubSubType : public eprosima::fastdds::dds::TopicDataType { @@ -49,7 +85,7 @@ namespace carla_msgs eProsima_user_DllExport CarlaActorInfoPubSubType(); - eProsima_user_DllExport virtual ~CarlaActorInfoPubSubType(); + eProsima_user_DllExport virtual ~CarlaActorInfoPubSubType() override; eProsima_user_DllExport virtual bool serialize( void* data, @@ -100,8 +136,10 @@ namespace carla_msgs MD5 m_md5; unsigned char* m_keyBuffer; + }; } } -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx index f1074ccd7aa..950e143610b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx @@ -16,7 +16,7 @@ * @file CarlaEgoVehicleTelemetryData.cpp * This source file contains the definition of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifdef _WIN32 @@ -34,26 +34,51 @@ using namespace eprosima::fastcdr::exception; #include +#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; +#define carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_cdr_typesize 44ULL; +#define carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_cdr_typesize 4704ULL; +#define std_msgs_msg_Header_max_cdr_typesize 268ULL; +#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; +#define carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_key_cdr_typesize 0ULL; +#define carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_key_cdr_typesize 0ULL; +#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; + + + + + + + + + + + + + + + carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData() { - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@14fc5f04 + // std_msgs::msg::Header m_header - // m_speed com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e2829c7 + // float m_speed m_speed = 0.0; - // m_steer com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3feb2dda + // float m_steer m_steer = 0.0; - // m_throttle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6a8658ff + // float m_throttle m_throttle = 0.0; - // m_brake com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1c742ed4 + // float m_brake m_brake = 0.0; - // m_engine_rpm com.eprosima.idl.parser.typecode.PrimitiveTypeCode@333d4a8c + // float m_engine_rpm m_engine_rpm = 0.0; - // m_gear com.eprosima.idl.parser.typecode.PrimitiveTypeCode@55de24cc + // long m_gear m_gear = 0; - // m_drag com.eprosima.idl.parser.typecode.PrimitiveTypeCode@dc7df28 + // float m_drag m_drag = 0.0; - // m_wheels com.eprosima.idl.parser.typecode.SequenceTypeCode@30f842ca + // sequence m_wheels + // unsigned long m_light_state_flags + m_light_state_flags = 0; } @@ -67,6 +92,8 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData::~CarlaEgoVehicleTelemetryData() + + } carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( @@ -81,10 +108,11 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( m_gear = x.m_gear; m_drag = x.m_drag; m_wheels = x.m_wheels; + m_light_state_flags = x.m_light_state_flags; } carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( - CarlaEgoVehicleTelemetryData&& x) + CarlaEgoVehicleTelemetryData&& x) noexcept { m_header = std::move(x.m_header); m_speed = x.m_speed; @@ -95,6 +123,7 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( m_gear = x.m_gear; m_drag = x.m_drag; m_wheels = std::move(x.m_wheels); + m_light_state_flags = x.m_light_state_flags; } carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator =( @@ -110,12 +139,13 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleT m_gear = x.m_gear; m_drag = x.m_drag; m_wheels = x.m_wheels; + m_light_state_flags = x.m_light_state_flags; return *this; } carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator =( - CarlaEgoVehicleTelemetryData&& x) + CarlaEgoVehicleTelemetryData&& x) noexcept { m_header = std::move(x.m_header); @@ -127,6 +157,7 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleT m_gear = x.m_gear; m_drag = x.m_drag; m_wheels = std::move(x.m_wheels); + m_light_state_flags = x.m_light_state_flags; return *this; } @@ -135,7 +166,7 @@ bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator ==( const CarlaEgoVehicleTelemetryData& x) const { - return (m_header == x.m_header && m_speed == x.m_speed && m_steer == x.m_steer && m_throttle == x.m_throttle && m_brake == x.m_brake && m_engine_rpm == x.m_engine_rpm && m_gear == x.m_gear && m_drag == x.m_drag && m_wheels == x.m_wheels); + return (m_header == x.m_header && m_speed == x.m_speed && m_steer == x.m_steer && m_throttle == x.m_throttle && m_brake == x.m_brake && m_engine_rpm == x.m_engine_rpm && m_gear == x.m_gear && m_drag == x.m_drag && m_wheels == x.m_wheels && m_light_state_flags == x.m_light_state_flags); } bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator !=( @@ -147,40 +178,8 @@ bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator !=( size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getMaxCdrSerializedSize(current_alignment);} - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_cdr_typesize; } size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getCdrSerializedSize( @@ -220,6 +219,9 @@ size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getCdrSerializedSize( { current_alignment += carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getCdrSerializedSize(data.wheels().at(a), current_alignment);} + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + return current_alignment - initial_alignment; } @@ -237,6 +239,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::serialize( scdr << m_gear; scdr << m_drag; scdr << m_wheels; + scdr << m_light_state_flags; } @@ -253,6 +256,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::deserialize( dcdr >> m_gear; dcdr >> m_drag; dcdr >> m_wheels; + dcdr >> m_light_state_flags; } /*! @@ -525,15 +529,41 @@ std::vector& carla_msgs::msg { return m_wheels; } +/*! + * @brief This function sets a value in member light_state_flags + * @param _light_state_flags New value for member light_state_flags + */ +void carla_msgs::msg::CarlaEgoVehicleTelemetryData::light_state_flags( + uint32_t _light_state_flags) +{ + m_light_state_flags = _light_state_flags; +} -size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize( - size_t current_alignment) +/*! + * @brief This function returns the value of member light_state_flags + * @return Value of member light_state_flags + */ +uint32_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::light_state_flags() const { - size_t current_align = current_alignment; + return m_light_state_flags; +} + +/*! + * @brief This function returns a reference to member light_state_flags + * @return Reference to member light_state_flags + */ +uint32_t& carla_msgs::msg::CarlaEgoVehicleTelemetryData::light_state_flags() +{ + return m_light_state_flags; +} - return current_align; +size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_key_cdr_typesize; } bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::isKeyDefined() @@ -545,7 +575,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h index 38ffe70e338..cff149cc65a 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h @@ -16,14 +16,16 @@ * @file CarlaEgoVehicleTelemetryData.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ +#include "CarlaEgoVehicleTelemetryDataWheel.h" #include "std_msgs/msg/Header.h" -#include "carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h" + +#include #include #include @@ -44,16 +46,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaEgoVehicleTelemetryData_SOURCE) -#define CarlaEgoVehicleTelemetryData_DllAPI __declspec( dllexport ) +#if defined(CARLAEGOVEHICLETELEMETRYDATA_SOURCE) +#define CARLAEGOVEHICLETELEMETRYDATA_DllAPI __declspec( dllexport ) #else -#define CarlaEgoVehicleTelemetryData_DllAPI __declspec( dllimport ) -#endif // CarlaEgoVehicleTelemetryData_SOURCE +#define CARLAEGOVEHICLETELEMETRYDATA_DllAPI __declspec( dllimport ) +#endif // CARLAEGOVEHICLETELEMETRYDATA_SOURCE #else -#define CarlaEgoVehicleTelemetryData_DllAPI +#define CARLAEGOVEHICLETELEMETRYDATA_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaEgoVehicleTelemetryData_DllAPI +#define CARLAEGOVEHICLETELEMETRYDATA_DllAPI #endif // _WIN32 namespace eprosima { @@ -65,9 +67,24 @@ class Cdr; namespace carla_msgs { namespace msg { + namespace CarlaEgoVehicleTelemetryData_Constants { + const uint32_t LIGHTSTATEFLAG_NONE = 0; + const uint32_t LIGHTSTATEFLAG_POSITION = 1; + const uint32_t LIGHTSTATEFLAG_LOWBEAM = 2; + const uint32_t LIGHTSTATEFLAG_HIGHBEAM = 4; + const uint32_t LIGHTSTATEFLAG_BRAKE = 8; + const uint32_t LIGHTSTATEFLAG_RIGHTBLINKER = 16; + const uint32_t LIGHTSTATEFLAG_LEFTBLINKER = 32; + const uint32_t LIGHTSTATEFLAG_REVERSE = 64; + const uint32_t LIGHTSTATEFLAG_FOG = 128; + const uint32_t LIGHTSTATEFLAG_INTERIOR = 256; + const uint32_t LIGHTSTATEFLAG_SPECIAL1 = 512; + const uint32_t LIGHTSTATEFLAG_SPECIAL2 = 1024; + const uint32_t LIGHTSTATEFLAG_ALL = 4294967295; + } // namespace CarlaEgoVehicleTelemetryData_Constants /*! * @brief This class represents the structure CarlaEgoVehicleTelemetryData defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLETELEMETRYDATA + * @ingroup CarlaEgoVehicleTelemetryData */ class CarlaEgoVehicleTelemetryData { @@ -95,7 +112,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. */ eProsima_user_DllExport CarlaEgoVehicleTelemetryData( - CarlaEgoVehicleTelemetryData&& x); + CarlaEgoVehicleTelemetryData&& x) noexcept; /*! * @brief Copy assignment. @@ -109,7 +126,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. */ eProsima_user_DllExport CarlaEgoVehicleTelemetryData& operator =( - CarlaEgoVehicleTelemetryData&& x); + CarlaEgoVehicleTelemetryData&& x) noexcept; /*! * @brief Comparison operator. @@ -308,13 +325,32 @@ namespace carla_msgs { * @return Reference to member wheels */ eProsima_user_DllExport std::vector& wheels(); + /*! + * @brief This function sets a value in member light_state_flags + * @param _light_state_flags New value for member light_state_flags + */ + eProsima_user_DllExport void light_state_flags( + uint32_t _light_state_flags); /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. + * @brief This function returns the value of member light_state_flags + * @return Value of member light_state_flags + */ + eProsima_user_DllExport uint32_t light_state_flags() const; + + /*! + * @brief This function returns a reference to member light_state_flags + * @return Reference to member light_state_flags */ + eProsima_user_DllExport uint32_t& light_state_flags(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -377,8 +413,11 @@ namespace carla_msgs { int32_t m_gear; float m_drag; std::vector m_wheels; + uint32_t m_light_state_flags; + }; } // namespace msg } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx index 4b80b9a7c91..592dbb703c3 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx @@ -16,7 +16,7 @@ * @file CarlaEgoVehicleTelemetryDataPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -30,6 +30,23 @@ using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; namespace carla_msgs { namespace msg { + namespace CarlaEgoVehicleTelemetryData_Constants { + + + + + + + + + + + + + + + } //End of namespace CarlaEgoVehicleTelemetryData_Constants + CarlaEgoVehicleTelemetryDataPubSubType::CarlaEgoVehicleTelemetryDataPubSubType() { setName("carla_msgs::msg::dds_::CarlaEgoVehicleTelemetryData_"); @@ -62,15 +79,15 @@ namespace carla_msgs { // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); // Serialize the object. p_type->serialize(ser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -84,25 +101,25 @@ namespace carla_msgs { SerializedPayload_t* payload, void* data) { - //Convert DATA to pointer of your type - CarlaEgoVehicleTelemetryData* p_type = static_cast(data); + try + { + // Convert DATA to pointer of your type + CarlaEgoVehicleTelemetryData* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - try - { // Deserialize the object. p_type->deserialize(deser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -173,4 +190,6 @@ namespace carla_msgs { } //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h index 6056b1a85ad..5ba0f3f94d1 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h @@ -16,7 +16,7 @@ * @file CarlaEgoVehicleTelemetryDataPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -28,6 +28,9 @@ #include "CarlaEgoVehicleTelemetryData.h" +#include "CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ Generated CarlaEgoVehicleTelemetryData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. @@ -37,9 +40,26 @@ namespace carla_msgs { namespace msg { + namespace CarlaEgoVehicleTelemetryData_Constants + { + + + + + + + + + + + + + + } + /*! * @brief This class represents the TopicDataType of the type CarlaEgoVehicleTelemetryData defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLETELEMETRYDATA + * @ingroup CarlaEgoVehicleTelemetryData */ class CarlaEgoVehicleTelemetryDataPubSubType : public eprosima::fastdds::dds::TopicDataType { @@ -49,7 +69,7 @@ namespace carla_msgs eProsima_user_DllExport CarlaEgoVehicleTelemetryDataPubSubType(); - eProsima_user_DllExport virtual ~CarlaEgoVehicleTelemetryDataPubSubType(); + eProsima_user_DllExport virtual ~CarlaEgoVehicleTelemetryDataPubSubType() override; eProsima_user_DllExport virtual bool serialize( void* data, @@ -100,8 +120,10 @@ namespace carla_msgs MD5 m_md5; unsigned char* m_keyBuffer; + }; } } -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx index 5fea3453e79..e42a9e76bac 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx @@ -16,7 +16,7 @@ * @file CarlaEgoVehicleTelemetryDataWheel.cpp * This source file contains the definition of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifdef _WIN32 @@ -34,29 +34,32 @@ using namespace eprosima::fastcdr::exception; #include +#define carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_cdr_typesize 44ULL; +#define carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_key_cdr_typesize 0ULL; + carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel() { - // m_tire_friction com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f15d60e + // float m_tire_friction m_tire_friction = 0.0; - // m_lat_slip com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1be2019a + // float m_lat_slip m_lat_slip = 0.0; - // m_long_slip com.eprosima.idl.parser.typecode.PrimitiveTypeCode@29d80d2b + // float m_long_slip m_long_slip = 0.0; - // m_omega com.eprosima.idl.parser.typecode.PrimitiveTypeCode@58e1d9d + // float m_omega m_omega = 0.0; - // m_tire_load com.eprosima.idl.parser.typecode.PrimitiveTypeCode@446a1e84 + // float m_tire_load m_tire_load = 0.0; - // m_normalized_tire_load com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f0f2942 + // float m_normalized_tire_load m_normalized_tire_load = 0.0; - // m_torque com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2657d4dd + // float m_torque m_torque = 0.0; - // m_long_force com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5340477f + // float m_long_force m_long_force = 0.0; - // m_lat_force com.eprosima.idl.parser.typecode.PrimitiveTypeCode@47caedad + // float m_lat_force m_lat_force = 0.0; - // m_normalized_long_force com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7139992f + // float m_normalized_long_force m_normalized_long_force = 0.0; - // m_normalized_lat_force com.eprosima.idl.parser.typecode.PrimitiveTypeCode@69504ae9 + // float m_normalized_lat_force m_normalized_lat_force = 0.0; } @@ -73,6 +76,7 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::~CarlaEgoVehicleTelemetryDat + } carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel( @@ -92,7 +96,7 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryData } carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel( - CarlaEgoVehicleTelemetryDataWheel&& x) + CarlaEgoVehicleTelemetryDataWheel&& x) noexcept { m_tire_friction = x.m_tire_friction; m_lat_slip = x.m_lat_slip; @@ -127,7 +131,7 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& carla_msgs::msg::CarlaEgoVeh } carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator =( - CarlaEgoVehicleTelemetryDataWheel&& x) + CarlaEgoVehicleTelemetryDataWheel&& x) noexcept { m_tire_friction = x.m_tire_friction; @@ -161,44 +165,8 @@ bool carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator !=( size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getMaxCdrSerializedSize( size_t current_alignment) { - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; + static_cast(current_alignment); + return carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_cdr_typesize; } size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getCdrSerializedSize( @@ -590,14 +558,12 @@ float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force( } + size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize( size_t current_alignment) { - size_t current_align = current_alignment; - - - - return current_align; + static_cast(current_alignment); + return carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_key_cdr_typesize; } bool carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::isKeyDefined() @@ -609,7 +575,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - } + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h index 03859a1c742..2eb27dafd62 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h @@ -16,13 +16,15 @@ * @file CarlaEgoVehicleTelemetryDataWheel.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ +#include + #include #include #include @@ -42,16 +44,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaEgoVehicleTelemetryDataWheel_SOURCE) -#define CarlaEgoVehicleTelemetryDataWheel_DllAPI __declspec( dllexport ) +#if defined(CARLAEGOVEHICLETELEMETRYDATAWHEEL_SOURCE) +#define CARLAEGOVEHICLETELEMETRYDATAWHEEL_DllAPI __declspec( dllexport ) #else -#define CarlaEgoVehicleTelemetryDataWheel_DllAPI __declspec( dllimport ) -#endif // CarlaEgoVehicleTelemetryDataWheel_SOURCE +#define CARLAEGOVEHICLETELEMETRYDATAWHEEL_DllAPI __declspec( dllimport ) +#endif // CARLAEGOVEHICLETELEMETRYDATAWHEEL_SOURCE #else -#define CarlaEgoVehicleTelemetryDataWheel_DllAPI +#define CARLAEGOVEHICLETELEMETRYDATAWHEEL_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaEgoVehicleTelemetryDataWheel_DllAPI +#define CARLAEGOVEHICLETELEMETRYDATAWHEEL_DllAPI #endif // _WIN32 namespace eprosima { @@ -65,7 +67,7 @@ namespace carla_msgs { namespace msg { /*! * @brief This class represents the structure CarlaEgoVehicleTelemetryDataWheel defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLETELEMETRYDATAWHEEL + * @ingroup CarlaEgoVehicleTelemetryDataWheel */ class CarlaEgoVehicleTelemetryDataWheel { @@ -93,7 +95,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. */ eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel( - CarlaEgoVehicleTelemetryDataWheel&& x); + CarlaEgoVehicleTelemetryDataWheel&& x) noexcept; /*! * @brief Copy assignment. @@ -107,7 +109,7 @@ namespace carla_msgs { * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. */ eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel& operator =( - CarlaEgoVehicleTelemetryDataWheel&& x); + CarlaEgoVehicleTelemetryDataWheel&& x) noexcept; /*! * @brief Comparison operator. @@ -334,11 +336,11 @@ namespace carla_msgs { /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ eProsima_user_DllExport static size_t getMaxCdrSerializedSize( size_t current_alignment = 0); @@ -403,8 +405,10 @@ namespace carla_msgs { float m_lat_force; float m_normalized_long_force; float m_normalized_lat_force; + }; } // namespace msg } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx index f50b3bfb5d8..f29375edf48 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx @@ -16,7 +16,7 @@ * @file CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -62,15 +62,15 @@ namespace carla_msgs { // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); // Serialize the object. p_type->serialize(ser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -84,25 +84,25 @@ namespace carla_msgs { SerializedPayload_t* payload, void* data) { - //Convert DATA to pointer of your type - CarlaEgoVehicleTelemetryDataWheel* p_type = static_cast(data); + try + { + // Convert DATA to pointer of your type + CarlaEgoVehicleTelemetryDataWheel* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - try - { // Deserialize the object. p_type->deserialize(deser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -173,4 +173,6 @@ namespace carla_msgs { } //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h index 79a78733627..b3e93e8987e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h @@ -16,7 +16,7 @@ * @file CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -28,6 +28,7 @@ #include "CarlaEgoVehicleTelemetryDataWheel.h" + #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ Generated CarlaEgoVehicleTelemetryDataWheel is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. @@ -37,9 +38,39 @@ namespace carla_msgs { namespace msg { + + #ifndef SWIG + namespace detail { + + template + struct CarlaEgoVehicleTelemetryDataWheel_rob + { + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + }; + + struct CarlaEgoVehicleTelemetryDataWheel_f + { + typedef float CarlaEgoVehicleTelemetryDataWheel::* type; + friend constexpr type get( + CarlaEgoVehicleTelemetryDataWheel_f); + }; + + template struct CarlaEgoVehicleTelemetryDataWheel_rob; + + template + inline size_t constexpr CarlaEgoVehicleTelemetryDataWheel_offset_of() { + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); + } + } + #endif + /*! * @brief This class represents the TopicDataType of the type CarlaEgoVehicleTelemetryDataWheel defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLETELEMETRYDATAWHEEL + * @ingroup CarlaEgoVehicleTelemetryDataWheel */ class CarlaEgoVehicleTelemetryDataWheelPubSubType : public eprosima::fastdds::dds::TopicDataType { @@ -49,7 +80,7 @@ namespace carla_msgs eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheelPubSubType(); - eProsima_user_DllExport virtual ~CarlaEgoVehicleTelemetryDataWheelPubSubType(); + eProsima_user_DllExport virtual ~CarlaEgoVehicleTelemetryDataWheelPubSubType() override; eProsima_user_DllExport virtual bool serialize( void* data, @@ -83,7 +114,7 @@ namespace carla_msgs #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN eProsima_user_DllExport inline bool is_plain() const override { - return true; + return is_plain_impl(); } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -100,8 +131,16 @@ namespace carla_msgs MD5 m_md5; unsigned char* m_keyBuffer; - }; + + private: + + static constexpr bool is_plain_impl() + { + return 44ULL == (detail::CarlaEgoVehicleTelemetryDataWheel_offset_of() + sizeof(float)); + + }}; } } -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/publishers/ObjectPublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectPublisher.cpp index 881a3ecbdce..9d16704902f 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/ObjectPublisher.cpp @@ -16,7 +16,7 @@ ObjectPublisher::ObjectPublisher(ROS2NameRecord &parent_publisher, std::shared_p bool ObjectPublisher::Init(std::shared_ptr domain_participant) { return _impl->InitHistoryPreallocatedWithReallocMemoryMode( - domain_participant, _parent_publisher.get_topic_name("object"), DEFAULT_SENSOR_DATA_QOS); + domain_participant, _parent_publisher.get_topic_name("object"), DEFAULT_PUBLISHER_QOS); } bool ObjectPublisher::Publish() { @@ -27,7 +27,7 @@ bool ObjectPublisher::SubscribersConnected() const { return _impl->SubscribersConnected(); } -void ObjectPublisher::UpdateObject(std::shared_ptr &object) { +void ObjectPublisher::UpdateObject(std::shared_ptr &object) { // forward the data to the objects publisher _objects_publisher->AddObject(object); derived_object_msgs::msg::Object ros_object = object->object(); diff --git a/LibCarla/source/carla/ros2/publishers/ObjectPublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectPublisher.h index 228f195f7a4..3341dcf3a67 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/ObjectPublisher.h @@ -34,7 +34,7 @@ class ObjectPublisher : public PublisherInterface { */ bool SubscribersConnected() const override; - void UpdateObject(std::shared_ptr &object); + void UpdateObject(std::shared_ptr &object); private: ROS2NameRecord &_parent_publisher; diff --git a/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.cpp index c1f393b2c0e..5f3727e96e7 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.cpp @@ -16,7 +16,7 @@ ObjectWithCovariancePublisher::ObjectWithCovariancePublisher(ROS2NameRecord &par bool ObjectWithCovariancePublisher::Init(std::shared_ptr domain_participant) { return _impl->InitHistoryPreallocatedWithReallocMemoryMode( - domain_participant, _parent_publisher.get_topic_name("object_with_covariance"), DEFAULT_SENSOR_DATA_QOS); + domain_participant, _parent_publisher.get_topic_name("object_with_covariance"), DEFAULT_PUBLISHER_QOS); } bool ObjectWithCovariancePublisher::Publish() { @@ -27,7 +27,7 @@ bool ObjectWithCovariancePublisher::SubscribersConnected() const { return _impl->SubscribersConnected(); } -void ObjectWithCovariancePublisher::UpdateObject(std::shared_ptr &object) { +void ObjectWithCovariancePublisher::UpdateObject(std::shared_ptr &object) { // forward the data to the objects publisher _objects_publisher->AddObject(object); derived_object_msgs::msg::ObjectWithCovariance ros_object_with_covariance = object->object_with_covariance(); diff --git a/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.h index 75c81effa3e..45708937097 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.h +++ b/LibCarla/source/carla/ros2/publishers/ObjectWithCovariancePublisher.h @@ -34,7 +34,7 @@ class ObjectWithCovariancePublisher : public PublisherInterface { */ bool SubscribersConnected() const override; - void UpdateObject(std::shared_ptr &object); + void UpdateObject(std::shared_ptr &object); private: ROS2NameRecord &_parent_publisher; diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp index 1b39465bdb7..01be3fbbefb 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp @@ -5,13 +5,18 @@ #include "ObjectsPublisher.h" #include "carla/ros2/impl/DdsPublisherImpl.h" +#include namespace carla { namespace ros2 { -ObjectsPublisher::ObjectsPublisher() - : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("objects")), - _impl(std::make_shared()) {} +ObjectsPublisher::ObjectsPublisher(ObjectsPublisher::ObjectMode const update_mode, std::string role_name) + : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName(role_name)) + , _impl(std::make_shared()) + , _update_mode(update_mode) +{ + _impl->Message().header().frame_id("map"); +} bool ObjectsPublisher::Init(std::shared_ptr domain_participant) { return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); @@ -19,8 +24,9 @@ bool ObjectsPublisher::Init(std::shared_ptr domain_par bool ObjectsPublisher::Publish() { bool result = _impl->Publish(); - // after every frame clear the objects - _impl->Message().objects().clear(); + if (_update_mode == ObjectsPublisher::ObjectMode::DYNAMIC_PUBLISH_ALWAYS) { + _impl->Message().objects().clear(); + } return result; } @@ -29,13 +35,35 @@ bool ObjectsPublisher::SubscribersConnected() const { } void ObjectsPublisher::UpdateHeader(const builtin_interfaces::msg::Time &stamp) { - _impl->SetMessageHeader(stamp, "map"); + _impl->Message().header().stamp(stamp); + if ((_update_mode == ObjectsPublisher::ObjectMode::DYNAMIC_PUBLISH_ALWAYS) + || (_update_mode == ObjectsPublisher::ObjectMode::STATIC_PUBLISH_ONCE)) { + _impl->SetMessageUpdated(); + } +} + +void ObjectsPublisher::UpdateObject(std::shared_ptr &object) { + auto find_res = std::find_if(_impl->Message().objects().begin(), _impl->Message().objects().end(), + [object](derived_object_msgs::msg::Object &ros_object){ return ros_object.id()==object->actor_id(); }); + if (find_res != _impl->Message().objects().end()) { + if ( object->has_dynamic_data_changed(*find_res) ) + { + derived_object_msgs::msg::Object const ros_object = object->object(); + *find_res=ros_object; + _impl->SetMessageUpdated(); + } + } } -void ObjectsPublisher::AddObject(std::shared_ptr &object) { - derived_object_msgs::msg::Object ros_object = object->object(); +void ObjectsPublisher::AddObject(carla::ros2::types::Object const &object) { + derived_object_msgs::msg::Object ros_object = object.object(); _impl->Message().objects().emplace_back(ros_object); } +void ObjectsPublisher::RemoveObject(uint64_t const object_id) { + std::remove_if(_impl->Message().objects().begin(), _impl->Message().objects().end(), + [object_id](derived_object_msgs::msg::Object &ros_object){ return ros_object.id()==object_id; }); +} + } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h index b7d149b08fd..d392ff5a693 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h @@ -16,7 +16,13 @@ using ObjectsPublisherImpl = class ObjectsPublisher : public PublisherBaseSensor { public: - ObjectsPublisher(); + enum class ObjectMode { + DYNAMIC_PUBLISH_ALWAYS, + DYNAMIC_PUBLISH_ON_CHANGE, + STATIC_PUBLISH_ONCE + }; + + ObjectsPublisher(ObjectMode const update_mode, std::string role_name = "objects"); virtual ~ObjectsPublisher() = default; /** @@ -35,10 +41,20 @@ class ObjectsPublisher : public PublisherBaseSensor { void UpdateHeader(const builtin_interfaces::msg::Time &stamp); - void AddObject(std::shared_ptr &object); + void UpdateObject(std::shared_ptr &object); + + void AddObject(std::shared_ptr &object) + { + AddObject(*object); + } + + void AddObject(carla::ros2::types::Object const &object); + + void RemoveObject(uint64_t const object_id); private: std::shared_ptr _impl; + ObjectMode const _update_mode; }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp index 39d3140a656..e7c21c63c79 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp @@ -32,7 +32,7 @@ void ObjectsWithCovariancePublisher::UpdateHeader(const builtin_interfaces::msg: _impl->SetMessageHeader(stamp, "map"); } -void ObjectsWithCovariancePublisher::AddObject(std::shared_ptr &object) { +void ObjectsWithCovariancePublisher::AddObject(std::shared_ptr &object) { derived_object_msgs::msg::ObjectWithCovariance ros_object_with_covariance = object->object_with_covariance(); _impl->Message().objects().emplace_back(ros_object_with_covariance); } diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h index d5016fa82ef..066b74fb481 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h +++ b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h @@ -35,7 +35,7 @@ class ObjectsWithCovariancePublisher : public PublisherBaseSensor { void UpdateHeader(const builtin_interfaces::msg::Time &stamp); - void AddObject(std::shared_ptr &object); + void AddObject(std::shared_ptr &object); private: std::shared_ptr _impl; diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBase.h b/LibCarla/source/carla/ros2/publishers/PublisherBase.h index 37a72f893d2..ab40360e33b 100644 --- a/LibCarla/source/carla/ros2/publishers/PublisherBase.h +++ b/LibCarla/source/carla/ros2/publishers/PublisherBase.h @@ -22,10 +22,10 @@ class PublisherBase : public PublisherInterface, public ROS2NameRecord { public: PublisherBase(std::shared_ptr actor_name_definition) : ROS2NameRecord(actor_name_definition) { - log_debug("PublisherBase created for topic {}", actor_name_definition->ros_name); + log_debug("PublisherBase created for topic ", actor_name_definition->ros_name); } virtual ~PublisherBase() { - log_debug("PublisherBase destroyed for topic {}", _actor_name_definition->ros_name); + log_debug("PublisherBase destroyed for topic ", _actor_name_definition->ros_name); }; /** @@ -70,6 +70,20 @@ class PublisherBase : public PublisherInterface, public ROS2NameRecord { (void) actor_id; return _actor_name_definition->enabled_for_ros; } + + /* + * @brief is the publisher actually enabled for ROS tf publication + */ + virtual bool do_publish_tf(carla::streaming::detail::actor_id_type actor_id=0) const { + (void) actor_id; + return _actor_name_definition->publish_tf; + } + + + carla_msgs::msg::CarlaActorInfo carla_actor_info(std::shared_ptr name_registry = nullptr) const { + return _actor_name_definition->carla_actor_info(name_registry); + } + }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h b/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h index cd04136dfa4..c7069d5060a 100644 --- a/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h +++ b/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h @@ -19,14 +19,6 @@ class PublisherBaseSensor : public PublisherBase { PublisherBaseSensor(std::shared_ptr actor_name_definition) : PublisherBase(actor_name_definition) {} virtual ~PublisherBaseSensor() = default; - - /* - * @brief Override ROS2NameRecord::get_topic_qos() for (pseudo) sensor publishers. - * I.e. deploy carla::ros2::DEFAULT_SENSOR_DATA_QOS - */ - ROS2QoS get_topic_qos() const { - return DEFAULT_SENSOR_DATA_QOS; - } }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp index 50f7782deaf..b0a026a252d 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp @@ -12,72 +12,100 @@ namespace ros2 { TrafficLightPublisher::TrafficLightPublisher( std::shared_ptr traffic_light_actor_definition, std::shared_ptr objects_publisher, - std::shared_ptr objects_with_covariance_publisher, std::shared_ptr traffic_lights_publisher) : PublisherBaseSensor( - std::static_pointer_cast(traffic_light_actor_definition)), - _traffic_light_info(std::make_shared()), - _traffic_light_status(std::make_shared()), - _traffic_light_object_publisher(std::make_shared(*this, objects_publisher)), - _traffic_light_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)), - _traffic_lights_publisher(traffic_lights_publisher) { - - _traffic_light_status->Message().state(carla_msgs::msg::CarlaTrafficLightStatus_Constants::UNKNOWN); + std::static_pointer_cast(traffic_light_actor_definition)) +#if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA + , _traffic_light_info_publisher(std::make_shared()) + , _traffic_light_status_publisher(std::make_shared()) + , _traffic_light_object_publisher(std::make_shared(*this, objects_publisher)) +#else + , _traffic_light_objects_publisher(objects_publisher) +#endif + , _traffic_lights_publisher(traffic_lights_publisher) { + _traffic_light_status.header().frame_id("map"); + _traffic_light_status.state(carla_msgs::msg::CarlaTrafficLightStatus_Constants::UNKNOWN); } bool TrafficLightPublisher::Init(std::shared_ptr domain_participant) { - return _traffic_light_info->Init(domain_participant, get_topic_name("traffic_light_info"), - PublisherBase::get_topic_qos()) && - _traffic_light_status->Init(domain_participant, get_topic_name("traffic_light_status"), - PublisherBase::get_topic_qos()) && - _traffic_light_object_publisher->Init(domain_participant) && - _traffic_light_object_with_covariance_publisher->Init(domain_participant); + bool success = true; +#if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA + success &= _traffic_light_info_publisher->Init(domain_participant, get_topic_name("traffic_light_info"), + PublisherBase::get_topic_qos()); +success &= _traffic_light_status_publisher->Init(domain_participant, get_topic_name("traffic_light_status"), + PublisherBase::get_topic_qos()); +success &= _traffic_light_object_publisher->Init(domain_participant); +#endif + return success; } bool TrafficLightPublisher::Publish() { - bool success = _traffic_light_info->Publish(); - success &= _traffic_light_status->Publish(); + bool success = true; +#if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA + success &= _traffic_light_info_publisher->Publish(); + success &= _traffic_light_status_publisher->Publish(); success &= _traffic_light_object_publisher->Publish(); - success &= _traffic_light_object_with_covariance_publisher->Publish(); +#endif return success; } bool TrafficLightPublisher::SubscribersConnected() const { - return _traffic_light_info->SubscribersConnected() || _traffic_light_status->SubscribersConnected() || - _traffic_light_object_publisher->SubscribersConnected() || _traffic_light_object_with_covariance_publisher->SubscribersConnected(); + bool connected = false; +#if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA + connected |= _traffic_light_info_publisher->SubscribersConnected(); + connected |= _traffic_light_status_publisher->SubscribersConnected(); + connected |= _traffic_light_object_publisher->SubscribersConnected(); +#endif + return connected; } -void TrafficLightPublisher::UpdateTrafficLight(std::shared_ptr &object, +void TrafficLightPublisher::UpdateTrafficLight(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &actor_dynamic_state) { - if ( (!_traffic_light_info_initialized) || (_traffic_light_info->Message().transform() != object->Transform().pose())) { + if ( (!_traffic_light_info_initialized) || (_traffic_light_info.transform() != object->Transform().pose())) { _traffic_light_info_initialized = true; - _traffic_light_info->Message().id(object->Id()); - _traffic_light_info->Message().transform(object->Transform().pose()); + _traffic_light_info.id(object->actor_id()); + _traffic_light_info.transform(object->Transform().pose()); // trigger volume auto traffic_light_actor_definition = std::dynamic_pointer_cast(_actor_name_definition); - auto global_location = traffic_light_actor_definition->trigger_volume.location; - object->Transform().GetTransform().TransformPoint(global_location); - _traffic_light_info->Message().trigger_volume().center().x(global_location.x); - _traffic_light_info->Message().trigger_volume().center().y(global_location.y); - _traffic_light_info->Message().trigger_volume().center().z(global_location.z); - auto const ros_extent = traffic_light_actor_definition->trigger_volume.extent * 2.; - _traffic_light_info->Message().trigger_volume().size().x(ros_extent.x); - _traffic_light_info->Message().trigger_volume().size().y(ros_extent.y); - _traffic_light_info->Message().trigger_volume().size().z(ros_extent.z); - - _traffic_light_info->SetMessageUpdated(); - _traffic_lights_publisher->UpdateTrafficLightInfo(_traffic_light_info->Message()); + if (traffic_light_actor_definition!=nullptr) + { + auto global_location = traffic_light_actor_definition->trigger_volume.location; + object->Transform().TransformPoint(global_location); + _traffic_light_info.trigger_volume().center().x(global_location.x); + _traffic_light_info.trigger_volume().center().y(global_location.y); + _traffic_light_info.trigger_volume().center().z(global_location.z); + auto const ros_extent = traffic_light_actor_definition->trigger_volume.extent * 2.; + _traffic_light_info.trigger_volume().size().x(ros_extent.x); + _traffic_light_info.trigger_volume().size().y(ros_extent.y); + _traffic_light_info.trigger_volume().size().z(ros_extent.z); + } + else + { + log_error("TrafficLightPublisher::UpdateTrafficLight(", std::to_string(*_actor_name_definition), + ") actor definition should be of type carla::ros2::types::TrafficLightActorDefinition"); + } +#if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA + _traffic_light_info_publisher->Message()=_traffic_light_info; + _traffic_light_info_publisher->SetMessageUpdated(); +#endif + _traffic_lights_publisher->UpdateTrafficLightInfo(_traffic_light_info); } - if (_traffic_light_status->Message().state() != carla::ros2::types::GetTrafficLightState(actor_dynamic_state)) { - _traffic_light_status->SetMessageHeader(object->Timestamp().time(), "map"); - _traffic_light_status->Message().id(_traffic_light_info->Message().id()); - _traffic_light_status->Message().state(carla::ros2::types::GetTrafficLightState(actor_dynamic_state)); - _traffic_lights_publisher->UpdateTrafficLightStatus(_traffic_light_status->Message()); + if (_traffic_light_status.state() != carla::ros2::types::GetTrafficLightState(actor_dynamic_state)) { + _traffic_light_status.id(_traffic_light_info.id()); + _traffic_light_status.state(carla::ros2::types::GetTrafficLightState(actor_dynamic_state)); + _traffic_light_status.header().stamp(object->Timestamp().time()); +#if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA + _traffic_light_status_publisher->Message()=_traffic_light_status; + _traffic_light_status_publisher->SetMessageUpdated(); +#endif + _traffic_lights_publisher->UpdateTrafficLightStatus(_traffic_light_status); } - +#if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA _traffic_light_object_publisher->UpdateObject(object); - _traffic_light_object_with_covariance_publisher->UpdateObject(object); +#else + _traffic_light_objects_publisher->UpdateObject(object); +#endif } } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h index 72d6794a4d0..098b2cbc4eb 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h @@ -5,7 +5,6 @@ #pragma once #include "carla/ros2/publishers/ObjectPublisher.h" -#include "carla/ros2/publishers/ObjectWithCovariancePublisher.h" #include "carla/ros2/publishers/PublisherBaseSensor.h" #include "carla/ros2/publishers/TrafficLightsPublisher.h" #include "carla/ros2/types/Object.h" @@ -14,6 +13,8 @@ #include "carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h" #include "carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h" +#define PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA 0 + namespace carla { namespace ros2 { @@ -26,7 +27,6 @@ class TrafficLightPublisher : public PublisherBaseSensor { public: TrafficLightPublisher(std::shared_ptr traffic_light_actor_definition, std::shared_ptr objects_publisher, - std::shared_ptr objects_with_covariance_publisher, std::shared_ptr traffic_lights_publisher); virtual ~TrafficLightPublisher() = default; @@ -44,16 +44,21 @@ class TrafficLightPublisher : public PublisherBaseSensor { */ bool SubscribersConnected() const override; - void UpdateTrafficLight(std::shared_ptr &object, + void UpdateTrafficLight(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &actor_dynamic_state); private: - std::shared_ptr _traffic_light_info; + carla_msgs::msg::CarlaTrafficLightStatus _traffic_light_status; + carla_msgs::msg::CarlaTrafficLightInfo _traffic_light_info; bool _traffic_light_info_initialized{false}; +#if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA + std::shared_ptr _traffic_light_info_publisher; bool _traffic_light_info_published{false}; - std::shared_ptr _traffic_light_status; + std::shared_ptr _traffic_light_status_publisher; std::shared_ptr _traffic_light_object_publisher; - std::shared_ptr _traffic_light_object_with_covariance_publisher; +#else + std::shared_ptr _traffic_light_objects_publisher; +#endif std::shared_ptr _traffic_lights_publisher; }; } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.cpp index 7f1b58bc15c..be9a8c51de3 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.cpp @@ -6,34 +6,53 @@ #include "carla/ros2/impl/DdsPublisherImpl.h" + namespace carla { namespace ros2 { TrafficSignPublisher::TrafficSignPublisher( std::shared_ptr traffic_sign_actor_definition, - std::shared_ptr objects_publisher, - std::shared_ptr objects_with_covariance_publisher) + std::shared_ptr objects_publisher) : PublisherBase( - std::static_pointer_cast(traffic_sign_actor_definition)), - _traffic_sign_object_publisher(std::make_shared(*this, objects_publisher)), - _traffic_sign_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)) {} + std::static_pointer_cast(traffic_sign_actor_definition)) +#if PUBLISH_INDIVIDUAL_TRAFFIC_SIGN_DATA + , _traffic_sign_object_publisher(std::make_shared(*this, objects_publisher)) +#else + , _traffic_sign_objects_publisher(objects_publisher) +#endif + {} bool TrafficSignPublisher::Init(std::shared_ptr domain_participant) { - return _traffic_sign_object_publisher->Init(domain_participant) && _traffic_sign_object_with_covariance_publisher->Init(domain_participant); + bool success = true; +#if PUBLISH_INDIVIDUAL_TRAFFIC_SIGN_DATA + success &= _traffic_sign_object_publisher->Init(domain_participant); +#endif + return success; } bool TrafficSignPublisher::Publish() { - return _traffic_sign_object_publisher->Publish() && _traffic_sign_object_with_covariance_publisher->Publish(); + bool success = true; +#if PUBLISH_INDIVIDUAL_TRAFFIC_SIGN_DATA + success &= _traffic_sign_object_publisher->Publish(); +#endif + return success; } bool TrafficSignPublisher::SubscribersConnected() const { - return _traffic_sign_object_publisher->SubscribersConnected() || _traffic_sign_object_with_covariance_publisher->SubscribersConnected(); + bool connected = false; +#if PUBLISH_INDIVIDUAL_TRAFFIC_SIGN_DATA + connected |= _traffic_sign_object_publisher->SubscribersConnected(); +#endif + return connected; } -void TrafficSignPublisher::UpdateTrafficSign(std::shared_ptr &object, +void TrafficSignPublisher::UpdateTrafficSign(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &) { +#if PUBLISH_INDIVIDUAL_TRAFFIC_SIGN_DATA _traffic_sign_object_publisher->UpdateObject(object); - _traffic_sign_object_with_covariance_publisher->UpdateObject(object); +#else + _traffic_sign_objects_publisher->UpdateObject(object); +#endif } } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.h b/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.h index 7237651b364..d40cf2653ef 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/TrafficSignPublisher.h @@ -5,20 +5,20 @@ #pragma once #include "carla/ros2/publishers/ObjectPublisher.h" -#include "carla/ros2/publishers/ObjectWithCovariancePublisher.h" #include "carla/ros2/publishers/PublisherBase.h" #include "carla/ros2/types/Object.h" #include "carla/ros2/types/TrafficSignActorDefinition.h" #include "carla/sensor/data/ActorDynamicState.h" +#define PUBLISH_INDIVIDUAL_TRAFFIC_SIGN_DATA 0 + namespace carla { namespace ros2 { class TrafficSignPublisher : public PublisherBase { public: TrafficSignPublisher(std::shared_ptr traffic_sign_actor_definition, - std::shared_ptr objects_publisher, - std::shared_ptr objects_with_covariance_publisher); + std::shared_ptr objects_publisher); virtual ~TrafficSignPublisher() = default; /** @@ -35,12 +35,15 @@ class TrafficSignPublisher : public PublisherBase { */ bool SubscribersConnected() const override; - void UpdateTrafficSign(std::shared_ptr &object, + void UpdateTrafficSign(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &actor_dynamic_state); private: +#if PUBLISH_INDIVIDUAL_TRAFFIC_SIGN_DATA std::shared_ptr _traffic_sign_object_publisher; - std::shared_ptr _traffic_sign_object_with_covariance_publisher; +#else + std::shared_ptr _traffic_sign_objects_publisher; +#endif }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index ef81df12ccb..a70c17e01e8 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -5,48 +5,111 @@ #include "UeWorldPublisher.h" #include "carla/sensor/data/RawEpisodeState.h" +#include "carla/ros2/publishers/CarlaActorListPublisher.h" +#include "carla/ros2/publishers/TransformPublisher.h" +#include "carla/ros2/publishers/UeCollisionPublisher.h" +#include "carla/ros2/publishers/UeDVSCameraPublisher.h" +#include "carla/ros2/publishers/UeDepthCameraPublisher.h" +#include "carla/ros2/publishers/UeGNSSPublisher.h" +#include "carla/ros2/publishers/UeIMUPublisher.h" +#include "carla/ros2/publishers/UeISCameraPublisher.h" +#include "carla/ros2/publishers/UeLidarPublisher.h" +#include "carla/ros2/publishers/UeNormalsCameraPublisher.h" +#include "carla/ros2/publishers/UeOpticalFlowCameraPublisher.h" +#include "carla/ros2/publishers/UeRGBCameraPublisher.h" +#include "carla/ros2/publishers/UeRadarPublisher.h" +#include "carla/ros2/publishers/UeSSCameraPublisher.h" +#include "carla/ros2/publishers/UeSemanticLidarPublisher.h" +#include "carla/ros2/publishers/UeV2XPublisher.h" +#include "carla/ros2/publishers/UeV2XCustomPublisher.h" +#include "carla/ros2/publishers/VehiclePublisher.h" +#include "carla/ros2/subscribers/AckermannControlSubscriber.h" +#include "carla/ros2/subscribers/VehicleControlSubscriber.h" #include "carla/ros2/types/EpisodeSettings.h" + +#include "carla/ros2/types/Acceleration.h" +#include "carla/ros2/types/AngularVelocity.h" +#include "carla/ros2/types/Quaternion.h" +#include "carla/ros2/types/Speed.h" +#include "carla/ros2/types/VehicleAckermannControl.h" +#include "carla/ros2/types/VehicleControl.h" + namespace carla { namespace ros2 { + UeWorldPublisher::UeWorldPublisher(carla::rpc::RpcServerInterface& carla_server, std::shared_ptr name_registry, std::shared_ptr sensor_actor_definition) : UePublisherBaseSensor(sensor_actor_definition, std::make_shared()), _carla_server(carla_server), _name_registry(name_registry), - _carla_status_publisher(std::make_shared()), - _carla_weather_publisher(std::make_shared(_carla_server)), - _carla_actor_list_publisher(std::make_shared("actor_list")), _clock_publisher(std::make_shared()), _world_info_publisher(std::make_shared(_carla_server)), - _objects_publisher(std::make_shared()), + _status_publisher(std::make_shared()), + _weather_publisher(std::make_shared(_carla_server)), + _sensor_actor_list_publisher(std::make_shared("sensor_list")), + _actor_list_publisher(std::make_shared("actor_list")), + _objects_publisher(std::make_shared(ObjectsPublisher::ObjectMode::DYNAMIC_PUBLISH_ALWAYS, "objects")), _objects_with_covariance_publisher(std::make_shared()), _traffic_lights_publisher(std::make_shared()), + _traffic_light_actor_list_publisher(std::make_shared("traffic_lights/actor_list")), + _traffic_light_objects_publisher(std::make_shared(ObjectsPublisher::ObjectMode::DYNAMIC_PUBLISH_ON_CHANGE, "traffic_lights/objects")), + _traffic_sign_actor_list_publisher(std::make_shared("traffic_signs/actor_list")), + _traffic_sign_objects_publisher(std::make_shared(ObjectsPublisher::ObjectMode::DYNAMIC_PUBLISH_ON_CHANGE, "traffic_signs/objects")), + _environment_actor_list_publisher(std::make_shared("environment/actor_list")), + _environment_objects_publisher(std::make_shared(ObjectsPublisher::ObjectMode::STATIC_PUBLISH_ONCE, "environment/objects")), _carla_control_subscriber(std::make_shared(*this, _carla_server)), _sync_subscriber(std::make_shared(*this, _carla_server)), _weather_control_subscriber(std::make_shared(*this, _carla_server)) { + + _dispatcher = _carla_server.GetDispatcher(); } bool UeWorldPublisher::Init(std::shared_ptr domain_participant) { + // add this to the list of sensors first + auto sensor_ue = AddSensorUeInternal(GetSensorActorDefinition()); + sensor_ue->publisher=std::static_pointer_cast(shared_from_this()); + _domain_participant_impl = domain_participant; - _initialized = _carla_status_publisher->Init(domain_participant) && - _carla_weather_publisher->Init(domain_participant) && - _carla_actor_list_publisher->Init(domain_participant) && _clock_publisher->Init(domain_participant) && - _world_info_publisher->Init(domain_participant) && _objects_publisher->Init(domain_participant) && - _objects_with_covariance_publisher->Init(domain_participant) && _traffic_lights_publisher->Init(domain_participant) && + _initialized = _transform_publisher->Init(domain_participant) && - _carla_control_subscriber->Init(domain_participant) && _sync_subscriber->Init(domain_participant) && - _weather_control_subscriber->Init(domain_participant); + _clock_publisher->Init(domain_participant) && + _world_info_publisher->Init(domain_participant) && + _status_publisher->Init(domain_participant) && + _weather_publisher->Init(domain_participant) && + _sensor_actor_list_publisher->Init(_domain_participant_impl) && + _actor_list_publisher->Init(domain_participant) && + _objects_publisher->Init(domain_participant) && + _objects_with_covariance_publisher->Init(domain_participant) && + _traffic_lights_publisher->Init(domain_participant) && + _traffic_light_actor_list_publisher->Init(_domain_participant_impl) && + _traffic_light_objects_publisher->Init(domain_participant) && + _traffic_sign_actor_list_publisher->Init(_domain_participant_impl) && + _traffic_sign_objects_publisher->Init(domain_participant) && + _environment_actor_list_publisher->Init(domain_participant) && + _environment_objects_publisher->Init(domain_participant) && + _carla_control_subscriber->Init(domain_participant) && + _weather_control_subscriber->Init(domain_participant) && + _sync_subscriber->Init(domain_participant); return _initialized; } +void UeWorldPublisher::Cleanup() { + _objects.clear(); + _vehicles.clear(); + _walkers.clear(); + _traffic_lights.clear(); + _traffic_signs.clear(); + _ue_sensors.clear(); +} + bool UeWorldPublisher::Publish() { if (!_initialized) { return false; } - return _clock_publisher->Publish() && _world_info_publisher->Publish() && _carla_weather_publisher->Publish(); + return _clock_publisher->Publish() && _world_info_publisher->Publish() && _weather_publisher->Publish(); } void UeWorldPublisher::ProcessMessages() { @@ -56,7 +119,7 @@ void UeWorldPublisher::ProcessMessages() { _carla_control_subscriber->ProcessMessages(); _sync_subscriber->ProcessMessages(); - _carla_weather_publisher->ProcessMessages(); + _weather_publisher->ProcessMessages(); _world_info_publisher->ProcessMessages(); _weather_control_subscriber->ProcessMessages(); for (auto& vehicle : _vehicles) { @@ -69,21 +132,247 @@ void UeWorldPublisher::ProcessMessages() { walker.second._walker_controller->ProcessMessages(); } + UpdateAndPublishEnvironmentObjects(); UpdateAndPublishStatus(); } +void UeWorldPublisher::UpdateSensorDataPreAction() { + for (auto &ue_sensor : _ue_sensors) { + if (ue_sensor.second.publisher_expected && (ue_sensor.second.publisher == nullptr)) { + CreateSensorUePublisher(ue_sensor.second); + } + if (ue_sensor.second.publisher != nullptr) { + if (ue_sensor.second.publisher->SubscribersConnected() && ue_sensor.second.session == nullptr) { + ue_sensor.second.session = std::make_shared(ue_sensor.first); + log_debug("UeWorldPublisher::UpdateSensorDataPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition), + "]: Registering session"); + _dispatcher->RegisterSession(ue_sensor.second.session); + } else if (!ue_sensor.second.publisher->SubscribersConnected() && ue_sensor.second.session != nullptr) { + log_debug("UeWorldPublisher::UpdateSensorDataPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition), + "]: Deregistering session"); + _dispatcher->DeregisterSession(ue_sensor.second.session); + ue_sensor.second.session.reset(); + } + } + } + + for (auto &ue_sensor : _ue_sensors) { + if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) ) { + ue_sensor.second.publisher->UpdateSensorDataPreAction(); + } + } + + if (_sensors_changed) { + _sensors_changed = false; + carla_msgs::msg::CarlaActorList actor_list; + for (auto &ue_sensor : _ue_sensors) { + if (ue_sensor.second.sensor_actor_definition->id != 0) { + actor_list.actors().push_back(ue_sensor.second.sensor_actor_definition->carla_actor_info(_name_registry)); + } + } + _sensor_actor_list_publisher->UpdateCarlaActorList(actor_list); + _sensor_actor_list_publisher->Publish(); + } +} + +void UeWorldPublisher::ProcessDataFromUeSensor(carla::streaming::detail::stream_id_type const stream_id, + std::shared_ptr message) { + auto ue_sensor = _ue_sensors.find(stream_id); + if (ue_sensor != _ue_sensors.end()) { + auto const &sensor_actor_definition = ue_sensor->second.sensor_actor_definition; + + auto buffer_list_view = message->GetBufferViewSequence(); + // currently we only support sensor header + data buffer + DEBUG_ASSERT_EQ(buffer_list_view.size(), 2u); + carla::SharedBufferView sensor_header_view = *buffer_list_view.begin(); + + auto sensor_header = std::shared_ptr( + sensor_header_view, reinterpret_cast( + sensor_header_view.get()->data())); + + if (ue_sensor->second.publisher) { + if ( ue_sensor->second.publisher->is_enabled_for_ros() ) { + auto data_view_iter = buffer_list_view.begin(); + data_view_iter++; + if (data_view_iter != buffer_list_view.end()) { + if (ue_sensor->second.publisher->do_publish_tf() ) { + ue_sensor->second.publisher->UpdateTransform(sensor_header); + } + ue_sensor->second.publisher->UpdateSensorData(sensor_header, *data_view_iter); + ue_sensor->second.publisher->Publish(); + } + log_verbose("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", + std::to_string(*sensor_actor_definition), " Processed."); + + } else { + log_verbose("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", + std::to_string(*sensor_actor_definition), std::to_string(*ue_sensor->second.publisher->_actor_name_definition), " not enabled for ROS. Dropping data."); + } + } else { + log_error("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", + std::to_string(*sensor_actor_definition), " not registered. Dropping data."); + } + + } else { + log_error("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", std::to_string(stream_id), + " not registered. Dropping data."); + } +} + void UeWorldPublisher::UpdateSensorDataPostAction() { if (!_initialized) { return; } + for (auto &ue_sensor : _ue_sensors) { + if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) ) { + ue_sensor.second.publisher->UpdateSensorDataPostAction(); + } + } + UpdateAndPublishStatus(); _transform_publisher->Publish(); - _carla_actor_list_publisher->Publish(); + _actor_list_publisher->Publish(); _objects_publisher->Publish(); _objects_with_covariance_publisher->Publish(); _traffic_lights_publisher->Publish(); + _traffic_light_actor_list_publisher->Publish(); + _traffic_light_objects_publisher->Publish(); + _traffic_sign_actor_list_publisher->Publish(); + _traffic_sign_objects_publisher->Publish(); +} + +void UeWorldPublisher::CreateSensorUePublisher(UeSensor &sensor) { + // Create the respective sensor publisher + switch (sensor.sensor_actor_definition->sensor_type) { + case types::PublisherSensorType::CollisionSensor: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::DepthCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::NormalsCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::DVSCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::GnssSensor: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::InertialMeasurementUnit: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::OpticalFlowCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::Radar: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::RayCastSemanticLidar: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::RayCastLidar: + case types::PublisherSensorType::HSSLidar: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::SceneCaptureCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher, sensor.actor_set_transform_callback)); + } break; + case types::PublisherSensorType::SemanticSegmentationCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::InstanceSegmentationCamera: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::V2X: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + } break; + case types::PublisherSensorType::V2XCustom: + { + sensor.publisher = std::static_pointer_cast( + std::make_shared(sensor.sensor_actor_definition, sensor.v2x_custom_send_callback, _transform_publisher)); + } break; + case types::PublisherSensorType::WorldObserver: + case types::PublisherSensorType::RssSensor: + // no server side interface to be implemented: maybe move client based implementation from client to the sensor + // folder for those? in each case should be implemented in a form that the actual calcuations are only performed + // if anyone listening to the topic + case types::PublisherSensorType::CameraGBufferUint8: + case types::PublisherSensorType::CameraGBufferFloat: + case types::PublisherSensorType::LaneInvasionSensor: + case types::PublisherSensorType::ObstacleDetectionSensor: + default: { + sensor.publisher_expected = false; + log_error("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + "]: Not a UE sensor or no publisher implemented yet"); + } + } + if (sensor.publisher != nullptr) { + if (!sensor.publisher->Init(_domain_participant_impl)) { + log_error("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + "]: Failed to init publisher"); + } else { + log_debug("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + "]: Publisher initialized"); + } + } +} + +UeWorldPublisher::UeSensor* UeWorldPublisher::AddSensorUeInternal(std::shared_ptr sensor_actor_definition) { + auto insert_result = _ue_sensors.insert({sensor_actor_definition->stream_id, UeSensor(sensor_actor_definition)}); + if (!insert_result.second) { + log_warning("UeWorldPublisher::AddSensorUe(", std::to_string(*sensor_actor_definition), + "): Sensor already_registered. Ignoring"); + return nullptr; + } + _sensors_changed = true; + return &insert_result.first->second; +} + +void UeWorldPublisher::AddSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback) { + auto ue_sensor = AddSensorUeInternal(sensor_actor_definition); + if ( ue_sensor != nullptr ) { + ue_sensor->actor_set_transform_callback = actor_set_transform_callback; + } +} + +void UeWorldPublisher::AddV2XCustomSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback) { + auto ue_sensor = AddSensorUeInternal(sensor_actor_definition); + if ( ue_sensor != nullptr ) { + ue_sensor->v2x_custom_send_callback = v2x_custom_send_callback; + } } void UeWorldPublisher::AddVehicleUe( @@ -173,10 +462,11 @@ void UeWorldPublisher::AddTrafficLightUe( if (!object_result.second) { object_result.first->second = object; } - _objects_changed = true; + _traffic_light_objects_publisher->AddObject(*object); + _traffic_lights_changed = true; auto traffic_light_publisher = std::make_shared(traffic_light_actor_definition, - _objects_publisher, _objects_with_covariance_publisher, _traffic_lights_publisher); + _traffic_light_objects_publisher, _traffic_lights_publisher); UeTrafficLight ue_traffic_light(traffic_light_publisher); auto traffic_light_result = _traffic_lights.insert({traffic_light_actor_definition->id, ue_traffic_light}); if (!traffic_light_result.second) { @@ -203,10 +493,11 @@ void UeWorldPublisher::AddTrafficSignUe( if (!object_result.second) { object_result.first->second = object; } - _objects_changed = true; + _traffic_sign_objects_publisher->AddObject(*object); + _traffic_signs_changed = true; auto traffic_sign_publisher = - std::make_shared(traffic_sign_actor_definition, _objects_publisher, _objects_with_covariance_publisher); + std::make_shared(traffic_sign_actor_definition, _traffic_sign_objects_publisher); UeTrafficSign ue_traffic_sign(traffic_sign_publisher); auto traffic_sign_result = _traffic_signs.insert({traffic_sign_actor_definition->id, ue_traffic_sign}); if (!traffic_sign_result.second) { @@ -228,32 +519,44 @@ void UeWorldPublisher::RemoveActor(ActorId actor) { return; } _objects.erase(actor); - _objects_changed = true; auto vehicle_iter = _vehicles.find(actor); if ( vehicle_iter != _vehicles.end() ) { log_debug("ROS2::RemoveVehicleUe(", std::to_string( *std::static_pointer_cast(vehicle_iter->second._vehicle_publisher->_actor_name_definition)), ")"); _vehicles.erase(vehicle_iter); + _objects_changed = true; } auto walker_iter = _walkers.find(actor); if ( walker_iter != _walkers.end() ) { log_debug("ROS2::RemoveWalkerUe(", std::to_string( *std::static_pointer_cast(walker_iter->second._walker_publisher->_actor_name_definition)), ")"); _walkers.erase(walker_iter); + _objects_changed = true; } auto traffic_light_iter = _traffic_lights.find(actor); if ( traffic_light_iter != _traffic_lights.end() ) { log_debug("ROS2::RemoveTrafficLightUe(", std::to_string( *std::static_pointer_cast(traffic_light_iter->second._traffic_light_publisher->_actor_name_definition)), ")"); _traffic_lights.erase(traffic_light_iter); + _traffic_lights_changed = true; } _traffic_lights_publisher->RemoveTrafficLight(actor); + _traffic_light_objects_publisher->RemoveObject(actor); auto traffic_sign_iter = _traffic_signs.find(actor); if ( traffic_sign_iter != _traffic_signs.end() ) { log_debug("ROS2::RemoveTrafficSignUe(", std::to_string( *std::static_pointer_cast(traffic_sign_iter->second._traffic_sign_publisher->_actor_name_definition)), ")"); _traffic_signs.erase(traffic_sign_iter); + _traffic_signs_changed = true; + } + _traffic_sign_objects_publisher->RemoveObject(actor); + + auto sensor_iter = find_ue_sensor(actor); + if (sensor_iter!=_ue_sensors.end()) { + log_debug("ROS2::RemoveSensorUe(", std::to_string(*sensor_iter->second.sensor_actor_definition), ")"); + _ue_sensors.erase(sensor_iter); + _sensors_changed = true; } } @@ -282,9 +585,9 @@ void UeWorldPublisher::UpdateAndPublishStatus() { } status.game_running(synchronization_target_game_time_min > _timestamp.Stamp()); - _carla_status_publisher->UpdateCarlaStatus(status); + _status_publisher->UpdateCarlaStatus(status); - _carla_status_publisher->Publish(); + _status_publisher->Publish(); } } @@ -308,75 +611,126 @@ void UeWorldPublisher::UpdateSensorData( } for (auto const& actor_dynamic_state : buffer_data_2_vector(buffer_view)) { - auto object_it = _objects.find(actor_dynamic_state.id); - std::shared_ptr object = nullptr; - bool object_enabled_for_ros = false; - if (object_it != _objects.end()) { - object = object_it->second; - } + bool actor_processed = false; + carla::ros2::types::Transform transform(actor_dynamic_state.transform, actor_dynamic_state.quaternion); + + auto object_it = _objects.find(actor_dynamic_state.id); + if (object_it != _objects.end()) { + object_it->second->UpdateObject(_timestamp, actor_dynamic_state); + + std::shared_ptr object = object_it->second; - if (object != nullptr) { - carla::ros2::types::Transform transform(actor_dynamic_state.transform, actor_dynamic_state.quaternion); auto vehicle_it = _vehicles.find(actor_dynamic_state.id); if (vehicle_it != _vehicles.end()) { + actor_processed=true; UeVehicle& ue_vehicle = vehicle_it->second; auto publisher = ue_vehicle._vehicle_publisher; if ( publisher->is_enabled_for_ros() ) { - object_enabled_for_ros = true; - publisher->UpdateTransform(_timestamp, transform); + if ( publisher->do_publish_tf() ) { + publisher->UpdateTransform(_timestamp, transform); + } publisher->UpdateVehicle(object, actor_dynamic_state); publisher->Publish(); } } - auto walker_it = _walkers.find(actor_dynamic_state.id); - if (walker_it != _walkers.end()) { - UeWalker& ue_walker = walker_it->second; - auto publisher = ue_walker._walker_publisher; - if ( publisher->is_enabled_for_ros() ) { - object_enabled_for_ros = true; - publisher->UpdateTransform(_timestamp, transform); - publisher->UpdateWalker(object, actor_dynamic_state); - publisher->Publish(); + if ( !actor_processed ) { + auto walker_it = _walkers.find(actor_dynamic_state.id); + if (walker_it != _walkers.end()) { + actor_processed=true; + UeWalker& ue_walker = walker_it->second; + auto publisher = ue_walker._walker_publisher; + if ( publisher->is_enabled_for_ros() ) { + if ( publisher->do_publish_tf() ) { + publisher->UpdateTransform(_timestamp, transform); + } + publisher->UpdateWalker(object, actor_dynamic_state); + publisher->Publish(); + } } } - auto traffic_sign_it = _traffic_signs.find(actor_dynamic_state.id); - if (traffic_sign_it != _traffic_signs.end()) { - UeTrafficSign& ue_traffic_sign = traffic_sign_it->second; - auto publisher = ue_traffic_sign._traffic_sign_publisher; - if ( publisher->is_enabled_for_ros() ) { - object_enabled_for_ros = true; - publisher->UpdateTrafficSign(object, actor_dynamic_state); - publisher->Publish(); + if ( !actor_processed ) { + auto traffic_sign_it = _traffic_signs.find(actor_dynamic_state.id); + if (traffic_sign_it != _traffic_signs.end()) { + actor_processed=true; + UeTrafficSign& ue_traffic_sign = traffic_sign_it->second; + auto publisher = ue_traffic_sign._traffic_sign_publisher; + if ( publisher->is_enabled_for_ros() ) { + publisher->UpdateTrafficSign(object, actor_dynamic_state); + publisher->Publish(); + } } } - auto traffic_light_it = _traffic_lights.find(actor_dynamic_state.id); - if (traffic_light_it != _traffic_lights.end()) { - UeTrafficLight& ue_traffic_light = traffic_light_it->second; - auto publisher = ue_traffic_light._traffic_light_publisher; - if ( publisher->is_enabled_for_ros() ) { - object_enabled_for_ros = true; - publisher->UpdateTrafficLight(object, actor_dynamic_state); - publisher->Publish(); + if ( !actor_processed ) { + auto traffic_light_it = _traffic_lights.find(actor_dynamic_state.id); + if (traffic_light_it != _traffic_lights.end()) { + actor_processed=true; + UeTrafficLight& ue_traffic_light = traffic_light_it->second; + auto publisher = ue_traffic_light._traffic_light_publisher; + if ( publisher->is_enabled_for_ros() ) { + publisher->UpdateTrafficLight(object, actor_dynamic_state); + publisher->Publish(); + } } } } - if ( object_enabled_for_ros ) { - object->UpdateObject(_timestamp, actor_dynamic_state); + if ( !actor_processed ) { + auto sensor_it = find_ue_sensor(actor_dynamic_state.id); + if ( sensor_it != _ue_sensors.end() ) { + actor_processed=true; + // store the transform to be able to calculate relative transform in case of nested sensors + sensor_it->second.transform = transform; + } + } + } + + for (auto &ue_sensor : _ue_sensors) { + if ( (ue_sensor.second.publisher != nullptr) && + (ue_sensor.first != GetSensorActorDefinition()->stream_id) && + (ue_sensor.second.publisher->is_enabled_for_ros()) && + (ue_sensor.second.publisher->do_publish_tf()) && + (!ue_sensor.second.publisher->SubscribersConnected())) { + // update sensor transform of sensors not subscribed, as their data stream is not deployed + auto const parent_actor_id = ue_sensor.second.publisher->get_parent_actor_id(); + auto const parent_transform = get_transform(parent_actor_id); + auto const relative_transform = ue_sensor.second.transform.GetRelativeTransform(parent_transform); + ue_sensor.second.publisher->UpdateTransform(_timestamp, relative_transform); } } if (_objects_changed) { _objects_changed = false; carla_msgs::msg::CarlaActorList actor_list; - for (auto const& object : _objects) { - actor_list.actors().push_back(object.second->carla_actor_info(_name_registry)); + for (auto const& vehicle : _vehicles) { + actor_list.actors().push_back(vehicle.second._vehicle_publisher->carla_actor_info(_name_registry)); + } + for (auto const& walker : _walkers) { + actor_list.actors().push_back(walker.second._walker_publisher->carla_actor_info(_name_registry)); + } + _actor_list_publisher->UpdateCarlaActorList(actor_list); + } + if (_traffic_lights_changed) { + _traffic_lights_changed = false; + carla_msgs::msg::CarlaActorList actor_list; + for (auto const& traffic_light : _traffic_lights) { + actor_list.actors().push_back(traffic_light.second._traffic_light_publisher->carla_actor_info(_name_registry)); + } + _traffic_light_actor_list_publisher->UpdateCarlaActorList(actor_list); + } + _traffic_light_objects_publisher->UpdateHeader(_timestamp.time()); + + if (_traffic_signs_changed) { + _traffic_signs_changed = false; + carla_msgs::msg::CarlaActorList actor_list; + for (auto const& traffic_sign : _traffic_signs) { + actor_list.actors().push_back(traffic_sign.second._traffic_sign_publisher->carla_actor_info(_name_registry)); } - _carla_actor_list_publisher->UpdateCarlaActorList(actor_list); + _traffic_sign_actor_list_publisher->UpdateCarlaActorList(actor_list); } + _traffic_sign_objects_publisher->UpdateHeader(_timestamp.time()); } void UeWorldPublisher::enable_for_ros(carla::streaming::detail::actor_id_type actor_id) { @@ -400,6 +754,15 @@ void UeWorldPublisher::enable_for_ros(carla::streaming::detail::actor_id_type ac if (traffic_light_it != _traffic_lights.end()) { traffic_light_it->second._traffic_light_publisher->enable_for_ros(); } + auto sensor_it = find_ue_sensor(actor_id); + if (sensor_it != _ue_sensors.end()) { + if ( !sensor_it->second.publisher->is_enabled_for_ros() ) { + log_debug("Enable Sensor for ROS: ", + std::to_string(*sensor_it->second.publisher->_actor_name_definition)); + sensor_it->second.publisher->enable_for_ros(); + } + } + } void UeWorldPublisher::disable_for_ros(carla::streaming::detail::actor_id_type actor_id) { @@ -423,6 +786,14 @@ void UeWorldPublisher::disable_for_ros(carla::streaming::detail::actor_id_type a if (traffic_light_it != _traffic_lights.end()) { traffic_light_it->second._traffic_light_publisher->disable_for_ros(); } + auto sensor_it = find_ue_sensor(actor_id); + if (sensor_it != _ue_sensors.end()) { + if ( sensor_it->second.publisher->is_enabled_for_ros() ) { + log_debug("Disable Sensor for ROS: ", + std::to_string(*sensor_it->second.publisher->_actor_name_definition)); + sensor_it->second.publisher->disable_for_ros(); + } + } } bool UeWorldPublisher::is_enabled_for_ros(carla::streaming::detail::actor_id_type actor_id) const { @@ -446,8 +817,108 @@ bool UeWorldPublisher::is_enabled_for_ros(carla::streaming::detail::actor_id_typ if (traffic_light_it != _traffic_lights.end()) { return traffic_light_it->second._traffic_light_publisher->is_enabled_for_ros(); } + auto sensor_it = find_ue_sensor(actor_id); + if (sensor_it != _ue_sensors.end()) { + return sensor_it->second.publisher->is_enabled_for_ros(); + } return false; } +void UeWorldPublisher::UpdateAndPublishEnvironmentObjects() +{ + if (!_initialized) + { + return; + } + + // The world observer enabled_for_ros flag is matching the ROS2TopicVisibility configuration value which is used to decide + // on the publication of the environment objects at this point + // Otherwhise one might have to define some enable_for_ros() calls for e.g. different carla::rpc::CityObjectLabel parameters + // if a fine granular selection will be required. + bool const ros2_topic_visibility = PublisherBase::is_enabled_for_ros(0); + if ( !ros2_topic_visibility) + { + return; + } + + if ( !_environment_objects_initialized ) + { + carla_msgs::msg::CarlaActorList actor_list; + for (auto label: {carla::rpc::CityObjectLabel::Any}) + { + auto response = _carla_server.call_get_environment_objects(static_cast(label)); + if ( !response.HasError() ) + { + auto const &environment_objects = response.Get(); + for (auto const& env_object : environment_objects) + { + auto const object = carla::ros2::types::Object(env_object, ros2_topic_visibility); + _environment_objects_publisher->AddObject(object); + actor_list.actors().push_back(object.carla_actor_info()); + } + } + } + if (!actor_list.actors().empty()) { + _environment_actor_list_publisher->UpdateCarlaActorList(actor_list); + _environment_objects_publisher->UpdateHeader(_timestamp.time()); + + _environment_objects_initialized = _environment_actor_list_publisher->Publish(); + _environment_objects_initialized &= _environment_objects_publisher->Publish(); + + log_debug("ROS2::UpdateAndPublishEnvironmentObjects() = ", actor_list.actors().size(), _environment_objects_initialized); + } + } +} + +void UeWorldPublisher::AttachActors(ActorId const child, ActorId const parent) { + log_debug("UeWorldPublisher::AttachActors[", child, "]: parent=", parent); + _name_registry->AttachActors(child, parent); + auto find_result = find_ue_sensor(child); + if ( find_result != _ue_sensors.end()) { + UeSensor &sensor = find_result->second; + if (sensor.publisher) { + log_error("UeWorldPublisher::AttachActors[", std::to_string(*sensor.sensor_actor_definition), + "]: Sensor attached to parent ", parent, + ". Sensor has already a running publisher with base topic name ", sensor.publisher->get_topic_name(), + " has to be destroyed due to re-attachment"); + sensor.publisher.reset(); + } + _sensors_changed = true; + } +} + +std::unordered_map::iterator +UeWorldPublisher::find_ue_sensor(ActorId actor_id) +{ + auto find_result = std::find_if(_ue_sensors.begin(), _ue_sensors.end(), + [actor_id](std::pair element) { + return actor_id == element.second.sensor_actor_definition->id; + }); + return find_result; +} + +std::unordered_map::const_iterator +UeWorldPublisher::find_ue_sensor(ActorId actor_id)const +{ + auto find_result = std::find_if(_ue_sensors.begin(), _ue_sensors.end(), + [actor_id](std::pair element) { + return actor_id == element.second.sensor_actor_definition->id; + }); + return find_result; +} + +carla::ros2::types::Transform UeWorldPublisher::get_transform(ActorId actor_id) { + auto object_it = _objects.find(actor_id); + if (object_it != _objects.end()) { + return object_it->second->Transform(); + } + auto sensor_it = find_ue_sensor(actor_id); + if ( sensor_it != _ue_sensors.end() ) { + return sensor_it->second.transform; + } + return carla::ros2::types::Transform(); +} + + } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h index 3d1b8527879..0131842fd57 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h @@ -5,6 +5,7 @@ #pragma once #include "carla/ros2/ROS2NameRegistry.h" +#include "carla/ros2/ROS2Session.h" #include "carla/ros2/publishers/CarlaActorListPublisher.h" #include "carla/ros2/publishers/CarlaStatusPublisher.h" #include "carla/ros2/publishers/ClockPublisher.h" @@ -43,9 +44,11 @@ namespace ros2 { * - vehicle * - traffic_light * - traffic_sign - * + * - environment_objects + * -... + * */ -class UeWorldPublisher : public UePublisherBaseSensor { +class UeWorldPublisher : public UePublisherBaseSensor, public std::enable_shared_from_this { public: UeWorldPublisher(carla::rpc::RpcServerInterface &carla_server, std::shared_ptr name_registry, std::shared_ptr sensor_actor_definition); @@ -56,6 +59,8 @@ class UeWorldPublisher : public UePublisherBaseSensor { */ bool Init(std::shared_ptr domain_participant) override; + void Cleanup(); + /** * Implement PublisherInterface::Publish interface */ @@ -78,6 +83,11 @@ class UeWorldPublisher : public UePublisherBaseSensor { */ void RemoveActor(ActorId actor); + /** + * Implement UePublisherBaseSensor::UpdateSensorDataPreAction() + */ + void UpdateSensorDataPreAction() override; + /** * Implement UePublisherBaseSensor::UpdateSensorData() */ @@ -88,6 +98,7 @@ class UeWorldPublisher : public UePublisherBaseSensor { */ void UpdateSensorDataPostAction() override; + void AttachActors(ActorId const child, ActorId const parent); void AddVehicleUe(std::shared_ptr vehicle_actor_definition, carla::ros2::types::VehicleControlCallback vehicle_control_callback, @@ -98,6 +109,14 @@ class UeWorldPublisher : public UePublisherBaseSensor { void AddTrafficLightUe( std::shared_ptr traffic_light_actor_definition); void AddTrafficSignUe(std::shared_ptr traffic_sign_actor_definition); + void AddSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback = nullptr); + void AddV2XCustomSensorUe(std::shared_ptr sensor_actor_definition, + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback); + + void ProcessDataFromUeSensor(carla::streaming::detail::stream_id_type const stream_id, + std::shared_ptr message); + uint64_t CurrentFrame() const { return _frame; @@ -106,9 +125,6 @@ class UeWorldPublisher : public UePublisherBaseSensor { return _timestamp; } - auto GetTransformPublisher() const { - return _transform_publisher; - } /* * @brief enable actor ROS publication @@ -127,6 +143,7 @@ class UeWorldPublisher : public UePublisherBaseSensor { private: void UpdateAndPublishStatus(); + void UpdateAndPublishEnvironmentObjects(); using EpisodeHeaderConst = carla::sensor::s11n::EpisodeStateSerializer::Header const; @@ -148,12 +165,12 @@ class UeWorldPublisher : public UePublisherBaseSensor { buffer_view, carla::sensor::s11n::EpisodeStateSerializer::header_offset); } + carla::ros2::types::Transform get_transform(ActorId actor_id); + carla::ros2::types::Timestamp _timestamp{}; uint64_t _frame{0u}; carla::sensor::s11n::EpisodeStateSerializer::Header _episode_header; bool _frame_changed{false}; - // ensure to send out at least one message with empty object list - bool _objects_changed{true}; std::unordered_map> _objects; struct UeVehicle { @@ -196,19 +213,57 @@ class UeWorldPublisher : public UePublisherBaseSensor { }; std::unordered_map _traffic_signs; + struct UeSensor { + UeSensor(std::shared_ptr sensor_actor_definition_) + : sensor_actor_definition(sensor_actor_definition_) {} + std::shared_ptr sensor_actor_definition; + carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback{nullptr}; + bool publisher_expected{true}; + std::shared_ptr publisher; + std::shared_ptr session; + carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback{nullptr}; + carla::ros2::types::Transform transform; + }; + std::unordered_map _ue_sensors; + + UeSensor* AddSensorUeInternal(std::shared_ptr sensor_actor_definition); + void CreateSensorUePublisher(UeSensor& sensor); + std::unordered_map::iterator find_ue_sensor(ActorId actor_id); + std::unordered_map::const_iterator find_ue_sensor(ActorId actor_id) const; + std::shared_ptr _domain_participant_impl; carla::rpc::RpcServerInterface &_carla_server; std::shared_ptr _name_registry; + std::shared_ptr _dispatcher; + // publisher - std::shared_ptr _carla_status_publisher; - std::shared_ptr _carla_weather_publisher; - std::shared_ptr _carla_actor_list_publisher; std::shared_ptr _clock_publisher; std::shared_ptr _world_info_publisher; + std::shared_ptr _status_publisher; + std::shared_ptr _weather_publisher; + + bool _sensors_changed{false}; + std::shared_ptr _sensor_actor_list_publisher; + + bool _objects_changed{true}; + std::shared_ptr _actor_list_publisher; std::shared_ptr _objects_publisher; std::shared_ptr _objects_with_covariance_publisher; + + bool _traffic_lights_changed{true}; std::shared_ptr _traffic_lights_publisher; + std::shared_ptr _traffic_light_actor_list_publisher; + std::shared_ptr _traffic_light_objects_publisher; + + bool _traffic_signs_changed{true}; + std::shared_ptr _traffic_sign_actor_list_publisher; + std::shared_ptr _traffic_sign_objects_publisher; + + std::shared_ptr _environment_actor_list_publisher; + std::shared_ptr _environment_objects_publisher; + bool _environment_objects_initialized{false}; + // subscriber std::shared_ptr _carla_control_subscriber; std::shared_ptr _weather_control_subscriber; diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp index 0c6a376a411..fe376a95abf 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -100,13 +100,13 @@ bool VehiclePublisher::ProcessMessages() { // This should happen within the message processing step, when also other calls are expected // to ensure the simulation internal data is actually locked and its safe to acceess it. if (_vehicle_telemetry_publisher->SubscribersConnected()) { - auto response = _carla_server.call_get_telemetry_data(_actor_name_definition->id); - if (response.HasError()) { + auto telemetry_data_response = _carla_server.call_get_telemetry_data(_actor_name_definition->id); + if (telemetry_data_response.HasError()) { carla::log_warning("VehiclePublisher: Failed to get telemetry data for actor id ", - std::to_string(_actor_name_definition->id), ":", response.GetError().What()); + std::to_string(_actor_name_definition->id), ":", telemetry_data_response.GetError().What()); } else { - auto const telemetry_data = response.Get(); + auto const telemetry_data = telemetry_data_response.Get(); _vehicle_telemetry_publisher->Message().throttle(telemetry_data.throttle); _vehicle_telemetry_publisher->Message().steer(telemetry_data.steer); _vehicle_telemetry_publisher->Message().brake(telemetry_data.brake); @@ -133,11 +133,20 @@ bool VehiclePublisher::ProcessMessages() { _vehicle_telemetry_publisher->SetMessageUpdated(); } + auto light_state_response = _carla_server.call_get_vehicle_light_state(_actor_name_definition->id); + if (light_state_response.HasError()) { + carla::log_warning("VehiclePublisher: Failed to get vehicle light state for actor id ", + std::to_string(_actor_name_definition->id), ":", light_state_response.GetError().What()); + } else { + auto const light_state = light_state_response.Get(); + _vehicle_telemetry_publisher->Message().light_state_flags(light_state.light_state); + _vehicle_telemetry_publisher->SetMessageUpdated(); + } } return true; } -void VehiclePublisher::UpdateVehicle(std::shared_ptr &object, +void VehiclePublisher::UpdateVehicle(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &actor_dynamic_state) { _vehicle_odometry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); _vehicle_odometry_publisher->Message().child_frame_id(frame_id()); diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h index 97aea7e9b54..c2463097e9c 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h @@ -62,7 +62,7 @@ class VehiclePublisher : public PublisherBaseTransform { */ bool ProcessMessages(); - void UpdateVehicle(std::shared_ptr &object, + void UpdateVehicle(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &actor_dynamic_state); private: diff --git a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp index c47f3361276..0371b607aac 100644 --- a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp @@ -40,7 +40,7 @@ bool WalkerPublisher::SubscribersConnected() const { _walker_object_with_covariance_publisher->SubscribersConnected(); } -void WalkerPublisher::UpdateWalker(std::shared_ptr &object, +void WalkerPublisher::UpdateWalker(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &) { _walker_odometry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); _walker_odometry_publisher->Message().child_frame_id(frame_id()); diff --git a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.h b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.h index 1f865be100f..5292a324810 100644 --- a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.h @@ -41,7 +41,7 @@ class WalkerPublisher : public PublisherBaseTransform { */ bool SubscribersConnected() const override; - void UpdateWalker(std::shared_ptr &object, + void UpdateWalker(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &actor_dynamic_state); private: diff --git a/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp b/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp index aa1fa8ac1d4..6c3d598b646 100644 --- a/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp +++ b/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp @@ -37,7 +37,8 @@ carla_msgs::srv::SpawnObject_Response SpawnObjectService::SpawnObject( carla_msgs::srv::SpawnObject_Request const &request) { carla_msgs::srv::SpawnObject_Response response; - log_debug("ROS2:SpawnObjectService processing request for '", request.blueprint().id(), "' Pose: ", request.random_pose()?"random":"provided"); + log_debug("ROS2:SpawnObjectService processing request for '", request.blueprint().id(), "' Pose: ", + request.random_pose()?"random":std::to_string(carla::ros2::types::Transform(request.transform()))); int32_t retry_count = 5; do { @@ -61,7 +62,7 @@ carla_msgs::srv::SpawnObject_Response SpawnObjectService::SpawnObject( carla::ros2::types::Transform ros_transform(request.transform()); transform = ros_transform.GetTransform(); } - log_debug("ROS2:SpawnObjectService processing request. Pose: (", transform.location.x, ", ", transform.location.y, ", ", transform.location.z, ")"); + log_debug("ROS2:SpawnObjectService processing request. Pose: ", std::to_string(transform), ")"); auto blueprints = carla::actors::BlueprintLibrary(_carla_server.call_get_actor_definitions().Get()).Filter(request.blueprint().id()); if (blueprints->empty()) { diff --git a/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.cpp b/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.cpp index cb73974ab68..239ad1a8e83 100644 --- a/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.cpp +++ b/LibCarla/source/carla/ros2/subscribers/ActorSetTransformSubscriber.cpp @@ -22,7 +22,8 @@ bool ActorSetTransformSubscriber::Init(std::shared_ptr void ActorSetTransformSubscriber::ProcessMessages() { while (_impl->HasPublishersConnected() && _impl->HasNewMessage()) { if (_actor_set_transform_callback != nullptr ) { - _actor_set_transform_callback(carla::ros2::types::Transform(_impl->GetMessage())); + carla::ros2::types::Transform transform(_impl->GetMessage()); + _actor_set_transform_callback(transform); } else { carla::log_error("ActorSetTransformSubscriber::ProcessMessages >> set_transform callback is not available!"); diff --git a/LibCarla/source/carla/ros2/types/ActorDefinition.h b/LibCarla/source/carla/ros2/types/ActorDefinition.h index bc3dd03e248..afce36a7a2b 100644 --- a/LibCarla/source/carla/ros2/types/ActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/ActorDefinition.h @@ -5,6 +5,7 @@ #pragma once #include "carla/geom/BoundingBox.h" +#include "carla/rpc/EnvironmentObject.h" #include "carla/ros2/types/ActorNameDefinition.h" #include "carla/ros2/types/Polygon.h" #include "carla/ros2/types/Transform.h" @@ -13,12 +14,33 @@ namespace carla { namespace ros2 { namespace types { -using ActorSetTransformCallback = std::function; +using ActorSetTransformCallback = std::function; struct ActorDefinition : public ActorNameDefinition { - ActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox bounding_box_) + ActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox const &bounding_box_) : ActorNameDefinition(actor_name_definition), bounding_box(bounding_box_) { + normalize_bounding_box(); + } + + ActorDefinition(const carla::rpc::EnvironmentObject &env_object, bool enabled_for_ros_) + : bounding_box(env_object.bounding_box) { + + id = env_object.id; + type_id = env_object.name; + object_type=std::to_string(env_object.type); + base_type="environment_object"; + enabled_for_ros = enabled_for_ros_; + city_object_label=env_object.type; + + normalize_bounding_box(); + } + + carla::geom::BoundingBox bounding_box; + +private: + void normalize_bounding_box() { + // Unreal Bounding Boxes seem to be not always correct (some were NaN) if ( std::fpclassify(bounding_box.extent.x) != FP_NORMAL ) { bounding_box.extent.x = 0.1f; @@ -26,8 +48,6 @@ struct ActorDefinition : public ActorNameDefinition { bounding_box.extent.z = 0.1f; } } - - carla::geom::BoundingBox bounding_box; }; diff --git a/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp b/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp index b30ad3ed4c4..9297eb0dc18 100644 --- a/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp +++ b/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp @@ -3,6 +3,7 @@ // For a copy, see . #include "carla/ros2/types/ActorNameDefinition.h" +#include "carla/ros2/types/SensorActorDefinition.h" #include "carla/ros2/ROS2NameRegistry.h" @@ -13,18 +14,45 @@ namespace types { carla_msgs::msg::CarlaActorInfo ActorNameDefinition::carla_actor_info(std::shared_ptr name_registry) const { carla_msgs::msg::CarlaActorInfo actor_info; actor_info.id(id); - actor_info.parent_id(name_registry->ParentActorId(id)); actor_info.type(type_id); actor_info.rosname(ros_name); actor_info.rolename(role_name); actor_info.object_type(object_type); actor_info.base_type(base_type); - auto topic_prefix = name_registry->TopicPrefix(id); - if ( topic_prefix.length() >= 3 ) - { - // remove "rt" prefix - actor_info.topic_prefix(topic_prefix.substr(3)); + if ( name_registry != nullptr ) { + actor_info.parent_id(name_registry->ParentActorId(id)); + auto topic_prefix = name_registry->TopicPrefix(id); + if ( topic_prefix.length() >= 3 ) { + // remove "rt/" prefix + topic_prefix = topic_prefix.substr(3); + } + if ( topic_prefix.front() == '/') { + // remove any leading "/" + topic_prefix.erase(topic_prefix.begin()); + } + actor_info.topic_prefix(topic_prefix); + auto sensor_actor_definition = dynamic_cast(this); + if ( sensor_actor_definition != nullptr ) { + if ( id == 0 ) { + // the world and multiple world sensors share the same id + actor_info.frame_id("map"); + } else { + actor_info.frame_id(name_registry->FrameId(id)); + } + } + } else { + // environment objects + actor_info.parent_id(0); + actor_info.topic_prefix("environment/"); } + for (auto const &attribute: attributes) { + diagnostic_msgs::msg::KeyValue key_value; + key_value.key(attribute.first); + key_value.value(attribute.second); + actor_info.attributes().push_back(key_value); + } + actor_info.city_object_label(static_cast(city_object_label)); + return actor_info; } diff --git a/LibCarla/source/carla/ros2/types/ActorNameDefinition.h b/LibCarla/source/carla/ros2/types/ActorNameDefinition.h index 3820cb1bbda..2d8d6c9ddaa 100644 --- a/LibCarla/source/carla/ros2/types/ActorNameDefinition.h +++ b/LibCarla/source/carla/ros2/types/ActorNameDefinition.h @@ -5,9 +5,13 @@ #pragma once #include +#include +#include #include "carla/streaming/detail/Types.h" +#include "carla/rpc/ObjectLabel.h" #include "carla_msgs/msg/CarlaActorInfo.h" +#include "carla/ros2/ROS2TopicVisibilityDefaultMode.h" namespace carla { namespace ros2 { @@ -17,20 +21,70 @@ class ROS2NameRegistry; namespace types { struct ActorNameDefinition { - ActorNameDefinition(carla::streaming::detail::actor_id_type id_ = 0u, std::string type_id_ = "", std::string ros_name_ = "", - std::string role_name_ = "", std::string object_type_ = "", std::string base_type_ = "", bool enabled_for_ros_ = false) + + ActorNameDefinition() {}; + + ActorNameDefinition(ActorNameDefinition const &other, carla::rpc::CityObjectLabel city_object_label_) + : id(other.id), + type_id(other.type_id), + ros_name(other.ros_name), + role_name(other.role_name), + object_type(other.object_type), + base_type(other.base_type), + enabled_for_ros(other.enabled_for_ros), + publish_tf(other.publish_tf), + frame_id(other.frame_id), + city_object_label(city_object_label_), + attributes(other.attributes) { + } + +#ifdef LIBCARLA_INCLUDED_FROM_UE4 + ActorNameDefinition(uint64_t id_, std::string type_id_, FActorDescription const &Description, carla::ros2::ROS2TopicVisibilityDefaultMode const topic_visibility_default_mode) : id(id_), type_id(type_id_), - ros_name(ros_name_), - role_name(role_name_), - object_type(object_type_), - base_type(base_type_), - enabled_for_ros(enabled_for_ros_) {} + ros_name(std::string(TCHAR_TO_UTF8(*Description.GetAttribute("ros_name").Value))), + role_name(std::string(TCHAR_TO_UTF8(*Description.GetAttribute("role_name").Value))), + object_type(std::string(TCHAR_TO_UTF8(*Description.GetAttribute("object_type").Value))), + base_type(std::string(TCHAR_TO_UTF8(*Description.GetAttribute("base_type").Value))), + enabled_for_ros(false), + frame_id(TCHAR_TO_UTF8(*Description.GetAttribute("ros_frame_id").Value)), + city_object_label(carla::rpc::CityObjectLabel::None) { + + std::string enabled_for_ros_string = TCHAR_TO_UTF8(*Description.GetAttribute("enabled_for_ros").Value); + if ( (enabled_for_ros_string == "") && (topic_visibility_default_mode == carla::ros2::ROS2TopicVisibilityDefaultMode::eOn )) { + enabled_for_ros = true; + } + else { + enabled_for_ros = Description.GetAttribute("enabled_for_ros").Value.ToBool(); + } + std::string ros_publish_tf_string = TCHAR_TO_UTF8(*Description.GetAttribute("ros_publish_tf").Value); + if ( (ros_publish_tf_string == "") && (topic_visibility_default_mode == carla::ros2::ROS2TopicVisibilityDefaultMode::eOn )) { + publish_tf = true; + } + else { + publish_tf = Description.GetAttribute("ros_publish_tf").Value.ToBool(); + } - static std::shared_ptr CreateFromRoleName(std::string const &role_name_, bool enabled_for_ros_ = false) { + for (auto const &ActorVariation: Description.Variations) { + std::string key = TCHAR_TO_UTF8(*ActorVariation.Key); + // filter out some values already stored explicitly + if ((key == "ros_name") + || (key == "role_name") + || (key == "object_type") + || (key == "base_type")) { + continue; + } + std::string value = TCHAR_TO_UTF8(*ActorVariation.Value.Value); + attributes[key] = value; + } } +#endif + + static std::shared_ptr CreateFromRoleName(std::string const &role_name_, + carla::ros2::ROS2TopicVisibilityDefaultMode const topic_visibility_default_mode = carla::ros2::ROS2TopicVisibilityDefaultMode::eOn ) { auto actor_name_definition = std::make_shared(); actor_name_definition->role_name = role_name_; - actor_name_definition->enabled_for_ros = enabled_for_ros_; + actor_name_definition->base_type = "world"; + actor_name_definition->enabled_for_ros = topic_visibility_default_mode == carla::ros2::ROS2TopicVisibilityDefaultMode::eOn; return actor_name_definition; } @@ -38,13 +92,18 @@ struct ActorNameDefinition { virtual ~ActorNameDefinition() = default; - carla::streaming::detail::actor_id_type id; + uint64_t id{0u}; std::string type_id; std::string ros_name; std::string role_name; std::string object_type; std::string base_type; - bool enabled_for_ros; + bool enabled_for_ros{false}; + bool publish_tf{true}; + std::string frame_id; + carla::rpc::CityObjectLabel city_object_label{carla::rpc::CityObjectLabel::None}; + std::map attributes; + }; } // namespace types } // namespace ros2 @@ -53,10 +112,21 @@ struct ActorNameDefinition { namespace std { inline std::string to_string(carla::ros2::types::ActorNameDefinition const &actor_definition) { - return "ActorName(actor_id=" + std::to_string(actor_definition.id) + " type_id=" + actor_definition.type_id + - " ros_name=" + actor_definition.ros_name + " role_name=" + actor_definition.role_name + - " object_type=" + actor_definition.object_type + " base_type=" + actor_definition.base_type + - " enabled_for_ros=" + std::to_string(actor_definition.enabled_for_ros) + ")"; + std::stringstream str; + str << "ActorName(actor_id=" << std::to_string(actor_definition.id) + << " type_id=" << actor_definition.type_id + << " ros_name=" << actor_definition.ros_name + << " role_name=" << actor_definition.role_name + << " object_type=" << actor_definition.object_type + << " base_type=" << actor_definition.base_type + << " enabled_for_ros=" << std::to_string(actor_definition.enabled_for_ros) + << " publish_tf=" << std::to_string(actor_definition.publish_tf) + << " frame_id=" << actor_definition.frame_id; + for (auto const &attribute: actor_definition.attributes) { + str << " " << attribute.first << "=" << attribute.second; + } + str << ")"; + return str.str(); } } // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Object.h b/LibCarla/source/carla/ros2/types/Object.h index 5390f7e845d..72b681924b0 100644 --- a/LibCarla/source/carla/ros2/types/Object.h +++ b/LibCarla/source/carla/ros2/types/Object.h @@ -16,6 +16,7 @@ #include "carla/ros2/types/VehicleActorDefinition.h" #include "carla/ros2/types/WalkerActorDefinition.h" #include "carla/rpc/VehiclePhysicsControl.h" +#include "carla/rpc/EnvironmentObject.h" #include "carla/sensor/data/ActorDynamicState.h" #include "derived_object_msgs/msg/Object.h" #include "derived_object_msgs/msg/ObjectWithCovariance.h" @@ -40,18 +41,18 @@ class Object { * classification is one of the derived_object_msgs::msg::Object_Constants::CLASSIFICATION_* constants */ explicit Object(std::shared_ptr vehicle_actor_definition) - : _actor_name_definition( - std::static_pointer_cast(vehicle_actor_definition)) { + : _actor_definition( + std::static_pointer_cast(vehicle_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_OTHER_VEHICLE; - if (_actor_name_definition->base_type == "Bus" || _actor_name_definition->base_type == "Truck" - || _actor_name_definition->base_type == "bus" || _actor_name_definition->base_type == "truck") { + if (_actor_definition->base_type == "Bus" || _actor_definition->base_type == "Truck" + || _actor_definition->base_type == "bus" || _actor_definition->base_type == "truck") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_TRUCK; - } else if (_actor_name_definition->base_type == "car" || _actor_name_definition->base_type == "van") { + } else if (_actor_definition->base_type == "car" || _actor_definition->base_type == "van") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_CAR; - } else if (_actor_name_definition->base_type == "motorcycle") { + } else if (_actor_definition->base_type == "motorcycle") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_MOTORCYCLE; - } else if (_actor_name_definition->base_type == "bicycle") { + } else if (_actor_definition->base_type == "bicycle") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BIKE; } else { // as long as we don't have the concrete information within a blueprint ... @@ -71,8 +72,8 @@ class Object { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BIKE; } carla::log_warning( - "Unknown Vehicle Object[", _actor_name_definition->type_id, "] id: ", _actor_name_definition->id, - " object_type: ", _actor_name_definition->object_type, " base_type: ", _actor_name_definition->base_type, + "Unknown Vehicle Object[", _actor_definition->type_id, "] id: ", _actor_definition->id, + " object_type: ", _actor_definition->object_type, " base_type: ", _actor_definition->base_type, " mass: ", vehicle_actor_definition->vehicle_physics_control.mass, " estimated ROS-class based on mass: ", classification_string()); } } @@ -82,12 +83,12 @@ class Object { * classification is one of the derived_object_msgs::msg::Object_Constants::CLASSIFICATION_* constants */ explicit Object(std::shared_ptr walker_actor_definition) - : _actor_name_definition( - std::static_pointer_cast(walker_actor_definition)) { + : _actor_definition( + std::static_pointer_cast(walker_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_PEDESTRIAN; - carla::log_debug("Creating Walker Object[", _actor_name_definition->type_id, "] id: ", _actor_name_definition->id, - " object_type: ", _actor_name_definition->object_type, - " base_type: ", _actor_name_definition->base_type, " ROS-class: ", classification_string()); + carla::log_verbose("Creating Walker Object[", _actor_definition->type_id, "] id: ", _actor_definition->id, + " object_type: ", _actor_definition->object_type, + " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); } /** * The representation of an object in the sense of derived_object_msgs::msg::Object. @@ -95,12 +96,13 @@ class Object { * classification is one of the derived_object_msgs::msg::Object_Constants::CLASSIFICATION_* constants */ explicit Object(std::shared_ptr traffic_light_actor_definition) - : _actor_name_definition( - std::static_pointer_cast(traffic_light_actor_definition)) { + : _actor_definition( + std::static_pointer_cast(traffic_light_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; - carla::log_debug("Creating Traffic Light Object[", _actor_name_definition->type_id, - "] id: ", _actor_name_definition->id, " object_type: ", _actor_name_definition->object_type, - " base_type: ", _actor_name_definition->base_type, " ROS-class: ", classification_string()); + _classification_age = std::numeric_limits::max(); + carla::log_verbose("Creating Traffic Light Object[", _actor_definition->type_id, + "] id: ", _actor_definition->id, " object_type: ", _actor_definition->object_type, + " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); } /** * The representation of an object in the sense of derived_object_msgs::msg::Object. @@ -108,13 +110,69 @@ class Object { * classification is one of the derived_object_msgs::msg::Object_Constants::CLASSIFICATION_* constants */ explicit Object(std::shared_ptr traffic_sign_actor_definition) - : _actor_name_definition( - std::static_pointer_cast(traffic_sign_actor_definition)) { + : _actor_definition( + std::static_pointer_cast(traffic_sign_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; - carla::log_debug("Creating Traffic Sign Object[", _actor_name_definition->type_id, - "] id: ", _actor_name_definition->id, " object_type: ", _actor_name_definition->object_type, - " base_type: ", _actor_name_definition->base_type, " ROS-class: ", classification_string()); + _classification_age = std::numeric_limits::max(); + carla::log_verbose("Creating Traffic Sign Object[", _actor_definition->type_id, + "] id: ", _actor_definition->id, " object_type: ", _actor_definition->object_type, + " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); } + + explicit Object(carla::rpc::EnvironmentObject environment_object, bool enable_for_ros) + : _actor_definition(std::make_shared(environment_object, enable_for_ros)) { + _classification_age = std::numeric_limits::max(); + + // derived object msgs are somewhat limited in terms of classification support + // therefore also an actor list for environment objects will be published + // containing the exact tag + switch(environment_object.type) { + case carla::rpc::CityObjectLabel::Pedestrians: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_PEDESTRIAN; + break; + case carla::rpc::CityObjectLabel::Rider: + case carla::rpc::CityObjectLabel::Bicycle: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BIKE; + break; + case carla::rpc::CityObjectLabel::Car: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_CAR; + break; + case carla::rpc::CityObjectLabel::Motorcycle: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_MOTORCYCLE; + break; + case carla::rpc::CityObjectLabel::Bus: + case carla::rpc::CityObjectLabel::Truck: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_TRUCK; + break; + case carla::rpc::CityObjectLabel::TrafficLight: + case carla::rpc::CityObjectLabel::TrafficSigns: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; + break; + case carla::rpc::CityObjectLabel::Train: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_OTHER_VEHICLE; + break; + case carla::rpc::CityObjectLabel::Poles: + case carla::rpc::CityObjectLabel::Fences: + case carla::rpc::CityObjectLabel::Walls: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BARRIER; + break; + case carla::rpc::CityObjectLabel::Buildings: + case carla::rpc::CityObjectLabel::Static: + default: + _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN; + } + + // and put in our object state update + carla::sensor::data::ActorDynamicState actor_dynamic_state; + actor_dynamic_state.id = actor_id(); + actor_dynamic_state.transform = environment_object.transform; + actor_dynamic_state.quaternion = carla::geom::Quaternion(environment_object.transform.rotation); + UpdateObject(carla::ros2::types::Timestamp(), actor_dynamic_state); + carla::log_verbose("Creating Environment Object[", _actor_definition->type_id, + "] id: ", actor_id(), " object_type: ", _actor_definition->object_type, + " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); + } + ~Object() = default; Object(const Object&) = delete; Object& operator=(const Object&) = delete; @@ -123,12 +181,9 @@ class Object { void UpdateObject(carla::ros2::types::Timestamp const& timestamp, carla::sensor::data::ActorDynamicState const& actor_dynamic_state) { - auto actor_definition = std::dynamic_pointer_cast(_actor_name_definition); - if (nullptr != actor_definition) { - _bounding_box.extent = actor_definition->bounding_box.extent; - _bounding_box.location = actor_dynamic_state.transform.location; - _bounding_box.rotation = actor_dynamic_state.transform.rotation; - } + _bounding_box.extent = _actor_definition->bounding_box.extent; + _bounding_box.location = actor_dynamic_state.transform.location; + _bounding_box.rotation = actor_dynamic_state.transform.rotation; _transform = carla::ros2::types::Transform(actor_dynamic_state.transform, actor_dynamic_state.quaternion); _accelerated_movement.UpdateSpeed( carla::ros2::types::Speed(carla::geom::Velocity(actor_dynamic_state.velocity), actor_dynamic_state.quaternion), @@ -143,22 +198,16 @@ class Object { derived_object_msgs::msg::Object object; object.header().stamp(_accelerated_movement.Timestamp().time()); object.header().frame_id("map"); - object.id(_actor_name_definition->id); + object.id(_actor_definition->id); object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); object.object_classified(true); object.pose(_transform.pose()); object.twist(_accelerated_movement.twist()); object.accel(_accelerated_movement.accel()); - - auto actor_definition = std::dynamic_pointer_cast(_actor_name_definition); - if (nullptr != actor_definition) { - object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); - auto const ros_extent = _bounding_box.extent * 2.f; - object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); - object.shape().polygon().points(*Polygon(_bounding_box.GetLocalVertices()).polygon()); - } else { - object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX_X); - } + object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); + auto const ros_extent = _bounding_box.extent * 2.f; + object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); + object.shape().polygon().points(*Polygon(_bounding_box.GetLocalVertices()).polygon()); object.classification(_classification); object.classification_certainty(255u); object.classification_age(_classification_age); @@ -169,27 +218,31 @@ class Object { derived_object_msgs::msg::ObjectWithCovariance object; object.header().stamp(_accelerated_movement.Timestamp().time()); object.header().frame_id("map"); - object.id(_actor_name_definition->id); + object.id(_actor_definition->id); object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); object.object_classified(true); object.pose(_transform.pose_with_covariance()); object.twist(_accelerated_movement.twist_with_covariance()); object.accel(_accelerated_movement.accel_with_covariance()); - - auto actor_definition = std::dynamic_pointer_cast(_actor_name_definition); - if (nullptr != actor_definition) { - object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); - auto const ros_extent = _bounding_box.extent * 2.f; - object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); - } else { - object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX_X); - } + object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); + auto const ros_extent = _bounding_box.extent * 2.f; + object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); object.classification(_classification); object.classification_certainty(255u); object.classification_age(_classification_age); return object; } + /** + * @brief check if dynamic content has changed (ignoring timestamp) + */ + bool has_dynamic_data_changed(derived_object_msgs::msg::Object const &other) const { + return (other.id()!=_actor_definition->id) + || (other.pose() != _transform.pose()) + || (other.twist() != _accelerated_movement.twist()) + || (other.accel() != _accelerated_movement.accel()); + } + carla::ros2::types::Timestamp const& Timestamp() const { return _accelerated_movement.Timestamp(); } @@ -206,11 +259,11 @@ class Object { return _accelerated_movement; } - uint8_t classification() { + uint8_t classification() const { return _classification; } - std::string classification_string() { + std::string classification_string() const { switch (_classification) { case derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN: return "UNKNOWN"; @@ -241,13 +294,18 @@ class Object { } } - carla_msgs::msg::CarlaActorInfo carla_actor_info(std::shared_ptr name_registry) const { - return _actor_name_definition->carla_actor_info(name_registry); + carla_msgs::msg::CarlaActorInfo carla_actor_info(std::shared_ptr name_registry = nullptr) const { + return _actor_definition->carla_actor_info(name_registry); } - carla::streaming::detail::actor_id_type Id() { return _actor_name_definition->id; } + carla::streaming::detail::actor_id_type actor_id() const { return _actor_definition->id; } + + const carla::ros2::types::ActorDefinition& actor_definition()const { return *_actor_definition; } + + const carla::ros2::types::ActorNameDefinition& actor_name_definition()const { return *_actor_definition; } + private: - std::shared_ptr _actor_name_definition; + std::shared_ptr _actor_definition; uint8_t _classification{derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN}; carla::geom::BoundingBox _bounding_box; carla::ros2::types::Transform _transform; diff --git a/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h b/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h index 42a33ae2d57..d5f42941b66 100644 --- a/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/TrafficLightActorDefinition.h @@ -29,8 +29,8 @@ inline uint8_t GetTrafficLightState(carla::sensor::data::ActorDynamicState const } struct TrafficLightActorDefinition : public ActorDefinition { - TrafficLightActorDefinition(ActorDefinition const &actor_definitions, carla::geom::BoundingBox const &trigger_volume_in) - : ActorDefinition(actor_definitions) + TrafficLightActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox const &bounding_box, carla::geom::BoundingBox const &trigger_volume_in) + : ActorDefinition(actor_name_definition, bounding_box) , trigger_volume(trigger_volume_in) {} carla::geom::BoundingBox trigger_volume; diff --git a/LibCarla/source/carla/ros2/types/TrafficSignActorDefinition.h b/LibCarla/source/carla/ros2/types/TrafficSignActorDefinition.h index 2a3201d4b68..dd11a8a2c52 100644 --- a/LibCarla/source/carla/ros2/types/TrafficSignActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/TrafficSignActorDefinition.h @@ -11,7 +11,8 @@ namespace ros2 { namespace types { struct TrafficSignActorDefinition : public ActorDefinition { - TrafficSignActorDefinition(ActorDefinition const &actor_definitions) : ActorDefinition(actor_definitions) {} + TrafficSignActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox const &bounding_box) + : ActorDefinition(actor_name_definition, bounding_box) {} virtual ~TrafficSignActorDefinition() = default; }; diff --git a/LibCarla/source/carla/ros2/types/Transform.h b/LibCarla/source/carla/ros2/types/Transform.h index 2d63347309f..e2940b71e77 100644 --- a/LibCarla/source/carla/ros2/types/Transform.h +++ b/LibCarla/source/carla/ros2/types/Transform.h @@ -25,7 +25,17 @@ class Transform { * carla_transform: the carla Transform */ explicit Transform(const carla::geom::Transform& carla_transform, const carla::geom::Quaternion& carla_quaternion) - : _carla_transform(carla_transform), _carla_quaternion(carla_quaternion) { + : _carla_location(carla_transform.location) + , _carla_rotation(carla_transform.rotation) + , _carla_rotation_initialized(true) + , _carla_quaternion(carla_quaternion) { + init_ros_transform(); + } + + explicit Transform(const carla::geom::Location& carla_location, const carla::geom::Quaternion& carla_quaternion) + : _carla_location(carla_location) + , _carla_rotation_initialized(false) + , _carla_quaternion(carla_quaternion) { init_ros_transform(); } @@ -39,13 +49,18 @@ class Transform { ros_location.x = float(pose.position().x()); ros_location.y = float(pose.position().y()); ros_location.z = float(pose.position().z()); - _carla_transform.location = CoordinateSystemTransform::TransformLinearAxixVector3D(ros_location); - _carla_quaternion = carla::ros2::types::Quaternion(_ros_transform.rotation()).GetQuaternion(); + _carla_location = CoordinateSystemTransform::TransformLinearAxixVector3D(ros_location); + auto const quaternion = carla::ros2::types::Quaternion(_ros_transform.rotation()); + _carla_quaternion = quaternion.GetQuaternion(); + _carla_rotation_initialized = false; } #ifdef LIBCARLA_INCLUDED_FROM_UE4 Transform(const FTransform& ue4_transform) - : _carla_transform(ue4_transform), _carla_quaternion(ue4_transform.GetRotation()) { + : _carla_location(ue4_transform.GetLocation()) + , _carla_rotation(ue4_transform.Rotator()) + , _carla_rotation_initialized(true) + , _carla_quaternion(ue4_transform.GetRotation()) { init_ros_transform(); } #endif // LIBCARLA_INCLUDED_FROM_UE4 @@ -95,8 +110,9 @@ class Transform { * * Uses CARLA naming convention */ - const carla::geom::Transform& GetTransform() const { - return _carla_transform; + carla::geom::Transform GetTransform() { + EnsureCarlaRotatorInitialized(); + return carla::geom::Transform(_carla_location, _carla_rotation); } /** @@ -105,7 +121,7 @@ class Transform { * Uses CARLA naming convention */ const carla::geom::Location& GetLocation() const { - return _carla_transform.location; + return _carla_location; } /** @@ -113,8 +129,9 @@ class Transform { * * Uses CARLA naming convention */ - const carla::geom::Rotation& GetRotator() const { - return _carla_transform.rotation; + const carla::geom::Rotation& GetRotator() { + EnsureCarlaRotatorInitialized(); + return _carla_rotation; } /** @@ -126,18 +143,69 @@ class Transform { return _carla_quaternion; } + /** + * Transform the in_point + */ + void TransformPoint(carla::geom::Vector3D &in_point) const { + carla::geom::Vector3D rotated_point = _carla_quaternion.RotatedPoint(in_point); // First rotate + in_point = rotated_point + carla::geom::Vector3D(_carla_location); // Then translate + } + + /** + * Get the transform of this relative to the provided base transform. + */ + carla::ros2::types::Transform GetRelativeTransform(carla::ros2::types::Transform const &basis) const { + auto const relative_quaternion_new_base = basis.GetQuaternion().Inverse() * GetQuaternion(); + auto const relative_location_current_base = GetLocation() - basis.GetLocation(); + carla::geom::Location const relative_location_new_base = carla::geom::Vector3D(basis.GetQuaternion().RotatedPoint(relative_location_current_base)); + carla::ros2::types::Transform relative_transform(relative_location_new_base, relative_quaternion_new_base); + return relative_transform; + } + private: + void EnsureCarlaRotatorInitialized() { + if ( !_carla_rotation_initialized ) { + _carla_rotation_initialized = true; + _carla_rotation = _carla_quaternion.Rotator(); + } + } + void init_ros_transform() { // switch y-axis from right to left -> negate y-axis - _ros_transform.translation() = CoordinateSystemTransform::TransformLinearAxisMsg(_carla_transform.location); + _ros_transform.translation() = CoordinateSystemTransform::TransformLinearAxisMsg(_carla_location); _ros_transform.rotation(carla::ros2::types::Quaternion(_carla_quaternion).quaternion()); } - // keep the carla types for local - carla::geom::Transform _carla_transform; + // keep the carla types, but with rotation optional (only to be calculated if required in case of ROS input) + // be aware: rotation calculation requires some sin/cos calls and is rather expensive + carla::geom::Rotation _carla_rotation; + bool _carla_rotation_initialized = false; + carla::geom::Location _carla_location; carla::geom::Quaternion _carla_quaternion; geometry_msgs::msg::Transform _ros_transform; }; } // namespace types } // namespace ros2 -} // namespace carla \ No newline at end of file +} // namespace carla + + +namespace std { + +inline std::string to_string(geometry_msgs::msg::Transform const &transform) { + return "ROSTransform(translation(x=" + + std::to_string(transform.translation().x()) + ", y=" + + std::to_string(transform.translation().y()) + ", z=" + + std::to_string(transform.translation().z()) + "), " + + "rotation(x=" + + std::to_string(transform.rotation().x()) + ", y=" + + std::to_string(transform.rotation().y()) + ", z=" + + std::to_string(transform.rotation().z()) + ", w=" + + std::to_string(transform.rotation().w()) + "))"; +} + +inline std::string to_string(carla::ros2::types::Transform const &transform) { + return "Transform(" + std::to_string(transform.transform()) + " CARLA: " + + std::to_string(transform.GetQuaternion()) + std::to_string(transform.GetLocation()); +} + +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h b/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h index 08cbc92090c..46cc0df3d19 100644 --- a/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/VehicleActorDefinition.h @@ -33,9 +33,9 @@ inline uint8_t GetVehicleControlType(carla::sensor::data::ActorDynamicState cons } struct VehicleActorDefinition : public ActorDefinition { - VehicleActorDefinition(ActorDefinition const &actor_definition, + VehicleActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox const &bounding_box, rpc::VehiclePhysicsControl vehicle_physics_control_in) - : ActorDefinition(actor_definition) + : ActorDefinition(actor_name_definition, bounding_box) , vehicle_physics_control(vehicle_physics_control_in) {} rpc::VehiclePhysicsControl vehicle_physics_control; diff --git a/LibCarla/source/carla/ros2/types/WalkerActorDefinition.h b/LibCarla/source/carla/ros2/types/WalkerActorDefinition.h index 2d5be9d5862..5489d5eb84a 100644 --- a/LibCarla/source/carla/ros2/types/WalkerActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/WalkerActorDefinition.h @@ -16,7 +16,8 @@ namespace types { using WalkerControlCallback = std::function; struct WalkerActorDefinition : public ActorDefinition { - WalkerActorDefinition(ActorDefinition const &actor_definition) : ActorDefinition(actor_definition) {} + WalkerActorDefinition(ActorNameDefinition const &actor_name_definition, carla::geom::BoundingBox const &bounding_box) + : ActorDefinition(actor_name_definition, bounding_box) {} virtual ~WalkerActorDefinition() = default; }; } // namespace types diff --git a/LibCarla/source/carla/rpc/EnvironmentObject.h b/LibCarla/source/carla/rpc/EnvironmentObject.h index 45ed58388aa..b7f64d9d0d7 100644 --- a/LibCarla/source/carla/rpc/EnvironmentObject.h +++ b/LibCarla/source/carla/rpc/EnvironmentObject.h @@ -14,6 +14,12 @@ #include "carla/rpc/Transform.h" #include "carla/rpc/ObjectLabel.h" +#ifdef LIBCARLA_INCLUDED_FROM_UE4 +#include +#include "Carla/Util/EnvironmentObject.h" +#include +#endif // LIBCARLA_INCLUDED_FROM_UE4 + namespace carla { namespace rpc { diff --git a/LibCarla/source/carla/rpc/ObjectLabel.h b/LibCarla/source/carla/rpc/ObjectLabel.h index 1f51a550a19..663dc56a58d 100644 --- a/LibCarla/source/carla/rpc/ObjectLabel.h +++ b/LibCarla/source/carla/rpc/ObjectLabel.h @@ -9,6 +9,7 @@ #include "carla/MsgPack.h" #include +#include namespace carla { namespace rpc { @@ -52,4 +53,43 @@ namespace rpc { } // namespace rpc } // namespace carla -MSGPACK_ADD_ENUM(carla::rpc::CityObjectLabel); +MSGPACK_ADD_ENUM(carla::rpc::CityObjectLabel) + +namespace std { + inline std::string to_string(carla::rpc::CityObjectLabel label) { + switch (label) + { + case carla::rpc::CityObjectLabel::None: return "None"; + case carla::rpc::CityObjectLabel::Roads: return "Roads"; + case carla::rpc::CityObjectLabel::Sidewalks: return "Sidewalks"; + case carla::rpc::CityObjectLabel::Buildings: return "Buildings"; + case carla::rpc::CityObjectLabel::Walls: return "Walls"; + case carla::rpc::CityObjectLabel::Fences: return "Fences"; + case carla::rpc::CityObjectLabel::Poles: return "Poles"; + case carla::rpc::CityObjectLabel::TrafficLight: return "TrafficLight"; + case carla::rpc::CityObjectLabel::TrafficSigns: return "TrafficSigns"; + case carla::rpc::CityObjectLabel::Vegetation: return "Vegetation"; + case carla::rpc::CityObjectLabel::Terrain: return "Terrain"; + case carla::rpc::CityObjectLabel::Sky: return "Sky"; + case carla::rpc::CityObjectLabel::Pedestrians: return "Pedestrians"; + case carla::rpc::CityObjectLabel::Rider: return "Rider"; + case carla::rpc::CityObjectLabel::Car: return "Car"; + case carla::rpc::CityObjectLabel::Truck: return "Truck"; + case carla::rpc::CityObjectLabel::Bus: return "Bus"; + case carla::rpc::CityObjectLabel::Train: return "Train"; + case carla::rpc::CityObjectLabel::Motorcycle: return "Motorcycle"; + case carla::rpc::CityObjectLabel::Bicycle: return "Bicycle"; + case carla::rpc::CityObjectLabel::Static: return "Static"; + case carla::rpc::CityObjectLabel::Dynamic: return "Dynamic"; + case carla::rpc::CityObjectLabel::Other: return "Other"; + case carla::rpc::CityObjectLabel::Water: return "Water"; + case carla::rpc::CityObjectLabel::RoadLines: return "RoadLines"; + case carla::rpc::CityObjectLabel::Ground: return "Ground"; + case carla::rpc::CityObjectLabel::Bridge: return "Bridge"; + case carla::rpc::CityObjectLabel::RailTrack: return "RailTrack"; + case carla::rpc::CityObjectLabel::GuardRail: return "GuardRail"; + case carla::rpc::CityObjectLabel::Any: return "Any"; + default: return "Unknown"; + } + }; +} // namespace std \ No newline at end of file diff --git a/LibCarla/source/carla/rpc/RpcServerInterface.h b/LibCarla/source/carla/rpc/RpcServerInterface.h index 22c414729f5..6c69d4631da 100644 --- a/LibCarla/source/carla/rpc/RpcServerInterface.h +++ b/LibCarla/source/carla/rpc/RpcServerInterface.h @@ -11,11 +11,13 @@ #include "carla/rpc/ActorDescription.h" #include "carla/rpc/AttachmentType.h" #include "carla/rpc/EpisodeSettings.h" +#include "carla/rpc/EnvironmentObject.h" #include "carla/rpc/MapInfo.h" #include "carla/rpc/MapLayer.h" #include "carla/rpc/Response.h" #include "carla/rpc/ServerSynchronizationTypes.h" #include "carla/rpc/Transform.h" +#include "carla/rpc/VehicleLightState.h" #include "carla/rpc/VehicleTelemetryData.h" #include "carla/rpc/WeatherParameters.h" #include "carla/streaming/detail/Dispatcher.h" @@ -66,7 +68,8 @@ class RpcServerInterface { ActorId ParentId, AttachmentType InAttachmentType, const std::string &socket_name) = 0; virtual Response call_destroy_actor(ActorId ActorId) = 0; - virtual Response call_get_telemetry_data(ActorId ActorId) = 0; + virtual Response call_get_telemetry_data(ActorId ActorId) = 0; + virtual Response call_get_vehicle_light_state(ActorId ActorId) = 0; /** * @} @@ -76,9 +79,9 @@ class RpcServerInterface { * @brief ros actor interaction calls * @{ */ - virtual carla::rpc::Response call_enable_actor_for_ros(ActorId actor_id) = 0; - virtual carla::rpc::Response call_disable_actor_for_ros(ActorId actor_id) = 0; - virtual carla::rpc::Response call_is_actor_enabled_for_ros(ActorId actor_id) = 0; + virtual Response call_enable_actor_for_ros(ActorId actor_id) = 0; + virtual Response call_disable_actor_for_ros(ActorId actor_id) = 0; + virtual Response call_is_actor_enabled_for_ros(ActorId actor_id) = 0; /** * @} */ @@ -90,7 +93,7 @@ class RpcServerInterface { virtual Response call_tick( synchronization_client_id_type const &client_id, synchronization_participant_id_type const &participant_id, - carla::rpc::SynchronizationTickMode synchronization_tick_mode) = 0; + SynchronizationTickMode synchronization_tick_mode) = 0; virtual Response call_register_synchronization_participant( synchronization_client_id_type const &client_id, synchronization_participant_id_type const &participant_id_hint = ALL_PARTICIPANTS) = 0; @@ -99,7 +102,7 @@ class RpcServerInterface { virtual Response call_update_synchronization_window( synchronization_client_id_type const &client_id, synchronization_participant_id_type const &participant_id, synchronization_target_game_time const &target_game_time = NO_SYNC_TARGET_GAME_TIME) = 0; - virtual carla::rpc::Response > > call_get_synchronization_window_status() = 0; + virtual Response > > call_get_synchronization_window_status() = 0; /** * @} */ @@ -113,6 +116,18 @@ class RpcServerInterface { /** * @} */ + + /** + * @brief environment objects related calls + * @{ + */ + virtual Response> call_get_environment_objects(uint8_t queried_tag) =0; + virtual Response call_enable_environment_objects( + const std::vector& env_objects_ids, + bool enable) = 0; + /** + * @} + */ }; } // namespace rpc diff --git a/LibCarla/source/carla/sensor/data/SerializerVectorAllocator.h b/LibCarla/source/carla/sensor/data/SerializerVectorAllocator.h index c4b88447623..e942f20145b 100644 --- a/LibCarla/source/carla/sensor/data/SerializerVectorAllocator.h +++ b/LibCarla/source/carla/sensor/data/SerializerVectorAllocator.h @@ -72,7 +72,7 @@ namespace data { std::allocator(), _buffer(buffer), _header_offset(header_offset) { - log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(), "] created"); + log_verbose("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(), "] created"); } SerializerVectorAllocator(SerializerVectorAllocator &&other) : @@ -80,7 +80,7 @@ namespace data { _buffer(std::move(other._buffer)), _header_offset(std::exchange(other._header_offset, 0u)), _is_allocated(std::exchange(other._is_allocated, false)) { - log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] created by move from [", &other, "]"); + log_verbose("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] created by move from [", &other, "]"); } SerializerVectorAllocator(const SerializerVectorAllocator &other) : @@ -88,15 +88,15 @@ namespace data { _buffer(other._buffer), _header_offset(other._header_offset), _is_allocated(other._is_allocated) { - log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] created by copy from [", &other, "]"); + log_verbose("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] created by copy from [", &other, "]"); } ~SerializerVectorAllocator() { - log_debug("~SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] destroyed"); + log_verbose("~SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] destroyed"); } SerializerVectorAllocator& operator=(SerializerVectorAllocator &&other) { - log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] move assigned from [", &other, "]"); + log_verbose("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] move assigned from [", &other, "]"); _buffer = std::move(other._buffer); _header_offset = std::exchange(other._header_offset, 0u); _is_allocated = std::exchange(other._is_allocated, false); @@ -104,7 +104,7 @@ namespace data { } SerializerVectorAllocator& operator=(const SerializerVectorAllocator &other) { - log_debug("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] assigned from [", &other, "]"); + log_verbose("SerializerVectorAllocator[", this, ":", _buffer?static_cast(_buffer->data()):nullptr, "|", _buffer.use_count(),"] assigned from [", &other, "]"); _buffer = other._buffer; _header_offset = other._header_offset; return *this; diff --git a/LibCarla/source/carla/streaming/detail/Message.h b/LibCarla/source/carla/streaming/detail/Message.h index bbcfd87c54c..f03ecc8e1a5 100644 --- a/LibCarla/source/carla/streaming/detail/Message.h +++ b/LibCarla/source/carla/streaming/detail/Message.h @@ -60,11 +60,11 @@ namespace detail { : MessageTmpl(sizeof...(Buffers) + 1u, buf, buffers...) { static_assert(sizeof...(Buffers) < max_size(), "Too many buffers!"); _buffer_views[0u] = boost::asio::buffer(&_total_size, sizeof(_total_size)); - log_debug("MessageTmpl[", this, "] Created message with ", _number_of_buffers, " buffers and total size ", _total_size, " bytes. ", GetBufferDetailsAsString()); + log_verbose("MessageTmpl[", this, "] Created message with ", _number_of_buffers, " buffers and total size ", _total_size, " bytes. ", GetBufferDetailsAsString()); } ~MessageTmpl(){ - log_debug("MessageTmpl[", this, "] Destroyed.", GetBufferDetailsAsString()); + log_verbose("MessageTmpl[", this, "] Destroyed.", GetBufferDetailsAsString()); } /// Size in bytes of the message excluding the header. diff --git a/LibCarla/source/carla/streaming/detail/MultiStreamState.h b/LibCarla/source/carla/streaming/detail/MultiStreamState.h index c9043eadea2..106d432ee91 100644 --- a/LibCarla/source/carla/streaming/detail/MultiStreamState.h +++ b/LibCarla/source/carla/streaming/detail/MultiStreamState.h @@ -36,7 +36,7 @@ namespace detail { if (session != nullptr) { auto message = Session::MakeMessage(buffers...); session->WriteMessage(std::move(message)); - log_debug("MultiStreamState::Write>> sensor ", session->get_stream_id(), " data sent to single session"); + log_verbose("MultiStreamState::Write>> sensor ", session->get_stream_id(), " data sent to single session"); // Return here, _session is only valid if we have a // single session. return; @@ -49,10 +49,10 @@ namespace detail { for (auto &s : _sessions) { if (s != nullptr) { s->WriteMessage(message); - log_debug("MultiStreamState::Write>> sensor ", s->get_stream_id(), " data sent to session ", message->GetBufferDetailsAsString()); + log_verbose("MultiStreamState::Write>> sensor ", s->get_stream_id(), " data sent to session ", message->GetBufferDetailsAsString()); } } - log_debug("MultiStreamState::Write>> Write finished for multiple sessions"); + log_verbose("MultiStreamState::Write>> Write finished for multiple sessions"); } } diff --git a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp index a3533c4f993..bcb36fcdff7 100644 --- a/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp +++ b/LibCarla/source/carla/streaming/detail/tcp/ServerSession.cpp @@ -108,7 +108,7 @@ namespace tcp { } }; - log_debug("session", _session_id, ": sending message of", message->size(), "bytes ", message->GetBufferDetailsAsString()); + log_verbose("session", _session_id, ": sending message of", message->size(), "bytes ", message->GetBufferDetailsAsString()); _deadline.expires_from_now(_timeout); boost::asio::async_write(_socket, message->GetBufferSequence(), diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp index 988f945257a..9760c99a667 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorDispatcher.cpp @@ -277,7 +277,7 @@ void RegisterActorROS2(std::shared_ptr ROS2, FCarlaActor* Car } else if (SceneCaptureCamera != nullptr) { // scene capture cameras are allowed to be moved by external user - carla::ros2::types::ActorSetTransformCallback ActorSetTransformCallback = [Sensor](carla::ros2::types::Transform const &Transform) -> void { + carla::ros2::types::ActorSetTransformCallback ActorSetTransformCallback = [Sensor](carla::ros2::types::Transform &Transform) -> void { Sensor->SetActorTransform(Transform.GetTransform()); }; ROS2->AddSensorUe(SensorActorDefinition, ActorSetTransformCallback); @@ -289,10 +289,10 @@ void RegisterActorROS2(std::shared_ptr ROS2, FCarlaActor* Car else if (Vehicle != nullptr ) { FVehiclePhysicsControl PhysicsControl; CarlaActor->GetPhysicsControl(PhysicsControl); - + ActorNameDefinition.city_object_label = static_cast(ATagger::GetTagOfTaggedComponent(*Vehicle->GetMesh())); auto VehicleActorDefinition = std::make_shared( - carla::ros2::types::ActorDefinition(ActorNameDefinition, - CarlaActor->GetActorInfo()->BoundingBox), + ActorNameDefinition, + CarlaActor->GetActorInfo()->BoundingBox, PhysicsControl); carla::ros2::types::VehicleControlCallback VehicleControlCallback = [Vehicle](carla::ros2::types::VehicleControl const &Source) -> void { @@ -307,16 +307,17 @@ void RegisterActorROS2(std::shared_ptr ROS2, FCarlaActor* Car carla::ros2::types::VehicleAckermannControlCallback VehicleAckermannControlCallback = [Vehicle](carla::ros2::types::VehicleAckermannControl const &Source) -> void { Vehicle->ApplyVehicleAckermannControl(Source.GetVehicleAckermannControl(), EVehicleInputPriority::User); }; - carla::ros2::types::ActorSetTransformCallback VehicleSetTransformCallback = [Vehicle](carla::ros2::types::Transform const &Transform) -> void { + carla::ros2::types::ActorSetTransformCallback VehicleSetTransformCallback = [Vehicle](carla::ros2::types::Transform &Transform) -> void { Vehicle->SetActorTransform(Transform.GetTransform()); }; ROS2->AddVehicleUe(VehicleActorDefinition, VehicleControlCallback, VehicleAckermannControlCallback, VehicleSetTransformCallback); } else if ( Walker != nullptr ) { + ActorNameDefinition.city_object_label = carla::rpc::CityObjectLabel::Pedestrians; auto WalkerActorDefinition = std::make_shared( - carla::ros2::types::ActorDefinition(ActorNameDefinition, - CarlaActor->GetActorInfo()->BoundingBox)); + ActorNameDefinition, + CarlaActor->GetActorInfo()->BoundingBox); auto WalkerController = Cast(Walker->GetController()); carla::ros2::types::WalkerControlCallback walker_control_callback = [WalkerController](carla::ros2::types::WalkerControl const &Source) -> void { @@ -326,17 +327,19 @@ void RegisterActorROS2(std::shared_ptr ROS2, FCarlaActor* Car ROS2->AddWalkerUe(WalkerActorDefinition, walker_control_callback); } else if ( TrafficLight != nullptr ) { + ActorNameDefinition.city_object_label = carla::rpc::CityObjectLabel::TrafficLight; auto TrafficLightTriggerVolume = UBoundingBoxCalculator::GetTrafficSignTriggerVolume(TrafficLight); auto TrafficLightActorDefinition = std::make_shared( - carla::ros2::types::ActorDefinition(ActorNameDefinition, - CarlaActor->GetActorInfo()->BoundingBox), TrafficLightTriggerVolume); + ActorNameDefinition, + CarlaActor->GetActorInfo()->BoundingBox, + TrafficLightTriggerVolume); ROS2->AddTrafficLightUe(TrafficLightActorDefinition); } else if ( TrafficSign != nullptr ) { + ActorNameDefinition.city_object_label = carla::rpc::CityObjectLabel::TrafficSigns; auto TrafficSignActorDefinition = std::make_shared( - carla::ros2::types::ActorDefinition(ActorNameDefinition, - CarlaActor->GetActorInfo()->BoundingBox) - ); + ActorNameDefinition, + CarlaActor->GetActorInfo()->BoundingBox); ROS2->AddTrafficSignUe(TrafficSignActorDefinition); } } @@ -356,22 +359,11 @@ FCarlaActor* UActorDispatcher::RegisterActor( auto ROS2 = carla::ros2::ROS2::GetInstance(); if (ROS2->IsEnabled()) { - bool EnabledForRos = false; - if ( (Description.GetAttribute("enabled_for_ros").Value.Equals(TEXT(""))) && (ROS2->VisibilityDefaultMode() == carla::ros2::ROS2::TopicVisibilityDefaultMode::eOn )) { - EnabledForRos = true; - } - else { - EnabledForRos = Description.GetAttribute("enabled_for_ros").Value.ToBool(); - } - carla::ros2::types::ActorNameDefinition ActorNameDefinition( View->GetActorId(), std::string(TCHAR_TO_UTF8(*View->GetActorInfo()->Description.Id)), - std::string(TCHAR_TO_UTF8(*Description.GetAttribute("ros_name").Value)), - std::string(TCHAR_TO_UTF8(*Description.GetAttribute("role_name").Value)), - std::string(TCHAR_TO_UTF8(*Description.GetAttribute("object_type").Value)), - std::string(TCHAR_TO_UTF8(*Description.GetAttribute("base_type").Value)), - EnabledForRos); + Description, + ROS2->VisibilityDefaultMode()); RegisterActorROS2(ROS2, View, ActorNameDefinition); } #endif diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp index f15782c391a..c8ab8e17c32 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEngine.cpp @@ -236,7 +236,7 @@ void FCarlaEngine::NotifyInitGame(const UCarlaSettings &Settings) UE_LOG(LogCarla, Log, TEXT("ENABLE ROS: %s"), UTF8_TO_TCHAR(Settings.ROS2TopicVisibility?" Topics visible per default": " Topics invisible")); auto ROS2 = carla::ros2::ROS2::GetInstance(); ROS2->Enable(&Server, carla::streaming::detail::token_type(WorldObserver.GetToken()).get_stream_id(), - Settings.ROS2TopicVisibility?carla::ros2::ROS2::TopicVisibilityDefaultMode::eOn:carla::ros2::ROS2::TopicVisibilityDefaultMode::eOff); + Settings.ROS2TopicVisibility?carla::ros2::ROS2TopicVisibilityDefaultMode::eOn:carla::ros2::ROS2TopicVisibilityDefaultMode::eOff); Server.SetROS2TopicVisibilityDefaultEnabled(Settings.ROS2TopicVisibility); } #endif diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp index f288b1acc46..e77e45cf215 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp @@ -201,6 +201,7 @@ class FCarlaServer::FPimpl: public carla::rpc::RpcServerInterface const std::string &socket_name) override; carla::rpc::Response call_destroy_actor(carla::rpc::ActorId ActorId) override; carla::rpc::Response call_get_telemetry_data(carla::rpc::ActorId ActorId) override; + carla::rpc::Response call_get_vehicle_light_state(carla::rpc::ActorId ActorId) override; /** * @} */ @@ -264,6 +265,17 @@ class FCarlaServer::FPimpl: public carla::rpc::RpcServerInterface * @} */ + /** + * @brief environment objects related calls + * @{ + */ + carla::rpc::Response> call_get_environment_objects(uint8_t queried_tag) override; + carla::rpc::Response call_enable_environment_objects( + const std::vector& env_objects_ids, + bool enable) override; + /** + * @} + */ void OnClientDisconnected(std::shared_ptr server_session); void OnClientConnected(std::shared_ptr server_session); @@ -839,40 +851,13 @@ void FCarlaServer::FPimpl::BindActions() BIND_SYNC(get_environment_objects) << [this](uint8 QueriedTag) -> R> { REQUIRE_CARLA_EPISODE(); - ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(Episode->GetWorld()); - if (!GameMode) - { - RESPOND_ERROR("unable to find CARLA game mode"); - } - TArray Result = GameMode->GetEnvironmentObjects(QueriedTag); - ALargeMapManager* LargeMap = GameMode->GetLMManager(); - if (LargeMap) - { - for(auto& Object : Result) - { - Object.Transform = LargeMap->LocalToGlobalTransform(Object.Transform); - } - } - return MakeVectorFromTArray(Result); + return call_get_environment_objects(QueriedTag); }; BIND_SYNC(enable_environment_objects) << [this](std::vector EnvObjectIds, bool Enable) -> R { REQUIRE_CARLA_EPISODE(); - ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(Episode->GetWorld()); - if (!GameMode) - { - RESPOND_ERROR("unable to find CARLA game mode"); - } - - TSet EnvObjectIdsSet; - for(uint64 Id : EnvObjectIds) - { - EnvObjectIdsSet.Emplace(Id); - } - - GameMode->EnableEnvironmentObjects(EnvObjectIdsSet, Enable); - return R::Success(); + return call_enable_environment_objects(EnvObjectIds, Enable); }; BIND_SYNC(set_annotations_traverse_translucency) << [this](bool Enable) -> R @@ -1866,25 +1851,7 @@ BIND_SYNC(send) << [this]( cr::ActorId ActorId) -> R { REQUIRE_CARLA_EPISODE(); - FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId); - if (!CarlaActor) - { - return RespondError( - "get_vehicle_light_state", - ECarlaServerResponse::ActorNotFound, - " Actor Id: " + FString::FromInt(ActorId)); - } - FVehicleLightState LightState; - ECarlaServerResponse Response = - CarlaActor->GetVehicleLightState(LightState); - if (Response != ECarlaServerResponse::Success) - { - return RespondError( - "get_vehicle_light_state", - Response, - " Actor Id: " + FString::FromInt(ActorId)); - } - return cr::VehicleLightState(LightState); + return call_get_vehicle_light_state(ActorId); }; BIND_SYNC(apply_physics_control) << [this]( @@ -3583,6 +3550,29 @@ carla::rpc::Response FCarlaServer::FPimpl::cal return carla::rpc::VehicleTelemetryData(TelemetryData); } +carla::rpc::Response FCarlaServer::FPimpl::call_get_vehicle_light_state(carla::rpc::ActorId ActorId) +{ + FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId); + if (!CarlaActor) + { + return RespondError( + "get_vehicle_light_state", + ECarlaServerResponse::ActorNotFound, + " Actor Id: " + FString::FromInt(ActorId)); + } + FVehicleLightState LightState; + ECarlaServerResponse Response = + CarlaActor->GetVehicleLightState(LightState); + if (Response != ECarlaServerResponse::Success) + { + return RespondError( + "get_vehicle_light_state", + Response, + " Actor Id: " + FString::FromInt(ActorId)); + } + return carla::rpc::VehicleLightState(LightState); +} + FCarlaServer::FPimpl::CheckHandleActorInSecondaryServerResult FCarlaServer::FPimpl::CheckHandleSensorInSecondaryServer(carla::streaming::detail::stream_id_type stream_id) { FCarlaActor* CarlaActor = Episode->FindCarlaActorByStreamId(stream_id); if ( CarlaActor == nullptr ) @@ -3714,6 +3704,45 @@ carla::rpc::Response FCarlaServer::FPimpl::call_set_weather_parameters(car return R::Success(); } +carla::rpc::Response> FCarlaServer::FPimpl::call_get_environment_objects(uint8_t QueriedTag) +{ + ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(Episode->GetWorld()); + if (!GameMode) + { + RESPOND_ERROR("unable to find CARLA game mode"); + } + TArray Result = GameMode->GetEnvironmentObjects(QueriedTag); + ALargeMapManager* LargeMap = GameMode->GetLMManager(); + if (LargeMap) + { + for(auto& Object : Result) + { + Object.Transform = LargeMap->LocalToGlobalTransform(Object.Transform); + } + } + return MakeVectorFromTArray(Result); +} + +carla::rpc::Response FCarlaServer::FPimpl::call_enable_environment_objects( + const std::vector& EnvObjectIds, + bool Enable) +{ + ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(Episode->GetWorld()); + if (!GameMode) + { + RESPOND_ERROR("unable to find CARLA game mode"); + } + + TSet EnvObjectIdsSet; + for(uint64 Id : EnvObjectIds) + { + EnvObjectIdsSet.Emplace(Id); + } + + GameMode->EnableEnvironmentObjects(EnvObjectIdsSet, Enable); + return R::Success(); +} + void FCarlaServer::FPimpl::OnClientConnected(std::shared_ptr server_session) { auto const RegisterResponse = ServerSync.RegisterSynchronizationParticipant(SynchronizationClientId()); if ( RegisterResponse ) { @@ -4000,6 +4029,11 @@ carla::rpc::Response FCarlaServer::call_get_te return Pimpl->call_get_telemetry_data(ActorId); } +carla::rpc::Response FCarlaServer::call_get_vehicle_light_state(carla::rpc::ActorId ActorId) +{ + return Pimpl->call_get_vehicle_light_state(ActorId); +} + carla::rpc::Response FCarlaServer::call_tick( carla::rpc::synchronization_client_id_type const &client_id, carla::rpc::synchronization_participant_id_type const&synchronization_participant, @@ -4043,3 +4077,15 @@ carla::rpc::Response FCarlaServer::call_set_weather_parameters(carla::rpc: { return Pimpl->call_set_weather_parameters(weather_parameters); } + +carla::rpc::Response> FCarlaServer::call_get_environment_objects(uint8_t QueriedTag) +{ + return Pimpl->call_get_environment_objects(QueriedTag); +} + +carla::rpc::Response FCarlaServer::call_enable_environment_objects( + const std::vector& EnvObjectIds, + bool Enable) +{ + return Pimpl->call_enable_environment_objects(EnvObjectIds, Enable); +} diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h index 3020a1fd39f..7a84424a9e1 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.h @@ -103,6 +103,7 @@ class FCarlaServer: public carla::rpc::RpcServerInterface const std::string &socket_name) override; carla::rpc::Response call_destroy_actor(carla::rpc::ActorId ActorId) override; carla::rpc::Response call_get_telemetry_data(carla::rpc::ActorId ActorId) override; + carla::rpc::Response call_get_vehicle_light_state(carla::rpc::ActorId ActorId) override; /** * @} */ @@ -149,6 +150,17 @@ class FCarlaServer: public carla::rpc::RpcServerInterface * @} */ + /** + * @brief environment objects related calls + * @{ + */ + carla::rpc::Response> call_get_environment_objects(uint8_t queried_tag) override; + carla::rpc::Response call_enable_environment_objects( + const std::vector& env_objects_ids, + bool enable) override; + /** + * @} + */ private: class FPimpl; From e3b510d888c093e399e942320eb90f166fb9aa79 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Mon, 19 Jan 2026 18:09:18 +0100 Subject: [PATCH 18/39] Fix race condition on nested sensor creation Already register the sensor-actors when collecting the sensor information to ensure respective parent sensors are already registered at construction time of the actual sensor publisher. This can happen if sensors are nested in some hierarchy. Fix emulated actor name definition of EnvironmentObject that the base_type reflects the type of the object (car, traffic_light, etc.) instead of the object_type. Now it is identical to the other actors. --- .../source/carla/ros2/ROS2NameRegistry.cpp | 126 +++++++++--------- LibCarla/source/carla/ros2/ROS2NameRegistry.h | 30 +++-- .../ros2/publishers/UeWorldPublisher.cpp | 56 ++++---- .../carla/ros2/publishers/UeWorldPublisher.h | 6 +- .../source/carla/ros2/types/ActorDefinition.h | 4 +- 5 files changed, 118 insertions(+), 104 deletions(-) diff --git a/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp b/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp index 837b251679c..5b629c4f23d 100644 --- a/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp +++ b/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp @@ -26,34 +26,43 @@ void ROS2NameRegistry::Clear() { void ROS2NameRegistry::RegisterRecord(ROS2NameRecord const* record) { std::lock_guard lock(access_mutex); - record_set.insert(record); + KeyType key(record); + auto insert_result = record_set.insert(key); + insert_result.first->_number_of_register_calls++; + if (insert_result.second) { + log_debug("ROS2NameRegistry::RegisterRecord: ", + std::to_string(*insert_result.first->_actor_name_definition)); + } } void ROS2NameRegistry::UnregisterRecord(ROS2NameRecord const* record) { std::lock_guard lock(access_mutex); - auto const actor_id = record->_actor_name_definition->id; - record_set.erase(record); + KeyType key(record); + auto find_result = record_set.find(key); + if ( find_result != record_set.end() ) { + find_result->_number_of_register_calls--; + if ( find_result->_number_of_register_calls == 0u) { + log_debug("ROS2NameRegistry::UnregisterRecord: ", + std::to_string(*find_result->_actor_name_definition)); - for (auto iter = parent_map.begin(); iter != parent_map.end(); /*no update of iter*/) { - if (iter->first == actor_id) { - // erase this actor from the map - iter = parent_map.erase(iter); - } else if (iter->second == actor_id) { - // if this actor was the parent of another one, erase this dependency - auto const child = iter->first; - iter = parent_map.erase(iter); - // and update child data - UpdateTopicAndFrameLocked(child); - } else { - ++iter; - } - } + auto const actor_id = find_result->_actor_name_definition->id; + record_set.erase(find_result); + topic_and_frame_map.erase(key); - for (auto iter = topic_and_frame_map.begin(); iter != topic_and_frame_map.end(); /*no update of iter*/) { - if (iter->first._record == record) { - iter = topic_and_frame_map.erase(iter); - } else { - ++iter; + for (auto iter = parent_map.begin(); iter != parent_map.end(); /*no update of iter*/) { + if (iter->first == actor_id) { + // erase this actor from the map + iter = parent_map.erase(iter); + } else if (iter->second == actor_id) { + // if this actor was the parent of another one, erase this dependency + auto const child = iter->first; + iter = parent_map.erase(iter); + // and update child data + UpdateTopicAndFrameLocked(child); + } else { + ++iter; + } + } } } } @@ -74,9 +83,9 @@ std::string ROS2NameRegistry::TopicPrefix(ActorId const actor_id) { std::lock_guard lock(access_mutex); std::string result_topic_name = ""; for (auto& record : record_set) { - auto const actor_definition = record->_actor_name_definition; + auto const actor_definition = record._actor_name_definition; if (actor_definition->id == actor_id) { - auto const topic_name = GetTopicAndFrameLocked(KeyType(record))._topic_name; + auto const topic_name = GetTopicAndFrameLocked(record)._topic_name; if (result_topic_name.empty()) { result_topic_name = topic_name; } else { @@ -105,34 +114,30 @@ std::string ROS2NameRegistry::FrameId(carla::streaming::detail::actor_id_type co std::lock_guard lock(access_mutex); std::string result_topic_name = ""; for (auto& record : record_set) { - if (record->_actor_name_definition->id == actor_id) { - auto const frame_id = GetTopicAndFrameLocked(KeyType(record))._frame_id; + if (record._actor_name_definition->id == actor_id) { + auto const frame_id = GetTopicAndFrameLocked(record)._frame_id; return frame_id; } } return ""; } -ROS2NameRegistry::TopicAndFrame const& ROS2NameRegistry::GetTopicAndFrameLocked(ROS2NameRecord const* record) { - return GetTopicAndFrameLocked(KeyType(record)); -} - ROS2NameRegistry::TopicAndFrame const& ROS2NameRegistry::GetParentTopicAndFrameLocked( - ROS2NameRecord const* child_record) { - ActorId const child_id = child_record->_actor_name_definition->id; + KeyType const& child_record) { + ActorId const child_id = child_record._actor_name_definition->id; // multiple parent entries are not allowed auto find_result = parent_map.find(child_id); if (find_result != parent_map.end()) { auto const parent_actor_id = find_result->second; std::map::iterator parent_iter = topic_and_frame_map.end(); for (auto iter = topic_and_frame_map.begin(); iter != topic_and_frame_map.end(); ++iter) { - if (iter->first._actor_id == parent_actor_id) { + if (iter->first.actor_id() == parent_actor_id) { if (parent_iter != topic_and_frame_map.end()) { log_error("ROS2NameRegistry::GetParentTopicAndFrameLocked: multiple parent candidates for child ", - std::to_string(*child_record->_actor_name_definition), " found. ", " Potential Parents ", - std::to_string(*iter->first._record->_actor_name_definition), - std::to_string(*parent_iter->first._record->_actor_name_definition), - " This is not an expected configuration. Cannot decide. Ignore parent"); + std::to_string(*child_record._actor_name_definition), " found. ", " Potential Parents ", + std::to_string(*iter->first._actor_name_definition), + std::to_string(*parent_iter->first._actor_name_definition), + " This is not an expected configuration. Cannot decide what to return. Ignore parent"); return g_empty_topic_and_frame; } else { parent_iter = iter; @@ -143,27 +148,29 @@ ROS2NameRegistry::TopicAndFrame const& ROS2NameRegistry::GetParentTopicAndFrameL return parent_iter->second; } else { // create the parent topic and frame - ROS2NameRecord const* parent_record = nullptr; + KeyType parent_key(nullptr); for (auto& record : record_set) { - if (record->_actor_name_definition->id == parent_actor_id) { - if (parent_record != nullptr) { + if (record._actor_name_definition->id == parent_actor_id) { + if (parent_key._actor_name_definition != nullptr) { log_error("ROS2NameRegistry::GetParentTopicAndFrameLocked: multiple parent candidates for child ", - std::to_string(*child_record->_actor_name_definition), " found. ", " Potential Parents ", - std::to_string(*record->_actor_name_definition), - std::to_string(*parent_record->_actor_name_definition), - " This is not an expected configuration. Cannot decide. Ignore parent"); + std::to_string(*child_record._actor_name_definition), " found. ", " Potential Parents ", + std::to_string(*record._actor_name_definition), + std::to_string(*parent_key._actor_name_definition), + " This is not an expected configuration. Cannot decide what to create. Ignore parent"); return g_empty_topic_and_frame; } else { - parent_record = record; + parent_key = record; } } } - if (parent_record != nullptr) { - KeyType const key(parent_record); - return CreateTopicAndFrameLocked(key)->second; + if (parent_key._actor_name_definition != nullptr) { + log_debug("ROS2NameRegistry::GetParentTopicAndFrameLocked: child ", + std::to_string(*child_record._actor_name_definition) ," found parent ", + std::to_string(*parent_key._actor_name_definition)); + return CreateTopicAndFrameLocked(parent_key)->second; } else { log_error("ROS2NameRegistry::GetParentTopicAndFrameLocked: no parent candidate found for child ", - std::to_string(*child_record->_actor_name_definition), " found. ", + std::to_string(*child_record._actor_name_definition), " found. ", " This is not an expected configuration. Cannot decide. Ignore parent_id=", parent_actor_id); return g_empty_topic_and_frame; } @@ -184,10 +191,9 @@ ROS2NameRegistry::TopicAndFrame const& ROS2NameRegistry::GetTopicAndFrameLocked( void ROS2NameRegistry::UpdateTopicAndFrameLocked(carla::streaming::detail::actor_id_type actor_id) { // update all of this for (auto& record : record_set) { - auto const actor_definition = record->_actor_name_definition; + auto const actor_definition = record._actor_name_definition; if (actor_definition->id == actor_id) { - KeyType const key(record); - (void)CreateTopicAndFrameLocked(key); + (void)CreateTopicAndFrameLocked(record); } } } @@ -202,13 +208,13 @@ std::string number_to_three_letter_string(uint32_t number) { std::map::iterator ROS2NameRegistry::CreateTopicAndFrameLocked(ROS2NameRegistry::KeyType const& key) { - auto const actor_definition = key._record->_actor_name_definition; + auto const actor_definition = key._actor_name_definition; TopicAndFrame parent_topic_and_frame; - auto parent_iter = parent_map.find(key._actor_id); + auto parent_iter = parent_map.find(key.actor_id()); if (parent_iter != parent_map.end()) { // get the data, if not availble, update also the parent - parent_topic_and_frame = GetParentTopicAndFrameLocked(key._record); + parent_topic_and_frame = GetParentTopicAndFrameLocked(key); } ROS2NameRegistry::TopicAndFrame topic_and_frame("rt/carla"); @@ -226,13 +232,13 @@ ROS2NameRegistry::CreateTopicAndFrameLocked(ROS2NameRegistry::KeyType const& key // let us query the type of actor we have auto vehicle_actor_definition = - std::dynamic_pointer_cast(actor_definition); - auto walker_actor_definition = std::dynamic_pointer_cast(actor_definition); - auto sensor_actor_definition = std::dynamic_pointer_cast(actor_definition); + std::dynamic_pointer_cast(actor_definition); + auto walker_actor_definition = std::dynamic_pointer_cast(actor_definition); + auto sensor_actor_definition = std::dynamic_pointer_cast(actor_definition); auto traffic_light_actor_definition = - std::dynamic_pointer_cast(actor_definition); + std::dynamic_pointer_cast(actor_definition); auto traffic_sign_actor_definition = - std::dynamic_pointer_cast(actor_definition); + std::dynamic_pointer_cast(actor_definition); // prefix with generic type prefix std::string type; diff --git a/LibCarla/source/carla/ros2/ROS2NameRegistry.h b/LibCarla/source/carla/ros2/ROS2NameRegistry.h index 54a0aca51e8..f890e0ccd75 100644 --- a/LibCarla/source/carla/ros2/ROS2NameRegistry.h +++ b/LibCarla/source/carla/ros2/ROS2NameRegistry.h @@ -99,32 +99,38 @@ class ROS2NameRegistry { TopicAndFrame ExpandTopicName(TopicAndFrame const& topic_and_frame, std::string const& postfix_topic, std::string const& postfix_frame=""); struct KeyType { - explicit KeyType(ROS2NameRecord const* record) : _record(record), _actor_id(record->_actor_name_definition->id) {} + explicit KeyType(ROS2NameRecord const* record) : + _actor_name_definition(record->_actor_name_definition) {} bool operator<(const KeyType& other) const { - if (_actor_id == other._actor_id) { - return _record < other._record; - } else { - return _actor_id < other._actor_id; - } + // the actor name definition shared pointer is the differentiating piece + return _actor_name_definition < other._actor_name_definition; } + carla::streaming::detail::actor_id_type actor_id()const { return _actor_name_definition->id; } - ROS2NameRecord const* const _record; - carla::streaming::detail::actor_id_type _actor_id; + std::shared_ptr _actor_name_definition; + mutable uint32_t _number_of_register_calls{0u}; }; // locked operations - TopicAndFrame const& GetTopicAndFrameLocked(ROS2NameRecord const* record); - TopicAndFrame const& GetParentTopicAndFrameLocked(ROS2NameRecord const* record); - TopicAndFrame const& GetTopicAndFrameLocked(KeyType const& key); + TopicAndFrame const& GetParentTopicAndFrameLocked(KeyType const& key); + + TopicAndFrame const& GetTopicAndFrameLocked(ROS2NameRecord const* record){ + return GetTopicAndFrameLocked(KeyType(record)); + } + TopicAndFrame const& GetParentTopicAndFrameLocked(ROS2NameRecord const* record) { + return GetParentTopicAndFrameLocked(KeyType(record)); + } + void UpdateTopicAndFrameLocked(carla::streaming::detail::actor_id_type actor_id); std::map::iterator CreateTopicAndFrameLocked(KeyType const& key); mutable std::mutex access_mutex; - std::set record_set; + std::set record_set; std::map parent_map; std::map topic_and_frame_map; + std::set missing_parents; }; } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index a70c17e01e8..b267f3caabf 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -144,11 +144,11 @@ void UeWorldPublisher::UpdateSensorDataPreAction() { if (ue_sensor.second.publisher != nullptr) { if (ue_sensor.second.publisher->SubscribersConnected() && ue_sensor.second.session == nullptr) { ue_sensor.second.session = std::make_shared(ue_sensor.first); - log_debug("UeWorldPublisher::UpdateSensorDataPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition), + log_debug("UeWorldPublisher::UpdateSensorDataPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition()), "]: Registering session"); _dispatcher->RegisterSession(ue_sensor.second.session); } else if (!ue_sensor.second.publisher->SubscribersConnected() && ue_sensor.second.session != nullptr) { - log_debug("UeWorldPublisher::UpdateSensorDataPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition), + log_debug("UeWorldPublisher::UpdateSensorDataPreAction[", std::to_string(*ue_sensor.second.sensor_actor_definition()), "]: Deregistering session"); _dispatcher->DeregisterSession(ue_sensor.second.session); ue_sensor.second.session.reset(); @@ -166,8 +166,8 @@ void UeWorldPublisher::UpdateSensorDataPreAction() { _sensors_changed = false; carla_msgs::msg::CarlaActorList actor_list; for (auto &ue_sensor : _ue_sensors) { - if (ue_sensor.second.sensor_actor_definition->id != 0) { - actor_list.actors().push_back(ue_sensor.second.sensor_actor_definition->carla_actor_info(_name_registry)); + if (ue_sensor.second.sensor_actor_definition()->id != 0) { + actor_list.actors().push_back(ue_sensor.second.sensor_actor_definition()->carla_actor_info(_name_registry)); } } _sensor_actor_list_publisher->UpdateCarlaActorList(actor_list); @@ -179,7 +179,7 @@ void UeWorldPublisher::ProcessDataFromUeSensor(carla::streaming::detail::stream_ std::shared_ptr message) { auto ue_sensor = _ue_sensors.find(stream_id); if (ue_sensor != _ue_sensors.end()) { - auto const &sensor_actor_definition = ue_sensor->second.sensor_actor_definition; + auto const &sensor_actor_definition = ue_sensor->second.sensor_actor_definition(); auto buffer_list_view = message->GetBufferViewSequence(); // currently we only support sensor header + data buffer @@ -245,82 +245,82 @@ void UeWorldPublisher::UpdateSensorDataPostAction() { void UeWorldPublisher::CreateSensorUePublisher(UeSensor &sensor) { // Create the respective sensor publisher - switch (sensor.sensor_actor_definition->sensor_type) { + switch (sensor.sensor_actor_definition()->sensor_type) { case types::PublisherSensorType::CollisionSensor: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::DepthCamera: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::NormalsCamera: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::DVSCamera: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::GnssSensor: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::InertialMeasurementUnit: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::OpticalFlowCamera: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::Radar: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::RayCastSemanticLidar: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::RayCastLidar: case types::PublisherSensorType::HSSLidar: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::SceneCaptureCamera: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher, sensor.actor_set_transform_callback)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher, sensor.actor_set_transform_callback)); } break; case types::PublisherSensorType::SemanticSegmentationCamera: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::InstanceSegmentationCamera: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::V2X: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::V2XCustom: { sensor.publisher = std::static_pointer_cast( - std::make_shared(sensor.sensor_actor_definition, sensor.v2x_custom_send_callback, _transform_publisher)); + std::make_shared(sensor.sensor_actor_definition(), sensor.v2x_custom_send_callback, _transform_publisher)); } break; case types::PublisherSensorType::WorldObserver: case types::PublisherSensorType::RssSensor: @@ -333,16 +333,16 @@ void UeWorldPublisher::CreateSensorUePublisher(UeSensor &sensor) { case types::PublisherSensorType::ObstacleDetectionSensor: default: { sensor.publisher_expected = false; - log_error("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + log_error("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition()), "]: Not a UE sensor or no publisher implemented yet"); } } if (sensor.publisher != nullptr) { if (!sensor.publisher->Init(_domain_participant_impl)) { - log_error("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + log_error("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition()), "]: Failed to init publisher"); } else { - log_debug("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition), + log_debug("UeWorldPublisher::CreateSensorUePublisher[", std::to_string(*sensor.sensor_actor_definition()), "]: Publisher initialized"); } } @@ -554,7 +554,7 @@ void UeWorldPublisher::RemoveActor(ActorId actor) { auto sensor_iter = find_ue_sensor(actor); if (sensor_iter!=_ue_sensors.end()) { - log_debug("ROS2::RemoveSensorUe(", std::to_string(*sensor_iter->second.sensor_actor_definition), ")"); + log_debug("ROS2::RemoveSensorUe(", std::to_string(*sensor_iter->second.sensor_actor_definition()), ")"); _ue_sensors.erase(sensor_iter); _sensors_changed = true; } @@ -877,7 +877,7 @@ void UeWorldPublisher::AttachActors(ActorId const child, ActorId const parent) { if ( find_result != _ue_sensors.end()) { UeSensor &sensor = find_result->second; if (sensor.publisher) { - log_error("UeWorldPublisher::AttachActors[", std::to_string(*sensor.sensor_actor_definition), + log_error("UeWorldPublisher::AttachActors[", std::to_string(*sensor.sensor_actor_definition()), "]: Sensor attached to parent ", parent, ". Sensor has already a running publisher with base topic name ", sensor.publisher->get_topic_name(), " has to be destroyed due to re-attachment"); @@ -892,7 +892,7 @@ UeWorldPublisher::find_ue_sensor(ActorId actor_id) { auto find_result = std::find_if(_ue_sensors.begin(), _ue_sensors.end(), [actor_id](std::pair element) { - return actor_id == element.second.sensor_actor_definition->id; + return actor_id == element.second.sensor_actor_definition()->id; }); return find_result; } @@ -902,7 +902,7 @@ UeWorldPublisher::find_ue_sensor(ActorId actor_id)const { auto find_result = std::find_if(_ue_sensors.begin(), _ue_sensors.end(), [actor_id](std::pair element) { - return actor_id == element.second.sensor_actor_definition->id; + return actor_id == element.second.sensor_actor_definition()->id; }); return find_result; } diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h index 0131842fd57..eeca8f3504b 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h @@ -215,8 +215,10 @@ class UeWorldPublisher : public UePublisherBaseSensor, public std::enable_shared struct UeSensor { UeSensor(std::shared_ptr sensor_actor_definition_) - : sensor_actor_definition(sensor_actor_definition_) {} - std::shared_ptr sensor_actor_definition; + : sensor_actor_record(std::make_shared(sensor_actor_definition_)) {} + std::shared_ptr sensor_actor_definition() { + return std::dynamic_pointer_cast(sensor_actor_record->_actor_name_definition); } + std::shared_ptr sensor_actor_record; carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback{nullptr}; bool publisher_expected{true}; std::shared_ptr publisher; diff --git a/LibCarla/source/carla/ros2/types/ActorDefinition.h b/LibCarla/source/carla/ros2/types/ActorDefinition.h index afce36a7a2b..8bf629dc73f 100644 --- a/LibCarla/source/carla/ros2/types/ActorDefinition.h +++ b/LibCarla/source/carla/ros2/types/ActorDefinition.h @@ -28,8 +28,8 @@ struct ActorDefinition : public ActorNameDefinition { id = env_object.id; type_id = env_object.name; - object_type=std::to_string(env_object.type); - base_type="environment_object"; + object_type="environment_object"; + base_type=std::to_string(env_object.type); enabled_for_ros = enabled_for_ros_; city_object_label=env_object.type; From 46689fa65162f629588edd0e68a19ba960be93a9 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Mon, 2 Feb 2026 19:26:57 +0100 Subject: [PATCH 19/39] Fix relative TF of not subscribed sensors --- LibCarla/source/carla/ros2/types/Transform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibCarla/source/carla/ros2/types/Transform.h b/LibCarla/source/carla/ros2/types/Transform.h index e2940b71e77..1557dcc1d1a 100644 --- a/LibCarla/source/carla/ros2/types/Transform.h +++ b/LibCarla/source/carla/ros2/types/Transform.h @@ -157,7 +157,7 @@ class Transform { carla::ros2::types::Transform GetRelativeTransform(carla::ros2::types::Transform const &basis) const { auto const relative_quaternion_new_base = basis.GetQuaternion().Inverse() * GetQuaternion(); auto const relative_location_current_base = GetLocation() - basis.GetLocation(); - carla::geom::Location const relative_location_new_base = carla::geom::Vector3D(basis.GetQuaternion().RotatedPoint(relative_location_current_base)); + carla::geom::Location const relative_location_new_base = carla::geom::Vector3D(basis.GetQuaternion().InverseRotatedPoint(relative_location_current_base)); carla::ros2::types::Transform relative_transform(relative_location_new_base, relative_quaternion_new_base); return relative_transform; } From b5f05214f484bc1b712ebbf8b2045989d67b8907 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Fri, 6 Feb 2026 15:23:41 +0100 Subject: [PATCH 20/39] Harmonize flags of carla_server and carla_fastdds library carla_fastdds library didn't set the server definitions Make foonathan_memory provider compilation more robust (v1.3.2 introduced FOONATHAN_MEMORY_FORCE_VENDORED_BUILD parameter which is not present in v1.3.1). In some cases didn't checkout the sources. --- Util/BuildTools/Setup.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Util/BuildTools/Setup.sh b/Util/BuildTools/Setup.sh index 0cff6acfce1..52906963c8f 100755 --- a/Util/BuildTools/Setup.sh +++ b/Util/BuildTools/Setup.sh @@ -929,7 +929,7 @@ if ${USE_ROS2} ; then FOONATHAN_MEMORY_VENDOR_BASENAME=foonathan-memory-vendor FOONATHAN_MEMORY_VENDOR_SOURCE_DIR=${PWD}/${FOONATHAN_MEMORY_VENDOR_BASENAME}-source FOONATHAN_MEMORY_VENDOR_REPO="https://github.com/eProsima/foonathan_memory_vendor.git" - FOONATHAN_MEMORY_VENDOR_BRANCH=v1.3.1 + FOONATHAN_MEMORY_VENDOR_BRANCH=v1.3.2 git clone --depth 1 --branch ${FOONATHAN_MEMORY_VENDOR_BRANCH} ${FOONATHAN_MEMORY_VENDOR_REPO} ${FOONATHAN_MEMORY_VENDOR_SOURCE_DIR} @@ -1029,7 +1029,7 @@ cat >${CMAKE_CONFIG_FILE}.gen < Date: Wed, 4 Feb 2026 19:06:29 +0100 Subject: [PATCH 21/39] Fix Quaternion <-> Rotator conversion In a previous commit where the Quaternions were introduced to support ROS conversion later on, the Rotator rotations were adapted to perform left-handed rotations to match the behavior of Quaternions in a left-handed system in a mathematical manner. But the original CARLA code from 0.9.16 was totally correct on performing rotations using the Rotator, since Unreal Rotator has a very special definition of rotation directions: performing left-handed rotation for yaw component, but right-handed rotations for the other two axis. This commit reverts the behavior of the Rotator and adapts the Quaternion <-> Rotator conversion: roll and pitch have to be negated when converting Rototar to Quaternion and vice-versa. To ensure geom::Rotator and geom::Quaternion behave exactly as their Unreal counterparts, the unit test have been expanded and the expected results within taken over from Unreal calculation results. The rotation matrix rotations are verified within that test, too. --- LibCarla/source/carla/geom/Quaternion.h | 79 +++---- .../source/carla/geom/RightHandedVector3D.h | 54 ----- LibCarla/source/carla/geom/Rotation.h | 58 +++-- LibCarla/source/carla/geom/Transform.h | 4 - LibCarla/source/carla/ros2/types/Quaternion.h | 27 +-- LibCarla/source/carla/ros2/types/Transform.h | 16 +- LibCarla/source/test/common/test_geom.cpp | 209 +++++++++++------- PythonAPI/carla/source/libcarla/Geom.cpp | 6 - PythonAPI/test/unit/test_transform.py | 17 +- 9 files changed, 219 insertions(+), 251 deletions(-) delete mode 100644 LibCarla/source/carla/geom/RightHandedVector3D.h diff --git a/LibCarla/source/carla/geom/Quaternion.h b/LibCarla/source/carla/geom/Quaternion.h index 512b7a1b88f..9842d357d4d 100644 --- a/LibCarla/source/carla/geom/Quaternion.h +++ b/LibCarla/source/carla/geom/Quaternion.h @@ -6,8 +6,6 @@ #pragma once -#define ALLOW_UNSAFE_GEOM_MATRIX_ACCESS 1 - #include #include #include @@ -17,7 +15,6 @@ #include "carla/geom/Location.h" #include "carla/geom/Vector3D.h" #include "carla/geom/Rotation.h" -#include "carla/geom/RightHandedVector3D.h" namespace carla { namespace geom { @@ -34,22 +31,6 @@ namespace geom { * Stores the orientation of an entity as quaternion; * The quaternion is existing in Unreal coordinate system. * This is considered by all defined operations on the quaternion (input/output vectors and angles are automatically converted where required) - * - * Be aware: UE uses left-handed coordinate system! - Because nearly every writing on this is written in a form which let's room for interpretation - Even that one talks on clock-wise rotation: https://forums.unrealengine.com/t/ue4-coordinate-system-not-right-handed/80398/4, - but it is not telling if you are watching into axis positive direction or negative direction; therefore "clockwise" can be interpreted in both ways. - Ok, the example given makes it definitely clear then. - - Therefore let's take the easiest way to explain: Your left hand! - Point thumb upwards (positive z-Axis direction), index finger forwards (positive x-Axis direction), middle finger rightwards (positive y-Axis direction) - Positive rotation can be "visualized" with thumb of the left hand pointing into the respective positive direction of the rotation axis, - then the fingers when creating a fist are showing the positive rotation direction. - - The same by the way, works for right-handed coordinate systems: just take the right hand instead, resulting in the y-axis beeing flipped and rotation direction switches! - - The "problem" is that a linear algebra (matrix/quaternion/vector multiplication) is actually operating in a right-handed coordinate system. Don't ask why the hell the - compter graphics guys actually prefer left-handed systems. Robotics, of which automated driving is a sub area, does not. */ class Quaternion { public: @@ -79,8 +60,11 @@ namespace geom { explicit Quaternion(Rotation const &rotator) { // intermediate values in double to improve precision // calculation see https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles - double const roll_2 = Math::ToRadians(rotator.roll) * 0.5; - double const pitch_2 = Math::ToRadians(rotator.pitch) * 0.5; + // geom::Quaternion is in unreal left handed system, rotating around all axis left handed + // geom::Rotation is in unreal left handed system, treating yaw as left-handed rotation + // but pitch and roll as right-handed ones! Therefore, we have to negate pitch and roll here + double const roll_2 = Math::ToRadians(-rotator.roll) * 0.5; + double const pitch_2 = Math::ToRadians(-rotator.pitch) * 0.5; double const yaw_2 = Math::ToRadians(rotator.yaw) * 0.5; double cr = std::cos(roll_2); double sr = std::sin(roll_2); @@ -89,27 +73,25 @@ namespace geom { double cy = std::cos(yaw_2); double sy = std::sin(yaw_2); - // unreal rotates in counter direction, therefore the rotation has to be inverted. - // Unreal uses left handed system: negate x,y,z axis (counter direction), negate y-axis (pointing to the right) - x = -float(sr * cp * cy - cr * sp * sy); // negate - y = float(cr * sp * cy + sr * cp * sy); // double negate - z = -float(cr * cp * sy - sr * sp * cy); // negate + x = float(sr * cp * cy - cr * sp * sy); + y = float(cr * sp * cy + sr * cp * sy); + z = float(cr * cp * sy - sr * sp * cy); w = float(cr * cp * cy + sr * sp * sy); } static Quaternion CreateFromYawDegree(float const &yaw_degree) { // intermediate values in double to improve precision // calculation see https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles - // unreal rotates in left direction ! therefore we have to apply the inverse Euler rotation here double const yaw_2 = Math::ToRadians(yaw_degree) * 0.5; double cy = std::cos(yaw_2); double sy = std::sin(yaw_2); Quaternion quat; - // unreal rotates in counter direction, therefore the rotation has to be inverted. - // Unreal uses left handed system: y-axis is negated (double negated) + // geom::Quaternion is in unreal left handed system, rotating around all axis left handed + // geom::Rotation is in unreal left handed system, treating yaw as left-handed rotation + // Therefore, no negation required for yaw component quat.x = 0.f; quat.y = 0.f; - quat.z = -float(sy); // negate + quat.z = float(sy); quat.w = float(cy); return quat; } @@ -171,8 +153,10 @@ namespace geom { auto const cp = std::cos(pitch); yaw = std::atan2(matrix[3]/cp, matrix[0]/cp); } - // Unreal uses left handed system: y-axis is negated: apply on output vector - return -yaw; + // geom::Quaternion is in unreal left handed system, rotating around all axis left handed + // geom::Rotation is in unreal left handed system, treating yaw as left-handed rotation + // Therefore, no negation required for yaw component + return yaw; } /** shortened version of Rotator() providing the yaw component in degree @@ -206,21 +190,23 @@ namespace geom { yaw = 0.f; roll = std::atan2(matrix[7], matrix[8]); } - // Unreal uses left handed system: negate all rotations + // geom::Quaternion is in unreal left handed system, rotating around all axis left handed + // geom::Rotation is in unreal left handed system, treating yaw as left-handed rotation + // but pitch and roll as right-handed ones! Therefore, we have to negate pitch and roll here carla::geom::Rotation rotator; rotator.roll = Math::ToDegrees(-roll); rotator.pitch = Math::ToDegrees(-pitch); - rotator.yaw = Math::ToDegrees(-yaw); + rotator.yaw = Math::ToDegrees(yaw); return rotator; } template - RightHandedVector3D RotatedVector(VECTOR_TYPE const &in_point) const { + Vector3D RotatedVector(VECTOR_TYPE const &in_point) const { return RotatedPoint(in_point); } template - RightHandedVector3D InverseRotatedVector(VECTOR_TYPE const &in_point) const { + Vector3D InverseRotatedVector(VECTOR_TYPE const &in_point) const { return InverseRotatedPoint(in_point); } @@ -282,16 +268,7 @@ namespace geom { } // ========================================================================= -#if ALLOW_UNSAFE_GEOM_MATRIX_ACCESS public: -#else - private: -#endif - // Computes the 3x3 rotation-matrix of the quaternion (as this matrix operates in right handed space as our quaternion, keept the matrix private for the moment. - // If required public input/output vectors of this operation will have to be ensured to be RightHandedVector3D - // Therefore, making it public reuires a dedicated Matrix class which is enforing this by it's interface. - // Don't allow access on matrix members for people who don't know the background in detail: that will definitely go wrong! - // Best is to NOT use this function therefore at all. std::array RotationMatrix() const { // calculation see https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles // in the matrix each component is multplied with another component; @@ -329,18 +306,18 @@ namespace geom { return Inverse().RotationMatrix(); } - RightHandedVector3D RotatedPoint(RightHandedVector3D const &in_point) const { + Vector3D RotatedPoint(Vector3D const &in_point) const { Quaternion quat = *this * in_point * Inverse(); - RightHandedVector3D out_point; + Vector3D out_point; out_point.x = quat.x; out_point.y = quat.y; out_point.z = quat.z; return out_point; } - RightHandedVector3D InverseRotatedPoint(RightHandedVector3D const &in_point) const { + Vector3D InverseRotatedPoint(Vector3D const &in_point) const { Quaternion quat = Inverse() * in_point * *this; - RightHandedVector3D out_point; + Vector3D out_point; out_point.x = quat.x; out_point.y = quat.y; out_point.z = quat.z; @@ -358,7 +335,7 @@ inline Quaternion operator*(const Quaternion& q1, const Quaternion& q2) { return quat; } -inline Quaternion operator*(const Quaternion& q, const RightHandedVector3D& v) +inline Quaternion operator*(const Quaternion& q, const Vector3D& v) { Quaternion quat; quat.x = q.w * v.x + q.y * v.z - q.z * v.y; @@ -368,7 +345,7 @@ inline Quaternion operator*(const Quaternion& q, const RightHandedVector3D& v) return quat; } -inline Quaternion operator*(const RightHandedVector3D& v, const Quaternion& q) +inline Quaternion operator*(const Vector3D& v, const Quaternion& q) { Quaternion quat; quat.x = v.x * q.w + v.y * q.z - v.z * q.y; diff --git a/LibCarla/source/carla/geom/RightHandedVector3D.h b/LibCarla/source/carla/geom/RightHandedVector3D.h deleted file mode 100644 index f931bc4744e..00000000000 --- a/LibCarla/source/carla/geom/RightHandedVector3D.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma -// de Barcelona (UAB). -// -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/geom/Vector3D.h" - -namespace carla { -namespace geom { - - class Quaternion; - class Rotation; - Quaternion operator*(const Quaternion& q, const Vector3D& w); - Quaternion operator*(const Vector3D& w, const Quaternion& q); - - /** Stores a Vector3D in right handed representation required for the internal calculations */ - class RightHandedVector3D { - public: - RightHandedVector3D(Vector3D const& ue_vector) - : x(ue_vector.x) - , y(-ue_vector.y) - , z(ue_vector.z) - {} - - operator Vector3D() const { - return Vector3D(x, -y, z); - } - - private: - // only the implicit conversion's are accessible by the public - RightHandedVector3D() = default; - RightHandedVector3D(RightHandedVector3D const &) = default; - RightHandedVector3D(RightHandedVector3D &&) = default; - RightHandedVector3D& operator=(RightHandedVector3D const &) = default; - RightHandedVector3D& operator=(RightHandedVector3D &&) = default; - - friend class Quaternion; - friend class Rotation; - friend Quaternion operator*(const Quaternion&, const RightHandedVector3D&); - friend Quaternion operator*(const RightHandedVector3D&, const Quaternion&); - - - float x = 0.0f; - - float y = 0.0f; - - float z = 0.0f; - }; - -} // namespace geom -} // namespace carla diff --git a/LibCarla/source/carla/geom/Rotation.h b/LibCarla/source/carla/geom/Rotation.h index ad4a3144ed7..8b78696e6af 100644 --- a/LibCarla/source/carla/geom/Rotation.h +++ b/LibCarla/source/carla/geom/Rotation.h @@ -12,7 +12,6 @@ #include "carla/MsgPack.h" #include "carla/geom/Math.h" #include "carla/geom/Vector3D.h" -#include "carla/geom/RightHandedVector3D.h" #ifdef LIBCARLA_INCLUDED_FROM_UE4 #include @@ -75,61 +74,60 @@ namespace geom { return RotatedVector(up_vector); } - RightHandedVector3D RotatedVector(RightHandedVector3D const &in_point) const { + Vector3D RotatedVector(Vector3D const &in_point) const { // Rotates Rz(yaw) * Ry(pitch) * Rx(roll) = first x, then y, then z. - // Unreal uses left handed system: negate x,y,z axis rotations (counter direction), negate y-axis rotation again, because we have a right handed vector at hand now - const float cr = std::cos(Math::ToRadians(-roll)); // negate - const float sr = std::sin(Math::ToRadians(-roll)); // negate - const float cp = std::cos(Math::ToRadians(pitch)); // double-negate - const float sp = std::sin(Math::ToRadians(pitch)); // double-negate - const float cy = std::cos(Math::ToRadians(-yaw)); // negate - const float sy = std::sin(Math::ToRadians(-yaw)); // negate - - // Matrix basis see https://en.wikipedia.org/wiki/Rotation_matrix Euler Angles, alpha=roll, beta=pitch, gamma=yaw - RightHandedVector3D out_point; + // Be aware that the Unreal Rotator interface uses a very special interpretation of rotation directions + // treating yaw as left-handed rotation but pitch and roll as right-handed ones! + const float cr = std::cos(Math::ToRadians(roll)); + const float sr = std::sin(Math::ToRadians(roll)); + const float cp = std::cos(Math::ToRadians(pitch)); + const float sp = std::sin(Math::ToRadians(pitch)); + const float cy = std::cos(Math::ToRadians(yaw)); + const float sy = std::sin(Math::ToRadians(yaw)); + + Vector3D out_point; out_point.x = in_point.x * (cp * cy) + - in_point.y * (cy * sp * sr - sy * cr) + - in_point.z * (cy * sp * cr + sy * sr); + in_point.y * (cy * sp * sr - sy * cr) + + in_point.z * (-cy * sp * cr - sy * sr); out_point.y = in_point.x * (cp * sy) + in_point.y * (sy * sp * sr + cy * cr) + - in_point.z * (sy * sp * cr - cy * sr); + in_point.z * (-sy * sp * cr + cy * sr); out_point.z = - in_point.x * (-sp) + - in_point.y * (cp * sr) + + in_point.x * (sp) + + in_point.y * (-cp * sr) + in_point.z * (cp * cr); return out_point; } - RightHandedVector3D InverseRotatedVector(RightHandedVector3D const &in_point) const { - // Unreal uses left handed system: negate x,y,z axis rotations (counter direction), negate y-axis rotation again, because we have a right handed vector at hand now - const float cr = std::cos(Math::ToRadians(-roll)); // negate - const float sr = std::sin(Math::ToRadians(-roll)); // negate - const float cp = std::cos(Math::ToRadians(pitch)); // double-negate - const float sp = std::sin(Math::ToRadians(pitch)); // double-negate - const float cy = std::cos(Math::ToRadians(-yaw)); // negate - const float sy = std::sin(Math::ToRadians(-yaw)); // negate + Vector3D InverseRotatedVector(Vector3D const &in_point) const { + const float cr = std::cos(Math::ToRadians(roll)); + const float sr = std::sin(Math::ToRadians(roll)); + const float cp = std::cos(Math::ToRadians(pitch)); + const float sp = std::sin(Math::ToRadians(pitch)); + const float cy = std::cos(Math::ToRadians(yaw)); + const float sy = std::sin(Math::ToRadians(yaw)); // Applies the transposed of the matrix used in RotateVector function, // which is the rotation inverse. - RightHandedVector3D out_point; + Vector3D out_point; out_point.x = in_point.x * (cp * cy) + in_point.y * (cp * sy) + - in_point.z * (-sp); + in_point.z * (sp); out_point.y = in_point.x * (cy * sp * sr - sy * cr) + in_point.y * (sy * sp * sr + cy * cr) + - in_point.z * (cp * sr); + in_point.z * (-cp * sr); out_point.z = - in_point.x * (cy * sp * cr + sy * sr) + - in_point.y * (sy * sp * cr - cy * sr) + + in_point.x * (-cy * sp * cr - sy * sr) + + in_point.y * (-sy * sp * cr + cy * sr) + in_point.z * (cp * cr); return out_point; diff --git a/LibCarla/source/carla/geom/Transform.h b/LibCarla/source/carla/geom/Transform.h index 1633562544b..c8aed949c9f 100644 --- a/LibCarla/source/carla/geom/Transform.h +++ b/LibCarla/source/carla/geom/Transform.h @@ -112,9 +112,6 @@ namespace geom { #endif // LIBCARLA_INCLUDED_FROM_UE4 -#if ALLOW_UNSAFE_GEOM_MATRIX_ACCESS - // this matrix is rotating within a right handed-coordinate system, but Unreal coordinate frame is left-handed! - // If we want to make this public, a dedicated Matrix4x4 type has to be defined considiering that (see also Quaternion.h) std::array TransformationMatrix() const { auto const matrix = Quaternion(rotation).RotationMatrix(); @@ -142,7 +139,6 @@ namespace geom { return transform; } -#endif }; inline std::ostream &operator<<(std::ostream &out, const Transform &transform) { diff --git a/LibCarla/source/carla/ros2/types/Quaternion.h b/LibCarla/source/carla/ros2/types/Quaternion.h index 2c5226a342d..c5f56d7e9f5 100644 --- a/LibCarla/source/carla/ros2/types/Quaternion.h +++ b/LibCarla/source/carla/ros2/types/Quaternion.h @@ -15,9 +15,12 @@ namespace types { /** Convert a carla rotation to a ROS quaternion - Considers the conversion from left-handed system (unreal) to right-handed - system (ROS). - Considers the conversion from degrees (carla) to radians (ROS). + Considers the conversion from left-handed system (unreal) with axis x-forward, y-rightwards, z-up + to right-handed system (ROS) with axis x-forward, y-leftwards, z-up. + If you were moving to a pure LH system where the Y-axis also pointed Left, you would negate everything. + But Unreal flipped the axis direction (Left to Right) and flipped the handedness (RH to LH), + those two flips "cancel out" for the X and Y rotations. + Therefore, only the z component of the quaternion is negated! */ class Quaternion { public: @@ -25,11 +28,10 @@ class Quaternion { * carla_rotation: the carla Rotation */ explicit Quaternion(const geom::Quaternion& carla_quaternion) { - // left-handed to right-handed -> negate the rotation by negating all axis components - // switch y-axis from right to left -> negate y-axis - _ros_quaternion.x(-carla_quaternion.x); // -(forward = forward) - _ros_quaternion.y(carla_quaternion.y); // -( right = -left ) - _ros_quaternion.z(-carla_quaternion.z); // -( up = up ) + // negate z component to convert from Unreal left-handed system to ROS right-handed system + _ros_quaternion.x(carla_quaternion.x); + _ros_quaternion.y(carla_quaternion.y); + _ros_quaternion.z(-carla_quaternion.z); _ros_quaternion.w(carla_quaternion.w); } /** @@ -52,11 +54,10 @@ class Quaternion { geom::Quaternion GetQuaternion() const { geom::Quaternion carla_quaternion; - // left-handed to right-handed -> negate the rotation by negating all axis components - // switch y-axis from right to left -> negate y-axis - carla_quaternion.x = float(-_ros_quaternion.x()); // -(forward = forward) - carla_quaternion.y = float(_ros_quaternion.y()); // -( right = -left ) - carla_quaternion.z = float(-_ros_quaternion.z()); // -( up = up ) + // negate z component to convert from Unreal left-handed system to ROS right-handed system + carla_quaternion.x = float(_ros_quaternion.x()); + carla_quaternion.y = float(_ros_quaternion.y()); + carla_quaternion.z = float(-_ros_quaternion.z()); carla_quaternion.w = float(_ros_quaternion.w()); return carla_quaternion; } diff --git a/LibCarla/source/carla/ros2/types/Transform.h b/LibCarla/source/carla/ros2/types/Transform.h index 1557dcc1d1a..2c682b3a52e 100644 --- a/LibCarla/source/carla/ros2/types/Transform.h +++ b/LibCarla/source/carla/ros2/types/Transform.h @@ -110,7 +110,7 @@ class Transform { * * Uses CARLA naming convention */ - carla::geom::Transform GetTransform() { + carla::geom::Transform GetTransform() const { EnsureCarlaRotatorInitialized(); return carla::geom::Transform(_carla_location, _carla_rotation); } @@ -129,7 +129,7 @@ class Transform { * * Uses CARLA naming convention */ - const carla::geom::Rotation& GetRotator() { + const carla::geom::Rotation& GetRotator() const { EnsureCarlaRotatorInitialized(); return _carla_rotation; } @@ -163,7 +163,7 @@ class Transform { } private: - void EnsureCarlaRotatorInitialized() { + void EnsureCarlaRotatorInitialized() const { if ( !_carla_rotation_initialized ) { _carla_rotation_initialized = true; _carla_rotation = _carla_quaternion.Rotator(); @@ -176,10 +176,12 @@ class Transform { _ros_transform.rotation(carla::ros2::types::Quaternion(_carla_quaternion).quaternion()); } - // keep the carla types, but with rotation optional (only to be calculated if required in case of ROS input) + // keep the carla types, but with rotation optional // be aware: rotation calculation requires some sin/cos calls and is rather expensive - carla::geom::Rotation _carla_rotation; - bool _carla_rotation_initialized = false; + // therefore, calculate rotation only if actually required (e.g. in case of ROS input) + // make the rotation mutable to allow lazy initialization in const methods + mutable carla::geom::Rotation _carla_rotation; + mutable bool _carla_rotation_initialized = false; carla::geom::Location _carla_location; carla::geom::Quaternion _carla_quaternion; geometry_msgs::msg::Transform _ros_transform; @@ -205,7 +207,7 @@ inline std::string to_string(geometry_msgs::msg::Transform const &transform) { inline std::string to_string(carla::ros2::types::Transform const &transform) { return "Transform(" + std::to_string(transform.transform()) + " CARLA: " + - std::to_string(transform.GetQuaternion()) + std::to_string(transform.GetLocation()); + std::to_string(transform.GetQuaternion()) + std::to_string(transform.GetLocation()) + std::to_string(transform.GetRotator()) + ")"; } } // namespace std \ No newline at end of file diff --git a/LibCarla/source/test/common/test_geom.cpp b/LibCarla/source/test/common/test_geom.cpp index 9459c7c4696..455ce6a3154 100644 --- a/LibCarla/source/test/common/test_geom.cpp +++ b/LibCarla/source/test/common/test_geom.cpp @@ -125,36 +125,8 @@ TEST(geom, quaternion_inverse) { ASSERT_NEAR(unit.w, Quaternion().w, error) << "unit: " << unit.x << " " << unit.y << " " << unit.z << " " << unit.w; } -Vector3D carla_0_9_15_RotatedVector(Rotation const &rotator, Vector3D const &in_point) { - // Rotates Rz(yaw) * Ry(pitch) * Rx(roll) = first x, then y, then z. - const float cy = std::cos(Math::ToRadians(rotator.yaw)); - const float sy = std::sin(Math::ToRadians(rotator.yaw)); - const float cr = std::cos(Math::ToRadians(rotator.roll)); - const float sr = std::sin(Math::ToRadians(rotator.roll)); - const float cp = std::cos(Math::ToRadians(rotator.pitch)); - const float sp = std::sin(Math::ToRadians(rotator.pitch)); - - Vector3D out_point; - out_point.x = - in_point.x * (cp * cy) + - in_point.y * (cy * sp * sr - sy * cr) + - in_point.z * (-cy * sp * cr - sy * sr); - - out_point.y = - in_point.x * (cp * sy) + - in_point.y * (sy * sp * sr + cy * cr) + - in_point.z * (-sy * sp * cr + cy * sr); - - out_point.z = - in_point.x * (sp) + - in_point.y * (-cp * sr) + - in_point.z * (cp * cr); - - return out_point; -} - TEST(geom, single_point_rotation_90) { - auto compare = [](int line, Rotation const &rotator, Vector3D point, Vector3D const &result_point)->void { + auto compare = [](int line, Rotation const &rotator, Vector3D point, Vector3D const &result_point, Quaternion const &result_quat)->void { constexpr double error = 0.001; Vector3D const in_point = point; @@ -162,7 +134,7 @@ TEST(geom, single_point_rotation_90) { Location translation (0.0,0.0,0.0); Transform transform = Transform(translation, rotator); transform.TransformPoint(point); - EXPECT_NEAR(point.x, result_point.x, error) + EXPECT_NEAR(point.x, result_point.x, error) << " LINE " << line << " x: \n" << " point: " << point.x << " " << point.y << " " << point.z; EXPECT_NEAR(point.y, result_point.y, error) @@ -183,7 +155,26 @@ TEST(geom, single_point_rotation_90) { << " LINE "<< line << " -z: \n" << " point: " << point.x << " " << point.y << " " << point.z; + // do we create the quaternion correctly? Quaternion quaternion(rotator); + EXPECT_NEAR(quaternion.x, result_quat.x, error) + << " LINE " << line << " x: \n" + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w << "\n" + << " res-quat: " << result_quat.x << " " << result_quat.y << " " << result_quat.z << " " << result_quat.w << "\n"; + EXPECT_NEAR(quaternion.y, result_quat.y, error) + << " LINE " << line << " y: \n" + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w << "\n" + << " res-quat: " << result_quat.x << " " << result_quat.y << " " << result_quat.z << " " << result_quat.w << "\n"; + EXPECT_NEAR(quaternion.z, result_quat.z, error) + << " LINE " << line << " z: \n" + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w << "\n" + << " res-quat: " << result_quat.x << " " << result_quat.y << " " << result_quat.z << " " << result_quat.w << "\n"; + EXPECT_NEAR(quaternion.w, result_quat.w, error) + << " LINE " << line << " w: \n" + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w << "\n" + << " res-quat: " << result_quat.x << " " << result_quat.y << " " << result_quat.z << " " << result_quat.w << "\n"; + + // does the quaternion rotate the point correctly? Vector3D rotated_vector = quaternion.RotatedVector(in_point); EXPECT_NEAR(rotated_vector.x, result_point.x, error) << " LINE " << line << " x: \n" @@ -211,58 +202,124 @@ TEST(geom, single_point_rotation_90) { << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w << "\n" << " rotated_vector: " << rotated_vector.x << " " << rotated_vector.y << " " << rotated_vector.z; - auto const carla_0_9_15_result = carla_0_9_15_RotatedVector(rotator, in_point); - if ((std::fabs(carla_0_9_15_result.x-result_point.x) > error) || - (std::fabs(carla_0_9_15_result.y-result_point.y) > error) || - (std::fabs(carla_0_9_15_result.z-result_point.z) > error)) { - std::cerr << "Information: Rotation carla 0.9.16 test Rotation(pitch=" << rotator.pitch << ", yaw=" << rotator.yaw << ", roll=" << rotator.roll << ")" << std::endl - << " point: " << point.x << " " << point.y << " " << point.z << std::endl - << " resulted in point: " << carla_0_9_15_result.x << " " << carla_0_9_15_result.y << " " << carla_0_9_15_result.z << std::endl - << " but correct result is : " << result_point.x << " " << result_point.y << " " << result_point.z << std::endl; - } + // does the quaternion convert back to rotator correctly? + Rotation quat_rotator = quaternion.Rotator(); + EXPECT_NEAR(quat_rotator.roll, rotator.roll, error) + << " LINE " << line << " roll: \n" + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w; + EXPECT_NEAR(quat_rotator.pitch, rotator.pitch, error) + << " LINE "<< line << " pitch: \n" + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w; + EXPECT_NEAR(quat_rotator.yaw, rotator.yaw, error) + << " LINE "<< line << " yaw: \n" + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w; + float quat_yaw_rad = quaternion.YawRad(); + EXPECT_NEAR(quat_yaw_rad, Math::ToRadians(rotator.yaw), error) + << " LINE "<< line << " quat-yaw-rad: \n" + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w; + + // also test the rotation matrix directly + auto matrix = quaternion.RotationMatrix(); + point.x = matrix[0] * in_point.x + matrix[1] * in_point.y + matrix[2] * in_point.z; + point.y = matrix[3] * in_point.x + matrix[4] * in_point.y + matrix[5] * in_point.z; + point.z = matrix[6] * in_point.x + matrix[7] * in_point.y + matrix[8] * in_point.z; + EXPECT_NEAR(point.x, result_point.x, error) + << " LINE " << line << " x: \n" + << " point: " << point.x << " " << point.y << " " << point.z + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w + << " matrix: " << matrix[0] << " " << matrix[1] << " " << matrix[2] + << " \n" << matrix[3] << " " << matrix[4] << " " << matrix[5] + << " \n" << matrix[6] << " " << matrix[7] << " " << matrix[8]; + EXPECT_NEAR(point.y, result_point.y, error) + << " LINE "<< line << " y: \n" + << " point: " << point.x << " " << point.y << " " << point.z + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w + << " matrix: " << matrix[0] << " " << matrix[1] << " " << matrix[2] + << " \n" << matrix[3] << " " << matrix[4] << " " << matrix[5] + << " \n" << matrix[6] << " " << matrix[7] << " " << matrix[8]; + EXPECT_NEAR(point.z, result_point.z, error) + << " LINE "<< line << " z: \n" + << " point: " << point.x << " " << point.y << " " << point.z + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w + << " matrix: " << matrix[0] << " " << matrix[1] << " " << matrix[2] + << " \n" << matrix[3] << " " << matrix[4] << " " << matrix[5] + << " \n" << matrix[6] << " " << matrix[7] << " " << matrix[8]; + matrix = quaternion.InverseRotationMatrix(); + auto rotated_point = point; + point.x = matrix[0] * rotated_point.x + matrix[1] * rotated_point.y + matrix[2] * rotated_point.z; + point.y = matrix[3] * rotated_point.x + matrix[4] * rotated_point.y + matrix[5] * rotated_point.z; + point.z = matrix[6] * rotated_point.x + matrix[7] * rotated_point.y + matrix[8] * rotated_point.z; + EXPECT_NEAR(point.x, in_point.x, error) + << " LINE " << line << " x: \n" + << " point: " << point.x << " " << point.y << " " << point.z + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w + << " matrix: " << matrix[0] << " " << matrix[1] << " " << matrix[2] + << " \n" << matrix[3] << " " << matrix[4] << " " << matrix[5] + << " \n" << matrix[6] << " " << matrix[7] << " " << matrix[8]; + EXPECT_NEAR(point.y, in_point.y, error) + << " LINE "<< line << " y: \n" + << " point: " << point.x << " " << point.y << " " << point.z + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w + << " matrix: " << matrix[0] << " " << matrix[1] << " " << matrix[2] + << " \n" << matrix[3] << " " << matrix[4] << " " << matrix[5] + << " \n" << matrix[6] << " " << matrix[7] << " " << matrix[8]; + EXPECT_NEAR(point.z, in_point.z, error) + << " LINE "<< line << " z: \n" + << " point: " << point.x << " " << point.y << " " << point.z + << " quat: " << quaternion.x << " " << quaternion.y << " " << quaternion.z << " " << quaternion.w + << " matrix: " << matrix[0] << " " << matrix[1] << " " << matrix[2] + << " \n" << matrix[3] << " " << matrix[4] << " " << matrix[5] + << " \n" << matrix[6] << " " << matrix[7] << " " << matrix[8]; }; // test all 90° rotations of positive unit vectors on axis; Remember: - // UE uses left-handed coordinate system! - // Because nearly every writing on this is written in a form which let's room for interpretation - // Even that one talks on clock-wise rotation: https://forums.unrealengine.com/t/ue4-coordinate-system-not-right-handed/80398/4, - // but it is not telling if you are watching into axis positive direction or negative direction; therefore "clockwise" can be interpreted in both ways. - // Ok, the example given makes it definitely clear then, which is our test 7 below. - // - // Therefore let's take the easiest way to explain: Your left hand! - // Point thumb upwards (positive z-Axis direction), index finger forwards (positive x-Axis direction), middle finger rightwards (positive y-Axis direction) - // Positive rotation can be "visualized" with thumb of the left hand pointing into the respective positive direction of the rotation axis, - // then the fingers when creating a fist are showing the positive rotation direction. - // - // The same by the way, works for right-handed coordinate systems: just take the right hand instead, resulting in the y-axis beeing flipped and rotation direction switches! - // - // pitch(y) yaw(z) roll(x) px py pz r_x r_y r_z - // pitch hand index finger goes down - compare( 1, { 90.0f, 0.0f, 0.0f}, {1.0f, 0.f, 0.f}, { 0.0f, 0.0f, -1.0f}); // x-axis downwards - compare( 2, { 90.0f, 0.0f, 0.0f}, {0.0f, 1.f, 0.f}, { 0.0f, 1.0f, 0.0f}); // y-axis constant - compare( 3, { 90.0f, 0.0f, 0.0f}, {0.0f, 0.f, 1.f}, { 1.0f, 0.0f, 0.0f}); // z-axis forwards + // UE uses left-handed coordinate system: using the left hand we get: + // Point thumb upwards (positive z-Axis direction), index finger forwards (positive x-Axis direction), middle finger rightwards (positive y-Axis direction) + // All rotation values in the Rotator are stored in degrees. + // The angles are interpreted as intrinsic rotations applied in the order Yaw, then Pitch, then Roll. + // I.e., an object would be rotated first by the specified yaw around its up axis + // (with positive angles interpreted as clockwise when viewed from above, along -Z), + // then pitched around its (new) right axis (with positive angles interpreted as 'nose up', i.e. clockwise when viewed along +Y), + // and then finally rolled around its (final) forward axis (with positive angles interpreted as clockwise rotations when viewed along +X). + // Note that these conventions differ from quaternion axis/angle. UE Quat always considers a positive angle to be a left-handed rotation, + // whereas Rotator treats yaw as left-handed but pitch and roll as right-handed. + // + // Since we need to reqroduce the existing behaviour from Unreal within our Rotator and Quaternion classes, + // we have to take care of these conventions here in the test cases as well. + // The result values have previously been verified within Unreal Engine results directly. + Quaternion const pitch_positive_90 = {0.000000, -0.707107, 0.000000, 0.707107}; + Quaternion const pitch_negative_90 = {-0.000000, 0.707107, 0.000000, 0.707107}; + Quaternion const yaw_positive_90 = {0.000000, -0.000000, 0.707107, 0.707107}; + Quaternion const yaw_negative_90 = {-0.000000, 0.000000, -0.707107, 0.707107}; + Quaternion const roll_positive_90 = {-0.707107, -0.000000, 0.000000, 0.707107}; + Quaternion const roll_negative_90 = {0.707107, 0.000000, 0.000000, 0.707107}; + // pitch(y) yaw(z) roll(x) px py pz r_x r_y r_z q_x q_y q_z q_w // pitch hand index finger goes up - compare( 4, { -90.0f, 0.0f, 0.0f}, {1.0f, 0.f, 0.f}, { 0.0f, 0.0f, 1.0f}); // x-axis upwards - compare( 5, { -90.0f, 0.0f, 0.0f}, {0.0f, 1.f, 0.f}, { 0.0f, 1.0f, 0.0f}); // y-axis constant - compare( 6, { -90.0f, 0.0f, 0.0f}, {0.0f, 0.f, 1.f}, {-1.0f, 0.0f, 0.0f}); // z-axis backwards + compare( 1, { 90.0f, 0.0f, 0.0f}, {1.0f, 0.f, 0.f}, { 0.0f, 0.0f, 1.0f}, pitch_positive_90); // x-axis upwards + compare( 2, { 90.0f, 0.0f, 0.0f}, {0.0f, 1.f, 0.f}, { 0.0f, 1.0f, 0.0f}, pitch_positive_90); // y-axis constant + compare( 3, { 90.0f, 0.0f, 0.0f}, {0.0f, 0.f, 1.f}, {-1.0f, 0.0f, 0.0f}, pitch_positive_90); // z-axis backwards + // pitch hand index finger goes down + compare( 4, { -90.0f, 0.0f, 0.0f}, {1.0f, 0.f, 0.f}, { 0.0f, 0.0f, -1.0f}, pitch_negative_90); // x-axis downwards + compare( 5, { -90.0f, 0.0f, 0.0f}, {0.0f, 1.f, 0.f}, { 0.0f, 1.0f, 0.0f}, pitch_negative_90); // y-axis constant + compare( 6, { -90.0f, 0.0f, 0.0f}, {0.0f, 0.f, 1.f}, { 1.0f, 0.0f, 0.0f}, pitch_negative_90); // z-axis forwards // yaw hand index finger goes to the right - compare( 7, { 0.0f, 90.0f, 0.0f}, {1.0f, 0.f, 0.f}, { 0.0f, 1.0f, 0.0f}); // x-axis rightwards - compare( 8, { 0.0f, 90.0f, 0.0f}, {0.0f, 1.f, 0.f}, {-1.0f, 0.0f, 0.0f}); // y-axis backwards - compare( 9, { 0.0f, 90.0f, 0.0f}, {0.0f, 0.f, 1.f}, { 0.0f, 0.0f, 1.0f}); // z-axis constant + compare( 7, { 0.0f, 90.0f, 0.0f}, {1.0f, 0.f, 0.f}, { 0.0f, 1.0f, 0.0f}, yaw_positive_90); // x-axis rightwards + compare( 8, { 0.0f, 90.0f, 0.0f}, {0.0f, 1.f, 0.f}, {-1.0f, 0.0f, 0.0f}, yaw_positive_90); // y-axis backwards + compare( 9, { 0.0f, 90.0f, 0.0f}, {0.0f, 0.f, 1.f}, { 0.0f, 0.0f, 1.0f}, yaw_positive_90); // z-axis constant // yaw hand index finger goes to the left - compare(10, { 0.0f, -90.0f, 0.0f}, {1.0f, 0.f, 0.f}, { 0.0f, -1.0f, 0.0f}); // x-axis leftwards - compare(11, { 0.0f, -90.0f, 0.0f}, {0.0f, 1.f, 0.f}, { 1.0f, 0.0f, 0.0f}); // y-axis forwards - compare(12, { 0.0f, -90.0f, 0.0f}, {0.0f, 0.f, 1.f}, { 0.0f, 0.0f, 1.0f}); // z-axis constant + compare(10, { 0.0f, -90.0f, 0.0f}, {1.0f, 0.f, 0.f}, { 0.0f, -1.0f, 0.0f}, yaw_negative_90); // x-axis leftwards + compare(11, { 0.0f, -90.0f, 0.0f}, {0.0f, 1.f, 0.f}, { 1.0f, 0.0f, 0.0f}, yaw_negative_90); // y-axis forwards + compare(12, { 0.0f, -90.0f, 0.0f}, {0.0f, 0.f, 1.f}, { 0.0f, 0.0f, 1.0f}, yaw_negative_90); // z-axis constant - // roll hand: thumb points to the left - compare(13, { 0.0f, 0.0f, 90.0f}, {1.0f, 0.f, 0.f}, { 1.0f, 0.0f, 0.0f}); // x-axis constant - compare(14, { 0.0f, 0.0f, 90.0f}, {0.0f, 1.f, 0.f}, { 0.0f, 0.0f, 1.0f}); // y-axis upwards - compare(15, { 0.0f, 0.0f, 90.0f}, {0.0f, 0.f, 1.f}, { 0.0f, -1.0f, 0.0f}); // z-axis leftwards // roll hand: thumb points to the right - compare(16, { 0.0f, 0.0f, -90.0f}, {1.0f, 0.f, 0.f}, { 1.0f, 0.0f, 0.0f}); // x-axis constant - compare(17, { 0.0f, 0.0f, -90.0f}, {0.0f, 1.f, 0.f}, { 0.0f, 0.0f, -1.0f}); // y-axis downwards - compare(18, { 0.0f, 0.0f, -90.0f}, {0.0f, 0.f, 1.f}, { 0.0f, 1.0f, 0.0f}); // z-axis rightwards + compare(13, { 0.0f, 0.0f, 90.0f}, {1.0f, 0.f, 0.f}, { 1.0f, 0.0f, 0.0f}, roll_positive_90); // x-axis constant + compare(14, { 0.0f, 0.0f, 90.0f}, {0.0f, 1.f, 0.f}, { 0.0f, 0.0f, -1.0f}, roll_positive_90); // y-axis downwards + compare(15, { 0.0f, 0.0f, 90.0f}, {0.0f, 0.f, 1.f}, { 0.0f, 1.0f, 0.0f}, roll_positive_90); // z-axis rightwards + // roll hand: thumb points to the left + compare(16, { 0.0f, 0.0f, -90.0f}, {1.0f, 0.f, 0.f}, { 1.0f, 0.0f, 0.0f}, roll_negative_90); // x-axis constant + compare(17, { 0.0f, 0.0f, -90.0f}, {0.0f, 1.f, 0.f}, { 0.0f, 0.0f, 1.0f}, roll_negative_90); // y-axis upwards + compare(18, { 0.0f, 0.0f, -90.0f}, {0.0f, 0.f, 1.f}, { 0.0f, -1.0f, 0.0f}, roll_negative_90); // z-axis leftwards } TEST(geom, single_point_translation_and_rotation) { @@ -274,9 +331,9 @@ TEST(geom, single_point_translation_and_rotation) { Location point (0.0, 0.0, 2.0); transform.TransformPoint(point); - Location result_point(2.0, 0.0, -1.0); //!!! This line was wrong in CARLA version <= 0.9.16 due to invalid pitch AND roll rotations, (most relevant) yaw rotations were not affected + Location result_point(-2.0, 0.0, -1.0); - ASSERT_NEAR(point.x, result_point.x, error) << point.x << " " << point.y << " " << point.z; + ASSERT_NEAR(point.x, result_point.x, error); ASSERT_NEAR(point.y, result_point.y, error); ASSERT_NEAR(point.z, result_point.z, error); } @@ -360,7 +417,7 @@ TEST(geom, forward_vector) { compare({360.0f, 360.0f, 0.0f}, {1.0f, 0.0f, 0.0f}); compare({ 0.0f, 90.0f, 0.0f}, {0.0f, 1.0f, 0.0f}); compare({ 0.0f, -90.0f, 0.0f}, {0.0f,-1.0f, 0.0f}); - compare({ 90.0f, 0.0f, 0.0f}, {0.0f, 0.0f, -1.0f}); //!!! This line was wrong in CARLA version <= 0.9.16 due to invalid pitch AND roll rotations, (most relevant) yaw rotations were not affected + compare({ 90.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f}); compare({180.0f, -90.0f, 0.0f}, {0.0f, 1.0f, 0.0f}); } diff --git a/PythonAPI/carla/source/libcarla/Geom.cpp b/PythonAPI/carla/source/libcarla/Geom.cpp index 2c4749ebe3c..444d750e280 100644 --- a/PythonAPI/carla/source/libcarla/Geom.cpp +++ b/PythonAPI/carla/source/libcarla/Geom.cpp @@ -27,7 +27,6 @@ static void TransformList(const carla::geom::Transform &self, boost::python::lis } } -#if ALLOW_UNSAFE_GEOM_MATRIX_ACCESS static boost::python::list BuildMatrix(const std::array &m) { boost::python::list r_out; boost::python::list r[4]; @@ -43,7 +42,6 @@ static auto GetTransformMatrix(const carla::geom::Transform &self) { static auto GetInverseTransformMatrix(const carla::geom::Transform &self) { return BuildMatrix(self.InverseTransformationMatrix()); } -#endif static auto Cross(const carla::geom::Vector3D &self, const carla::geom::Vector3D &other) { return carla::geom::Math::Cross(self, other); @@ -221,10 +219,8 @@ void export_geom() { .def("length", &cg::Quaternion::Length) .def("squared_length", &cg::Quaternion::SquaredLength) .def("unit_quaternion", &cg::Quaternion::UnitQuaternion) -#if ALLOW_UNSAFE_GEOM_MATRIX_ACCESS .def("rotation_matrix", &cg::Quaternion::RotationMatrix) .def("inverse_rotation_matrix", &cg::Quaternion::InverseRotationMatrix) -#endif .def("rotated_quaternion", &cg::Quaternion::RotatedQuaternion, (arg("quaternion"))) .def("yaw_rad", &cg::Quaternion::YawRad) .def("yaw_degree", &cg::Quaternion::YawDegree) @@ -257,10 +253,8 @@ void export_geom() { .def("get_forward_vector", &cg::Transform::GetForwardVector) .def("get_right_vector", &cg::Transform::GetRightVector) .def("get_up_vector", &cg::Transform::GetUpVector) -#if ALLOW_UNSAFE_GEOM_MATRIX_ACCESS .def("get_matrix", &GetTransformMatrix) .def("get_inverse_matrix", &GetInverseTransformMatrix) -#endif .def("__eq__", &cg::Transform::operator==) .def("__ne__", &cg::Transform::operator!=) .def(self_ns::str(self_ns::self)) diff --git a/PythonAPI/test/unit/test_transform.py b/PythonAPI/test/unit/test_transform.py index 02c3519c194..f811e852c52 100644 --- a/PythonAPI/test/unit/test_transform.py +++ b/PythonAPI/test/unit/test_transform.py @@ -149,8 +149,7 @@ def test_rotation_and_translation(self): point = carla.Location(x=0.0, y=0.0, z=2.0) t.transform(point) - #!!! This solution_list was wrong in CARLA version <= 0.9.16 due to invalid pitch AND roll rotations, (most relevant) yaw rotations were not affected - self.assertTrue(abs(point.x - (2.0)) <= error) + self.assertTrue(abs(point.x - (-2.0)) <= error) self.assertTrue(abs(point.y - 0.0) <= error) self.assertTrue(abs(point.z - (-1.0)) <= error) @@ -166,10 +165,9 @@ def test_list_rotation_and_translation_location(self): ] t.transform(point_list) - #!!! This solution_list was wrong in CARLA version <= 0.9.16 due to invalid pitch AND roll rotations, (most relevant) yaw rotations were not affected - solution_list = [carla.Location(2.0, 0.0, -1.0), - carla.Location(1.0, 10.0, -1.0), - carla.Location(2.0, 18.0, -1.0) + solution_list = [carla.Location(-2.0, 0.0, -1.0), + carla.Location(-1.0, 10.0, -1.0), + carla.Location(-2.0, 18.0, -1.0) ] for i in range(len(point_list)): @@ -189,10 +187,9 @@ def test_list_rotation_and_translation_vector3d(self): ] t.transform(point_list) - #!!! This solution_list was wrong in CARLA version <= 0.9.15 due to invalid pitch AND roll rotations, (most relevant) yaw rotations were not affected - solution_list = [carla.Vector3D(2.0, 0.0, -1.0), - carla.Vector3D(1.0, 10.0, -1.0), - carla.Vector3D(2.0, 18.0, -1.0) + solution_list = [carla.Vector3D(-2.0, 0.0, -1.0), + carla.Vector3D(-1.0, 10.0, -1.0), + carla.Vector3D(-2.0, 18.0, -1.0) ] for i in range(len(point_list)): From 1aa318560fa17fc256087e634326a388d6e36821 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 17 Feb 2026 14:36:49 +0100 Subject: [PATCH 22/39] Revert ROS2 Quaternion In the previous commit on fixing the Fix Quaternion <-> Rotator conversion within CARLA, on the ROS2 branch one intermediate file slipped in introducing wrong roll conversions. Reverting to the previous state. --- LibCarla/source/carla/ros2/types/Quaternion.h | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/LibCarla/source/carla/ros2/types/Quaternion.h b/LibCarla/source/carla/ros2/types/Quaternion.h index c5f56d7e9f5..432e16ca2f9 100644 --- a/LibCarla/source/carla/ros2/types/Quaternion.h +++ b/LibCarla/source/carla/ros2/types/Quaternion.h @@ -15,12 +15,8 @@ namespace types { /** Convert a carla rotation to a ROS quaternion - Considers the conversion from left-handed system (unreal) with axis x-forward, y-rightwards, z-up - to right-handed system (ROS) with axis x-forward, y-leftwards, z-up. - If you were moving to a pure LH system where the Y-axis also pointed Left, you would negate everything. - But Unreal flipped the axis direction (Left to Right) and flipped the handedness (RH to LH), - those two flips "cancel out" for the X and Y rotations. - Therefore, only the z component of the quaternion is negated! + Considers the conversion from left-handed system (unreal) to right-handed + system (ROS). */ class Quaternion { public: @@ -28,10 +24,11 @@ class Quaternion { * carla_rotation: the carla Rotation */ explicit Quaternion(const geom::Quaternion& carla_quaternion) { - // negate z component to convert from Unreal left-handed system to ROS right-handed system - _ros_quaternion.x(carla_quaternion.x); - _ros_quaternion.y(carla_quaternion.y); - _ros_quaternion.z(-carla_quaternion.z); + // left-handed to right-handed -> negate the rotation by negating all axis components + // switch y-axis from right to left -> negate y-axis + _ros_quaternion.x(-carla_quaternion.x); // -(forward = forward) + _ros_quaternion.y(carla_quaternion.y); // -( right = -left ) + _ros_quaternion.z(-carla_quaternion.z); // -( up = up ) _ros_quaternion.w(carla_quaternion.w); } /** @@ -54,10 +51,11 @@ class Quaternion { geom::Quaternion GetQuaternion() const { geom::Quaternion carla_quaternion; - // negate z component to convert from Unreal left-handed system to ROS right-handed system - carla_quaternion.x = float(_ros_quaternion.x()); - carla_quaternion.y = float(_ros_quaternion.y()); - carla_quaternion.z = float(-_ros_quaternion.z()); + // left-handed to right-handed -> negate the rotation by negating all axis components + // switch y-axis from right to left -> negate y-axis + carla_quaternion.x = float(-_ros_quaternion.x()); // -(forward = forward) + carla_quaternion.y = float(_ros_quaternion.y()); // -( right = -left ) + carla_quaternion.z = float(-_ros_quaternion.z()); // -( up = up ) carla_quaternion.w = float(_ros_quaternion.w()); return carla_quaternion; } From 075c4f95b4d21d77efbf2e2b3af390de4fad0fb6 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 18 Feb 2026 20:11:23 +0100 Subject: [PATCH 23/39] Publish sensor transforms to /tf_static Since in most cases sensor relative transforms are static, these are published to the /tf_static topic to reduce the load on /tf topic. --- .../ros2/publishers/PublisherBaseTransform.h | 14 +++-- .../ros2/publishers/TransformPublisher.cpp | 60 +++++++++++++++---- .../ros2/publishers/TransformPublisher.h | 11 +++- .../ros2/publishers/UePublisherBaseSensor.h | 7 ++- .../ros2/publishers/VehiclePublisher.cpp | 2 +- .../carla/ros2/publishers/WalkerPublisher.cpp | 2 +- 6 files changed, 75 insertions(+), 21 deletions(-) diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h b/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h index 14104e0a775..2014a1d0adf 100644 --- a/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h +++ b/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h @@ -24,9 +24,14 @@ class PublisherBaseTransform : public PublisherBaseSensor { using CoordinateSystemTransform = carla::ros2::types::CoordinateSystemTransform; PublisherBaseTransform(std::shared_ptr actor_name_definition, - std::shared_ptr transform_publisher) - : PublisherBaseSensor(actor_name_definition), _transform_publisher(transform_publisher) {} - virtual ~PublisherBaseTransform() = default; + std::shared_ptr transform_publisher, + TransformPublisher::TransformPublisherMode const mode) + : PublisherBaseSensor(actor_name_definition), _transform_publisher(transform_publisher), _mode(mode) {} + + virtual ~PublisherBaseTransform() { + // remove the transform from the TF tree when the publisher is destroyed + _transform_publisher->RemoveTransform(frame_id()); + } /** * Update the internal transform state with the new transform. @@ -43,7 +48,7 @@ class PublisherBaseTransform : public PublisherBaseSensor { void UpdateTransform(ros2::types::Timestamp const &ros_timestamp, ros2::types::Transform const &ros_transform) { _timestamp = ros_timestamp; _transform = ros_transform; - _transform_publisher->AddTransform(_timestamp.time(), frame_id(), parent_frame_id(), _transform.transform()); + _transform_publisher->AddTransform(_timestamp.time(), frame_id(), parent_frame_id(), _transform.transform(), _mode); } /** @@ -71,6 +76,7 @@ class PublisherBaseTransform : public PublisherBaseSensor { carla::ros2::types::Timestamp _timestamp; carla::ros2::types::Transform _transform; std::shared_ptr _transform_publisher; + TransformPublisher::TransformPublisherMode _mode; }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp index 9020d32ba7e..6a376da11e4 100644 --- a/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp @@ -14,38 +14,76 @@ namespace ros2 { TransformPublisher::TransformPublisher() : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("tf")), - _impl(std::make_shared()) {} + _impl_tf(std::make_shared()), + _impl_tf_static(std::make_shared()) {} bool TransformPublisher::Init(std::shared_ptr domain_participant) { - return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, "rt/tf", get_topic_qos()); + return _impl_tf->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, "rt/tf", get_topic_qos()) + && _impl_tf_static->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, "rt/tf_static", get_topic_qos()); } bool TransformPublisher::Publish() { - auto const success = _impl->Publish(); - // after every frame clear the tf tree - _impl->Message().transforms().clear(); + auto success = _impl_tf->Publish(); + success &= _impl_tf_static->Publish(); + // after every frame clear the dynamic tf tree + _impl_tf->Message().transforms().clear(); return success; } + bool TransformPublisher::SubscribersConnected() const { - return _impl->SubscribersConnected(); + return _impl_tf->SubscribersConnected() || _impl_tf_static->SubscribersConnected(); } void TransformPublisher::AddTransform(const builtin_interfaces::msg::Time &stamp, const std::string &name, const std::string &parent, - geometry_msgs::msg::Transform const &transform) { + geometry_msgs::msg::Transform const &transform, TransformPublisher::TransformPublisherMode const mode) { geometry_msgs::msg::TransformStamped ts; ts.header().frame_id(parent); if ( name == parent ) { - // the child frame cannot be its own parent in ROS TF, so replace it with "carla" - ts.child_frame_id("carla"); + // the child frame cannot be its own parent in ROS TF, so just ignore + return; } else { ts.child_frame_id(name); } ts.header().stamp(stamp); ts.transform(transform); - _impl->Message().transforms().push_back(ts); - _impl->SetMessageUpdated(); + + if ( mode == TransformPublisherMode::MODE_STATIC ) { + bool found = false; + for (auto & t : _impl_tf_static->Message().transforms()) { + if (t.child_frame_id() == ts.child_frame_id()) { + // the child frame already exists in the static tf tree, so republish it only if necessary + // either the transform or the parent frame has changed + if (t.transform() != ts.transform() || t.header().frame_id() != ts.header().frame_id()) { + t = ts; + _impl_tf_static->SetMessageUpdated(); + } + found = true; + break; + } + } + if ( !found ) { + _impl_tf_static->Message().transforms().push_back(ts); + _impl_tf_static->SetMessageUpdated(); + } + } + else { + _impl_tf->Message().transforms().push_back(ts); + _impl_tf->SetMessageUpdated(); + } +} + +void TransformPublisher::RemoveTransform(const std::string &name) { + // remove the transform from the static tf tree if it exists there + for (auto it = _impl_tf_static->Message().transforms().begin(); it != _impl_tf_static->Message().transforms().end(); ++it) { + if (it->child_frame_id() == name) { + _impl_tf_static->Message().transforms().erase(it); + _impl_tf_static->SetMessageUpdated(); + return; + } + } } + } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/TransformPublisher.h b/LibCarla/source/carla/ros2/publishers/TransformPublisher.h index 76042a00165..5fe0f0cb504 100644 --- a/LibCarla/source/carla/ros2/publishers/TransformPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/TransformPublisher.h @@ -32,11 +32,18 @@ class TransformPublisher : public PublisherBase { */ bool SubscribersConnected() const override; + enum class TransformPublisherMode { + MODE_STATIC = 0, + MODE_DYNAMIC = 1 + }; + void AddTransform(const builtin_interfaces::msg::Time &stamp, const std::string &name, const std::string &parent, - geometry_msgs::msg::Transform const &transform); + geometry_msgs::msg::Transform const &transform, TransformPublisherMode const mode); + void RemoveTransform(const std::string &name); private: - std::shared_ptr _impl; + std::shared_ptr _impl_tf; + std::shared_ptr _impl_tf_static; }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h b/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h index affd975d63c..e7581e9e384 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h @@ -13,12 +13,15 @@ namespace ros2 { /** A Publisher base class for sensors receiving their data directly from UE4 via buffers. Extends PublisherBaseTransform by UpdateSensorData() function. - */ + Usually sensors are not moving in respect to their parent in the TF tree, so the transform is published as static and only updated if the sensor's position relatively to the parent changes. + */ class UePublisherBaseSensor : public PublisherBaseTransform { public: UePublisherBaseSensor(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) - : PublisherBaseTransform(sensor_actor_definition, transform_publisher) {} + : PublisherBaseTransform(sensor_actor_definition, transform_publisher, + TransformPublisher::TransformPublisherMode::MODE_STATIC) {} + virtual ~UePublisherBaseSensor() = default; /** diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp index fe376a95abf..5cf391dea6f 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -18,7 +18,7 @@ VehiclePublisher::VehiclePublisher(std::shared_ptr objects_with_covariance_publisher, carla::rpc::RpcServerInterface &carla_server) : PublisherBaseTransform(std::static_pointer_cast(vehicle_actor_definition), - transform_publisher), + transform_publisher, TransformPublisher::TransformPublisherMode::MODE_DYNAMIC), _carla_server(carla_server), _vehicle_info_publisher(std::make_shared()), _vehicle_status_publisher(std::make_shared()), diff --git a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp index 0371b607aac..2773cf3caaf 100644 --- a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp @@ -16,7 +16,7 @@ WalkerPublisher::WalkerPublisher(std::shared_ptr objects_publisher, std::shared_ptr objects_with_covariance_publisher) : PublisherBaseTransform(std::static_pointer_cast(walker_actor_definition), - transform_publisher), + transform_publisher, TransformPublisher::TransformPublisherMode::MODE_DYNAMIC), _walker_odometry_publisher(std::make_shared()), _walker_object_publisher(std::make_shared(*this, objects_publisher)), _walker_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)) {} From 4f1dbb0d8c6f9c991db467059b798693841e5142 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 18 Feb 2026 20:09:11 +0100 Subject: [PATCH 24/39] Make LoadMapService asynchonous This enables the service call to wait with the (success) response until the new episode was actually started which finally allows callers to postpone further actions until the game is running as expected. --- LibCarla/source/carla/ros2/ROS2.cpp | 18 ++-- LibCarla/source/carla/ros2/ROS2.h | 3 +- .../fastdds/carla/ros2/impl/DdsServiceImpl.h | 87 +++++++++++++------ .../ros2/services/DestroyObjectService.cpp | 2 +- .../ros2/services/GetAvailableMapsService.cpp | 2 +- .../ros2/services/GetBlueprintsService.cpp | 2 +- .../carla/ros2/services/LoadMapService.cpp | 75 ++++++++++------ .../carla/ros2/services/LoadMapService.h | 9 +- .../services/SetEpisodeSettingsService.cpp | 2 +- .../ros2/services/SpawnObjectService.cpp | 2 +- 10 files changed, 135 insertions(+), 67 deletions(-) diff --git a/LibCarla/source/carla/ros2/ROS2.cpp b/LibCarla/source/carla/ros2/ROS2.cpp index 2bb9d9a56f3..0a0908479f8 100644 --- a/LibCarla/source/carla/ros2/ROS2.cpp +++ b/LibCarla/source/carla/ros2/ROS2.cpp @@ -57,6 +57,12 @@ void ROS2::Enable(carla::rpc::RpcServerInterface *carla_server, carla::ros2::types::PublisherSensorType::WorldObserver, world_observer_stream_id); log_info("ROS2 enabled"); + + // initialize the load map service immediately since that + // has to stay alive during a map reload to send the response back to the client + _load_map_service = std::make_shared( + *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("load_map")); + _load_map_service->Init(_domain_participant_impl); } void ROS2::NotifyInitGame() { @@ -72,7 +78,7 @@ void ROS2::NotifyInitGame() { "]: Publisher initialized"); } - ProcessDataFromUeSensorPreAction(); + ProcessDataFromUeSensorPreAction(); } void ROS2::NotifyBeginEpisode() { @@ -98,15 +104,14 @@ void ROS2::NotifyBeginEpisode() { get_available_maps_service->Init(_domain_participant_impl); _services.push_back(get_available_maps_service); - auto load_map_service = std::make_shared( - *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("load_map")); - load_map_service->Init(_domain_participant_impl); - _services.push_back(load_map_service); - auto set_epsisode_settings_service = std::make_shared( *_carla_server, carla::ros2::types::ActorNameDefinition::CreateFromRoleName("set_episode_settings")); set_epsisode_settings_service->Init(_domain_participant_impl); _services.push_back(set_epsisode_settings_service); + + // inform load map service about new episode to trigger pending map change if there is any + _load_map_service->NotifyBeginEpisode(); + _services.push_back(_load_map_service); } void ROS2::NotifyEndEpisode() { @@ -125,6 +130,7 @@ void ROS2::NotifyEndGame() { void ROS2::Disable() { NotifyEndEpisode(); NotifyEndGame(); + _load_map_service.reset(); _world_observer_sensor_actor_definition.reset(); _domain_participant_impl.reset(); _name_registry.reset(); diff --git a/LibCarla/source/carla/ros2/ROS2.h b/LibCarla/source/carla/ros2/ROS2.h index 3489ee1582c..1feaf37f68c 100644 --- a/LibCarla/source/carla/ros2/ROS2.h +++ b/LibCarla/source/carla/ros2/ROS2.h @@ -30,7 +30,7 @@ class TransformPublisher; class CarlaActorListPublisher; class UeWorldPublisher; class ServiceInterface; - +class LoadMapService; class ROS2 { public: @@ -111,6 +111,7 @@ class ROS2 { std::shared_ptr _world_publisher; std::list> _services; + std::shared_ptr _load_map_service; // sigleton ROS2(){}; diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h index c675cfae23d..70c853c6b99 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h @@ -142,19 +142,24 @@ class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::D return true; } - using ServiceCallbackType = std::function; - void SetServiceCallback(ServiceCallbackType callback) { - _callback = callback; + using SyncServiceCallbackType = std::function; + void SetSyncServiceCallback(SyncServiceCallbackType callback) { + _sync_callback = callback; + } + + using RequestPtrType = std::shared_ptr; + using AsyncServiceCallbackType = std::function; + void SetAsyncServiceCallback(AsyncServiceCallbackType callback) { + _async_callback = callback; } void on_data_available(eprosima::fastdds::dds::DataReader* reader) override { - eprosima::fastdds::dds::SampleInfo info; - REQUEST_TYPE request; - auto rcode = reader->take_next_sample(&request, &info); + auto incoming_request = std::make_shared(); + auto rcode = reader->take_next_sample(&incoming_request->request, &incoming_request->info); if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { - if (eprosima::fastdds::dds::InstanceStateKind::ALIVE_INSTANCE_STATE == info.instance_state) { + if (eprosima::fastdds::dds::InstanceStateKind::ALIVE_INSTANCE_STATE == incoming_request->info.instance_state) { carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::on_data_available(): Incoming request "); - _incoming_requests.push_back({request, info.sample_identity}); + _incoming_requests.push_back(incoming_request); } else { carla::log_error("DdsServiceImpl[", _request_topic->get_name(), "]::on_data_available(): Error not a request instance"); @@ -166,31 +171,54 @@ class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::D } void CheckRequest() override { - if (!_callback) { - carla::log_warning("DdsServiceImpl[", _request_topic->get_name(), "]::CheckRequest(): No callback defined yet"); - return; - } while (!_incoming_requests.empty()) { carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::CheckRequest(): New Request"); auto const incoming_request = _incoming_requests.front(); - RESPONSE_TYPE response = _callback(incoming_request._request); - carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), "]::CheckRequest(): Callback returned"); - - eprosima::fastrtps::rtps::WriteParams write_params; - write_params.related_sample_identity() = incoming_request._request_identity; - auto rcode = _datawriter->write(reinterpret_cast(&response), write_params); - if (rcode != bool(eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK)) { - // strange: getting error while the result is actually sent out - carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), - "]::CheckRequest() Failed to write data; Error ", std::to_string(rcode)); + if ( _sync_callback) { + carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::CheckRequest(): Calling sync callback"); + auto response = _sync_callback(incoming_request->request); + carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::CheckRequest(): Sync callback returned"); + SendResponseInternal(response, incoming_request->info.sample_identity); + } else if (_async_callback) { + carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::CheckRequest(): Calling async callback"); + _pending_async_requests.push_back(incoming_request); + auto request_ptr = std::shared_ptr(incoming_request, &incoming_request->request); + _async_callback(request_ptr); + } else { + carla::log_warning("DdsServiceImpl[", _request_topic->get_name(), + "]::CheckRequest(): No sync or async callback defined yet"); } - carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), "]::CheckRequest() Response sent"); - _incoming_requests.pop_front(); } } + void SendResponse(RequestPtrType request_ptr, RESPONSE_TYPE response) { + carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::SendResponse(): Sending async response"); + auto it = std::find_if(_pending_async_requests.begin(), _pending_async_requests.end(), + [request_ptr](std::shared_ptr const& pending_request) { + return &pending_request->request == request_ptr.get(); + }); + if (it != _pending_async_requests.end()) { + SendResponseInternal(response, it->get()->info.sample_identity); + _pending_async_requests.erase(it); + } else { + carla::log_error("DdsServiceImpl[", _request_topic->get_name(), + "]::SendResponse(): Could not find matching pending request for async response"); + } + } private: + void SendResponseInternal(RESPONSE_TYPE& response, const eprosima::fastrtps::rtps::SampleIdentity& related_request_identity) { + eprosima::fastrtps::rtps::WriteParams write_params; + write_params.related_sample_identity() = related_request_identity; + auto rcode = _datawriter->write(reinterpret_cast(&response), write_params); + if (rcode != bool(eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK)) { + // strange: getting error while the result is actually sent out + carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), + "]::SendResponse() Failed to write data; Error ", std::to_string(rcode)); + } + carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), "]::SendResponse() Response sent"); + } + eprosima::fastdds::dds::DomainParticipant* _participant{nullptr}; eprosima::fastdds::dds::TypeSupport _request_type{new REQUEST_PUB_TYPE()}; @@ -203,13 +231,16 @@ class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::D eprosima::fastdds::dds::Publisher* _publisher{nullptr}; eprosima::fastdds::dds::DataWriter* _datawriter{nullptr}; - ServiceCallbackType _callback{nullptr}; + SyncServiceCallbackType _sync_callback{nullptr}; + AsyncServiceCallbackType _async_callback{nullptr}; struct IncomingRequest { - REQUEST_TYPE _request{}; - eprosima::fastrtps::rtps::SampleIdentity _request_identity; + REQUEST_TYPE request{}; + eprosima::fastdds::dds::SampleInfo info; }; - std::deque _incoming_requests; + std::deque> _incoming_requests; + + std::list> _pending_async_requests; }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/services/DestroyObjectService.cpp b/LibCarla/source/carla/ros2/services/DestroyObjectService.cpp index d6940305462..840328ef6ed 100644 --- a/LibCarla/source/carla/ros2/services/DestroyObjectService.cpp +++ b/LibCarla/source/carla/ros2/services/DestroyObjectService.cpp @@ -15,7 +15,7 @@ DestroyObjectService::DestroyObjectService( : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} bool DestroyObjectService::Init(std::shared_ptr domain_participant) { - _impl->SetServiceCallback(std::bind(&DestroyObjectService::DestroyObject, this, std::placeholders::_1)); + _impl->SetSyncServiceCallback(std::bind(&DestroyObjectService::DestroyObject, this, std::placeholders::_1)); return _impl->Init(domain_participant, get_topic_name()); } diff --git a/LibCarla/source/carla/ros2/services/GetAvailableMapsService.cpp b/LibCarla/source/carla/ros2/services/GetAvailableMapsService.cpp index 5f410a0bab5..39a4e8224be 100644 --- a/LibCarla/source/carla/ros2/services/GetAvailableMapsService.cpp +++ b/LibCarla/source/carla/ros2/services/GetAvailableMapsService.cpp @@ -18,7 +18,7 @@ GetAvailableMapsService::GetAvailableMapsService( : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} bool GetAvailableMapsService::Init(std::shared_ptr domain_participant) { - _impl->SetServiceCallback(std::bind(&GetAvailableMapsService::GetAvailableMaps, this, std::placeholders::_1)); + _impl->SetSyncServiceCallback(std::bind(&GetAvailableMapsService::GetAvailableMaps, this, std::placeholders::_1)); return _impl->Init(domain_participant, get_topic_name()); } diff --git a/LibCarla/source/carla/ros2/services/GetBlueprintsService.cpp b/LibCarla/source/carla/ros2/services/GetBlueprintsService.cpp index 06e96f4749e..ba4ecf5630a 100644 --- a/LibCarla/source/carla/ros2/services/GetBlueprintsService.cpp +++ b/LibCarla/source/carla/ros2/services/GetBlueprintsService.cpp @@ -18,7 +18,7 @@ GetBlueprintsService::GetBlueprintsService( : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} bool GetBlueprintsService::Init(std::shared_ptr domain_participant) { - _impl->SetServiceCallback(std::bind(&GetBlueprintsService::GetBlueprints, this, std::placeholders::_1)); + _impl->SetSyncServiceCallback(std::bind(&GetBlueprintsService::GetBlueprints, this, std::placeholders::_1)); return _impl->Init(domain_participant, get_topic_name()); } diff --git a/LibCarla/source/carla/ros2/services/LoadMapService.cpp b/LibCarla/source/carla/ros2/services/LoadMapService.cpp index e5d99727ca2..dc3ba4a4bd7 100644 --- a/LibCarla/source/carla/ros2/services/LoadMapService.cpp +++ b/LibCarla/source/carla/ros2/services/LoadMapService.cpp @@ -19,7 +19,7 @@ LoadMapService::LoadMapService( } bool LoadMapService::Init(std::shared_ptr domain_participant) { - _impl->SetServiceCallback(std::bind(&LoadMapService::LoadMap, this, std::placeholders::_1)); + _impl->SetAsyncServiceCallback(std::bind(&LoadMapService::LoadMap, this, std::placeholders::_1)); return _impl->Init(domain_participant, get_topic_name()); } @@ -27,51 +27,74 @@ void LoadMapService::CheckRequest() { _impl->CheckRequest(); } -carla_msgs::srv::LoadMap_Response LoadMapService::LoadMap( - carla_msgs::srv::LoadMap_Request const &request) { - carla_msgs::srv::LoadMap_Response response; +void LoadMapService::LoadMap( + std::shared_ptr request) { - auto new_map_name = request.mapname(); + bool request_failed = false; + + auto new_map_name = request->mapname(); auto current_map_name = _carla_server.call_get_map_info().Get().name; std::string map_name_prefix = "Carla/Maps/"; - std::string map_name_without_prefix = request.mapname(); + std::string map_name_without_prefix = request->mapname(); if (map_name_without_prefix.find(map_name_prefix) == 0) { map_name_without_prefix.erase(0, map_name_prefix.length()); } std::string map_name_with_prefix = map_name_prefix + map_name_without_prefix; std::string error_reason; - if( request.force_reload() || + if( request->force_reload() || (!(map_name_without_prefix == current_map_name) && !(map_name_with_prefix == current_map_name))) { - auto call_response = _carla_server.call_load_new_episode(map_name_without_prefix, request.reset_episode_settings(), static_cast(request.map_layers())); + PendingMapChangeRequest pending_request{request, _episode_begin_count+1}; + _pending_map_change_requests.push_back(pending_request); + auto call_response = _carla_server.call_load_new_episode(map_name_without_prefix, request->reset_episode_settings(), static_cast(request->map_layers())); if ( call_response.HasError() ) { - response.success(false); + request_failed = true; + _pending_map_change_requests.pop_back(); error_reason = call_response.GetError().What(); } - else { - response.success(true); - } } else { - response.success(false); + request_failed = true; error_reason = "Map already loaded and no reload requested"; } - if (response.success()) { - log_info("ROS2:LoadMapService(", request.mapname(), + + if (request_failed) { + log_error("ROS2:LoadMapService(", request->mapname(), "): request to load new episode '", map_name_without_prefix, - "' with force: ", request.force_reload()?"True":"False", - ", reset_episode_settings: ", request.reset_episode_settings()?"True":"False", - " and map_layers: ", request.map_layers(), - " succeeded"); + "' with force: ", request->force_reload()?"True":"False", + ", reset_episode_settings: ", request->reset_episode_settings()?"True":"False", + " and map_layers: ", request->map_layers(), + " failed: ", error_reason); + carla_msgs::srv::LoadMap_Response response; + response.success(false); + _impl->SendResponse(request, response); } else { - log_error("ROS2:LoadMapService(", request.mapname(), - "): request to load new episode '", map_name_without_prefix, - "' with force: ", request.force_reload()?"True":"False", - ", reset_episode_settings: ", request.reset_episode_settings()?"True":"False", - " and map_layers: ", request.map_layers(), - " failed: ", error_reason); + /* waiting for new episode to begin */ + } +} + +void LoadMapService::NotifyBeginEpisode() { + _episode_begin_count++; + + /* process pending map change requests, if any */ + auto pending_request_it = _pending_map_change_requests.begin(); + while (pending_request_it != _pending_map_change_requests.end()) { + if (pending_request_it->required_episode_begin_count <= _episode_begin_count) { + auto request = pending_request_it->request; + log_info("ROS2:LoadMapService(", request->mapname(), + "' with force: ", request->force_reload()?"True":"False", + ", reset_episode_settings: ", request->reset_episode_settings()?"True":"False", + " and map_layers: ", request->map_layers(), + " succeeded"); + carla_msgs::srv::LoadMap_Response response; + response.success(true); + _impl->SendResponse(request, response); + pending_request_it = _pending_map_change_requests.erase(pending_request_it); + } + else { + ++pending_request_it; + } } - return response; } } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/services/LoadMapService.h b/LibCarla/source/carla/ros2/services/LoadMapService.h index 7a33014c6c3..84d93aa86e6 100644 --- a/LibCarla/source/carla/ros2/services/LoadMapService.h +++ b/LibCarla/source/carla/ros2/services/LoadMapService.h @@ -34,10 +34,17 @@ class LoadMapService */ bool Init(std::shared_ptr domain_participant) override; + void NotifyBeginEpisode(); private: - carla_msgs::srv::LoadMap_Response LoadMap(carla_msgs::srv::LoadMap_Request const &request); + void LoadMap(std::shared_ptr request); std::shared_ptr _impl; + struct PendingMapChangeRequest { + std::shared_ptr request; + uint64_t required_episode_begin_count; + }; + std::deque _pending_map_change_requests; + std::atomic _episode_begin_count{0}; }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp b/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp index 8c955e0fa88..bbecb9a3a99 100644 --- a/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp +++ b/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp @@ -16,7 +16,7 @@ SetEpisodeSettingsService::SetEpisodeSettingsService( : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} bool SetEpisodeSettingsService::Init(std::shared_ptr domain_participant) { - _impl->SetServiceCallback(std::bind(&SetEpisodeSettingsService::SetEpisodeSettings, this, std::placeholders::_1)); + _impl->SetSyncServiceCallback(std::bind(&SetEpisodeSettingsService::SetEpisodeSettings, this, std::placeholders::_1)); return _impl->Init(domain_participant, get_topic_name()); } diff --git a/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp b/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp index 6c3d598b646..28032208d80 100644 --- a/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp +++ b/LibCarla/source/carla/ros2/services/SpawnObjectService.cpp @@ -25,7 +25,7 @@ SpawnObjectService::SpawnObjectService(carla::rpc::RpcServerInterface &carla_ser : ServiceBase(carla_server, actor_name_definition), _impl(std::make_shared()) {} bool SpawnObjectService::Init(std::shared_ptr domain_participant) { - _impl->SetServiceCallback(std::bind(&SpawnObjectService::SpawnObject, this, std::placeholders::_1)); + _impl->SetSyncServiceCallback(std::bind(&SpawnObjectService::SpawnObject, this, std::placeholders::_1)); return _impl->Init(domain_participant, get_topic_name()); } From 25162f149a54eee149dc98deab06ebe8fb43a35d Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Fri, 20 Feb 2026 12:50:27 +0100 Subject: [PATCH 25/39] ROS2: environment objects identification Transport upper 32 bit of the environment object ID via Object.msg classification_age member to allow alignment with the CarlaActorList actor-id. --- LibCarla/source/carla/ros2/types/Object.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/LibCarla/source/carla/ros2/types/Object.h b/LibCarla/source/carla/ros2/types/Object.h index 72b681924b0..df6b7cd378c 100644 --- a/LibCarla/source/carla/ros2/types/Object.h +++ b/LibCarla/source/carla/ros2/types/Object.h @@ -99,7 +99,6 @@ class Object { : _actor_definition( std::static_pointer_cast(traffic_light_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; - _classification_age = std::numeric_limits::max(); carla::log_verbose("Creating Traffic Light Object[", _actor_definition->type_id, "] id: ", _actor_definition->id, " object_type: ", _actor_definition->object_type, " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); @@ -113,7 +112,6 @@ class Object { : _actor_definition( std::static_pointer_cast(traffic_sign_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; - _classification_age = std::numeric_limits::max(); carla::log_verbose("Creating Traffic Sign Object[", _actor_definition->type_id, "] id: ", _actor_definition->id, " object_type: ", _actor_definition->object_type, " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); @@ -121,7 +119,6 @@ class Object { explicit Object(carla::rpc::EnvironmentObject environment_object, bool enable_for_ros) : _actor_definition(std::make_shared(environment_object, enable_for_ros)) { - _classification_age = std::numeric_limits::max(); // derived object msgs are somewhat limited in terms of classification support // therefore also an actor list for environment objects will be published @@ -165,6 +162,12 @@ class Object { // and put in our object state update carla::sensor::data::ActorDynamicState actor_dynamic_state; actor_dynamic_state.id = actor_id(); + // environment objects have a 64 bit unreal id, but Object.msg only supports uint32, + // so we put the upper 32 bit of the actor id into the classification age, + // so that we can correlate the object in the object list with the 64-bit id in the CarlaActorInfo list for environment objects + _classification_age = static_cast((_actor_definition->id>>32) & 0xFFFFFFFF); + _actor_definition->attributes["Object.id"] = std::to_string(actor_id()); + _actor_definition->attributes["Object.classification_age"] = std::to_string(_classification_age); actor_dynamic_state.transform = environment_object.transform; actor_dynamic_state.quaternion = carla::geom::Quaternion(environment_object.transform.rotation); UpdateObject(carla::ros2::types::Timestamp(), actor_dynamic_state); @@ -189,16 +192,13 @@ class Object { carla::ros2::types::Speed(carla::geom::Velocity(actor_dynamic_state.velocity), actor_dynamic_state.quaternion), carla::ros2::types::AngularVelocity(carla::geom::AngularVelocity(actor_dynamic_state.angular_velocity)), timestamp); - if (_classification_age < std::numeric_limits::max()) { - ++_classification_age; - } } derived_object_msgs::msg::Object object() const { derived_object_msgs::msg::Object object; object.header().stamp(_accelerated_movement.Timestamp().time()); object.header().frame_id("map"); - object.id(_actor_definition->id); + object.id(actor_id()); object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); object.object_classified(true); object.pose(_transform.pose()); @@ -218,7 +218,7 @@ class Object { derived_object_msgs::msg::ObjectWithCovariance object; object.header().stamp(_accelerated_movement.Timestamp().time()); object.header().frame_id("map"); - object.id(_actor_definition->id); + object.id(actor_id()); object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); object.object_classified(true); object.pose(_transform.pose_with_covariance()); @@ -298,7 +298,8 @@ class Object { return _actor_definition->carla_actor_info(name_registry); } - carla::streaming::detail::actor_id_type actor_id() const { return _actor_definition->id; } + carla::streaming::detail::actor_id_type actor_id() const { + return static_cast(_actor_definition->id & 0xFFFFFFFF); } const carla::ros2::types::ActorDefinition& actor_definition()const { return *_actor_definition; } @@ -310,7 +311,7 @@ class Object { carla::geom::BoundingBox _bounding_box; carla::ros2::types::Transform _transform; carla::ros2::types::AcceleratedMovement _accelerated_movement; - uint32_t _classification_age{0u}; + uint32_t _classification_age{std::numeric_limits::max()}; }; } // namespace types } // namespace ros2 From 6c7abd89970a6fa073d1992ccaf61938f43cc8a6 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Thu, 26 Feb 2026 19:38:34 +0100 Subject: [PATCH 26/39] Improve DDS ROS2 settings Mainly configure writer and reader QoS and keep the topic and publisher QoS to their defaults. On KEEP_ALL_HISTORY_QOS adapt the DDS recource limits instead of the history.depth parameter to have an effect. Services use KEEP_LAST_HISTORY_QOS and volatile durability; the writer pushlishes in sync mode to ensure the service responses are passed immediately to the middleware and have precedence over sensor data. Some smaller fixes. --- .../carla/ros2/impl/DdsPublisherImpl.h | 13 ++++------- .../ros2/fastdds/carla/ros2/impl/DdsQoS.h | 18 ++------------- .../fastdds/carla/ros2/impl/DdsServiceImpl.h | 23 +++++++++++-------- .../carla/ros2/impl/DdsSubscriberImpl.h | 9 ++++---- .../carla/ros2/services/LoadMapService.cpp | 2 +- .../services/SetEpisodeSettingsService.cpp | 9 +++++--- 6 files changed, 31 insertions(+), 43 deletions(-) diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h index e3f18f33775..e33498e038e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsPublisherImpl.h @@ -53,25 +53,21 @@ class DdsPublisherImpl : public PublisherInterface, eprosima::fastdds::dds::Data */ bool InitHistoryPreallocatedWithReallocMemoryMode(std::shared_ptr domain_participant, std::string topic_name, ROS2QoS qos) { - auto pubqos = PublisherQos(qos); auto wqos = DataWriterQos(qos); - auto tqos = TopicQos(qos); wqos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - return InitInternal(domain_participant, topic_name, tqos, pubqos, wqos); + return InitInternal(domain_participant, topic_name, wqos); } bool Init(std::shared_ptr domain_participant, std::string topic_name, ROS2QoS qos) { - auto pubqos = PublisherQos(qos); auto wqos = DataWriterQos(qos); - auto tqos = TopicQos(qos); - return InitInternal(domain_participant, topic_name, tqos, pubqos, wqos); + return InitInternal(domain_participant, topic_name, wqos); } bool Publish() override { if (_message_updated) { carla::log_verbose("DdsPublisherImpl[", _topic->get_name(), "]::Publishing() updated message"); eprosima::fastrtps::rtps::InstanceHandle_t instance_handle; - auto rcode = _datawriter->write(&_message, instance_handle); + eprosima::fastrtps::types::ReturnCode_t rcode = _datawriter->write(&_message, instance_handle); if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { _message_updated = false; } else { @@ -124,7 +120,6 @@ class DdsPublisherImpl : public PublisherInterface, eprosima::fastdds::dds::Data private: bool InitInternal(std::shared_ptr domain_participant, std::string topic_name, - eprosima::fastdds::dds::TopicQos const& tqos, eprosima::fastdds::dds::PublisherQos const& pubqos, eprosima::fastdds::dds::DataWriterQos const& wqos) { carla::log_debug("DdsPublisherImpl[", topic_name, "]::Init()"); @@ -141,12 +136,14 @@ class DdsPublisherImpl : public PublisherInterface, eprosima::fastdds::dds::Data _type.register_type(_participant); + auto const pubqos = eprosima::fastdds::dds::PUBLISHER_QOS_DEFAULT; _publisher = _participant->create_publisher(pubqos); if (_publisher == nullptr) { carla::log_error("DdsPublisherImpl[", _type->getName(), "]::Init() Failed to create Publisher"); return false; } + auto const tqos = eprosima::fastdds::dds::TOPIC_QOS_DEFAULT; _topic = _participant->create_topic(topic_name, _type->getName(), tqos); if (_topic == nullptr) { carla::log_error("DdsPublisherImpl[", _type->getName(), "]::Init() Failed to create Topic for ", topic_name); diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h index 4d39c51089e..1bcbd92bee4 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h @@ -35,15 +35,12 @@ FAST_DDS_QOS_TYPE FastDdsQos(ROS2QoS const &qos) { fast_dds_qos.history().depth = qos._history_depth; } else if (qos._history == ROS2QoS::History::KEEP_ALL) { fast_dds_qos.history().kind = eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_ALL_HISTORY_QOS; - fast_dds_qos.history().depth = qos._history_depth; + fast_dds_qos.resource_limits().max_samples = 1000; // Or some high value + fast_dds_qos.resource_limits().allocated_samples = qos._history_depth; } return fast_dds_qos; } -inline eprosima::fastdds::dds::TopicQos TopicQos(ROS2QoS const &qos) { - return FastDdsQos(qos); -} - inline eprosima::fastdds::dds::DataWriterQos DataWriterQos(ROS2QoS const &qos) { return FastDdsQos(qos); } @@ -52,17 +49,6 @@ inline eprosima::fastdds::dds::DataReaderQos DataReaderQos(ROS2QoS const &qos) { return FastDdsQos(qos); } -inline eprosima::fastdds::dds::PublisherQos PublisherQos(ROS2QoS const &qos) { - (void)qos; - eprosima::fastdds::dds::PublisherQos pubqos = eprosima::fastdds::dds::PUBLISHER_QOS_DEFAULT; - return pubqos; -} - -inline eprosima::fastdds::dds::SubscriberQos SubscriberQos(ROS2QoS const &qos) { - (void)qos; - eprosima::fastdds::dds::SubscriberQos subqos = eprosima::fastdds::dds::SUBSCRIBER_QOS_DEFAULT; - return subqos; -} } // namespace ros2 } // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h index 70c853c6b99..4fb40850f01 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsServiceImpl.h @@ -82,8 +82,6 @@ class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::D } _request_type.register_type(_participant); auto topic_qos = eprosima::fastdds::dds::TOPIC_QOS_DEFAULT; - topic_qos.history().kind = eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS; - topic_qos.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; _request_topic = _participant->create_topic(request_name, _request_type->getName(), topic_qos); if (_request_topic == nullptr) { @@ -96,11 +94,14 @@ class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::D carla::log_error("DdsServiceImpl[", topic_name, "]::Init(): Failed to create Subscriber"); return false; } + eprosima::fastdds::dds::DataReaderListener* reader_listener = static_cast(this); auto datareader_qos = eprosima::fastdds::dds::DATAREADER_QOS_DEFAULT; - datareader_qos.history().kind = eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS; + datareader_qos.history().kind = eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS; + datareader_qos.history().depth = 50; datareader_qos.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; + datareader_qos.durability().kind = eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS; _datareader = _subscriber->create_datareader(_request_topic, datareader_qos, reader_listener); if (_datareader == nullptr) { @@ -130,9 +131,11 @@ class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::D auto writer_qos = eprosima::fastdds::dds::DATAWRITER_QOS_DEFAULT; writer_qos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - writer_qos.history().kind = eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS; - writer_qos.durability().kind = eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS; + writer_qos.history().kind = eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS; + writer_qos.history().depth = 10; + writer_qos.durability().kind = eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS; writer_qos.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; + writer_qos.publish_mode().kind = eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE; _datawriter = _publisher->create_datawriter(_response_topic, writer_qos); if (_datawriter == nullptr) { carla::log_error("DdsServiceImpl[", _response_topic->get_name(), "]::Init() Failed to create DataWriter"); @@ -155,7 +158,7 @@ class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::D void on_data_available(eprosima::fastdds::dds::DataReader* reader) override { auto incoming_request = std::make_shared(); - auto rcode = reader->take_next_sample(&incoming_request->request, &incoming_request->info); + eprosima::fastrtps::types::ReturnCode_t rcode = reader->take_next_sample(&incoming_request->request, &incoming_request->info); if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { if (eprosima::fastdds::dds::InstanceStateKind::ALIVE_INSTANCE_STATE == incoming_request->info.instance_state) { carla::log_debug("DdsServiceImpl[", _request_topic->get_name(), "]::on_data_available(): Incoming request "); @@ -209,12 +212,12 @@ class DdsServiceImpl : public ServiceInterface, public eprosima::fastdds::dds::D private: void SendResponseInternal(RESPONSE_TYPE& response, const eprosima::fastrtps::rtps::SampleIdentity& related_request_identity) { eprosima::fastrtps::rtps::WriteParams write_params; + write_params.related_sample_identity() = related_request_identity; - auto rcode = _datawriter->write(reinterpret_cast(&response), write_params); - if (rcode != bool(eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK)) { - // strange: getting error while the result is actually sent out + eprosima::fastrtps::types::ReturnCode_t rcode = _datawriter->write(&response, write_params); + if (rcode != eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), - "]::SendResponse() Failed to write data; Error ", std::to_string(rcode)); + "]::SendResponse() Failed to write data; Error ", std::to_string(rcode), " , ", related_request_identity.sequence_number()); } carla::log_debug("DdsServiceImpl[", _response_topic->get_name(), "]::SendResponse() Response sent"); } diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsSubscriberImpl.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsSubscriberImpl.h index 76585a492a6..f4a7fc1ace0 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsSubscriberImpl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsSubscriberImpl.h @@ -55,10 +55,8 @@ class DdsSubscriberImpl : public SubscriberImplBase, public eprosi } bool Init(std::shared_ptr domain_participant, std::string topic_name, ROS2QoS qos) { - auto subqos = SubscriberQos(qos); auto rqos = DataReaderQos(qos); - auto tqos = TopicQos(qos); - return InitInternal(domain_participant, topic_name, tqos, subqos, rqos); + return InitInternal(domain_participant, topic_name, rqos); } void on_subscription_matched(eprosima::fastdds::dds::DataReader* reader, @@ -93,7 +91,7 @@ class DdsSubscriberImpl : public SubscriberImplBase, public eprosi void on_data_available(eprosima::fastdds::dds::DataReader* reader) override { eprosima::fastdds::dds::SampleInfo info; MESSAGE_TYPE message; - auto rcode = reader->take_next_sample(&message, &info); + eprosima::fastrtps::types::ReturnCode_t rcode = reader->take_next_sample(&message, &info); auto const publisher_guid = GetPublisherGuid(info.publication_handle); if (rcode == eprosima::fastrtps::types::ReturnCode_t::ReturnCodeValue::RETCODE_OK) { AddMessage(publisher_guid, message); @@ -106,7 +104,6 @@ class DdsSubscriberImpl : public SubscriberImplBase, public eprosi } bool InitInternal(std::shared_ptr domain_participant, std::string topic_name, - eprosima::fastdds::dds::TopicQos const& tqos, eprosima::fastdds::dds::SubscriberQos const& subqos, eprosima::fastdds::dds::DataReaderQos const& rqos) { carla::log_debug("DdsSubscriberImpl[", topic_name, "]::Init()"); @@ -123,12 +120,14 @@ class DdsSubscriberImpl : public SubscriberImplBase, public eprosi _type.register_type(_participant); + auto const subqos = eprosima::fastdds::dds::SUBSCRIBER_QOS_DEFAULT; _subscriber = _participant->create_subscriber(subqos); if (_subscriber == nullptr) { carla::log_error("DdsSubscriberImpl[", topic_name, "]::Init(): Failed to create Subscriber"); return false; } + auto const tqos = eprosima::fastdds::dds::TOPIC_QOS_DEFAULT; _topic = _participant->create_topic(topic_name, _type->getName(), tqos); if (_topic == nullptr) { carla::log_error("DdsSubscriberImpl[", topic_name, "]::Init(): Failed to create Topic"); diff --git a/LibCarla/source/carla/ros2/services/LoadMapService.cpp b/LibCarla/source/carla/ros2/services/LoadMapService.cpp index dc3ba4a4bd7..2129d9a3d48 100644 --- a/LibCarla/source/carla/ros2/services/LoadMapService.cpp +++ b/LibCarla/source/carla/ros2/services/LoadMapService.cpp @@ -69,7 +69,7 @@ void LoadMapService::LoadMap( _impl->SendResponse(request, response); } else { - /* waiting for new episode to begin */ + /* waiting with the respose for new episode to begin */ } } diff --git a/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp b/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp index bbecb9a3a99..b9b7f6482bc 100644 --- a/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp +++ b/LibCarla/source/carla/ros2/services/SetEpisodeSettingsService.cpp @@ -30,11 +30,14 @@ carla_msgs::srv::SetEpisodeSettings_Response SetEpisodeSettingsService::SetEpiso carla_msgs::srv::SetEpisodeSettings_Response response; carla::ros2::types::EpisodeSettings episode_settings(request.episode_settings()); auto result = _carla_server.call_set_episode_settings(episode_settings.GetEpisodeSettings()); - if ( result > 0 ) { - response.success(true); + if ( result.HasError() ) { + log_error("ROS2:SetEpisodeSettings(): failed to apply episode settings: ", + result.GetError().What()); + response.success(false); } else { - response.success(false); + log_info("ROS2:SetEpisodeSettings(): applied episode settings successful"); + response.success(true); } return response; From 996709a5b5f7110cb3e4afbac62073532621d3b4 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Mon, 2 Mar 2026 10:08:06 +0100 Subject: [PATCH 27/39] Update to fastdds 2.14.6 using fastcdr 2.3 and fastddsgen 3.3.2 --- CHANGELOG.md | 1 + LibCarla/source/carla/ros2/fastdds/README.md | 20 +- .../ackermann_msgs/msg/AckermannDrive.cxx | 184 +- .../ackermann_msgs/msg/AckermannDrive.h | 399 +- .../msg/AckermannDriveCdrAux.hpp | 50 + .../msg/AckermannDriveCdrAux.ipp | 162 + .../msg/AckermannDrivePubSubTypes.cxx | 314 +- .../msg/AckermannDrivePubSubTypes.h | 106 +- .../msg/AckermannDriveStamped.cxx | 123 +- .../msg/AckermannDriveStamped.h | 309 +- .../msg/AckermannDriveStampedCdrAux.hpp | 52 + .../msg/AckermannDriveStampedCdrAux.ipp | 138 + .../msg/AckermannDriveStampedPubSubTypes.cxx | 314 +- .../msg/AckermannDriveStampedPubSubTypes.h | 105 +- .../fastdds/builtin_interfaces/msg/Time.cxx | 131 +- .../fastdds/builtin_interfaces/msg/Time.h | 279 +- .../builtin_interfaces/msg/TimeCdrAux.hpp | 50 + .../builtin_interfaces/msg/TimeCdrAux.ipp | 138 + .../msg/TimePubSubTypes.cxx | 314 +- .../builtin_interfaces/msg/TimePubSubTypes.h | 106 +- .../carla_msgs/msg/CarlaActorBlueprint.cxx | 169 +- .../carla_msgs/msg/CarlaActorBlueprint.h | 394 +- .../msg/CarlaActorBlueprintCdrAux.hpp | 52 + .../msg/CarlaActorBlueprintCdrAux.ipp | 148 + .../msg/CarlaActorBlueprintPubSubTypes.cxx | 316 +- .../msg/CarlaActorBlueprintPubSubTypes.h | 141 +- .../fastdds/carla_msgs/msg/CarlaActorInfo.cxx | 306 +- .../fastdds/carla_msgs/msg/CarlaActorInfo.h | 841 +-- .../carla_msgs/msg/CarlaActorInfoCdrAux.hpp | 114 + .../carla_msgs/msg/CarlaActorInfoCdrAux.ipp | 273 + .../msg/CarlaActorInfoPubSubTypes.cxx | 324 +- .../msg/CarlaActorInfoPubSubTypes.h | 171 +- .../fastdds/carla_msgs/msg/CarlaActorList.cxx | 115 +- .../fastdds/carla_msgs/msg/CarlaActorList.h | 286 +- .../carla_msgs/msg/CarlaActorListCdrAux.hpp | 54 + .../carla_msgs/msg/CarlaActorListCdrAux.ipp | 132 + .../msg/CarlaActorListPubSubTypes.cxx | 316 +- .../msg/CarlaActorListPubSubTypes.h | 141 +- .../carla_msgs/msg/CarlaBoundingBox.cxx | 123 +- .../fastdds/carla_msgs/msg/CarlaBoundingBox.h | 338 +- .../carla_msgs/msg/CarlaBoundingBoxCdrAux.hpp | 50 + .../carla_msgs/msg/CarlaBoundingBoxCdrAux.ipp | 138 + .../msg/CarlaBoundingBoxPubSubTypes.cxx | 314 +- .../msg/CarlaBoundingBoxPubSubTypes.h | 139 +- .../carla_msgs/msg/CarlaCollisionEvent.cxx | 142 +- .../carla_msgs/msg/CarlaCollisionEvent.h | 381 +- .../msg/CarlaCollisionEventCdrAux.hpp | 51 + .../msg/CarlaCollisionEventCdrAux.ipp | 146 + .../msg/CarlaCollisionEventPubSubTypes.cxx | 314 +- .../msg/CarlaCollisionEventPubSubTypes.h | 140 +- .../fastdds/carla_msgs/msg/CarlaControl.cxx | 108 +- .../fastdds/carla_msgs/msg/CarlaControl.h | 281 +- .../carla_msgs/msg/CarlaControlCdrAux.hpp | 57 + .../carla_msgs/msg/CarlaControlCdrAux.ipp | 137 + .../msg/CarlaControlPubSubTypes.cxx | 330 +- .../carla_msgs/msg/CarlaControlPubSubTypes.h | 148 +- .../carla_msgs/msg/CarlaEgoVehicleControl.cxx | 259 +- .../carla_msgs/msg/CarlaEgoVehicleControl.h | 612 +- .../msg/CarlaEgoVehicleControlCdrAux.hpp | 50 + .../msg/CarlaEgoVehicleControlCdrAux.ipp | 194 + .../msg/CarlaEgoVehicleControlPubSubTypes.cxx | 314 +- .../msg/CarlaEgoVehicleControlPubSubTypes.h | 139 +- .../carla_msgs/msg/CarlaEgoVehicleInfo.cxx | 388 +- .../carla_msgs/msg/CarlaEgoVehicleInfo.h | 897 ++- .../msg/CarlaEgoVehicleInfoCdrAux.hpp | 50 + .../msg/CarlaEgoVehicleInfoCdrAux.ipp | 242 + .../msg/CarlaEgoVehicleInfoPubSubTypes.cxx | 314 +- .../msg/CarlaEgoVehicleInfoPubSubTypes.h | 139 +- .../msg/CarlaEgoVehicleInfoWheel.cxx | 219 +- .../carla_msgs/msg/CarlaEgoVehicleInfoWheel.h | 530 +- .../msg/CarlaEgoVehicleInfoWheelCdrAux.hpp | 50 + .../msg/CarlaEgoVehicleInfoWheelCdrAux.ipp | 178 + .../CarlaEgoVehicleInfoWheelPubSubTypes.cxx | 314 +- .../msg/CarlaEgoVehicleInfoWheelPubSubTypes.h | 139 +- .../carla_msgs/msg/CarlaEgoVehicleStatus.cxx | 214 +- .../carla_msgs/msg/CarlaEgoVehicleStatus.h | 596 +- .../msg/CarlaEgoVehicleStatusCdrAux.hpp | 60 + .../msg/CarlaEgoVehicleStatusCdrAux.ipp | 183 + .../msg/CarlaEgoVehicleStatusPubSubTypes.cxx | 327 +- .../msg/CarlaEgoVehicleStatusPubSubTypes.h | 151 +- .../msg/CarlaEgoVehicleTelemetryData.cxx | 268 +- .../msg/CarlaEgoVehicleTelemetryData.h | 688 +- .../CarlaEgoVehicleTelemetryDataCdrAux.hpp | 78 + .../CarlaEgoVehicleTelemetryDataCdrAux.ipp | 229 + ...arlaEgoVehicleTelemetryDataPubSubTypes.cxx | 327 +- .../CarlaEgoVehicleTelemetryDataPubSubTypes.h | 152 +- .../msg/CarlaEgoVehicleTelemetryDataWheel.cxx | 262 +- .../msg/CarlaEgoVehicleTelemetryDataWheel.h | 667 +- ...arlaEgoVehicleTelemetryDataWheelCdrAux.hpp | 50 + ...arlaEgoVehicleTelemetryDataWheelCdrAux.ipp | 210 + ...goVehicleTelemetryDataWheelPubSubTypes.cxx | 312 +- ...aEgoVehicleTelemetryDataWheelPubSubTypes.h | 163 +- .../carla_msgs/msg/CarlaEpisodeSettings.cxx | 298 +- .../carla_msgs/msg/CarlaEpisodeSettings.h | 679 +- .../msg/CarlaEpisodeSettingsCdrAux.hpp | 50 + .../msg/CarlaEpisodeSettingsCdrAux.ipp | 210 + .../msg/CarlaEpisodeSettingsPubSubTypes.cxx | 314 +- .../msg/CarlaEpisodeSettingsPubSubTypes.h | 138 +- .../carla_msgs/msg/CarlaLaneInvasion.cxx | 225 - .../carla_msgs/msg/CarlaLaneInvasion.h | 225 - .../carla_msgs/msg/CarlaLaneInvasionEvent.cxx | 138 +- .../carla_msgs/msg/CarlaLaneInvasionEvent.h | 352 +- .../msg/CarlaLaneInvasionEventCdrAux.hpp | 60 + .../msg/CarlaLaneInvasionEventCdrAux.ipp | 147 + .../msg/CarlaLaneInvasionEventPubSubTypes.cxx | 332 +- .../msg/CarlaLaneInvasionEventPubSubTypes.h | 151 +- .../msg/CarlaLaneInvasionPubSubTypes.cxx | 172 - .../msg/CarlaLaneInvasionPubSubTypes.h | 92 - .../fastdds/carla_msgs/msg/CarlaStatus.cxx | 191 +- .../ros2/fastdds/carla_msgs/msg/CarlaStatus.h | 478 +- .../carla_msgs/msg/CarlaStatusCdrAux.hpp | 51 + .../carla_msgs/msg/CarlaStatusCdrAux.ipp | 162 + .../carla_msgs/msg/CarlaStatusPubSubTypes.cxx | 314 +- .../carla_msgs/msg/CarlaStatusPubSubTypes.h | 141 +- .../msg/CarlaSynchronizationWindow.cxx | 108 +- .../msg/CarlaSynchronizationWindow.h | 269 +- .../msg/CarlaSynchronizationWindowCdrAux.hpp | 50 + .../msg/CarlaSynchronizationWindowCdrAux.ipp | 130 + ...aSynchronizationWindowParticipantState.cxx | 151 +- ...rlaSynchronizationWindowParticipantState.h | 364 +- ...ronizationWindowParticipantStateCdrAux.hpp | 50 + ...ronizationWindowParticipantStateCdrAux.ipp | 146 + ...ationWindowParticipantStatePubSubTypes.cxx | 314 +- ...izationWindowParticipantStatePubSubTypes.h | 138 +- .../CarlaSynchronizationWindowPubSubTypes.cxx | 314 +- .../CarlaSynchronizationWindowPubSubTypes.h | 138 +- .../carla_msgs/msg/CarlaTrafficLightInfo.cxx | 142 +- .../carla_msgs/msg/CarlaTrafficLightInfo.h | 381 +- .../msg/CarlaTrafficLightInfoCdrAux.hpp | 50 + .../msg/CarlaTrafficLightInfoCdrAux.ipp | 146 + .../msg/CarlaTrafficLightInfoList.cxx | 115 +- .../msg/CarlaTrafficLightInfoList.h | 286 +- .../msg/CarlaTrafficLightInfoListCdrAux.hpp | 54 + .../msg/CarlaTrafficLightInfoListCdrAux.ipp | 132 + .../CarlaTrafficLightInfoListPubSubTypes.cxx | 316 +- .../CarlaTrafficLightInfoListPubSubTypes.h | 141 +- .../msg/CarlaTrafficLightInfoPubSubTypes.cxx | 314 +- .../msg/CarlaTrafficLightInfoPubSubTypes.h | 140 +- .../msg/CarlaTrafficLightStatus.cxx | 147 +- .../carla_msgs/msg/CarlaTrafficLightStatus.h | 382 +- .../msg/CarlaTrafficLightStatusCdrAux.hpp | 62 + .../msg/CarlaTrafficLightStatusCdrAux.ipp | 157 + .../msg/CarlaTrafficLightStatusList.cxx | 115 +- .../msg/CarlaTrafficLightStatusList.h | 286 +- .../msg/CarlaTrafficLightStatusListCdrAux.hpp | 54 + .../msg/CarlaTrafficLightStatusListCdrAux.ipp | 132 + ...CarlaTrafficLightStatusListPubSubTypes.cxx | 316 +- .../CarlaTrafficLightStatusListPubSubTypes.h | 141 +- .../CarlaTrafficLightStatusPubSubTypes.cxx | 336 +- .../msg/CarlaTrafficLightStatusPubSubTypes.h | 151 +- .../carla_msgs/msg/CarlaV2XByteArray.cxx | 135 +- .../carla_msgs/msg/CarlaV2XByteArray.h | 326 +- .../msg/CarlaV2XByteArrayCdrAux.hpp | 53 + .../msg/CarlaV2XByteArrayCdrAux.ipp | 140 + .../msg/CarlaV2XByteArrayPubSubTypes.cxx | 317 +- .../msg/CarlaV2XByteArrayPubSubTypes.h | 140 +- .../fastdds/carla_msgs/msg/CarlaV2XCustom.cxx | 240 - .../fastdds/carla_msgs/msg/CarlaV2XCustom.h | 243 - .../carla_msgs/msg/CarlaV2XCustomData.cxx | 126 +- .../carla_msgs/msg/CarlaV2XCustomData.h | 325 +- .../msg/CarlaV2XCustomDataCdrAux.hpp | 54 + .../msg/CarlaV2XCustomDataCdrAux.ipp | 138 + .../carla_msgs/msg/CarlaV2XCustomDataList.cxx | 115 +- .../carla_msgs/msg/CarlaV2XCustomDataList.h | 286 +- .../msg/CarlaV2XCustomDataListCdrAux.hpp | 52 + .../msg/CarlaV2XCustomDataListCdrAux.ipp | 132 + .../msg/CarlaV2XCustomDataListPubSubTypes.cxx | 316 +- .../msg/CarlaV2XCustomDataListPubSubTypes.h | 141 +- .../msg/CarlaV2XCustomDataPubSubTypes.cxx | 314 +- .../msg/CarlaV2XCustomDataPubSubTypes.h | 139 +- .../carla_msgs/msg/CarlaV2XCustomMessage.cxx | 123 +- .../carla_msgs/msg/CarlaV2XCustomMessage.h | 340 +- .../msg/CarlaV2XCustomMessageCdrAux.hpp | 54 + .../msg/CarlaV2XCustomMessageCdrAux.ipp | 138 + .../msg/CarlaV2XCustomMessagePubSubTypes.cxx | 314 +- .../msg/CarlaV2XCustomMessagePubSubTypes.h | 140 +- .../msg/CarlaV2XCustomPubSubTypes.cxx | 176 - .../msg/CarlaV2XCustomPubSubTypes.h | 107 - .../fastdds/carla_msgs/msg/CarlaV2XData.cxx | 126 +- .../fastdds/carla_msgs/msg/CarlaV2XData.h | 325 +- .../carla_msgs/msg/CarlaV2XDataCdrAux.hpp | 107 + .../carla_msgs/msg/CarlaV2XDataCdrAux.ipp | 138 + .../carla_msgs/msg/CarlaV2XDataList.cxx | 115 +- .../fastdds/carla_msgs/msg/CarlaV2XDataList.h | 286 +- .../carla_msgs/msg/CarlaV2XDataListCdrAux.hpp | 64 + .../carla_msgs/msg/CarlaV2XDataListCdrAux.ipp | 132 + .../msg/CarlaV2XDataListPubSubTypes.cxx | 316 +- .../msg/CarlaV2XDataListPubSubTypes.h | 141 +- .../msg/CarlaV2XDataPubSubTypes.cxx | 314 +- .../carla_msgs/msg/CarlaV2XDataPubSubTypes.h | 139 +- .../carla_msgs/msg/CarlaWalkerControl.cxx | 163 +- .../carla_msgs/msg/CarlaWalkerControl.h | 422 +- .../msg/CarlaWalkerControlCdrAux.hpp | 50 + .../msg/CarlaWalkerControlCdrAux.ipp | 154 + .../msg/CarlaWalkerControlPubSubTypes.cxx | 314 +- .../msg/CarlaWalkerControlPubSubTypes.h | 140 +- .../carla_msgs/msg/CarlaWeatherParameters.cxx | 359 +- .../carla_msgs/msg/CarlaWeatherParameters.h | 802 +- .../msg/CarlaWeatherParametersCdrAux.hpp | 50 + .../msg/CarlaWeatherParametersCdrAux.ipp | 234 + .../msg/CarlaWeatherParametersPubSubTypes.cxx | 314 +- .../msg/CarlaWeatherParametersPubSubTypes.h | 138 +- .../fastdds/carla_msgs/msg/CarlaWorldInfo.cxx | 151 +- .../fastdds/carla_msgs/msg/CarlaWorldInfo.h | 390 +- .../carla_msgs/msg/CarlaWorldInfoCdrAux.hpp | 50 + .../carla_msgs/msg/CarlaWorldInfoCdrAux.ipp | 146 + .../msg/CarlaWorldInfoPubSubTypes.cxx | 314 +- .../msg/CarlaWorldInfoPubSubTypes.h | 138 +- .../fastdds/carla_msgs/srv/DestroyObject.cxx | 201 +- .../fastdds/carla_msgs/srv/DestroyObject.h | 496 +- .../carla_msgs/srv/DestroyObjectCdrAux.hpp | 59 + .../carla_msgs/srv/DestroyObjectCdrAux.ipp | 216 + .../srv/DestroyObjectPubSubTypes.cxx | 610 +- .../carla_msgs/srv/DestroyObjectPubSubTypes.h | 255 +- .../carla_msgs/srv/GetAvailableMaps.cxx | 206 +- .../fastdds/carla_msgs/srv/GetAvailableMaps.h | 511 +- .../carla_msgs/srv/GetAvailableMapsCdrAux.hpp | 61 + .../carla_msgs/srv/GetAvailableMapsCdrAux.ipp | 218 + .../srv/GetAvailableMapsPubSubTypes.cxx | 612 +- .../srv/GetAvailableMapsPubSubTypes.h | 257 +- .../fastdds/carla_msgs/srv/GetBlueprints.cxx | 205 +- .../fastdds/carla_msgs/srv/GetBlueprints.h | 526 +- .../carla_msgs/srv/GetBlueprintsCdrAux.hpp | 63 + .../carla_msgs/srv/GetBlueprintsCdrAux.ipp | 218 + .../srv/GetBlueprintsPubSubTypes.cxx | 612 +- .../carla_msgs/srv/GetBlueprintsPubSubTypes.h | 258 +- .../ros2/fastdds/carla_msgs/srv/LoadMap.cxx | 265 +- .../ros2/fastdds/carla_msgs/srv/LoadMap.h | 660 +- .../fastdds/carla_msgs/srv/LoadMapCdrAux.hpp | 82 + .../fastdds/carla_msgs/srv/LoadMapCdrAux.ipp | 263 + .../carla_msgs/srv/LoadMapPubSubTypes.cxx | 650 +- .../carla_msgs/srv/LoadMapPubSubTypes.h | 275 +- .../carla_msgs/srv/SetEpisodeSettings.cxx | 198 +- .../carla_msgs/srv/SetEpisodeSettings.h | 511 +- .../srv/SetEpisodeSettingsCdrAux.hpp | 59 + .../srv/SetEpisodeSettingsCdrAux.ipp | 216 + .../srv/SetEpisodeSettingsPubSubTypes.cxx | 610 +- .../srv/SetEpisodeSettingsPubSubTypes.h | 256 +- .../fastdds/carla_msgs/srv/SpawnObject.cxx | 278 +- .../ros2/fastdds/carla_msgs/srv/SpawnObject.h | 703 +- .../carla_msgs/srv/SpawnObjectCdrAux.hpp | 63 + .../carla_msgs/srv/SpawnObjectCdrAux.ipp | 248 + .../carla_msgs/srv/SpawnObjectPubSubTypes.cxx | 610 +- .../carla_msgs/srv/SpawnObjectPubSubTypes.h | 257 +- .../carla/ros2/fastdds/clean_idl_file.bash | 55 + .../derived_object_msgs/msg/Object.cxx | 324 +- .../fastdds/derived_object_msgs/msg/Object.h | 768 +- .../derived_object_msgs/msg/ObjectArray.cxx | 137 +- .../derived_object_msgs/msg/ObjectArray.h | 309 +- .../msg/ObjectArrayCdrAux.hpp | 58 + .../msg/ObjectArrayCdrAux.ipp | 140 + .../msg/ObjectArrayPubSubTypes.cxx | 316 +- .../msg/ObjectArrayPubSubTypes.h | 109 +- .../derived_object_msgs/msg/ObjectCdrAux.hpp | 82 + .../derived_object_msgs/msg/ObjectCdrAux.ipp | 247 + .../msg/ObjectPubSubTypes.cxx | 331 +- .../msg/ObjectPubSubTypes.h | 143 +- .../msg/ObjectWithCovariance.cxx | 324 +- .../msg/ObjectWithCovariance.h | 836 +-- .../msg/ObjectWithCovarianceArray.cxx | 137 +- .../msg/ObjectWithCovarianceArray.h | 340 +- .../msg/ObjectWithCovarianceArrayCdrAux.hpp | 67 + .../msg/ObjectWithCovarianceArrayCdrAux.ipp | 140 + .../ObjectWithCovarianceArrayPubSubTypes.cxx | 316 +- .../ObjectWithCovarianceArrayPubSubTypes.h | 141 +- .../msg/ObjectWithCovarianceCdrAux.hpp | 95 + .../msg/ObjectWithCovarianceCdrAux.ipp | 247 + .../msg/ObjectWithCovariancePubSubTypes.cxx | 331 +- .../msg/ObjectWithCovariancePubSubTypes.h | 165 +- .../msg/SolidPrimitiveWithCovariance.cxx | 173 +- .../msg/SolidPrimitiveWithCovariance.h | 409 +- .../SolidPrimitiveWithCovarianceCdrAux.hpp | 77 + .../SolidPrimitiveWithCovarianceCdrAux.ipp | 173 + ...olidPrimitiveWithCovariancePubSubTypes.cxx | 351 +- .../SolidPrimitiveWithCovariancePubSubTypes.h | 159 +- .../fastdds/diagnostic_msgs/msg/KeyValue.cxx | 131 +- .../fastdds/diagnostic_msgs/msg/KeyValue.h | 304 +- .../diagnostic_msgs/msg/KeyValueCdrAux.hpp | 50 + .../diagnostic_msgs/msg/KeyValueCdrAux.ipp | 138 + .../msg/KeyValuePubSubTypes.cxx | 314 +- .../diagnostic_msgs/msg/KeyValuePubSubTypes.h | 106 +- .../msg/AccelerationConfidence.cxx | 106 +- .../msg/AccelerationConfidence.h | 285 +- .../msg/AccelerationConfidenceCdrAux.hpp | 61 + .../msg/AccelerationConfidenceCdrAux.ipp | 141 + .../msg/AccelerationConfidencePubSubTypes.cxx | 336 +- .../msg/AccelerationConfidencePubSubTypes.h | 150 +- .../msg/AccelerationControl.cxx | 142 +- .../msg/AccelerationControl.h | 345 +- .../msg/AccelerationControlCdrAux.hpp | 67 + .../msg/AccelerationControlCdrAux.ipp | 155 + .../msg/AccelerationControlPubSubTypes.cxx | 345 +- .../msg/AccelerationControlPubSubTypes.h | 153 +- .../etsi_its_cam_msgs/msg/Altitude.cxx | 123 +- .../fastdds/etsi_its_cam_msgs/msg/Altitude.h | 340 +- .../etsi_its_cam_msgs/msg/AltitudeCdrAux.hpp | 51 + .../etsi_its_cam_msgs/msg/AltitudeCdrAux.ipp | 138 + .../msg/AltitudeConfidence.cxx | 115 +- .../msg/AltitudeConfidence.h | 307 +- .../msg/AltitudeConfidenceCdrAux.hpp | 83 + .../msg/AltitudeConfidenceCdrAux.ipp | 163 + .../msg/AltitudeConfidencePubSubTypes.cxx | 331 +- .../msg/AltitudeConfidencePubSubTypes.h | 161 +- .../msg/AltitudePubSubTypes.cxx | 314 +- .../msg/AltitudePubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/AltitudeValue.cxx | 106 +- .../etsi_its_cam_msgs/msg/AltitudeValue.h | 285 +- .../msg/AltitudeValueCdrAux.hpp | 61 + .../msg/AltitudeValueCdrAux.ipp | 141 + .../msg/AltitudeValuePubSubTypes.cxx | 336 +- .../msg/AltitudeValuePubSubTypes.h | 150 +- .../etsi_its_cam_msgs/msg/BasicContainer.cxx | 123 +- .../etsi_its_cam_msgs/msg/BasicContainer.h | 340 +- .../msg/BasicContainerCdrAux.hpp | 59 + .../msg/BasicContainerCdrAux.ipp | 138 + .../msg/BasicContainerPubSubTypes.cxx | 314 +- .../msg/BasicContainerPubSubTypes.h | 140 +- .../BasicVehicleContainerHighFrequency.cxx | 558 +- .../msg/BasicVehicleContainerHighFrequency.h | 1383 ++-- ...sicVehicleContainerHighFrequencyCdrAux.hpp | 58 + ...sicVehicleContainerHighFrequencyCdrAux.ipp | 306 + ...hicleContainerHighFrequencyPubSubTypes.cxx | 314 +- ...VehicleContainerHighFrequencyPubSubTypes.h | 154 +- .../msg/BasicVehicleContainerLowFrequency.cxx | 139 +- .../msg/BasicVehicleContainerLowFrequency.h | 394 +- ...asicVehicleContainerLowFrequencyCdrAux.hpp | 52 + ...asicVehicleContainerLowFrequencyCdrAux.ipp | 146 + ...ehicleContainerLowFrequencyPubSubTypes.cxx | 314 +- ...cVehicleContainerLowFrequencyPubSubTypes.h | 141 +- .../fastdds/etsi_its_cam_msgs/msg/CAM.cxx | 123 +- .../ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h | 328 +- .../etsi_its_cam_msgs/msg/CAMCdrAux.hpp | 120 + .../etsi_its_cam_msgs/msg/CAMCdrAux.ipp | 138 + .../etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx | 314 +- .../etsi_its_cam_msgs/msg/CAMPubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/CamParameters.cxx | 195 +- .../etsi_its_cam_msgs/msg/CamParameters.h | 530 +- .../msg/CamParametersCdrAux.hpp | 57 + .../msg/CamParametersCdrAux.ipp | 170 + .../msg/CamParametersPubSubTypes.cxx | 314 +- .../msg/CamParametersPubSubTypes.h | 142 +- .../etsi_its_cam_msgs/msg/CauseCode.cxx | 123 +- .../fastdds/etsi_its_cam_msgs/msg/CauseCode.h | 340 +- .../etsi_its_cam_msgs/msg/CauseCodeCdrAux.hpp | 50 + .../etsi_its_cam_msgs/msg/CauseCodeCdrAux.ipp | 138 + .../msg/CauseCodePubSubTypes.cxx | 314 +- .../msg/CauseCodePubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/CauseCodeType.cxx | 128 +- .../etsi_its_cam_msgs/msg/CauseCodeType.h | 333 +- .../msg/CauseCodeTypeCdrAux.hpp | 109 + .../msg/CauseCodeTypeCdrAux.ipp | 189 + .../msg/CauseCodeTypePubSubTypes.cxx | 324 +- .../msg/CauseCodeTypePubSubTypes.h | 174 +- .../msg/CenDsrcTollingZone.cxx | 160 +- .../msg/CenDsrcTollingZone.h | 435 +- .../msg/CenDsrcTollingZoneCdrAux.hpp | 52 + .../msg/CenDsrcTollingZoneCdrAux.ipp | 154 + .../msg/CenDsrcTollingZoneID.cxx | 105 +- .../msg/CenDsrcTollingZoneID.h | 284 +- .../msg/CenDsrcTollingZoneIDCdrAux.hpp | 51 + .../msg/CenDsrcTollingZoneIDCdrAux.ipp | 130 + .../msg/CenDsrcTollingZoneIDPubSubTypes.cxx | 314 +- .../msg/CenDsrcTollingZoneIDPubSubTypes.h | 139 +- .../msg/CenDsrcTollingZonePubSubTypes.cxx | 314 +- .../msg/CenDsrcTollingZonePubSubTypes.h | 141 +- .../etsi_its_cam_msgs/msg/ClosedLanes.cxx | 198 +- .../etsi_its_cam_msgs/msg/ClosedLanes.h | 517 +- .../msg/ClosedLanesCdrAux.hpp | 51 + .../msg/ClosedLanesCdrAux.ipp | 170 + .../msg/ClosedLanesPubSubTypes.cxx | 314 +- .../msg/ClosedLanesPubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/CoopAwareness.cxx | 123 +- .../etsi_its_cam_msgs/msg/CoopAwareness.h | 340 +- .../msg/CoopAwarenessCdrAux.hpp | 78 + .../msg/CoopAwarenessCdrAux.ipp | 138 + .../msg/CoopAwarenessPubSubTypes.cxx | 314 +- .../msg/CoopAwarenessPubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/Curvature.cxx | 123 +- .../fastdds/etsi_its_cam_msgs/msg/Curvature.h | 340 +- .../msg/CurvatureCalculationMode.cxx | 108 +- .../msg/CurvatureCalculationMode.h | 281 +- .../msg/CurvatureCalculationModeCdrAux.hpp | 57 + .../msg/CurvatureCalculationModeCdrAux.ipp | 137 + .../CurvatureCalculationModePubSubTypes.cxx | 330 +- .../msg/CurvatureCalculationModePubSubTypes.h | 148 +- .../etsi_its_cam_msgs/msg/CurvatureCdrAux.hpp | 52 + .../etsi_its_cam_msgs/msg/CurvatureCdrAux.ipp | 138 + .../msg/CurvatureConfidence.cxx | 107 +- .../msg/CurvatureConfidence.h | 291 +- .../msg/CurvatureConfidenceCdrAux.hpp | 67 + .../msg/CurvatureConfidenceCdrAux.ipp | 147 + .../msg/CurvatureConfidencePubSubTypes.cxx | 345 +- .../msg/CurvatureConfidencePubSubTypes.h | 153 +- .../msg/CurvaturePubSubTypes.cxx | 314 +- .../msg/CurvaturePubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/CurvatureValue.cxx | 107 +- .../etsi_its_cam_msgs/msg/CurvatureValue.h | 283 +- .../msg/CurvatureValueCdrAux.hpp | 59 + .../msg/CurvatureValueCdrAux.ipp | 139 + .../msg/CurvatureValuePubSubTypes.cxx | 333 +- .../msg/CurvatureValuePubSubTypes.h | 149 +- .../msg/DangerousGoodsBasic.cxx | 119 +- .../msg/DangerousGoodsBasic.h | 315 +- .../msg/DangerousGoodsBasicCdrAux.hpp | 91 + .../msg/DangerousGoodsBasicCdrAux.ipp | 171 + .../msg/DangerousGoodsBasicPubSubTypes.cxx | 315 +- .../msg/DangerousGoodsBasicPubSubTypes.h | 165 +- .../msg/DangerousGoodsContainer.cxx | 105 +- .../msg/DangerousGoodsContainer.h | 284 +- .../msg/DangerousGoodsContainerCdrAux.hpp | 50 + .../msg/DangerousGoodsContainerCdrAux.ipp | 130 + .../DangerousGoodsContainerPubSubTypes.cxx | 314 +- .../msg/DangerousGoodsContainerPubSubTypes.h | 139 +- .../etsi_its_cam_msgs/msg/DeltaAltitude.cxx | 106 +- .../etsi_its_cam_msgs/msg/DeltaAltitude.h | 285 +- .../msg/DeltaAltitudeCdrAux.hpp | 61 + .../msg/DeltaAltitudeCdrAux.ipp | 141 + .../msg/DeltaAltitudePubSubTypes.cxx | 336 +- .../msg/DeltaAltitudePubSubTypes.h | 150 +- .../etsi_its_cam_msgs/msg/DeltaLatitude.cxx | 106 +- .../etsi_its_cam_msgs/msg/DeltaLatitude.h | 285 +- .../msg/DeltaLatitudeCdrAux.hpp | 61 + .../msg/DeltaLatitudeCdrAux.ipp | 141 + .../msg/DeltaLatitudePubSubTypes.cxx | 336 +- .../msg/DeltaLatitudePubSubTypes.h | 150 +- .../etsi_its_cam_msgs/msg/DeltaLongitude.cxx | 106 +- .../etsi_its_cam_msgs/msg/DeltaLongitude.h | 285 +- .../msg/DeltaLongitudeCdrAux.hpp | 61 + .../msg/DeltaLongitudeCdrAux.ipp | 141 + .../msg/DeltaLongitudePubSubTypes.cxx | 336 +- .../msg/DeltaLongitudePubSubTypes.h | 150 +- .../msg/DeltaReferencePosition.cxx | 139 +- .../msg/DeltaReferencePosition.h | 394 +- .../msg/DeltaReferencePositionCdrAux.hpp | 51 + .../msg/DeltaReferencePositionCdrAux.ipp | 146 + .../msg/DeltaReferencePositionPubSubTypes.cxx | 314 +- .../msg/DeltaReferencePositionPubSubTypes.h | 141 +- .../etsi_its_cam_msgs/msg/DriveDirection.cxx | 108 +- .../etsi_its_cam_msgs/msg/DriveDirection.h | 281 +- .../msg/DriveDirectionCdrAux.hpp | 57 + .../msg/DriveDirectionCdrAux.ipp | 137 + .../msg/DriveDirectionPubSubTypes.cxx | 330 +- .../msg/DriveDirectionPubSubTypes.h | 148 +- .../msg/DrivingLaneStatus.cxx | 142 +- .../etsi_its_cam_msgs/msg/DrivingLaneStatus.h | 333 +- .../msg/DrivingLaneStatusCdrAux.hpp | 55 + .../msg/DrivingLaneStatusCdrAux.ipp | 143 + .../msg/DrivingLaneStatusPubSubTypes.cxx | 327 +- .../msg/DrivingLaneStatusPubSubTypes.h | 147 +- .../msg/EmbarkationStatus.cxx | 108 +- .../etsi_its_cam_msgs/msg/EmbarkationStatus.h | 269 +- .../msg/EmbarkationStatusCdrAux.hpp | 50 + .../msg/EmbarkationStatusCdrAux.ipp | 130 + .../msg/EmbarkationStatusPubSubTypes.cxx | 314 +- .../msg/EmbarkationStatusPubSubTypes.h | 138 +- .../msg/EmergencyContainer.cxx | 179 +- .../msg/EmergencyContainer.h | 476 +- .../msg/EmergencyContainerCdrAux.hpp | 52 + .../msg/EmergencyContainerCdrAux.ipp | 162 + .../msg/EmergencyContainerPubSubTypes.cxx | 314 +- .../msg/EmergencyContainerPubSubTypes.h | 141 +- .../msg/EmergencyPriority.cxx | 141 +- .../etsi_its_cam_msgs/msg/EmergencyPriority.h | 335 +- .../msg/EmergencyPriorityCdrAux.hpp | 57 + .../msg/EmergencyPriorityCdrAux.ipp | 145 + .../msg/EmergencyPriorityPubSubTypes.cxx | 330 +- .../msg/EmergencyPriorityPubSubTypes.h | 148 +- .../etsi_its_cam_msgs/msg/ExteriorLights.cxx | 143 +- .../etsi_its_cam_msgs/msg/ExteriorLights.h | 347 +- .../msg/ExteriorLightsCdrAux.hpp | 69 + .../msg/ExteriorLightsCdrAux.ipp | 157 + .../msg/ExteriorLightsPubSubTypes.cxx | 348 +- .../msg/ExteriorLightsPubSubTypes.h | 154 +- .../msg/GenerationDeltaTime.cxx | 108 +- .../msg/GenerationDeltaTime.h | 281 +- .../msg/GenerationDeltaTimeCdrAux.hpp | 57 + .../msg/GenerationDeltaTimeCdrAux.ipp | 137 + .../msg/GenerationDeltaTimePubSubTypes.cxx | 330 +- .../msg/GenerationDeltaTimePubSubTypes.h | 148 +- .../msg/HardShoulderStatus.cxx | 108 +- .../msg/HardShoulderStatus.h | 281 +- .../msg/HardShoulderStatusCdrAux.hpp | 57 + .../msg/HardShoulderStatusCdrAux.ipp | 137 + .../msg/HardShoulderStatusPubSubTypes.cxx | 330 +- .../msg/HardShoulderStatusPubSubTypes.h | 148 +- .../fastdds/etsi_its_cam_msgs/msg/Heading.cxx | 123 +- .../fastdds/etsi_its_cam_msgs/msg/Heading.h | 340 +- .../etsi_its_cam_msgs/msg/HeadingCdrAux.hpp | 52 + .../etsi_its_cam_msgs/msg/HeadingCdrAux.ipp | 138 + .../msg/HeadingConfidence.cxx | 105 +- .../etsi_its_cam_msgs/msg/HeadingConfidence.h | 287 +- .../msg/HeadingConfidenceCdrAux.hpp | 63 + .../msg/HeadingConfidenceCdrAux.ipp | 143 + .../msg/HeadingConfidencePubSubTypes.cxx | 339 +- .../msg/HeadingConfidencePubSubTypes.h | 151 +- .../msg/HeadingPubSubTypes.cxx | 314 +- .../msg/HeadingPubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/HeadingValue.cxx | 106 +- .../etsi_its_cam_msgs/msg/HeadingValue.h | 289 +- .../msg/HeadingValueCdrAux.hpp | 65 + .../msg/HeadingValueCdrAux.ipp | 145 + .../msg/HeadingValuePubSubTypes.cxx | 342 +- .../msg/HeadingValuePubSubTypes.h | 152 +- .../msg/HighFrequencyContainer.cxx | 143 +- .../msg/HighFrequencyContainer.h | 391 +- .../msg/HighFrequencyContainerCdrAux.hpp | 64 + .../msg/HighFrequencyContainerCdrAux.ipp | 151 + .../msg/HighFrequencyContainerPubSubTypes.cxx | 327 +- .../msg/HighFrequencyContainerPubSubTypes.h | 149 +- .../etsi_its_cam_msgs/msg/ItsPduHeader.cxx | 155 +- .../etsi_its_cam_msgs/msg/ItsPduHeader.h | 406 +- .../msg/ItsPduHeaderCdrAux.hpp | 85 + .../msg/ItsPduHeaderCdrAux.ipp | 181 + .../msg/ItsPduHeaderPubSubTypes.cxx | 332 +- .../msg/ItsPduHeaderPubSubTypes.h | 163 +- .../etsi_its_cam_msgs/msg/LanePosition.cxx | 105 +- .../etsi_its_cam_msgs/msg/LanePosition.h | 287 +- .../msg/LanePositionCdrAux.hpp | 63 + .../msg/LanePositionCdrAux.ipp | 143 + .../msg/LanePositionPubSubTypes.cxx | 339 +- .../msg/LanePositionPubSubTypes.h | 151 +- .../msg/LateralAcceleration.cxx | 123 +- .../msg/LateralAcceleration.h | 340 +- .../msg/LateralAccelerationCdrAux.hpp | 51 + .../msg/LateralAccelerationCdrAux.ipp | 138 + .../msg/LateralAccelerationPubSubTypes.cxx | 314 +- .../msg/LateralAccelerationPubSubTypes.h | 140 +- .../msg/LateralAccelerationValue.cxx | 106 +- .../msg/LateralAccelerationValue.h | 285 +- .../msg/LateralAccelerationValueCdrAux.hpp | 61 + .../msg/LateralAccelerationValueCdrAux.ipp | 141 + .../LateralAccelerationValuePubSubTypes.cxx | 336 +- .../msg/LateralAccelerationValuePubSubTypes.h | 150 +- .../etsi_its_cam_msgs/msg/Latitude.cxx | 106 +- .../fastdds/etsi_its_cam_msgs/msg/Latitude.h | 285 +- .../etsi_its_cam_msgs/msg/LatitudeCdrAux.hpp | 61 + .../etsi_its_cam_msgs/msg/LatitudeCdrAux.ipp | 141 + .../msg/LatitudePubSubTypes.cxx | 336 +- .../msg/LatitudePubSubTypes.h | 150 +- .../msg/LightBarSirenInUse.cxx | 141 +- .../msg/LightBarSirenInUse.h | 335 +- .../msg/LightBarSirenInUseCdrAux.hpp | 57 + .../msg/LightBarSirenInUseCdrAux.ipp | 145 + .../msg/LightBarSirenInUsePubSubTypes.cxx | 330 +- .../msg/LightBarSirenInUsePubSubTypes.h | 148 +- .../etsi_its_cam_msgs/msg/Longitude.cxx | 106 +- .../fastdds/etsi_its_cam_msgs/msg/Longitude.h | 285 +- .../etsi_its_cam_msgs/msg/LongitudeCdrAux.hpp | 61 + .../etsi_its_cam_msgs/msg/LongitudeCdrAux.ipp | 141 + .../msg/LongitudePubSubTypes.cxx | 336 +- .../msg/LongitudePubSubTypes.h | 150 +- .../msg/LongitudinalAcceleration.cxx | 123 +- .../msg/LongitudinalAcceleration.h | 340 +- .../msg/LongitudinalAccelerationCdrAux.hpp | 51 + .../msg/LongitudinalAccelerationCdrAux.ipp | 138 + .../LongitudinalAccelerationPubSubTypes.cxx | 314 +- .../msg/LongitudinalAccelerationPubSubTypes.h | 140 +- .../msg/LongitudinalAccelerationValue.cxx | 106 +- .../msg/LongitudinalAccelerationValue.h | 285 +- .../LongitudinalAccelerationValueCdrAux.hpp | 61 + .../LongitudinalAccelerationValueCdrAux.ipp | 141 + ...ngitudinalAccelerationValuePubSubTypes.cxx | 336 +- ...LongitudinalAccelerationValuePubSubTypes.h | 150 +- .../msg/LowFrequencyContainer.cxx | 129 +- .../msg/LowFrequencyContainer.h | 333 +- .../msg/LowFrequencyContainerCdrAux.hpp | 53 + .../msg/LowFrequencyContainerCdrAux.ipp | 141 + .../msg/LowFrequencyContainerPubSubTypes.cxx | 322 +- .../msg/LowFrequencyContainerPubSubTypes.h | 146 +- .../etsi_its_cam_msgs/msg/PathDeltaTime.cxx | 108 +- .../etsi_its_cam_msgs/msg/PathDeltaTime.h | 281 +- .../msg/PathDeltaTimeCdrAux.hpp | 57 + .../msg/PathDeltaTimeCdrAux.ipp | 137 + .../msg/PathDeltaTimePubSubTypes.cxx | 330 +- .../msg/PathDeltaTimePubSubTypes.h | 148 +- .../etsi_its_cam_msgs/msg/PathHistory.cxx | 116 +- .../etsi_its_cam_msgs/msg/PathHistory.h | 296 +- .../msg/PathHistoryCdrAux.hpp | 59 + .../msg/PathHistoryCdrAux.ipp | 137 + .../msg/PathHistoryPubSubTypes.cxx | 329 +- .../msg/PathHistoryPubSubTypes.h | 150 +- .../etsi_its_cam_msgs/msg/PathPoint.cxx | 144 +- .../fastdds/etsi_its_cam_msgs/msg/PathPoint.h | 381 +- .../etsi_its_cam_msgs/msg/PathPointCdrAux.hpp | 52 + .../etsi_its_cam_msgs/msg/PathPointCdrAux.ipp | 146 + .../msg/PathPointPubSubTypes.cxx | 314 +- .../msg/PathPointPubSubTypes.h | 140 +- .../msg/PerformanceClass.cxx | 106 +- .../etsi_its_cam_msgs/msg/PerformanceClass.h | 285 +- .../msg/PerformanceClassCdrAux.hpp | 61 + .../msg/PerformanceClassCdrAux.ipp | 141 + .../msg/PerformanceClassPubSubTypes.cxx | 336 +- .../msg/PerformanceClassPubSubTypes.h | 150 +- .../msg/PosConfidenceEllipse.cxx | 139 +- .../msg/PosConfidenceEllipse.h | 394 +- .../msg/PosConfidenceEllipseCdrAux.hpp | 52 + .../msg/PosConfidenceEllipseCdrAux.ipp | 146 + .../msg/PosConfidenceEllipsePubSubTypes.cxx | 314 +- .../msg/PosConfidenceEllipsePubSubTypes.h | 140 +- .../msg/ProtectedCommunicationZone.cxx | 250 +- .../msg/ProtectedCommunicationZone.h | 679 +- .../msg/ProtectedCommunicationZoneCdrAux.hpp | 50 + .../msg/ProtectedCommunicationZoneCdrAux.ipp | 194 + .../ProtectedCommunicationZonePubSubTypes.cxx | 314 +- .../ProtectedCommunicationZonePubSubTypes.h | 144 +- .../msg/ProtectedCommunicationZonesRSU.cxx | 116 +- .../msg/ProtectedCommunicationZonesRSU.h | 296 +- .../ProtectedCommunicationZonesRSUCdrAux.hpp | 59 + .../ProtectedCommunicationZonesRSUCdrAux.ipp | 137 + ...tectedCommunicationZonesRSUPubSubTypes.cxx | 329 +- ...rotectedCommunicationZonesRSUPubSubTypes.h | 150 +- .../etsi_its_cam_msgs/msg/ProtectedZoneID.cxx | 109 +- .../etsi_its_cam_msgs/msg/ProtectedZoneID.h | 279 +- .../msg/ProtectedZoneIDCdrAux.hpp | 55 + .../msg/ProtectedZoneIDCdrAux.ipp | 135 + .../msg/ProtectedZoneIDPubSubTypes.cxx | 327 +- .../msg/ProtectedZoneIDPubSubTypes.h | 147 +- .../msg/ProtectedZoneRadius.cxx | 108 +- .../msg/ProtectedZoneRadius.h | 281 +- .../msg/ProtectedZoneRadiusCdrAux.hpp | 57 + .../msg/ProtectedZoneRadiusCdrAux.ipp | 137 + .../msg/ProtectedZoneRadiusPubSubTypes.cxx | 330 +- .../msg/ProtectedZoneRadiusPubSubTypes.h | 148 +- .../msg/ProtectedZoneType.cxx | 109 +- .../etsi_its_cam_msgs/msg/ProtectedZoneType.h | 279 +- .../msg/ProtectedZoneTypeCdrAux.hpp | 55 + .../msg/ProtectedZoneTypeCdrAux.ipp | 135 + .../msg/ProtectedZoneTypePubSubTypes.cxx | 327 +- .../msg/ProtectedZoneTypePubSubTypes.h | 147 +- .../etsi_its_cam_msgs/msg/PtActivation.cxx | 123 +- .../etsi_its_cam_msgs/msg/PtActivation.h | 340 +- .../msg/PtActivationCdrAux.hpp | 52 + .../msg/PtActivationCdrAux.ipp | 138 + .../msg/PtActivationData.cxx | 117 +- .../etsi_its_cam_msgs/msg/PtActivationData.h | 294 +- .../msg/PtActivationDataCdrAux.hpp | 57 + .../msg/PtActivationDataCdrAux.ipp | 137 + .../msg/PtActivationDataPubSubTypes.cxx | 329 +- .../msg/PtActivationDataPubSubTypes.h | 149 +- .../msg/PtActivationPubSubTypes.cxx | 314 +- .../msg/PtActivationPubSubTypes.h | 140 +- .../msg/PtActivationType.cxx | 106 +- .../etsi_its_cam_msgs/msg/PtActivationType.h | 285 +- .../msg/PtActivationTypeCdrAux.hpp | 61 + .../msg/PtActivationTypeCdrAux.ipp | 141 + .../msg/PtActivationTypePubSubTypes.cxx | 336 +- .../msg/PtActivationTypePubSubTypes.h | 150 +- .../msg/PublicTransportContainer.cxx | 144 +- .../msg/PublicTransportContainer.h | 381 +- .../msg/PublicTransportContainerCdrAux.hpp | 50 + .../msg/PublicTransportContainerCdrAux.ipp | 146 + .../PublicTransportContainerPubSubTypes.cxx | 314 +- .../msg/PublicTransportContainerPubSubTypes.h | 140 +- .../msg/RSUContainerHighFrequency.cxx | 128 +- .../msg/RSUContainerHighFrequency.h | 325 +- .../msg/RSUContainerHighFrequencyCdrAux.hpp | 54 + .../msg/RSUContainerHighFrequencyCdrAux.ipp | 138 + .../RSUContainerHighFrequencyPubSubTypes.cxx | 314 +- .../RSUContainerHighFrequencyPubSubTypes.h | 139 +- .../msg/ReferencePosition.cxx | 203 +- .../etsi_its_cam_msgs/msg/ReferencePosition.h | 448 +- .../msg/ReferencePositionCdrAux.hpp | 57 + .../msg/ReferencePositionCdrAux.ipp | 154 + .../msg/ReferencePositionPubSubTypes.cxx | 314 +- .../msg/ReferencePositionPubSubTypes.h | 142 +- .../etsi_its_cam_msgs/msg/RescueContainer.cxx | 105 +- .../etsi_its_cam_msgs/msg/RescueContainer.h | 284 +- .../msg/RescueContainerCdrAux.hpp | 51 + .../msg/RescueContainerCdrAux.ipp | 130 + .../msg/RescueContainerPubSubTypes.cxx | 314 +- .../msg/RescueContainerPubSubTypes.h | 139 +- .../msg/RoadWorksContainerBasic.cxx | 179 +- .../msg/RoadWorksContainerBasic.h | 476 +- .../msg/RoadWorksContainerBasicCdrAux.hpp | 51 + .../msg/RoadWorksContainerBasicCdrAux.ipp | 162 + .../RoadWorksContainerBasicPubSubTypes.cxx | 314 +- .../msg/RoadWorksContainerBasicPubSubTypes.h | 141 +- .../msg/RoadworksSubCauseCode.cxx | 108 +- .../msg/RoadworksSubCauseCode.h | 293 +- .../msg/RoadworksSubCauseCodeCdrAux.hpp | 69 + .../msg/RoadworksSubCauseCodeCdrAux.ipp | 149 + .../msg/RoadworksSubCauseCodePubSubTypes.cxx | 348 +- .../msg/RoadworksSubCauseCodePubSubTypes.h | 154 +- .../msg/SafetyCarContainer.cxx | 214 +- .../msg/SafetyCarContainer.h | 571 +- .../msg/SafetyCarContainerCdrAux.hpp | 53 + .../msg/SafetyCarContainerCdrAux.ipp | 178 + .../msg/SafetyCarContainerPubSubTypes.cxx | 314 +- .../msg/SafetyCarContainerPubSubTypes.h | 142 +- .../etsi_its_cam_msgs/msg/SemiAxisLength.cxx | 106 +- .../etsi_its_cam_msgs/msg/SemiAxisLength.h | 285 +- .../msg/SemiAxisLengthCdrAux.hpp | 61 + .../msg/SemiAxisLengthCdrAux.ipp | 141 + .../msg/SemiAxisLengthPubSubTypes.cxx | 336 +- .../msg/SemiAxisLengthPubSubTypes.h | 150 +- .../msg/SpecialTransportContainer.cxx | 123 +- .../msg/SpecialTransportContainer.h | 340 +- .../msg/SpecialTransportContainerCdrAux.hpp | 52 + .../msg/SpecialTransportContainerCdrAux.ipp | 138 + .../SpecialTransportContainerPubSubTypes.cxx | 314 +- .../SpecialTransportContainerPubSubTypes.h | 140 +- .../msg/SpecialTransportType.cxx | 141 +- .../msg/SpecialTransportType.h | 339 +- .../msg/SpecialTransportTypeCdrAux.hpp | 61 + .../msg/SpecialTransportTypeCdrAux.ipp | 149 + .../msg/SpecialTransportTypePubSubTypes.cxx | 336 +- .../msg/SpecialTransportTypePubSubTypes.h | 150 +- .../msg/SpecialVehicleContainer.cxx | 234 +- .../msg/SpecialVehicleContainer.h | 671 +- .../msg/SpecialVehicleContainerCdrAux.hpp | 87 + .../msg/SpecialVehicleContainerCdrAux.ipp | 201 + .../SpecialVehicleContainerPubSubTypes.cxx | 342 +- .../msg/SpecialVehicleContainerPubSubTypes.h | 159 +- .../fastdds/etsi_its_cam_msgs/msg/Speed.cxx | 123 +- .../fastdds/etsi_its_cam_msgs/msg/Speed.h | 340 +- .../etsi_its_cam_msgs/msg/SpeedCdrAux.hpp | 51 + .../etsi_its_cam_msgs/msg/SpeedCdrAux.ipp | 138 + .../etsi_its_cam_msgs/msg/SpeedConfidence.cxx | 105 +- .../etsi_its_cam_msgs/msg/SpeedConfidence.h | 287 +- .../msg/SpeedConfidenceCdrAux.hpp | 63 + .../msg/SpeedConfidenceCdrAux.ipp | 143 + .../msg/SpeedConfidencePubSubTypes.cxx | 339 +- .../msg/SpeedConfidencePubSubTypes.h | 151 +- .../etsi_its_cam_msgs/msg/SpeedLimit.cxx | 108 +- .../etsi_its_cam_msgs/msg/SpeedLimit.h | 281 +- .../msg/SpeedLimitCdrAux.hpp | 57 + .../msg/SpeedLimitCdrAux.ipp | 137 + .../msg/SpeedLimitPubSubTypes.cxx | 330 +- .../msg/SpeedLimitPubSubTypes.h | 148 +- .../msg/SpeedPubSubTypes.cxx | 314 +- .../etsi_its_cam_msgs/msg/SpeedPubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/SpeedValue.cxx | 106 +- .../etsi_its_cam_msgs/msg/SpeedValue.h | 285 +- .../msg/SpeedValueCdrAux.hpp | 61 + .../msg/SpeedValueCdrAux.ipp | 141 + .../msg/SpeedValuePubSubTypes.cxx | 336 +- .../msg/SpeedValuePubSubTypes.h | 150 +- .../etsi_its_cam_msgs/msg/StationID.cxx | 109 +- .../fastdds/etsi_its_cam_msgs/msg/StationID.h | 279 +- .../etsi_its_cam_msgs/msg/StationIDCdrAux.hpp | 55 + .../etsi_its_cam_msgs/msg/StationIDCdrAux.ipp | 135 + .../msg/StationIDPubSubTypes.cxx | 327 +- .../msg/StationIDPubSubTypes.h | 147 +- .../etsi_its_cam_msgs/msg/StationType.cxx | 114 +- .../etsi_its_cam_msgs/msg/StationType.h | 305 +- .../msg/StationTypeCdrAux.hpp | 81 + .../msg/StationTypeCdrAux.ipp | 161 + .../msg/StationTypePubSubTypes.cxx | 332 +- .../msg/StationTypePubSubTypes.h | 160 +- .../msg/SteeringWheelAngle.cxx | 123 +- .../msg/SteeringWheelAngle.h | 340 +- .../msg/SteeringWheelAngleCdrAux.hpp | 52 + .../msg/SteeringWheelAngleCdrAux.ipp | 138 + .../msg/SteeringWheelAngleConfidence.cxx | 106 +- .../msg/SteeringWheelAngleConfidence.h | 285 +- .../SteeringWheelAngleConfidenceCdrAux.hpp | 61 + .../SteeringWheelAngleConfidenceCdrAux.ipp | 141 + ...teeringWheelAngleConfidencePubSubTypes.cxx | 336 +- .../SteeringWheelAngleConfidencePubSubTypes.h | 150 +- .../msg/SteeringWheelAnglePubSubTypes.cxx | 314 +- .../msg/SteeringWheelAnglePubSubTypes.h | 140 +- .../msg/SteeringWheelAngleValue.cxx | 105 +- .../msg/SteeringWheelAngleValue.h | 287 +- .../msg/SteeringWheelAngleValueCdrAux.hpp | 63 + .../msg/SteeringWheelAngleValueCdrAux.ipp | 143 + .../SteeringWheelAngleValuePubSubTypes.cxx | 339 +- .../msg/SteeringWheelAngleValuePubSubTypes.h | 151 +- .../msg/SubCauseCodeType.cxx | 109 +- .../etsi_its_cam_msgs/msg/SubCauseCodeType.h | 279 +- .../msg/SubCauseCodeTypeCdrAux.hpp | 55 + .../msg/SubCauseCodeTypeCdrAux.ipp | 135 + .../msg/SubCauseCodeTypePubSubTypes.cxx | 327 +- .../msg/SubCauseCodeTypePubSubTypes.h | 147 +- .../etsi_its_cam_msgs/msg/TimestampIts.cxx | 107 +- .../etsi_its_cam_msgs/msg/TimestampIts.h | 283 +- .../msg/TimestampItsCdrAux.hpp | 59 + .../msg/TimestampItsCdrAux.ipp | 139 + .../msg/TimestampItsPubSubTypes.cxx | 333 +- .../msg/TimestampItsPubSubTypes.h | 149 +- .../etsi_its_cam_msgs/msg/TrafficRule.cxx | 107 +- .../etsi_its_cam_msgs/msg/TrafficRule.h | 283 +- .../msg/TrafficRuleCdrAux.hpp | 59 + .../msg/TrafficRuleCdrAux.ipp | 139 + .../msg/TrafficRulePubSubTypes.cxx | 333 +- .../msg/TrafficRulePubSubTypes.h | 149 +- .../etsi_its_cam_msgs/msg/VehicleLength.cxx | 123 +- .../etsi_its_cam_msgs/msg/VehicleLength.h | 340 +- .../msg/VehicleLengthCdrAux.hpp | 50 + .../msg/VehicleLengthCdrAux.ipp | 138 + .../msg/VehicleLengthConfidenceIndication.cxx | 106 +- .../msg/VehicleLengthConfidenceIndication.h | 285 +- ...ehicleLengthConfidenceIndicationCdrAux.hpp | 61 + ...ehicleLengthConfidenceIndicationCdrAux.ipp | 141 + ...eLengthConfidenceIndicationPubSubTypes.cxx | 336 +- ...cleLengthConfidenceIndicationPubSubTypes.h | 150 +- .../msg/VehicleLengthPubSubTypes.cxx | 314 +- .../msg/VehicleLengthPubSubTypes.h | 140 +- .../msg/VehicleLengthValue.cxx | 106 +- .../msg/VehicleLengthValue.h | 285 +- .../msg/VehicleLengthValueCdrAux.hpp | 61 + .../msg/VehicleLengthValueCdrAux.ipp | 141 + .../msg/VehicleLengthValuePubSubTypes.cxx | 336 +- .../msg/VehicleLengthValuePubSubTypes.h | 150 +- .../etsi_its_cam_msgs/msg/VehicleRole.cxx | 115 +- .../etsi_its_cam_msgs/msg/VehicleRole.h | 307 +- .../msg/VehicleRoleCdrAux.hpp | 83 + .../msg/VehicleRoleCdrAux.ipp | 163 + .../msg/VehicleRolePubSubTypes.cxx | 331 +- .../msg/VehicleRolePubSubTypes.h | 161 +- .../etsi_its_cam_msgs/msg/VehicleWidth.cxx | 106 +- .../etsi_its_cam_msgs/msg/VehicleWidth.h | 285 +- .../msg/VehicleWidthCdrAux.hpp | 61 + .../msg/VehicleWidthCdrAux.ipp | 141 + .../msg/VehicleWidthPubSubTypes.cxx | 336 +- .../msg/VehicleWidthPubSubTypes.h | 150 +- .../msg/VerticalAcceleration.cxx | 123 +- .../msg/VerticalAcceleration.h | 340 +- .../msg/VerticalAccelerationCdrAux.hpp | 50 + .../msg/VerticalAccelerationCdrAux.ipp | 138 + .../msg/VerticalAccelerationPubSubTypes.cxx | 314 +- .../msg/VerticalAccelerationPubSubTypes.h | 140 +- .../msg/VerticalAccelerationValue.cxx | 106 +- .../msg/VerticalAccelerationValue.h | 285 +- .../msg/VerticalAccelerationValueCdrAux.hpp | 61 + .../msg/VerticalAccelerationValueCdrAux.ipp | 141 + .../VerticalAccelerationValuePubSubTypes.cxx | 336 +- .../VerticalAccelerationValuePubSubTypes.h | 150 +- .../fastdds/etsi_its_cam_msgs/msg/YawRate.cxx | 123 +- .../fastdds/etsi_its_cam_msgs/msg/YawRate.h | 340 +- .../etsi_its_cam_msgs/msg/YawRateCdrAux.hpp | 52 + .../etsi_its_cam_msgs/msg/YawRateCdrAux.ipp | 138 + .../msg/YawRateConfidence.cxx | 108 +- .../etsi_its_cam_msgs/msg/YawRateConfidence.h | 293 +- .../msg/YawRateConfidenceCdrAux.hpp | 69 + .../msg/YawRateConfidenceCdrAux.ipp | 149 + .../msg/YawRateConfidencePubSubTypes.cxx | 348 +- .../msg/YawRateConfidencePubSubTypes.h | 154 +- .../msg/YawRatePubSubTypes.cxx | 314 +- .../msg/YawRatePubSubTypes.h | 140 +- .../etsi_its_cam_msgs/msg/YawRateValue.cxx | 105 +- .../etsi_its_cam_msgs/msg/YawRateValue.h | 287 +- .../msg/YawRateValueCdrAux.hpp | 63 + .../msg/YawRateValueCdrAux.ipp | 143 + .../msg/YawRateValuePubSubTypes.cxx | 339 +- .../msg/YawRateValuePubSubTypes.h | 151 +- .../source/carla/ros2/fastdds/fastcdr/Cdr.h | 6549 +++++++++-------- .../fastdds/fastcdr/CdrSizeCalculator.hpp | 1347 ++++ .../ros2/fastdds/geometry_msgs/msg/Accel.cxx | 123 +- .../ros2/fastdds/geometry_msgs/msg/Accel.h | 338 +- .../fastdds/geometry_msgs/msg/AccelCdrAux.hpp | 50 + .../fastdds/geometry_msgs/msg/AccelCdrAux.ipp | 138 + .../geometry_msgs/msg/AccelPubSubTypes.cxx | 314 +- .../geometry_msgs/msg/AccelPubSubTypes.h | 139 +- .../geometry_msgs/msg/AccelWithCovariance.cxx | 136 +- .../geometry_msgs/msg/AccelWithCovariance.h | 341 +- .../msg/AccelWithCovarianceCdrAux.hpp | 54 + .../msg/AccelWithCovarianceCdrAux.ipp | 140 + .../msg/AccelWithCovariancePubSubTypes.cxx | 317 +- .../msg/AccelWithCovariancePubSubTypes.h | 141 +- .../ros2/fastdds/geometry_msgs/msg/Point.cxx | 150 +- .../ros2/fastdds/geometry_msgs/msg/Point.h | 351 +- .../fastdds/geometry_msgs/msg/Point32.cxx | 150 +- .../ros2/fastdds/geometry_msgs/msg/Point32.h | 351 +- .../geometry_msgs/msg/Point32CdrAux.hpp | 50 + .../geometry_msgs/msg/Point32CdrAux.ipp | 146 + .../geometry_msgs/msg/Point32PubSubTypes.cxx | 314 +- .../geometry_msgs/msg/Point32PubSubTypes.h | 138 +- .../fastdds/geometry_msgs/msg/PointCdrAux.hpp | 50 + .../fastdds/geometry_msgs/msg/PointCdrAux.ipp | 146 + .../geometry_msgs/msg/PointPubSubTypes.cxx | 314 +- .../geometry_msgs/msg/PointPubSubTypes.h | 138 +- .../fastdds/geometry_msgs/msg/Polygon.cxx | 115 +- .../ros2/fastdds/geometry_msgs/msg/Polygon.h | 286 +- .../geometry_msgs/msg/PolygonCdrAux.hpp | 52 + .../geometry_msgs/msg/PolygonCdrAux.ipp | 132 + .../geometry_msgs/msg/PolygonPubSubTypes.cxx | 316 +- .../geometry_msgs/msg/PolygonPubSubTypes.h | 141 +- .../ros2/fastdds/geometry_msgs/msg/Pose.cxx | 123 +- .../ros2/fastdds/geometry_msgs/msg/Pose.h | 340 +- .../fastdds/geometry_msgs/msg/PoseCdrAux.hpp | 52 + .../fastdds/geometry_msgs/msg/PoseCdrAux.ipp | 138 + .../geometry_msgs/msg/PosePubSubTypes.cxx | 314 +- .../geometry_msgs/msg/PosePubSubTypes.h | 140 +- .../geometry_msgs/msg/PoseWithCovariance.cxx | 136 +- .../geometry_msgs/msg/PoseWithCovariance.h | 341 +- .../msg/PoseWithCovarianceCdrAux.hpp | 53 + .../msg/PoseWithCovarianceCdrAux.ipp | 140 + .../msg/PoseWithCovariancePubSubTypes.cxx | 317 +- .../msg/PoseWithCovariancePubSubTypes.h | 141 +- .../fastdds/geometry_msgs/msg/Quaternion.cxx | 167 +- .../fastdds/geometry_msgs/msg/Quaternion.h | 392 +- .../geometry_msgs/msg/QuaternionCdrAux.hpp | 50 + .../geometry_msgs/msg/QuaternionCdrAux.ipp | 154 + .../msg/QuaternionPubSubTypes.cxx | 314 +- .../geometry_msgs/msg/QuaternionPubSubTypes.h | 138 +- .../fastdds/geometry_msgs/msg/Transform.cxx | 114 +- .../fastdds/geometry_msgs/msg/Transform.h | 311 +- .../geometry_msgs/msg/TransformCdrAux.hpp | 51 + .../geometry_msgs/msg/TransformCdrAux.ipp | 138 + .../msg/TransformPubSubTypes.cxx | 314 +- .../geometry_msgs/msg/TransformPubSubTypes.h | 131 +- .../geometry_msgs/msg/TransformStamped.cxx | 139 +- .../geometry_msgs/msg/TransformStamped.h | 363 +- .../msg/TransformStampedCdrAux.hpp | 52 + .../msg/TransformStampedCdrAux.ipp | 146 + .../msg/TransformStampedPubSubTypes.cxx | 314 +- .../msg/TransformStampedPubSubTypes.h | 104 +- .../ros2/fastdds/geometry_msgs/msg/Twist.cxx | 123 +- .../ros2/fastdds/geometry_msgs/msg/Twist.h | 338 +- .../fastdds/geometry_msgs/msg/TwistCdrAux.hpp | 50 + .../fastdds/geometry_msgs/msg/TwistCdrAux.ipp | 138 + .../geometry_msgs/msg/TwistPubSubTypes.cxx | 314 +- .../geometry_msgs/msg/TwistPubSubTypes.h | 139 +- .../geometry_msgs/msg/TwistWithCovariance.cxx | 136 +- .../geometry_msgs/msg/TwistWithCovariance.h | 341 +- .../msg/TwistWithCovarianceCdrAux.hpp | 55 + .../msg/TwistWithCovarianceCdrAux.ipp | 140 + .../msg/TwistWithCovariancePubSubTypes.cxx | 317 +- .../msg/TwistWithCovariancePubSubTypes.h | 141 +- .../fastdds/geometry_msgs/msg/Vector3.cxx | 150 +- .../ros2/fastdds/geometry_msgs/msg/Vector3.h | 351 +- .../geometry_msgs/msg/Vector3CdrAux.hpp | 50 + .../geometry_msgs/msg/Vector3CdrAux.ipp | 146 + .../geometry_msgs/msg/Vector3PubSubTypes.cxx | 314 +- .../geometry_msgs/msg/Vector3PubSubTypes.h | 138 +- .../ros2/fastdds/nav_msgs/msg/Odometry.cxx | 161 +- .../ros2/fastdds/nav_msgs/msg/Odometry.h | 417 +- .../fastdds/nav_msgs/msg/OdometryCdrAux.hpp | 57 + .../fastdds/nav_msgs/msg/OdometryCdrAux.ipp | 154 + .../nav_msgs/msg/OdometryPubSubTypes.cxx | 314 +- .../nav_msgs/msg/OdometryPubSubTypes.h | 106 +- .../fastdds/post_process_generated_files.bash | 25 + .../ros2/fastdds/rosgraph_msgs/msg/Clock.cxx | 109 +- .../ros2/fastdds/rosgraph_msgs/msg/Clock.h | 255 +- .../fastdds/rosgraph_msgs/msg/ClockCdrAux.hpp | 50 + .../fastdds/rosgraph_msgs/msg/ClockCdrAux.ipp | 130 + .../rosgraph_msgs/msg/ClockPubSubTypes.cxx | 318 +- .../rosgraph_msgs/msg/ClockPubSubTypes.h | 114 +- .../fastdds/sensor_msgs/msg/CameraInfo.cxx | 307 +- .../ros2/fastdds/sensor_msgs/msg/CameraInfo.h | 727 +- .../sensor_msgs/msg/CameraInfoCdrAux.hpp | 57 + .../sensor_msgs/msg/CameraInfoCdrAux.ipp | 214 + .../sensor_msgs/msg/CameraInfoPubSubTypes.cxx | 318 +- .../sensor_msgs/msg/CameraInfoPubSubTypes.h | 106 +- .../ros2/fastdds/sensor_msgs/msg/Image.cc | 360 +- .../ros2/fastdds/sensor_msgs/msg/Image.h | 533 +- .../fastdds/sensor_msgs/msg/ImageCdrAux.cxx | 180 + .../fastdds/sensor_msgs/msg/ImageCdrAux.hpp | 53 + .../sensor_msgs/msg/ImageCdrAuxFromBuffer.cxx | 180 + .../sensor_msgs/msg/ImagePubSubTypes.cc | 247 +- .../sensor_msgs/msg/ImagePubSubTypes.h | 114 +- .../ros2/fastdds/sensor_msgs/msg/Imu.cxx | 204 +- .../carla/ros2/fastdds/sensor_msgs/msg/Imu.h | 583 +- .../fastdds/sensor_msgs/msg/ImuCdrAux.hpp | 52 + .../fastdds/sensor_msgs/msg/ImuCdrAux.ipp | 180 + .../sensor_msgs/msg/ImuPubSubTypes.cxx | 317 +- .../fastdds/sensor_msgs/msg/ImuPubSubTypes.h | 109 +- .../fastdds/sensor_msgs/msg/NavSatFix.cxx | 192 +- .../ros2/fastdds/sensor_msgs/msg/NavSatFix.h | 539 +- .../sensor_msgs/msg/NavSatFixCdrAux.hpp | 61 + .../sensor_msgs/msg/NavSatFixCdrAux.ipp | 189 + .../sensor_msgs/msg/NavSatFixPubSubTypes.cxx | 328 +- .../sensor_msgs/msg/NavSatFixPubSubTypes.h | 119 +- .../fastdds/sensor_msgs/msg/NavSatStatus.cxx | 116 +- .../fastdds/sensor_msgs/msg/NavSatStatus.h | 303 +- .../sensor_msgs/msg/NavSatStatusCdrAux.hpp | 71 + .../sensor_msgs/msg/NavSatStatusCdrAux.ipp | 159 + .../msg/NavSatStatusPubSubTypes.cxx | 338 +- .../sensor_msgs/msg/NavSatStatusPubSubTypes.h | 148 +- .../fastdds/sensor_msgs/msg/PointCloud2.cc | 487 -- .../fastdds/sensor_msgs/msg/PointCloud2.cxx | 433 ++ .../fastdds/sensor_msgs/msg/PointCloud2.h | 608 +- .../sensor_msgs/msg/PointCloud2CdrAux.hpp | 51 + .../sensor_msgs/msg/PointCloud2CdrAux.ipp | 194 + .../sensor_msgs/msg/PointCloud2PubSubTypes.cc | 150 - .../msg/PointCloud2PubSubTypes.cxx | 198 + .../sensor_msgs/msg/PointCloud2PubSubTypes.h | 112 +- .../fastdds/sensor_msgs/msg/PointField.cxx | 141 +- .../ros2/fastdds/sensor_msgs/msg/PointField.h | 392 +- .../sensor_msgs/msg/PointFieldCdrAux.hpp | 67 + .../sensor_msgs/msg/PointFieldCdrAux.ipp | 171 + .../sensor_msgs/msg/PointFieldPubSubTypes.cxx | 334 +- .../sensor_msgs/msg/PointFieldPubSubTypes.h | 125 +- .../sensor_msgs/msg/RegionOfInterest.cxx | 149 +- .../sensor_msgs/msg/RegionOfInterest.h | 393 +- .../msg/RegionOfInterestCdrAux.hpp | 50 + .../msg/RegionOfInterestCdrAux.ipp | 162 + .../msg/RegionOfInterestPubSubTypes.cxx | 314 +- .../msg/RegionOfInterestPubSubTypes.h | 125 +- .../fastdds/shape_msgs/msg/SolidPrimitive.cxx | 164 +- .../fastdds/shape_msgs/msg/SolidPrimitive.h | 351 +- .../shape_msgs/msg/SolidPrimitiveCdrAux.hpp | 79 + .../shape_msgs/msg/SolidPrimitiveCdrAux.ipp | 175 + .../msg/SolidPrimitivePubSubTypes.cxx | 331 +- .../msg/SolidPrimitivePubSubTypes.h | 138 +- .../carla/ros2/fastdds/std_msgs/msg/Bool.cxx | 183 - .../carla/ros2/fastdds/std_msgs/msg/Bool.h | 210 - .../fastdds/std_msgs/msg/BoolPubSubTypes.cxx | 176 - .../fastdds/std_msgs/msg/BoolPubSubTypes.h | 107 - .../ros2/fastdds/std_msgs/msg/Float32.cxx | 91 +- .../carla/ros2/fastdds/std_msgs/msg/Float32.h | 241 +- .../fastdds/std_msgs/msg/Float32CdrAux.hpp | 50 + .../fastdds/std_msgs/msg/Float32CdrAux.ipp | 130 + .../std_msgs/msg/Float32PubSubTypes.cxx | 314 +- .../fastdds/std_msgs/msg/Float32PubSubTypes.h | 127 +- .../ros2/fastdds/std_msgs/msg/Header.cxx | 129 +- .../carla/ros2/fastdds/std_msgs/msg/Header.h | 307 +- .../fastdds/std_msgs/msg/HeaderCdrAux.hpp | 50 + .../fastdds/std_msgs/msg/HeaderCdrAux.ipp | 138 + .../std_msgs/msg/HeaderPubSubTypes.cxx | 316 +- .../fastdds/std_msgs/msg/HeaderPubSubTypes.h | 109 +- .../ros2/fastdds/std_msgs/msg/String.cxx | 173 - .../carla/ros2/fastdds/std_msgs/msg/String.h | 196 - .../std_msgs/msg/StringPubSubTypes.cxx | 172 - .../fastdds/std_msgs/msg/StringPubSubTypes.h | 91 - .../ros2/fastdds/tf2_msgs/msg/TF2Error.cxx | 211 - .../ros2/fastdds/tf2_msgs/msg/TF2Error.h | 222 - .../tf2_msgs/msg/TF2ErrorPubSubTypes.cxx | 172 - .../tf2_msgs/msg/TF2ErrorPubSubTypes.h | 90 - .../ros2/fastdds/tf2_msgs/msg/TFMessage.cxx | 115 +- .../ros2/fastdds/tf2_msgs/msg/TFMessage.h | 259 +- .../fastdds/tf2_msgs/msg/TFMessageCdrAux.hpp | 55 + .../fastdds/tf2_msgs/msg/TFMessageCdrAux.ipp | 132 + .../tf2_msgs/msg/TFMessagePubSubTypes.cxx | 316 +- .../tf2_msgs/msg/TFMessagePubSubTypes.h | 107 +- .../carla/ros2/publishers/ClockPublisher.h | 2 +- .../ros2/publishers/UeDVSCameraPublisher.cpp | 10 +- .../ros2/publishers/UeLidarPublisher.cpp | 8 +- .../ros2/publishers/UePublisherBaseCamera.cc | 37 +- .../ros2/publishers/UePublisherBaseCamera.h | 2 + .../ros2/publishers/UeRadarPublisher.cpp | 14 +- .../publishers/UeSemanticLidarPublisher.cpp | 12 +- Util/BuildTools/Setup.sh | 4 +- 1033 files changed, 121818 insertions(+), 94223 deletions(-) create mode 100644 LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsCdrAux.ipp delete mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventCdrAux.ipp delete mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStateCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStateCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayCdrAux.ipp delete mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessageCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessageCdrAux.ipp delete mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectCdrAux.ipp create mode 100755 LibCarla/source/carla/ros2/fastdds/clean_idl_file.bash create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovarianceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovarianceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidenceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidenceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidenceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidenceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidenceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidenceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidenceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidenceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUseCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUseCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipseCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipseCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZoneCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZoneCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidenceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidenceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidenceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidenceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypeCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypeCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRuleCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRuleCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRoleCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRoleCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidenceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidenceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValueCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValueCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/fastcdr/CdrSizeCalculator.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovarianceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovarianceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32CdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32CdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovarianceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovarianceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovarianceCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovarianceCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3CdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3CdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryCdrAux.ipp create mode 100755 LibCarla/source/carla/ros2/fastdds/post_process_generated_files.bash create mode 100644 LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAux.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAuxFromBuffer.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusCdrAux.ipp delete mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cc create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2CdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2CdrAux.ipp delete mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cc create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cxx create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestCdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitiveCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitiveCdrAux.ipp delete mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.h delete mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32CdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32CdrAux.ipp create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderCdrAux.ipp delete mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.h delete mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.h delete mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.h delete mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.cxx delete mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.h create mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessageCdrAux.hpp create mode 100644 LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessageCdrAux.ipp diff --git a/CHANGELOG.md b/CHANGELOG.md index dea91a909f0..5ab9813df8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Added support for parsing offsets from OpenDRIVE using optional offset transforms. * Added ad-rss type-stubs for the PythonAPI when building with RSS support * ROS2Native: Extended functionality and performance of ROS2 support + * ROS2Native: Update to fastdds 2.14.6 ## CARLA 0.9.16 diff --git a/LibCarla/source/carla/ros2/fastdds/README.md b/LibCarla/source/carla/ros2/fastdds/README.md index 2c44c1746aa..35ed0ba8d15 100644 --- a/LibCarla/source/carla/ros2/fastdds/README.md +++ b/LibCarla/source/carla/ros2/fastdds/README.md @@ -6,15 +6,23 @@ To update the types within this folder one has to: * install ROS2 on the system and all message dependencies of the carla_msgs (see ros-carla-msgs docu) * in case the carla msg files are changed: - build the ROS2 package of the carla_msgs - - copy the idl files from the build folder into the respective carla_msgs folder - - revert the removal of "#pragma once" line within the overridden idls - - add "#pragma once" directive to newly created idls + - clean the idl files by calling the clean_idl_file.bash script on the files e.g. + ```find install/carla_msgs -name "*.idl" -exec clean_idl_file.bash {} \;``` + - the cleaning adds "#pragma once" directive if not yet present to prevent from multiple including the files * To have all relevant files beeing placed in the correct subfolders by the code generator it is best practice to copy the carla_msgs folder in parallel to the other folders of your ROS2 system first and execute the generator from the respective ROS2 folder e.g. ``` sudo cp -r carla_msgs /opt/ros//share - Fast-DDS-GEN/scripts/fastddsgen -d /output-code -I /opt/ros//share/ -typeros2 carla_msgs/msg/*.idl + cd /opt/ros//share + Fast-DDS-GEN/scripts/fastddsgen -d /output-code -I /opt/ros//share/ -typeros2 ackermann_msgs/msg/AckermannDrive.idl nav_msgs/msg/Odometry.idl std_msgs/msg/Float32.idl sensor_msgs/msg/NavSatFix.idl sensor_msgs/msg/Imu.idl sensor_msgs/msg/PointCloud2.idl sensor_msgs/msg/Image.idl sensor_msgs/msg/CameraInfo.idl tf2_msgs/msg/TFMessage.idl derived_object_msgs/msg/ObjectWithCovarianceArray.idl rosgraph_msgs/msg/Clock.idl derived_object_msgs/msg/ObjectArray.idl rosgraph_msgs/msg/Clock.idl carla_msgs/msg/*idl carla_msgs/srv/*idl ``` - In case you get errors in some of the idl files: add "#pragma once" directive to those idls to ensure they are only included once by the generator. * In some cases you will have to rename variables because of name clashes within different sub-namespaces which the fastddsgen generator is not able to - distiguish. Easiest workaround for variables is placing a "_" in front of the name, so the output will be the same as expected. On class files append e.g. "BLABLA" and later perform a search and replace. Alternatively wait until the generator is fixed and works properly + distiguish. Easiest workaround for variables is adding suffixes e.g. "BLABLA" to the class and/or variable names and later perform a search and replace. + You might want to run the post_process_generated_file.sh within the generated code directory to take care on some issues observed with FastDDS generator 4.0.5 (including the BLABLA change). + Finally, you might face some linker issues, because the clashes within the idl files transfer partially into the C++ files, where you might have to move some functions into proper namespaces(i.e register_double__36_type_identifier and register_double__9_type_identifier). + Alternatively use the ros idl creation toolchain or wait until the generator is fixed and works properly. + * When switching to a new version of FastCdr, one has to keep in mind, that the generated files of the image-type have been adapted to allow for other allocators (i.e. carla::sensor::data::SerializerVectorAllocator) for the vector type to support copyless passing the memory rendered within Unreal to the deserialization function. That also required to extend the fastcdr header files located in the fastcdr subdirectory. But that implementation effort seemed worth for the sake of speed on image transfer. + + + + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.cxx b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.cxx index 8688c1a6e49..2ad8100259d 100644 --- a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.cxx +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.cxx @@ -14,9 +14,9 @@ /*! * @file AckermannDrive.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,37 +27,31 @@ char dummy; #endif // _WIN32 #include "AckermannDrive.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -ackermann_msgs::msg::AckermannDrive::AckermannDrive() -{ - // m_steering_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2654635 - m_steering_angle = 0.0; - // m_steering_angle_velocity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@737a135b - m_steering_angle_velocity = 0.0; - // m_speed com.eprosima.idl.parser.typecode.PrimitiveTypeCode@687ef2e0 - m_speed = 0.0; - // m_acceleration com.eprosima.idl.parser.typecode.PrimitiveTypeCode@15dcfae7 - m_acceleration = 0.0; - // m_jerk com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3da05287 - m_jerk = 0.0; -} +namespace ackermann_msgs { -ackermann_msgs::msg::AckermannDrive::~AckermannDrive() -{ +namespace msg { +AckermannDrive::AckermannDrive() +{ +} +AckermannDrive::~AckermannDrive() +{ } -ackermann_msgs::msg::AckermannDrive::AckermannDrive( +AckermannDrive::AckermannDrive( const AckermannDrive& x) { m_steering_angle = x.m_steering_angle; @@ -67,8 +61,8 @@ ackermann_msgs::msg::AckermannDrive::AckermannDrive( m_jerk = x.m_jerk; } -ackermann_msgs::msg::AckermannDrive::AckermannDrive( - AckermannDrive&& x) +AckermannDrive::AckermannDrive( + AckermannDrive&& x) noexcept { m_steering_angle = x.m_steering_angle; m_steering_angle_velocity = x.m_steering_angle_velocity; @@ -77,7 +71,7 @@ ackermann_msgs::msg::AckermannDrive::AckermannDrive( m_jerk = x.m_jerk; } -ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDrive::operator =( +AckermannDrive& AckermannDrive::operator =( const AckermannDrive& x) { @@ -86,12 +80,11 @@ ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDrive::operat m_speed = x.m_speed; m_acceleration = x.m_acceleration; m_jerk = x.m_jerk; - return *this; } -ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDrive::operator =( - AckermannDrive&& x) +AckermannDrive& AckermannDrive::operator =( + AckermannDrive&& x) noexcept { m_steering_angle = x.m_steering_angle; @@ -99,103 +92,30 @@ ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDrive::operat m_speed = x.m_speed; m_acceleration = x.m_acceleration; m_jerk = x.m_jerk; - return *this; } -bool ackermann_msgs::msg::AckermannDrive::operator ==( +bool AckermannDrive::operator ==( const AckermannDrive& x) const { - - return (m_steering_angle == x.m_steering_angle && m_steering_angle_velocity == x.m_steering_angle_velocity && m_speed == x.m_speed && m_acceleration == x.m_acceleration && m_jerk == x.m_jerk); + return (m_steering_angle == x.m_steering_angle && + m_steering_angle_velocity == x.m_steering_angle_velocity && + m_speed == x.m_speed && + m_acceleration == x.m_acceleration && + m_jerk == x.m_jerk); } -bool ackermann_msgs::msg::AckermannDrive::operator !=( +bool AckermannDrive::operator !=( const AckermannDrive& x) const { return !(*this == x); } -size_t ackermann_msgs::msg::AckermannDrive::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -size_t ackermann_msgs::msg::AckermannDrive::getCdrSerializedSize( - const ackermann_msgs::msg::AckermannDrive& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void ackermann_msgs::msg::AckermannDrive::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_steering_angle; - scdr << m_steering_angle_velocity; - scdr << m_speed; - scdr << m_acceleration; - scdr << m_jerk; - -} - -void ackermann_msgs::msg::AckermannDrive::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_steering_angle; - dcdr >> m_steering_angle_velocity; - dcdr >> m_speed; - dcdr >> m_acceleration; - dcdr >> m_jerk; -} - /*! * @brief This function sets a value in member steering_angle * @param _steering_angle New value for member steering_angle */ -void ackermann_msgs::msg::AckermannDrive::steering_angle( +void AckermannDrive::steering_angle( float _steering_angle) { m_steering_angle = _steering_angle; @@ -205,7 +125,7 @@ void ackermann_msgs::msg::AckermannDrive::steering_angle( * @brief This function returns the value of member steering_angle * @return Value of member steering_angle */ -float ackermann_msgs::msg::AckermannDrive::steering_angle() const +float AckermannDrive::steering_angle() const { return m_steering_angle; } @@ -214,16 +134,17 @@ float ackermann_msgs::msg::AckermannDrive::steering_angle() const * @brief This function returns a reference to member steering_angle * @return Reference to member steering_angle */ -float& ackermann_msgs::msg::AckermannDrive::steering_angle() +float& AckermannDrive::steering_angle() { return m_steering_angle; } + /*! * @brief This function sets a value in member steering_angle_velocity * @param _steering_angle_velocity New value for member steering_angle_velocity */ -void ackermann_msgs::msg::AckermannDrive::steering_angle_velocity( +void AckermannDrive::steering_angle_velocity( float _steering_angle_velocity) { m_steering_angle_velocity = _steering_angle_velocity; @@ -233,7 +154,7 @@ void ackermann_msgs::msg::AckermannDrive::steering_angle_velocity( * @brief This function returns the value of member steering_angle_velocity * @return Value of member steering_angle_velocity */ -float ackermann_msgs::msg::AckermannDrive::steering_angle_velocity() const +float AckermannDrive::steering_angle_velocity() const { return m_steering_angle_velocity; } @@ -242,16 +163,17 @@ float ackermann_msgs::msg::AckermannDrive::steering_angle_velocity() const * @brief This function returns a reference to member steering_angle_velocity * @return Reference to member steering_angle_velocity */ -float& ackermann_msgs::msg::AckermannDrive::steering_angle_velocity() +float& AckermannDrive::steering_angle_velocity() { return m_steering_angle_velocity; } + /*! * @brief This function sets a value in member speed * @param _speed New value for member speed */ -void ackermann_msgs::msg::AckermannDrive::speed( +void AckermannDrive::speed( float _speed) { m_speed = _speed; @@ -261,7 +183,7 @@ void ackermann_msgs::msg::AckermannDrive::speed( * @brief This function returns the value of member speed * @return Value of member speed */ -float ackermann_msgs::msg::AckermannDrive::speed() const +float AckermannDrive::speed() const { return m_speed; } @@ -270,16 +192,17 @@ float ackermann_msgs::msg::AckermannDrive::speed() const * @brief This function returns a reference to member speed * @return Reference to member speed */ -float& ackermann_msgs::msg::AckermannDrive::speed() +float& AckermannDrive::speed() { return m_speed; } + /*! * @brief This function sets a value in member acceleration * @param _acceleration New value for member acceleration */ -void ackermann_msgs::msg::AckermannDrive::acceleration( +void AckermannDrive::acceleration( float _acceleration) { m_acceleration = _acceleration; @@ -289,7 +212,7 @@ void ackermann_msgs::msg::AckermannDrive::acceleration( * @brief This function returns the value of member acceleration * @return Value of member acceleration */ -float ackermann_msgs::msg::AckermannDrive::acceleration() const +float AckermannDrive::acceleration() const { return m_acceleration; } @@ -298,16 +221,17 @@ float ackermann_msgs::msg::AckermannDrive::acceleration() const * @brief This function returns a reference to member acceleration * @return Reference to member acceleration */ -float& ackermann_msgs::msg::AckermannDrive::acceleration() +float& AckermannDrive::acceleration() { return m_acceleration; } + /*! * @brief This function sets a value in member jerk * @param _jerk New value for member jerk */ -void ackermann_msgs::msg::AckermannDrive::jerk( +void AckermannDrive::jerk( float _jerk) { m_jerk = _jerk; @@ -317,7 +241,7 @@ void ackermann_msgs::msg::AckermannDrive::jerk( * @brief This function returns the value of member jerk * @return Value of member jerk */ -float ackermann_msgs::msg::AckermannDrive::jerk() const +float AckermannDrive::jerk() const { return m_jerk; } @@ -326,32 +250,18 @@ float ackermann_msgs::msg::AckermannDrive::jerk() const * @brief This function returns a reference to member jerk * @return Reference to member jerk */ -float& ackermann_msgs::msg::AckermannDrive::jerk() +float& AckermannDrive::jerk() { return m_jerk; } -size_t ackermann_msgs::msg::AckermannDrive::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} - -bool ackermann_msgs::msg::AckermannDrive::isKeyDefined() -{ - return false; -} +} // namespace msg -void ackermann_msgs::msg::AckermannDrive::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace ackermann_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AckermannDriveCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.h b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.h index 9d0e123cf05..c5b482ec3e2 100644 --- a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.h +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrive.h @@ -16,22 +16,28 @@ * @file AckermannDrive.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ #define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ -#include #include #include +#include #include #include #include +#include +#include +#include + + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -41,224 +47,207 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(AckermannDrive_SOURCE) -#define AckermannDrive_DllAPI __declspec(dllexport) +#if defined(ACKERMANNDRIVE_SOURCE) +#define ACKERMANNDRIVE_DllAPI __declspec( dllexport ) #else -#define AckermannDrive_DllAPI __declspec(dllimport) -#endif // AckermannDrive_SOURCE +#define ACKERMANNDRIVE_DllAPI __declspec( dllimport ) +#endif // ACKERMANNDRIVE_SOURCE #else -#define AckermannDrive_DllAPI +#define ACKERMANNDRIVE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define AckermannDrive_DllAPI -#endif // _WIN32 +#define ACKERMANNDRIVE_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace ackermann_msgs { + namespace msg { + + + /*! * @brief This class represents the structure AckermannDrive defined by the user in the IDL file. - * @ingroup ACKERMANNDRIVE + * @ingroup AckermannDrive */ -class AckermannDrive { +class AckermannDrive +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AckermannDrive(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AckermannDrive(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. - */ - eProsima_user_DllExport AckermannDrive(const AckermannDrive& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. - */ - eProsima_user_DllExport AckermannDrive(AckermannDrive&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. - */ - eProsima_user_DllExport AckermannDrive& operator=(const AckermannDrive& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. - */ - eProsima_user_DllExport AckermannDrive& operator=(AckermannDrive&& x); - - /*! - * @brief Comparison operator. - * @param x ackermann_msgs::msg::AckermannDrive object to compare. - */ - eProsima_user_DllExport bool operator==(const AckermannDrive& x) const; - - /*! - * @brief Comparison operator. - * @param x ackermann_msgs::msg::AckermannDrive object to compare. - */ - eProsima_user_DllExport bool operator!=(const AckermannDrive& x) const; - - /*! - * @brief This function sets a value in member steering_angle - * @param _steering_angle New value for member steering_angle - */ - eProsima_user_DllExport void steering_angle(float _steering_angle); - - /*! - * @brief This function returns the value of member steering_angle - * @return Value of member steering_angle - */ - eProsima_user_DllExport float steering_angle() const; - - /*! - * @brief This function returns a reference to member steering_angle - * @return Reference to member steering_angle - */ - eProsima_user_DllExport float& steering_angle(); - - /*! - * @brief This function sets a value in member steering_angle_velocity - * @param _steering_angle_velocity New value for member steering_angle_velocity - */ - eProsima_user_DllExport void steering_angle_velocity(float _steering_angle_velocity); - - /*! - * @brief This function returns the value of member steering_angle_velocity - * @return Value of member steering_angle_velocity - */ - eProsima_user_DllExport float steering_angle_velocity() const; - - /*! - * @brief This function returns a reference to member steering_angle_velocity - * @return Reference to member steering_angle_velocity - */ - eProsima_user_DllExport float& steering_angle_velocity(); - - /*! - * @brief This function sets a value in member speed - * @param _speed New value for member speed - */ - eProsima_user_DllExport void speed(float _speed); - - /*! - * @brief This function returns the value of member speed - * @return Value of member speed - */ - eProsima_user_DllExport float speed() const; - - /*! - * @brief This function returns a reference to member speed - * @return Reference to member speed - */ - eProsima_user_DllExport float& speed(); - - /*! - * @brief This function sets a value in member acceleration - * @param _acceleration New value for member acceleration - */ - eProsima_user_DllExport void acceleration(float _acceleration); - - /*! - * @brief This function returns the value of member acceleration - * @return Value of member acceleration - */ - eProsima_user_DllExport float acceleration() const; - - /*! - * @brief This function returns a reference to member acceleration - * @return Reference to member acceleration - */ - eProsima_user_DllExport float& acceleration(); - - /*! - * @brief This function sets a value in member jerk - * @param _jerk New value for member jerk - */ - eProsima_user_DllExport void jerk(float _jerk); - - /*! - * @brief This function returns the value of member jerk - * @return Value of member jerk - */ - eProsima_user_DllExport float jerk() const; - - /*! - * @brief This function returns a reference to member jerk - * @return Reference to member jerk - */ - eProsima_user_DllExport float& jerk(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const ackermann_msgs::msg::AckermannDrive& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AckermannDrive(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AckermannDrive(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. + */ + eProsima_user_DllExport AckermannDrive( + const AckermannDrive& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. + */ + eProsima_user_DllExport AckermannDrive( + AckermannDrive&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. + */ + eProsima_user_DllExport AckermannDrive& operator =( + const AckermannDrive& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ackermann_msgs::msg::AckermannDrive that will be copied. + */ + eProsima_user_DllExport AckermannDrive& operator =( + AckermannDrive&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ackermann_msgs::msg::AckermannDrive object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AckermannDrive& x) const; + + /*! + * @brief Comparison operator. + * @param x ackermann_msgs::msg::AckermannDrive object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AckermannDrive& x) const; + + /*! + * @brief This function sets a value in member steering_angle + * @param _steering_angle New value for member steering_angle + */ + eProsima_user_DllExport void steering_angle( + float _steering_angle); + + /*! + * @brief This function returns the value of member steering_angle + * @return Value of member steering_angle + */ + eProsima_user_DllExport float steering_angle() const; + + /*! + * @brief This function returns a reference to member steering_angle + * @return Reference to member steering_angle + */ + eProsima_user_DllExport float& steering_angle(); + + + /*! + * @brief This function sets a value in member steering_angle_velocity + * @param _steering_angle_velocity New value for member steering_angle_velocity + */ + eProsima_user_DllExport void steering_angle_velocity( + float _steering_angle_velocity); + + /*! + * @brief This function returns the value of member steering_angle_velocity + * @return Value of member steering_angle_velocity + */ + eProsima_user_DllExport float steering_angle_velocity() const; + + /*! + * @brief This function returns a reference to member steering_angle_velocity + * @return Reference to member steering_angle_velocity + */ + eProsima_user_DllExport float& steering_angle_velocity(); + + + /*! + * @brief This function sets a value in member speed + * @param _speed New value for member speed + */ + eProsima_user_DllExport void speed( + float _speed); + + /*! + * @brief This function returns the value of member speed + * @return Value of member speed + */ + eProsima_user_DllExport float speed() const; + + /*! + * @brief This function returns a reference to member speed + * @return Reference to member speed + */ + eProsima_user_DllExport float& speed(); + + + /*! + * @brief This function sets a value in member acceleration + * @param _acceleration New value for member acceleration + */ + eProsima_user_DllExport void acceleration( + float _acceleration); + + /*! + * @brief This function returns the value of member acceleration + * @return Value of member acceleration + */ + eProsima_user_DllExport float acceleration() const; + + /*! + * @brief This function returns a reference to member acceleration + * @return Reference to member acceleration + */ + eProsima_user_DllExport float& acceleration(); + + + /*! + * @brief This function sets a value in member jerk + * @param _jerk New value for member jerk + */ + eProsima_user_DllExport void jerk( + float _jerk); + + /*! + * @brief This function returns the value of member jerk + * @return Value of member jerk + */ + eProsima_user_DllExport float jerk() const; + + /*! + * @brief This function returns a reference to member jerk + * @return Reference to member jerk + */ + eProsima_user_DllExport float& jerk(); private: - float m_steering_angle; - float m_steering_angle_velocity; - float m_speed; - float m_acceleration; - float m_jerk; + + float m_steering_angle{0.0}; + float m_steering_angle_velocity{0.0}; + float m_speed{0.0}; + float m_acceleration{0.0}; + float m_jerk{0.0}; + }; -} // namespace msg -} // namespace ackermann_msgs -#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ \ No newline at end of file +} // namespace msg + +} // namespace ackermann_msgs + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveCdrAux.hpp new file mode 100644 index 00000000000..290f810a4a7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AckermannDriveCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVECDRAUX_HPP_ + +#include "AckermannDrive.h" + +constexpr uint32_t ackermann_msgs_msg_AckermannDrive_max_cdr_typesize {24UL}; +constexpr uint32_t ackermann_msgs_msg_AckermannDrive_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const ackermann_msgs::msg::AckermannDrive& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveCdrAux.ipp new file mode 100644 index 00000000000..ee5fc67f163 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveCdrAux.ipp @@ -0,0 +1,162 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AckermannDriveCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVECDRAUX_IPP_ + +#include "AckermannDriveCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const ackermann_msgs::msg::AckermannDrive& data, + size_t& current_alignment) +{ + using namespace ackermann_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.steering_angle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.steering_angle_velocity(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.speed(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.acceleration(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.jerk(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const ackermann_msgs::msg::AckermannDrive& data) +{ + using namespace ackermann_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.steering_angle() + << eprosima::fastcdr::MemberId(1) << data.steering_angle_velocity() + << eprosima::fastcdr::MemberId(2) << data.speed() + << eprosima::fastcdr::MemberId(3) << data.acceleration() + << eprosima::fastcdr::MemberId(4) << data.jerk() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + ackermann_msgs::msg::AckermannDrive& data) +{ + using namespace ackermann_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.steering_angle(); + break; + + case 1: + dcdr >> data.steering_angle_velocity(); + break; + + case 2: + dcdr >> data.speed(); + break; + + case 3: + dcdr >> data.acceleration(); + break; + + case 4: + dcdr >> data.jerk(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const ackermann_msgs::msg::AckermannDrive& data) +{ + using namespace ackermann_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.cxx index 1938057b3ab..42fa2df5172 100644 --- a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file AckermannDrivePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AckermannDrivePubSubTypes.h" +#include "AckermannDriveCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace ackermann_msgs { - namespace msg { - AckermannDrivePubSubType::AckermannDrivePubSubType() - { - setName("ackermann_msgs::msg::dds_::AckermannDrive_"); - auto type_size = AckermannDrive::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = AckermannDrive::isKeyDefined(); - size_t keyLength = AckermannDrive::getKeyMaxCdrSerializedSize() > 16 ? - AckermannDrive::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - AckermannDrivePubSubType::~AckermannDrivePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool AckermannDrivePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - AckermannDrive* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AckermannDrivePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - AckermannDrive* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AckermannDrivePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AckermannDrivePubSubType::createData() - { - return reinterpret_cast(new AckermannDrive()); - } - - void AckermannDrivePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AckermannDrivePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - AckermannDrive* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AckermannDrive::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || AckermannDrive::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +AckermannDrivePubSubType::AckermannDrivePubSubType() +{ + setName("ackermann_msgs::msg::dds_::AckermannDrive_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AckermannDrive::getMaxCdrSerializedSize()); +#else + ackermann_msgs_msg_AckermannDrive_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AckermannDrivePubSubType::~AckermannDrivePubSubType() +{ +} + +bool AckermannDrivePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AckermannDrive* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AckermannDrivePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AckermannDrive* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AckermannDrivePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AckermannDrivePubSubType::createData() +{ + return reinterpret_cast(new AckermannDrive()); +} + +void AckermannDrivePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AckermannDrivePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace ackermann_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.h index 24182acab85..df69d15df62 100644 --- a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDrivePubSubTypes.h @@ -16,76 +16,120 @@ * @file AckermannDrivePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "AckermannDrive.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated AckermannDrive is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated AckermannDrive is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace ackermann_msgs { namespace msg { + + + /*! * @brief This class represents the TopicDataType of the type AckermannDrive defined by the user in the IDL file. - * @ingroup ACKERMANNDRIVE + * @ingroup AckermannDrive */ -class AckermannDrivePubSubType : public eprosima::fastdds::dds::TopicDataType { +class AckermannDrivePubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef AckermannDrive type; - eProsima_user_DllExport AckermannDrivePubSubType(); + typedef AckermannDrive type; + + eProsima_user_DllExport AckermannDrivePubSubType(); - eProsima_user_DllExport virtual ~AckermannDrivePubSubType(); + eProsima_user_DllExport ~AckermannDrivePubSubType() override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return true; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return true; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - new (memory) AckermannDrive(); - return true; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; }; } // namespace msg } // namespace ackermann_msgs -#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.cxx b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.cxx index d1d2fce8634..926f11776da 100644 --- a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.cxx +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.cxx @@ -14,9 +14,9 @@ /*! * @file AckermannDriveStamped.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "AckermannDriveStamped.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -ackermann_msgs::msg::AckermannDriveStamped::AckermannDriveStamped() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@176b3f44 - // m_drive com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6ee6f53 +namespace ackermann_msgs { + +namespace msg { -} -ackermann_msgs::msg::AckermannDriveStamped::~AckermannDriveStamped() +AckermannDriveStamped::AckermannDriveStamped() { +} +AckermannDriveStamped::~AckermannDriveStamped() +{ } -ackermann_msgs::msg::AckermannDriveStamped::AckermannDriveStamped( +AckermannDriveStamped::AckermannDriveStamped( const AckermannDriveStamped& x) { m_header = x.m_header; m_drive = x.m_drive; } -ackermann_msgs::msg::AckermannDriveStamped::AckermannDriveStamped( - AckermannDriveStamped&& x) +AckermannDriveStamped::AckermannDriveStamped( + AckermannDriveStamped&& x) noexcept { m_header = std::move(x.m_header); m_drive = std::move(x.m_drive); } -ackermann_msgs::msg::AckermannDriveStamped& ackermann_msgs::msg::AckermannDriveStamped::operator =( +AckermannDriveStamped& AckermannDriveStamped::operator =( const AckermannDriveStamped& x) { m_header = x.m_header; m_drive = x.m_drive; - return *this; } -ackermann_msgs::msg::AckermannDriveStamped& ackermann_msgs::msg::AckermannDriveStamped::operator =( - AckermannDriveStamped&& x) +AckermannDriveStamped& AckermannDriveStamped::operator =( + AckermannDriveStamped&& x) noexcept { m_header = std::move(x.m_header); m_drive = std::move(x.m_drive); - return *this; } -bool ackermann_msgs::msg::AckermannDriveStamped::operator ==( +bool AckermannDriveStamped::operator ==( const AckermannDriveStamped& x) const { - - return (m_header == x.m_header && m_drive == x.m_drive); + return (m_header == x.m_header && + m_drive == x.m_drive); } -bool ackermann_msgs::msg::AckermannDriveStamped::operator !=( +bool AckermannDriveStamped::operator !=( const AckermannDriveStamped& x) const { return !(*this == x); } -size_t ackermann_msgs::msg::AckermannDriveStamped::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += ackermann_msgs::msg::AckermannDrive::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t ackermann_msgs::msg::AckermannDriveStamped::getCdrSerializedSize( - const ackermann_msgs::msg::AckermannDriveStamped& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += ackermann_msgs::msg::AckermannDrive::getCdrSerializedSize(data.drive(), current_alignment); - - return current_alignment - initial_alignment; -} - -void ackermann_msgs::msg::AckermannDriveStamped::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_drive; - -} - -void ackermann_msgs::msg::AckermannDriveStamped::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_drive; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void ackermann_msgs::msg::AckermannDriveStamped::header( +void AckermannDriveStamped::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -152,7 +110,7 @@ void ackermann_msgs::msg::AckermannDriveStamped::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void ackermann_msgs::msg::AckermannDriveStamped::header( +void AckermannDriveStamped::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -162,7 +120,7 @@ void ackermann_msgs::msg::AckermannDriveStamped::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& ackermann_msgs::msg::AckermannDriveStamped::header() const +const std_msgs::msg::Header& AckermannDriveStamped::header() const { return m_header; } @@ -171,15 +129,17 @@ const std_msgs::msg::Header& ackermann_msgs::msg::AckermannDriveStamped::header( * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& ackermann_msgs::msg::AckermannDriveStamped::header() +std_msgs::msg::Header& AckermannDriveStamped::header() { return m_header; } + + /*! * @brief This function copies the value in member drive * @param _drive New value to be copied in member drive */ -void ackermann_msgs::msg::AckermannDriveStamped::drive( +void AckermannDriveStamped::drive( const ackermann_msgs::msg::AckermannDrive& _drive) { m_drive = _drive; @@ -189,7 +149,7 @@ void ackermann_msgs::msg::AckermannDriveStamped::drive( * @brief This function moves the value in member drive * @param _drive New value to be moved in member drive */ -void ackermann_msgs::msg::AckermannDriveStamped::drive( +void AckermannDriveStamped::drive( ackermann_msgs::msg::AckermannDrive&& _drive) { m_drive = std::move(_drive); @@ -199,7 +159,7 @@ void ackermann_msgs::msg::AckermannDriveStamped::drive( * @brief This function returns a constant reference to member drive * @return Constant reference to member drive */ -const ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDriveStamped::drive() const +const ackermann_msgs::msg::AckermannDrive& AckermannDriveStamped::drive() const { return m_drive; } @@ -208,31 +168,18 @@ const ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDriveSt * @brief This function returns a reference to member drive * @return Reference to member drive */ -ackermann_msgs::msg::AckermannDrive& ackermann_msgs::msg::AckermannDriveStamped::drive() +ackermann_msgs::msg::AckermannDrive& AckermannDriveStamped::drive() { return m_drive; } -size_t ackermann_msgs::msg::AckermannDriveStamped::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool ackermann_msgs::msg::AckermannDriveStamped::isKeyDefined() -{ - return false; -} +} // namespace msg -void ackermann_msgs::msg::AckermannDriveStamped::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace ackermann_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AckermannDriveStampedCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.h b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.h index 472e5779790..93e36456d8d 100644 --- a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.h +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStamped.h @@ -16,25 +16,30 @@ * @file AckermannDriveStamped.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ #define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ -#include "AckermannDrive.h" -#include "std_msgs/msg/Header.h" - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "AckermannDrive.h" +#include "std_msgs/msg/Header.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -44,178 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(AckermannDriveStamped_SOURCE) -#define AckermannDriveStamped_DllAPI __declspec(dllexport) +#if defined(ACKERMANNDRIVESTAMPED_SOURCE) +#define ACKERMANNDRIVESTAMPED_DllAPI __declspec( dllexport ) #else -#define AckermannDriveStamped_DllAPI __declspec(dllimport) -#endif // AckermannDriveStamped_SOURCE +#define ACKERMANNDRIVESTAMPED_DllAPI __declspec( dllimport ) +#endif // ACKERMANNDRIVESTAMPED_SOURCE #else -#define AckermannDriveStamped_DllAPI +#define ACKERMANNDRIVESTAMPED_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define AckermannDriveStamped_DllAPI -#endif // _WIN32 +#define ACKERMANNDRIVESTAMPED_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace ackermann_msgs { + namespace msg { + + + /*! * @brief This class represents the structure AckermannDriveStamped defined by the user in the IDL file. - * @ingroup ACKERMANNDRIVESTAMPED + * @ingroup AckermannDriveStamped */ -class AckermannDriveStamped { +class AckermannDriveStamped +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AckermannDriveStamped(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AckermannDriveStamped(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. - */ - eProsima_user_DllExport AckermannDriveStamped(const AckermannDriveStamped& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. - */ - eProsima_user_DllExport AckermannDriveStamped(AckermannDriveStamped&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. - */ - eProsima_user_DllExport AckermannDriveStamped& operator=(const AckermannDriveStamped& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. - */ - eProsima_user_DllExport AckermannDriveStamped& operator=(AckermannDriveStamped&& x); - - /*! - * @brief Comparison operator. - * @param x ackermann_msgs::msg::AckermannDriveStamped object to compare. - */ - eProsima_user_DllExport bool operator==(const AckermannDriveStamped& x) const; - - /*! - * @brief Comparison operator. - * @param x ackermann_msgs::msg::AckermannDriveStamped object to compare. - */ - eProsima_user_DllExport bool operator!=(const AckermannDriveStamped& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member drive - * @param _drive New value to be copied in member drive - */ - eProsima_user_DllExport void drive(const ackermann_msgs::msg::AckermannDrive& _drive); - - /*! - * @brief This function moves the value in member drive - * @param _drive New value to be moved in member drive - */ - eProsima_user_DllExport void drive(ackermann_msgs::msg::AckermannDrive&& _drive); - - /*! - * @brief This function returns a constant reference to member drive - * @return Constant reference to member drive - */ - eProsima_user_DllExport const ackermann_msgs::msg::AckermannDrive& drive() const; - - /*! - * @brief This function returns a reference to member drive - * @return Reference to member drive - */ - eProsima_user_DllExport ackermann_msgs::msg::AckermannDrive& drive(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const ackermann_msgs::msg::AckermannDriveStamped& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AckermannDriveStamped(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AckermannDriveStamped(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + */ + eProsima_user_DllExport AckermannDriveStamped( + const AckermannDriveStamped& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + */ + eProsima_user_DllExport AckermannDriveStamped( + AckermannDriveStamped&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + */ + eProsima_user_DllExport AckermannDriveStamped& operator =( + const AckermannDriveStamped& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ackermann_msgs::msg::AckermannDriveStamped that will be copied. + */ + eProsima_user_DllExport AckermannDriveStamped& operator =( + AckermannDriveStamped&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ackermann_msgs::msg::AckermannDriveStamped object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AckermannDriveStamped& x) const; + + /*! + * @brief Comparison operator. + * @param x ackermann_msgs::msg::AckermannDriveStamped object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AckermannDriveStamped& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member drive + * @param _drive New value to be copied in member drive + */ + eProsima_user_DllExport void drive( + const ackermann_msgs::msg::AckermannDrive& _drive); + + /*! + * @brief This function moves the value in member drive + * @param _drive New value to be moved in member drive + */ + eProsima_user_DllExport void drive( + ackermann_msgs::msg::AckermannDrive&& _drive); + + /*! + * @brief This function returns a constant reference to member drive + * @return Constant reference to member drive + */ + eProsima_user_DllExport const ackermann_msgs::msg::AckermannDrive& drive() const; + + /*! + * @brief This function returns a reference to member drive + * @return Reference to member drive + */ + eProsima_user_DllExport ackermann_msgs::msg::AckermannDrive& drive(); private: - std_msgs::msg::Header m_header; - ackermann_msgs::msg::AckermannDrive m_drive; + + std_msgs::msg::Header m_header; + ackermann_msgs::msg::AckermannDrive m_drive; + }; -} // namespace msg -} // namespace ackermann_msgs -#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ \ No newline at end of file +} // namespace msg + +} // namespace ackermann_msgs + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedCdrAux.hpp new file mode 100644 index 00000000000..874f0e3b505 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AckermannDriveStampedCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPEDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPEDCDRAUX_HPP_ + +#include "AckermannDriveStamped.h" + +constexpr uint32_t ackermann_msgs_msg_AckermannDriveStamped_max_cdr_typesize {304UL}; +constexpr uint32_t ackermann_msgs_msg_AckermannDriveStamped_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const ackermann_msgs::msg::AckermannDriveStamped& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPEDCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedCdrAux.ipp new file mode 100644 index 00000000000..810db5ccb82 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AckermannDriveStampedCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPEDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPEDCDRAUX_IPP_ + +#include "AckermannDriveStampedCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const ackermann_msgs::msg::AckermannDriveStamped& data, + size_t& current_alignment) +{ + using namespace ackermann_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.drive(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const ackermann_msgs::msg::AckermannDriveStamped& data) +{ + using namespace ackermann_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.drive() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + ackermann_msgs::msg::AckermannDriveStamped& data) +{ + using namespace ackermann_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.drive(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const ackermann_msgs::msg::AckermannDriveStamped& data) +{ + using namespace ackermann_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPEDCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.cxx index 5427bc5febf..1a8d35279e8 100644 --- a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file AckermannDriveStampedPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AckermannDriveStampedPubSubTypes.h" +#include "AckermannDriveStampedCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace ackermann_msgs { - namespace msg { - AckermannDriveStampedPubSubType::AckermannDriveStampedPubSubType() - { - setName("ackermann_msgs::msg::dds_::AckermannDriveStamped_"); - auto type_size = AckermannDriveStamped::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = AckermannDriveStamped::isKeyDefined(); - size_t keyLength = AckermannDriveStamped::getKeyMaxCdrSerializedSize() > 16 ? - AckermannDriveStamped::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - AckermannDriveStampedPubSubType::~AckermannDriveStampedPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool AckermannDriveStampedPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - AckermannDriveStamped* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AckermannDriveStampedPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - AckermannDriveStamped* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AckermannDriveStampedPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AckermannDriveStampedPubSubType::createData() - { - return reinterpret_cast(new AckermannDriveStamped()); - } - - void AckermannDriveStampedPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AckermannDriveStampedPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - AckermannDriveStamped* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AckermannDriveStamped::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || AckermannDriveStamped::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +AckermannDriveStampedPubSubType::AckermannDriveStampedPubSubType() +{ + setName("ackermann_msgs::msg::dds_::AckermannDriveStamped_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AckermannDriveStamped::getMaxCdrSerializedSize()); +#else + ackermann_msgs_msg_AckermannDriveStamped_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AckermannDriveStampedPubSubType::~AckermannDriveStampedPubSubType() +{ +} + +bool AckermannDriveStampedPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AckermannDriveStamped* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AckermannDriveStampedPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AckermannDriveStamped* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AckermannDriveStampedPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AckermannDriveStampedPubSubType::createData() +{ + return reinterpret_cast(new AckermannDriveStamped()); +} + +void AckermannDriveStampedPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AckermannDriveStampedPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace ackermann_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h index 86aedb8db10..8288d4bdaa7 100644 --- a/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h @@ -16,77 +16,122 @@ * @file AckermannDriveStampedPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "AckermannDriveStamped.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "AckermannDrivePubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated AckermannDriveStamped is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace ackermann_msgs { namespace msg { + + + /*! * @brief This class represents the TopicDataType of the type AckermannDriveStamped defined by the user in the IDL file. - * @ingroup ACKERMANNDRIVESTAMPED + * @ingroup AckermannDriveStamped */ -class AckermannDriveStampedPubSubType : public eprosima::fastdds::dds::TopicDataType { +class AckermannDriveStampedPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef AckermannDriveStamped type; - eProsima_user_DllExport AckermannDriveStampedPubSubType(); + typedef AckermannDriveStamped type; + + eProsima_user_DllExport AckermannDriveStampedPubSubType(); - eProsima_user_DllExport virtual ~AckermannDriveStampedPubSubType(); + eProsima_user_DllExport ~AckermannDriveStampedPubSubType() override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; }; } // namespace msg } // namespace ackermann_msgs -#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ACKERMANN_MSGS_MSG_ACKERMANNDRIVESTAMPED_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.cxx b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.cxx index 3191854d26b..ceed6b49dd6 100644 --- a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.cxx +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.cxx @@ -14,9 +14,9 @@ /*! * @file Time.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,130 +27,80 @@ char dummy; #endif // _WIN32 #include "Time.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -builtin_interfaces::msg::Time::Time() -{ - // m_sec com.eprosima.idl.parser.typecode.PrimitiveTypeCode@d23e042 - m_sec = 0; - // m_nanosec com.eprosima.idl.parser.typecode.PrimitiveTypeCode@46d59067 - m_nanosec = 0; -} +namespace builtin_interfaces { + +namespace msg { + + -builtin_interfaces::msg::Time::~Time() +Time::Time() { +} +Time::~Time() +{ } -builtin_interfaces::msg::Time::Time( +Time::Time( const Time& x) { m_sec = x.m_sec; m_nanosec = x.m_nanosec; } -builtin_interfaces::msg::Time::Time( - Time&& x) +Time::Time( + Time&& x) noexcept { m_sec = x.m_sec; m_nanosec = x.m_nanosec; } -builtin_interfaces::msg::Time& builtin_interfaces::msg::Time::operator =( +Time& Time::operator =( const Time& x) { m_sec = x.m_sec; m_nanosec = x.m_nanosec; - return *this; } -builtin_interfaces::msg::Time& builtin_interfaces::msg::Time::operator =( - Time&& x) +Time& Time::operator =( + Time&& x) noexcept { m_sec = x.m_sec; m_nanosec = x.m_nanosec; - return *this; } -bool builtin_interfaces::msg::Time::operator ==( +bool Time::operator ==( const Time& x) const { - - return (m_sec == x.m_sec && m_nanosec == x.m_nanosec); + return (m_sec == x.m_sec && + m_nanosec == x.m_nanosec); } -bool builtin_interfaces::msg::Time::operator !=( +bool Time::operator !=( const Time& x) const { return !(*this == x); } -size_t builtin_interfaces::msg::Time::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -size_t builtin_interfaces::msg::Time::getCdrSerializedSize( - const builtin_interfaces::msg::Time& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void builtin_interfaces::msg::Time::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_sec; - scdr << m_nanosec; - -} - -void builtin_interfaces::msg::Time::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_sec; - dcdr >> m_nanosec; -} - /*! * @brief This function sets a value in member sec * @param _sec New value for member sec */ -void builtin_interfaces::msg::Time::sec( +void Time::sec( int32_t _sec) { m_sec = _sec; @@ -160,7 +110,7 @@ void builtin_interfaces::msg::Time::sec( * @brief This function returns the value of member sec * @return Value of member sec */ -int32_t builtin_interfaces::msg::Time::sec() const +int32_t Time::sec() const { return m_sec; } @@ -169,16 +119,17 @@ int32_t builtin_interfaces::msg::Time::sec() const * @brief This function returns a reference to member sec * @return Reference to member sec */ -int32_t& builtin_interfaces::msg::Time::sec() +int32_t& Time::sec() { return m_sec; } + /*! * @brief This function sets a value in member nanosec * @param _nanosec New value for member nanosec */ -void builtin_interfaces::msg::Time::nanosec( +void Time::nanosec( uint32_t _nanosec) { m_nanosec = _nanosec; @@ -188,7 +139,7 @@ void builtin_interfaces::msg::Time::nanosec( * @brief This function returns the value of member nanosec * @return Value of member nanosec */ -uint32_t builtin_interfaces::msg::Time::nanosec() const +uint32_t Time::nanosec() const { return m_nanosec; } @@ -197,32 +148,18 @@ uint32_t builtin_interfaces::msg::Time::nanosec() const * @brief This function returns a reference to member nanosec * @return Reference to member nanosec */ -uint32_t& builtin_interfaces::msg::Time::nanosec() +uint32_t& Time::nanosec() { return m_nanosec; } -size_t builtin_interfaces::msg::Time::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool builtin_interfaces::msg::Time::isKeyDefined() -{ - return false; -} +} // namespace msg -void builtin_interfaces::msg::Time::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace builtin_interfaces +// Include auxiliary functions like for serializing/deserializing. +#include "TimeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.h b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.h index ae55bc39467..cf8e94b6c9b 100644 --- a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.h +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/Time.h @@ -16,22 +16,28 @@ * @file Time.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ #define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ -#include #include #include +#include #include #include #include +#include +#include +#include + + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -41,167 +47,144 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Time_SOURCE) -#define Time_DllAPI __declspec(dllexport) +#if defined(TIME_SOURCE) +#define TIME_DllAPI __declspec( dllexport ) #else -#define Time_DllAPI __declspec(dllimport) -#endif // Time_SOURCE +#define TIME_DllAPI __declspec( dllimport ) +#endif // TIME_SOURCE #else -#define Time_DllAPI +#define TIME_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Time_DllAPI -#endif // _WIN32 +#define TIME_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace builtin_interfaces { + namespace msg { + + + /*! * @brief This class represents the structure Time defined by the user in the IDL file. - * @ingroup TIME + * @ingroup Time */ -class Time { +class Time +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Time(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Time(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. - */ - eProsima_user_DllExport Time(const Time& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. - */ - eProsima_user_DllExport Time(Time&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. - */ - eProsima_user_DllExport Time& operator=(const Time& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. - */ - eProsima_user_DllExport Time& operator=(Time&& x); - - /*! - * @brief Comparison operator. - * @param x builtin_interfaces::msg::Time object to compare. - */ - eProsima_user_DllExport bool operator==(const Time& x) const; - - /*! - * @brief Comparison operator. - * @param x builtin_interfaces::msg::Time object to compare. - */ - eProsima_user_DllExport bool operator!=(const Time& x) const; - - /*! - * @brief This function sets a value in member sec - * @param _sec New value for member sec - */ - eProsima_user_DllExport void sec(int32_t _sec); - - /*! - * @brief This function returns the value of member sec - * @return Value of member sec - */ - eProsima_user_DllExport int32_t sec() const; - - /*! - * @brief This function returns a reference to member sec - * @return Reference to member sec - */ - eProsima_user_DllExport int32_t& sec(); - - /*! - * @brief This function sets a value in member nanosec - * @param _nanosec New value for member nanosec - */ - eProsima_user_DllExport void nanosec(uint32_t _nanosec); - - /*! - * @brief This function returns the value of member nanosec - * @return Value of member nanosec - */ - eProsima_user_DllExport uint32_t nanosec() const; - - /*! - * @brief This function returns a reference to member nanosec - * @return Reference to member nanosec - */ - eProsima_user_DllExport uint32_t& nanosec(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const builtin_interfaces::msg::Time& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Time(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Time(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + */ + eProsima_user_DllExport Time( + const Time& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + */ + eProsima_user_DllExport Time( + Time&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + */ + eProsima_user_DllExport Time& operator =( + const Time& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. + */ + eProsima_user_DllExport Time& operator =( + Time&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::Time object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Time& x) const; + + /*! + * @brief Comparison operator. + * @param x builtin_interfaces::msg::Time object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Time& x) const; + + /*! + * @brief This function sets a value in member sec + * @param _sec New value for member sec + */ + eProsima_user_DllExport void sec( + int32_t _sec); + + /*! + * @brief This function returns the value of member sec + * @return Value of member sec + */ + eProsima_user_DllExport int32_t sec() const; + + /*! + * @brief This function returns a reference to member sec + * @return Reference to member sec + */ + eProsima_user_DllExport int32_t& sec(); + + + /*! + * @brief This function sets a value in member nanosec + * @param _nanosec New value for member nanosec + */ + eProsima_user_DllExport void nanosec( + uint32_t _nanosec); + + /*! + * @brief This function returns the value of member nanosec + * @return Value of member nanosec + */ + eProsima_user_DllExport uint32_t nanosec() const; + + /*! + * @brief This function returns a reference to member nanosec + * @return Reference to member nanosec + */ + eProsima_user_DllExport uint32_t& nanosec(); private: - int32_t m_sec; - uint32_t m_nanosec; + + int32_t m_sec{0}; + uint32_t m_nanosec{0}; + }; -} // namespace msg -} // namespace builtin_interfaces -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ \ No newline at end of file +} // namespace msg + +} // namespace builtin_interfaces + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimeCdrAux.hpp new file mode 100644 index 00000000000..8ff3a974f9e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimeCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIMECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIMECDRAUX_HPP_ + +#include "Time.h" + +constexpr uint32_t builtin_interfaces_msg_Time_max_cdr_typesize {12UL}; +constexpr uint32_t builtin_interfaces_msg_Time_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::Time& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIMECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimeCdrAux.ipp new file mode 100644 index 00000000000..6cb341cd620 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimeCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIMECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIMECDRAUX_IPP_ + +#include "TimeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const builtin_interfaces::msg::Time& data, + size_t& current_alignment) +{ + using namespace builtin_interfaces::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.sec(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.nanosec(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::Time& data) +{ + using namespace builtin_interfaces::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.sec() + << eprosima::fastcdr::MemberId(1) << data.nanosec() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + builtin_interfaces::msg::Time& data) +{ + using namespace builtin_interfaces::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.sec(); + break; + + case 1: + dcdr >> data.nanosec(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const builtin_interfaces::msg::Time& data) +{ + using namespace builtin_interfaces::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIMECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.cxx index ca1c7915dda..2c418f22641 100644 --- a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file TimePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "TimePubSubTypes.h" +#include "TimeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace builtin_interfaces { - namespace msg { - TimePubSubType::TimePubSubType() - { - setName("builtin_interfaces::msg::dds_::Time_"); - auto type_size = Time::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Time::isKeyDefined(); - size_t keyLength = Time::getKeyMaxCdrSerializedSize() > 16 ? - Time::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TimePubSubType::~TimePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TimePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Time* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TimePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Time* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TimePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TimePubSubType::createData() - { - return reinterpret_cast(new Time()); - } - - void TimePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TimePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Time* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Time::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Time::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +TimePubSubType::TimePubSubType() +{ + setName("builtin_interfaces::msg::dds_::Time_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Time::getMaxCdrSerializedSize()); +#else + builtin_interfaces_msg_Time_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +TimePubSubType::~TimePubSubType() +{ +} + +bool TimePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Time* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool TimePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Time* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function TimePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* TimePubSubType::createData() +{ + return reinterpret_cast(new Time()); +} + +void TimePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TimePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace builtin_interfaces + diff --git a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.h index 919dd66069d..3de3c15477d 100644 --- a/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/builtin_interfaces/msg/TimePubSubTypes.h @@ -16,76 +16,120 @@ * @file TimePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "Time.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace builtin_interfaces { namespace msg { + + + /*! * @brief This class represents the TopicDataType of the type Time defined by the user in the IDL file. - * @ingroup TIME + * @ingroup Time */ -class TimePubSubType : public eprosima::fastdds::dds::TopicDataType { +class TimePubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef Time type; - eProsima_user_DllExport TimePubSubType(); + typedef Time type; + + eProsima_user_DllExport TimePubSubType(); - eProsima_user_DllExport virtual ~TimePubSubType(); + eProsima_user_DllExport ~TimePubSubType() override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return true; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return true; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - new (memory) Time(); - return true; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; }; } // namespace msg } // namespace builtin_interfaces -#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.cxx index e6d497ed577..7d511be9b1c 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaActorBlueprint.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,33 @@ char dummy; #endif // _WIN32 #include "CarlaActorBlueprint.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaActorBlueprint::CarlaActorBlueprint() -{ - // m_id com.eprosima.idl.parser.typecode.StringTypeCode@2b4a2ec7 - m_id =""; - // m_tags com.eprosima.idl.parser.typecode.SequenceTypeCode@564718df - // m_attributes com.eprosima.idl.parser.typecode.SequenceTypeCode@51b7e5df +namespace carla_msgs { + +namespace msg { -} -carla_msgs::msg::CarlaActorBlueprint::~CarlaActorBlueprint() -{ +CarlaActorBlueprint::CarlaActorBlueprint() +{ } -carla_msgs::msg::CarlaActorBlueprint::CarlaActorBlueprint( +CarlaActorBlueprint::~CarlaActorBlueprint() +{ +} + +CarlaActorBlueprint::CarlaActorBlueprint( const CarlaActorBlueprint& x) { m_id = x.m_id; @@ -59,127 +61,53 @@ carla_msgs::msg::CarlaActorBlueprint::CarlaActorBlueprint( m_attributes = x.m_attributes; } -carla_msgs::msg::CarlaActorBlueprint::CarlaActorBlueprint( - CarlaActorBlueprint&& x) +CarlaActorBlueprint::CarlaActorBlueprint( + CarlaActorBlueprint&& x) noexcept { m_id = std::move(x.m_id); m_tags = std::move(x.m_tags); m_attributes = std::move(x.m_attributes); } -carla_msgs::msg::CarlaActorBlueprint& carla_msgs::msg::CarlaActorBlueprint::operator =( +CarlaActorBlueprint& CarlaActorBlueprint::operator =( const CarlaActorBlueprint& x) { m_id = x.m_id; m_tags = x.m_tags; m_attributes = x.m_attributes; - return *this; } -carla_msgs::msg::CarlaActorBlueprint& carla_msgs::msg::CarlaActorBlueprint::operator =( - CarlaActorBlueprint&& x) +CarlaActorBlueprint& CarlaActorBlueprint::operator =( + CarlaActorBlueprint&& x) noexcept { m_id = std::move(x.m_id); m_tags = std::move(x.m_tags); m_attributes = std::move(x.m_attributes); - return *this; } -bool carla_msgs::msg::CarlaActorBlueprint::operator ==( +bool CarlaActorBlueprint::operator ==( const CarlaActorBlueprint& x) const { - - return (m_id == x.m_id && m_tags == x.m_tags && m_attributes == x.m_attributes); + return (m_id == x.m_id && + m_tags == x.m_tags && + m_attributes == x.m_attributes); } -bool carla_msgs::msg::CarlaActorBlueprint::operator !=( +bool CarlaActorBlueprint::operator !=( const CarlaActorBlueprint& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaActorBlueprint::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - } - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += diagnostic_msgs::msg::KeyValue::getMaxCdrSerializedSize(current_alignment);} - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaActorBlueprint::getCdrSerializedSize( - const carla_msgs::msg::CarlaActorBlueprint& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.id().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.tags().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - data.tags().at(a).size() + 1; - } - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.attributes().size(); ++a) - { - current_alignment += diagnostic_msgs::msg::KeyValue::getCdrSerializedSize(data.attributes().at(a), current_alignment);} - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaActorBlueprint::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_id; - scdr << m_tags;scdr << m_attributes; - -} - -void carla_msgs::msg::CarlaActorBlueprint::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_id; - dcdr >> m_tags; - dcdr >> m_attributes; -} - /*! * @brief This function copies the value in member id * @param _id New value to be copied in member id */ -void carla_msgs::msg::CarlaActorBlueprint::id( +void CarlaActorBlueprint::id( const std::string& _id) { m_id = _id; @@ -189,7 +117,7 @@ void carla_msgs::msg::CarlaActorBlueprint::id( * @brief This function moves the value in member id * @param _id New value to be moved in member id */ -void carla_msgs::msg::CarlaActorBlueprint::id( +void CarlaActorBlueprint::id( std::string&& _id) { m_id = std::move(_id); @@ -199,7 +127,7 @@ void carla_msgs::msg::CarlaActorBlueprint::id( * @brief This function returns a constant reference to member id * @return Constant reference to member id */ -const std::string& carla_msgs::msg::CarlaActorBlueprint::id() const +const std::string& CarlaActorBlueprint::id() const { return m_id; } @@ -208,15 +136,17 @@ const std::string& carla_msgs::msg::CarlaActorBlueprint::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -std::string& carla_msgs::msg::CarlaActorBlueprint::id() +std::string& CarlaActorBlueprint::id() { return m_id; } + + /*! * @brief This function copies the value in member tags * @param _tags New value to be copied in member tags */ -void carla_msgs::msg::CarlaActorBlueprint::tags( +void CarlaActorBlueprint::tags( const std::vector& _tags) { m_tags = _tags; @@ -226,7 +156,7 @@ void carla_msgs::msg::CarlaActorBlueprint::tags( * @brief This function moves the value in member tags * @param _tags New value to be moved in member tags */ -void carla_msgs::msg::CarlaActorBlueprint::tags( +void CarlaActorBlueprint::tags( std::vector&& _tags) { m_tags = std::move(_tags); @@ -236,7 +166,7 @@ void carla_msgs::msg::CarlaActorBlueprint::tags( * @brief This function returns a constant reference to member tags * @return Constant reference to member tags */ -const std::vector& carla_msgs::msg::CarlaActorBlueprint::tags() const +const std::vector& CarlaActorBlueprint::tags() const { return m_tags; } @@ -245,15 +175,17 @@ const std::vector& carla_msgs::msg::CarlaActorBlueprint::tags() con * @brief This function returns a reference to member tags * @return Reference to member tags */ -std::vector& carla_msgs::msg::CarlaActorBlueprint::tags() +std::vector& CarlaActorBlueprint::tags() { return m_tags; } + + /*! * @brief This function copies the value in member attributes * @param _attributes New value to be copied in member attributes */ -void carla_msgs::msg::CarlaActorBlueprint::attributes( +void CarlaActorBlueprint::attributes( const std::vector& _attributes) { m_attributes = _attributes; @@ -263,7 +195,7 @@ void carla_msgs::msg::CarlaActorBlueprint::attributes( * @brief This function moves the value in member attributes * @param _attributes New value to be moved in member attributes */ -void carla_msgs::msg::CarlaActorBlueprint::attributes( +void CarlaActorBlueprint::attributes( std::vector&& _attributes) { m_attributes = std::move(_attributes); @@ -273,7 +205,7 @@ void carla_msgs::msg::CarlaActorBlueprint::attributes( * @brief This function returns a constant reference to member attributes * @return Constant reference to member attributes */ -const std::vector& carla_msgs::msg::CarlaActorBlueprint::attributes() const +const std::vector& CarlaActorBlueprint::attributes() const { return m_attributes; } @@ -282,31 +214,18 @@ const std::vector& carla_msgs::msg::CarlaActorBl * @brief This function returns a reference to member attributes * @return Reference to member attributes */ -std::vector& carla_msgs::msg::CarlaActorBlueprint::attributes() +std::vector& CarlaActorBlueprint::attributes() { return m_attributes; } -size_t carla_msgs::msg::CarlaActorBlueprint::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool carla_msgs::msg::CarlaActorBlueprint::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaActorBlueprint::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaActorBlueprintCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.h index 64f09476123..527a3d6bc40 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprint.h @@ -16,20 +16,25 @@ * @file CarlaActorBlueprint.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_H_ -#include "diagnostic_msgs/msg/KeyValue.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "diagnostic_msgs/msg/KeyValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,227 +48,188 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaActorBlueprint_SOURCE) -#define CarlaActorBlueprint_DllAPI __declspec( dllexport ) +#if defined(CARLAACTORBLUEPRINT_SOURCE) +#define CARLAACTORBLUEPRINT_DllAPI __declspec( dllexport ) #else -#define CarlaActorBlueprint_DllAPI __declspec( dllimport ) -#endif // CarlaActorBlueprint_SOURCE +#define CARLAACTORBLUEPRINT_DllAPI __declspec( dllimport ) +#endif // CARLAACTORBLUEPRINT_SOURCE #else -#define CarlaActorBlueprint_DllAPI +#define CARLAACTORBLUEPRINT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaActorBlueprint_DllAPI +#define CARLAACTORBLUEPRINT_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaActorBlueprint defined by the user in the IDL file. - * @ingroup CARLAACTORBLUEPRINT - */ - class CarlaActorBlueprint - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaActorBlueprint(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaActorBlueprint(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. - */ - eProsima_user_DllExport CarlaActorBlueprint( - const CarlaActorBlueprint& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. - */ - eProsima_user_DllExport CarlaActorBlueprint( - CarlaActorBlueprint&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. - */ - eProsima_user_DllExport CarlaActorBlueprint& operator =( - const CarlaActorBlueprint& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. - */ - eProsima_user_DllExport CarlaActorBlueprint& operator =( - CarlaActorBlueprint&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaActorBlueprint object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaActorBlueprint& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaActorBlueprint object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaActorBlueprint& x) const; - - /*! - * @brief This function copies the value in member id - * @param _id New value to be copied in member id - */ - eProsima_user_DllExport void id( - const std::string& _id); - - /*! - * @brief This function moves the value in member id - * @param _id New value to be moved in member id - */ - eProsima_user_DllExport void id( - std::string&& _id); - - /*! - * @brief This function returns a constant reference to member id - * @return Constant reference to member id - */ - eProsima_user_DllExport const std::string& id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport std::string& id(); - /*! - * @brief This function copies the value in member tags - * @param _tags New value to be copied in member tags - */ - eProsima_user_DllExport void tags( - const std::vector& _tags); - - /*! - * @brief This function moves the value in member tags - * @param _tags New value to be moved in member tags - */ - eProsima_user_DllExport void tags( - std::vector&& _tags); - - /*! - * @brief This function returns a constant reference to member tags - * @return Constant reference to member tags - */ - eProsima_user_DllExport const std::vector& tags() const; - - /*! - * @brief This function returns a reference to member tags - * @return Reference to member tags - */ - eProsima_user_DllExport std::vector& tags(); - /*! - * @brief This function copies the value in member attributes - * @param _attributes New value to be copied in member attributes - */ - eProsima_user_DllExport void attributes( - const std::vector& _attributes); - - /*! - * @brief This function moves the value in member attributes - * @param _attributes New value to be moved in member attributes - */ - eProsima_user_DllExport void attributes( - std::vector&& _attributes); - - /*! - * @brief This function returns a constant reference to member attributes - * @return Constant reference to member attributes - */ - eProsima_user_DllExport const std::vector& attributes() const; - - /*! - * @brief This function returns a reference to member attributes - * @return Reference to member attributes - */ - eProsima_user_DllExport std::vector& attributes(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaActorBlueprint& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::string m_id; - std::vector m_tags; - std::vector m_attributes; - }; - } // namespace msg + +namespace msg { + + + + + +/*! + * @brief This class represents the structure CarlaActorBlueprint defined by the user in the IDL file. + * @ingroup CarlaActorBlueprint + */ +class CarlaActorBlueprint +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaActorBlueprint(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaActorBlueprint(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. + */ + eProsima_user_DllExport CarlaActorBlueprint( + const CarlaActorBlueprint& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. + */ + eProsima_user_DllExport CarlaActorBlueprint( + CarlaActorBlueprint&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. + */ + eProsima_user_DllExport CarlaActorBlueprint& operator =( + const CarlaActorBlueprint& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorBlueprint that will be copied. + */ + eProsima_user_DllExport CarlaActorBlueprint& operator =( + CarlaActorBlueprint&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorBlueprint object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaActorBlueprint& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorBlueprint object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaActorBlueprint& x) const; + + /*! + * @brief This function copies the value in member id + * @param _id New value to be copied in member id + */ + eProsima_user_DllExport void id( + const std::string& _id); + + /*! + * @brief This function moves the value in member id + * @param _id New value to be moved in member id + */ + eProsima_user_DllExport void id( + std::string&& _id); + + /*! + * @brief This function returns a constant reference to member id + * @return Constant reference to member id + */ + eProsima_user_DllExport const std::string& id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport std::string& id(); + + + /*! + * @brief This function copies the value in member tags + * @param _tags New value to be copied in member tags + */ + eProsima_user_DllExport void tags( + const std::vector& _tags); + + /*! + * @brief This function moves the value in member tags + * @param _tags New value to be moved in member tags + */ + eProsima_user_DllExport void tags( + std::vector&& _tags); + + /*! + * @brief This function returns a constant reference to member tags + * @return Constant reference to member tags + */ + eProsima_user_DllExport const std::vector& tags() const; + + /*! + * @brief This function returns a reference to member tags + * @return Reference to member tags + */ + eProsima_user_DllExport std::vector& tags(); + + + /*! + * @brief This function copies the value in member attributes + * @param _attributes New value to be copied in member attributes + */ + eProsima_user_DllExport void attributes( + const std::vector& _attributes); + + /*! + * @brief This function moves the value in member attributes + * @param _attributes New value to be moved in member attributes + */ + eProsima_user_DllExport void attributes( + std::vector&& _attributes); + + /*! + * @brief This function returns a constant reference to member attributes + * @return Constant reference to member attributes + */ + eProsima_user_DllExport const std::vector& attributes() const; + + /*! + * @brief This function returns a reference to member attributes + * @return Reference to member attributes + */ + eProsima_user_DllExport std::vector& attributes(); + +private: + + std::string m_id; + std::vector m_tags; + std::vector m_attributes; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintCdrAux.hpp new file mode 100644 index 00000000000..ecd0d94fd63 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorBlueprintCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINTCDRAUX_HPP_ + +#include "CarlaActorBlueprint.h" + +constexpr uint32_t carla_msgs_msg_CarlaActorBlueprint_max_cdr_typesize {78680UL}; +constexpr uint32_t carla_msgs_msg_CarlaActorBlueprint_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorBlueprint& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintCdrAux.ipp new file mode 100644 index 00000000000..722c6db2941 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintCdrAux.ipp @@ -0,0 +1,148 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorBlueprintCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINTCDRAUX_IPP_ + +#include "CarlaActorBlueprintCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaActorBlueprint& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.tags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.attributes(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorBlueprint& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.id() + << eprosima::fastcdr::MemberId(1) << data.tags() + << eprosima::fastcdr::MemberId(2) << data.attributes() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaActorBlueprint& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.id(); + break; + + case 1: + dcdr >> data.tags(); + break; + + case 2: + dcdr >> data.attributes(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorBlueprint& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.cxx index cf6a7ea9199..919dc1bef1a 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file CarlaActorBlueprintPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaActorBlueprintPubSubTypes.h" +#include "CarlaActorBlueprintCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaActorBlueprintPubSubType::CarlaActorBlueprintPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaActorBlueprint_"); - auto type_size = CarlaActorBlueprint::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaActorBlueprint::isKeyDefined(); - size_t keyLength = CarlaActorBlueprint::getKeyMaxCdrSerializedSize() > 16 ? - CarlaActorBlueprint::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaActorBlueprintPubSubType::~CarlaActorBlueprintPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaActorBlueprintPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaActorBlueprint* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaActorBlueprintPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaActorBlueprint* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaActorBlueprintPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaActorBlueprintPubSubType::createData() - { - return reinterpret_cast(new CarlaActorBlueprint()); - } - - void CarlaActorBlueprintPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaActorBlueprintPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaActorBlueprint* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaActorBlueprint::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaActorBlueprint::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +CarlaActorBlueprintPubSubType::CarlaActorBlueprintPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaActorBlueprint_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaActorBlueprint::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaActorBlueprint_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaActorBlueprintPubSubType::~CarlaActorBlueprintPubSubType() +{ +} + +bool CarlaActorBlueprintPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaActorBlueprint* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaActorBlueprintPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaActorBlueprint* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaActorBlueprintPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaActorBlueprintPubSubType::createData() +{ + return reinterpret_cast(new CarlaActorBlueprint()); +} + +void CarlaActorBlueprintPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaActorBlueprintPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h index 9d5a2a9f4cc..1e614a2a704 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h @@ -16,92 +16,123 @@ * @file CarlaActorBlueprintPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaActorBlueprint.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "diagnostic_msgs/msg/KeyValuePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaActorBlueprint is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaActorBlueprint defined by the user in the IDL file. + * @ingroup CarlaActorBlueprint + */ +class CarlaActorBlueprintPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaActorBlueprint defined by the user in the IDL file. - * @ingroup CARLAACTORBLUEPRINT - */ - class CarlaActorBlueprintPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaActorBlueprint type; + typedef CarlaActorBlueprint type; - eProsima_user_DllExport CarlaActorBlueprintPubSubType(); + eProsima_user_DllExport CarlaActorBlueprintPubSubType(); - eProsima_user_DllExport virtual ~CarlaActorBlueprintPubSubType(); + eProsima_user_DllExport ~CarlaActorBlueprintPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORBLUEPRINT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx index 7e1dfa9450e..59c2c13199a 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaActorInfo.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,92 +27,37 @@ char dummy; #endif // _WIN32 #include "CarlaActorInfo.h" + #include + #include using namespace eprosima::fastcdr::exception; #include - -#define carla_msgs_msg_CarlaActorInfo_max_cdr_typesize 53844ULL; -#define diagnostic_msgs_msg_KeyValue_max_cdr_typesize 520ULL; -#define carla_msgs_msg_CarlaActorInfo_max_key_cdr_typesize 0ULL; -#define diagnostic_msgs_msg_KeyValue_max_key_cdr_typesize 0ULL; - - - - - - - - - - - - - - - - - - - - - - +namespace carla_msgs { +namespace msg { +namespace CarlaActorInfo_Constants { +} // namespace CarlaActorInfo_Constants -carla_msgs::msg::CarlaActorInfo::CarlaActorInfo() +CarlaActorInfo::CarlaActorInfo() { - // unsigned long long m_id - m_id = 0; - // unsigned long long m_parent_id - m_parent_id = 0; - // string m_type - m_type =""; - // string m_rosname - m_rosname =""; - // string m_rolename - m_rolename =""; - // string m_object_type - m_object_type =""; - // string m_base_type - m_base_type =""; - // string m_topic_prefix - m_topic_prefix =""; - // string m_frame_id - m_frame_id =""; - // uint8 m_city_object_label - m_city_object_label = 0; - // sequence m_attributes - - } -carla_msgs::msg::CarlaActorInfo::~CarlaActorInfo() +CarlaActorInfo::~CarlaActorInfo() { - - - - - - - - - - - } -carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( +CarlaActorInfo::CarlaActorInfo( const CarlaActorInfo& x) { m_id = x.m_id; @@ -128,8 +73,8 @@ carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( m_attributes = x.m_attributes; } -carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( - CarlaActorInfo&& x) noexcept +CarlaActorInfo::CarlaActorInfo( + CarlaActorInfo&& x) noexcept { m_id = x.m_id; m_parent_id = x.m_parent_id; @@ -144,7 +89,7 @@ carla_msgs::msg::CarlaActorInfo::CarlaActorInfo( m_attributes = std::move(x.m_attributes); } -carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( +CarlaActorInfo& CarlaActorInfo::operator =( const CarlaActorInfo& x) { @@ -159,11 +104,10 @@ carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( m_frame_id = x.m_frame_id; m_city_object_label = x.m_city_object_label; m_attributes = x.m_attributes; - return *this; } -carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( +CarlaActorInfo& CarlaActorInfo::operator =( CarlaActorInfo&& x) noexcept { @@ -178,112 +122,36 @@ carla_msgs::msg::CarlaActorInfo& carla_msgs::msg::CarlaActorInfo::operator =( m_frame_id = std::move(x.m_frame_id); m_city_object_label = x.m_city_object_label; m_attributes = std::move(x.m_attributes); - return *this; } -bool carla_msgs::msg::CarlaActorInfo::operator ==( +bool CarlaActorInfo::operator ==( const CarlaActorInfo& x) const { - - return (m_id == x.m_id && m_parent_id == x.m_parent_id && m_type == x.m_type && m_rosname == x.m_rosname && m_rolename == x.m_rolename && m_object_type == x.m_object_type && m_base_type == x.m_base_type && m_topic_prefix == x.m_topic_prefix && m_frame_id == x.m_frame_id && m_city_object_label == x.m_city_object_label && m_attributes == x.m_attributes); + return (m_id == x.m_id && + m_parent_id == x.m_parent_id && + m_type == x.m_type && + m_rosname == x.m_rosname && + m_rolename == x.m_rolename && + m_object_type == x.m_object_type && + m_base_type == x.m_base_type && + m_topic_prefix == x.m_topic_prefix && + m_frame_id == x.m_frame_id && + m_city_object_label == x.m_city_object_label && + m_attributes == x.m_attributes); } -bool carla_msgs::msg::CarlaActorInfo::operator !=( +bool CarlaActorInfo::operator !=( const CarlaActorInfo& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaActorInfo::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return carla_msgs_msg_CarlaActorInfo_max_cdr_typesize; -} - -size_t carla_msgs::msg::CarlaActorInfo::getCdrSerializedSize( - const carla_msgs::msg::CarlaActorInfo& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.rosname().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.rolename().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.object_type().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.base_type().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.topic_prefix().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.attributes().size(); ++a) - { - current_alignment += diagnostic_msgs::msg::KeyValue::getCdrSerializedSize(data.attributes().at(a), current_alignment);} - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaActorInfo::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_id; - scdr << m_parent_id; - scdr << m_type.c_str(); - scdr << m_rosname.c_str(); - scdr << m_rolename.c_str(); - scdr << m_object_type.c_str(); - scdr << m_base_type.c_str(); - scdr << m_topic_prefix.c_str(); - scdr << m_frame_id.c_str(); - scdr << m_city_object_label; - scdr << m_attributes; - -} - -void carla_msgs::msg::CarlaActorInfo::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_id; - dcdr >> m_parent_id; - dcdr >> m_type; - dcdr >> m_rosname; - dcdr >> m_rolename; - dcdr >> m_object_type; - dcdr >> m_base_type; - dcdr >> m_topic_prefix; - dcdr >> m_frame_id; - dcdr >> m_city_object_label; - dcdr >> m_attributes; -} - /*! * @brief This function sets a value in member id * @param _id New value for member id */ -void carla_msgs::msg::CarlaActorInfo::id( +void CarlaActorInfo::id( uint64_t _id) { m_id = _id; @@ -293,7 +161,7 @@ void carla_msgs::msg::CarlaActorInfo::id( * @brief This function returns the value of member id * @return Value of member id */ -uint64_t carla_msgs::msg::CarlaActorInfo::id() const +uint64_t CarlaActorInfo::id() const { return m_id; } @@ -302,16 +170,17 @@ uint64_t carla_msgs::msg::CarlaActorInfo::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -uint64_t& carla_msgs::msg::CarlaActorInfo::id() +uint64_t& CarlaActorInfo::id() { return m_id; } + /*! * @brief This function sets a value in member parent_id * @param _parent_id New value for member parent_id */ -void carla_msgs::msg::CarlaActorInfo::parent_id( +void CarlaActorInfo::parent_id( uint64_t _parent_id) { m_parent_id = _parent_id; @@ -321,7 +190,7 @@ void carla_msgs::msg::CarlaActorInfo::parent_id( * @brief This function returns the value of member parent_id * @return Value of member parent_id */ -uint64_t carla_msgs::msg::CarlaActorInfo::parent_id() const +uint64_t CarlaActorInfo::parent_id() const { return m_parent_id; } @@ -330,16 +199,17 @@ uint64_t carla_msgs::msg::CarlaActorInfo::parent_id() const * @brief This function returns a reference to member parent_id * @return Reference to member parent_id */ -uint64_t& carla_msgs::msg::CarlaActorInfo::parent_id() +uint64_t& CarlaActorInfo::parent_id() { return m_parent_id; } + /*! * @brief This function copies the value in member type * @param _type New value to be copied in member type */ -void carla_msgs::msg::CarlaActorInfo::type( +void CarlaActorInfo::type( const std::string& _type) { m_type = _type; @@ -349,7 +219,7 @@ void carla_msgs::msg::CarlaActorInfo::type( * @brief This function moves the value in member type * @param _type New value to be moved in member type */ -void carla_msgs::msg::CarlaActorInfo::type( +void CarlaActorInfo::type( std::string&& _type) { m_type = std::move(_type); @@ -359,7 +229,7 @@ void carla_msgs::msg::CarlaActorInfo::type( * @brief This function returns a constant reference to member type * @return Constant reference to member type */ -const std::string& carla_msgs::msg::CarlaActorInfo::type() const +const std::string& CarlaActorInfo::type() const { return m_type; } @@ -368,15 +238,17 @@ const std::string& carla_msgs::msg::CarlaActorInfo::type() const * @brief This function returns a reference to member type * @return Reference to member type */ -std::string& carla_msgs::msg::CarlaActorInfo::type() +std::string& CarlaActorInfo::type() { return m_type; } + + /*! * @brief This function copies the value in member rosname * @param _rosname New value to be copied in member rosname */ -void carla_msgs::msg::CarlaActorInfo::rosname( +void CarlaActorInfo::rosname( const std::string& _rosname) { m_rosname = _rosname; @@ -386,7 +258,7 @@ void carla_msgs::msg::CarlaActorInfo::rosname( * @brief This function moves the value in member rosname * @param _rosname New value to be moved in member rosname */ -void carla_msgs::msg::CarlaActorInfo::rosname( +void CarlaActorInfo::rosname( std::string&& _rosname) { m_rosname = std::move(_rosname); @@ -396,7 +268,7 @@ void carla_msgs::msg::CarlaActorInfo::rosname( * @brief This function returns a constant reference to member rosname * @return Constant reference to member rosname */ -const std::string& carla_msgs::msg::CarlaActorInfo::rosname() const +const std::string& CarlaActorInfo::rosname() const { return m_rosname; } @@ -405,15 +277,17 @@ const std::string& carla_msgs::msg::CarlaActorInfo::rosname() const * @brief This function returns a reference to member rosname * @return Reference to member rosname */ -std::string& carla_msgs::msg::CarlaActorInfo::rosname() +std::string& CarlaActorInfo::rosname() { return m_rosname; } + + /*! * @brief This function copies the value in member rolename * @param _rolename New value to be copied in member rolename */ -void carla_msgs::msg::CarlaActorInfo::rolename( +void CarlaActorInfo::rolename( const std::string& _rolename) { m_rolename = _rolename; @@ -423,7 +297,7 @@ void carla_msgs::msg::CarlaActorInfo::rolename( * @brief This function moves the value in member rolename * @param _rolename New value to be moved in member rolename */ -void carla_msgs::msg::CarlaActorInfo::rolename( +void CarlaActorInfo::rolename( std::string&& _rolename) { m_rolename = std::move(_rolename); @@ -433,7 +307,7 @@ void carla_msgs::msg::CarlaActorInfo::rolename( * @brief This function returns a constant reference to member rolename * @return Constant reference to member rolename */ -const std::string& carla_msgs::msg::CarlaActorInfo::rolename() const +const std::string& CarlaActorInfo::rolename() const { return m_rolename; } @@ -442,15 +316,17 @@ const std::string& carla_msgs::msg::CarlaActorInfo::rolename() const * @brief This function returns a reference to member rolename * @return Reference to member rolename */ -std::string& carla_msgs::msg::CarlaActorInfo::rolename() +std::string& CarlaActorInfo::rolename() { return m_rolename; } + + /*! * @brief This function copies the value in member object_type * @param _object_type New value to be copied in member object_type */ -void carla_msgs::msg::CarlaActorInfo::object_type( +void CarlaActorInfo::object_type( const std::string& _object_type) { m_object_type = _object_type; @@ -460,7 +336,7 @@ void carla_msgs::msg::CarlaActorInfo::object_type( * @brief This function moves the value in member object_type * @param _object_type New value to be moved in member object_type */ -void carla_msgs::msg::CarlaActorInfo::object_type( +void CarlaActorInfo::object_type( std::string&& _object_type) { m_object_type = std::move(_object_type); @@ -470,7 +346,7 @@ void carla_msgs::msg::CarlaActorInfo::object_type( * @brief This function returns a constant reference to member object_type * @return Constant reference to member object_type */ -const std::string& carla_msgs::msg::CarlaActorInfo::object_type() const +const std::string& CarlaActorInfo::object_type() const { return m_object_type; } @@ -479,15 +355,17 @@ const std::string& carla_msgs::msg::CarlaActorInfo::object_type() const * @brief This function returns a reference to member object_type * @return Reference to member object_type */ -std::string& carla_msgs::msg::CarlaActorInfo::object_type() +std::string& CarlaActorInfo::object_type() { return m_object_type; } + + /*! * @brief This function copies the value in member base_type * @param _base_type New value to be copied in member base_type */ -void carla_msgs::msg::CarlaActorInfo::base_type( +void CarlaActorInfo::base_type( const std::string& _base_type) { m_base_type = _base_type; @@ -497,7 +375,7 @@ void carla_msgs::msg::CarlaActorInfo::base_type( * @brief This function moves the value in member base_type * @param _base_type New value to be moved in member base_type */ -void carla_msgs::msg::CarlaActorInfo::base_type( +void CarlaActorInfo::base_type( std::string&& _base_type) { m_base_type = std::move(_base_type); @@ -507,7 +385,7 @@ void carla_msgs::msg::CarlaActorInfo::base_type( * @brief This function returns a constant reference to member base_type * @return Constant reference to member base_type */ -const std::string& carla_msgs::msg::CarlaActorInfo::base_type() const +const std::string& CarlaActorInfo::base_type() const { return m_base_type; } @@ -516,15 +394,17 @@ const std::string& carla_msgs::msg::CarlaActorInfo::base_type() const * @brief This function returns a reference to member base_type * @return Reference to member base_type */ -std::string& carla_msgs::msg::CarlaActorInfo::base_type() +std::string& CarlaActorInfo::base_type() { return m_base_type; } + + /*! * @brief This function copies the value in member topic_prefix * @param _topic_prefix New value to be copied in member topic_prefix */ -void carla_msgs::msg::CarlaActorInfo::topic_prefix( +void CarlaActorInfo::topic_prefix( const std::string& _topic_prefix) { m_topic_prefix = _topic_prefix; @@ -534,7 +414,7 @@ void carla_msgs::msg::CarlaActorInfo::topic_prefix( * @brief This function moves the value in member topic_prefix * @param _topic_prefix New value to be moved in member topic_prefix */ -void carla_msgs::msg::CarlaActorInfo::topic_prefix( +void CarlaActorInfo::topic_prefix( std::string&& _topic_prefix) { m_topic_prefix = std::move(_topic_prefix); @@ -544,7 +424,7 @@ void carla_msgs::msg::CarlaActorInfo::topic_prefix( * @brief This function returns a constant reference to member topic_prefix * @return Constant reference to member topic_prefix */ -const std::string& carla_msgs::msg::CarlaActorInfo::topic_prefix() const +const std::string& CarlaActorInfo::topic_prefix() const { return m_topic_prefix; } @@ -553,15 +433,17 @@ const std::string& carla_msgs::msg::CarlaActorInfo::topic_prefix() const * @brief This function returns a reference to member topic_prefix * @return Reference to member topic_prefix */ -std::string& carla_msgs::msg::CarlaActorInfo::topic_prefix() +std::string& CarlaActorInfo::topic_prefix() { return m_topic_prefix; } + + /*! * @brief This function copies the value in member frame_id * @param _frame_id New value to be copied in member frame_id */ -void carla_msgs::msg::CarlaActorInfo::frame_id( +void CarlaActorInfo::frame_id( const std::string& _frame_id) { m_frame_id = _frame_id; @@ -571,7 +453,7 @@ void carla_msgs::msg::CarlaActorInfo::frame_id( * @brief This function moves the value in member frame_id * @param _frame_id New value to be moved in member frame_id */ -void carla_msgs::msg::CarlaActorInfo::frame_id( +void CarlaActorInfo::frame_id( std::string&& _frame_id) { m_frame_id = std::move(_frame_id); @@ -581,7 +463,7 @@ void carla_msgs::msg::CarlaActorInfo::frame_id( * @brief This function returns a constant reference to member frame_id * @return Constant reference to member frame_id */ -const std::string& carla_msgs::msg::CarlaActorInfo::frame_id() const +const std::string& CarlaActorInfo::frame_id() const { return m_frame_id; } @@ -590,15 +472,17 @@ const std::string& carla_msgs::msg::CarlaActorInfo::frame_id() const * @brief This function returns a reference to member frame_id * @return Reference to member frame_id */ -std::string& carla_msgs::msg::CarlaActorInfo::frame_id() +std::string& CarlaActorInfo::frame_id() { return m_frame_id; } + + /*! * @brief This function sets a value in member city_object_label * @param _city_object_label New value for member city_object_label */ -void carla_msgs::msg::CarlaActorInfo::city_object_label( +void CarlaActorInfo::city_object_label( uint8_t _city_object_label) { m_city_object_label = _city_object_label; @@ -608,7 +492,7 @@ void carla_msgs::msg::CarlaActorInfo::city_object_label( * @brief This function returns the value of member city_object_label * @return Value of member city_object_label */ -uint8_t carla_msgs::msg::CarlaActorInfo::city_object_label() const +uint8_t CarlaActorInfo::city_object_label() const { return m_city_object_label; } @@ -617,16 +501,17 @@ uint8_t carla_msgs::msg::CarlaActorInfo::city_object_label() const * @brief This function returns a reference to member city_object_label * @return Reference to member city_object_label */ -uint8_t& carla_msgs::msg::CarlaActorInfo::city_object_label() +uint8_t& CarlaActorInfo::city_object_label() { return m_city_object_label; } + /*! * @brief This function copies the value in member attributes * @param _attributes New value to be copied in member attributes */ -void carla_msgs::msg::CarlaActorInfo::attributes( +void CarlaActorInfo::attributes( const std::vector& _attributes) { m_attributes = _attributes; @@ -636,7 +521,7 @@ void carla_msgs::msg::CarlaActorInfo::attributes( * @brief This function moves the value in member attributes * @param _attributes New value to be moved in member attributes */ -void carla_msgs::msg::CarlaActorInfo::attributes( +void CarlaActorInfo::attributes( std::vector&& _attributes) { m_attributes = std::move(_attributes); @@ -646,7 +531,7 @@ void carla_msgs::msg::CarlaActorInfo::attributes( * @brief This function returns a constant reference to member attributes * @return Constant reference to member attributes */ -const std::vector& carla_msgs::msg::CarlaActorInfo::attributes() const +const std::vector& CarlaActorInfo::attributes() const { return m_attributes; } @@ -655,29 +540,18 @@ const std::vector& carla_msgs::msg::CarlaActorIn * @brief This function returns a reference to member attributes * @return Reference to member attributes */ -std::vector& carla_msgs::msg::CarlaActorInfo::attributes() +std::vector& CarlaActorInfo::attributes() { return m_attributes; } -size_t carla_msgs::msg::CarlaActorInfo::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return carla_msgs_msg_CarlaActorInfo_max_key_cdr_typesize; -} -bool carla_msgs::msg::CarlaActorInfo::isKeyDefined() -{ - return false; -} -void carla_msgs::msg::CarlaActorInfo::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} +} // namespace msg +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaActorInfoCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h index ec7e7895a2b..2944daf797f 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfo.h @@ -16,22 +16,25 @@ * @file CarlaActorInfo.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ -#include "diagnostic_msgs/msg/KeyValue.h" - -#include - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "diagnostic_msgs/msg/KeyValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -60,436 +63,410 @@ namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - namespace CarlaActorInfo_Constants { - const uint8_t CITYOBJECTLABEL_NONE = 0; - const uint8_t CITYOBJECTLABEL_ROADS = 1; - const uint8_t CITYOBJECTLABEL_SIDEWALKS = 2; - const uint8_t CITYOBJECTLABEL_BUILDINGS = 3; - const uint8_t CITYOBJECTLABEL_WALLS = 4; - const uint8_t CITYOBJECTLABEL_FENCES = 5; - const uint8_t CITYOBJECTLABEL_POLES = 6; - const uint8_t CITYOBJECTLABEL_TRAFFICLIGHT = 7; - const uint8_t CITYOBJECTLABEL_TRAFFICSIGNS = 8; - const uint8_t CITYOBJECTLABEL_VEGETATION = 9; - const uint8_t CITYOBJECTLABEL_TERRAIN = 10; - const uint8_t CITYOBJECTLABEL_SKY = 11; - const uint8_t CITYOBJECTLABEL_PEDESTRIANS = 12; - const uint8_t CITYOBJECTLABEL_RIDER = 13; - const uint8_t CITYOBJECTLABEL_CAR = 14; - const uint8_t CITYOBJECTLABEL_TRUCK = 15; - const uint8_t CITYOBJECTLABEL_BUS = 16; - const uint8_t CITYOBJECTLABEL_TRAIN = 17; - const uint8_t CITYOBJECTLABEL_MOTORCYCLE = 18; - const uint8_t CITYOBJECTLABEL_BICYCLE = 19; - const uint8_t CITYOBJECTLABEL_STATIC = 20; - const uint8_t CITYOBJECTLABEL_DYNAMIC = 21; - const uint8_t CITYOBJECTLABEL_OTHER = 22; - const uint8_t CITYOBJECTLABEL_WATER = 23; - const uint8_t CITYOBJECTLABEL_ROADLINES = 24; - const uint8_t CITYOBJECTLABEL_GROUND = 25; - const uint8_t CITYOBJECTLABEL_BRIDGE = 26; - const uint8_t CITYOBJECTLABEL_RAILTRACK = 27; - const uint8_t CITYOBJECTLABEL_GUARDRAIL = 28; - const uint8_t CITYOBJECTLABEL_ANY = 255; - } // namespace CarlaActorInfo_Constants - /*! - * @brief This class represents the structure CarlaActorInfo defined by the user in the IDL file. - * @ingroup CarlaActorInfo - */ - class CarlaActorInfo - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaActorInfo(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaActorInfo(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. - */ - eProsima_user_DllExport CarlaActorInfo( - const CarlaActorInfo& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. - */ - eProsima_user_DllExport CarlaActorInfo( - CarlaActorInfo&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. - */ - eProsima_user_DllExport CarlaActorInfo& operator =( - const CarlaActorInfo& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. - */ - eProsima_user_DllExport CarlaActorInfo& operator =( - CarlaActorInfo&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaActorInfo object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaActorInfo& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaActorInfo object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaActorInfo& x) const; - - /*! - * @brief This function sets a value in member id - * @param _id New value for member id - */ - eProsima_user_DllExport void id( - uint64_t _id); - - /*! - * @brief This function returns the value of member id - * @return Value of member id - */ - eProsima_user_DllExport uint64_t id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport uint64_t& id(); - - /*! - * @brief This function sets a value in member parent_id - * @param _parent_id New value for member parent_id - */ - eProsima_user_DllExport void parent_id( - uint64_t _parent_id); - - /*! - * @brief This function returns the value of member parent_id - * @return Value of member parent_id - */ - eProsima_user_DllExport uint64_t parent_id() const; - - /*! - * @brief This function returns a reference to member parent_id - * @return Reference to member parent_id - */ - eProsima_user_DllExport uint64_t& parent_id(); - - /*! - * @brief This function copies the value in member type - * @param _type New value to be copied in member type - */ - eProsima_user_DllExport void type( - const std::string& _type); - - /*! - * @brief This function moves the value in member type - * @param _type New value to be moved in member type - */ - eProsima_user_DllExport void type( - std::string&& _type); - - /*! - * @brief This function returns a constant reference to member type - * @return Constant reference to member type - */ - eProsima_user_DllExport const std::string& type() const; - - /*! - * @brief This function returns a reference to member type - * @return Reference to member type - */ - eProsima_user_DllExport std::string& type(); - /*! - * @brief This function copies the value in member rosname - * @param _rosname New value to be copied in member rosname - */ - eProsima_user_DllExport void rosname( - const std::string& _rosname); - - /*! - * @brief This function moves the value in member rosname - * @param _rosname New value to be moved in member rosname - */ - eProsima_user_DllExport void rosname( - std::string&& _rosname); - - /*! - * @brief This function returns a constant reference to member rosname - * @return Constant reference to member rosname - */ - eProsima_user_DllExport const std::string& rosname() const; - - /*! - * @brief This function returns a reference to member rosname - * @return Reference to member rosname - */ - eProsima_user_DllExport std::string& rosname(); - /*! - * @brief This function copies the value in member rolename - * @param _rolename New value to be copied in member rolename - */ - eProsima_user_DllExport void rolename( - const std::string& _rolename); - - /*! - * @brief This function moves the value in member rolename - * @param _rolename New value to be moved in member rolename - */ - eProsima_user_DllExport void rolename( - std::string&& _rolename); - - /*! - * @brief This function returns a constant reference to member rolename - * @return Constant reference to member rolename - */ - eProsima_user_DllExport const std::string& rolename() const; - - /*! - * @brief This function returns a reference to member rolename - * @return Reference to member rolename - */ - eProsima_user_DllExport std::string& rolename(); - /*! - * @brief This function copies the value in member object_type - * @param _object_type New value to be copied in member object_type - */ - eProsima_user_DllExport void object_type( - const std::string& _object_type); - - /*! - * @brief This function moves the value in member object_type - * @param _object_type New value to be moved in member object_type - */ - eProsima_user_DllExport void object_type( - std::string&& _object_type); - - /*! - * @brief This function returns a constant reference to member object_type - * @return Constant reference to member object_type - */ - eProsima_user_DllExport const std::string& object_type() const; - - /*! - * @brief This function returns a reference to member object_type - * @return Reference to member object_type - */ - eProsima_user_DllExport std::string& object_type(); - /*! - * @brief This function copies the value in member base_type - * @param _base_type New value to be copied in member base_type - */ - eProsima_user_DllExport void base_type( - const std::string& _base_type); - - /*! - * @brief This function moves the value in member base_type - * @param _base_type New value to be moved in member base_type - */ - eProsima_user_DllExport void base_type( - std::string&& _base_type); - - /*! - * @brief This function returns a constant reference to member base_type - * @return Constant reference to member base_type - */ - eProsima_user_DllExport const std::string& base_type() const; - - /*! - * @brief This function returns a reference to member base_type - * @return Reference to member base_type - */ - eProsima_user_DllExport std::string& base_type(); - /*! - * @brief This function copies the value in member topic_prefix - * @param _topic_prefix New value to be copied in member topic_prefix - */ - eProsima_user_DllExport void topic_prefix( - const std::string& _topic_prefix); - - /*! - * @brief This function moves the value in member topic_prefix - * @param _topic_prefix New value to be moved in member topic_prefix - */ - eProsima_user_DllExport void topic_prefix( - std::string&& _topic_prefix); - - /*! - * @brief This function returns a constant reference to member topic_prefix - * @return Constant reference to member topic_prefix - */ - eProsima_user_DllExport const std::string& topic_prefix() const; - - /*! - * @brief This function returns a reference to member topic_prefix - * @return Reference to member topic_prefix - */ - eProsima_user_DllExport std::string& topic_prefix(); - /*! - * @brief This function copies the value in member frame_id - * @param _frame_id New value to be copied in member frame_id - */ - eProsima_user_DllExport void frame_id( - const std::string& _frame_id); - - /*! - * @brief This function moves the value in member frame_id - * @param _frame_id New value to be moved in member frame_id - */ - eProsima_user_DllExport void frame_id( - std::string&& _frame_id); - - /*! - * @brief This function returns a constant reference to member frame_id - * @return Constant reference to member frame_id - */ - eProsima_user_DllExport const std::string& frame_id() const; - - /*! - * @brief This function returns a reference to member frame_id - * @return Reference to member frame_id - */ - eProsima_user_DllExport std::string& frame_id(); - /*! - * @brief This function sets a value in member city_object_label - * @param _city_object_label New value for member city_object_label - */ - eProsima_user_DllExport void city_object_label( - uint8_t _city_object_label); - - /*! - * @brief This function returns the value of member city_object_label - * @return Value of member city_object_label - */ - eProsima_user_DllExport uint8_t city_object_label() const; - - /*! - * @brief This function returns a reference to member city_object_label - * @return Reference to member city_object_label - */ - eProsima_user_DllExport uint8_t& city_object_label(); - - /*! - * @brief This function copies the value in member attributes - * @param _attributes New value to be copied in member attributes - */ - eProsima_user_DllExport void attributes( - const std::vector& _attributes); - - /*! - * @brief This function moves the value in member attributes - * @param _attributes New value to be moved in member attributes - */ - eProsima_user_DllExport void attributes( - std::vector&& _attributes); - - /*! - * @brief This function returns a constant reference to member attributes - * @return Constant reference to member attributes - */ - eProsima_user_DllExport const std::vector& attributes() const; - - /*! - * @brief This function returns a reference to member attributes - * @return Reference to member attributes - */ - eProsima_user_DllExport std::vector& attributes(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaActorInfo& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint64_t m_id; - uint64_t m_parent_id; - std::string m_type; - std::string m_rosname; - std::string m_rolename; - std::string m_object_type; - std::string m_base_type; - std::string m_topic_prefix; - std::string m_frame_id; - uint8_t m_city_object_label; - std::vector m_attributes; - - }; - } // namespace msg + +namespace msg { + +namespace CarlaActorInfo_Constants { + +const uint8_t CITYOBJECTLABEL_NONE = 0; +const uint8_t CITYOBJECTLABEL_ROADS = 1; +const uint8_t CITYOBJECTLABEL_SIDEWALKS = 2; +const uint8_t CITYOBJECTLABEL_BUILDINGS = 3; +const uint8_t CITYOBJECTLABEL_WALLS = 4; +const uint8_t CITYOBJECTLABEL_FENCES = 5; +const uint8_t CITYOBJECTLABEL_POLES = 6; +const uint8_t CITYOBJECTLABEL_TRAFFICLIGHT = 7; +const uint8_t CITYOBJECTLABEL_TRAFFICSIGNS = 8; +const uint8_t CITYOBJECTLABEL_VEGETATION = 9; +const uint8_t CITYOBJECTLABEL_TERRAIN = 10; +const uint8_t CITYOBJECTLABEL_SKY = 11; +const uint8_t CITYOBJECTLABEL_PEDESTRIANS = 12; +const uint8_t CITYOBJECTLABEL_RIDER = 13; +const uint8_t CITYOBJECTLABEL_CAR = 14; +const uint8_t CITYOBJECTLABEL_TRUCK = 15; +const uint8_t CITYOBJECTLABEL_BUS = 16; +const uint8_t CITYOBJECTLABEL_TRAIN = 17; +const uint8_t CITYOBJECTLABEL_MOTORCYCLE = 18; +const uint8_t CITYOBJECTLABEL_BICYCLE = 19; +const uint8_t CITYOBJECTLABEL_STATIC = 20; +const uint8_t CITYOBJECTLABEL_DYNAMIC = 21; +const uint8_t CITYOBJECTLABEL_OTHER = 22; +const uint8_t CITYOBJECTLABEL_WATER = 23; +const uint8_t CITYOBJECTLABEL_ROADLINES = 24; +const uint8_t CITYOBJECTLABEL_GROUND = 25; +const uint8_t CITYOBJECTLABEL_BRIDGE = 26; +const uint8_t CITYOBJECTLABEL_RAILTRACK = 27; +const uint8_t CITYOBJECTLABEL_GUARDRAIL = 28; +const uint8_t CITYOBJECTLABEL_ANY = 255; + +} // namespace CarlaActorInfo_Constants + + + + +/*! + * @brief This class represents the structure CarlaActorInfo defined by the user in the IDL file. + * @ingroup CarlaActorInfo + */ +class CarlaActorInfo +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaActorInfo(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaActorInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. + */ + eProsima_user_DllExport CarlaActorInfo( + const CarlaActorInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. + */ + eProsima_user_DllExport CarlaActorInfo( + CarlaActorInfo&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. + */ + eProsima_user_DllExport CarlaActorInfo& operator =( + const CarlaActorInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorInfo that will be copied. + */ + eProsima_user_DllExport CarlaActorInfo& operator =( + CarlaActorInfo&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaActorInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaActorInfo& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint64_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint64_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint64_t& id(); + + + /*! + * @brief This function sets a value in member parent_id + * @param _parent_id New value for member parent_id + */ + eProsima_user_DllExport void parent_id( + uint64_t _parent_id); + + /*! + * @brief This function returns the value of member parent_id + * @return Value of member parent_id + */ + eProsima_user_DllExport uint64_t parent_id() const; + + /*! + * @brief This function returns a reference to member parent_id + * @return Reference to member parent_id + */ + eProsima_user_DllExport uint64_t& parent_id(); + + + /*! + * @brief This function copies the value in member type + * @param _type New value to be copied in member type + */ + eProsima_user_DllExport void type( + const std::string& _type); + + /*! + * @brief This function moves the value in member type + * @param _type New value to be moved in member type + */ + eProsima_user_DllExport void type( + std::string&& _type); + + /*! + * @brief This function returns a constant reference to member type + * @return Constant reference to member type + */ + eProsima_user_DllExport const std::string& type() const; + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport std::string& type(); + + + /*! + * @brief This function copies the value in member rosname + * @param _rosname New value to be copied in member rosname + */ + eProsima_user_DllExport void rosname( + const std::string& _rosname); + + /*! + * @brief This function moves the value in member rosname + * @param _rosname New value to be moved in member rosname + */ + eProsima_user_DllExport void rosname( + std::string&& _rosname); + + /*! + * @brief This function returns a constant reference to member rosname + * @return Constant reference to member rosname + */ + eProsima_user_DllExport const std::string& rosname() const; + + /*! + * @brief This function returns a reference to member rosname + * @return Reference to member rosname + */ + eProsima_user_DllExport std::string& rosname(); + + + /*! + * @brief This function copies the value in member rolename + * @param _rolename New value to be copied in member rolename + */ + eProsima_user_DllExport void rolename( + const std::string& _rolename); + + /*! + * @brief This function moves the value in member rolename + * @param _rolename New value to be moved in member rolename + */ + eProsima_user_DllExport void rolename( + std::string&& _rolename); + + /*! + * @brief This function returns a constant reference to member rolename + * @return Constant reference to member rolename + */ + eProsima_user_DllExport const std::string& rolename() const; + + /*! + * @brief This function returns a reference to member rolename + * @return Reference to member rolename + */ + eProsima_user_DllExport std::string& rolename(); + + + /*! + * @brief This function copies the value in member object_type + * @param _object_type New value to be copied in member object_type + */ + eProsima_user_DllExport void object_type( + const std::string& _object_type); + + /*! + * @brief This function moves the value in member object_type + * @param _object_type New value to be moved in member object_type + */ + eProsima_user_DllExport void object_type( + std::string&& _object_type); + + /*! + * @brief This function returns a constant reference to member object_type + * @return Constant reference to member object_type + */ + eProsima_user_DllExport const std::string& object_type() const; + + /*! + * @brief This function returns a reference to member object_type + * @return Reference to member object_type + */ + eProsima_user_DllExport std::string& object_type(); + + + /*! + * @brief This function copies the value in member base_type + * @param _base_type New value to be copied in member base_type + */ + eProsima_user_DllExport void base_type( + const std::string& _base_type); + + /*! + * @brief This function moves the value in member base_type + * @param _base_type New value to be moved in member base_type + */ + eProsima_user_DllExport void base_type( + std::string&& _base_type); + + /*! + * @brief This function returns a constant reference to member base_type + * @return Constant reference to member base_type + */ + eProsima_user_DllExport const std::string& base_type() const; + + /*! + * @brief This function returns a reference to member base_type + * @return Reference to member base_type + */ + eProsima_user_DllExport std::string& base_type(); + + + /*! + * @brief This function copies the value in member topic_prefix + * @param _topic_prefix New value to be copied in member topic_prefix + */ + eProsima_user_DllExport void topic_prefix( + const std::string& _topic_prefix); + + /*! + * @brief This function moves the value in member topic_prefix + * @param _topic_prefix New value to be moved in member topic_prefix + */ + eProsima_user_DllExport void topic_prefix( + std::string&& _topic_prefix); + + /*! + * @brief This function returns a constant reference to member topic_prefix + * @return Constant reference to member topic_prefix + */ + eProsima_user_DllExport const std::string& topic_prefix() const; + + /*! + * @brief This function returns a reference to member topic_prefix + * @return Reference to member topic_prefix + */ + eProsima_user_DllExport std::string& topic_prefix(); + + + /*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ + eProsima_user_DllExport void frame_id( + const std::string& _frame_id); + + /*! + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ + eProsima_user_DllExport void frame_id( + std::string&& _frame_id); + + /*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ + eProsima_user_DllExport const std::string& frame_id() const; + + /*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ + eProsima_user_DllExport std::string& frame_id(); + + + /*! + * @brief This function sets a value in member city_object_label + * @param _city_object_label New value for member city_object_label + */ + eProsima_user_DllExport void city_object_label( + uint8_t _city_object_label); + + /*! + * @brief This function returns the value of member city_object_label + * @return Value of member city_object_label + */ + eProsima_user_DllExport uint8_t city_object_label() const; + + /*! + * @brief This function returns a reference to member city_object_label + * @return Reference to member city_object_label + */ + eProsima_user_DllExport uint8_t& city_object_label(); + + + /*! + * @brief This function copies the value in member attributes + * @param _attributes New value to be copied in member attributes + */ + eProsima_user_DllExport void attributes( + const std::vector& _attributes); + + /*! + * @brief This function moves the value in member attributes + * @param _attributes New value to be moved in member attributes + */ + eProsima_user_DllExport void attributes( + std::vector&& _attributes); + + /*! + * @brief This function returns a constant reference to member attributes + * @return Constant reference to member attributes + */ + eProsima_user_DllExport const std::vector& attributes() const; + + /*! + * @brief This function returns a reference to member attributes + * @return Reference to member attributes + */ + eProsima_user_DllExport std::vector& attributes(); + +private: + + uint64_t m_id{0}; + uint64_t m_parent_id{0}; + std::string m_type; + std::string m_rosname; + std::string m_rolename; + std::string m_object_type; + std::string m_base_type; + std::string m_topic_prefix; + std::string m_frame_id; + uint8_t m_city_object_label{0}; + std::vector m_attributes; + +}; + +} // namespace msg + } // namespace carla_msgs #endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_H_ + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoCdrAux.hpp new file mode 100644 index 00000000000..9580e25668e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoCdrAux.hpp @@ -0,0 +1,114 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorInfoCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFOCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFOCDRAUX_HPP_ + +#include "CarlaActorInfo.h" + +constexpr uint32_t carla_msgs_msg_CarlaActorInfo_max_cdr_typesize {54256UL}; +constexpr uint32_t carla_msgs_msg_CarlaActorInfo_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorInfo& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFOCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoCdrAux.ipp new file mode 100644 index 00000000000..5a8a8e99512 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoCdrAux.ipp @@ -0,0 +1,273 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorInfoCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFOCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFOCDRAUX_IPP_ + +#include "CarlaActorInfoCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaActorInfo& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.parent_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.rosname(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.rolename(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.object_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.base_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.topic_prefix(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.frame_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.city_object_label(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.attributes(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorInfo& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.id() + << eprosima::fastcdr::MemberId(1) << data.parent_id() + << eprosima::fastcdr::MemberId(2) << data.type() + << eprosima::fastcdr::MemberId(3) << data.rosname() + << eprosima::fastcdr::MemberId(4) << data.rolename() + << eprosima::fastcdr::MemberId(5) << data.object_type() + << eprosima::fastcdr::MemberId(6) << data.base_type() + << eprosima::fastcdr::MemberId(7) << data.topic_prefix() + << eprosima::fastcdr::MemberId(8) << data.frame_id() + << eprosima::fastcdr::MemberId(9) << data.city_object_label() + << eprosima::fastcdr::MemberId(10) << data.attributes() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaActorInfo& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.id(); + break; + + case 1: + dcdr >> data.parent_id(); + break; + + case 2: + dcdr >> data.type(); + break; + + case 3: + dcdr >> data.rosname(); + break; + + case 4: + dcdr >> data.rolename(); + break; + + case 5: + dcdr >> data.object_type(); + break; + + case 6: + dcdr >> data.base_type(); + break; + + case 7: + dcdr >> data.topic_prefix(); + break; + + case 8: + dcdr >> data.frame_id(); + break; + + case 9: + dcdr >> data.city_object_label(); + break; + + case 10: + dcdr >> data.attributes(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorInfo& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFOCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx index a1c4cc061fe..bc29e9cc244 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.cxx @@ -16,21 +16,53 @@ * @file CarlaActorInfoPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaActorInfoPubSubTypes.h" +#include "CarlaActorInfoCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - namespace CarlaActorInfo_Constants { +namespace msg { +namespace CarlaActorInfo_Constants { + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -62,150 +94,170 @@ namespace carla_msgs { - } //End of namespace CarlaActorInfo_Constants - CarlaActorInfoPubSubType::CarlaActorInfoPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaActorInfo_"); - auto type_size = CarlaActorInfo::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaActorInfo::isKeyDefined(); - size_t keyLength = CarlaActorInfo::getKeyMaxCdrSerializedSize() > 16 ? - CarlaActorInfo::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - CarlaActorInfoPubSubType::~CarlaActorInfoPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } +} //End of namespace CarlaActorInfo_Constants - bool CarlaActorInfoPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaActorInfo* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - bool CarlaActorInfoPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - CarlaActorInfo* p_type = static_cast(data); +CarlaActorInfoPubSubType::CarlaActorInfoPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaActorInfo_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaActorInfo::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaActorInfo_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); +CarlaActorInfoPubSubType::~CarlaActorInfoPubSubType() +{ +} - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); +bool CarlaActorInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaActorInfo* p_type = + static_cast(data); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - return true; - } + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} - std::function CarlaActorInfoPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaActorInfoPubSubType::createData() - { - return reinterpret_cast(new CarlaActorInfo()); - } - - void CarlaActorInfoPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaActorInfoPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaActorInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaActorInfo::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaActorInfo::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +bool CarlaActorInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaActorInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaActorInfoPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaActorInfoPubSubType::createData() +{ + return reinterpret_cast(new CarlaActorInfo()); +} + +void CarlaActorInfoPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaActorInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg } //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h index 20764987dc2..fa163221697 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorInfoPubSubTypes.h @@ -16,31 +16,44 @@ * @file CarlaActorInfoPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaActorInfo.h" #include "diagnostic_msgs/msg/KeyValuePubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaActorInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs -{ - namespace msg - { - namespace CarlaActorInfo_Constants - { +namespace carla_msgs { +namespace msg { +namespace CarlaActorInfo_Constants { + + + + + + + + + + + @@ -71,75 +84,117 @@ namespace carla_msgs - } - /*! - * @brief This class represents the TopicDataType of the type CarlaActorInfo defined by the user in the IDL file. - * @ingroup CarlaActorInfo - */ - class CarlaActorInfoPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef CarlaActorInfo type; - eProsima_user_DllExport CarlaActorInfoPubSubType(); - eProsima_user_DllExport virtual ~CarlaActorInfoPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + +} // namespace CarlaActorInfo_Constants + + + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaActorInfo defined by the user in the IDL file. + * @ingroup CarlaActorInfo + */ +class CarlaActorInfoPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CarlaActorInfo type; + + eProsima_user_DllExport CarlaActorInfoPubSubType(); + + eProsima_user_DllExport ~CarlaActorInfoPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; } -} + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs #endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORINFO_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.cxx index b917f5d934a..d3bdee932aa 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaActorList.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,77 @@ char dummy; #endif // _WIN32 #include "CarlaActorList.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaActorList::CarlaActorList() -{ - // m_actors com.eprosima.idl.parser.typecode.SequenceTypeCode@79ca92b9 + +namespace carla_msgs { + +namespace msg { + + + +CarlaActorList::CarlaActorList() +{ } -carla_msgs::msg::CarlaActorList::~CarlaActorList() +CarlaActorList::~CarlaActorList() { } -carla_msgs::msg::CarlaActorList::CarlaActorList( +CarlaActorList::CarlaActorList( const CarlaActorList& x) { m_actors = x.m_actors; } -carla_msgs::msg::CarlaActorList::CarlaActorList( - CarlaActorList&& x) +CarlaActorList::CarlaActorList( + CarlaActorList&& x) noexcept { m_actors = std::move(x.m_actors); } -carla_msgs::msg::CarlaActorList& carla_msgs::msg::CarlaActorList::operator =( +CarlaActorList& CarlaActorList::operator =( const CarlaActorList& x) { m_actors = x.m_actors; - return *this; } -carla_msgs::msg::CarlaActorList& carla_msgs::msg::CarlaActorList::operator =( - CarlaActorList&& x) +CarlaActorList& CarlaActorList::operator =( + CarlaActorList&& x) noexcept { m_actors = std::move(x.m_actors); - return *this; } -bool carla_msgs::msg::CarlaActorList::operator ==( +bool CarlaActorList::operator ==( const CarlaActorList& x) const { - return (m_actors == x.m_actors); } -bool carla_msgs::msg::CarlaActorList::operator !=( +bool CarlaActorList::operator !=( const CarlaActorList& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaActorList::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaActorInfo::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaActorList::getCdrSerializedSize( - const carla_msgs::msg::CarlaActorList& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.actors().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaActorInfo::getCdrSerializedSize(data.actors().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaActorList::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_actors; -} - -void carla_msgs::msg::CarlaActorList::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_actors;} - /*! * @brief This function copies the value in member actors * @param _actors New value to be copied in member actors */ -void carla_msgs::msg::CarlaActorList::actors( +void CarlaActorList::actors( const std::vector& _actors) { m_actors = _actors; @@ -149,7 +107,7 @@ void carla_msgs::msg::CarlaActorList::actors( * @brief This function moves the value in member actors * @param _actors New value to be moved in member actors */ -void carla_msgs::msg::CarlaActorList::actors( +void CarlaActorList::actors( std::vector&& _actors) { m_actors = std::move(_actors); @@ -159,7 +117,7 @@ void carla_msgs::msg::CarlaActorList::actors( * @brief This function returns a constant reference to member actors * @return Constant reference to member actors */ -const std::vector& carla_msgs::msg::CarlaActorList::actors() const +const std::vector& CarlaActorList::actors() const { return m_actors; } @@ -168,31 +126,18 @@ const std::vector& carla_msgs::msg::CarlaActorL * @brief This function returns a reference to member actors * @return Reference to member actors */ -std::vector& carla_msgs::msg::CarlaActorList::actors() +std::vector& CarlaActorList::actors() { return m_actors; } -size_t carla_msgs::msg::CarlaActorList::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaActorList::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaActorList::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaActorListCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.h index d240a40de87..745e3efb59d 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorList.h @@ -16,20 +16,25 @@ * @file CarlaActorList.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_H_ -#include "carla_msgs/msg/CarlaActorInfo.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaActorInfo.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaActorList_SOURCE) -#define CarlaActorList_DllAPI __declspec( dllexport ) +#if defined(CARLAACTORLIST_SOURCE) +#define CARLAACTORLIST_DllAPI __declspec( dllexport ) #else -#define CarlaActorList_DllAPI __declspec( dllimport ) -#endif // CarlaActorList_SOURCE +#define CARLAACTORLIST_DllAPI __declspec( dllimport ) +#endif // CARLAACTORLIST_SOURCE #else -#define CarlaActorList_DllAPI +#define CARLAACTORLIST_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaActorList_DllAPI +#define CARLAACTORLIST_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaActorList defined by the user in the IDL file. - * @ingroup CARLAACTORLIST - */ - class CarlaActorList - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaActorList(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaActorList(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. - */ - eProsima_user_DllExport CarlaActorList( - const CarlaActorList& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. - */ - eProsima_user_DllExport CarlaActorList( - CarlaActorList&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. - */ - eProsima_user_DllExport CarlaActorList& operator =( - const CarlaActorList& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. - */ - eProsima_user_DllExport CarlaActorList& operator =( - CarlaActorList&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaActorList object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaActorList& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaActorList object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaActorList& x) const; - - /*! - * @brief This function copies the value in member actors - * @param _actors New value to be copied in member actors - */ - eProsima_user_DllExport void actors( - const std::vector& _actors); - - /*! - * @brief This function moves the value in member actors - * @param _actors New value to be moved in member actors - */ - eProsima_user_DllExport void actors( - std::vector&& _actors); - - /*! - * @brief This function returns a constant reference to member actors - * @return Constant reference to member actors - */ - eProsima_user_DllExport const std::vector& actors() const; - - /*! - * @brief This function returns a reference to member actors - * @return Reference to member actors - */ - eProsima_user_DllExport std::vector& actors(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaActorList& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_actors; - }; - } // namespace msg + +namespace msg { + + + + + +/*! + * @brief This class represents the structure CarlaActorList defined by the user in the IDL file. + * @ingroup CarlaActorList + */ +class CarlaActorList +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaActorList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaActorList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. + */ + eProsima_user_DllExport CarlaActorList( + const CarlaActorList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. + */ + eProsima_user_DllExport CarlaActorList( + CarlaActorList&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. + */ + eProsima_user_DllExport CarlaActorList& operator =( + const CarlaActorList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaActorList that will be copied. + */ + eProsima_user_DllExport CarlaActorList& operator =( + CarlaActorList&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaActorList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaActorList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaActorList& x) const; + + /*! + * @brief This function copies the value in member actors + * @param _actors New value to be copied in member actors + */ + eProsima_user_DllExport void actors( + const std::vector& _actors); + + /*! + * @brief This function moves the value in member actors + * @param _actors New value to be moved in member actors + */ + eProsima_user_DllExport void actors( + std::vector&& _actors); + + /*! + * @brief This function returns a constant reference to member actors + * @return Constant reference to member actors + */ + eProsima_user_DllExport const std::vector& actors() const; + + /*! + * @brief This function returns a reference to member actors + * @return Reference to member actors + */ + eProsima_user_DllExport std::vector& actors(); + +private: + + std::vector m_actors; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListCdrAux.hpp new file mode 100644 index 00000000000..3324d15e495 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListCdrAux.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorListCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLISTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLISTCDRAUX_HPP_ + +#include "CarlaActorList.h" + +constexpr uint32_t carla_msgs_msg_CarlaActorList_max_cdr_typesize {5425608UL}; +constexpr uint32_t carla_msgs_msg_CarlaActorList_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorList& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLISTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListCdrAux.ipp new file mode 100644 index 00000000000..6e6b0a0fdb2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListCdrAux.ipp @@ -0,0 +1,132 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaActorListCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLISTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLISTCDRAUX_IPP_ + +#include "CarlaActorListCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaActorList& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.actors(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorList& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.actors() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaActorList& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.actors(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaActorList& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLISTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.cxx index 60c088ed9e4..710e0695c7b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file CarlaActorListPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaActorListPubSubTypes.h" +#include "CarlaActorListCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaActorListPubSubType::CarlaActorListPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaActorList_"); - auto type_size = CarlaActorList::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaActorList::isKeyDefined(); - size_t keyLength = CarlaActorList::getKeyMaxCdrSerializedSize() > 16 ? - CarlaActorList::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaActorListPubSubType::~CarlaActorListPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaActorListPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaActorList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaActorListPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaActorList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaActorListPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaActorListPubSubType::createData() - { - return reinterpret_cast(new CarlaActorList()); - } - - void CarlaActorListPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaActorListPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaActorList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaActorList::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaActorList::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +CarlaActorListPubSubType::CarlaActorListPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaActorList_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaActorList::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaActorList_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaActorListPubSubType::~CarlaActorListPubSubType() +{ +} + +bool CarlaActorListPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaActorList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaActorListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaActorList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaActorListPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaActorListPubSubType::createData() +{ + return reinterpret_cast(new CarlaActorList()); +} + +void CarlaActorListPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaActorListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.h index bbaa66ed618..c66482d6635 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaActorListPubSubTypes.h @@ -16,92 +16,123 @@ * @file CarlaActorListPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaActorList.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaActorInfoPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaActorList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaActorList defined by the user in the IDL file. + * @ingroup CarlaActorList + */ +class CarlaActorListPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaActorList defined by the user in the IDL file. - * @ingroup CARLAACTORLIST - */ - class CarlaActorListPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaActorList type; + typedef CarlaActorList type; - eProsima_user_DllExport CarlaActorListPubSubType(); + eProsima_user_DllExport CarlaActorListPubSubType(); - eProsima_user_DllExport virtual ~CarlaActorListPubSubType(); + eProsima_user_DllExport ~CarlaActorListPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAACTORLIST_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.cxx index 7d5e150fb58..33f62ae230d 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaBoundingBox.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "CarlaBoundingBox.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaBoundingBox::CarlaBoundingBox() -{ - // m_center com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4a94ee4 - // m_size com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4a94ee4 +namespace carla_msgs { + +namespace msg { -} -carla_msgs::msg::CarlaBoundingBox::~CarlaBoundingBox() +CarlaBoundingBox::CarlaBoundingBox() { +} +CarlaBoundingBox::~CarlaBoundingBox() +{ } -carla_msgs::msg::CarlaBoundingBox::CarlaBoundingBox( +CarlaBoundingBox::CarlaBoundingBox( const CarlaBoundingBox& x) { m_center = x.m_center; m_size = x.m_size; } -carla_msgs::msg::CarlaBoundingBox::CarlaBoundingBox( - CarlaBoundingBox&& x) +CarlaBoundingBox::CarlaBoundingBox( + CarlaBoundingBox&& x) noexcept { m_center = std::move(x.m_center); m_size = std::move(x.m_size); } -carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaBoundingBox::operator =( +CarlaBoundingBox& CarlaBoundingBox::operator =( const CarlaBoundingBox& x) { m_center = x.m_center; m_size = x.m_size; - return *this; } -carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaBoundingBox::operator =( - CarlaBoundingBox&& x) +CarlaBoundingBox& CarlaBoundingBox::operator =( + CarlaBoundingBox&& x) noexcept { m_center = std::move(x.m_center); m_size = std::move(x.m_size); - return *this; } -bool carla_msgs::msg::CarlaBoundingBox::operator ==( +bool CarlaBoundingBox::operator ==( const CarlaBoundingBox& x) const { - - return (m_center == x.m_center && m_size == x.m_size); + return (m_center == x.m_center && + m_size == x.m_size); } -bool carla_msgs::msg::CarlaBoundingBox::operator !=( +bool CarlaBoundingBox::operator !=( const CarlaBoundingBox& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaBoundingBox::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaBoundingBox::getCdrSerializedSize( - const carla_msgs::msg::CarlaBoundingBox& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.center(), current_alignment); - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.size(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaBoundingBox::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_center; - scdr << m_size; - -} - -void carla_msgs::msg::CarlaBoundingBox::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_center; - dcdr >> m_size; -} - /*! * @brief This function copies the value in member center * @param _center New value to be copied in member center */ -void carla_msgs::msg::CarlaBoundingBox::center( +void CarlaBoundingBox::center( const geometry_msgs::msg::Vector3& _center) { m_center = _center; @@ -152,7 +110,7 @@ void carla_msgs::msg::CarlaBoundingBox::center( * @brief This function moves the value in member center * @param _center New value to be moved in member center */ -void carla_msgs::msg::CarlaBoundingBox::center( +void CarlaBoundingBox::center( geometry_msgs::msg::Vector3&& _center) { m_center = std::move(_center); @@ -162,7 +120,7 @@ void carla_msgs::msg::CarlaBoundingBox::center( * @brief This function returns a constant reference to member center * @return Constant reference to member center */ -const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::center() const +const geometry_msgs::msg::Vector3& CarlaBoundingBox::center() const { return m_center; } @@ -171,15 +129,17 @@ const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::center() c * @brief This function returns a reference to member center * @return Reference to member center */ -geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::center() +geometry_msgs::msg::Vector3& CarlaBoundingBox::center() { return m_center; } + + /*! * @brief This function copies the value in member size * @param _size New value to be copied in member size */ -void carla_msgs::msg::CarlaBoundingBox::size( +void CarlaBoundingBox::size( const geometry_msgs::msg::Vector3& _size) { m_size = _size; @@ -189,7 +149,7 @@ void carla_msgs::msg::CarlaBoundingBox::size( * @brief This function moves the value in member size * @param _size New value to be moved in member size */ -void carla_msgs::msg::CarlaBoundingBox::size( +void CarlaBoundingBox::size( geometry_msgs::msg::Vector3&& _size) { m_size = std::move(_size); @@ -199,7 +159,7 @@ void carla_msgs::msg::CarlaBoundingBox::size( * @brief This function returns a constant reference to member size * @return Constant reference to member size */ -const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::size() const +const geometry_msgs::msg::Vector3& CarlaBoundingBox::size() const { return m_size; } @@ -208,31 +168,18 @@ const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::size() con * @brief This function returns a reference to member size * @return Reference to member size */ -geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaBoundingBox::size() +geometry_msgs::msg::Vector3& CarlaBoundingBox::size() { return m_size; } -size_t carla_msgs::msg::CarlaBoundingBox::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaBoundingBox::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaBoundingBox::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaBoundingBoxCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.h index 5ab9197c590..76ca610cbb5 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBox.h @@ -16,20 +16,25 @@ * @file CarlaBoundingBox.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_H_ -#include "geometry_msgs/msg/Vector3.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "geometry_msgs/msg/Vector3.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,201 +48,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaBoundingBox_SOURCE) -#define CarlaBoundingBox_DllAPI __declspec( dllexport ) +#if defined(CARLABOUNDINGBOX_SOURCE) +#define CARLABOUNDINGBOX_DllAPI __declspec( dllexport ) #else -#define CarlaBoundingBox_DllAPI __declspec( dllimport ) -#endif // CarlaBoundingBox_SOURCE +#define CARLABOUNDINGBOX_DllAPI __declspec( dllimport ) +#endif // CARLABOUNDINGBOX_SOURCE #else -#define CarlaBoundingBox_DllAPI +#define CARLABOUNDINGBOX_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaBoundingBox_DllAPI +#define CARLABOUNDINGBOX_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaBoundingBox defined by the user in the IDL file. - * @ingroup CARLABOUNDINGBOX - */ - class CarlaBoundingBox - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaBoundingBox(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaBoundingBox(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. - */ - eProsima_user_DllExport CarlaBoundingBox( - const CarlaBoundingBox& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. - */ - eProsima_user_DllExport CarlaBoundingBox( - CarlaBoundingBox&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. - */ - eProsima_user_DllExport CarlaBoundingBox& operator =( - const CarlaBoundingBox& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. - */ - eProsima_user_DllExport CarlaBoundingBox& operator =( - CarlaBoundingBox&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaBoundingBox object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaBoundingBox& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaBoundingBox object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaBoundingBox& x) const; - - /*! - * @brief This function copies the value in member center - * @param _center New value to be copied in member center - */ - eProsima_user_DllExport void center( - const geometry_msgs::msg::Vector3& _center); - - /*! - * @brief This function moves the value in member center - * @param _center New value to be moved in member center - */ - eProsima_user_DllExport void center( - geometry_msgs::msg::Vector3&& _center); - - /*! - * @brief This function returns a constant reference to member center - * @return Constant reference to member center - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& center() const; - - /*! - * @brief This function returns a reference to member center - * @return Reference to member center - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& center(); - /*! - * @brief This function copies the value in member size - * @param _size New value to be copied in member size - */ - eProsima_user_DllExport void size( - const geometry_msgs::msg::Vector3& _size); - - /*! - * @brief This function moves the value in member size - * @param _size New value to be moved in member size - */ - eProsima_user_DllExport void size( - geometry_msgs::msg::Vector3&& _size); - - /*! - * @brief This function returns a constant reference to member size - * @return Constant reference to member size - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& size() const; - - /*! - * @brief This function returns a reference to member size - * @return Reference to member size - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& size(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaBoundingBox& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - geometry_msgs::msg::Vector3 m_center; - geometry_msgs::msg::Vector3 m_size; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaBoundingBox defined by the user in the IDL file. + * @ingroup CarlaBoundingBox + */ +class CarlaBoundingBox +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaBoundingBox(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaBoundingBox(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. + */ + eProsima_user_DllExport CarlaBoundingBox( + const CarlaBoundingBox& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. + */ + eProsima_user_DllExport CarlaBoundingBox( + CarlaBoundingBox&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. + */ + eProsima_user_DllExport CarlaBoundingBox& operator =( + const CarlaBoundingBox& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaBoundingBox that will be copied. + */ + eProsima_user_DllExport CarlaBoundingBox& operator =( + CarlaBoundingBox&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaBoundingBox object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaBoundingBox& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaBoundingBox object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaBoundingBox& x) const; + + /*! + * @brief This function copies the value in member center + * @param _center New value to be copied in member center + */ + eProsima_user_DllExport void center( + const geometry_msgs::msg::Vector3& _center); + + /*! + * @brief This function moves the value in member center + * @param _center New value to be moved in member center + */ + eProsima_user_DllExport void center( + geometry_msgs::msg::Vector3&& _center); + + /*! + * @brief This function returns a constant reference to member center + * @return Constant reference to member center + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& center() const; + + /*! + * @brief This function returns a reference to member center + * @return Reference to member center + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& center(); + + + /*! + * @brief This function copies the value in member size + * @param _size New value to be copied in member size + */ + eProsima_user_DllExport void size( + const geometry_msgs::msg::Vector3& _size); + + /*! + * @brief This function moves the value in member size + * @param _size New value to be moved in member size + */ + eProsima_user_DllExport void size( + geometry_msgs::msg::Vector3&& _size); + + /*! + * @brief This function returns a constant reference to member size + * @return Constant reference to member size + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& size() const; + + /*! + * @brief This function returns a reference to member size + * @return Reference to member size + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& size(); + +private: + + geometry_msgs::msg::Vector3 m_center; + geometry_msgs::msg::Vector3 m_size; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxCdrAux.hpp new file mode 100644 index 00000000000..cc925f190c9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaBoundingBoxCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOXCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOXCDRAUX_HPP_ + +#include "CarlaBoundingBox.h" + +constexpr uint32_t carla_msgs_msg_CarlaBoundingBox_max_cdr_typesize {64UL}; +constexpr uint32_t carla_msgs_msg_CarlaBoundingBox_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaBoundingBox& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOXCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxCdrAux.ipp new file mode 100644 index 00000000000..ee448481764 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaBoundingBoxCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOXCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOXCDRAUX_IPP_ + +#include "CarlaBoundingBoxCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaBoundingBox& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.center(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.size(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaBoundingBox& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.center() + << eprosima::fastcdr::MemberId(1) << data.size() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaBoundingBox& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.center(); + break; + + case 1: + dcdr >> data.size(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaBoundingBox& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOXCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.cxx index 835b49206f3..416066fb334 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaBoundingBoxPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaBoundingBoxPubSubTypes.h" +#include "CarlaBoundingBoxCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaBoundingBoxPubSubType::CarlaBoundingBoxPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaBoundingBox_"); - auto type_size = CarlaBoundingBox::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaBoundingBox::isKeyDefined(); - size_t keyLength = CarlaBoundingBox::getKeyMaxCdrSerializedSize() > 16 ? - CarlaBoundingBox::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaBoundingBoxPubSubType::~CarlaBoundingBoxPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaBoundingBoxPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaBoundingBox* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaBoundingBoxPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaBoundingBox* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaBoundingBoxPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaBoundingBoxPubSubType::createData() - { - return reinterpret_cast(new CarlaBoundingBox()); - } - - void CarlaBoundingBoxPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaBoundingBoxPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaBoundingBox* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaBoundingBox::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaBoundingBox::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaBoundingBoxPubSubType::CarlaBoundingBoxPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaBoundingBox_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaBoundingBox::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaBoundingBox_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaBoundingBoxPubSubType::~CarlaBoundingBoxPubSubType() +{ +} + +bool CarlaBoundingBoxPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaBoundingBox* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaBoundingBoxPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaBoundingBox* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaBoundingBoxPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaBoundingBoxPubSubType::createData() +{ + return reinterpret_cast(new CarlaBoundingBox()); +} + +void CarlaBoundingBoxPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaBoundingBoxPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.h index 6be65c2a042..b8069ead4b9 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaBoundingBoxPubSubTypes.h @@ -16,92 +16,121 @@ * @file CarlaBoundingBoxPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaBoundingBox.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "geometry_msgs/msg/Vector3PubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaBoundingBox is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaBoundingBox defined by the user in the IDL file. + * @ingroup CarlaBoundingBox + */ +class CarlaBoundingBoxPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaBoundingBox defined by the user in the IDL file. - * @ingroup CARLABOUNDINGBOX - */ - class CarlaBoundingBoxPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaBoundingBox type; + typedef CarlaBoundingBox type; - eProsima_user_DllExport CarlaBoundingBoxPubSubType(); + eProsima_user_DllExport CarlaBoundingBoxPubSubType(); - eProsima_user_DllExport virtual ~CarlaBoundingBoxPubSubType(); + eProsima_user_DllExport ~CarlaBoundingBoxPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaBoundingBox(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLABOUNDINGBOX_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.cxx index 6a71c72d358..b140cd6d875 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaCollisionEvent.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaCollisionEvent.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@31f9b85e - // m_other_actor_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@424e1977 - m_other_actor_id = 0; - // m_normal_impulse com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@10d68fcd +namespace carla_msgs { +namespace msg { -} -carla_msgs::msg::CarlaCollisionEvent::~CarlaCollisionEvent() -{ +CarlaCollisionEvent::CarlaCollisionEvent() +{ +} +CarlaCollisionEvent::~CarlaCollisionEvent() +{ } -carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent( +CarlaCollisionEvent::CarlaCollisionEvent( const CarlaCollisionEvent& x) { m_header = x.m_header; @@ -59,105 +59,53 @@ carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent( m_normal_impulse = x.m_normal_impulse; } -carla_msgs::msg::CarlaCollisionEvent::CarlaCollisionEvent( - CarlaCollisionEvent&& x) +CarlaCollisionEvent::CarlaCollisionEvent( + CarlaCollisionEvent&& x) noexcept { m_header = std::move(x.m_header); m_other_actor_id = x.m_other_actor_id; m_normal_impulse = std::move(x.m_normal_impulse); } -carla_msgs::msg::CarlaCollisionEvent& carla_msgs::msg::CarlaCollisionEvent::operator =( +CarlaCollisionEvent& CarlaCollisionEvent::operator =( const CarlaCollisionEvent& x) { m_header = x.m_header; m_other_actor_id = x.m_other_actor_id; m_normal_impulse = x.m_normal_impulse; - return *this; } -carla_msgs::msg::CarlaCollisionEvent& carla_msgs::msg::CarlaCollisionEvent::operator =( - CarlaCollisionEvent&& x) +CarlaCollisionEvent& CarlaCollisionEvent::operator =( + CarlaCollisionEvent&& x) noexcept { m_header = std::move(x.m_header); m_other_actor_id = x.m_other_actor_id; m_normal_impulse = std::move(x.m_normal_impulse); - return *this; } -bool carla_msgs::msg::CarlaCollisionEvent::operator ==( +bool CarlaCollisionEvent::operator ==( const CarlaCollisionEvent& x) const { - - return (m_header == x.m_header && m_other_actor_id == x.m_other_actor_id && m_normal_impulse == x.m_normal_impulse); + return (m_header == x.m_header && + m_other_actor_id == x.m_other_actor_id && + m_normal_impulse == x.m_normal_impulse); } -bool carla_msgs::msg::CarlaCollisionEvent::operator !=( +bool CarlaCollisionEvent::operator !=( const CarlaCollisionEvent& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaCollisionEvent::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaCollisionEvent::getCdrSerializedSize( - const carla_msgs::msg::CarlaCollisionEvent& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.normal_impulse(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaCollisionEvent::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_other_actor_id; - scdr << m_normal_impulse; - -} - -void carla_msgs::msg::CarlaCollisionEvent::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_other_actor_id; - dcdr >> m_normal_impulse; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaCollisionEvent::header( +void CarlaCollisionEvent::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -167,7 +115,7 @@ void carla_msgs::msg::CarlaCollisionEvent::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaCollisionEvent::header( +void CarlaCollisionEvent::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -177,7 +125,7 @@ void carla_msgs::msg::CarlaCollisionEvent::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& carla_msgs::msg::CarlaCollisionEvent::header() const +const std_msgs::msg::Header& CarlaCollisionEvent::header() const { return m_header; } @@ -186,15 +134,17 @@ const std_msgs::msg::Header& carla_msgs::msg::CarlaCollisionEvent::header() cons * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& carla_msgs::msg::CarlaCollisionEvent::header() +std_msgs::msg::Header& CarlaCollisionEvent::header() { return m_header; } + + /*! * @brief This function sets a value in member other_actor_id * @param _other_actor_id New value for member other_actor_id */ -void carla_msgs::msg::CarlaCollisionEvent::other_actor_id( +void CarlaCollisionEvent::other_actor_id( uint32_t _other_actor_id) { m_other_actor_id = _other_actor_id; @@ -204,7 +154,7 @@ void carla_msgs::msg::CarlaCollisionEvent::other_actor_id( * @brief This function returns the value of member other_actor_id * @return Value of member other_actor_id */ -uint32_t carla_msgs::msg::CarlaCollisionEvent::other_actor_id() const +uint32_t CarlaCollisionEvent::other_actor_id() const { return m_other_actor_id; } @@ -213,16 +163,17 @@ uint32_t carla_msgs::msg::CarlaCollisionEvent::other_actor_id() const * @brief This function returns a reference to member other_actor_id * @return Reference to member other_actor_id */ -uint32_t& carla_msgs::msg::CarlaCollisionEvent::other_actor_id() +uint32_t& CarlaCollisionEvent::other_actor_id() { return m_other_actor_id; } + /*! * @brief This function copies the value in member normal_impulse * @param _normal_impulse New value to be copied in member normal_impulse */ -void carla_msgs::msg::CarlaCollisionEvent::normal_impulse( +void CarlaCollisionEvent::normal_impulse( const geometry_msgs::msg::Vector3& _normal_impulse) { m_normal_impulse = _normal_impulse; @@ -232,7 +183,7 @@ void carla_msgs::msg::CarlaCollisionEvent::normal_impulse( * @brief This function moves the value in member normal_impulse * @param _normal_impulse New value to be moved in member normal_impulse */ -void carla_msgs::msg::CarlaCollisionEvent::normal_impulse( +void CarlaCollisionEvent::normal_impulse( geometry_msgs::msg::Vector3&& _normal_impulse) { m_normal_impulse = std::move(_normal_impulse); @@ -242,7 +193,7 @@ void carla_msgs::msg::CarlaCollisionEvent::normal_impulse( * @brief This function returns a constant reference to member normal_impulse * @return Constant reference to member normal_impulse */ -const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaCollisionEvent::normal_impulse() const +const geometry_msgs::msg::Vector3& CarlaCollisionEvent::normal_impulse() const { return m_normal_impulse; } @@ -251,31 +202,18 @@ const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaCollisionEvent::normal_ * @brief This function returns a reference to member normal_impulse * @return Reference to member normal_impulse */ -geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaCollisionEvent::normal_impulse() +geometry_msgs::msg::Vector3& CarlaCollisionEvent::normal_impulse() { return m_normal_impulse; } -size_t carla_msgs::msg::CarlaCollisionEvent::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool carla_msgs::msg::CarlaCollisionEvent::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaCollisionEvent::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaCollisionEventCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.h index 70b1234f7ce..f9d0cb25bad 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEvent.h @@ -16,21 +16,26 @@ * @file CarlaCollisionEvent.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_H_ -#include "geometry_msgs/msg/Vector3.h" -#include "std_msgs/msg/Header.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "geometry_msgs/msg/Vector3.h" +#include "std_msgs/msg/Header.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,221 +49,179 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaCollisionEvent_SOURCE) -#define CarlaCollisionEvent_DllAPI __declspec( dllexport ) +#if defined(CARLACOLLISIONEVENT_SOURCE) +#define CARLACOLLISIONEVENT_DllAPI __declspec( dllexport ) #else -#define CarlaCollisionEvent_DllAPI __declspec( dllimport ) -#endif // CarlaCollisionEvent_SOURCE +#define CARLACOLLISIONEVENT_DllAPI __declspec( dllimport ) +#endif // CARLACOLLISIONEVENT_SOURCE #else -#define CarlaCollisionEvent_DllAPI +#define CARLACOLLISIONEVENT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaCollisionEvent_DllAPI +#define CARLACOLLISIONEVENT_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaCollisionEvent defined by the user in the IDL file. - * @ingroup CARLACOLLISIONEVENT - */ - class CarlaCollisionEvent - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaCollisionEvent(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaCollisionEvent(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. - */ - eProsima_user_DllExport CarlaCollisionEvent( - const CarlaCollisionEvent& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. - */ - eProsima_user_DllExport CarlaCollisionEvent( - CarlaCollisionEvent&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. - */ - eProsima_user_DllExport CarlaCollisionEvent& operator =( - const CarlaCollisionEvent& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. - */ - eProsima_user_DllExport CarlaCollisionEvent& operator =( - CarlaCollisionEvent&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaCollisionEvent object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaCollisionEvent& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaCollisionEvent object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaCollisionEvent& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member other_actor_id - * @param _other_actor_id New value for member other_actor_id - */ - eProsima_user_DllExport void other_actor_id( - uint32_t _other_actor_id); - - /*! - * @brief This function returns the value of member other_actor_id - * @return Value of member other_actor_id - */ - eProsima_user_DllExport uint32_t other_actor_id() const; - - /*! - * @brief This function returns a reference to member other_actor_id - * @return Reference to member other_actor_id - */ - eProsima_user_DllExport uint32_t& other_actor_id(); - - /*! - * @brief This function copies the value in member normal_impulse - * @param _normal_impulse New value to be copied in member normal_impulse - */ - eProsima_user_DllExport void normal_impulse( - const geometry_msgs::msg::Vector3& _normal_impulse); - - /*! - * @brief This function moves the value in member normal_impulse - * @param _normal_impulse New value to be moved in member normal_impulse - */ - eProsima_user_DllExport void normal_impulse( - geometry_msgs::msg::Vector3&& _normal_impulse); - - /*! - * @brief This function returns a constant reference to member normal_impulse - * @return Constant reference to member normal_impulse - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& normal_impulse() const; - - /*! - * @brief This function returns a reference to member normal_impulse - * @return Reference to member normal_impulse - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& normal_impulse(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaCollisionEvent& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - uint32_t m_other_actor_id; - geometry_msgs::msg::Vector3 m_normal_impulse; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaCollisionEvent defined by the user in the IDL file. + * @ingroup CarlaCollisionEvent + */ +class CarlaCollisionEvent +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaCollisionEvent(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaCollisionEvent(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. + */ + eProsima_user_DllExport CarlaCollisionEvent( + const CarlaCollisionEvent& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. + */ + eProsima_user_DllExport CarlaCollisionEvent( + CarlaCollisionEvent&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. + */ + eProsima_user_DllExport CarlaCollisionEvent& operator =( + const CarlaCollisionEvent& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaCollisionEvent that will be copied. + */ + eProsima_user_DllExport CarlaCollisionEvent& operator =( + CarlaCollisionEvent&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaCollisionEvent object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaCollisionEvent& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaCollisionEvent object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaCollisionEvent& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member other_actor_id + * @param _other_actor_id New value for member other_actor_id + */ + eProsima_user_DllExport void other_actor_id( + uint32_t _other_actor_id); + + /*! + * @brief This function returns the value of member other_actor_id + * @return Value of member other_actor_id + */ + eProsima_user_DllExport uint32_t other_actor_id() const; + + /*! + * @brief This function returns a reference to member other_actor_id + * @return Reference to member other_actor_id + */ + eProsima_user_DllExport uint32_t& other_actor_id(); + + + /*! + * @brief This function copies the value in member normal_impulse + * @param _normal_impulse New value to be copied in member normal_impulse + */ + eProsima_user_DllExport void normal_impulse( + const geometry_msgs::msg::Vector3& _normal_impulse); + + /*! + * @brief This function moves the value in member normal_impulse + * @param _normal_impulse New value to be moved in member normal_impulse + */ + eProsima_user_DllExport void normal_impulse( + geometry_msgs::msg::Vector3&& _normal_impulse); + + /*! + * @brief This function returns a constant reference to member normal_impulse + * @return Constant reference to member normal_impulse + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& normal_impulse() const; + + /*! + * @brief This function returns a reference to member normal_impulse + * @return Reference to member normal_impulse + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& normal_impulse(); + +private: + + std_msgs::msg::Header m_header; + uint32_t m_other_actor_id{0}; + geometry_msgs::msg::Vector3 m_normal_impulse; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventCdrAux.hpp new file mode 100644 index 00000000000..ea0a11cabcc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaCollisionEventCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENTCDRAUX_HPP_ + +#include "CarlaCollisionEvent.h" + +constexpr uint32_t carla_msgs_msg_CarlaCollisionEvent_max_cdr_typesize {312UL}; +constexpr uint32_t carla_msgs_msg_CarlaCollisionEvent_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaCollisionEvent& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventCdrAux.ipp new file mode 100644 index 00000000000..24c40acf1bb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaCollisionEventCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENTCDRAUX_IPP_ + +#include "CarlaCollisionEventCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaCollisionEvent& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.other_actor_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.normal_impulse(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaCollisionEvent& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.other_actor_id() + << eprosima::fastcdr::MemberId(2) << data.normal_impulse() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaCollisionEvent& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.other_actor_id(); + break; + + case 2: + dcdr >> data.normal_impulse(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaCollisionEvent& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.cxx index 3b3d04904d3..05c03d31787 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaCollisionEventPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaCollisionEventPubSubTypes.h" +#include "CarlaCollisionEventCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaCollisionEventPubSubType::CarlaCollisionEventPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaCollisionEvent_"); - auto type_size = CarlaCollisionEvent::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaCollisionEvent::isKeyDefined(); - size_t keyLength = CarlaCollisionEvent::getKeyMaxCdrSerializedSize() > 16 ? - CarlaCollisionEvent::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaCollisionEventPubSubType::~CarlaCollisionEventPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaCollisionEventPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaCollisionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaCollisionEventPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaCollisionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaCollisionEventPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaCollisionEventPubSubType::createData() - { - return reinterpret_cast(new CarlaCollisionEvent()); - } - - void CarlaCollisionEventPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaCollisionEventPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaCollisionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaCollisionEvent::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaCollisionEvent::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaCollisionEventPubSubType::CarlaCollisionEventPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaCollisionEvent_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaCollisionEvent::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaCollisionEvent_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaCollisionEventPubSubType::~CarlaCollisionEventPubSubType() +{ +} + +bool CarlaCollisionEventPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaCollisionEvent* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaCollisionEventPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaCollisionEvent* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaCollisionEventPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaCollisionEventPubSubType::createData() +{ + return reinterpret_cast(new CarlaCollisionEvent()); +} + +void CarlaCollisionEventPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaCollisionEventPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.h index 7bce83aedc7..f6f63562d43 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaCollisionEventPubSubTypes.h @@ -16,92 +16,122 @@ * @file CarlaCollisionEventPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaCollisionEvent.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "geometry_msgs/msg/Vector3PubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaCollisionEvent is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaCollisionEvent defined by the user in the IDL file. + * @ingroup CarlaCollisionEvent + */ +class CarlaCollisionEventPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaCollisionEvent defined by the user in the IDL file. - * @ingroup CARLACOLLISIONEVENT - */ - class CarlaCollisionEventPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaCollisionEvent type; + typedef CarlaCollisionEvent type; - eProsima_user_DllExport CarlaCollisionEventPubSubType(); + eProsima_user_DllExport CarlaCollisionEventPubSubType(); - eProsima_user_DllExport virtual ~CarlaCollisionEventPubSubType(); + eProsima_user_DllExport ~CarlaCollisionEventPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACOLLISIONEVENT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.cxx index f3be268c5ef..db374c7d4fe 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaControl.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,117 +27,79 @@ char dummy; #endif // _WIN32 #include "CarlaControl.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace carla_msgs { +namespace msg { +namespace CarlaControl_Constants { + + +} // namespace CarlaControl_Constants -carla_msgs::msg::CarlaControl::CarlaControl() -{ - // m_command com.eprosima.idl.parser.typecode.PrimitiveTypeCode@11c9af63 - m_command = 0; +CarlaControl::CarlaControl() +{ } -carla_msgs::msg::CarlaControl::~CarlaControl() +CarlaControl::~CarlaControl() { } -carla_msgs::msg::CarlaControl::CarlaControl( +CarlaControl::CarlaControl( const CarlaControl& x) { m_command = x.m_command; } -carla_msgs::msg::CarlaControl::CarlaControl( - CarlaControl&& x) +CarlaControl::CarlaControl( + CarlaControl&& x) noexcept { m_command = x.m_command; } -carla_msgs::msg::CarlaControl& carla_msgs::msg::CarlaControl::operator =( +CarlaControl& CarlaControl::operator =( const CarlaControl& x) { m_command = x.m_command; - return *this; } -carla_msgs::msg::CarlaControl& carla_msgs::msg::CarlaControl::operator =( - CarlaControl&& x) +CarlaControl& CarlaControl::operator =( + CarlaControl&& x) noexcept { m_command = x.m_command; - return *this; } -bool carla_msgs::msg::CarlaControl::operator ==( +bool CarlaControl::operator ==( const CarlaControl& x) const { - return (m_command == x.m_command); } -bool carla_msgs::msg::CarlaControl::operator !=( +bool CarlaControl::operator !=( const CarlaControl& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaControl::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaControl::getCdrSerializedSize( - const carla_msgs::msg::CarlaControl& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaControl::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_command; - -} - -void carla_msgs::msg::CarlaControl::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_command; -} - /*! * @brief This function sets a value in member command * @param _command New value for member command */ -void carla_msgs::msg::CarlaControl::command( +void CarlaControl::command( int8_t _command) { m_command = _command; @@ -147,7 +109,7 @@ void carla_msgs::msg::CarlaControl::command( * @brief This function returns the value of member command * @return Value of member command */ -int8_t carla_msgs::msg::CarlaControl::command() const +int8_t CarlaControl::command() const { return m_command; } @@ -156,32 +118,18 @@ int8_t carla_msgs::msg::CarlaControl::command() const * @brief This function returns a reference to member command * @return Reference to member command */ -int8_t& carla_msgs::msg::CarlaControl::command() +int8_t& CarlaControl::command() { return m_command; } -size_t carla_msgs::msg::CarlaControl::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool carla_msgs::msg::CarlaControl::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaControl::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaControlCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.h index 807600956f5..8cebc790c8f 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControl.h @@ -16,19 +16,24 @@ * @file CarlaControl.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,174 +47,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaControl_SOURCE) -#define CarlaControl_DllAPI __declspec( dllexport ) +#if defined(CARLACONTROL_SOURCE) +#define CARLACONTROL_DllAPI __declspec( dllexport ) #else -#define CarlaControl_DllAPI __declspec( dllimport ) -#endif // CarlaControl_SOURCE +#define CARLACONTROL_DllAPI __declspec( dllimport ) +#endif // CARLACONTROL_SOURCE #else -#define CarlaControl_DllAPI +#define CARLACONTROL_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaControl_DllAPI +#define CARLACONTROL_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - namespace CarlaControl_Constants { - const int8_t PLAY = 0; - const int8_t PAUSE = 1; - const int8_t STEP_ONCE = 2; - } // namespace CarlaControl_Constants - /*! - * @brief This class represents the structure CarlaControl defined by the user in the IDL file. - * @ingroup CARLACONTROL - */ - class CarlaControl - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaControl(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaControl(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. - */ - eProsima_user_DllExport CarlaControl( - const CarlaControl& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. - */ - eProsima_user_DllExport CarlaControl( - CarlaControl&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. - */ - eProsima_user_DllExport CarlaControl& operator =( - const CarlaControl& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. - */ - eProsima_user_DllExport CarlaControl& operator =( - CarlaControl&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaControl object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaControl& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaControl object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaControl& x) const; - - /*! - * @brief This function sets a value in member command - * @param _command New value for member command - */ - eProsima_user_DllExport void command( - int8_t _command); - - /*! - * @brief This function returns the value of member command - * @return Value of member command - */ - eProsima_user_DllExport int8_t command() const; - - /*! - * @brief This function returns a reference to member command - * @return Reference to member command - */ - eProsima_user_DllExport int8_t& command(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaControl& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int8_t m_command; - }; - } // namespace msg + +namespace msg { + +namespace CarlaControl_Constants { + +const int8_t PLAY = 0; +const int8_t PAUSE = 1; +const int8_t STEP_ONCE = 2; + +} // namespace CarlaControl_Constants + + +/*! + * @brief This class represents the structure CarlaControl defined by the user in the IDL file. + * @ingroup CarlaControl + */ +class CarlaControl +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaControl(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaControl(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. + */ + eProsima_user_DllExport CarlaControl( + const CarlaControl& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. + */ + eProsima_user_DllExport CarlaControl( + CarlaControl&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. + */ + eProsima_user_DllExport CarlaControl& operator =( + const CarlaControl& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaControl that will be copied. + */ + eProsima_user_DllExport CarlaControl& operator =( + CarlaControl&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaControl object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaControl& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaControl object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaControl& x) const; + + /*! + * @brief This function sets a value in member command + * @param _command New value for member command + */ + eProsima_user_DllExport void command( + int8_t _command); + + /*! + * @brief This function returns the value of member command + * @return Value of member command + */ + eProsima_user_DllExport int8_t command() const; + + /*! + * @brief This function returns a reference to member command + * @return Reference to member command + */ + eProsima_user_DllExport int8_t& command(); + +private: + + int8_t m_command{0}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlCdrAux.hpp new file mode 100644 index 00000000000..dd35e545336 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaControlCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROLCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROLCDRAUX_HPP_ + +#include "CarlaControl.h" + +constexpr uint32_t carla_msgs_msg_CarlaControl_max_cdr_typesize {5UL}; +constexpr uint32_t carla_msgs_msg_CarlaControl_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaControl& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROLCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlCdrAux.ipp new file mode 100644 index 00000000000..d15f5134b95 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaControlCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROLCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROLCDRAUX_IPP_ + +#include "CarlaControlCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaControl& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.command(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaControl& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.command() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaControl& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.command(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaControl& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROLCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.cxx index 952965abb37..4f57db4bb82 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.cxx @@ -16,167 +16,193 @@ * @file CarlaControlPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaControlPubSubTypes.h" +#include "CarlaControlCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - namespace CarlaControl_Constants { - - - - - } //End of namespace CarlaControl_Constants - CarlaControlPubSubType::CarlaControlPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaControl_"); - auto type_size = CarlaControl::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaControl::isKeyDefined(); - size_t keyLength = CarlaControl::getKeyMaxCdrSerializedSize() > 16 ? - CarlaControl::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaControlPubSubType::~CarlaControlPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaControlPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaControlPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaControlPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaControlPubSubType::createData() - { - return reinterpret_cast(new CarlaControl()); - } - - void CarlaControlPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaControlPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaControl::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaControl::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace CarlaControl_Constants { + + + + + + + +} //End of namespace CarlaControl_Constants + + + +CarlaControlPubSubType::CarlaControlPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaControl_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaControl::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaControl_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaControlPubSubType::~CarlaControlPubSubType() +{ +} + +bool CarlaControlPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaControl* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaControlPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaControl* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaControlPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaControlPubSubType::createData() +{ + return reinterpret_cast(new CarlaControl()); +} + +void CarlaControlPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaControlPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.h index a26ea9f1605..12db88d0c4f 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaControlPubSubTypes.h @@ -16,98 +16,128 @@ * @file CarlaControlPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaControl.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs -{ - namespace msg - { - namespace CarlaControl_Constants - { +namespace carla_msgs { +namespace msg { +namespace CarlaControl_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type CarlaControl defined by the user in the IDL file. - * @ingroup CARLACONTROL - */ - class CarlaControlPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace CarlaControl_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaControl defined by the user in the IDL file. + * @ingroup CarlaControl + */ +class CarlaControlPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CarlaControl type; - typedef CarlaControl type; + eProsima_user_DllExport CarlaControlPubSubType(); - eProsima_user_DllExport CarlaControlPubSubType(); + eProsima_user_DllExport ~CarlaControlPubSubType() override; - eProsima_user_DllExport virtual ~CarlaControlPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaControl(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLACONTROL_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.cxx index 2e5cf67562d..2172ffd97bb 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaEgoVehicleControl.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,49 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaEgoVehicleControl.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@550dbc7a - - // m_throttle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7bab3f1a - m_throttle = 0.0; - // m_steer com.eprosima.idl.parser.typecode.PrimitiveTypeCode@437da279 - m_steer = 0.0; - // m_brake com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23c30a20 - m_brake = 0.0; - // m_hand_brake com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e1a0406 - m_hand_brake = false; - // m_reverse com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3cebbb30 - m_reverse = false; - // m_gear com.eprosima.idl.parser.typecode.PrimitiveTypeCode@67f639d3 - m_gear = 0; - // m_manual_gear_shift com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6253c26 - m_manual_gear_shift = false; - // m_control_priority com.eprosima.idl.parser.typecode.PrimitiveTypeCode@49049a04 - m_control_priority = 4; - -} - -carla_msgs::msg::CarlaEgoVehicleControl::~CarlaEgoVehicleControl() -{ - - +namespace carla_msgs { +namespace msg { +CarlaEgoVehicleControl::CarlaEgoVehicleControl() +{ +} +CarlaEgoVehicleControl::~CarlaEgoVehicleControl() +{ } -carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl( +CarlaEgoVehicleControl::CarlaEgoVehicleControl( const CarlaEgoVehicleControl& x) { m_header = x.m_header; @@ -83,8 +65,8 @@ carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl( m_control_priority = x.m_control_priority; } -carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl( - CarlaEgoVehicleControl&& x) +CarlaEgoVehicleControl::CarlaEgoVehicleControl( + CarlaEgoVehicleControl&& x) noexcept { m_header = std::move(x.m_header); m_throttle = x.m_throttle; @@ -97,7 +79,7 @@ carla_msgs::msg::CarlaEgoVehicleControl::CarlaEgoVehicleControl( m_control_priority = x.m_control_priority; } -carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl::operator =( +CarlaEgoVehicleControl& CarlaEgoVehicleControl::operator =( const CarlaEgoVehicleControl& x) { @@ -110,12 +92,11 @@ carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl m_gear = x.m_gear; m_manual_gear_shift = x.m_manual_gear_shift; m_control_priority = x.m_control_priority; - return *this; } -carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl::operator =( - CarlaEgoVehicleControl&& x) +CarlaEgoVehicleControl& CarlaEgoVehicleControl::operator =( + CarlaEgoVehicleControl&& x) noexcept { m_header = std::move(x.m_header); @@ -127,131 +108,34 @@ carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleControl m_gear = x.m_gear; m_manual_gear_shift = x.m_manual_gear_shift; m_control_priority = x.m_control_priority; - return *this; } -bool carla_msgs::msg::CarlaEgoVehicleControl::operator ==( +bool CarlaEgoVehicleControl::operator ==( const CarlaEgoVehicleControl& x) const { - - return (m_header == x.m_header && m_throttle == x.m_throttle && m_steer == x.m_steer && m_brake == x.m_brake && m_hand_brake == x.m_hand_brake && m_reverse == x.m_reverse && m_gear == x.m_gear && m_manual_gear_shift == x.m_manual_gear_shift && m_control_priority == x.m_control_priority); + return (m_header == x.m_header && + m_throttle == x.m_throttle && + m_steer == x.m_steer && + m_brake == x.m_brake && + m_hand_brake == x.m_hand_brake && + m_reverse == x.m_reverse && + m_gear == x.m_gear && + m_manual_gear_shift == x.m_manual_gear_shift && + m_control_priority == x.m_control_priority); } -bool carla_msgs::msg::CarlaEgoVehicleControl::operator !=( +bool CarlaEgoVehicleControl::operator !=( const CarlaEgoVehicleControl& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaEgoVehicleControl::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaEgoVehicleControl::getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleControl& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaEgoVehicleControl::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_throttle; - scdr << m_steer; - scdr << m_brake; - scdr << m_hand_brake; - scdr << m_reverse; - scdr << m_gear; - scdr << m_manual_gear_shift; - scdr << m_control_priority; - -} - -void carla_msgs::msg::CarlaEgoVehicleControl::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_throttle; - dcdr >> m_steer; - dcdr >> m_brake; - dcdr >> m_hand_brake; - dcdr >> m_reverse; - dcdr >> m_gear; - dcdr >> m_manual_gear_shift; - dcdr >> m_control_priority; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaEgoVehicleControl::header( +void CarlaEgoVehicleControl::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -261,7 +145,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaEgoVehicleControl::header( +void CarlaEgoVehicleControl::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -271,7 +155,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleControl::header() const +const std_msgs::msg::Header& CarlaEgoVehicleControl::header() const { return m_header; } @@ -280,15 +164,17 @@ const std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleControl::header() c * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleControl::header() +std_msgs::msg::Header& CarlaEgoVehicleControl::header() { return m_header; } + + /*! * @brief This function sets a value in member throttle * @param _throttle New value for member throttle */ -void carla_msgs::msg::CarlaEgoVehicleControl::throttle( +void CarlaEgoVehicleControl::throttle( float _throttle) { m_throttle = _throttle; @@ -298,7 +184,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::throttle( * @brief This function returns the value of member throttle * @return Value of member throttle */ -float carla_msgs::msg::CarlaEgoVehicleControl::throttle() const +float CarlaEgoVehicleControl::throttle() const { return m_throttle; } @@ -307,16 +193,17 @@ float carla_msgs::msg::CarlaEgoVehicleControl::throttle() const * @brief This function returns a reference to member throttle * @return Reference to member throttle */ -float& carla_msgs::msg::CarlaEgoVehicleControl::throttle() +float& CarlaEgoVehicleControl::throttle() { return m_throttle; } + /*! * @brief This function sets a value in member steer * @param _steer New value for member steer */ -void carla_msgs::msg::CarlaEgoVehicleControl::steer( +void CarlaEgoVehicleControl::steer( float _steer) { m_steer = _steer; @@ -326,7 +213,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::steer( * @brief This function returns the value of member steer * @return Value of member steer */ -float carla_msgs::msg::CarlaEgoVehicleControl::steer() const +float CarlaEgoVehicleControl::steer() const { return m_steer; } @@ -335,16 +222,17 @@ float carla_msgs::msg::CarlaEgoVehicleControl::steer() const * @brief This function returns a reference to member steer * @return Reference to member steer */ -float& carla_msgs::msg::CarlaEgoVehicleControl::steer() +float& CarlaEgoVehicleControl::steer() { return m_steer; } + /*! * @brief This function sets a value in member brake * @param _brake New value for member brake */ -void carla_msgs::msg::CarlaEgoVehicleControl::brake( +void CarlaEgoVehicleControl::brake( float _brake) { m_brake = _brake; @@ -354,7 +242,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::brake( * @brief This function returns the value of member brake * @return Value of member brake */ -float carla_msgs::msg::CarlaEgoVehicleControl::brake() const +float CarlaEgoVehicleControl::brake() const { return m_brake; } @@ -363,16 +251,17 @@ float carla_msgs::msg::CarlaEgoVehicleControl::brake() const * @brief This function returns a reference to member brake * @return Reference to member brake */ -float& carla_msgs::msg::CarlaEgoVehicleControl::brake() +float& CarlaEgoVehicleControl::brake() { return m_brake; } + /*! * @brief This function sets a value in member hand_brake * @param _hand_brake New value for member hand_brake */ -void carla_msgs::msg::CarlaEgoVehicleControl::hand_brake( +void CarlaEgoVehicleControl::hand_brake( bool _hand_brake) { m_hand_brake = _hand_brake; @@ -382,7 +271,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::hand_brake( * @brief This function returns the value of member hand_brake * @return Value of member hand_brake */ -bool carla_msgs::msg::CarlaEgoVehicleControl::hand_brake() const +bool CarlaEgoVehicleControl::hand_brake() const { return m_hand_brake; } @@ -391,16 +280,17 @@ bool carla_msgs::msg::CarlaEgoVehicleControl::hand_brake() const * @brief This function returns a reference to member hand_brake * @return Reference to member hand_brake */ -bool& carla_msgs::msg::CarlaEgoVehicleControl::hand_brake() +bool& CarlaEgoVehicleControl::hand_brake() { return m_hand_brake; } + /*! * @brief This function sets a value in member reverse * @param _reverse New value for member reverse */ -void carla_msgs::msg::CarlaEgoVehicleControl::reverse( +void CarlaEgoVehicleControl::reverse( bool _reverse) { m_reverse = _reverse; @@ -410,7 +300,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::reverse( * @brief This function returns the value of member reverse * @return Value of member reverse */ -bool carla_msgs::msg::CarlaEgoVehicleControl::reverse() const +bool CarlaEgoVehicleControl::reverse() const { return m_reverse; } @@ -419,16 +309,17 @@ bool carla_msgs::msg::CarlaEgoVehicleControl::reverse() const * @brief This function returns a reference to member reverse * @return Reference to member reverse */ -bool& carla_msgs::msg::CarlaEgoVehicleControl::reverse() +bool& CarlaEgoVehicleControl::reverse() { return m_reverse; } + /*! * @brief This function sets a value in member gear * @param _gear New value for member gear */ -void carla_msgs::msg::CarlaEgoVehicleControl::gear( +void CarlaEgoVehicleControl::gear( int32_t _gear) { m_gear = _gear; @@ -438,7 +329,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::gear( * @brief This function returns the value of member gear * @return Value of member gear */ -int32_t carla_msgs::msg::CarlaEgoVehicleControl::gear() const +int32_t CarlaEgoVehicleControl::gear() const { return m_gear; } @@ -447,16 +338,17 @@ int32_t carla_msgs::msg::CarlaEgoVehicleControl::gear() const * @brief This function returns a reference to member gear * @return Reference to member gear */ -int32_t& carla_msgs::msg::CarlaEgoVehicleControl::gear() +int32_t& CarlaEgoVehicleControl::gear() { return m_gear; } + /*! * @brief This function sets a value in member manual_gear_shift * @param _manual_gear_shift New value for member manual_gear_shift */ -void carla_msgs::msg::CarlaEgoVehicleControl::manual_gear_shift( +void CarlaEgoVehicleControl::manual_gear_shift( bool _manual_gear_shift) { m_manual_gear_shift = _manual_gear_shift; @@ -466,7 +358,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::manual_gear_shift( * @brief This function returns the value of member manual_gear_shift * @return Value of member manual_gear_shift */ -bool carla_msgs::msg::CarlaEgoVehicleControl::manual_gear_shift() const +bool CarlaEgoVehicleControl::manual_gear_shift() const { return m_manual_gear_shift; } @@ -475,16 +367,17 @@ bool carla_msgs::msg::CarlaEgoVehicleControl::manual_gear_shift() const * @brief This function returns a reference to member manual_gear_shift * @return Reference to member manual_gear_shift */ -bool& carla_msgs::msg::CarlaEgoVehicleControl::manual_gear_shift() +bool& CarlaEgoVehicleControl::manual_gear_shift() { return m_manual_gear_shift; } + /*! * @brief This function sets a value in member control_priority * @param _control_priority New value for member control_priority */ -void carla_msgs::msg::CarlaEgoVehicleControl::control_priority( +void CarlaEgoVehicleControl::control_priority( uint8_t _control_priority) { m_control_priority = _control_priority; @@ -494,7 +387,7 @@ void carla_msgs::msg::CarlaEgoVehicleControl::control_priority( * @brief This function returns the value of member control_priority * @return Value of member control_priority */ -uint8_t carla_msgs::msg::CarlaEgoVehicleControl::control_priority() const +uint8_t CarlaEgoVehicleControl::control_priority() const { return m_control_priority; } @@ -503,32 +396,18 @@ uint8_t carla_msgs::msg::CarlaEgoVehicleControl::control_priority() const * @brief This function returns a reference to member control_priority * @return Reference to member control_priority */ -uint8_t& carla_msgs::msg::CarlaEgoVehicleControl::control_priority() +uint8_t& CarlaEgoVehicleControl::control_priority() { return m_control_priority; } -size_t carla_msgs::msg::CarlaEgoVehicleControl::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool carla_msgs::msg::CarlaEgoVehicleControl::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaEgoVehicleControl::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaEgoVehicleControlCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.h index 3590c6e70f3..a8566142681 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControl.h @@ -16,20 +16,25 @@ * @file CarlaEgoVehicleControl.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_H_ -#include "std_msgs/msg/Header.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "std_msgs/msg/Header.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,335 +48,298 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaEgoVehicleControl_SOURCE) -#define CarlaEgoVehicleControl_DllAPI __declspec( dllexport ) +#if defined(CARLAEGOVEHICLECONTROL_SOURCE) +#define CARLAEGOVEHICLECONTROL_DllAPI __declspec( dllexport ) #else -#define CarlaEgoVehicleControl_DllAPI __declspec( dllimport ) -#endif // CarlaEgoVehicleControl_SOURCE +#define CARLAEGOVEHICLECONTROL_DllAPI __declspec( dllimport ) +#endif // CARLAEGOVEHICLECONTROL_SOURCE #else -#define CarlaEgoVehicleControl_DllAPI +#define CARLAEGOVEHICLECONTROL_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaEgoVehicleControl_DllAPI +#define CARLAEGOVEHICLECONTROL_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaEgoVehicleControl defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLECONTROL - */ - class CarlaEgoVehicleControl - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaEgoVehicleControl(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaEgoVehicleControl(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleControl( - const CarlaEgoVehicleControl& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleControl( - CarlaEgoVehicleControl&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleControl& operator =( - const CarlaEgoVehicleControl& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleControl& operator =( - CarlaEgoVehicleControl&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleControl object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaEgoVehicleControl& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleControl object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaEgoVehicleControl& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member throttle - * @param _throttle New value for member throttle - */ - eProsima_user_DllExport void throttle( - float _throttle); - - /*! - * @brief This function returns the value of member throttle - * @return Value of member throttle - */ - eProsima_user_DllExport float throttle() const; - - /*! - * @brief This function returns a reference to member throttle - * @return Reference to member throttle - */ - eProsima_user_DllExport float& throttle(); - - /*! - * @brief This function sets a value in member steer - * @param _steer New value for member steer - */ - eProsima_user_DllExport void steer( - float _steer); - - /*! - * @brief This function returns the value of member steer - * @return Value of member steer - */ - eProsima_user_DllExport float steer() const; - - /*! - * @brief This function returns a reference to member steer - * @return Reference to member steer - */ - eProsima_user_DllExport float& steer(); - - /*! - * @brief This function sets a value in member brake - * @param _brake New value for member brake - */ - eProsima_user_DllExport void brake( - float _brake); - - /*! - * @brief This function returns the value of member brake - * @return Value of member brake - */ - eProsima_user_DllExport float brake() const; - - /*! - * @brief This function returns a reference to member brake - * @return Reference to member brake - */ - eProsima_user_DllExport float& brake(); - - /*! - * @brief This function sets a value in member hand_brake - * @param _hand_brake New value for member hand_brake - */ - eProsima_user_DllExport void hand_brake( - bool _hand_brake); - - /*! - * @brief This function returns the value of member hand_brake - * @return Value of member hand_brake - */ - eProsima_user_DllExport bool hand_brake() const; - - /*! - * @brief This function returns a reference to member hand_brake - * @return Reference to member hand_brake - */ - eProsima_user_DllExport bool& hand_brake(); - - /*! - * @brief This function sets a value in member reverse - * @param _reverse New value for member reverse - */ - eProsima_user_DllExport void reverse( - bool _reverse); - - /*! - * @brief This function returns the value of member reverse - * @return Value of member reverse - */ - eProsima_user_DllExport bool reverse() const; - - /*! - * @brief This function returns a reference to member reverse - * @return Reference to member reverse - */ - eProsima_user_DllExport bool& reverse(); - - /*! - * @brief This function sets a value in member gear - * @param _gear New value for member gear - */ - eProsima_user_DllExport void gear( - int32_t _gear); - - /*! - * @brief This function returns the value of member gear - * @return Value of member gear - */ - eProsima_user_DllExport int32_t gear() const; - - /*! - * @brief This function returns a reference to member gear - * @return Reference to member gear - */ - eProsima_user_DllExport int32_t& gear(); - - /*! - * @brief This function sets a value in member manual_gear_shift - * @param _manual_gear_shift New value for member manual_gear_shift - */ - eProsima_user_DllExport void manual_gear_shift( - bool _manual_gear_shift); - - /*! - * @brief This function returns the value of member manual_gear_shift - * @return Value of member manual_gear_shift - */ - eProsima_user_DllExport bool manual_gear_shift() const; - - /*! - * @brief This function returns a reference to member manual_gear_shift - * @return Reference to member manual_gear_shift - */ - eProsima_user_DllExport bool& manual_gear_shift(); - - /*! - * @brief This function sets a value in member control_priority - * @param _control_priority New value for member control_priority - */ - eProsima_user_DllExport void control_priority( - uint8_t _control_priority); - - /*! - * @brief This function returns the value of member control_priority - * @return Value of member control_priority - */ - eProsima_user_DllExport uint8_t control_priority() const; - - /*! - * @brief This function returns a reference to member control_priority - * @return Reference to member control_priority - */ - eProsima_user_DllExport uint8_t& control_priority(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleControl& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - float m_throttle; - float m_steer; - float m_brake; - bool m_hand_brake; - bool m_reverse; - int32_t m_gear; - bool m_manual_gear_shift; - uint8_t m_control_priority; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaEgoVehicleControl defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleControl + */ +class CarlaEgoVehicleControl +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleControl(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleControl(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleControl( + const CarlaEgoVehicleControl& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleControl( + CarlaEgoVehicleControl&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleControl& operator =( + const CarlaEgoVehicleControl& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleControl that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleControl& operator =( + CarlaEgoVehicleControl&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleControl object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleControl& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleControl object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleControl& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member throttle + * @param _throttle New value for member throttle + */ + eProsima_user_DllExport void throttle( + float _throttle); + + /*! + * @brief This function returns the value of member throttle + * @return Value of member throttle + */ + eProsima_user_DllExport float throttle() const; + + /*! + * @brief This function returns a reference to member throttle + * @return Reference to member throttle + */ + eProsima_user_DllExport float& throttle(); + + + /*! + * @brief This function sets a value in member steer + * @param _steer New value for member steer + */ + eProsima_user_DllExport void steer( + float _steer); + + /*! + * @brief This function returns the value of member steer + * @return Value of member steer + */ + eProsima_user_DllExport float steer() const; + + /*! + * @brief This function returns a reference to member steer + * @return Reference to member steer + */ + eProsima_user_DllExport float& steer(); + + + /*! + * @brief This function sets a value in member brake + * @param _brake New value for member brake + */ + eProsima_user_DllExport void brake( + float _brake); + + /*! + * @brief This function returns the value of member brake + * @return Value of member brake + */ + eProsima_user_DllExport float brake() const; + + /*! + * @brief This function returns a reference to member brake + * @return Reference to member brake + */ + eProsima_user_DllExport float& brake(); + + + /*! + * @brief This function sets a value in member hand_brake + * @param _hand_brake New value for member hand_brake + */ + eProsima_user_DllExport void hand_brake( + bool _hand_brake); + + /*! + * @brief This function returns the value of member hand_brake + * @return Value of member hand_brake + */ + eProsima_user_DllExport bool hand_brake() const; + + /*! + * @brief This function returns a reference to member hand_brake + * @return Reference to member hand_brake + */ + eProsima_user_DllExport bool& hand_brake(); + + + /*! + * @brief This function sets a value in member reverse + * @param _reverse New value for member reverse + */ + eProsima_user_DllExport void reverse( + bool _reverse); + + /*! + * @brief This function returns the value of member reverse + * @return Value of member reverse + */ + eProsima_user_DllExport bool reverse() const; + + /*! + * @brief This function returns a reference to member reverse + * @return Reference to member reverse + */ + eProsima_user_DllExport bool& reverse(); + + + /*! + * @brief This function sets a value in member gear + * @param _gear New value for member gear + */ + eProsima_user_DllExport void gear( + int32_t _gear); + + /*! + * @brief This function returns the value of member gear + * @return Value of member gear + */ + eProsima_user_DllExport int32_t gear() const; + + /*! + * @brief This function returns a reference to member gear + * @return Reference to member gear + */ + eProsima_user_DllExport int32_t& gear(); + + + /*! + * @brief This function sets a value in member manual_gear_shift + * @param _manual_gear_shift New value for member manual_gear_shift + */ + eProsima_user_DllExport void manual_gear_shift( + bool _manual_gear_shift); + + /*! + * @brief This function returns the value of member manual_gear_shift + * @return Value of member manual_gear_shift + */ + eProsima_user_DllExport bool manual_gear_shift() const; + + /*! + * @brief This function returns a reference to member manual_gear_shift + * @return Reference to member manual_gear_shift + */ + eProsima_user_DllExport bool& manual_gear_shift(); + + + /*! + * @brief This function sets a value in member control_priority + * @param _control_priority New value for member control_priority + */ + eProsima_user_DllExport void control_priority( + uint8_t _control_priority); + + /*! + * @brief This function returns the value of member control_priority + * @return Value of member control_priority + */ + eProsima_user_DllExport uint8_t control_priority() const; + + /*! + * @brief This function returns a reference to member control_priority + * @return Reference to member control_priority + */ + eProsima_user_DllExport uint8_t& control_priority(); + +private: + + std_msgs::msg::Header m_header; + float m_throttle{0.0}; + float m_steer{0.0}; + float m_brake{0.0}; + bool m_hand_brake{false}; + bool m_reverse{false}; + int32_t m_gear{0}; + bool m_manual_gear_shift{false}; + uint8_t m_control_priority{4}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlCdrAux.hpp new file mode 100644 index 00000000000..defee7b76b2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleControlCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROLCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROLCDRAUX_HPP_ + +#include "CarlaEgoVehicleControl.h" + +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleControl_max_cdr_typesize {302UL}; +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleControl_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleControl& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROLCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlCdrAux.ipp new file mode 100644 index 00000000000..f7c24e9d882 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlCdrAux.ipp @@ -0,0 +1,194 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleControlCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROLCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROLCDRAUX_IPP_ + +#include "CarlaEgoVehicleControlCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaEgoVehicleControl& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.throttle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.steer(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.brake(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.hand_brake(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.reverse(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.gear(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.manual_gear_shift(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.control_priority(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleControl& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.throttle() + << eprosima::fastcdr::MemberId(2) << data.steer() + << eprosima::fastcdr::MemberId(3) << data.brake() + << eprosima::fastcdr::MemberId(4) << data.hand_brake() + << eprosima::fastcdr::MemberId(5) << data.reverse() + << eprosima::fastcdr::MemberId(6) << data.gear() + << eprosima::fastcdr::MemberId(7) << data.manual_gear_shift() + << eprosima::fastcdr::MemberId(8) << data.control_priority() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaEgoVehicleControl& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.throttle(); + break; + + case 2: + dcdr >> data.steer(); + break; + + case 3: + dcdr >> data.brake(); + break; + + case 4: + dcdr >> data.hand_brake(); + break; + + case 5: + dcdr >> data.reverse(); + break; + + case 6: + dcdr >> data.gear(); + break; + + case 7: + dcdr >> data.manual_gear_shift(); + break; + + case 8: + dcdr >> data.control_priority(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleControl& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROLCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.cxx index 848b04376a9..2d1caed9195 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaEgoVehicleControlPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaEgoVehicleControlPubSubTypes.h" +#include "CarlaEgoVehicleControlCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaEgoVehicleControlPubSubType::CarlaEgoVehicleControlPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaEgoVehicleControl_"); - auto type_size = CarlaEgoVehicleControl::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaEgoVehicleControl::isKeyDefined(); - size_t keyLength = CarlaEgoVehicleControl::getKeyMaxCdrSerializedSize() > 16 ? - CarlaEgoVehicleControl::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaEgoVehicleControlPubSubType::~CarlaEgoVehicleControlPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaEgoVehicleControlPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaEgoVehicleControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaEgoVehicleControlPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaEgoVehicleControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaEgoVehicleControlPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaEgoVehicleControlPubSubType::createData() - { - return reinterpret_cast(new CarlaEgoVehicleControl()); - } - - void CarlaEgoVehicleControlPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaEgoVehicleControlPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaEgoVehicleControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaEgoVehicleControl::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaEgoVehicleControl::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaEgoVehicleControlPubSubType::CarlaEgoVehicleControlPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaEgoVehicleControl_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaEgoVehicleControl::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaEgoVehicleControl_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaEgoVehicleControlPubSubType::~CarlaEgoVehicleControlPubSubType() +{ +} + +bool CarlaEgoVehicleControlPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaEgoVehicleControl* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaEgoVehicleControlPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaEgoVehicleControl* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaEgoVehicleControlPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaEgoVehicleControlPubSubType::createData() +{ + return reinterpret_cast(new CarlaEgoVehicleControl()); +} + +void CarlaEgoVehicleControlPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaEgoVehicleControlPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.h index 1ccae436e6e..f8dc4a6f9c7 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleControlPubSubTypes.h @@ -16,92 +16,121 @@ * @file CarlaEgoVehicleControlPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaEgoVehicleControl.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaEgoVehicleControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleControl defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleControl + */ +class CarlaEgoVehicleControlPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaEgoVehicleControl defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLECONTROL - */ - class CarlaEgoVehicleControlPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaEgoVehicleControl type; + typedef CarlaEgoVehicleControl type; - eProsima_user_DllExport CarlaEgoVehicleControlPubSubType(); + eProsima_user_DllExport CarlaEgoVehicleControlPubSubType(); - eProsima_user_DllExport virtual ~CarlaEgoVehicleControlPubSubType(); + eProsima_user_DllExport ~CarlaEgoVehicleControlPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLECONTROL_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx index 992175d15ff..e7156271efb 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaEgoVehicleInfo.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,67 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaEgoVehicleInfo.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo() -{ - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@45018215 - m_id = 0; - // m_type com.eprosima.idl.parser.typecode.StringTypeCode@65d6b83b - m_type =""; - // m_rolename com.eprosima.idl.parser.typecode.StringTypeCode@d706f19 - m_rolename =""; - // m_wheels com.eprosima.idl.parser.typecode.SequenceTypeCode@30b7c004 - - // m_max_rpm com.eprosima.idl.parser.typecode.PrimitiveTypeCode@79efed2d - m_max_rpm = 0.0; - // m_moi com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2928854b - m_moi = 0.0; - // m_damping_rate_full_throttle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27ae2fd0 - m_damping_rate_full_throttle = 0.0; - // m_damping_rate_zero_throttle_clutch_engaged com.eprosima.idl.parser.typecode.PrimitiveTypeCode@29176cc1 - m_damping_rate_zero_throttle_clutch_engaged = 0.0; - // m_damping_rate_zero_throttle_clutch_disengaged com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2f177a4b - m_damping_rate_zero_throttle_clutch_disengaged = 0.0; - // m_use_gear_autobox com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4278a03f - m_use_gear_autobox = false; - // m_gear_switch_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61dd025 - m_gear_switch_time = 0.0; - // m_clutch_strength com.eprosima.idl.parser.typecode.PrimitiveTypeCode@124c278f - m_clutch_strength = 0.0; - // m_mass com.eprosima.idl.parser.typecode.PrimitiveTypeCode@15b204a1 - m_mass = 0.0; - // m_drag_coefficient com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77167fb7 - m_drag_coefficient = 0.0; - // m_center_of_mass com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1fe20588 - - -} - -carla_msgs::msg::CarlaEgoVehicleInfo::~CarlaEgoVehicleInfo() -{ - - - - - - - - +namespace carla_msgs { +namespace msg { +CarlaEgoVehicleInfo::CarlaEgoVehicleInfo() +{ +} +CarlaEgoVehicleInfo::~CarlaEgoVehicleInfo() +{ } -carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( +CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( const CarlaEgoVehicleInfo& x) { m_id = x.m_id; @@ -107,8 +71,8 @@ carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( m_center_of_mass = x.m_center_of_mass; } -carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( - CarlaEgoVehicleInfo&& x) +CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( + CarlaEgoVehicleInfo&& x) noexcept { m_id = x.m_id; m_type = std::move(x.m_type); @@ -127,7 +91,7 @@ carla_msgs::msg::CarlaEgoVehicleInfo::CarlaEgoVehicleInfo( m_center_of_mass = std::move(x.m_center_of_mass); } -carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::operator =( +CarlaEgoVehicleInfo& CarlaEgoVehicleInfo::operator =( const CarlaEgoVehicleInfo& x) { @@ -146,12 +110,11 @@ carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::oper m_mass = x.m_mass; m_drag_coefficient = x.m_drag_coefficient; m_center_of_mass = x.m_center_of_mass; - return *this; } -carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::operator =( - CarlaEgoVehicleInfo&& x) +CarlaEgoVehicleInfo& CarlaEgoVehicleInfo::operator =( + CarlaEgoVehicleInfo&& x) noexcept { m_id = x.m_id; @@ -169,183 +132,40 @@ carla_msgs::msg::CarlaEgoVehicleInfo& carla_msgs::msg::CarlaEgoVehicleInfo::oper m_mass = x.m_mass; m_drag_coefficient = x.m_drag_coefficient; m_center_of_mass = std::move(x.m_center_of_mass); - return *this; } -bool carla_msgs::msg::CarlaEgoVehicleInfo::operator ==( +bool CarlaEgoVehicleInfo::operator ==( const CarlaEgoVehicleInfo& x) const { - - return (m_id == x.m_id && m_type == x.m_type && m_rolename == x.m_rolename && m_wheels == x.m_wheels && m_max_rpm == x.m_max_rpm && m_moi == x.m_moi && m_damping_rate_full_throttle == x.m_damping_rate_full_throttle && m_damping_rate_zero_throttle_clutch_engaged == x.m_damping_rate_zero_throttle_clutch_engaged && m_damping_rate_zero_throttle_clutch_disengaged == x.m_damping_rate_zero_throttle_clutch_disengaged && m_use_gear_autobox == x.m_use_gear_autobox && m_gear_switch_time == x.m_gear_switch_time && m_clutch_strength == x.m_clutch_strength && m_mass == x.m_mass && m_drag_coefficient == x.m_drag_coefficient && m_center_of_mass == x.m_center_of_mass); -} - -bool carla_msgs::msg::CarlaEgoVehicleInfo::operator !=( + return (m_id == x.m_id && + m_type == x.m_type && + m_rolename == x.m_rolename && + m_wheels == x.m_wheels && + m_max_rpm == x.m_max_rpm && + m_moi == x.m_moi && + m_damping_rate_full_throttle == x.m_damping_rate_full_throttle && + m_damping_rate_zero_throttle_clutch_engaged == x.m_damping_rate_zero_throttle_clutch_engaged && + m_damping_rate_zero_throttle_clutch_disengaged == x.m_damping_rate_zero_throttle_clutch_disengaged && + m_use_gear_autobox == x.m_use_gear_autobox && + m_gear_switch_time == x.m_gear_switch_time && + m_clutch_strength == x.m_clutch_strength && + m_mass == x.m_mass && + m_drag_coefficient == x.m_drag_coefficient && + m_center_of_mass == x.m_center_of_mass); +} + +bool CarlaEgoVehicleInfo::operator !=( const CarlaEgoVehicleInfo& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaEgoVehicleInfo::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaEgoVehicleInfoWheel::getMaxCdrSerializedSize(current_alignment);} - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaEgoVehicleInfo::getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleInfo& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.rolename().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.wheels().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaEgoVehicleInfoWheel::getCdrSerializedSize(data.wheels().at(a), current_alignment);} - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.center_of_mass(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaEgoVehicleInfo::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_id; - scdr << m_type; - scdr << m_rolename; - scdr << m_wheels; - scdr << m_max_rpm; - scdr << m_moi; - scdr << m_damping_rate_full_throttle; - scdr << m_damping_rate_zero_throttle_clutch_engaged; - scdr << m_damping_rate_zero_throttle_clutch_disengaged; - scdr << m_use_gear_autobox; - scdr << m_gear_switch_time; - scdr << m_clutch_strength; - scdr << m_mass; - scdr << m_drag_coefficient; - scdr << m_center_of_mass; - -} - -void carla_msgs::msg::CarlaEgoVehicleInfo::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_id; - dcdr >> m_type; - dcdr >> m_rolename; - dcdr >> m_wheels; - dcdr >> m_max_rpm; - dcdr >> m_moi; - dcdr >> m_damping_rate_full_throttle; - dcdr >> m_damping_rate_zero_throttle_clutch_engaged; - dcdr >> m_damping_rate_zero_throttle_clutch_disengaged; - dcdr >> m_use_gear_autobox; - dcdr >> m_gear_switch_time; - dcdr >> m_clutch_strength; - dcdr >> m_mass; - dcdr >> m_drag_coefficient; - dcdr >> m_center_of_mass; -} - /*! * @brief This function sets a value in member id * @param _id New value for member id */ -void carla_msgs::msg::CarlaEgoVehicleInfo::id( +void CarlaEgoVehicleInfo::id( uint32_t _id) { m_id = _id; @@ -355,7 +175,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::id( * @brief This function returns the value of member id * @return Value of member id */ -uint32_t carla_msgs::msg::CarlaEgoVehicleInfo::id() const +uint32_t CarlaEgoVehicleInfo::id() const { return m_id; } @@ -364,16 +184,17 @@ uint32_t carla_msgs::msg::CarlaEgoVehicleInfo::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -uint32_t& carla_msgs::msg::CarlaEgoVehicleInfo::id() +uint32_t& CarlaEgoVehicleInfo::id() { return m_id; } + /*! * @brief This function copies the value in member type * @param _type New value to be copied in member type */ -void carla_msgs::msg::CarlaEgoVehicleInfo::type( +void CarlaEgoVehicleInfo::type( const std::string& _type) { m_type = _type; @@ -383,7 +204,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::type( * @brief This function moves the value in member type * @param _type New value to be moved in member type */ -void carla_msgs::msg::CarlaEgoVehicleInfo::type( +void CarlaEgoVehicleInfo::type( std::string&& _type) { m_type = std::move(_type); @@ -393,7 +214,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::type( * @brief This function returns a constant reference to member type * @return Constant reference to member type */ -const std::string& carla_msgs::msg::CarlaEgoVehicleInfo::type() const +const std::string& CarlaEgoVehicleInfo::type() const { return m_type; } @@ -402,15 +223,17 @@ const std::string& carla_msgs::msg::CarlaEgoVehicleInfo::type() const * @brief This function returns a reference to member type * @return Reference to member type */ -std::string& carla_msgs::msg::CarlaEgoVehicleInfo::type() +std::string& CarlaEgoVehicleInfo::type() { return m_type; } + + /*! * @brief This function copies the value in member rolename * @param _rolename New value to be copied in member rolename */ -void carla_msgs::msg::CarlaEgoVehicleInfo::rolename( +void CarlaEgoVehicleInfo::rolename( const std::string& _rolename) { m_rolename = _rolename; @@ -420,7 +243,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::rolename( * @brief This function moves the value in member rolename * @param _rolename New value to be moved in member rolename */ -void carla_msgs::msg::CarlaEgoVehicleInfo::rolename( +void CarlaEgoVehicleInfo::rolename( std::string&& _rolename) { m_rolename = std::move(_rolename); @@ -430,7 +253,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::rolename( * @brief This function returns a constant reference to member rolename * @return Constant reference to member rolename */ -const std::string& carla_msgs::msg::CarlaEgoVehicleInfo::rolename() const +const std::string& CarlaEgoVehicleInfo::rolename() const { return m_rolename; } @@ -439,15 +262,17 @@ const std::string& carla_msgs::msg::CarlaEgoVehicleInfo::rolename() const * @brief This function returns a reference to member rolename * @return Reference to member rolename */ -std::string& carla_msgs::msg::CarlaEgoVehicleInfo::rolename() +std::string& CarlaEgoVehicleInfo::rolename() { return m_rolename; } + + /*! * @brief This function copies the value in member wheels * @param _wheels New value to be copied in member wheels */ -void carla_msgs::msg::CarlaEgoVehicleInfo::wheels( +void CarlaEgoVehicleInfo::wheels( const std::vector& _wheels) { m_wheels = _wheels; @@ -457,7 +282,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::wheels( * @brief This function moves the value in member wheels * @param _wheels New value to be moved in member wheels */ -void carla_msgs::msg::CarlaEgoVehicleInfo::wheels( +void CarlaEgoVehicleInfo::wheels( std::vector&& _wheels) { m_wheels = std::move(_wheels); @@ -467,7 +292,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::wheels( * @brief This function returns a constant reference to member wheels * @return Constant reference to member wheels */ -const std::vector& carla_msgs::msg::CarlaEgoVehicleInfo::wheels() const +const std::vector& CarlaEgoVehicleInfo::wheels() const { return m_wheels; } @@ -476,15 +301,17 @@ const std::vector& carla_msgs::msg::C * @brief This function returns a reference to member wheels * @return Reference to member wheels */ -std::vector& carla_msgs::msg::CarlaEgoVehicleInfo::wheels() +std::vector& CarlaEgoVehicleInfo::wheels() { return m_wheels; } + + /*! * @brief This function sets a value in member max_rpm * @param _max_rpm New value for member max_rpm */ -void carla_msgs::msg::CarlaEgoVehicleInfo::max_rpm( +void CarlaEgoVehicleInfo::max_rpm( float _max_rpm) { m_max_rpm = _max_rpm; @@ -494,7 +321,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::max_rpm( * @brief This function returns the value of member max_rpm * @return Value of member max_rpm */ -float carla_msgs::msg::CarlaEgoVehicleInfo::max_rpm() const +float CarlaEgoVehicleInfo::max_rpm() const { return m_max_rpm; } @@ -503,16 +330,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::max_rpm() const * @brief This function returns a reference to member max_rpm * @return Reference to member max_rpm */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::max_rpm() +float& CarlaEgoVehicleInfo::max_rpm() { return m_max_rpm; } + /*! * @brief This function sets a value in member moi * @param _moi New value for member moi */ -void carla_msgs::msg::CarlaEgoVehicleInfo::moi( +void CarlaEgoVehicleInfo::moi( float _moi) { m_moi = _moi; @@ -522,7 +350,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::moi( * @brief This function returns the value of member moi * @return Value of member moi */ -float carla_msgs::msg::CarlaEgoVehicleInfo::moi() const +float CarlaEgoVehicleInfo::moi() const { return m_moi; } @@ -531,16 +359,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::moi() const * @brief This function returns a reference to member moi * @return Reference to member moi */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::moi() +float& CarlaEgoVehicleInfo::moi() { return m_moi; } + /*! * @brief This function sets a value in member damping_rate_full_throttle * @param _damping_rate_full_throttle New value for member damping_rate_full_throttle */ -void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_full_throttle( +void CarlaEgoVehicleInfo::damping_rate_full_throttle( float _damping_rate_full_throttle) { m_damping_rate_full_throttle = _damping_rate_full_throttle; @@ -550,7 +379,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_full_throttle( * @brief This function returns the value of member damping_rate_full_throttle * @return Value of member damping_rate_full_throttle */ -float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_full_throttle() const +float CarlaEgoVehicleInfo::damping_rate_full_throttle() const { return m_damping_rate_full_throttle; } @@ -559,16 +388,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_full_throttle() const * @brief This function returns a reference to member damping_rate_full_throttle * @return Reference to member damping_rate_full_throttle */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_full_throttle() +float& CarlaEgoVehicleInfo::damping_rate_full_throttle() { return m_damping_rate_full_throttle; } + /*! * @brief This function sets a value in member damping_rate_zero_throttle_clutch_engaged * @param _damping_rate_zero_throttle_clutch_engaged New value for member damping_rate_zero_throttle_clutch_engaged */ -void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged( +void CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged( float _damping_rate_zero_throttle_clutch_engaged) { m_damping_rate_zero_throttle_clutch_engaged = _damping_rate_zero_throttle_clutch_engaged; @@ -578,7 +408,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_eng * @brief This function returns the value of member damping_rate_zero_throttle_clutch_engaged * @return Value of member damping_rate_zero_throttle_clutch_engaged */ -float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged() const +float CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged() const { return m_damping_rate_zero_throttle_clutch_engaged; } @@ -587,16 +417,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_en * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_engaged * @return Reference to member damping_rate_zero_throttle_clutch_engaged */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged() +float& CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_engaged() { return m_damping_rate_zero_throttle_clutch_engaged; } + /*! * @brief This function sets a value in member damping_rate_zero_throttle_clutch_disengaged * @param _damping_rate_zero_throttle_clutch_disengaged New value for member damping_rate_zero_throttle_clutch_disengaged */ -void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged( +void CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged( float _damping_rate_zero_throttle_clutch_disengaged) { m_damping_rate_zero_throttle_clutch_disengaged = _damping_rate_zero_throttle_clutch_disengaged; @@ -606,7 +437,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_dis * @brief This function returns the value of member damping_rate_zero_throttle_clutch_disengaged * @return Value of member damping_rate_zero_throttle_clutch_disengaged */ -float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged() const +float CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged() const { return m_damping_rate_zero_throttle_clutch_disengaged; } @@ -615,16 +446,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_di * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_disengaged * @return Reference to member damping_rate_zero_throttle_clutch_disengaged */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged() +float& CarlaEgoVehicleInfo::damping_rate_zero_throttle_clutch_disengaged() { return m_damping_rate_zero_throttle_clutch_disengaged; } + /*! * @brief This function sets a value in member use_gear_autobox * @param _use_gear_autobox New value for member use_gear_autobox */ -void carla_msgs::msg::CarlaEgoVehicleInfo::use_gear_autobox( +void CarlaEgoVehicleInfo::use_gear_autobox( bool _use_gear_autobox) { m_use_gear_autobox = _use_gear_autobox; @@ -634,7 +466,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::use_gear_autobox( * @brief This function returns the value of member use_gear_autobox * @return Value of member use_gear_autobox */ -bool carla_msgs::msg::CarlaEgoVehicleInfo::use_gear_autobox() const +bool CarlaEgoVehicleInfo::use_gear_autobox() const { return m_use_gear_autobox; } @@ -643,16 +475,17 @@ bool carla_msgs::msg::CarlaEgoVehicleInfo::use_gear_autobox() const * @brief This function returns a reference to member use_gear_autobox * @return Reference to member use_gear_autobox */ -bool& carla_msgs::msg::CarlaEgoVehicleInfo::use_gear_autobox() +bool& CarlaEgoVehicleInfo::use_gear_autobox() { return m_use_gear_autobox; } + /*! * @brief This function sets a value in member gear_switch_time * @param _gear_switch_time New value for member gear_switch_time */ -void carla_msgs::msg::CarlaEgoVehicleInfo::gear_switch_time( +void CarlaEgoVehicleInfo::gear_switch_time( float _gear_switch_time) { m_gear_switch_time = _gear_switch_time; @@ -662,7 +495,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::gear_switch_time( * @brief This function returns the value of member gear_switch_time * @return Value of member gear_switch_time */ -float carla_msgs::msg::CarlaEgoVehicleInfo::gear_switch_time() const +float CarlaEgoVehicleInfo::gear_switch_time() const { return m_gear_switch_time; } @@ -671,16 +504,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::gear_switch_time() const * @brief This function returns a reference to member gear_switch_time * @return Reference to member gear_switch_time */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::gear_switch_time() +float& CarlaEgoVehicleInfo::gear_switch_time() { return m_gear_switch_time; } + /*! * @brief This function sets a value in member clutch_strength * @param _clutch_strength New value for member clutch_strength */ -void carla_msgs::msg::CarlaEgoVehicleInfo::clutch_strength( +void CarlaEgoVehicleInfo::clutch_strength( float _clutch_strength) { m_clutch_strength = _clutch_strength; @@ -690,7 +524,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::clutch_strength( * @brief This function returns the value of member clutch_strength * @return Value of member clutch_strength */ -float carla_msgs::msg::CarlaEgoVehicleInfo::clutch_strength() const +float CarlaEgoVehicleInfo::clutch_strength() const { return m_clutch_strength; } @@ -699,16 +533,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::clutch_strength() const * @brief This function returns a reference to member clutch_strength * @return Reference to member clutch_strength */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::clutch_strength() +float& CarlaEgoVehicleInfo::clutch_strength() { return m_clutch_strength; } + /*! * @brief This function sets a value in member mass * @param _mass New value for member mass */ -void carla_msgs::msg::CarlaEgoVehicleInfo::mass( +void CarlaEgoVehicleInfo::mass( float _mass) { m_mass = _mass; @@ -718,7 +553,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::mass( * @brief This function returns the value of member mass * @return Value of member mass */ -float carla_msgs::msg::CarlaEgoVehicleInfo::mass() const +float CarlaEgoVehicleInfo::mass() const { return m_mass; } @@ -727,16 +562,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::mass() const * @brief This function returns a reference to member mass * @return Reference to member mass */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::mass() +float& CarlaEgoVehicleInfo::mass() { return m_mass; } + /*! * @brief This function sets a value in member drag_coefficient * @param _drag_coefficient New value for member drag_coefficient */ -void carla_msgs::msg::CarlaEgoVehicleInfo::drag_coefficient( +void CarlaEgoVehicleInfo::drag_coefficient( float _drag_coefficient) { m_drag_coefficient = _drag_coefficient; @@ -746,7 +582,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::drag_coefficient( * @brief This function returns the value of member drag_coefficient * @return Value of member drag_coefficient */ -float carla_msgs::msg::CarlaEgoVehicleInfo::drag_coefficient() const +float CarlaEgoVehicleInfo::drag_coefficient() const { return m_drag_coefficient; } @@ -755,16 +591,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfo::drag_coefficient() const * @brief This function returns a reference to member drag_coefficient * @return Reference to member drag_coefficient */ -float& carla_msgs::msg::CarlaEgoVehicleInfo::drag_coefficient() +float& CarlaEgoVehicleInfo::drag_coefficient() { return m_drag_coefficient; } + /*! * @brief This function copies the value in member center_of_mass * @param _center_of_mass New value to be copied in member center_of_mass */ -void carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass( +void CarlaEgoVehicleInfo::center_of_mass( const geometry_msgs::msg::Vector3& _center_of_mass) { m_center_of_mass = _center_of_mass; @@ -774,7 +611,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass( * @brief This function moves the value in member center_of_mass * @param _center_of_mass New value to be moved in member center_of_mass */ -void carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass( +void CarlaEgoVehicleInfo::center_of_mass( geometry_msgs::msg::Vector3&& _center_of_mass) { m_center_of_mass = std::move(_center_of_mass); @@ -784,7 +621,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass( * @brief This function returns a constant reference to member center_of_mass * @return Constant reference to member center_of_mass */ -const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass() const +const geometry_msgs::msg::Vector3& CarlaEgoVehicleInfo::center_of_mass() const { return m_center_of_mass; } @@ -793,31 +630,18 @@ const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfo::center_ * @brief This function returns a reference to member center_of_mass * @return Reference to member center_of_mass */ -geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfo::center_of_mass() +geometry_msgs::msg::Vector3& CarlaEgoVehicleInfo::center_of_mass() { return m_center_of_mass; } -size_t carla_msgs::msg::CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool carla_msgs::msg::CarlaEgoVehicleInfo::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaEgoVehicleInfo::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaEgoVehicleInfoCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h index 3f791f8ded2..5f83d903766 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfo.h @@ -16,20 +16,25 @@ * @file CarlaEgoVehicleInfo.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_H_ -#include "carla_msgs/msg/CarlaEgoVehicleInfoWheel.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaEgoVehicleInfoWheel.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,473 +48,445 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaEgoVehicleInfo_SOURCE) -#define CarlaEgoVehicleInfo_DllAPI __declspec( dllexport ) +#if defined(CARLAEGOVEHICLEINFO_SOURCE) +#define CARLAEGOVEHICLEINFO_DllAPI __declspec( dllexport ) #else -#define CarlaEgoVehicleInfo_DllAPI __declspec( dllimport ) -#endif // CarlaEgoVehicleInfo_SOURCE +#define CARLAEGOVEHICLEINFO_DllAPI __declspec( dllimport ) +#endif // CARLAEGOVEHICLEINFO_SOURCE #else -#define CarlaEgoVehicleInfo_DllAPI +#define CARLAEGOVEHICLEINFO_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaEgoVehicleInfo_DllAPI +#define CARLAEGOVEHICLEINFO_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaEgoVehicleInfo defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLEINFO - */ - class CarlaEgoVehicleInfo - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaEgoVehicleInfo(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaEgoVehicleInfo(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleInfo( - const CarlaEgoVehicleInfo& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleInfo( - CarlaEgoVehicleInfo&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleInfo& operator =( - const CarlaEgoVehicleInfo& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleInfo& operator =( - CarlaEgoVehicleInfo&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleInfo object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaEgoVehicleInfo& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleInfo object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaEgoVehicleInfo& x) const; - - /*! - * @brief This function sets a value in member id - * @param _id New value for member id - */ - eProsima_user_DllExport void id( - uint32_t _id); - - /*! - * @brief This function returns the value of member id - * @return Value of member id - */ - eProsima_user_DllExport uint32_t id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport uint32_t& id(); - - /*! - * @brief This function copies the value in member type - * @param _type New value to be copied in member type - */ - eProsima_user_DllExport void type( - const std::string& _type); - - /*! - * @brief This function moves the value in member type - * @param _type New value to be moved in member type - */ - eProsima_user_DllExport void type( - std::string&& _type); - - /*! - * @brief This function returns a constant reference to member type - * @return Constant reference to member type - */ - eProsima_user_DllExport const std::string& type() const; - - /*! - * @brief This function returns a reference to member type - * @return Reference to member type - */ - eProsima_user_DllExport std::string& type(); - /*! - * @brief This function copies the value in member rolename - * @param _rolename New value to be copied in member rolename - */ - eProsima_user_DllExport void rolename( - const std::string& _rolename); - - /*! - * @brief This function moves the value in member rolename - * @param _rolename New value to be moved in member rolename - */ - eProsima_user_DllExport void rolename( - std::string&& _rolename); - - /*! - * @brief This function returns a constant reference to member rolename - * @return Constant reference to member rolename - */ - eProsima_user_DllExport const std::string& rolename() const; - - /*! - * @brief This function returns a reference to member rolename - * @return Reference to member rolename - */ - eProsima_user_DllExport std::string& rolename(); - /*! - * @brief This function copies the value in member wheels - * @param _wheels New value to be copied in member wheels - */ - eProsima_user_DllExport void wheels( - const std::vector& _wheels); - - /*! - * @brief This function moves the value in member wheels - * @param _wheels New value to be moved in member wheels - */ - eProsima_user_DllExport void wheels( - std::vector&& _wheels); - - /*! - * @brief This function returns a constant reference to member wheels - * @return Constant reference to member wheels - */ - eProsima_user_DllExport const std::vector& wheels() const; - - /*! - * @brief This function returns a reference to member wheels - * @return Reference to member wheels - */ - eProsima_user_DllExport std::vector& wheels(); - /*! - * @brief This function sets a value in member max_rpm - * @param _max_rpm New value for member max_rpm - */ - eProsima_user_DllExport void max_rpm( - float _max_rpm); - - /*! - * @brief This function returns the value of member max_rpm - * @return Value of member max_rpm - */ - eProsima_user_DllExport float max_rpm() const; - - /*! - * @brief This function returns a reference to member max_rpm - * @return Reference to member max_rpm - */ - eProsima_user_DllExport float& max_rpm(); - - /*! - * @brief This function sets a value in member moi - * @param _moi New value for member moi - */ - eProsima_user_DllExport void moi( - float _moi); - - /*! - * @brief This function returns the value of member moi - * @return Value of member moi - */ - eProsima_user_DllExport float moi() const; - - /*! - * @brief This function returns a reference to member moi - * @return Reference to member moi - */ - eProsima_user_DllExport float& moi(); - - /*! - * @brief This function sets a value in member damping_rate_full_throttle - * @param _damping_rate_full_throttle New value for member damping_rate_full_throttle - */ - eProsima_user_DllExport void damping_rate_full_throttle( - float _damping_rate_full_throttle); - - /*! - * @brief This function returns the value of member damping_rate_full_throttle - * @return Value of member damping_rate_full_throttle - */ - eProsima_user_DllExport float damping_rate_full_throttle() const; - - /*! - * @brief This function returns a reference to member damping_rate_full_throttle - * @return Reference to member damping_rate_full_throttle - */ - eProsima_user_DllExport float& damping_rate_full_throttle(); - - /*! - * @brief This function sets a value in member damping_rate_zero_throttle_clutch_engaged - * @param _damping_rate_zero_throttle_clutch_engaged New value for member damping_rate_zero_throttle_clutch_engaged - */ - eProsima_user_DllExport void damping_rate_zero_throttle_clutch_engaged( - float _damping_rate_zero_throttle_clutch_engaged); - - /*! - * @brief This function returns the value of member damping_rate_zero_throttle_clutch_engaged - * @return Value of member damping_rate_zero_throttle_clutch_engaged - */ - eProsima_user_DllExport float damping_rate_zero_throttle_clutch_engaged() const; - - /*! - * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_engaged - * @return Reference to member damping_rate_zero_throttle_clutch_engaged - */ - eProsima_user_DllExport float& damping_rate_zero_throttle_clutch_engaged(); - - /*! - * @brief This function sets a value in member damping_rate_zero_throttle_clutch_disengaged - * @param _damping_rate_zero_throttle_clutch_disengaged New value for member damping_rate_zero_throttle_clutch_disengaged - */ - eProsima_user_DllExport void damping_rate_zero_throttle_clutch_disengaged( - float _damping_rate_zero_throttle_clutch_disengaged); - - /*! - * @brief This function returns the value of member damping_rate_zero_throttle_clutch_disengaged - * @return Value of member damping_rate_zero_throttle_clutch_disengaged - */ - eProsima_user_DllExport float damping_rate_zero_throttle_clutch_disengaged() const; - - /*! - * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_disengaged - * @return Reference to member damping_rate_zero_throttle_clutch_disengaged - */ - eProsima_user_DllExport float& damping_rate_zero_throttle_clutch_disengaged(); - - /*! - * @brief This function sets a value in member use_gear_autobox - * @param _use_gear_autobox New value for member use_gear_autobox - */ - eProsima_user_DllExport void use_gear_autobox( - bool _use_gear_autobox); - - /*! - * @brief This function returns the value of member use_gear_autobox - * @return Value of member use_gear_autobox - */ - eProsima_user_DllExport bool use_gear_autobox() const; - - /*! - * @brief This function returns a reference to member use_gear_autobox - * @return Reference to member use_gear_autobox - */ - eProsima_user_DllExport bool& use_gear_autobox(); - - /*! - * @brief This function sets a value in member gear_switch_time - * @param _gear_switch_time New value for member gear_switch_time - */ - eProsima_user_DllExport void gear_switch_time( - float _gear_switch_time); - - /*! - * @brief This function returns the value of member gear_switch_time - * @return Value of member gear_switch_time - */ - eProsima_user_DllExport float gear_switch_time() const; - - /*! - * @brief This function returns a reference to member gear_switch_time - * @return Reference to member gear_switch_time - */ - eProsima_user_DllExport float& gear_switch_time(); - - /*! - * @brief This function sets a value in member clutch_strength - * @param _clutch_strength New value for member clutch_strength - */ - eProsima_user_DllExport void clutch_strength( - float _clutch_strength); - - /*! - * @brief This function returns the value of member clutch_strength - * @return Value of member clutch_strength - */ - eProsima_user_DllExport float clutch_strength() const; - - /*! - * @brief This function returns a reference to member clutch_strength - * @return Reference to member clutch_strength - */ - eProsima_user_DllExport float& clutch_strength(); - - /*! - * @brief This function sets a value in member mass - * @param _mass New value for member mass - */ - eProsima_user_DllExport void mass( - float _mass); - - /*! - * @brief This function returns the value of member mass - * @return Value of member mass - */ - eProsima_user_DllExport float mass() const; - - /*! - * @brief This function returns a reference to member mass - * @return Reference to member mass - */ - eProsima_user_DllExport float& mass(); - - /*! - * @brief This function sets a value in member drag_coefficient - * @param _drag_coefficient New value for member drag_coefficient - */ - eProsima_user_DllExport void drag_coefficient( - float _drag_coefficient); - - /*! - * @brief This function returns the value of member drag_coefficient - * @return Value of member drag_coefficient - */ - eProsima_user_DllExport float drag_coefficient() const; - - /*! - * @brief This function returns a reference to member drag_coefficient - * @return Reference to member drag_coefficient - */ - eProsima_user_DllExport float& drag_coefficient(); - - /*! - * @brief This function copies the value in member center_of_mass - * @param _center_of_mass New value to be copied in member center_of_mass - */ - eProsima_user_DllExport void center_of_mass( - const geometry_msgs::msg::Vector3& _center_of_mass); - - /*! - * @brief This function moves the value in member center_of_mass - * @param _center_of_mass New value to be moved in member center_of_mass - */ - eProsima_user_DllExport void center_of_mass( - geometry_msgs::msg::Vector3&& _center_of_mass); - - /*! - * @brief This function returns a constant reference to member center_of_mass - * @return Constant reference to member center_of_mass - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& center_of_mass() const; - - /*! - * @brief This function returns a reference to member center_of_mass - * @return Reference to member center_of_mass - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& center_of_mass(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleInfo& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint32_t m_id; - std::string m_type; - std::string m_rolename; - std::vector m_wheels; - float m_max_rpm; - float m_moi; - float m_damping_rate_full_throttle; - float m_damping_rate_zero_throttle_clutch_engaged; - float m_damping_rate_zero_throttle_clutch_disengaged; - bool m_use_gear_autobox; - float m_gear_switch_time; - float m_clutch_strength; - float m_mass; - float m_drag_coefficient; - geometry_msgs::msg::Vector3 m_center_of_mass; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaEgoVehicleInfo defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleInfo + */ +class CarlaEgoVehicleInfo +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo( + const CarlaEgoVehicleInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo( + CarlaEgoVehicleInfo&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo& operator =( + const CarlaEgoVehicleInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfo that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfo& operator =( + CarlaEgoVehicleInfo&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleInfo& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + + /*! + * @brief This function copies the value in member type + * @param _type New value to be copied in member type + */ + eProsima_user_DllExport void type( + const std::string& _type); + + /*! + * @brief This function moves the value in member type + * @param _type New value to be moved in member type + */ + eProsima_user_DllExport void type( + std::string&& _type); + + /*! + * @brief This function returns a constant reference to member type + * @return Constant reference to member type + */ + eProsima_user_DllExport const std::string& type() const; + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport std::string& type(); + + + /*! + * @brief This function copies the value in member rolename + * @param _rolename New value to be copied in member rolename + */ + eProsima_user_DllExport void rolename( + const std::string& _rolename); + + /*! + * @brief This function moves the value in member rolename + * @param _rolename New value to be moved in member rolename + */ + eProsima_user_DllExport void rolename( + std::string&& _rolename); + + /*! + * @brief This function returns a constant reference to member rolename + * @return Constant reference to member rolename + */ + eProsima_user_DllExport const std::string& rolename() const; + + /*! + * @brief This function returns a reference to member rolename + * @return Reference to member rolename + */ + eProsima_user_DllExport std::string& rolename(); + + + /*! + * @brief This function copies the value in member wheels + * @param _wheels New value to be copied in member wheels + */ + eProsima_user_DllExport void wheels( + const std::vector& _wheels); + + /*! + * @brief This function moves the value in member wheels + * @param _wheels New value to be moved in member wheels + */ + eProsima_user_DllExport void wheels( + std::vector&& _wheels); + + /*! + * @brief This function returns a constant reference to member wheels + * @return Constant reference to member wheels + */ + eProsima_user_DllExport const std::vector& wheels() const; + + /*! + * @brief This function returns a reference to member wheels + * @return Reference to member wheels + */ + eProsima_user_DllExport std::vector& wheels(); + + + /*! + * @brief This function sets a value in member max_rpm + * @param _max_rpm New value for member max_rpm + */ + eProsima_user_DllExport void max_rpm( + float _max_rpm); + + /*! + * @brief This function returns the value of member max_rpm + * @return Value of member max_rpm + */ + eProsima_user_DllExport float max_rpm() const; + + /*! + * @brief This function returns a reference to member max_rpm + * @return Reference to member max_rpm + */ + eProsima_user_DllExport float& max_rpm(); + + + /*! + * @brief This function sets a value in member moi + * @param _moi New value for member moi + */ + eProsima_user_DllExport void moi( + float _moi); + + /*! + * @brief This function returns the value of member moi + * @return Value of member moi + */ + eProsima_user_DllExport float moi() const; + + /*! + * @brief This function returns a reference to member moi + * @return Reference to member moi + */ + eProsima_user_DllExport float& moi(); + + + /*! + * @brief This function sets a value in member damping_rate_full_throttle + * @param _damping_rate_full_throttle New value for member damping_rate_full_throttle + */ + eProsima_user_DllExport void damping_rate_full_throttle( + float _damping_rate_full_throttle); + + /*! + * @brief This function returns the value of member damping_rate_full_throttle + * @return Value of member damping_rate_full_throttle + */ + eProsima_user_DllExport float damping_rate_full_throttle() const; + + /*! + * @brief This function returns a reference to member damping_rate_full_throttle + * @return Reference to member damping_rate_full_throttle + */ + eProsima_user_DllExport float& damping_rate_full_throttle(); + + + /*! + * @brief This function sets a value in member damping_rate_zero_throttle_clutch_engaged + * @param _damping_rate_zero_throttle_clutch_engaged New value for member damping_rate_zero_throttle_clutch_engaged + */ + eProsima_user_DllExport void damping_rate_zero_throttle_clutch_engaged( + float _damping_rate_zero_throttle_clutch_engaged); + + /*! + * @brief This function returns the value of member damping_rate_zero_throttle_clutch_engaged + * @return Value of member damping_rate_zero_throttle_clutch_engaged + */ + eProsima_user_DllExport float damping_rate_zero_throttle_clutch_engaged() const; + + /*! + * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_engaged + * @return Reference to member damping_rate_zero_throttle_clutch_engaged + */ + eProsima_user_DllExport float& damping_rate_zero_throttle_clutch_engaged(); + + + /*! + * @brief This function sets a value in member damping_rate_zero_throttle_clutch_disengaged + * @param _damping_rate_zero_throttle_clutch_disengaged New value for member damping_rate_zero_throttle_clutch_disengaged + */ + eProsima_user_DllExport void damping_rate_zero_throttle_clutch_disengaged( + float _damping_rate_zero_throttle_clutch_disengaged); + + /*! + * @brief This function returns the value of member damping_rate_zero_throttle_clutch_disengaged + * @return Value of member damping_rate_zero_throttle_clutch_disengaged + */ + eProsima_user_DllExport float damping_rate_zero_throttle_clutch_disengaged() const; + + /*! + * @brief This function returns a reference to member damping_rate_zero_throttle_clutch_disengaged + * @return Reference to member damping_rate_zero_throttle_clutch_disengaged + */ + eProsima_user_DllExport float& damping_rate_zero_throttle_clutch_disengaged(); + + + /*! + * @brief This function sets a value in member use_gear_autobox + * @param _use_gear_autobox New value for member use_gear_autobox + */ + eProsima_user_DllExport void use_gear_autobox( + bool _use_gear_autobox); + + /*! + * @brief This function returns the value of member use_gear_autobox + * @return Value of member use_gear_autobox + */ + eProsima_user_DllExport bool use_gear_autobox() const; + + /*! + * @brief This function returns a reference to member use_gear_autobox + * @return Reference to member use_gear_autobox + */ + eProsima_user_DllExport bool& use_gear_autobox(); + + + /*! + * @brief This function sets a value in member gear_switch_time + * @param _gear_switch_time New value for member gear_switch_time + */ + eProsima_user_DllExport void gear_switch_time( + float _gear_switch_time); + + /*! + * @brief This function returns the value of member gear_switch_time + * @return Value of member gear_switch_time + */ + eProsima_user_DllExport float gear_switch_time() const; + + /*! + * @brief This function returns a reference to member gear_switch_time + * @return Reference to member gear_switch_time + */ + eProsima_user_DllExport float& gear_switch_time(); + + + /*! + * @brief This function sets a value in member clutch_strength + * @param _clutch_strength New value for member clutch_strength + */ + eProsima_user_DllExport void clutch_strength( + float _clutch_strength); + + /*! + * @brief This function returns the value of member clutch_strength + * @return Value of member clutch_strength + */ + eProsima_user_DllExport float clutch_strength() const; + + /*! + * @brief This function returns a reference to member clutch_strength + * @return Reference to member clutch_strength + */ + eProsima_user_DllExport float& clutch_strength(); + + + /*! + * @brief This function sets a value in member mass + * @param _mass New value for member mass + */ + eProsima_user_DllExport void mass( + float _mass); + + /*! + * @brief This function returns the value of member mass + * @return Value of member mass + */ + eProsima_user_DllExport float mass() const; + + /*! + * @brief This function returns a reference to member mass + * @return Reference to member mass + */ + eProsima_user_DllExport float& mass(); + + + /*! + * @brief This function sets a value in member drag_coefficient + * @param _drag_coefficient New value for member drag_coefficient + */ + eProsima_user_DllExport void drag_coefficient( + float _drag_coefficient); + + /*! + * @brief This function returns the value of member drag_coefficient + * @return Value of member drag_coefficient + */ + eProsima_user_DllExport float drag_coefficient() const; + + /*! + * @brief This function returns a reference to member drag_coefficient + * @return Reference to member drag_coefficient + */ + eProsima_user_DllExport float& drag_coefficient(); + + + /*! + * @brief This function copies the value in member center_of_mass + * @param _center_of_mass New value to be copied in member center_of_mass + */ + eProsima_user_DllExport void center_of_mass( + const geometry_msgs::msg::Vector3& _center_of_mass); + + /*! + * @brief This function moves the value in member center_of_mass + * @param _center_of_mass New value to be moved in member center_of_mass + */ + eProsima_user_DllExport void center_of_mass( + geometry_msgs::msg::Vector3&& _center_of_mass); + + /*! + * @brief This function returns a constant reference to member center_of_mass + * @return Constant reference to member center_of_mass + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& center_of_mass() const; + + /*! + * @brief This function returns a reference to member center_of_mass + * @return Reference to member center_of_mass + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& center_of_mass(); + +private: + + uint32_t m_id{0}; + std::string m_type; + std::string m_rolename; + std::vector m_wheels; + float m_max_rpm{0.0}; + float m_moi{0.0}; + float m_damping_rate_full_throttle{0.0}; + float m_damping_rate_zero_throttle_clutch_engaged{0.0}; + float m_damping_rate_zero_throttle_clutch_disengaged{0.0}; + bool m_use_gear_autobox{false}; + float m_gear_switch_time{0.0}; + float m_clutch_strength{0.0}; + float m_mass{0.0}; + float m_drag_coefficient{0.0}; + geometry_msgs::msg::Vector3 m_center_of_mass; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoCdrAux.hpp new file mode 100644 index 00000000000..747b4b85d84 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOCDRAUX_HPP_ + +#include "CarlaEgoVehicleInfo.h" + +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleInfo_max_cdr_typesize {6208UL}; +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleInfo_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleInfo& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoCdrAux.ipp new file mode 100644 index 00000000000..0a3ac70d324 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoCdrAux.ipp @@ -0,0 +1,242 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOCDRAUX_IPP_ + +#include "CarlaEgoVehicleInfoCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaEgoVehicleInfo& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.rolename(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.wheels(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.max_rpm(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.moi(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.damping_rate_full_throttle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.damping_rate_zero_throttle_clutch_engaged(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.damping_rate_zero_throttle_clutch_disengaged(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.use_gear_autobox(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.gear_switch_time(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.clutch_strength(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), + data.mass(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), + data.drag_coefficient(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14), + data.center_of_mass(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleInfo& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.id() + << eprosima::fastcdr::MemberId(1) << data.type() + << eprosima::fastcdr::MemberId(2) << data.rolename() + << eprosima::fastcdr::MemberId(3) << data.wheels() + << eprosima::fastcdr::MemberId(4) << data.max_rpm() + << eprosima::fastcdr::MemberId(5) << data.moi() + << eprosima::fastcdr::MemberId(6) << data.damping_rate_full_throttle() + << eprosima::fastcdr::MemberId(7) << data.damping_rate_zero_throttle_clutch_engaged() + << eprosima::fastcdr::MemberId(8) << data.damping_rate_zero_throttle_clutch_disengaged() + << eprosima::fastcdr::MemberId(9) << data.use_gear_autobox() + << eprosima::fastcdr::MemberId(10) << data.gear_switch_time() + << eprosima::fastcdr::MemberId(11) << data.clutch_strength() + << eprosima::fastcdr::MemberId(12) << data.mass() + << eprosima::fastcdr::MemberId(13) << data.drag_coefficient() + << eprosima::fastcdr::MemberId(14) << data.center_of_mass() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaEgoVehicleInfo& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.id(); + break; + + case 1: + dcdr >> data.type(); + break; + + case 2: + dcdr >> data.rolename(); + break; + + case 3: + dcdr >> data.wheels(); + break; + + case 4: + dcdr >> data.max_rpm(); + break; + + case 5: + dcdr >> data.moi(); + break; + + case 6: + dcdr >> data.damping_rate_full_throttle(); + break; + + case 7: + dcdr >> data.damping_rate_zero_throttle_clutch_engaged(); + break; + + case 8: + dcdr >> data.damping_rate_zero_throttle_clutch_disengaged(); + break; + + case 9: + dcdr >> data.use_gear_autobox(); + break; + + case 10: + dcdr >> data.gear_switch_time(); + break; + + case 11: + dcdr >> data.clutch_strength(); + break; + + case 12: + dcdr >> data.mass(); + break; + + case 13: + dcdr >> data.drag_coefficient(); + break; + + case 14: + dcdr >> data.center_of_mass(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleInfo& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.cxx index f3713cf0d7d..9f2b65c43cd 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaEgoVehicleInfoPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaEgoVehicleInfoPubSubTypes.h" +#include "CarlaEgoVehicleInfoCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaEgoVehicleInfoPubSubType::CarlaEgoVehicleInfoPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaEgoVehicleInfo_"); - auto type_size = CarlaEgoVehicleInfo::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaEgoVehicleInfo::isKeyDefined(); - size_t keyLength = CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize() > 16 ? - CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaEgoVehicleInfoPubSubType::~CarlaEgoVehicleInfoPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaEgoVehicleInfoPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaEgoVehicleInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaEgoVehicleInfoPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaEgoVehicleInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaEgoVehicleInfoPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaEgoVehicleInfoPubSubType::createData() - { - return reinterpret_cast(new CarlaEgoVehicleInfo()); - } - - void CarlaEgoVehicleInfoPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaEgoVehicleInfoPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaEgoVehicleInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaEgoVehicleInfo::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaEgoVehicleInfoPubSubType::CarlaEgoVehicleInfoPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaEgoVehicleInfo_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaEgoVehicleInfo::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaEgoVehicleInfo_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaEgoVehicleInfoPubSubType::~CarlaEgoVehicleInfoPubSubType() +{ +} + +bool CarlaEgoVehicleInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaEgoVehicleInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaEgoVehicleInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaEgoVehicleInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaEgoVehicleInfoPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaEgoVehicleInfoPubSubType::createData() +{ + return reinterpret_cast(new CarlaEgoVehicleInfo()); +} + +void CarlaEgoVehicleInfoPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaEgoVehicleInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h index 2e57c5de0e1..d7351a905f4 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoPubSubTypes.h @@ -16,92 +16,121 @@ * @file CarlaEgoVehicleInfoPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaEgoVehicleInfo.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaEgoVehicleInfoWheelPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaEgoVehicleInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleInfo defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleInfo + */ +class CarlaEgoVehicleInfoPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaEgoVehicleInfo defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLEINFO - */ - class CarlaEgoVehicleInfoPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaEgoVehicleInfo type; + typedef CarlaEgoVehicleInfo type; - eProsima_user_DllExport CarlaEgoVehicleInfoPubSubType(); + eProsima_user_DllExport CarlaEgoVehicleInfoPubSubType(); - eProsima_user_DllExport virtual ~CarlaEgoVehicleInfoPubSubType(); + eProsima_user_DllExport ~CarlaEgoVehicleInfoPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFO_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.cxx index 15372480fde..8c6d5ad56b8 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaEgoVehicleInfoWheel.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,43 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaEgoVehicleInfoWheel.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel() -{ - // m_tire_friction com.eprosima.idl.parser.typecode.PrimitiveTypeCode@368247b9 - m_tire_friction = 0.0; - // m_damping_rate com.eprosima.idl.parser.typecode.PrimitiveTypeCode@55a147cc - m_damping_rate = 0.0; - // m_max_steer_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71ba6d4e - m_max_steer_angle = 0.0; - // m_radius com.eprosima.idl.parser.typecode.PrimitiveTypeCode@738dc9b - m_radius = 0.0; - // m_max_brake_torque com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3c77d488 - m_max_brake_torque = 0.0; - // m_max_handbrake_torque com.eprosima.idl.parser.typecode.PrimitiveTypeCode@63376bed - m_max_handbrake_torque = 0.0; - // m_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4145bad8 - - -} - -carla_msgs::msg::CarlaEgoVehicleInfoWheel::~CarlaEgoVehicleInfoWheel() -{ +namespace carla_msgs { +namespace msg { +CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel() +{ +} +CarlaEgoVehicleInfoWheel::~CarlaEgoVehicleInfoWheel() +{ } -carla_msgs::msg::CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel( +CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel( const CarlaEgoVehicleInfoWheel& x) { m_tire_friction = x.m_tire_friction; @@ -75,8 +63,8 @@ carla_msgs::msg::CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel( m_position = x.m_position; } -carla_msgs::msg::CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel( - CarlaEgoVehicleInfoWheel&& x) +CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel( + CarlaEgoVehicleInfoWheel&& x) noexcept { m_tire_friction = x.m_tire_friction; m_damping_rate = x.m_damping_rate; @@ -87,7 +75,7 @@ carla_msgs::msg::CarlaEgoVehicleInfoWheel::CarlaEgoVehicleInfoWheel( m_position = std::move(x.m_position); } -carla_msgs::msg::CarlaEgoVehicleInfoWheel& carla_msgs::msg::CarlaEgoVehicleInfoWheel::operator =( +CarlaEgoVehicleInfoWheel& CarlaEgoVehicleInfoWheel::operator =( const CarlaEgoVehicleInfoWheel& x) { @@ -98,12 +86,11 @@ carla_msgs::msg::CarlaEgoVehicleInfoWheel& carla_msgs::msg::CarlaEgoVehicleInfoW m_max_brake_torque = x.m_max_brake_torque; m_max_handbrake_torque = x.m_max_handbrake_torque; m_position = x.m_position; - return *this; } -carla_msgs::msg::CarlaEgoVehicleInfoWheel& carla_msgs::msg::CarlaEgoVehicleInfoWheel::operator =( - CarlaEgoVehicleInfoWheel&& x) +CarlaEgoVehicleInfoWheel& CarlaEgoVehicleInfoWheel::operator =( + CarlaEgoVehicleInfoWheel&& x) noexcept { m_tire_friction = x.m_tire_friction; @@ -113,115 +100,32 @@ carla_msgs::msg::CarlaEgoVehicleInfoWheel& carla_msgs::msg::CarlaEgoVehicleInfoW m_max_brake_torque = x.m_max_brake_torque; m_max_handbrake_torque = x.m_max_handbrake_torque; m_position = std::move(x.m_position); - return *this; } -bool carla_msgs::msg::CarlaEgoVehicleInfoWheel::operator ==( +bool CarlaEgoVehicleInfoWheel::operator ==( const CarlaEgoVehicleInfoWheel& x) const { - - return (m_tire_friction == x.m_tire_friction && m_damping_rate == x.m_damping_rate && m_max_steer_angle == x.m_max_steer_angle && m_radius == x.m_radius && m_max_brake_torque == x.m_max_brake_torque && m_max_handbrake_torque == x.m_max_handbrake_torque && m_position == x.m_position); + return (m_tire_friction == x.m_tire_friction && + m_damping_rate == x.m_damping_rate && + m_max_steer_angle == x.m_max_steer_angle && + m_radius == x.m_radius && + m_max_brake_torque == x.m_max_brake_torque && + m_max_handbrake_torque == x.m_max_handbrake_torque && + m_position == x.m_position); } -bool carla_msgs::msg::CarlaEgoVehicleInfoWheel::operator !=( +bool CarlaEgoVehicleInfoWheel::operator !=( const CarlaEgoVehicleInfoWheel& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaEgoVehicleInfoWheel::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaEgoVehicleInfoWheel::getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleInfoWheel& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.position(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_tire_friction; - scdr << m_damping_rate; - scdr << m_max_steer_angle; - scdr << m_radius; - scdr << m_max_brake_torque; - scdr << m_max_handbrake_torque; - scdr << m_position; - -} - -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_tire_friction; - dcdr >> m_damping_rate; - dcdr >> m_max_steer_angle; - dcdr >> m_radius; - dcdr >> m_max_brake_torque; - dcdr >> m_max_handbrake_torque; - dcdr >> m_position; -} - /*! * @brief This function sets a value in member tire_friction * @param _tire_friction New value for member tire_friction */ -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::tire_friction( +void CarlaEgoVehicleInfoWheel::tire_friction( float _tire_friction) { m_tire_friction = _tire_friction; @@ -231,7 +135,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfoWheel::tire_friction( * @brief This function returns the value of member tire_friction * @return Value of member tire_friction */ -float carla_msgs::msg::CarlaEgoVehicleInfoWheel::tire_friction() const +float CarlaEgoVehicleInfoWheel::tire_friction() const { return m_tire_friction; } @@ -240,16 +144,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfoWheel::tire_friction() const * @brief This function returns a reference to member tire_friction * @return Reference to member tire_friction */ -float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::tire_friction() +float& CarlaEgoVehicleInfoWheel::tire_friction() { return m_tire_friction; } + /*! * @brief This function sets a value in member damping_rate * @param _damping_rate New value for member damping_rate */ -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::damping_rate( +void CarlaEgoVehicleInfoWheel::damping_rate( float _damping_rate) { m_damping_rate = _damping_rate; @@ -259,7 +164,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfoWheel::damping_rate( * @brief This function returns the value of member damping_rate * @return Value of member damping_rate */ -float carla_msgs::msg::CarlaEgoVehicleInfoWheel::damping_rate() const +float CarlaEgoVehicleInfoWheel::damping_rate() const { return m_damping_rate; } @@ -268,16 +173,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfoWheel::damping_rate() const * @brief This function returns a reference to member damping_rate * @return Reference to member damping_rate */ -float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::damping_rate() +float& CarlaEgoVehicleInfoWheel::damping_rate() { return m_damping_rate; } + /*! * @brief This function sets a value in member max_steer_angle * @param _max_steer_angle New value for member max_steer_angle */ -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_steer_angle( +void CarlaEgoVehicleInfoWheel::max_steer_angle( float _max_steer_angle) { m_max_steer_angle = _max_steer_angle; @@ -287,7 +193,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_steer_angle( * @brief This function returns the value of member max_steer_angle * @return Value of member max_steer_angle */ -float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_steer_angle() const +float CarlaEgoVehicleInfoWheel::max_steer_angle() const { return m_max_steer_angle; } @@ -296,16 +202,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_steer_angle() const * @brief This function returns a reference to member max_steer_angle * @return Reference to member max_steer_angle */ -float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_steer_angle() +float& CarlaEgoVehicleInfoWheel::max_steer_angle() { return m_max_steer_angle; } + /*! * @brief This function sets a value in member radius * @param _radius New value for member radius */ -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::radius( +void CarlaEgoVehicleInfoWheel::radius( float _radius) { m_radius = _radius; @@ -315,7 +222,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfoWheel::radius( * @brief This function returns the value of member radius * @return Value of member radius */ -float carla_msgs::msg::CarlaEgoVehicleInfoWheel::radius() const +float CarlaEgoVehicleInfoWheel::radius() const { return m_radius; } @@ -324,16 +231,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfoWheel::radius() const * @brief This function returns a reference to member radius * @return Reference to member radius */ -float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::radius() +float& CarlaEgoVehicleInfoWheel::radius() { return m_radius; } + /*! * @brief This function sets a value in member max_brake_torque * @param _max_brake_torque New value for member max_brake_torque */ -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_brake_torque( +void CarlaEgoVehicleInfoWheel::max_brake_torque( float _max_brake_torque) { m_max_brake_torque = _max_brake_torque; @@ -343,7 +251,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_brake_torque( * @brief This function returns the value of member max_brake_torque * @return Value of member max_brake_torque */ -float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_brake_torque() const +float CarlaEgoVehicleInfoWheel::max_brake_torque() const { return m_max_brake_torque; } @@ -352,16 +260,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_brake_torque() const * @brief This function returns a reference to member max_brake_torque * @return Reference to member max_brake_torque */ -float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_brake_torque() +float& CarlaEgoVehicleInfoWheel::max_brake_torque() { return m_max_brake_torque; } + /*! * @brief This function sets a value in member max_handbrake_torque * @param _max_handbrake_torque New value for member max_handbrake_torque */ -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_handbrake_torque( +void CarlaEgoVehicleInfoWheel::max_handbrake_torque( float _max_handbrake_torque) { m_max_handbrake_torque = _max_handbrake_torque; @@ -371,7 +280,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_handbrake_torque( * @brief This function returns the value of member max_handbrake_torque * @return Value of member max_handbrake_torque */ -float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_handbrake_torque() const +float CarlaEgoVehicleInfoWheel::max_handbrake_torque() const { return m_max_handbrake_torque; } @@ -380,16 +289,17 @@ float carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_handbrake_torque() const * @brief This function returns a reference to member max_handbrake_torque * @return Reference to member max_handbrake_torque */ -float& carla_msgs::msg::CarlaEgoVehicleInfoWheel::max_handbrake_torque() +float& CarlaEgoVehicleInfoWheel::max_handbrake_torque() { return m_max_handbrake_torque; } + /*! * @brief This function copies the value in member position * @param _position New value to be copied in member position */ -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::position( +void CarlaEgoVehicleInfoWheel::position( const geometry_msgs::msg::Vector3& _position) { m_position = _position; @@ -399,7 +309,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfoWheel::position( * @brief This function moves the value in member position * @param _position New value to be moved in member position */ -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::position( +void CarlaEgoVehicleInfoWheel::position( geometry_msgs::msg::Vector3&& _position) { m_position = std::move(_position); @@ -409,7 +319,7 @@ void carla_msgs::msg::CarlaEgoVehicleInfoWheel::position( * @brief This function returns a constant reference to member position * @return Constant reference to member position */ -const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfoWheel::position() const +const geometry_msgs::msg::Vector3& CarlaEgoVehicleInfoWheel::position() const { return m_position; } @@ -418,31 +328,18 @@ const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfoWheel::po * @brief This function returns a reference to member position * @return Reference to member position */ -geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaEgoVehicleInfoWheel::position() +geometry_msgs::msg::Vector3& CarlaEgoVehicleInfoWheel::position() { return m_position; } -size_t carla_msgs::msg::CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool carla_msgs::msg::CarlaEgoVehicleInfoWheel::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaEgoVehicleInfoWheel::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaEgoVehicleInfoWheelCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.h index d589d2a4112..28533b81983 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheel.h @@ -16,20 +16,25 @@ * @file CarlaEgoVehicleInfoWheel.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_H_ -#include "geometry_msgs/msg/Vector3.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "geometry_msgs/msg/Vector3.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,295 +48,256 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaEgoVehicleInfoWheel_SOURCE) -#define CarlaEgoVehicleInfoWheel_DllAPI __declspec( dllexport ) +#if defined(CARLAEGOVEHICLEINFOWHEEL_SOURCE) +#define CARLAEGOVEHICLEINFOWHEEL_DllAPI __declspec( dllexport ) #else -#define CarlaEgoVehicleInfoWheel_DllAPI __declspec( dllimport ) -#endif // CarlaEgoVehicleInfoWheel_SOURCE +#define CARLAEGOVEHICLEINFOWHEEL_DllAPI __declspec( dllimport ) +#endif // CARLAEGOVEHICLEINFOWHEEL_SOURCE #else -#define CarlaEgoVehicleInfoWheel_DllAPI +#define CARLAEGOVEHICLEINFOWHEEL_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaEgoVehicleInfoWheel_DllAPI +#define CARLAEGOVEHICLEINFOWHEEL_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaEgoVehicleInfoWheel defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLEINFOWHEEL - */ - class CarlaEgoVehicleInfoWheel - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaEgoVehicleInfoWheel(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaEgoVehicleInfoWheel(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleInfoWheel( - const CarlaEgoVehicleInfoWheel& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleInfoWheel( - CarlaEgoVehicleInfoWheel&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleInfoWheel& operator =( - const CarlaEgoVehicleInfoWheel& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleInfoWheel& operator =( - CarlaEgoVehicleInfoWheel&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleInfoWheel object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaEgoVehicleInfoWheel& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleInfoWheel object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaEgoVehicleInfoWheel& x) const; - - /*! - * @brief This function sets a value in member tire_friction - * @param _tire_friction New value for member tire_friction - */ - eProsima_user_DllExport void tire_friction( - float _tire_friction); - - /*! - * @brief This function returns the value of member tire_friction - * @return Value of member tire_friction - */ - eProsima_user_DllExport float tire_friction() const; - - /*! - * @brief This function returns a reference to member tire_friction - * @return Reference to member tire_friction - */ - eProsima_user_DllExport float& tire_friction(); - - /*! - * @brief This function sets a value in member damping_rate - * @param _damping_rate New value for member damping_rate - */ - eProsima_user_DllExport void damping_rate( - float _damping_rate); - - /*! - * @brief This function returns the value of member damping_rate - * @return Value of member damping_rate - */ - eProsima_user_DllExport float damping_rate() const; - - /*! - * @brief This function returns a reference to member damping_rate - * @return Reference to member damping_rate - */ - eProsima_user_DllExport float& damping_rate(); - - /*! - * @brief This function sets a value in member max_steer_angle - * @param _max_steer_angle New value for member max_steer_angle - */ - eProsima_user_DllExport void max_steer_angle( - float _max_steer_angle); - - /*! - * @brief This function returns the value of member max_steer_angle - * @return Value of member max_steer_angle - */ - eProsima_user_DllExport float max_steer_angle() const; - - /*! - * @brief This function returns a reference to member max_steer_angle - * @return Reference to member max_steer_angle - */ - eProsima_user_DllExport float& max_steer_angle(); - - /*! - * @brief This function sets a value in member radius - * @param _radius New value for member radius - */ - eProsima_user_DllExport void radius( - float _radius); - - /*! - * @brief This function returns the value of member radius - * @return Value of member radius - */ - eProsima_user_DllExport float radius() const; - - /*! - * @brief This function returns a reference to member radius - * @return Reference to member radius - */ - eProsima_user_DllExport float& radius(); - - /*! - * @brief This function sets a value in member max_brake_torque - * @param _max_brake_torque New value for member max_brake_torque - */ - eProsima_user_DllExport void max_brake_torque( - float _max_brake_torque); - - /*! - * @brief This function returns the value of member max_brake_torque - * @return Value of member max_brake_torque - */ - eProsima_user_DllExport float max_brake_torque() const; - - /*! - * @brief This function returns a reference to member max_brake_torque - * @return Reference to member max_brake_torque - */ - eProsima_user_DllExport float& max_brake_torque(); - - /*! - * @brief This function sets a value in member max_handbrake_torque - * @param _max_handbrake_torque New value for member max_handbrake_torque - */ - eProsima_user_DllExport void max_handbrake_torque( - float _max_handbrake_torque); - - /*! - * @brief This function returns the value of member max_handbrake_torque - * @return Value of member max_handbrake_torque - */ - eProsima_user_DllExport float max_handbrake_torque() const; - - /*! - * @brief This function returns a reference to member max_handbrake_torque - * @return Reference to member max_handbrake_torque - */ - eProsima_user_DllExport float& max_handbrake_torque(); - - /*! - * @brief This function copies the value in member position - * @param _position New value to be copied in member position - */ - eProsima_user_DllExport void position( - const geometry_msgs::msg::Vector3& _position); - - /*! - * @brief This function moves the value in member position - * @param _position New value to be moved in member position - */ - eProsima_user_DllExport void position( - geometry_msgs::msg::Vector3&& _position); - - /*! - * @brief This function returns a constant reference to member position - * @return Constant reference to member position - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& position() const; - - /*! - * @brief This function returns a reference to member position - * @return Reference to member position - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& position(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleInfoWheel& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - float m_tire_friction; - float m_damping_rate; - float m_max_steer_angle; - float m_radius; - float m_max_brake_torque; - float m_max_handbrake_torque; - geometry_msgs::msg::Vector3 m_position; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaEgoVehicleInfoWheel defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleInfoWheel + */ +class CarlaEgoVehicleInfoWheel +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleInfoWheel(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel( + const CarlaEgoVehicleInfoWheel& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel( + CarlaEgoVehicleInfoWheel&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel& operator =( + const CarlaEgoVehicleInfoWheel& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleInfoWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleInfoWheel& operator =( + CarlaEgoVehicleInfoWheel&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleInfoWheel object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleInfoWheel& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleInfoWheel object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleInfoWheel& x) const; + + /*! + * @brief This function sets a value in member tire_friction + * @param _tire_friction New value for member tire_friction + */ + eProsima_user_DllExport void tire_friction( + float _tire_friction); + + /*! + * @brief This function returns the value of member tire_friction + * @return Value of member tire_friction + */ + eProsima_user_DllExport float tire_friction() const; + + /*! + * @brief This function returns a reference to member tire_friction + * @return Reference to member tire_friction + */ + eProsima_user_DllExport float& tire_friction(); + + + /*! + * @brief This function sets a value in member damping_rate + * @param _damping_rate New value for member damping_rate + */ + eProsima_user_DllExport void damping_rate( + float _damping_rate); + + /*! + * @brief This function returns the value of member damping_rate + * @return Value of member damping_rate + */ + eProsima_user_DllExport float damping_rate() const; + + /*! + * @brief This function returns a reference to member damping_rate + * @return Reference to member damping_rate + */ + eProsima_user_DllExport float& damping_rate(); + + + /*! + * @brief This function sets a value in member max_steer_angle + * @param _max_steer_angle New value for member max_steer_angle + */ + eProsima_user_DllExport void max_steer_angle( + float _max_steer_angle); + + /*! + * @brief This function returns the value of member max_steer_angle + * @return Value of member max_steer_angle + */ + eProsima_user_DllExport float max_steer_angle() const; + + /*! + * @brief This function returns a reference to member max_steer_angle + * @return Reference to member max_steer_angle + */ + eProsima_user_DllExport float& max_steer_angle(); + + + /*! + * @brief This function sets a value in member radius + * @param _radius New value for member radius + */ + eProsima_user_DllExport void radius( + float _radius); + + /*! + * @brief This function returns the value of member radius + * @return Value of member radius + */ + eProsima_user_DllExport float radius() const; + + /*! + * @brief This function returns a reference to member radius + * @return Reference to member radius + */ + eProsima_user_DllExport float& radius(); + + + /*! + * @brief This function sets a value in member max_brake_torque + * @param _max_brake_torque New value for member max_brake_torque + */ + eProsima_user_DllExport void max_brake_torque( + float _max_brake_torque); + + /*! + * @brief This function returns the value of member max_brake_torque + * @return Value of member max_brake_torque + */ + eProsima_user_DllExport float max_brake_torque() const; + + /*! + * @brief This function returns a reference to member max_brake_torque + * @return Reference to member max_brake_torque + */ + eProsima_user_DllExport float& max_brake_torque(); + + + /*! + * @brief This function sets a value in member max_handbrake_torque + * @param _max_handbrake_torque New value for member max_handbrake_torque + */ + eProsima_user_DllExport void max_handbrake_torque( + float _max_handbrake_torque); + + /*! + * @brief This function returns the value of member max_handbrake_torque + * @return Value of member max_handbrake_torque + */ + eProsima_user_DllExport float max_handbrake_torque() const; + + /*! + * @brief This function returns a reference to member max_handbrake_torque + * @return Reference to member max_handbrake_torque + */ + eProsima_user_DllExport float& max_handbrake_torque(); + + + /*! + * @brief This function copies the value in member position + * @param _position New value to be copied in member position + */ + eProsima_user_DllExport void position( + const geometry_msgs::msg::Vector3& _position); + + /*! + * @brief This function moves the value in member position + * @param _position New value to be moved in member position + */ + eProsima_user_DllExport void position( + geometry_msgs::msg::Vector3&& _position); + + /*! + * @brief This function returns a constant reference to member position + * @return Constant reference to member position + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& position() const; + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& position(); + +private: + + float m_tire_friction{0.0}; + float m_damping_rate{0.0}; + float m_max_steer_angle{0.0}; + float m_radius{0.0}; + float m_max_brake_torque{0.0}; + float m_max_handbrake_torque{0.0}; + geometry_msgs::msg::Vector3 m_position; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelCdrAux.hpp new file mode 100644 index 00000000000..17e7dc497ba --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoWheelCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEELCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEELCDRAUX_HPP_ + +#include "CarlaEgoVehicleInfoWheel.h" + +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleInfoWheel_max_cdr_typesize {56UL}; +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleInfoWheel_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleInfoWheel& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEELCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelCdrAux.ipp new file mode 100644 index 00000000000..687b6908eff --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelCdrAux.ipp @@ -0,0 +1,178 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleInfoWheelCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEELCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEELCDRAUX_IPP_ + +#include "CarlaEgoVehicleInfoWheelCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaEgoVehicleInfoWheel& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.tire_friction(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.damping_rate(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.max_steer_angle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.radius(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.max_brake_torque(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.max_handbrake_torque(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.position(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleInfoWheel& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.tire_friction() + << eprosima::fastcdr::MemberId(1) << data.damping_rate() + << eprosima::fastcdr::MemberId(2) << data.max_steer_angle() + << eprosima::fastcdr::MemberId(3) << data.radius() + << eprosima::fastcdr::MemberId(4) << data.max_brake_torque() + << eprosima::fastcdr::MemberId(5) << data.max_handbrake_torque() + << eprosima::fastcdr::MemberId(6) << data.position() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaEgoVehicleInfoWheel& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.tire_friction(); + break; + + case 1: + dcdr >> data.damping_rate(); + break; + + case 2: + dcdr >> data.max_steer_angle(); + break; + + case 3: + dcdr >> data.radius(); + break; + + case 4: + dcdr >> data.max_brake_torque(); + break; + + case 5: + dcdr >> data.max_handbrake_torque(); + break; + + case 6: + dcdr >> data.position(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleInfoWheel& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEELCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.cxx index 977bb4ffb1f..7053a6b4126 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaEgoVehicleInfoWheelPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaEgoVehicleInfoWheelPubSubTypes.h" +#include "CarlaEgoVehicleInfoWheelCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaEgoVehicleInfoWheelPubSubType::CarlaEgoVehicleInfoWheelPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaEgoVehicleInfoWheel_"); - auto type_size = CarlaEgoVehicleInfoWheel::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaEgoVehicleInfoWheel::isKeyDefined(); - size_t keyLength = CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize() > 16 ? - CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaEgoVehicleInfoWheelPubSubType::~CarlaEgoVehicleInfoWheelPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaEgoVehicleInfoWheelPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaEgoVehicleInfoWheel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaEgoVehicleInfoWheelPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaEgoVehicleInfoWheel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaEgoVehicleInfoWheelPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaEgoVehicleInfoWheelPubSubType::createData() - { - return reinterpret_cast(new CarlaEgoVehicleInfoWheel()); - } - - void CarlaEgoVehicleInfoWheelPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaEgoVehicleInfoWheelPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaEgoVehicleInfoWheel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaEgoVehicleInfoWheel::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaEgoVehicleInfoWheelPubSubType::CarlaEgoVehicleInfoWheelPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaEgoVehicleInfoWheel_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaEgoVehicleInfoWheel::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaEgoVehicleInfoWheel_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaEgoVehicleInfoWheelPubSubType::~CarlaEgoVehicleInfoWheelPubSubType() +{ +} + +bool CarlaEgoVehicleInfoWheelPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaEgoVehicleInfoWheel* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaEgoVehicleInfoWheelPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaEgoVehicleInfoWheel* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaEgoVehicleInfoWheelPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaEgoVehicleInfoWheelPubSubType::createData() +{ + return reinterpret_cast(new CarlaEgoVehicleInfoWheel()); +} + +void CarlaEgoVehicleInfoWheelPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaEgoVehicleInfoWheelPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.h index 7538ebc2f1b..68a6d8f992c 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleInfoWheelPubSubTypes.h @@ -16,92 +16,121 @@ * @file CarlaEgoVehicleInfoWheelPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaEgoVehicleInfoWheel.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "geometry_msgs/msg/Vector3PubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaEgoVehicleInfoWheel is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleInfoWheel defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleInfoWheel + */ +class CarlaEgoVehicleInfoWheelPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaEgoVehicleInfoWheel defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLEINFOWHEEL - */ - class CarlaEgoVehicleInfoWheelPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaEgoVehicleInfoWheel type; + typedef CarlaEgoVehicleInfoWheel type; - eProsima_user_DllExport CarlaEgoVehicleInfoWheelPubSubType(); + eProsima_user_DllExport CarlaEgoVehicleInfoWheelPubSubType(); - eProsima_user_DllExport virtual ~CarlaEgoVehicleInfoWheelPubSubType(); + eProsima_user_DllExport ~CarlaEgoVehicleInfoWheelPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaEgoVehicleInfoWheel(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLEINFOWHEEL_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.cxx index 4af4ff867f9..a48b2704480 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaEgoVehicleStatus.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,46 +27,35 @@ char dummy; #endif // _WIN32 #include "CarlaEgoVehicleStatus.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace carla_msgs { +namespace msg { -carla_msgs::msg::CarlaEgoVehicleStatus::CarlaEgoVehicleStatus() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2cf3d63b - - // m_velocity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7674f035 - m_velocity = 0.0; - // m_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@69e153c5 - - // m_orientation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@173ed316 +namespace CarlaEgoVehicleStatus_Constants { - // m_active_control_type com.eprosima.idl.parser.typecode.PrimitiveTypeCode@25ce9dc4 - m_active_control_type = 0; - // m_last_applied_vehicle_control com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@74ea2410 - // m_last_applied_ackermann_control com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@17f62e33 +} // namespace CarlaEgoVehicleStatus_Constants +CarlaEgoVehicleStatus::CarlaEgoVehicleStatus() +{ } -carla_msgs::msg::CarlaEgoVehicleStatus::~CarlaEgoVehicleStatus() +CarlaEgoVehicleStatus::~CarlaEgoVehicleStatus() { - - - - - - } -carla_msgs::msg::CarlaEgoVehicleStatus::CarlaEgoVehicleStatus( +CarlaEgoVehicleStatus::CarlaEgoVehicleStatus( const CarlaEgoVehicleStatus& x) { m_header = x.m_header; @@ -78,8 +67,8 @@ carla_msgs::msg::CarlaEgoVehicleStatus::CarlaEgoVehicleStatus( m_last_applied_ackermann_control = x.m_last_applied_ackermann_control; } -carla_msgs::msg::CarlaEgoVehicleStatus::CarlaEgoVehicleStatus( - CarlaEgoVehicleStatus&& x) +CarlaEgoVehicleStatus::CarlaEgoVehicleStatus( + CarlaEgoVehicleStatus&& x) noexcept { m_header = std::move(x.m_header); m_velocity = x.m_velocity; @@ -90,7 +79,7 @@ carla_msgs::msg::CarlaEgoVehicleStatus::CarlaEgoVehicleStatus( m_last_applied_ackermann_control = std::move(x.m_last_applied_ackermann_control); } -carla_msgs::msg::CarlaEgoVehicleStatus& carla_msgs::msg::CarlaEgoVehicleStatus::operator =( +CarlaEgoVehicleStatus& CarlaEgoVehicleStatus::operator =( const CarlaEgoVehicleStatus& x) { @@ -101,12 +90,11 @@ carla_msgs::msg::CarlaEgoVehicleStatus& carla_msgs::msg::CarlaEgoVehicleStatus:: m_active_control_type = x.m_active_control_type; m_last_applied_vehicle_control = x.m_last_applied_vehicle_control; m_last_applied_ackermann_control = x.m_last_applied_ackermann_control; - return *this; } -carla_msgs::msg::CarlaEgoVehicleStatus& carla_msgs::msg::CarlaEgoVehicleStatus::operator =( - CarlaEgoVehicleStatus&& x) +CarlaEgoVehicleStatus& CarlaEgoVehicleStatus::operator =( + CarlaEgoVehicleStatus&& x) noexcept { m_header = std::move(x.m_header); @@ -116,99 +104,32 @@ carla_msgs::msg::CarlaEgoVehicleStatus& carla_msgs::msg::CarlaEgoVehicleStatus:: m_active_control_type = x.m_active_control_type; m_last_applied_vehicle_control = std::move(x.m_last_applied_vehicle_control); m_last_applied_ackermann_control = std::move(x.m_last_applied_ackermann_control); - return *this; } -bool carla_msgs::msg::CarlaEgoVehicleStatus::operator ==( +bool CarlaEgoVehicleStatus::operator ==( const CarlaEgoVehicleStatus& x) const { - - return (m_header == x.m_header && m_velocity == x.m_velocity && m_acceleration == x.m_acceleration && m_orientation == x.m_orientation && m_active_control_type == x.m_active_control_type && m_last_applied_vehicle_control == x.m_last_applied_vehicle_control && m_last_applied_ackermann_control == x.m_last_applied_ackermann_control); + return (m_header == x.m_header && + m_velocity == x.m_velocity && + m_acceleration == x.m_acceleration && + m_orientation == x.m_orientation && + m_active_control_type == x.m_active_control_type && + m_last_applied_vehicle_control == x.m_last_applied_vehicle_control && + m_last_applied_ackermann_control == x.m_last_applied_ackermann_control); } -bool carla_msgs::msg::CarlaEgoVehicleStatus::operator !=( +bool CarlaEgoVehicleStatus::operator !=( const CarlaEgoVehicleStatus& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaEgoVehicleStatus::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Accel::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Quaternion::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += carla_msgs::msg::CarlaEgoVehicleControl::getMaxCdrSerializedSize(current_alignment); - current_alignment += ackermann_msgs::msg::AckermannDriveStamped::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaEgoVehicleStatus::getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleStatus& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Accel::getCdrSerializedSize(data.acceleration(), current_alignment); - current_alignment += geometry_msgs::msg::Quaternion::getCdrSerializedSize(data.orientation(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += carla_msgs::msg::CarlaEgoVehicleControl::getCdrSerializedSize(data.last_applied_vehicle_control(), current_alignment); - current_alignment += ackermann_msgs::msg::AckermannDriveStamped::getCdrSerializedSize(data.last_applied_ackermann_control(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaEgoVehicleStatus::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_velocity; - scdr << m_acceleration; - scdr << m_orientation; - scdr << m_active_control_type; - scdr << m_last_applied_vehicle_control; - scdr << m_last_applied_ackermann_control; - -} - -void carla_msgs::msg::CarlaEgoVehicleStatus::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_velocity; - dcdr >> m_acceleration; - dcdr >> m_orientation; - dcdr >> m_active_control_type; - dcdr >> m_last_applied_vehicle_control; - dcdr >> m_last_applied_ackermann_control; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaEgoVehicleStatus::header( +void CarlaEgoVehicleStatus::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -218,7 +139,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaEgoVehicleStatus::header( +void CarlaEgoVehicleStatus::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -228,7 +149,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleStatus::header() const +const std_msgs::msg::Header& CarlaEgoVehicleStatus::header() const { return m_header; } @@ -237,15 +158,17 @@ const std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleStatus::header() co * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleStatus::header() +std_msgs::msg::Header& CarlaEgoVehicleStatus::header() { return m_header; } + + /*! * @brief This function sets a value in member velocity * @param _velocity New value for member velocity */ -void carla_msgs::msg::CarlaEgoVehicleStatus::velocity( +void CarlaEgoVehicleStatus::velocity( float _velocity) { m_velocity = _velocity; @@ -255,7 +178,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::velocity( * @brief This function returns the value of member velocity * @return Value of member velocity */ -float carla_msgs::msg::CarlaEgoVehicleStatus::velocity() const +float CarlaEgoVehicleStatus::velocity() const { return m_velocity; } @@ -264,16 +187,17 @@ float carla_msgs::msg::CarlaEgoVehicleStatus::velocity() const * @brief This function returns a reference to member velocity * @return Reference to member velocity */ -float& carla_msgs::msg::CarlaEgoVehicleStatus::velocity() +float& CarlaEgoVehicleStatus::velocity() { return m_velocity; } + /*! * @brief This function copies the value in member acceleration * @param _acceleration New value to be copied in member acceleration */ -void carla_msgs::msg::CarlaEgoVehicleStatus::acceleration( +void CarlaEgoVehicleStatus::acceleration( const geometry_msgs::msg::Accel& _acceleration) { m_acceleration = _acceleration; @@ -283,7 +207,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::acceleration( * @brief This function moves the value in member acceleration * @param _acceleration New value to be moved in member acceleration */ -void carla_msgs::msg::CarlaEgoVehicleStatus::acceleration( +void CarlaEgoVehicleStatus::acceleration( geometry_msgs::msg::Accel&& _acceleration) { m_acceleration = std::move(_acceleration); @@ -293,7 +217,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::acceleration( * @brief This function returns a constant reference to member acceleration * @return Constant reference to member acceleration */ -const geometry_msgs::msg::Accel& carla_msgs::msg::CarlaEgoVehicleStatus::acceleration() const +const geometry_msgs::msg::Accel& CarlaEgoVehicleStatus::acceleration() const { return m_acceleration; } @@ -302,15 +226,17 @@ const geometry_msgs::msg::Accel& carla_msgs::msg::CarlaEgoVehicleStatus::acceler * @brief This function returns a reference to member acceleration * @return Reference to member acceleration */ -geometry_msgs::msg::Accel& carla_msgs::msg::CarlaEgoVehicleStatus::acceleration() +geometry_msgs::msg::Accel& CarlaEgoVehicleStatus::acceleration() { return m_acceleration; } + + /*! * @brief This function copies the value in member orientation * @param _orientation New value to be copied in member orientation */ -void carla_msgs::msg::CarlaEgoVehicleStatus::orientation( +void CarlaEgoVehicleStatus::orientation( const geometry_msgs::msg::Quaternion& _orientation) { m_orientation = _orientation; @@ -320,7 +246,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::orientation( * @brief This function moves the value in member orientation * @param _orientation New value to be moved in member orientation */ -void carla_msgs::msg::CarlaEgoVehicleStatus::orientation( +void CarlaEgoVehicleStatus::orientation( geometry_msgs::msg::Quaternion&& _orientation) { m_orientation = std::move(_orientation); @@ -330,7 +256,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::orientation( * @brief This function returns a constant reference to member orientation * @return Constant reference to member orientation */ -const geometry_msgs::msg::Quaternion& carla_msgs::msg::CarlaEgoVehicleStatus::orientation() const +const geometry_msgs::msg::Quaternion& CarlaEgoVehicleStatus::orientation() const { return m_orientation; } @@ -339,15 +265,17 @@ const geometry_msgs::msg::Quaternion& carla_msgs::msg::CarlaEgoVehicleStatus::or * @brief This function returns a reference to member orientation * @return Reference to member orientation */ -geometry_msgs::msg::Quaternion& carla_msgs::msg::CarlaEgoVehicleStatus::orientation() +geometry_msgs::msg::Quaternion& CarlaEgoVehicleStatus::orientation() { return m_orientation; } + + /*! * @brief This function sets a value in member active_control_type * @param _active_control_type New value for member active_control_type */ -void carla_msgs::msg::CarlaEgoVehicleStatus::active_control_type( +void CarlaEgoVehicleStatus::active_control_type( uint8_t _active_control_type) { m_active_control_type = _active_control_type; @@ -357,7 +285,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::active_control_type( * @brief This function returns the value of member active_control_type * @return Value of member active_control_type */ -uint8_t carla_msgs::msg::CarlaEgoVehicleStatus::active_control_type() const +uint8_t CarlaEgoVehicleStatus::active_control_type() const { return m_active_control_type; } @@ -366,16 +294,17 @@ uint8_t carla_msgs::msg::CarlaEgoVehicleStatus::active_control_type() const * @brief This function returns a reference to member active_control_type * @return Reference to member active_control_type */ -uint8_t& carla_msgs::msg::CarlaEgoVehicleStatus::active_control_type() +uint8_t& CarlaEgoVehicleStatus::active_control_type() { return m_active_control_type; } + /*! * @brief This function copies the value in member last_applied_vehicle_control * @param _last_applied_vehicle_control New value to be copied in member last_applied_vehicle_control */ -void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control( +void CarlaEgoVehicleStatus::last_applied_vehicle_control( const carla_msgs::msg::CarlaEgoVehicleControl& _last_applied_vehicle_control) { m_last_applied_vehicle_control = _last_applied_vehicle_control; @@ -385,7 +314,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control( * @brief This function moves the value in member last_applied_vehicle_control * @param _last_applied_vehicle_control New value to be moved in member last_applied_vehicle_control */ -void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control( +void CarlaEgoVehicleStatus::last_applied_vehicle_control( carla_msgs::msg::CarlaEgoVehicleControl&& _last_applied_vehicle_control) { m_last_applied_vehicle_control = std::move(_last_applied_vehicle_control); @@ -395,7 +324,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control( * @brief This function returns a constant reference to member last_applied_vehicle_control * @return Constant reference to member last_applied_vehicle_control */ -const carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control() const +const carla_msgs::msg::CarlaEgoVehicleControl& CarlaEgoVehicleStatus::last_applied_vehicle_control() const { return m_last_applied_vehicle_control; } @@ -404,15 +333,17 @@ const carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleS * @brief This function returns a reference to member last_applied_vehicle_control * @return Reference to member last_applied_vehicle_control */ -carla_msgs::msg::CarlaEgoVehicleControl& carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_vehicle_control() +carla_msgs::msg::CarlaEgoVehicleControl& CarlaEgoVehicleStatus::last_applied_vehicle_control() { return m_last_applied_vehicle_control; } + + /*! * @brief This function copies the value in member last_applied_ackermann_control * @param _last_applied_ackermann_control New value to be copied in member last_applied_ackermann_control */ -void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control( +void CarlaEgoVehicleStatus::last_applied_ackermann_control( const ackermann_msgs::msg::AckermannDriveStamped& _last_applied_ackermann_control) { m_last_applied_ackermann_control = _last_applied_ackermann_control; @@ -422,7 +353,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control( * @brief This function moves the value in member last_applied_ackermann_control * @param _last_applied_ackermann_control New value to be moved in member last_applied_ackermann_control */ -void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control( +void CarlaEgoVehicleStatus::last_applied_ackermann_control( ackermann_msgs::msg::AckermannDriveStamped&& _last_applied_ackermann_control) { m_last_applied_ackermann_control = std::move(_last_applied_ackermann_control); @@ -432,7 +363,7 @@ void carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control( * @brief This function returns a constant reference to member last_applied_ackermann_control * @return Constant reference to member last_applied_ackermann_control */ -const ackermann_msgs::msg::AckermannDriveStamped& carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control() const +const ackermann_msgs::msg::AckermannDriveStamped& CarlaEgoVehicleStatus::last_applied_ackermann_control() const { return m_last_applied_ackermann_control; } @@ -441,31 +372,18 @@ const ackermann_msgs::msg::AckermannDriveStamped& carla_msgs::msg::CarlaEgoVehic * @brief This function returns a reference to member last_applied_ackermann_control * @return Reference to member last_applied_ackermann_control */ -ackermann_msgs::msg::AckermannDriveStamped& carla_msgs::msg::CarlaEgoVehicleStatus::last_applied_ackermann_control() +ackermann_msgs::msg::AckermannDriveStamped& CarlaEgoVehicleStatus::last_applied_ackermann_control() { return m_last_applied_ackermann_control; } -size_t carla_msgs::msg::CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool carla_msgs::msg::CarlaEgoVehicleStatus::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaEgoVehicleStatus::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaEgoVehicleStatusCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.h index 385f5096c68..44d4da4a2bf 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatus.h @@ -16,23 +16,28 @@ * @file CarlaEgoVehicleStatus.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "geometry_msgs/msg/Quaternion.h" -#include "carla_msgs/msg/CarlaEgoVehicleControl.h" +#include "CarlaEgoVehicleControl.h" #include "geometry_msgs/msg/Accel.h" #include "ackermann_msgs/msg/AckermannDriveStamped.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -46,323 +51,290 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaEgoVehicleStatus_SOURCE) -#define CarlaEgoVehicleStatus_DllAPI __declspec( dllexport ) +#if defined(CARLAEGOVEHICLESTATUS_SOURCE) +#define CARLAEGOVEHICLESTATUS_DllAPI __declspec( dllexport ) #else -#define CarlaEgoVehicleStatus_DllAPI __declspec( dllimport ) -#endif // CarlaEgoVehicleStatus_SOURCE +#define CARLAEGOVEHICLESTATUS_DllAPI __declspec( dllimport ) +#endif // CARLAEGOVEHICLESTATUS_SOURCE #else -#define CarlaEgoVehicleStatus_DllAPI +#define CARLAEGOVEHICLESTATUS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaEgoVehicleStatus_DllAPI +#define CARLAEGOVEHICLESTATUS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - namespace CarlaEgoVehicleStatus_Constants { - const uint8_t VEHICLE_CONTROL = 0; - const uint8_t ACKERMANN_CONTROL = 1; - } // namespace CarlaEgoVehicleStatus_Constants - /*! - * @brief This class represents the structure CarlaEgoVehicleStatus defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLESTATUS - */ - class CarlaEgoVehicleStatus - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaEgoVehicleStatus(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaEgoVehicleStatus(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleStatus( - const CarlaEgoVehicleStatus& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleStatus( - CarlaEgoVehicleStatus&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleStatus& operator =( - const CarlaEgoVehicleStatus& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleStatus& operator =( - CarlaEgoVehicleStatus&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleStatus object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaEgoVehicleStatus& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleStatus object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaEgoVehicleStatus& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member velocity - * @param _velocity New value for member velocity - */ - eProsima_user_DllExport void velocity( - float _velocity); - - /*! - * @brief This function returns the value of member velocity - * @return Value of member velocity - */ - eProsima_user_DllExport float velocity() const; - - /*! - * @brief This function returns a reference to member velocity - * @return Reference to member velocity - */ - eProsima_user_DllExport float& velocity(); - - /*! - * @brief This function copies the value in member acceleration - * @param _acceleration New value to be copied in member acceleration - */ - eProsima_user_DllExport void acceleration( - const geometry_msgs::msg::Accel& _acceleration); - - /*! - * @brief This function moves the value in member acceleration - * @param _acceleration New value to be moved in member acceleration - */ - eProsima_user_DllExport void acceleration( - geometry_msgs::msg::Accel&& _acceleration); - - /*! - * @brief This function returns a constant reference to member acceleration - * @return Constant reference to member acceleration - */ - eProsima_user_DllExport const geometry_msgs::msg::Accel& acceleration() const; - - /*! - * @brief This function returns a reference to member acceleration - * @return Reference to member acceleration - */ - eProsima_user_DllExport geometry_msgs::msg::Accel& acceleration(); - /*! - * @brief This function copies the value in member orientation - * @param _orientation New value to be copied in member orientation - */ - eProsima_user_DllExport void orientation( - const geometry_msgs::msg::Quaternion& _orientation); - - /*! - * @brief This function moves the value in member orientation - * @param _orientation New value to be moved in member orientation - */ - eProsima_user_DllExport void orientation( - geometry_msgs::msg::Quaternion&& _orientation); - - /*! - * @brief This function returns a constant reference to member orientation - * @return Constant reference to member orientation - */ - eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; - - /*! - * @brief This function returns a reference to member orientation - * @return Reference to member orientation - */ - eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); - /*! - * @brief This function sets a value in member active_control_type - * @param _active_control_type New value for member active_control_type - */ - eProsima_user_DllExport void active_control_type( - uint8_t _active_control_type); - - /*! - * @brief This function returns the value of member active_control_type - * @return Value of member active_control_type - */ - eProsima_user_DllExport uint8_t active_control_type() const; - - /*! - * @brief This function returns a reference to member active_control_type - * @return Reference to member active_control_type - */ - eProsima_user_DllExport uint8_t& active_control_type(); - - /*! - * @brief This function copies the value in member last_applied_vehicle_control - * @param _last_applied_vehicle_control New value to be copied in member last_applied_vehicle_control - */ - eProsima_user_DllExport void last_applied_vehicle_control( - const carla_msgs::msg::CarlaEgoVehicleControl& _last_applied_vehicle_control); - - /*! - * @brief This function moves the value in member last_applied_vehicle_control - * @param _last_applied_vehicle_control New value to be moved in member last_applied_vehicle_control - */ - eProsima_user_DllExport void last_applied_vehicle_control( - carla_msgs::msg::CarlaEgoVehicleControl&& _last_applied_vehicle_control); - - /*! - * @brief This function returns a constant reference to member last_applied_vehicle_control - * @return Constant reference to member last_applied_vehicle_control - */ - eProsima_user_DllExport const carla_msgs::msg::CarlaEgoVehicleControl& last_applied_vehicle_control() const; - - /*! - * @brief This function returns a reference to member last_applied_vehicle_control - * @return Reference to member last_applied_vehicle_control - */ - eProsima_user_DllExport carla_msgs::msg::CarlaEgoVehicleControl& last_applied_vehicle_control(); - /*! - * @brief This function copies the value in member last_applied_ackermann_control - * @param _last_applied_ackermann_control New value to be copied in member last_applied_ackermann_control - */ - eProsima_user_DllExport void last_applied_ackermann_control( - const ackermann_msgs::msg::AckermannDriveStamped& _last_applied_ackermann_control); - - /*! - * @brief This function moves the value in member last_applied_ackermann_control - * @param _last_applied_ackermann_control New value to be moved in member last_applied_ackermann_control - */ - eProsima_user_DllExport void last_applied_ackermann_control( - ackermann_msgs::msg::AckermannDriveStamped&& _last_applied_ackermann_control); - - /*! - * @brief This function returns a constant reference to member last_applied_ackermann_control - * @return Constant reference to member last_applied_ackermann_control - */ - eProsima_user_DllExport const ackermann_msgs::msg::AckermannDriveStamped& last_applied_ackermann_control() const; - - /*! - * @brief This function returns a reference to member last_applied_ackermann_control - * @return Reference to member last_applied_ackermann_control - */ - eProsima_user_DllExport ackermann_msgs::msg::AckermannDriveStamped& last_applied_ackermann_control(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleStatus& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - float m_velocity; - geometry_msgs::msg::Accel m_acceleration; - geometry_msgs::msg::Quaternion m_orientation; - uint8_t m_active_control_type; - carla_msgs::msg::CarlaEgoVehicleControl m_last_applied_vehicle_control; - ackermann_msgs::msg::AckermannDriveStamped m_last_applied_ackermann_control; - }; - } // namespace msg + +namespace msg { + +namespace CarlaEgoVehicleStatus_Constants { + +const uint8_t VEHICLE_CONTROL = 0; +const uint8_t ACKERMANN_CONTROL = 1; + +} // namespace CarlaEgoVehicleStatus_Constants + + +/*! + * @brief This class represents the structure CarlaEgoVehicleStatus defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleStatus + */ +class CarlaEgoVehicleStatus +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus( + const CarlaEgoVehicleStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus( + CarlaEgoVehicleStatus&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus& operator =( + const CarlaEgoVehicleStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleStatus that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleStatus& operator =( + CarlaEgoVehicleStatus&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleStatus& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member velocity + * @param _velocity New value for member velocity + */ + eProsima_user_DllExport void velocity( + float _velocity); + + /*! + * @brief This function returns the value of member velocity + * @return Value of member velocity + */ + eProsima_user_DllExport float velocity() const; + + /*! + * @brief This function returns a reference to member velocity + * @return Reference to member velocity + */ + eProsima_user_DllExport float& velocity(); + + + /*! + * @brief This function copies the value in member acceleration + * @param _acceleration New value to be copied in member acceleration + */ + eProsima_user_DllExport void acceleration( + const geometry_msgs::msg::Accel& _acceleration); + + /*! + * @brief This function moves the value in member acceleration + * @param _acceleration New value to be moved in member acceleration + */ + eProsima_user_DllExport void acceleration( + geometry_msgs::msg::Accel&& _acceleration); + + /*! + * @brief This function returns a constant reference to member acceleration + * @return Constant reference to member acceleration + */ + eProsima_user_DllExport const geometry_msgs::msg::Accel& acceleration() const; + + /*! + * @brief This function returns a reference to member acceleration + * @return Reference to member acceleration + */ + eProsima_user_DllExport geometry_msgs::msg::Accel& acceleration(); + + + /*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ + eProsima_user_DllExport void orientation( + const geometry_msgs::msg::Quaternion& _orientation); + + /*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ + eProsima_user_DllExport void orientation( + geometry_msgs::msg::Quaternion&& _orientation); + + /*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ + eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; + + /*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ + eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); + + + /*! + * @brief This function sets a value in member active_control_type + * @param _active_control_type New value for member active_control_type + */ + eProsima_user_DllExport void active_control_type( + uint8_t _active_control_type); + + /*! + * @brief This function returns the value of member active_control_type + * @return Value of member active_control_type + */ + eProsima_user_DllExport uint8_t active_control_type() const; + + /*! + * @brief This function returns a reference to member active_control_type + * @return Reference to member active_control_type + */ + eProsima_user_DllExport uint8_t& active_control_type(); + + + /*! + * @brief This function copies the value in member last_applied_vehicle_control + * @param _last_applied_vehicle_control New value to be copied in member last_applied_vehicle_control + */ + eProsima_user_DllExport void last_applied_vehicle_control( + const carla_msgs::msg::CarlaEgoVehicleControl& _last_applied_vehicle_control); + + /*! + * @brief This function moves the value in member last_applied_vehicle_control + * @param _last_applied_vehicle_control New value to be moved in member last_applied_vehicle_control + */ + eProsima_user_DllExport void last_applied_vehicle_control( + carla_msgs::msg::CarlaEgoVehicleControl&& _last_applied_vehicle_control); + + /*! + * @brief This function returns a constant reference to member last_applied_vehicle_control + * @return Constant reference to member last_applied_vehicle_control + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaEgoVehicleControl& last_applied_vehicle_control() const; + + /*! + * @brief This function returns a reference to member last_applied_vehicle_control + * @return Reference to member last_applied_vehicle_control + */ + eProsima_user_DllExport carla_msgs::msg::CarlaEgoVehicleControl& last_applied_vehicle_control(); + + + /*! + * @brief This function copies the value in member last_applied_ackermann_control + * @param _last_applied_ackermann_control New value to be copied in member last_applied_ackermann_control + */ + eProsima_user_DllExport void last_applied_ackermann_control( + const ackermann_msgs::msg::AckermannDriveStamped& _last_applied_ackermann_control); + + /*! + * @brief This function moves the value in member last_applied_ackermann_control + * @param _last_applied_ackermann_control New value to be moved in member last_applied_ackermann_control + */ + eProsima_user_DllExport void last_applied_ackermann_control( + ackermann_msgs::msg::AckermannDriveStamped&& _last_applied_ackermann_control); + + /*! + * @brief This function returns a constant reference to member last_applied_ackermann_control + * @return Constant reference to member last_applied_ackermann_control + */ + eProsima_user_DllExport const ackermann_msgs::msg::AckermannDriveStamped& last_applied_ackermann_control() const; + + /*! + * @brief This function returns a reference to member last_applied_ackermann_control + * @return Reference to member last_applied_ackermann_control + */ + eProsima_user_DllExport ackermann_msgs::msg::AckermannDriveStamped& last_applied_ackermann_control(); + +private: + + std_msgs::msg::Header m_header; + float m_velocity{0.0}; + geometry_msgs::msg::Accel m_acceleration; + geometry_msgs::msg::Quaternion m_orientation; + uint8_t m_active_control_type{0}; + carla_msgs::msg::CarlaEgoVehicleControl m_last_applied_vehicle_control; + ackermann_msgs::msg::AckermannDriveStamped m_last_applied_ackermann_control; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusCdrAux.hpp new file mode 100644 index 00000000000..1f5af9f648e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusCdrAux.hpp @@ -0,0 +1,60 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleStatusCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUSCDRAUX_HPP_ + +#include "CarlaEgoVehicleStatus.h" + +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleStatus_max_cdr_typesize {1004UL}; +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleStatus_max_key_cdr_typesize {0UL}; + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleStatus& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusCdrAux.ipp new file mode 100644 index 00000000000..1eb5497de48 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusCdrAux.ipp @@ -0,0 +1,183 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleStatusCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUSCDRAUX_IPP_ + +#include "CarlaEgoVehicleStatusCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaEgoVehicleStatus& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.velocity(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.acceleration(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.orientation(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.active_control_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.last_applied_vehicle_control(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.last_applied_ackermann_control(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleStatus& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.velocity() + << eprosima::fastcdr::MemberId(2) << data.acceleration() + << eprosima::fastcdr::MemberId(3) << data.orientation() + << eprosima::fastcdr::MemberId(4) << data.active_control_type() + << eprosima::fastcdr::MemberId(5) << data.last_applied_vehicle_control() + << eprosima::fastcdr::MemberId(6) << data.last_applied_ackermann_control() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaEgoVehicleStatus& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.velocity(); + break; + + case 2: + dcdr >> data.acceleration(); + break; + + case 3: + dcdr >> data.orientation(); + break; + + case 4: + dcdr >> data.active_control_type(); + break; + + case 5: + dcdr >> data.last_applied_vehicle_control(); + break; + + case 6: + dcdr >> data.last_applied_ackermann_control(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleStatus& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.cxx index 38b6d501450..7d67c4ba678 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.cxx @@ -16,166 +16,191 @@ * @file CarlaEgoVehicleStatusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaEgoVehicleStatusPubSubTypes.h" +#include "CarlaEgoVehicleStatusCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - namespace CarlaEgoVehicleStatus_Constants { - - - - } //End of namespace CarlaEgoVehicleStatus_Constants - CarlaEgoVehicleStatusPubSubType::CarlaEgoVehicleStatusPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaEgoVehicleStatus_"); - auto type_size = CarlaEgoVehicleStatus::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaEgoVehicleStatus::isKeyDefined(); - size_t keyLength = CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize() > 16 ? - CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaEgoVehicleStatusPubSubType::~CarlaEgoVehicleStatusPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaEgoVehicleStatusPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaEgoVehicleStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaEgoVehicleStatusPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaEgoVehicleStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaEgoVehicleStatusPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaEgoVehicleStatusPubSubType::createData() - { - return reinterpret_cast(new CarlaEgoVehicleStatus()); - } - - void CarlaEgoVehicleStatusPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaEgoVehicleStatusPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaEgoVehicleStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaEgoVehicleStatus::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace CarlaEgoVehicleStatus_Constants { + + + + + +} //End of namespace CarlaEgoVehicleStatus_Constants + + + +CarlaEgoVehicleStatusPubSubType::CarlaEgoVehicleStatusPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaEgoVehicleStatus_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaEgoVehicleStatus::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaEgoVehicleStatus_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaEgoVehicleStatusPubSubType::~CarlaEgoVehicleStatusPubSubType() +{ +} + +bool CarlaEgoVehicleStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaEgoVehicleStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaEgoVehicleStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaEgoVehicleStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaEgoVehicleStatusPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaEgoVehicleStatusPubSubType::createData() +{ + return reinterpret_cast(new CarlaEgoVehicleStatus()); +} + +void CarlaEgoVehicleStatusPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaEgoVehicleStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h index f78f6a26419..4626127cf64 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleStatusPubSubTypes.h @@ -16,97 +16,130 @@ * @file CarlaEgoVehicleStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaEgoVehicleStatus.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "geometry_msgs/msg/QuaternionPubSubTypes.h" +#include "CarlaEgoVehicleControlPubSubTypes.h" +#include "geometry_msgs/msg/AccelPubSubTypes.h" +#include "ackermann_msgs/msg/AckermannDriveStampedPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaEgoVehicleStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs -{ - namespace msg - { - namespace CarlaEgoVehicleStatus_Constants - { +namespace carla_msgs { +namespace msg { +namespace CarlaEgoVehicleStatus_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type CarlaEgoVehicleStatus defined by the user in the IDL file. - * @ingroup CARLAEGOVEHICLESTATUS - */ - class CarlaEgoVehicleStatusPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef CarlaEgoVehicleStatus type; - eProsima_user_DllExport CarlaEgoVehicleStatusPubSubType(); +} // namespace CarlaEgoVehicleStatus_Constants - eProsima_user_DllExport virtual ~CarlaEgoVehicleStatusPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleStatus defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleStatus + */ +class CarlaEgoVehicleStatusPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CarlaEgoVehicleStatus type; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport CarlaEgoVehicleStatusPubSubType(); - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport ~CarlaEgoVehicleStatusPubSubType() override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport void deleteData( + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLESTATUS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx index 950e143610b..b6ac46ca57f 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaEgoVehicleTelemetryData.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,76 +27,35 @@ char dummy; #endif // _WIN32 #include "CarlaEgoVehicleTelemetryData.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; -#define carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_cdr_typesize 44ULL; -#define carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_cdr_typesize 4704ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; -#define carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_key_cdr_typesize 0ULL; -#define carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - - - - +namespace carla_msgs { +namespace msg { +namespace CarlaEgoVehicleTelemetryData_Constants { +} // namespace CarlaEgoVehicleTelemetryData_Constants - - - - -carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData() +CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData() { - // std_msgs::msg::Header m_header - - // float m_speed - m_speed = 0.0; - // float m_steer - m_steer = 0.0; - // float m_throttle - m_throttle = 0.0; - // float m_brake - m_brake = 0.0; - // float m_engine_rpm - m_engine_rpm = 0.0; - // long m_gear - m_gear = 0; - // float m_drag - m_drag = 0.0; - // sequence m_wheels - - // unsigned long m_light_state_flags - m_light_state_flags = 0; - } -carla_msgs::msg::CarlaEgoVehicleTelemetryData::~CarlaEgoVehicleTelemetryData() +CarlaEgoVehicleTelemetryData::~CarlaEgoVehicleTelemetryData() { - - - - - - - - - - } -carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( +CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( const CarlaEgoVehicleTelemetryData& x) { m_header = x.m_header; @@ -111,8 +70,8 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( m_light_state_flags = x.m_light_state_flags; } -carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( - CarlaEgoVehicleTelemetryData&& x) noexcept +CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( + CarlaEgoVehicleTelemetryData&& x) noexcept { m_header = std::move(x.m_header); m_speed = x.m_speed; @@ -126,7 +85,7 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData::CarlaEgoVehicleTelemetryData( m_light_state_flags = x.m_light_state_flags; } -carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator =( +CarlaEgoVehicleTelemetryData& CarlaEgoVehicleTelemetryData::operator =( const CarlaEgoVehicleTelemetryData& x) { @@ -140,11 +99,10 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleT m_drag = x.m_drag; m_wheels = x.m_wheels; m_light_state_flags = x.m_light_state_flags; - return *this; } -carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator =( +CarlaEgoVehicleTelemetryData& CarlaEgoVehicleTelemetryData::operator =( CarlaEgoVehicleTelemetryData&& x) noexcept { @@ -158,112 +116,35 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryData& carla_msgs::msg::CarlaEgoVehicleT m_drag = x.m_drag; m_wheels = std::move(x.m_wheels); m_light_state_flags = x.m_light_state_flags; - return *this; } -bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator ==( +bool CarlaEgoVehicleTelemetryData::operator ==( const CarlaEgoVehicleTelemetryData& x) const { - - return (m_header == x.m_header && m_speed == x.m_speed && m_steer == x.m_steer && m_throttle == x.m_throttle && m_brake == x.m_brake && m_engine_rpm == x.m_engine_rpm && m_gear == x.m_gear && m_drag == x.m_drag && m_wheels == x.m_wheels && m_light_state_flags == x.m_light_state_flags); + return (m_header == x.m_header && + m_speed == x.m_speed && + m_steer == x.m_steer && + m_throttle == x.m_throttle && + m_brake == x.m_brake && + m_engine_rpm == x.m_engine_rpm && + m_gear == x.m_gear && + m_drag == x.m_drag && + m_wheels == x.m_wheels && + m_light_state_flags == x.m_light_state_flags); } -bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::operator !=( +bool CarlaEgoVehicleTelemetryData::operator !=( const CarlaEgoVehicleTelemetryData& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_cdr_typesize; -} - -size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleTelemetryData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.wheels().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getCdrSerializedSize(data.wheels().at(a), current_alignment);} - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_speed; - scdr << m_steer; - scdr << m_throttle; - scdr << m_brake; - scdr << m_engine_rpm; - scdr << m_gear; - scdr << m_drag; - scdr << m_wheels; - scdr << m_light_state_flags; - -} - -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_speed; - dcdr >> m_steer; - dcdr >> m_throttle; - dcdr >> m_brake; - dcdr >> m_engine_rpm; - dcdr >> m_gear; - dcdr >> m_drag; - dcdr >> m_wheels; - dcdr >> m_light_state_flags; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::header( +void CarlaEgoVehicleTelemetryData::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -273,7 +154,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::header( +void CarlaEgoVehicleTelemetryData::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -283,7 +164,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleTelemetryData::header() const +const std_msgs::msg::Header& CarlaEgoVehicleTelemetryData::header() const { return m_header; } @@ -292,15 +173,17 @@ const std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleTelemetryData::head * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& carla_msgs::msg::CarlaEgoVehicleTelemetryData::header() +std_msgs::msg::Header& CarlaEgoVehicleTelemetryData::header() { return m_header; } + + /*! * @brief This function sets a value in member speed * @param _speed New value for member speed */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::speed( +void CarlaEgoVehicleTelemetryData::speed( float _speed) { m_speed = _speed; @@ -310,7 +193,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::speed( * @brief This function returns the value of member speed * @return Value of member speed */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryData::speed() const +float CarlaEgoVehicleTelemetryData::speed() const { return m_speed; } @@ -319,16 +202,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryData::speed() const * @brief This function returns a reference to member speed * @return Reference to member speed */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::speed() +float& CarlaEgoVehicleTelemetryData::speed() { return m_speed; } + /*! * @brief This function sets a value in member steer * @param _steer New value for member steer */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::steer( +void CarlaEgoVehicleTelemetryData::steer( float _steer) { m_steer = _steer; @@ -338,7 +222,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::steer( * @brief This function returns the value of member steer * @return Value of member steer */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryData::steer() const +float CarlaEgoVehicleTelemetryData::steer() const { return m_steer; } @@ -347,16 +231,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryData::steer() const * @brief This function returns a reference to member steer * @return Reference to member steer */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::steer() +float& CarlaEgoVehicleTelemetryData::steer() { return m_steer; } + /*! * @brief This function sets a value in member throttle * @param _throttle New value for member throttle */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::throttle( +void CarlaEgoVehicleTelemetryData::throttle( float _throttle) { m_throttle = _throttle; @@ -366,7 +251,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::throttle( * @brief This function returns the value of member throttle * @return Value of member throttle */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryData::throttle() const +float CarlaEgoVehicleTelemetryData::throttle() const { return m_throttle; } @@ -375,16 +260,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryData::throttle() const * @brief This function returns a reference to member throttle * @return Reference to member throttle */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::throttle() +float& CarlaEgoVehicleTelemetryData::throttle() { return m_throttle; } + /*! * @brief This function sets a value in member brake * @param _brake New value for member brake */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::brake( +void CarlaEgoVehicleTelemetryData::brake( float _brake) { m_brake = _brake; @@ -394,7 +280,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::brake( * @brief This function returns the value of member brake * @return Value of member brake */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryData::brake() const +float CarlaEgoVehicleTelemetryData::brake() const { return m_brake; } @@ -403,16 +289,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryData::brake() const * @brief This function returns a reference to member brake * @return Reference to member brake */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::brake() +float& CarlaEgoVehicleTelemetryData::brake() { return m_brake; } + /*! * @brief This function sets a value in member engine_rpm * @param _engine_rpm New value for member engine_rpm */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::engine_rpm( +void CarlaEgoVehicleTelemetryData::engine_rpm( float _engine_rpm) { m_engine_rpm = _engine_rpm; @@ -422,7 +309,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::engine_rpm( * @brief This function returns the value of member engine_rpm * @return Value of member engine_rpm */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryData::engine_rpm() const +float CarlaEgoVehicleTelemetryData::engine_rpm() const { return m_engine_rpm; } @@ -431,16 +318,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryData::engine_rpm() const * @brief This function returns a reference to member engine_rpm * @return Reference to member engine_rpm */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::engine_rpm() +float& CarlaEgoVehicleTelemetryData::engine_rpm() { return m_engine_rpm; } + /*! * @brief This function sets a value in member gear * @param _gear New value for member gear */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::gear( +void CarlaEgoVehicleTelemetryData::gear( int32_t _gear) { m_gear = _gear; @@ -450,7 +338,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::gear( * @brief This function returns the value of member gear * @return Value of member gear */ -int32_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::gear() const +int32_t CarlaEgoVehicleTelemetryData::gear() const { return m_gear; } @@ -459,16 +347,17 @@ int32_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::gear() const * @brief This function returns a reference to member gear * @return Reference to member gear */ -int32_t& carla_msgs::msg::CarlaEgoVehicleTelemetryData::gear() +int32_t& CarlaEgoVehicleTelemetryData::gear() { return m_gear; } + /*! * @brief This function sets a value in member drag * @param _drag New value for member drag */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::drag( +void CarlaEgoVehicleTelemetryData::drag( float _drag) { m_drag = _drag; @@ -478,7 +367,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::drag( * @brief This function returns the value of member drag * @return Value of member drag */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryData::drag() const +float CarlaEgoVehicleTelemetryData::drag() const { return m_drag; } @@ -487,16 +376,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryData::drag() const * @brief This function returns a reference to member drag * @return Reference to member drag */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryData::drag() +float& CarlaEgoVehicleTelemetryData::drag() { return m_drag; } + /*! * @brief This function copies the value in member wheels * @param _wheels New value to be copied in member wheels */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels( +void CarlaEgoVehicleTelemetryData::wheels( const std::vector& _wheels) { m_wheels = _wheels; @@ -506,7 +396,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels( * @brief This function moves the value in member wheels * @param _wheels New value to be moved in member wheels */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels( +void CarlaEgoVehicleTelemetryData::wheels( std::vector&& _wheels) { m_wheels = std::move(_wheels); @@ -516,7 +406,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels( * @brief This function returns a constant reference to member wheels * @return Constant reference to member wheels */ -const std::vector& carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels() const +const std::vector& CarlaEgoVehicleTelemetryData::wheels() const { return m_wheels; } @@ -525,15 +415,17 @@ const std::vector& carla_msg * @brief This function returns a reference to member wheels * @return Reference to member wheels */ -std::vector& carla_msgs::msg::CarlaEgoVehicleTelemetryData::wheels() +std::vector& CarlaEgoVehicleTelemetryData::wheels() { return m_wheels; } + + /*! * @brief This function sets a value in member light_state_flags * @param _light_state_flags New value for member light_state_flags */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::light_state_flags( +void CarlaEgoVehicleTelemetryData::light_state_flags( uint32_t _light_state_flags) { m_light_state_flags = _light_state_flags; @@ -543,7 +435,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryData::light_state_flags( * @brief This function returns the value of member light_state_flags * @return Value of member light_state_flags */ -uint32_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::light_state_flags() const +uint32_t CarlaEgoVehicleTelemetryData::light_state_flags() const { return m_light_state_flags; } @@ -552,30 +444,18 @@ uint32_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::light_state_flags() cons * @brief This function returns a reference to member light_state_flags * @return Reference to member light_state_flags */ -uint32_t& carla_msgs::msg::CarlaEgoVehicleTelemetryData::light_state_flags() +uint32_t& CarlaEgoVehicleTelemetryData::light_state_flags() { return m_light_state_flags; } -size_t carla_msgs::msg::CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_key_cdr_typesize; -} - -bool carla_msgs::msg::CarlaEgoVehicleTelemetryData::isKeyDefined() -{ - return false; -} -void carla_msgs::msg::CarlaEgoVehicleTelemetryData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} +} // namespace msg +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaEgoVehicleTelemetryDataCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h index cff149cc65a..c46da700ef8 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryData.h @@ -16,23 +16,26 @@ * @file CarlaEgoVehicleTelemetryData.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ -#include "CarlaEgoVehicleTelemetryDataWheel.h" -#include "std_msgs/msg/Header.h" - -#include - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaEgoVehicleTelemetryDataWheel.h" +#include "std_msgs/msg/Header.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -61,363 +64,328 @@ namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - namespace CarlaEgoVehicleTelemetryData_Constants { - const uint32_t LIGHTSTATEFLAG_NONE = 0; - const uint32_t LIGHTSTATEFLAG_POSITION = 1; - const uint32_t LIGHTSTATEFLAG_LOWBEAM = 2; - const uint32_t LIGHTSTATEFLAG_HIGHBEAM = 4; - const uint32_t LIGHTSTATEFLAG_BRAKE = 8; - const uint32_t LIGHTSTATEFLAG_RIGHTBLINKER = 16; - const uint32_t LIGHTSTATEFLAG_LEFTBLINKER = 32; - const uint32_t LIGHTSTATEFLAG_REVERSE = 64; - const uint32_t LIGHTSTATEFLAG_FOG = 128; - const uint32_t LIGHTSTATEFLAG_INTERIOR = 256; - const uint32_t LIGHTSTATEFLAG_SPECIAL1 = 512; - const uint32_t LIGHTSTATEFLAG_SPECIAL2 = 1024; - const uint32_t LIGHTSTATEFLAG_ALL = 4294967295; - } // namespace CarlaEgoVehicleTelemetryData_Constants - /*! - * @brief This class represents the structure CarlaEgoVehicleTelemetryData defined by the user in the IDL file. - * @ingroup CarlaEgoVehicleTelemetryData - */ - class CarlaEgoVehicleTelemetryData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaEgoVehicleTelemetryData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryData( - const CarlaEgoVehicleTelemetryData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryData( - CarlaEgoVehicleTelemetryData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryData& operator =( - const CarlaEgoVehicleTelemetryData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryData& operator =( - CarlaEgoVehicleTelemetryData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaEgoVehicleTelemetryData& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaEgoVehicleTelemetryData& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member speed - * @param _speed New value for member speed - */ - eProsima_user_DllExport void speed( - float _speed); - - /*! - * @brief This function returns the value of member speed - * @return Value of member speed - */ - eProsima_user_DllExport float speed() const; - - /*! - * @brief This function returns a reference to member speed - * @return Reference to member speed - */ - eProsima_user_DllExport float& speed(); - - /*! - * @brief This function sets a value in member steer - * @param _steer New value for member steer - */ - eProsima_user_DllExport void steer( - float _steer); - - /*! - * @brief This function returns the value of member steer - * @return Value of member steer - */ - eProsima_user_DllExport float steer() const; - - /*! - * @brief This function returns a reference to member steer - * @return Reference to member steer - */ - eProsima_user_DllExport float& steer(); - - /*! - * @brief This function sets a value in member throttle - * @param _throttle New value for member throttle - */ - eProsima_user_DllExport void throttle( - float _throttle); - - /*! - * @brief This function returns the value of member throttle - * @return Value of member throttle - */ - eProsima_user_DllExport float throttle() const; - - /*! - * @brief This function returns a reference to member throttle - * @return Reference to member throttle - */ - eProsima_user_DllExport float& throttle(); - - /*! - * @brief This function sets a value in member brake - * @param _brake New value for member brake - */ - eProsima_user_DllExport void brake( - float _brake); - - /*! - * @brief This function returns the value of member brake - * @return Value of member brake - */ - eProsima_user_DllExport float brake() const; - - /*! - * @brief This function returns a reference to member brake - * @return Reference to member brake - */ - eProsima_user_DllExport float& brake(); - - /*! - * @brief This function sets a value in member engine_rpm - * @param _engine_rpm New value for member engine_rpm - */ - eProsima_user_DllExport void engine_rpm( - float _engine_rpm); - - /*! - * @brief This function returns the value of member engine_rpm - * @return Value of member engine_rpm - */ - eProsima_user_DllExport float engine_rpm() const; - - /*! - * @brief This function returns a reference to member engine_rpm - * @return Reference to member engine_rpm - */ - eProsima_user_DllExport float& engine_rpm(); - - /*! - * @brief This function sets a value in member gear - * @param _gear New value for member gear - */ - eProsima_user_DllExport void gear( - int32_t _gear); - - /*! - * @brief This function returns the value of member gear - * @return Value of member gear - */ - eProsima_user_DllExport int32_t gear() const; - - /*! - * @brief This function returns a reference to member gear - * @return Reference to member gear - */ - eProsima_user_DllExport int32_t& gear(); - - /*! - * @brief This function sets a value in member drag - * @param _drag New value for member drag - */ - eProsima_user_DllExport void drag( - float _drag); - - /*! - * @brief This function returns the value of member drag - * @return Value of member drag - */ - eProsima_user_DllExport float drag() const; - - /*! - * @brief This function returns a reference to member drag - * @return Reference to member drag - */ - eProsima_user_DllExport float& drag(); - - /*! - * @brief This function copies the value in member wheels - * @param _wheels New value to be copied in member wheels - */ - eProsima_user_DllExport void wheels( - const std::vector& _wheels); - - /*! - * @brief This function moves the value in member wheels - * @param _wheels New value to be moved in member wheels - */ - eProsima_user_DllExport void wheels( - std::vector&& _wheels); - - /*! - * @brief This function returns a constant reference to member wheels - * @return Constant reference to member wheels - */ - eProsima_user_DllExport const std::vector& wheels() const; - - /*! - * @brief This function returns a reference to member wheels - * @return Reference to member wheels - */ - eProsima_user_DllExport std::vector& wheels(); - /*! - * @brief This function sets a value in member light_state_flags - * @param _light_state_flags New value for member light_state_flags - */ - eProsima_user_DllExport void light_state_flags( - uint32_t _light_state_flags); - - /*! - * @brief This function returns the value of member light_state_flags - * @return Value of member light_state_flags - */ - eProsima_user_DllExport uint32_t light_state_flags() const; - - /*! - * @brief This function returns a reference to member light_state_flags - * @return Reference to member light_state_flags - */ - eProsima_user_DllExport uint32_t& light_state_flags(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleTelemetryData& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - float m_speed; - float m_steer; - float m_throttle; - float m_brake; - float m_engine_rpm; - int32_t m_gear; - float m_drag; - std::vector m_wheels; - uint32_t m_light_state_flags; - - }; - } // namespace msg + +namespace msg { + +namespace CarlaEgoVehicleTelemetryData_Constants { + +const uint32_t LIGHTSTATEFLAG_NONE = 0; +const uint32_t LIGHTSTATEFLAG_POSITION = 1; +const uint32_t LIGHTSTATEFLAG_LOWBEAM = 2; +const uint32_t LIGHTSTATEFLAG_HIGHBEAM = 4; +const uint32_t LIGHTSTATEFLAG_BRAKE = 8; +const uint32_t LIGHTSTATEFLAG_RIGHTBLINKER = 16; +const uint32_t LIGHTSTATEFLAG_LEFTBLINKER = 32; +const uint32_t LIGHTSTATEFLAG_REVERSE = 64; +const uint32_t LIGHTSTATEFLAG_FOG = 128; +const uint32_t LIGHTSTATEFLAG_INTERIOR = 256; +const uint32_t LIGHTSTATEFLAG_SPECIAL1 = 512; +const uint32_t LIGHTSTATEFLAG_SPECIAL2 = 1024; +const uint32_t LIGHTSTATEFLAG_ALL = 4294967295; + +} // namespace CarlaEgoVehicleTelemetryData_Constants + + +/*! + * @brief This class represents the structure CarlaEgoVehicleTelemetryData defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleTelemetryData + */ +class CarlaEgoVehicleTelemetryData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleTelemetryData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryData( + const CarlaEgoVehicleTelemetryData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryData( + CarlaEgoVehicleTelemetryData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryData& operator =( + const CarlaEgoVehicleTelemetryData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryData that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryData& operator =( + CarlaEgoVehicleTelemetryData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleTelemetryData& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleTelemetryData& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member speed + * @param _speed New value for member speed + */ + eProsima_user_DllExport void speed( + float _speed); + + /*! + * @brief This function returns the value of member speed + * @return Value of member speed + */ + eProsima_user_DllExport float speed() const; + + /*! + * @brief This function returns a reference to member speed + * @return Reference to member speed + */ + eProsima_user_DllExport float& speed(); + + + /*! + * @brief This function sets a value in member steer + * @param _steer New value for member steer + */ + eProsima_user_DllExport void steer( + float _steer); + + /*! + * @brief This function returns the value of member steer + * @return Value of member steer + */ + eProsima_user_DllExport float steer() const; + + /*! + * @brief This function returns a reference to member steer + * @return Reference to member steer + */ + eProsima_user_DllExport float& steer(); + + + /*! + * @brief This function sets a value in member throttle + * @param _throttle New value for member throttle + */ + eProsima_user_DllExport void throttle( + float _throttle); + + /*! + * @brief This function returns the value of member throttle + * @return Value of member throttle + */ + eProsima_user_DllExport float throttle() const; + + /*! + * @brief This function returns a reference to member throttle + * @return Reference to member throttle + */ + eProsima_user_DllExport float& throttle(); + + + /*! + * @brief This function sets a value in member brake + * @param _brake New value for member brake + */ + eProsima_user_DllExport void brake( + float _brake); + + /*! + * @brief This function returns the value of member brake + * @return Value of member brake + */ + eProsima_user_DllExport float brake() const; + + /*! + * @brief This function returns a reference to member brake + * @return Reference to member brake + */ + eProsima_user_DllExport float& brake(); + + + /*! + * @brief This function sets a value in member engine_rpm + * @param _engine_rpm New value for member engine_rpm + */ + eProsima_user_DllExport void engine_rpm( + float _engine_rpm); + + /*! + * @brief This function returns the value of member engine_rpm + * @return Value of member engine_rpm + */ + eProsima_user_DllExport float engine_rpm() const; + + /*! + * @brief This function returns a reference to member engine_rpm + * @return Reference to member engine_rpm + */ + eProsima_user_DllExport float& engine_rpm(); + + + /*! + * @brief This function sets a value in member gear + * @param _gear New value for member gear + */ + eProsima_user_DllExport void gear( + int32_t _gear); + + /*! + * @brief This function returns the value of member gear + * @return Value of member gear + */ + eProsima_user_DllExport int32_t gear() const; + + /*! + * @brief This function returns a reference to member gear + * @return Reference to member gear + */ + eProsima_user_DllExport int32_t& gear(); + + + /*! + * @brief This function sets a value in member drag + * @param _drag New value for member drag + */ + eProsima_user_DllExport void drag( + float _drag); + + /*! + * @brief This function returns the value of member drag + * @return Value of member drag + */ + eProsima_user_DllExport float drag() const; + + /*! + * @brief This function returns a reference to member drag + * @return Reference to member drag + */ + eProsima_user_DllExport float& drag(); + + + /*! + * @brief This function copies the value in member wheels + * @param _wheels New value to be copied in member wheels + */ + eProsima_user_DllExport void wheels( + const std::vector& _wheels); + + /*! + * @brief This function moves the value in member wheels + * @param _wheels New value to be moved in member wheels + */ + eProsima_user_DllExport void wheels( + std::vector&& _wheels); + + /*! + * @brief This function returns a constant reference to member wheels + * @return Constant reference to member wheels + */ + eProsima_user_DllExport const std::vector& wheels() const; + + /*! + * @brief This function returns a reference to member wheels + * @return Reference to member wheels + */ + eProsima_user_DllExport std::vector& wheels(); + + + /*! + * @brief This function sets a value in member light_state_flags + * @param _light_state_flags New value for member light_state_flags + */ + eProsima_user_DllExport void light_state_flags( + uint32_t _light_state_flags); + + /*! + * @brief This function returns the value of member light_state_flags + * @return Value of member light_state_flags + */ + eProsima_user_DllExport uint32_t light_state_flags() const; + + /*! + * @brief This function returns a reference to member light_state_flags + * @return Reference to member light_state_flags + */ + eProsima_user_DllExport uint32_t& light_state_flags(); + +private: + + std_msgs::msg::Header m_header; + float m_speed{0.0}; + float m_steer{0.0}; + float m_throttle{0.0}; + float m_brake{0.0}; + float m_engine_rpm{0.0}; + int32_t m_gear{0}; + float m_drag{0.0}; + std::vector m_wheels; + uint32_t m_light_state_flags{0}; + +}; + +} // namespace msg + } // namespace carla_msgs #endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_H_ + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataCdrAux.hpp new file mode 100644 index 00000000000..19f339d0200 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataCdrAux.hpp @@ -0,0 +1,78 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATACDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATACDRAUX_HPP_ + +#include "CarlaEgoVehicleTelemetryData.h" + +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_cdr_typesize {5120UL}; +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleTelemetryData& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATACDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataCdrAux.ipp new file mode 100644 index 00000000000..793222c19ba --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataCdrAux.ipp @@ -0,0 +1,229 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATACDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATACDRAUX_IPP_ + +#include "CarlaEgoVehicleTelemetryDataCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaEgoVehicleTelemetryData& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.speed(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.steer(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.throttle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.brake(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.engine_rpm(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.gear(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.drag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.wheels(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.light_state_flags(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleTelemetryData& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.speed() + << eprosima::fastcdr::MemberId(2) << data.steer() + << eprosima::fastcdr::MemberId(3) << data.throttle() + << eprosima::fastcdr::MemberId(4) << data.brake() + << eprosima::fastcdr::MemberId(5) << data.engine_rpm() + << eprosima::fastcdr::MemberId(6) << data.gear() + << eprosima::fastcdr::MemberId(7) << data.drag() + << eprosima::fastcdr::MemberId(8) << data.wheels() + << eprosima::fastcdr::MemberId(9) << data.light_state_flags() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaEgoVehicleTelemetryData& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.speed(); + break; + + case 2: + dcdr >> data.steer(); + break; + + case 3: + dcdr >> data.throttle(); + break; + + case 4: + dcdr >> data.brake(); + break; + + case 5: + dcdr >> data.engine_rpm(); + break; + + case 6: + dcdr >> data.gear(); + break; + + case 7: + dcdr >> data.drag(); + break; + + case 8: + dcdr >> data.wheels(); + break; + + case 9: + dcdr >> data.light_state_flags(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleTelemetryData& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATACDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx index 592dbb703c3..e712b26ae9d 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.cxx @@ -16,21 +16,45 @@ * @file CarlaEgoVehicleTelemetryDataPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaEgoVehicleTelemetryDataPubSubTypes.h" +#include "CarlaEgoVehicleTelemetryDataCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - namespace CarlaEgoVehicleTelemetryData_Constants { +namespace msg { +namespace CarlaEgoVehicleTelemetryData_Constants { + + + + + + + + + + + + + + + + + + + + @@ -38,157 +62,166 @@ namespace carla_msgs { +} //End of namespace CarlaEgoVehicleTelemetryData_Constants +CarlaEgoVehicleTelemetryDataPubSubType::CarlaEgoVehicleTelemetryDataPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaEgoVehicleTelemetryData_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaEgoVehicleTelemetryData::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaEgoVehicleTelemetryData_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} +CarlaEgoVehicleTelemetryDataPubSubType::~CarlaEgoVehicleTelemetryDataPubSubType() +{ +} +bool CarlaEgoVehicleTelemetryDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaEgoVehicleTelemetryData* p_type = + static_cast(data); + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 - } //End of namespace CarlaEgoVehicleTelemetryData_Constants + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - CarlaEgoVehicleTelemetryDataPubSubType::CarlaEgoVehicleTelemetryDataPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaEgoVehicleTelemetryData_"); - auto type_size = CarlaEgoVehicleTelemetryData::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaEgoVehicleTelemetryData::isKeyDefined(); - size_t keyLength = CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize() > 16 ? - CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} - CarlaEgoVehicleTelemetryDataPubSubType::~CarlaEgoVehicleTelemetryDataPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaEgoVehicleTelemetryDataPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaEgoVehicleTelemetryData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaEgoVehicleTelemetryDataPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - CarlaEgoVehicleTelemetryData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaEgoVehicleTelemetryDataPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaEgoVehicleTelemetryDataPubSubType::createData() - { - return reinterpret_cast(new CarlaEgoVehicleTelemetryData()); - } - - void CarlaEgoVehicleTelemetryDataPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaEgoVehicleTelemetryDataPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaEgoVehicleTelemetryData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaEgoVehicleTelemetryData::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +bool CarlaEgoVehicleTelemetryDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaEgoVehicleTelemetryData* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaEgoVehicleTelemetryDataPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaEgoVehicleTelemetryDataPubSubType::createData() +{ + return reinterpret_cast(new CarlaEgoVehicleTelemetryData()); +} + +void CarlaEgoVehicleTelemetryDataPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaEgoVehicleTelemetryDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg } //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h index 5ba0f3f94d1..d5ba58c0285 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataPubSubTypes.h @@ -16,14 +16,19 @@ * @file CarlaEgoVehicleTelemetryDataPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaEgoVehicleTelemetryData.h" @@ -31,17 +36,28 @@ #include "CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h" #include "std_msgs/msg/HeaderPubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaEgoVehicleTelemetryData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs -{ - namespace msg - { - namespace CarlaEgoVehicleTelemetryData_Constants - { +namespace carla_msgs { +namespace msg { +namespace CarlaEgoVehicleTelemetryData_Constants { + + + + + + + + + + + + + + @@ -54,76 +70,96 @@ namespace carla_msgs +} // namespace CarlaEgoVehicleTelemetryData_Constants - } - /*! - * @brief This class represents the TopicDataType of the type CarlaEgoVehicleTelemetryData defined by the user in the IDL file. - * @ingroup CarlaEgoVehicleTelemetryData - */ - class CarlaEgoVehicleTelemetryDataPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef CarlaEgoVehicleTelemetryData type; +/*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleTelemetryData defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleTelemetryData + */ +class CarlaEgoVehicleTelemetryDataPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport CarlaEgoVehicleTelemetryDataPubSubType(); + typedef CarlaEgoVehicleTelemetryData type; - eProsima_user_DllExport virtual ~CarlaEgoVehicleTelemetryDataPubSubType() override; + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport ~CarlaEgoVehicleTelemetryDataPubSubType() override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs #endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATA_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx index e42a9e76bac..4efe63b7837 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaEgoVehicleTelemetryDataWheel.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,59 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaEgoVehicleTelemetryDataWheel.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_cdr_typesize 44ULL; -#define carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_key_cdr_typesize 0ULL; - -carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel() -{ - // float m_tire_friction - m_tire_friction = 0.0; - // float m_lat_slip - m_lat_slip = 0.0; - // float m_long_slip - m_long_slip = 0.0; - // float m_omega - m_omega = 0.0; - // float m_tire_load - m_tire_load = 0.0; - // float m_normalized_tire_load - m_normalized_tire_load = 0.0; - // float m_torque - m_torque = 0.0; - // float m_long_force - m_long_force = 0.0; - // float m_lat_force - m_lat_force = 0.0; - // float m_normalized_long_force - m_normalized_long_force = 0.0; - // float m_normalized_lat_force - m_normalized_lat_force = 0.0; - -} - -carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::~CarlaEgoVehicleTelemetryDataWheel() -{ - - - - - +namespace carla_msgs { +namespace msg { +CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel() +{ +} +CarlaEgoVehicleTelemetryDataWheel::~CarlaEgoVehicleTelemetryDataWheel() +{ } -carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel( +CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel( const CarlaEgoVehicleTelemetryDataWheel& x) { m_tire_friction = x.m_tire_friction; @@ -95,8 +67,8 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryData m_normalized_lat_force = x.m_normalized_lat_force; } -carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel( - CarlaEgoVehicleTelemetryDataWheel&& x) noexcept +CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryDataWheel( + CarlaEgoVehicleTelemetryDataWheel&& x) noexcept { m_tire_friction = x.m_tire_friction; m_lat_slip = x.m_lat_slip; @@ -111,7 +83,7 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::CarlaEgoVehicleTelemetryData m_normalized_lat_force = x.m_normalized_lat_force; } -carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator =( +CarlaEgoVehicleTelemetryDataWheel& CarlaEgoVehicleTelemetryDataWheel::operator =( const CarlaEgoVehicleTelemetryDataWheel& x) { @@ -126,11 +98,10 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& carla_msgs::msg::CarlaEgoVeh m_lat_force = x.m_lat_force; m_normalized_long_force = x.m_normalized_long_force; m_normalized_lat_force = x.m_normalized_lat_force; - return *this; } -carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator =( +CarlaEgoVehicleTelemetryDataWheel& CarlaEgoVehicleTelemetryDataWheel::operator =( CarlaEgoVehicleTelemetryDataWheel&& x) noexcept { @@ -145,115 +116,36 @@ carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& carla_msgs::msg::CarlaEgoVeh m_lat_force = x.m_lat_force; m_normalized_long_force = x.m_normalized_long_force; m_normalized_lat_force = x.m_normalized_lat_force; - return *this; } -bool carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator ==( +bool CarlaEgoVehicleTelemetryDataWheel::operator ==( const CarlaEgoVehicleTelemetryDataWheel& x) const { - - return (m_tire_friction == x.m_tire_friction && m_lat_slip == x.m_lat_slip && m_long_slip == x.m_long_slip && m_omega == x.m_omega && m_tire_load == x.m_tire_load && m_normalized_tire_load == x.m_normalized_tire_load && m_torque == x.m_torque && m_long_force == x.m_long_force && m_lat_force == x.m_lat_force && m_normalized_long_force == x.m_normalized_long_force && m_normalized_lat_force == x.m_normalized_lat_force); + return (m_tire_friction == x.m_tire_friction && + m_lat_slip == x.m_lat_slip && + m_long_slip == x.m_long_slip && + m_omega == x.m_omega && + m_tire_load == x.m_tire_load && + m_normalized_tire_load == x.m_normalized_tire_load && + m_torque == x.m_torque && + m_long_force == x.m_long_force && + m_lat_force == x.m_lat_force && + m_normalized_long_force == x.m_normalized_long_force && + m_normalized_lat_force == x.m_normalized_lat_force); } -bool carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::operator !=( +bool CarlaEgoVehicleTelemetryDataWheel::operator !=( const CarlaEgoVehicleTelemetryDataWheel& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_cdr_typesize; -} - -size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_tire_friction; - scdr << m_lat_slip; - scdr << m_long_slip; - scdr << m_omega; - scdr << m_tire_load; - scdr << m_normalized_tire_load; - scdr << m_torque; - scdr << m_long_force; - scdr << m_lat_force; - scdr << m_normalized_long_force; - scdr << m_normalized_lat_force; - -} - -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_tire_friction; - dcdr >> m_lat_slip; - dcdr >> m_long_slip; - dcdr >> m_omega; - dcdr >> m_tire_load; - dcdr >> m_normalized_tire_load; - dcdr >> m_torque; - dcdr >> m_long_force; - dcdr >> m_lat_force; - dcdr >> m_normalized_long_force; - dcdr >> m_normalized_lat_force; -} - /*! * @brief This function sets a value in member tire_friction * @param _tire_friction New value for member tire_friction */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_friction( +void CarlaEgoVehicleTelemetryDataWheel::tire_friction( float _tire_friction) { m_tire_friction = _tire_friction; @@ -263,7 +155,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_friction( * @brief This function returns the value of member tire_friction * @return Value of member tire_friction */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_friction() const +float CarlaEgoVehicleTelemetryDataWheel::tire_friction() const { return m_tire_friction; } @@ -272,16 +164,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_friction() const * @brief This function returns a reference to member tire_friction * @return Reference to member tire_friction */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_friction() +float& CarlaEgoVehicleTelemetryDataWheel::tire_friction() { return m_tire_friction; } + /*! * @brief This function sets a value in member lat_slip * @param _lat_slip New value for member lat_slip */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_slip( +void CarlaEgoVehicleTelemetryDataWheel::lat_slip( float _lat_slip) { m_lat_slip = _lat_slip; @@ -291,7 +184,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_slip( * @brief This function returns the value of member lat_slip * @return Value of member lat_slip */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_slip() const +float CarlaEgoVehicleTelemetryDataWheel::lat_slip() const { return m_lat_slip; } @@ -300,16 +193,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_slip() const * @brief This function returns a reference to member lat_slip * @return Reference to member lat_slip */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_slip() +float& CarlaEgoVehicleTelemetryDataWheel::lat_slip() { return m_lat_slip; } + /*! * @brief This function sets a value in member long_slip * @param _long_slip New value for member long_slip */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_slip( +void CarlaEgoVehicleTelemetryDataWheel::long_slip( float _long_slip) { m_long_slip = _long_slip; @@ -319,7 +213,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_slip( * @brief This function returns the value of member long_slip * @return Value of member long_slip */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_slip() const +float CarlaEgoVehicleTelemetryDataWheel::long_slip() const { return m_long_slip; } @@ -328,16 +222,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_slip() const * @brief This function returns a reference to member long_slip * @return Reference to member long_slip */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_slip() +float& CarlaEgoVehicleTelemetryDataWheel::long_slip() { return m_long_slip; } + /*! * @brief This function sets a value in member omega * @param _omega New value for member omega */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::omega( +void CarlaEgoVehicleTelemetryDataWheel::omega( float _omega) { m_omega = _omega; @@ -347,7 +242,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::omega( * @brief This function returns the value of member omega * @return Value of member omega */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::omega() const +float CarlaEgoVehicleTelemetryDataWheel::omega() const { return m_omega; } @@ -356,16 +251,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::omega() const * @brief This function returns a reference to member omega * @return Reference to member omega */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::omega() +float& CarlaEgoVehicleTelemetryDataWheel::omega() { return m_omega; } + /*! * @brief This function sets a value in member tire_load * @param _tire_load New value for member tire_load */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_load( +void CarlaEgoVehicleTelemetryDataWheel::tire_load( float _tire_load) { m_tire_load = _tire_load; @@ -375,7 +271,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_load( * @brief This function returns the value of member tire_load * @return Value of member tire_load */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_load() const +float CarlaEgoVehicleTelemetryDataWheel::tire_load() const { return m_tire_load; } @@ -384,16 +280,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_load() const * @brief This function returns a reference to member tire_load * @return Reference to member tire_load */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::tire_load() +float& CarlaEgoVehicleTelemetryDataWheel::tire_load() { return m_tire_load; } + /*! * @brief This function sets a value in member normalized_tire_load * @param _normalized_tire_load New value for member normalized_tire_load */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load( +void CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load( float _normalized_tire_load) { m_normalized_tire_load = _normalized_tire_load; @@ -403,7 +300,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load( * @brief This function returns the value of member normalized_tire_load * @return Value of member normalized_tire_load */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load() const +float CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load() const { return m_normalized_tire_load; } @@ -412,16 +309,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load() * @brief This function returns a reference to member normalized_tire_load * @return Reference to member normalized_tire_load */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load() +float& CarlaEgoVehicleTelemetryDataWheel::normalized_tire_load() { return m_normalized_tire_load; } + /*! * @brief This function sets a value in member torque * @param _torque New value for member torque */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::torque( +void CarlaEgoVehicleTelemetryDataWheel::torque( float _torque) { m_torque = _torque; @@ -431,7 +329,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::torque( * @brief This function returns the value of member torque * @return Value of member torque */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::torque() const +float CarlaEgoVehicleTelemetryDataWheel::torque() const { return m_torque; } @@ -440,16 +338,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::torque() const * @brief This function returns a reference to member torque * @return Reference to member torque */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::torque() +float& CarlaEgoVehicleTelemetryDataWheel::torque() { return m_torque; } + /*! * @brief This function sets a value in member long_force * @param _long_force New value for member long_force */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_force( +void CarlaEgoVehicleTelemetryDataWheel::long_force( float _long_force) { m_long_force = _long_force; @@ -459,7 +358,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_force( * @brief This function returns the value of member long_force * @return Value of member long_force */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_force() const +float CarlaEgoVehicleTelemetryDataWheel::long_force() const { return m_long_force; } @@ -468,16 +367,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_force() const * @brief This function returns a reference to member long_force * @return Reference to member long_force */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::long_force() +float& CarlaEgoVehicleTelemetryDataWheel::long_force() { return m_long_force; } + /*! * @brief This function sets a value in member lat_force * @param _lat_force New value for member lat_force */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_force( +void CarlaEgoVehicleTelemetryDataWheel::lat_force( float _lat_force) { m_lat_force = _lat_force; @@ -487,7 +387,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_force( * @brief This function returns the value of member lat_force * @return Value of member lat_force */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_force() const +float CarlaEgoVehicleTelemetryDataWheel::lat_force() const { return m_lat_force; } @@ -496,16 +396,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_force() const * @brief This function returns a reference to member lat_force * @return Reference to member lat_force */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::lat_force() +float& CarlaEgoVehicleTelemetryDataWheel::lat_force() { return m_lat_force; } + /*! * @brief This function sets a value in member normalized_long_force * @param _normalized_long_force New value for member normalized_long_force */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_long_force( +void CarlaEgoVehicleTelemetryDataWheel::normalized_long_force( float _normalized_long_force) { m_normalized_long_force = _normalized_long_force; @@ -515,7 +416,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_long_force( * @brief This function returns the value of member normalized_long_force * @return Value of member normalized_long_force */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_long_force() const +float CarlaEgoVehicleTelemetryDataWheel::normalized_long_force() const { return m_normalized_long_force; } @@ -524,16 +425,17 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_long_force( * @brief This function returns a reference to member normalized_long_force * @return Reference to member normalized_long_force */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_long_force() +float& CarlaEgoVehicleTelemetryDataWheel::normalized_long_force() { return m_normalized_long_force; } + /*! * @brief This function sets a value in member normalized_lat_force * @param _normalized_lat_force New value for member normalized_lat_force */ -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force( +void CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force( float _normalized_lat_force) { m_normalized_lat_force = _normalized_lat_force; @@ -543,7 +445,7 @@ void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force( * @brief This function returns the value of member normalized_lat_force * @return Value of member normalized_lat_force */ -float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force() const +float CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force() const { return m_normalized_lat_force; } @@ -552,30 +454,18 @@ float carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force() * @brief This function returns a reference to member normalized_lat_force * @return Reference to member normalized_lat_force */ -float& carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force() +float& CarlaEgoVehicleTelemetryDataWheel::normalized_lat_force() { return m_normalized_lat_force; } -size_t carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_key_cdr_typesize; -} -bool carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} +} // namespace msg +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaEgoVehicleTelemetryDataWheelCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h index 2eb27dafd62..d4d84aab5d2 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheel.h @@ -16,21 +16,24 @@ * @file CarlaEgoVehicleTelemetryDataWheel.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ - -#include - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -59,356 +62,318 @@ namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaEgoVehicleTelemetryDataWheel defined by the user in the IDL file. - * @ingroup CarlaEgoVehicleTelemetryDataWheel - */ - class CarlaEgoVehicleTelemetryDataWheel - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaEgoVehicleTelemetryDataWheel(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel( - const CarlaEgoVehicleTelemetryDataWheel& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel( - CarlaEgoVehicleTelemetryDataWheel&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel& operator =( - const CarlaEgoVehicleTelemetryDataWheel& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. - */ - eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel& operator =( - CarlaEgoVehicleTelemetryDataWheel&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaEgoVehicleTelemetryDataWheel& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaEgoVehicleTelemetryDataWheel& x) const; - - /*! - * @brief This function sets a value in member tire_friction - * @param _tire_friction New value for member tire_friction - */ - eProsima_user_DllExport void tire_friction( - float _tire_friction); - - /*! - * @brief This function returns the value of member tire_friction - * @return Value of member tire_friction - */ - eProsima_user_DllExport float tire_friction() const; - - /*! - * @brief This function returns a reference to member tire_friction - * @return Reference to member tire_friction - */ - eProsima_user_DllExport float& tire_friction(); - - /*! - * @brief This function sets a value in member lat_slip - * @param _lat_slip New value for member lat_slip - */ - eProsima_user_DllExport void lat_slip( - float _lat_slip); - - /*! - * @brief This function returns the value of member lat_slip - * @return Value of member lat_slip - */ - eProsima_user_DllExport float lat_slip() const; - - /*! - * @brief This function returns a reference to member lat_slip - * @return Reference to member lat_slip - */ - eProsima_user_DllExport float& lat_slip(); - - /*! - * @brief This function sets a value in member long_slip - * @param _long_slip New value for member long_slip - */ - eProsima_user_DllExport void long_slip( - float _long_slip); - - /*! - * @brief This function returns the value of member long_slip - * @return Value of member long_slip - */ - eProsima_user_DllExport float long_slip() const; - - /*! - * @brief This function returns a reference to member long_slip - * @return Reference to member long_slip - */ - eProsima_user_DllExport float& long_slip(); - - /*! - * @brief This function sets a value in member omega - * @param _omega New value for member omega - */ - eProsima_user_DllExport void omega( - float _omega); - - /*! - * @brief This function returns the value of member omega - * @return Value of member omega - */ - eProsima_user_DllExport float omega() const; - - /*! - * @brief This function returns a reference to member omega - * @return Reference to member omega - */ - eProsima_user_DllExport float& omega(); - - /*! - * @brief This function sets a value in member tire_load - * @param _tire_load New value for member tire_load - */ - eProsima_user_DllExport void tire_load( - float _tire_load); - - /*! - * @brief This function returns the value of member tire_load - * @return Value of member tire_load - */ - eProsima_user_DllExport float tire_load() const; - - /*! - * @brief This function returns a reference to member tire_load - * @return Reference to member tire_load - */ - eProsima_user_DllExport float& tire_load(); - - /*! - * @brief This function sets a value in member normalized_tire_load - * @param _normalized_tire_load New value for member normalized_tire_load - */ - eProsima_user_DllExport void normalized_tire_load( - float _normalized_tire_load); - - /*! - * @brief This function returns the value of member normalized_tire_load - * @return Value of member normalized_tire_load - */ - eProsima_user_DllExport float normalized_tire_load() const; - - /*! - * @brief This function returns a reference to member normalized_tire_load - * @return Reference to member normalized_tire_load - */ - eProsima_user_DllExport float& normalized_tire_load(); - - /*! - * @brief This function sets a value in member torque - * @param _torque New value for member torque - */ - eProsima_user_DllExport void torque( - float _torque); - - /*! - * @brief This function returns the value of member torque - * @return Value of member torque - */ - eProsima_user_DllExport float torque() const; - - /*! - * @brief This function returns a reference to member torque - * @return Reference to member torque - */ - eProsima_user_DllExport float& torque(); - - /*! - * @brief This function sets a value in member long_force - * @param _long_force New value for member long_force - */ - eProsima_user_DllExport void long_force( - float _long_force); - - /*! - * @brief This function returns the value of member long_force - * @return Value of member long_force - */ - eProsima_user_DllExport float long_force() const; - - /*! - * @brief This function returns a reference to member long_force - * @return Reference to member long_force - */ - eProsima_user_DllExport float& long_force(); - - /*! - * @brief This function sets a value in member lat_force - * @param _lat_force New value for member lat_force - */ - eProsima_user_DllExport void lat_force( - float _lat_force); - - /*! - * @brief This function returns the value of member lat_force - * @return Value of member lat_force - */ - eProsima_user_DllExport float lat_force() const; - - /*! - * @brief This function returns a reference to member lat_force - * @return Reference to member lat_force - */ - eProsima_user_DllExport float& lat_force(); - - /*! - * @brief This function sets a value in member normalized_long_force - * @param _normalized_long_force New value for member normalized_long_force - */ - eProsima_user_DllExport void normalized_long_force( - float _normalized_long_force); - - /*! - * @brief This function returns the value of member normalized_long_force - * @return Value of member normalized_long_force - */ - eProsima_user_DllExport float normalized_long_force() const; - - /*! - * @brief This function returns a reference to member normalized_long_force - * @return Reference to member normalized_long_force - */ - eProsima_user_DllExport float& normalized_long_force(); - - /*! - * @brief This function sets a value in member normalized_lat_force - * @param _normalized_lat_force New value for member normalized_lat_force - */ - eProsima_user_DllExport void normalized_lat_force( - float _normalized_lat_force); - - /*! - * @brief This function returns the value of member normalized_lat_force - * @return Value of member normalized_lat_force - */ - eProsima_user_DllExport float normalized_lat_force() const; - - /*! - * @brief This function returns a reference to member normalized_lat_force - * @return Reference to member normalized_lat_force - */ - eProsima_user_DllExport float& normalized_lat_force(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - float m_tire_friction; - float m_lat_slip; - float m_long_slip; - float m_omega; - float m_tire_load; - float m_normalized_tire_load; - float m_torque; - float m_long_force; - float m_lat_force; - float m_normalized_long_force; - float m_normalized_lat_force; - - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaEgoVehicleTelemetryDataWheel defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleTelemetryDataWheel + */ +class CarlaEgoVehicleTelemetryDataWheel +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEgoVehicleTelemetryDataWheel(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel( + const CarlaEgoVehicleTelemetryDataWheel& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel( + CarlaEgoVehicleTelemetryDataWheel&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel& operator =( + const CarlaEgoVehicleTelemetryDataWheel& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel that will be copied. + */ + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheel& operator =( + CarlaEgoVehicleTelemetryDataWheel&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEgoVehicleTelemetryDataWheel& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEgoVehicleTelemetryDataWheel& x) const; + + /*! + * @brief This function sets a value in member tire_friction + * @param _tire_friction New value for member tire_friction + */ + eProsima_user_DllExport void tire_friction( + float _tire_friction); + + /*! + * @brief This function returns the value of member tire_friction + * @return Value of member tire_friction + */ + eProsima_user_DllExport float tire_friction() const; + + /*! + * @brief This function returns a reference to member tire_friction + * @return Reference to member tire_friction + */ + eProsima_user_DllExport float& tire_friction(); + + + /*! + * @brief This function sets a value in member lat_slip + * @param _lat_slip New value for member lat_slip + */ + eProsima_user_DllExport void lat_slip( + float _lat_slip); + + /*! + * @brief This function returns the value of member lat_slip + * @return Value of member lat_slip + */ + eProsima_user_DllExport float lat_slip() const; + + /*! + * @brief This function returns a reference to member lat_slip + * @return Reference to member lat_slip + */ + eProsima_user_DllExport float& lat_slip(); + + + /*! + * @brief This function sets a value in member long_slip + * @param _long_slip New value for member long_slip + */ + eProsima_user_DllExport void long_slip( + float _long_slip); + + /*! + * @brief This function returns the value of member long_slip + * @return Value of member long_slip + */ + eProsima_user_DllExport float long_slip() const; + + /*! + * @brief This function returns a reference to member long_slip + * @return Reference to member long_slip + */ + eProsima_user_DllExport float& long_slip(); + + + /*! + * @brief This function sets a value in member omega + * @param _omega New value for member omega + */ + eProsima_user_DllExport void omega( + float _omega); + + /*! + * @brief This function returns the value of member omega + * @return Value of member omega + */ + eProsima_user_DllExport float omega() const; + + /*! + * @brief This function returns a reference to member omega + * @return Reference to member omega + */ + eProsima_user_DllExport float& omega(); + + + /*! + * @brief This function sets a value in member tire_load + * @param _tire_load New value for member tire_load + */ + eProsima_user_DllExport void tire_load( + float _tire_load); + + /*! + * @brief This function returns the value of member tire_load + * @return Value of member tire_load + */ + eProsima_user_DllExport float tire_load() const; + + /*! + * @brief This function returns a reference to member tire_load + * @return Reference to member tire_load + */ + eProsima_user_DllExport float& tire_load(); + + + /*! + * @brief This function sets a value in member normalized_tire_load + * @param _normalized_tire_load New value for member normalized_tire_load + */ + eProsima_user_DllExport void normalized_tire_load( + float _normalized_tire_load); + + /*! + * @brief This function returns the value of member normalized_tire_load + * @return Value of member normalized_tire_load + */ + eProsima_user_DllExport float normalized_tire_load() const; + + /*! + * @brief This function returns a reference to member normalized_tire_load + * @return Reference to member normalized_tire_load + */ + eProsima_user_DllExport float& normalized_tire_load(); + + + /*! + * @brief This function sets a value in member torque + * @param _torque New value for member torque + */ + eProsima_user_DllExport void torque( + float _torque); + + /*! + * @brief This function returns the value of member torque + * @return Value of member torque + */ + eProsima_user_DllExport float torque() const; + + /*! + * @brief This function returns a reference to member torque + * @return Reference to member torque + */ + eProsima_user_DllExport float& torque(); + + + /*! + * @brief This function sets a value in member long_force + * @param _long_force New value for member long_force + */ + eProsima_user_DllExport void long_force( + float _long_force); + + /*! + * @brief This function returns the value of member long_force + * @return Value of member long_force + */ + eProsima_user_DllExport float long_force() const; + + /*! + * @brief This function returns a reference to member long_force + * @return Reference to member long_force + */ + eProsima_user_DllExport float& long_force(); + + + /*! + * @brief This function sets a value in member lat_force + * @param _lat_force New value for member lat_force + */ + eProsima_user_DllExport void lat_force( + float _lat_force); + + /*! + * @brief This function returns the value of member lat_force + * @return Value of member lat_force + */ + eProsima_user_DllExport float lat_force() const; + + /*! + * @brief This function returns a reference to member lat_force + * @return Reference to member lat_force + */ + eProsima_user_DllExport float& lat_force(); + + + /*! + * @brief This function sets a value in member normalized_long_force + * @param _normalized_long_force New value for member normalized_long_force + */ + eProsima_user_DllExport void normalized_long_force( + float _normalized_long_force); + + /*! + * @brief This function returns the value of member normalized_long_force + * @return Value of member normalized_long_force + */ + eProsima_user_DllExport float normalized_long_force() const; + + /*! + * @brief This function returns a reference to member normalized_long_force + * @return Reference to member normalized_long_force + */ + eProsima_user_DllExport float& normalized_long_force(); + + + /*! + * @brief This function sets a value in member normalized_lat_force + * @param _normalized_lat_force New value for member normalized_lat_force + */ + eProsima_user_DllExport void normalized_lat_force( + float _normalized_lat_force); + + /*! + * @brief This function returns the value of member normalized_lat_force + * @return Value of member normalized_lat_force + */ + eProsima_user_DllExport float normalized_lat_force() const; + + /*! + * @brief This function returns a reference to member normalized_lat_force + * @return Reference to member normalized_lat_force + */ + eProsima_user_DllExport float& normalized_lat_force(); + +private: + + float m_tire_friction{0.0}; + float m_lat_slip{0.0}; + float m_long_slip{0.0}; + float m_omega{0.0}; + float m_tire_load{0.0}; + float m_normalized_tire_load{0.0}; + float m_torque{0.0}; + float m_long_force{0.0}; + float m_lat_force{0.0}; + float m_normalized_long_force{0.0}; + float m_normalized_lat_force{0.0}; + +}; + +} // namespace msg + } // namespace carla_msgs #endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_H_ + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelCdrAux.hpp new file mode 100644 index 00000000000..2ebe1b65a89 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataWheelCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEELCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEELCDRAUX_HPP_ + +#include "CarlaEgoVehicleTelemetryDataWheel.h" + +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_cdr_typesize {48UL}; +constexpr uint32_t carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEELCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelCdrAux.ipp new file mode 100644 index 00000000000..5a5f864c253 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelCdrAux.ipp @@ -0,0 +1,210 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEgoVehicleTelemetryDataWheelCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEELCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEELCDRAUX_IPP_ + +#include "CarlaEgoVehicleTelemetryDataWheelCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.tire_friction(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.lat_slip(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.long_slip(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.omega(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.tire_load(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.normalized_tire_load(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.torque(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.long_force(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.lat_force(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.normalized_long_force(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.normalized_lat_force(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.tire_friction() + << eprosima::fastcdr::MemberId(1) << data.lat_slip() + << eprosima::fastcdr::MemberId(2) << data.long_slip() + << eprosima::fastcdr::MemberId(3) << data.omega() + << eprosima::fastcdr::MemberId(4) << data.tire_load() + << eprosima::fastcdr::MemberId(5) << data.normalized_tire_load() + << eprosima::fastcdr::MemberId(6) << data.torque() + << eprosima::fastcdr::MemberId(7) << data.long_force() + << eprosima::fastcdr::MemberId(8) << data.lat_force() + << eprosima::fastcdr::MemberId(9) << data.normalized_long_force() + << eprosima::fastcdr::MemberId(10) << data.normalized_lat_force() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.tire_friction(); + break; + + case 1: + dcdr >> data.lat_slip(); + break; + + case 2: + dcdr >> data.long_slip(); + break; + + case 3: + dcdr >> data.omega(); + break; + + case 4: + dcdr >> data.tire_load(); + break; + + case 5: + dcdr >> data.normalized_tire_load(); + break; + + case 6: + dcdr >> data.torque(); + break; + + case 7: + dcdr >> data.long_force(); + break; + + case 8: + dcdr >> data.lat_force(); + break; + + case 9: + dcdr >> data.normalized_long_force(); + break; + + case 10: + dcdr >> data.normalized_lat_force(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEgoVehicleTelemetryDataWheel& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEELCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx index f29375edf48..29d4de28ff7 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cxx @@ -16,162 +16,182 @@ * @file CarlaEgoVehicleTelemetryDataWheelPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h" +#include "CarlaEgoVehicleTelemetryDataWheelCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaEgoVehicleTelemetryDataWheelPubSubType::CarlaEgoVehicleTelemetryDataWheelPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaEgoVehicleTelemetryDataWheel_"); - auto type_size = CarlaEgoVehicleTelemetryDataWheel::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaEgoVehicleTelemetryDataWheel::isKeyDefined(); - size_t keyLength = CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize() > 16 ? - CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaEgoVehicleTelemetryDataWheelPubSubType::~CarlaEgoVehicleTelemetryDataWheelPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaEgoVehicleTelemetryDataWheelPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaEgoVehicleTelemetryDataWheel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaEgoVehicleTelemetryDataWheelPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - CarlaEgoVehicleTelemetryDataWheel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaEgoVehicleTelemetryDataWheelPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaEgoVehicleTelemetryDataWheelPubSubType::createData() - { - return reinterpret_cast(new CarlaEgoVehicleTelemetryDataWheel()); - } - - void CarlaEgoVehicleTelemetryDataWheelPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaEgoVehicleTelemetryDataWheelPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaEgoVehicleTelemetryDataWheel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaEgoVehicleTelemetryDataWheel::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaEgoVehicleTelemetryDataWheelPubSubType::CarlaEgoVehicleTelemetryDataWheelPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaEgoVehicleTelemetryDataWheel_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaEgoVehicleTelemetryDataWheel::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaEgoVehicleTelemetryDataWheel_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaEgoVehicleTelemetryDataWheelPubSubType::~CarlaEgoVehicleTelemetryDataWheelPubSubType() +{ +} + +bool CarlaEgoVehicleTelemetryDataWheelPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaEgoVehicleTelemetryDataWheel* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaEgoVehicleTelemetryDataWheelPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaEgoVehicleTelemetryDataWheel* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaEgoVehicleTelemetryDataWheelPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaEgoVehicleTelemetryDataWheelPubSubType::createData() +{ + return reinterpret_cast(new CarlaEgoVehicleTelemetryDataWheel()); +} + +void CarlaEgoVehicleTelemetryDataWheelPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaEgoVehicleTelemetryDataWheelPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg } //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h index b3e93e8987e..13e21844cda 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h @@ -16,131 +16,120 @@ * @file CarlaEgoVehicleTelemetryDataWheelPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastddsgen (version: 2.5.3). + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaEgoVehicleTelemetryDataWheel.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaEgoVehicleTelemetryDataWheel is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs -{ - namespace msg - { - - #ifndef SWIG - namespace detail { - - template - struct CarlaEgoVehicleTelemetryDataWheel_rob - { - friend constexpr typename Tag::type get( - Tag) - { - return M; - } - }; - - struct CarlaEgoVehicleTelemetryDataWheel_f - { - typedef float CarlaEgoVehicleTelemetryDataWheel::* type; - friend constexpr type get( - CarlaEgoVehicleTelemetryDataWheel_f); - }; +namespace carla_msgs { +namespace msg { - template struct CarlaEgoVehicleTelemetryDataWheel_rob; - template - inline size_t constexpr CarlaEgoVehicleTelemetryDataWheel_offset_of() { - return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); - } - } - #endif - /*! - * @brief This class represents the TopicDataType of the type CarlaEgoVehicleTelemetryDataWheel defined by the user in the IDL file. - * @ingroup CarlaEgoVehicleTelemetryDataWheel - */ - class CarlaEgoVehicleTelemetryDataWheelPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +/*! + * @brief This class represents the TopicDataType of the type CarlaEgoVehicleTelemetryDataWheel defined by the user in the IDL file. + * @ingroup CarlaEgoVehicleTelemetryDataWheel + */ +class CarlaEgoVehicleTelemetryDataWheelPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - typedef CarlaEgoVehicleTelemetryDataWheel type; + typedef CarlaEgoVehicleTelemetryDataWheel type; - eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheelPubSubType(); + eProsima_user_DllExport CarlaEgoVehicleTelemetryDataWheelPubSubType(); - eProsima_user_DllExport virtual ~CarlaEgoVehicleTelemetryDataWheelPubSubType() override; + eProsima_user_DllExport ~CarlaEgoVehicleTelemetryDataWheelPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return is_plain_impl(); - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaEgoVehicleTelemetryDataWheel(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - private: +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - static constexpr bool is_plain_impl() - { - return 44ULL == (detail::CarlaEgoVehicleTelemetryDataWheel_offset_of() + sizeof(float)); +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - }}; - } -} +}; +} // namespace msg +} // namespace carla_msgs #endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEGOVEHICLETELEMETRYDATAWHEEL_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.cxx index 7083041fa1c..79f65df9c2b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaEpisodeSettings.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,55 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaEpisodeSettings.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaEpisodeSettings::CarlaEpisodeSettings() -{ - // m_synchronous_mode com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5dafbe45 - m_synchronous_mode = false; - // m_no_rendering_mode com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2254127a - m_no_rendering_mode = false; - // m_fixed_delta_seconds com.eprosima.idl.parser.typecode.PrimitiveTypeCode@51891008 - m_fixed_delta_seconds = 0.0; - // m_substepping com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2f953efd - m_substepping = true; - // m_max_substep_delta_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@f68f0dc - m_max_substep_delta_time = 0.01; - // m_max_substeps com.eprosima.idl.parser.typecode.PrimitiveTypeCode@d2de489 - m_max_substeps = 10; - // m_max_culling_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@14bdbc74 - m_max_culling_distance = 0.0; - // m_deterministic_ragdolls com.eprosima.idl.parser.typecode.PrimitiveTypeCode@12591ac8 - m_deterministic_ragdolls = false; - // m_tile_stream_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5a7fe64f - m_tile_stream_distance = 3000.0; - // m_actor_active_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1b66c0fb - m_actor_active_distance = 2000.0; - // m_spectator_as_ego com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3e0e1046 - m_spectator_as_ego = true; - -} - -carla_msgs::msg::CarlaEpisodeSettings::~CarlaEpisodeSettings() -{ - - - - +namespace carla_msgs { +namespace msg { +CarlaEpisodeSettings::CarlaEpisodeSettings() +{ +} +CarlaEpisodeSettings::~CarlaEpisodeSettings() +{ } -carla_msgs::msg::CarlaEpisodeSettings::CarlaEpisodeSettings( +CarlaEpisodeSettings::CarlaEpisodeSettings( const CarlaEpisodeSettings& x) { m_synchronous_mode = x.m_synchronous_mode; @@ -91,8 +67,8 @@ carla_msgs::msg::CarlaEpisodeSettings::CarlaEpisodeSettings( m_spectator_as_ego = x.m_spectator_as_ego; } -carla_msgs::msg::CarlaEpisodeSettings::CarlaEpisodeSettings( - CarlaEpisodeSettings&& x) +CarlaEpisodeSettings::CarlaEpisodeSettings( + CarlaEpisodeSettings&& x) noexcept { m_synchronous_mode = x.m_synchronous_mode; m_no_rendering_mode = x.m_no_rendering_mode; @@ -107,7 +83,7 @@ carla_msgs::msg::CarlaEpisodeSettings::CarlaEpisodeSettings( m_spectator_as_ego = x.m_spectator_as_ego; } -carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaEpisodeSettings::operator =( +CarlaEpisodeSettings& CarlaEpisodeSettings::operator =( const CarlaEpisodeSettings& x) { @@ -122,12 +98,11 @@ carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaEpisodeSettings::op m_tile_stream_distance = x.m_tile_stream_distance; m_actor_active_distance = x.m_actor_active_distance; m_spectator_as_ego = x.m_spectator_as_ego; - return *this; } -carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaEpisodeSettings::operator =( - CarlaEpisodeSettings&& x) +CarlaEpisodeSettings& CarlaEpisodeSettings::operator =( + CarlaEpisodeSettings&& x) noexcept { m_synchronous_mode = x.m_synchronous_mode; @@ -141,151 +116,36 @@ carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaEpisodeSettings::op m_tile_stream_distance = x.m_tile_stream_distance; m_actor_active_distance = x.m_actor_active_distance; m_spectator_as_ego = x.m_spectator_as_ego; - return *this; } -bool carla_msgs::msg::CarlaEpisodeSettings::operator ==( +bool CarlaEpisodeSettings::operator ==( const CarlaEpisodeSettings& x) const { - - return (m_synchronous_mode == x.m_synchronous_mode && m_no_rendering_mode == x.m_no_rendering_mode && m_fixed_delta_seconds == x.m_fixed_delta_seconds && m_substepping == x.m_substepping && m_max_substep_delta_time == x.m_max_substep_delta_time && m_max_substeps == x.m_max_substeps && m_max_culling_distance == x.m_max_culling_distance && m_deterministic_ragdolls == x.m_deterministic_ragdolls && m_tile_stream_distance == x.m_tile_stream_distance && m_actor_active_distance == x.m_actor_active_distance && m_spectator_as_ego == x.m_spectator_as_ego); + return (m_synchronous_mode == x.m_synchronous_mode && + m_no_rendering_mode == x.m_no_rendering_mode && + m_fixed_delta_seconds == x.m_fixed_delta_seconds && + m_substepping == x.m_substepping && + m_max_substep_delta_time == x.m_max_substep_delta_time && + m_max_substeps == x.m_max_substeps && + m_max_culling_distance == x.m_max_culling_distance && + m_deterministic_ragdolls == x.m_deterministic_ragdolls && + m_tile_stream_distance == x.m_tile_stream_distance && + m_actor_active_distance == x.m_actor_active_distance && + m_spectator_as_ego == x.m_spectator_as_ego); } -bool carla_msgs::msg::CarlaEpisodeSettings::operator !=( +bool CarlaEpisodeSettings::operator !=( const CarlaEpisodeSettings& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaEpisodeSettings::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaEpisodeSettings::getCdrSerializedSize( - const carla_msgs::msg::CarlaEpisodeSettings& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaEpisodeSettings::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_synchronous_mode; - scdr << m_no_rendering_mode; - scdr << m_fixed_delta_seconds; - scdr << m_substepping; - scdr << m_max_substep_delta_time; - scdr << m_max_substeps; - scdr << m_max_culling_distance; - scdr << m_deterministic_ragdolls; - scdr << m_tile_stream_distance; - scdr << m_actor_active_distance; - scdr << m_spectator_as_ego; - -} - -void carla_msgs::msg::CarlaEpisodeSettings::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_synchronous_mode; - dcdr >> m_no_rendering_mode; - dcdr >> m_fixed_delta_seconds; - dcdr >> m_substepping; - dcdr >> m_max_substep_delta_time; - dcdr >> m_max_substeps; - dcdr >> m_max_culling_distance; - dcdr >> m_deterministic_ragdolls; - dcdr >> m_tile_stream_distance; - dcdr >> m_actor_active_distance; - dcdr >> m_spectator_as_ego; -} - /*! * @brief This function sets a value in member synchronous_mode * @param _synchronous_mode New value for member synchronous_mode */ -void carla_msgs::msg::CarlaEpisodeSettings::synchronous_mode( +void CarlaEpisodeSettings::synchronous_mode( bool _synchronous_mode) { m_synchronous_mode = _synchronous_mode; @@ -295,7 +155,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::synchronous_mode( * @brief This function returns the value of member synchronous_mode * @return Value of member synchronous_mode */ -bool carla_msgs::msg::CarlaEpisodeSettings::synchronous_mode() const +bool CarlaEpisodeSettings::synchronous_mode() const { return m_synchronous_mode; } @@ -304,16 +164,17 @@ bool carla_msgs::msg::CarlaEpisodeSettings::synchronous_mode() const * @brief This function returns a reference to member synchronous_mode * @return Reference to member synchronous_mode */ -bool& carla_msgs::msg::CarlaEpisodeSettings::synchronous_mode() +bool& CarlaEpisodeSettings::synchronous_mode() { return m_synchronous_mode; } + /*! * @brief This function sets a value in member no_rendering_mode * @param _no_rendering_mode New value for member no_rendering_mode */ -void carla_msgs::msg::CarlaEpisodeSettings::no_rendering_mode( +void CarlaEpisodeSettings::no_rendering_mode( bool _no_rendering_mode) { m_no_rendering_mode = _no_rendering_mode; @@ -323,7 +184,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::no_rendering_mode( * @brief This function returns the value of member no_rendering_mode * @return Value of member no_rendering_mode */ -bool carla_msgs::msg::CarlaEpisodeSettings::no_rendering_mode() const +bool CarlaEpisodeSettings::no_rendering_mode() const { return m_no_rendering_mode; } @@ -332,16 +193,17 @@ bool carla_msgs::msg::CarlaEpisodeSettings::no_rendering_mode() const * @brief This function returns a reference to member no_rendering_mode * @return Reference to member no_rendering_mode */ -bool& carla_msgs::msg::CarlaEpisodeSettings::no_rendering_mode() +bool& CarlaEpisodeSettings::no_rendering_mode() { return m_no_rendering_mode; } + /*! * @brief This function sets a value in member fixed_delta_seconds * @param _fixed_delta_seconds New value for member fixed_delta_seconds */ -void carla_msgs::msg::CarlaEpisodeSettings::fixed_delta_seconds( +void CarlaEpisodeSettings::fixed_delta_seconds( double _fixed_delta_seconds) { m_fixed_delta_seconds = _fixed_delta_seconds; @@ -351,7 +213,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::fixed_delta_seconds( * @brief This function returns the value of member fixed_delta_seconds * @return Value of member fixed_delta_seconds */ -double carla_msgs::msg::CarlaEpisodeSettings::fixed_delta_seconds() const +double CarlaEpisodeSettings::fixed_delta_seconds() const { return m_fixed_delta_seconds; } @@ -360,16 +222,17 @@ double carla_msgs::msg::CarlaEpisodeSettings::fixed_delta_seconds() const * @brief This function returns a reference to member fixed_delta_seconds * @return Reference to member fixed_delta_seconds */ -double& carla_msgs::msg::CarlaEpisodeSettings::fixed_delta_seconds() +double& CarlaEpisodeSettings::fixed_delta_seconds() { return m_fixed_delta_seconds; } + /*! * @brief This function sets a value in member substepping * @param _substepping New value for member substepping */ -void carla_msgs::msg::CarlaEpisodeSettings::substepping( +void CarlaEpisodeSettings::substepping( bool _substepping) { m_substepping = _substepping; @@ -379,7 +242,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::substepping( * @brief This function returns the value of member substepping * @return Value of member substepping */ -bool carla_msgs::msg::CarlaEpisodeSettings::substepping() const +bool CarlaEpisodeSettings::substepping() const { return m_substepping; } @@ -388,16 +251,17 @@ bool carla_msgs::msg::CarlaEpisodeSettings::substepping() const * @brief This function returns a reference to member substepping * @return Reference to member substepping */ -bool& carla_msgs::msg::CarlaEpisodeSettings::substepping() +bool& CarlaEpisodeSettings::substepping() { return m_substepping; } + /*! * @brief This function sets a value in member max_substep_delta_time * @param _max_substep_delta_time New value for member max_substep_delta_time */ -void carla_msgs::msg::CarlaEpisodeSettings::max_substep_delta_time( +void CarlaEpisodeSettings::max_substep_delta_time( double _max_substep_delta_time) { m_max_substep_delta_time = _max_substep_delta_time; @@ -407,7 +271,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::max_substep_delta_time( * @brief This function returns the value of member max_substep_delta_time * @return Value of member max_substep_delta_time */ -double carla_msgs::msg::CarlaEpisodeSettings::max_substep_delta_time() const +double CarlaEpisodeSettings::max_substep_delta_time() const { return m_max_substep_delta_time; } @@ -416,16 +280,17 @@ double carla_msgs::msg::CarlaEpisodeSettings::max_substep_delta_time() const * @brief This function returns a reference to member max_substep_delta_time * @return Reference to member max_substep_delta_time */ -double& carla_msgs::msg::CarlaEpisodeSettings::max_substep_delta_time() +double& CarlaEpisodeSettings::max_substep_delta_time() { return m_max_substep_delta_time; } + /*! * @brief This function sets a value in member max_substeps * @param _max_substeps New value for member max_substeps */ -void carla_msgs::msg::CarlaEpisodeSettings::max_substeps( +void CarlaEpisodeSettings::max_substeps( int32_t _max_substeps) { m_max_substeps = _max_substeps; @@ -435,7 +300,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::max_substeps( * @brief This function returns the value of member max_substeps * @return Value of member max_substeps */ -int32_t carla_msgs::msg::CarlaEpisodeSettings::max_substeps() const +int32_t CarlaEpisodeSettings::max_substeps() const { return m_max_substeps; } @@ -444,16 +309,17 @@ int32_t carla_msgs::msg::CarlaEpisodeSettings::max_substeps() const * @brief This function returns a reference to member max_substeps * @return Reference to member max_substeps */ -int32_t& carla_msgs::msg::CarlaEpisodeSettings::max_substeps() +int32_t& CarlaEpisodeSettings::max_substeps() { return m_max_substeps; } + /*! * @brief This function sets a value in member max_culling_distance * @param _max_culling_distance New value for member max_culling_distance */ -void carla_msgs::msg::CarlaEpisodeSettings::max_culling_distance( +void CarlaEpisodeSettings::max_culling_distance( float _max_culling_distance) { m_max_culling_distance = _max_culling_distance; @@ -463,7 +329,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::max_culling_distance( * @brief This function returns the value of member max_culling_distance * @return Value of member max_culling_distance */ -float carla_msgs::msg::CarlaEpisodeSettings::max_culling_distance() const +float CarlaEpisodeSettings::max_culling_distance() const { return m_max_culling_distance; } @@ -472,16 +338,17 @@ float carla_msgs::msg::CarlaEpisodeSettings::max_culling_distance() const * @brief This function returns a reference to member max_culling_distance * @return Reference to member max_culling_distance */ -float& carla_msgs::msg::CarlaEpisodeSettings::max_culling_distance() +float& CarlaEpisodeSettings::max_culling_distance() { return m_max_culling_distance; } + /*! * @brief This function sets a value in member deterministic_ragdolls * @param _deterministic_ragdolls New value for member deterministic_ragdolls */ -void carla_msgs::msg::CarlaEpisodeSettings::deterministic_ragdolls( +void CarlaEpisodeSettings::deterministic_ragdolls( bool _deterministic_ragdolls) { m_deterministic_ragdolls = _deterministic_ragdolls; @@ -491,7 +358,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::deterministic_ragdolls( * @brief This function returns the value of member deterministic_ragdolls * @return Value of member deterministic_ragdolls */ -bool carla_msgs::msg::CarlaEpisodeSettings::deterministic_ragdolls() const +bool CarlaEpisodeSettings::deterministic_ragdolls() const { return m_deterministic_ragdolls; } @@ -500,16 +367,17 @@ bool carla_msgs::msg::CarlaEpisodeSettings::deterministic_ragdolls() const * @brief This function returns a reference to member deterministic_ragdolls * @return Reference to member deterministic_ragdolls */ -bool& carla_msgs::msg::CarlaEpisodeSettings::deterministic_ragdolls() +bool& CarlaEpisodeSettings::deterministic_ragdolls() { return m_deterministic_ragdolls; } + /*! * @brief This function sets a value in member tile_stream_distance * @param _tile_stream_distance New value for member tile_stream_distance */ -void carla_msgs::msg::CarlaEpisodeSettings::tile_stream_distance( +void CarlaEpisodeSettings::tile_stream_distance( float _tile_stream_distance) { m_tile_stream_distance = _tile_stream_distance; @@ -519,7 +387,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::tile_stream_distance( * @brief This function returns the value of member tile_stream_distance * @return Value of member tile_stream_distance */ -float carla_msgs::msg::CarlaEpisodeSettings::tile_stream_distance() const +float CarlaEpisodeSettings::tile_stream_distance() const { return m_tile_stream_distance; } @@ -528,16 +396,17 @@ float carla_msgs::msg::CarlaEpisodeSettings::tile_stream_distance() const * @brief This function returns a reference to member tile_stream_distance * @return Reference to member tile_stream_distance */ -float& carla_msgs::msg::CarlaEpisodeSettings::tile_stream_distance() +float& CarlaEpisodeSettings::tile_stream_distance() { return m_tile_stream_distance; } + /*! * @brief This function sets a value in member actor_active_distance * @param _actor_active_distance New value for member actor_active_distance */ -void carla_msgs::msg::CarlaEpisodeSettings::actor_active_distance( +void CarlaEpisodeSettings::actor_active_distance( float _actor_active_distance) { m_actor_active_distance = _actor_active_distance; @@ -547,7 +416,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::actor_active_distance( * @brief This function returns the value of member actor_active_distance * @return Value of member actor_active_distance */ -float carla_msgs::msg::CarlaEpisodeSettings::actor_active_distance() const +float CarlaEpisodeSettings::actor_active_distance() const { return m_actor_active_distance; } @@ -556,16 +425,17 @@ float carla_msgs::msg::CarlaEpisodeSettings::actor_active_distance() const * @brief This function returns a reference to member actor_active_distance * @return Reference to member actor_active_distance */ -float& carla_msgs::msg::CarlaEpisodeSettings::actor_active_distance() +float& CarlaEpisodeSettings::actor_active_distance() { return m_actor_active_distance; } + /*! * @brief This function sets a value in member spectator_as_ego * @param _spectator_as_ego New value for member spectator_as_ego */ -void carla_msgs::msg::CarlaEpisodeSettings::spectator_as_ego( +void CarlaEpisodeSettings::spectator_as_ego( bool _spectator_as_ego) { m_spectator_as_ego = _spectator_as_ego; @@ -575,7 +445,7 @@ void carla_msgs::msg::CarlaEpisodeSettings::spectator_as_ego( * @brief This function returns the value of member spectator_as_ego * @return Value of member spectator_as_ego */ -bool carla_msgs::msg::CarlaEpisodeSettings::spectator_as_ego() const +bool CarlaEpisodeSettings::spectator_as_ego() const { return m_spectator_as_ego; } @@ -584,32 +454,18 @@ bool carla_msgs::msg::CarlaEpisodeSettings::spectator_as_ego() const * @brief This function returns a reference to member spectator_as_ego * @return Reference to member spectator_as_ego */ -bool& carla_msgs::msg::CarlaEpisodeSettings::spectator_as_ego() +bool& CarlaEpisodeSettings::spectator_as_ego() { return m_spectator_as_ego; } -size_t carla_msgs::msg::CarlaEpisodeSettings::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool carla_msgs::msg::CarlaEpisodeSettings::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaEpisodeSettings::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaEpisodeSettingsCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.h index 5721de80b70..b33077b5b7b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettings.h @@ -16,19 +16,24 @@ * @file CarlaEpisodeSettings.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,369 +47,333 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaEpisodeSettings_SOURCE) -#define CarlaEpisodeSettings_DllAPI __declspec( dllexport ) +#if defined(CARLAEPISODESETTINGS_SOURCE) +#define CARLAEPISODESETTINGS_DllAPI __declspec( dllexport ) #else -#define CarlaEpisodeSettings_DllAPI __declspec( dllimport ) -#endif // CarlaEpisodeSettings_SOURCE +#define CARLAEPISODESETTINGS_DllAPI __declspec( dllimport ) +#endif // CARLAEPISODESETTINGS_SOURCE #else -#define CarlaEpisodeSettings_DllAPI +#define CARLAEPISODESETTINGS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaEpisodeSettings_DllAPI +#define CARLAEPISODESETTINGS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaEpisodeSettings defined by the user in the IDL file. - * @ingroup CARLAEPISODESETTINGS - */ - class CarlaEpisodeSettings - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaEpisodeSettings(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaEpisodeSettings(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. - */ - eProsima_user_DllExport CarlaEpisodeSettings( - const CarlaEpisodeSettings& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. - */ - eProsima_user_DllExport CarlaEpisodeSettings( - CarlaEpisodeSettings&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. - */ - eProsima_user_DllExport CarlaEpisodeSettings& operator =( - const CarlaEpisodeSettings& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. - */ - eProsima_user_DllExport CarlaEpisodeSettings& operator =( - CarlaEpisodeSettings&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEpisodeSettings object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaEpisodeSettings& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaEpisodeSettings object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaEpisodeSettings& x) const; - - /*! - * @brief This function sets a value in member synchronous_mode - * @param _synchronous_mode New value for member synchronous_mode - */ - eProsima_user_DllExport void synchronous_mode( - bool _synchronous_mode); - - /*! - * @brief This function returns the value of member synchronous_mode - * @return Value of member synchronous_mode - */ - eProsima_user_DllExport bool synchronous_mode() const; - - /*! - * @brief This function returns a reference to member synchronous_mode - * @return Reference to member synchronous_mode - */ - eProsima_user_DllExport bool& synchronous_mode(); - - /*! - * @brief This function sets a value in member no_rendering_mode - * @param _no_rendering_mode New value for member no_rendering_mode - */ - eProsima_user_DllExport void no_rendering_mode( - bool _no_rendering_mode); - - /*! - * @brief This function returns the value of member no_rendering_mode - * @return Value of member no_rendering_mode - */ - eProsima_user_DllExport bool no_rendering_mode() const; - - /*! - * @brief This function returns a reference to member no_rendering_mode - * @return Reference to member no_rendering_mode - */ - eProsima_user_DllExport bool& no_rendering_mode(); - - /*! - * @brief This function sets a value in member fixed_delta_seconds - * @param _fixed_delta_seconds New value for member fixed_delta_seconds - */ - eProsima_user_DllExport void fixed_delta_seconds( - double _fixed_delta_seconds); - - /*! - * @brief This function returns the value of member fixed_delta_seconds - * @return Value of member fixed_delta_seconds - */ - eProsima_user_DllExport double fixed_delta_seconds() const; - - /*! - * @brief This function returns a reference to member fixed_delta_seconds - * @return Reference to member fixed_delta_seconds - */ - eProsima_user_DllExport double& fixed_delta_seconds(); - - /*! - * @brief This function sets a value in member substepping - * @param _substepping New value for member substepping - */ - eProsima_user_DllExport void substepping( - bool _substepping); - - /*! - * @brief This function returns the value of member substepping - * @return Value of member substepping - */ - eProsima_user_DllExport bool substepping() const; - - /*! - * @brief This function returns a reference to member substepping - * @return Reference to member substepping - */ - eProsima_user_DllExport bool& substepping(); - - /*! - * @brief This function sets a value in member max_substep_delta_time - * @param _max_substep_delta_time New value for member max_substep_delta_time - */ - eProsima_user_DllExport void max_substep_delta_time( - double _max_substep_delta_time); - - /*! - * @brief This function returns the value of member max_substep_delta_time - * @return Value of member max_substep_delta_time - */ - eProsima_user_DllExport double max_substep_delta_time() const; - - /*! - * @brief This function returns a reference to member max_substep_delta_time - * @return Reference to member max_substep_delta_time - */ - eProsima_user_DllExport double& max_substep_delta_time(); - - /*! - * @brief This function sets a value in member max_substeps - * @param _max_substeps New value for member max_substeps - */ - eProsima_user_DllExport void max_substeps( - int32_t _max_substeps); - - /*! - * @brief This function returns the value of member max_substeps - * @return Value of member max_substeps - */ - eProsima_user_DllExport int32_t max_substeps() const; - - /*! - * @brief This function returns a reference to member max_substeps - * @return Reference to member max_substeps - */ - eProsima_user_DllExport int32_t& max_substeps(); - - /*! - * @brief This function sets a value in member max_culling_distance - * @param _max_culling_distance New value for member max_culling_distance - */ - eProsima_user_DllExport void max_culling_distance( - float _max_culling_distance); - - /*! - * @brief This function returns the value of member max_culling_distance - * @return Value of member max_culling_distance - */ - eProsima_user_DllExport float max_culling_distance() const; - - /*! - * @brief This function returns a reference to member max_culling_distance - * @return Reference to member max_culling_distance - */ - eProsima_user_DllExport float& max_culling_distance(); - - /*! - * @brief This function sets a value in member deterministic_ragdolls - * @param _deterministic_ragdolls New value for member deterministic_ragdolls - */ - eProsima_user_DllExport void deterministic_ragdolls( - bool _deterministic_ragdolls); - - /*! - * @brief This function returns the value of member deterministic_ragdolls - * @return Value of member deterministic_ragdolls - */ - eProsima_user_DllExport bool deterministic_ragdolls() const; - - /*! - * @brief This function returns a reference to member deterministic_ragdolls - * @return Reference to member deterministic_ragdolls - */ - eProsima_user_DllExport bool& deterministic_ragdolls(); - - /*! - * @brief This function sets a value in member tile_stream_distance - * @param _tile_stream_distance New value for member tile_stream_distance - */ - eProsima_user_DllExport void tile_stream_distance( - float _tile_stream_distance); - - /*! - * @brief This function returns the value of member tile_stream_distance - * @return Value of member tile_stream_distance - */ - eProsima_user_DllExport float tile_stream_distance() const; - - /*! - * @brief This function returns a reference to member tile_stream_distance - * @return Reference to member tile_stream_distance - */ - eProsima_user_DllExport float& tile_stream_distance(); - - /*! - * @brief This function sets a value in member actor_active_distance - * @param _actor_active_distance New value for member actor_active_distance - */ - eProsima_user_DllExport void actor_active_distance( - float _actor_active_distance); - - /*! - * @brief This function returns the value of member actor_active_distance - * @return Value of member actor_active_distance - */ - eProsima_user_DllExport float actor_active_distance() const; - - /*! - * @brief This function returns a reference to member actor_active_distance - * @return Reference to member actor_active_distance - */ - eProsima_user_DllExport float& actor_active_distance(); - - /*! - * @brief This function sets a value in member spectator_as_ego - * @param _spectator_as_ego New value for member spectator_as_ego - */ - eProsima_user_DllExport void spectator_as_ego( - bool _spectator_as_ego); - - /*! - * @brief This function returns the value of member spectator_as_ego - * @return Value of member spectator_as_ego - */ - eProsima_user_DllExport bool spectator_as_ego() const; - - /*! - * @brief This function returns a reference to member spectator_as_ego - * @return Reference to member spectator_as_ego - */ - eProsima_user_DllExport bool& spectator_as_ego(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaEpisodeSettings& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - bool m_synchronous_mode; - bool m_no_rendering_mode; - double m_fixed_delta_seconds; - bool m_substepping; - double m_max_substep_delta_time; - int32_t m_max_substeps; - float m_max_culling_distance; - bool m_deterministic_ragdolls; - float m_tile_stream_distance; - float m_actor_active_distance; - bool m_spectator_as_ego; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaEpisodeSettings defined by the user in the IDL file. + * @ingroup CarlaEpisodeSettings + */ +class CarlaEpisodeSettings +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaEpisodeSettings(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaEpisodeSettings(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. + */ + eProsima_user_DllExport CarlaEpisodeSettings( + const CarlaEpisodeSettings& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. + */ + eProsima_user_DllExport CarlaEpisodeSettings( + CarlaEpisodeSettings&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. + */ + eProsima_user_DllExport CarlaEpisodeSettings& operator =( + const CarlaEpisodeSettings& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaEpisodeSettings that will be copied. + */ + eProsima_user_DllExport CarlaEpisodeSettings& operator =( + CarlaEpisodeSettings&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEpisodeSettings object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaEpisodeSettings& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaEpisodeSettings object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaEpisodeSettings& x) const; + + /*! + * @brief This function sets a value in member synchronous_mode + * @param _synchronous_mode New value for member synchronous_mode + */ + eProsima_user_DllExport void synchronous_mode( + bool _synchronous_mode); + + /*! + * @brief This function returns the value of member synchronous_mode + * @return Value of member synchronous_mode + */ + eProsima_user_DllExport bool synchronous_mode() const; + + /*! + * @brief This function returns a reference to member synchronous_mode + * @return Reference to member synchronous_mode + */ + eProsima_user_DllExport bool& synchronous_mode(); + + + /*! + * @brief This function sets a value in member no_rendering_mode + * @param _no_rendering_mode New value for member no_rendering_mode + */ + eProsima_user_DllExport void no_rendering_mode( + bool _no_rendering_mode); + + /*! + * @brief This function returns the value of member no_rendering_mode + * @return Value of member no_rendering_mode + */ + eProsima_user_DllExport bool no_rendering_mode() const; + + /*! + * @brief This function returns a reference to member no_rendering_mode + * @return Reference to member no_rendering_mode + */ + eProsima_user_DllExport bool& no_rendering_mode(); + + + /*! + * @brief This function sets a value in member fixed_delta_seconds + * @param _fixed_delta_seconds New value for member fixed_delta_seconds + */ + eProsima_user_DllExport void fixed_delta_seconds( + double _fixed_delta_seconds); + + /*! + * @brief This function returns the value of member fixed_delta_seconds + * @return Value of member fixed_delta_seconds + */ + eProsima_user_DllExport double fixed_delta_seconds() const; + + /*! + * @brief This function returns a reference to member fixed_delta_seconds + * @return Reference to member fixed_delta_seconds + */ + eProsima_user_DllExport double& fixed_delta_seconds(); + + + /*! + * @brief This function sets a value in member substepping + * @param _substepping New value for member substepping + */ + eProsima_user_DllExport void substepping( + bool _substepping); + + /*! + * @brief This function returns the value of member substepping + * @return Value of member substepping + */ + eProsima_user_DllExport bool substepping() const; + + /*! + * @brief This function returns a reference to member substepping + * @return Reference to member substepping + */ + eProsima_user_DllExport bool& substepping(); + + + /*! + * @brief This function sets a value in member max_substep_delta_time + * @param _max_substep_delta_time New value for member max_substep_delta_time + */ + eProsima_user_DllExport void max_substep_delta_time( + double _max_substep_delta_time); + + /*! + * @brief This function returns the value of member max_substep_delta_time + * @return Value of member max_substep_delta_time + */ + eProsima_user_DllExport double max_substep_delta_time() const; + + /*! + * @brief This function returns a reference to member max_substep_delta_time + * @return Reference to member max_substep_delta_time + */ + eProsima_user_DllExport double& max_substep_delta_time(); + + + /*! + * @brief This function sets a value in member max_substeps + * @param _max_substeps New value for member max_substeps + */ + eProsima_user_DllExport void max_substeps( + int32_t _max_substeps); + + /*! + * @brief This function returns the value of member max_substeps + * @return Value of member max_substeps + */ + eProsima_user_DllExport int32_t max_substeps() const; + + /*! + * @brief This function returns a reference to member max_substeps + * @return Reference to member max_substeps + */ + eProsima_user_DllExport int32_t& max_substeps(); + + + /*! + * @brief This function sets a value in member max_culling_distance + * @param _max_culling_distance New value for member max_culling_distance + */ + eProsima_user_DllExport void max_culling_distance( + float _max_culling_distance); + + /*! + * @brief This function returns the value of member max_culling_distance + * @return Value of member max_culling_distance + */ + eProsima_user_DllExport float max_culling_distance() const; + + /*! + * @brief This function returns a reference to member max_culling_distance + * @return Reference to member max_culling_distance + */ + eProsima_user_DllExport float& max_culling_distance(); + + + /*! + * @brief This function sets a value in member deterministic_ragdolls + * @param _deterministic_ragdolls New value for member deterministic_ragdolls + */ + eProsima_user_DllExport void deterministic_ragdolls( + bool _deterministic_ragdolls); + + /*! + * @brief This function returns the value of member deterministic_ragdolls + * @return Value of member deterministic_ragdolls + */ + eProsima_user_DllExport bool deterministic_ragdolls() const; + + /*! + * @brief This function returns a reference to member deterministic_ragdolls + * @return Reference to member deterministic_ragdolls + */ + eProsima_user_DllExport bool& deterministic_ragdolls(); + + + /*! + * @brief This function sets a value in member tile_stream_distance + * @param _tile_stream_distance New value for member tile_stream_distance + */ + eProsima_user_DllExport void tile_stream_distance( + float _tile_stream_distance); + + /*! + * @brief This function returns the value of member tile_stream_distance + * @return Value of member tile_stream_distance + */ + eProsima_user_DllExport float tile_stream_distance() const; + + /*! + * @brief This function returns a reference to member tile_stream_distance + * @return Reference to member tile_stream_distance + */ + eProsima_user_DllExport float& tile_stream_distance(); + + + /*! + * @brief This function sets a value in member actor_active_distance + * @param _actor_active_distance New value for member actor_active_distance + */ + eProsima_user_DllExport void actor_active_distance( + float _actor_active_distance); + + /*! + * @brief This function returns the value of member actor_active_distance + * @return Value of member actor_active_distance + */ + eProsima_user_DllExport float actor_active_distance() const; + + /*! + * @brief This function returns a reference to member actor_active_distance + * @return Reference to member actor_active_distance + */ + eProsima_user_DllExport float& actor_active_distance(); + + + /*! + * @brief This function sets a value in member spectator_as_ego + * @param _spectator_as_ego New value for member spectator_as_ego + */ + eProsima_user_DllExport void spectator_as_ego( + bool _spectator_as_ego); + + /*! + * @brief This function returns the value of member spectator_as_ego + * @return Value of member spectator_as_ego + */ + eProsima_user_DllExport bool spectator_as_ego() const; + + /*! + * @brief This function returns a reference to member spectator_as_ego + * @return Reference to member spectator_as_ego + */ + eProsima_user_DllExport bool& spectator_as_ego(); + +private: + + bool m_synchronous_mode{false}; + bool m_no_rendering_mode{false}; + double m_fixed_delta_seconds{0.0}; + bool m_substepping{true}; + double m_max_substep_delta_time{0.01}; + int32_t m_max_substeps{10}; + float m_max_culling_distance{0.0}; + bool m_deterministic_ragdolls{false}; + float m_tile_stream_distance{3000.0}; + float m_actor_active_distance{2000.0}; + bool m_spectator_as_ego{true}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsCdrAux.hpp new file mode 100644 index 00000000000..5c72a469e79 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEpisodeSettingsCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGSCDRAUX_HPP_ + +#include "CarlaEpisodeSettings.h" + +constexpr uint32_t carla_msgs_msg_CarlaEpisodeSettings_max_cdr_typesize {53UL}; +constexpr uint32_t carla_msgs_msg_CarlaEpisodeSettings_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEpisodeSettings& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsCdrAux.ipp new file mode 100644 index 00000000000..2fcacf85556 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsCdrAux.ipp @@ -0,0 +1,210 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaEpisodeSettingsCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGSCDRAUX_IPP_ + +#include "CarlaEpisodeSettingsCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaEpisodeSettings& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.synchronous_mode(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.no_rendering_mode(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.fixed_delta_seconds(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.substepping(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.max_substep_delta_time(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.max_substeps(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.max_culling_distance(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.deterministic_ragdolls(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.tile_stream_distance(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.actor_active_distance(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.spectator_as_ego(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEpisodeSettings& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.synchronous_mode() + << eprosima::fastcdr::MemberId(1) << data.no_rendering_mode() + << eprosima::fastcdr::MemberId(2) << data.fixed_delta_seconds() + << eprosima::fastcdr::MemberId(3) << data.substepping() + << eprosima::fastcdr::MemberId(4) << data.max_substep_delta_time() + << eprosima::fastcdr::MemberId(5) << data.max_substeps() + << eprosima::fastcdr::MemberId(6) << data.max_culling_distance() + << eprosima::fastcdr::MemberId(7) << data.deterministic_ragdolls() + << eprosima::fastcdr::MemberId(8) << data.tile_stream_distance() + << eprosima::fastcdr::MemberId(9) << data.actor_active_distance() + << eprosima::fastcdr::MemberId(10) << data.spectator_as_ego() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaEpisodeSettings& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.synchronous_mode(); + break; + + case 1: + dcdr >> data.no_rendering_mode(); + break; + + case 2: + dcdr >> data.fixed_delta_seconds(); + break; + + case 3: + dcdr >> data.substepping(); + break; + + case 4: + dcdr >> data.max_substep_delta_time(); + break; + + case 5: + dcdr >> data.max_substeps(); + break; + + case 6: + dcdr >> data.max_culling_distance(); + break; + + case 7: + dcdr >> data.deterministic_ragdolls(); + break; + + case 8: + dcdr >> data.tile_stream_distance(); + break; + + case 9: + dcdr >> data.actor_active_distance(); + break; + + case 10: + dcdr >> data.spectator_as_ego(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaEpisodeSettings& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.cxx index 6ce6b26d917..0246c355c2a 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaEpisodeSettingsPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaEpisodeSettingsPubSubTypes.h" +#include "CarlaEpisodeSettingsCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaEpisodeSettingsPubSubType::CarlaEpisodeSettingsPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaEpisodeSettings_"); - auto type_size = CarlaEpisodeSettings::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaEpisodeSettings::isKeyDefined(); - size_t keyLength = CarlaEpisodeSettings::getKeyMaxCdrSerializedSize() > 16 ? - CarlaEpisodeSettings::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaEpisodeSettingsPubSubType::~CarlaEpisodeSettingsPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaEpisodeSettingsPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaEpisodeSettings* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaEpisodeSettingsPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaEpisodeSettings* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaEpisodeSettingsPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaEpisodeSettingsPubSubType::createData() - { - return reinterpret_cast(new CarlaEpisodeSettings()); - } - - void CarlaEpisodeSettingsPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaEpisodeSettingsPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaEpisodeSettings* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaEpisodeSettings::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaEpisodeSettings::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaEpisodeSettingsPubSubType::CarlaEpisodeSettingsPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaEpisodeSettings_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaEpisodeSettings::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaEpisodeSettings_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaEpisodeSettingsPubSubType::~CarlaEpisodeSettingsPubSubType() +{ +} + +bool CarlaEpisodeSettingsPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaEpisodeSettings* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaEpisodeSettingsPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaEpisodeSettings* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaEpisodeSettingsPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaEpisodeSettingsPubSubType::createData() +{ + return reinterpret_cast(new CarlaEpisodeSettings()); +} + +void CarlaEpisodeSettingsPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaEpisodeSettingsPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h index 48925fde9b8..e5519120fd4 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h @@ -16,92 +16,120 @@ * @file CarlaEpisodeSettingsPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaEpisodeSettings.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaEpisodeSettings is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaEpisodeSettings defined by the user in the IDL file. + * @ingroup CarlaEpisodeSettings + */ +class CarlaEpisodeSettingsPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaEpisodeSettings defined by the user in the IDL file. - * @ingroup CARLAEPISODESETTINGS - */ - class CarlaEpisodeSettingsPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaEpisodeSettings type; + typedef CarlaEpisodeSettings type; - eProsima_user_DllExport CarlaEpisodeSettingsPubSubType(); + eProsima_user_DllExport CarlaEpisodeSettingsPubSubType(); - eProsima_user_DllExport virtual ~CarlaEpisodeSettingsPubSubType(); + eProsima_user_DllExport ~CarlaEpisodeSettingsPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaEpisodeSettings(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAEPISODESETTINGS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.cxx deleted file mode 100644 index 64292e68d9a..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.cxx +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CarlaLaneInvasion.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "CarlaLaneInvasion.h" -#include - -#include -using namespace eprosima::fastcdr::exception; - -#include - -#define carla_msgs_msg_std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define carla_msgs_msg_LaneInvasionEvent_max_cdr_typesize 672ULL; -#define carla_msgs_msg_std_msgs_msg_Time_max_cdr_typesize 8ULL; -#define carla_msgs_msg_std_msgs_msg_Header_max_key_cdr_typesize 0ULL; -#define carla_msgs_msg_LaneInvasionEvent_max_key_cdr_typesize 0ULL; -#define carla_msgs_msg_std_msgs_msg_Time_max_key_cdr_typesize 0ULL; - -carla_msgs::msg::LaneInvasionEvent::LaneInvasionEvent() -{ -} - -carla_msgs::msg::LaneInvasionEvent::~LaneInvasionEvent() -{ -} - -carla_msgs::msg::LaneInvasionEvent::LaneInvasionEvent( - const LaneInvasionEvent& x) -{ - m_header = x.m_header; - m_crossed_lane_markings = x.m_crossed_lane_markings; -} - -carla_msgs::msg::LaneInvasionEvent::LaneInvasionEvent( - LaneInvasionEvent&& x) noexcept -{ - m_header = std::move(x.m_header); - m_crossed_lane_markings = std::move(x.m_crossed_lane_markings); -} - -carla_msgs::msg::LaneInvasionEvent& carla_msgs::msg::LaneInvasionEvent::operator =( - const LaneInvasionEvent& x) -{ - m_header = x.m_header; - m_crossed_lane_markings = x.m_crossed_lane_markings; - - return *this; -} - -carla_msgs::msg::LaneInvasionEvent& carla_msgs::msg::LaneInvasionEvent::operator =( - LaneInvasionEvent&& x) noexcept -{ - m_header = std::move(x.m_header); - m_crossed_lane_markings = std::move(x.m_crossed_lane_markings); - - return *this; -} - -bool carla_msgs::msg::LaneInvasionEvent::operator ==( - const LaneInvasionEvent& x) const -{ - return (m_header == x.m_header && m_crossed_lane_markings == x.m_crossed_lane_markings); -} - -bool carla_msgs::msg::LaneInvasionEvent::operator !=( - const LaneInvasionEvent& x) const -{ - return !(*this == x); -} - -size_t carla_msgs::msg::LaneInvasionEvent::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return carla_msgs_msg_LaneInvasionEvent_max_cdr_typesize; -} - -size_t carla_msgs::msg::LaneInvasionEvent::getCdrSerializedSize( - const carla_msgs::msg::LaneInvasionEvent& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.crossed_lane_markings().size() > 0) - { - current_alignment += (data.crossed_lane_markings().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::LaneInvasionEvent::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - scdr << m_crossed_lane_markings; -} - -void carla_msgs::msg::LaneInvasionEvent::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - dcdr >> m_crossed_lane_markings; -} - -/*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ -void carla_msgs::msg::LaneInvasionEvent::header( - const std_msgs::msg::Header& _header) -{ - m_header = _header; -} - -/*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ -void carla_msgs::msg::LaneInvasionEvent::header( - std_msgs::msg::Header&& _header) -{ - m_header = std::move(_header); -} - -/*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ -const std_msgs::msg::Header& carla_msgs::msg::LaneInvasionEvent::header() const -{ - return m_header; -} - -/*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ -std_msgs::msg::Header& carla_msgs::msg::LaneInvasionEvent::header() -{ - return m_header; -} -/*! - * @brief This function copies the value in member crossed_lane_markings - * @param _crossed_lane_markings New value to be copied in member crossed_lane_markings - */ -void carla_msgs::msg::LaneInvasionEvent::crossed_lane_markings( - const std::vector& _crossed_lane_markings) -{ - m_crossed_lane_markings = _crossed_lane_markings; -} - -/*! - * @brief This function moves the value in member crossed_lane_markings - * @param _crossed_lane_markings New value to be moved in member crossed_lane_markings - */ -void carla_msgs::msg::LaneInvasionEvent::crossed_lane_markings( - std::vector&& _crossed_lane_markings) -{ - m_crossed_lane_markings = std::move(_crossed_lane_markings); -} - -/*! - * @brief This function returns a constant reference to member crossed_lane_markings - * @return Constant reference to member crossed_lane_markings - */ -const std::vector& carla_msgs::msg::LaneInvasionEvent::crossed_lane_markings() const -{ - return m_crossed_lane_markings; -} - -/*! - * @brief This function returns a reference to member crossed_lane_markings - * @return Reference to member crossed_lane_markings - */ -std::vector& carla_msgs::msg::LaneInvasionEvent::crossed_lane_markings() -{ - return m_crossed_lane_markings; -} - - -size_t carla_msgs::msg::LaneInvasionEvent::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return carla_msgs_msg_LaneInvasionEvent_max_key_cdr_typesize; -} - -bool carla_msgs::msg::LaneInvasionEvent::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::LaneInvasionEvent::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.h deleted file mode 100644 index 236cf4fc08e..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasion.h +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CarlaLaneInvasion.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_H_ -#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_H_ - -#include "std_msgs/msg/Header.h" - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaLaneInvasion_SOURCE) -#define CarlaLaneInvasion_DllAPI __declspec(dllexport) -#else -#define CarlaLaneInvasion_DllAPI __declspec(dllimport) -#endif // CarlaLaneInvasion_SOURCE -#else -#define CarlaLaneInvasion_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CarlaLaneInvasion_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace carla_msgs { -namespace msg { -const int32_t LANE_MARKING_OTHER = 0; -const int32_t LANE_MARKING_BROKEN = 1; -const int32_t LANE_MARKING_SOLID = 2; -/*! - * @brief This class represents the structure LaneInvasionEvent defined by the user in the IDL file. - * @ingroup CarlaLaneInvasion - */ -class LaneInvasionEvent { -public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LaneInvasionEvent(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LaneInvasionEvent(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. - */ - eProsima_user_DllExport LaneInvasionEvent(const LaneInvasionEvent& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. - */ - eProsima_user_DllExport LaneInvasionEvent(LaneInvasionEvent&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. - */ - eProsima_user_DllExport LaneInvasionEvent& operator=(const LaneInvasionEvent& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::LaneInvasionEvent that will be copied. - */ - eProsima_user_DllExport LaneInvasionEvent& operator=(LaneInvasionEvent&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::LaneInvasionEvent object to compare. - */ - eProsima_user_DllExport bool operator==(const LaneInvasionEvent& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::LaneInvasionEvent object to compare. - */ - eProsima_user_DllExport bool operator!=(const LaneInvasionEvent& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member crossed_lane_markings - * @param _crossed_lane_markings New value to be copied in member crossed_lane_markings - */ - eProsima_user_DllExport void crossed_lane_markings(const std::vector& _crossed_lane_markings); - - /*! - * @brief This function moves the value in member crossed_lane_markings - * @param _crossed_lane_markings New value to be moved in member crossed_lane_markings - */ - eProsima_user_DllExport void crossed_lane_markings(std::vector&& _crossed_lane_markings); - - /*! - * @brief This function returns a constant reference to member crossed_lane_markings - * @return Constant reference to member crossed_lane_markings - */ - eProsima_user_DllExport const std::vector& crossed_lane_markings() const; - - /*! - * @brief This function returns a reference to member crossed_lane_markings - * @return Reference to member crossed_lane_markings - */ - eProsima_user_DllExport std::vector& crossed_lane_markings(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const carla_msgs::msg::LaneInvasionEvent& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; - -private: - std_msgs::msg::Header m_header; - std::vector m_crossed_lane_markings; -}; -} // namespace msg -} // namespace carla_msgs - -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.cxx index 9fb493e166b..9565afb3317 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaLaneInvasionEvent.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,139 +27,86 @@ char dummy; #endif // _WIN32 #include "CarlaLaneInvasionEvent.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace carla_msgs { +namespace msg { +namespace CarlaLaneInvasionEvent_Constants { -carla_msgs::msg::CarlaLaneInvasionEvent::CarlaLaneInvasionEvent() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5e3f861 - // m_crossed_lane_markings com.eprosima.idl.parser.typecode.SequenceTypeCode@2fb0623e +} // namespace CarlaLaneInvasionEvent_Constants + -} -carla_msgs::msg::CarlaLaneInvasionEvent::~CarlaLaneInvasionEvent() +CarlaLaneInvasionEvent::CarlaLaneInvasionEvent() { +} +CarlaLaneInvasionEvent::~CarlaLaneInvasionEvent() +{ } -carla_msgs::msg::CarlaLaneInvasionEvent::CarlaLaneInvasionEvent( +CarlaLaneInvasionEvent::CarlaLaneInvasionEvent( const CarlaLaneInvasionEvent& x) { m_header = x.m_header; m_crossed_lane_markings = x.m_crossed_lane_markings; } -carla_msgs::msg::CarlaLaneInvasionEvent::CarlaLaneInvasionEvent( - CarlaLaneInvasionEvent&& x) +CarlaLaneInvasionEvent::CarlaLaneInvasionEvent( + CarlaLaneInvasionEvent&& x) noexcept { m_header = std::move(x.m_header); m_crossed_lane_markings = std::move(x.m_crossed_lane_markings); } -carla_msgs::msg::CarlaLaneInvasionEvent& carla_msgs::msg::CarlaLaneInvasionEvent::operator =( +CarlaLaneInvasionEvent& CarlaLaneInvasionEvent::operator =( const CarlaLaneInvasionEvent& x) { m_header = x.m_header; m_crossed_lane_markings = x.m_crossed_lane_markings; - return *this; } -carla_msgs::msg::CarlaLaneInvasionEvent& carla_msgs::msg::CarlaLaneInvasionEvent::operator =( - CarlaLaneInvasionEvent&& x) +CarlaLaneInvasionEvent& CarlaLaneInvasionEvent::operator =( + CarlaLaneInvasionEvent&& x) noexcept { m_header = std::move(x.m_header); m_crossed_lane_markings = std::move(x.m_crossed_lane_markings); - return *this; } -bool carla_msgs::msg::CarlaLaneInvasionEvent::operator ==( +bool CarlaLaneInvasionEvent::operator ==( const CarlaLaneInvasionEvent& x) const { - - return (m_header == x.m_header && m_crossed_lane_markings == x.m_crossed_lane_markings); + return (m_header == x.m_header && + m_crossed_lane_markings == x.m_crossed_lane_markings); } -bool carla_msgs::msg::CarlaLaneInvasionEvent::operator !=( +bool CarlaLaneInvasionEvent::operator !=( const CarlaLaneInvasionEvent& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaLaneInvasionEvent::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaLaneInvasionEvent::getCdrSerializedSize( - const carla_msgs::msg::CarlaLaneInvasionEvent& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.crossed_lane_markings().size() > 0) - { - current_alignment += (data.crossed_lane_markings().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaLaneInvasionEvent::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_crossed_lane_markings; - -} - -void carla_msgs::msg::CarlaLaneInvasionEvent::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_crossed_lane_markings; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaLaneInvasionEvent::header( +void CarlaLaneInvasionEvent::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -169,7 +116,7 @@ void carla_msgs::msg::CarlaLaneInvasionEvent::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaLaneInvasionEvent::header( +void CarlaLaneInvasionEvent::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -179,7 +126,7 @@ void carla_msgs::msg::CarlaLaneInvasionEvent::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& carla_msgs::msg::CarlaLaneInvasionEvent::header() const +const std_msgs::msg::Header& CarlaLaneInvasionEvent::header() const { return m_header; } @@ -188,15 +135,17 @@ const std_msgs::msg::Header& carla_msgs::msg::CarlaLaneInvasionEvent::header() c * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& carla_msgs::msg::CarlaLaneInvasionEvent::header() +std_msgs::msg::Header& CarlaLaneInvasionEvent::header() { return m_header; } + + /*! * @brief This function copies the value in member crossed_lane_markings * @param _crossed_lane_markings New value to be copied in member crossed_lane_markings */ -void carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings( +void CarlaLaneInvasionEvent::crossed_lane_markings( const std::vector& _crossed_lane_markings) { m_crossed_lane_markings = _crossed_lane_markings; @@ -206,7 +155,7 @@ void carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings( * @brief This function moves the value in member crossed_lane_markings * @param _crossed_lane_markings New value to be moved in member crossed_lane_markings */ -void carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings( +void CarlaLaneInvasionEvent::crossed_lane_markings( std::vector&& _crossed_lane_markings) { m_crossed_lane_markings = std::move(_crossed_lane_markings); @@ -216,7 +165,7 @@ void carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings( * @brief This function returns a constant reference to member crossed_lane_markings * @return Constant reference to member crossed_lane_markings */ -const std::vector& carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings() const +const std::vector& CarlaLaneInvasionEvent::crossed_lane_markings() const { return m_crossed_lane_markings; } @@ -225,31 +174,18 @@ const std::vector& carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lan * @brief This function returns a reference to member crossed_lane_markings * @return Reference to member crossed_lane_markings */ -std::vector& carla_msgs::msg::CarlaLaneInvasionEvent::crossed_lane_markings() +std::vector& CarlaLaneInvasionEvent::crossed_lane_markings() { return m_crossed_lane_markings; } -size_t carla_msgs::msg::CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaLaneInvasionEvent::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaLaneInvasionEvent::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaLaneInvasionEventCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.h index c91607f1d4e..a47a5c902a9 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEvent.h @@ -16,20 +16,25 @@ * @file CarlaLaneInvasionEvent.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_H_ -#include "std_msgs/msg/Header.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "std_msgs/msg/Header.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,206 +48,167 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaLaneInvasionEvent_SOURCE) -#define CarlaLaneInvasionEvent_DllAPI __declspec( dllexport ) +#if defined(CARLALANEINVASIONEVENT_SOURCE) +#define CARLALANEINVASIONEVENT_DllAPI __declspec( dllexport ) #else -#define CarlaLaneInvasionEvent_DllAPI __declspec( dllimport ) -#endif // CarlaLaneInvasionEvent_SOURCE +#define CARLALANEINVASIONEVENT_DllAPI __declspec( dllimport ) +#endif // CARLALANEINVASIONEVENT_SOURCE #else -#define CarlaLaneInvasionEvent_DllAPI +#define CARLALANEINVASIONEVENT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaLaneInvasionEvent_DllAPI +#define CARLALANEINVASIONEVENT_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - namespace CarlaLaneInvasionEvent_Constants { - const int32_t LANE_MARKING_OTHER = 0; - const int32_t LANE_MARKING_BROKEN = 1; - const int32_t LANE_MARKING_SOLID = 2; - } // namespace CarlaLaneInvasionEvent_Constants - /*! - * @brief This class represents the structure CarlaLaneInvasionEvent defined by the user in the IDL file. - * @ingroup CARLALANEINVASIONEVENT - */ - class CarlaLaneInvasionEvent - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaLaneInvasionEvent(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaLaneInvasionEvent(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. - */ - eProsima_user_DllExport CarlaLaneInvasionEvent( - const CarlaLaneInvasionEvent& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. - */ - eProsima_user_DllExport CarlaLaneInvasionEvent( - CarlaLaneInvasionEvent&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. - */ - eProsima_user_DllExport CarlaLaneInvasionEvent& operator =( - const CarlaLaneInvasionEvent& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. - */ - eProsima_user_DllExport CarlaLaneInvasionEvent& operator =( - CarlaLaneInvasionEvent&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaLaneInvasionEvent object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaLaneInvasionEvent& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaLaneInvasionEvent object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaLaneInvasionEvent& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member crossed_lane_markings - * @param _crossed_lane_markings New value to be copied in member crossed_lane_markings - */ - eProsima_user_DllExport void crossed_lane_markings( - const std::vector& _crossed_lane_markings); - - /*! - * @brief This function moves the value in member crossed_lane_markings - * @param _crossed_lane_markings New value to be moved in member crossed_lane_markings - */ - eProsima_user_DllExport void crossed_lane_markings( - std::vector&& _crossed_lane_markings); - - /*! - * @brief This function returns a constant reference to member crossed_lane_markings - * @return Constant reference to member crossed_lane_markings - */ - eProsima_user_DllExport const std::vector& crossed_lane_markings() const; - - /*! - * @brief This function returns a reference to member crossed_lane_markings - * @return Reference to member crossed_lane_markings - */ - eProsima_user_DllExport std::vector& crossed_lane_markings(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaLaneInvasionEvent& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - std::vector m_crossed_lane_markings; - }; - } // namespace msg + +namespace msg { + +namespace CarlaLaneInvasionEvent_Constants { + +const int32_t LANE_MARKING_OTHER = 0; +const int32_t LANE_MARKING_BROKEN = 1; +const int32_t LANE_MARKING_SOLID = 2; + +} // namespace CarlaLaneInvasionEvent_Constants + + + + +/*! + * @brief This class represents the structure CarlaLaneInvasionEvent defined by the user in the IDL file. + * @ingroup CarlaLaneInvasionEvent + */ +class CarlaLaneInvasionEvent +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaLaneInvasionEvent(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaLaneInvasionEvent(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. + */ + eProsima_user_DllExport CarlaLaneInvasionEvent( + const CarlaLaneInvasionEvent& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. + */ + eProsima_user_DllExport CarlaLaneInvasionEvent( + CarlaLaneInvasionEvent&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. + */ + eProsima_user_DllExport CarlaLaneInvasionEvent& operator =( + const CarlaLaneInvasionEvent& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaLaneInvasionEvent that will be copied. + */ + eProsima_user_DllExport CarlaLaneInvasionEvent& operator =( + CarlaLaneInvasionEvent&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaLaneInvasionEvent object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaLaneInvasionEvent& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaLaneInvasionEvent object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaLaneInvasionEvent& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member crossed_lane_markings + * @param _crossed_lane_markings New value to be copied in member crossed_lane_markings + */ + eProsima_user_DllExport void crossed_lane_markings( + const std::vector& _crossed_lane_markings); + + /*! + * @brief This function moves the value in member crossed_lane_markings + * @param _crossed_lane_markings New value to be moved in member crossed_lane_markings + */ + eProsima_user_DllExport void crossed_lane_markings( + std::vector&& _crossed_lane_markings); + + /*! + * @brief This function returns a constant reference to member crossed_lane_markings + * @return Constant reference to member crossed_lane_markings + */ + eProsima_user_DllExport const std::vector& crossed_lane_markings() const; + + /*! + * @brief This function returns a reference to member crossed_lane_markings + * @return Reference to member crossed_lane_markings + */ + eProsima_user_DllExport std::vector& crossed_lane_markings(); + +private: + + std_msgs::msg::Header m_header; + std::vector m_crossed_lane_markings; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventCdrAux.hpp new file mode 100644 index 00000000000..0bd3e03e2f0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventCdrAux.hpp @@ -0,0 +1,60 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaLaneInvasionEventCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENTCDRAUX_HPP_ + +#include "CarlaLaneInvasionEvent.h" + +constexpr uint32_t carla_msgs_msg_CarlaLaneInvasionEvent_max_cdr_typesize {684UL}; +constexpr uint32_t carla_msgs_msg_CarlaLaneInvasionEvent_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaLaneInvasionEvent& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventCdrAux.ipp new file mode 100644 index 00000000000..5e4ded2cbbd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventCdrAux.ipp @@ -0,0 +1,147 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaLaneInvasionEventCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENTCDRAUX_IPP_ + +#include "CarlaLaneInvasionEventCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaLaneInvasionEvent& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.crossed_lane_markings(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaLaneInvasionEvent& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.crossed_lane_markings() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaLaneInvasionEvent& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.crossed_lane_markings(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaLaneInvasionEvent& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.cxx index 0c2df428c3c..b64e630de11 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.cxx @@ -16,167 +16,195 @@ * @file CarlaLaneInvasionEventPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaLaneInvasionEventPubSubTypes.h" +#include "CarlaLaneInvasionEventCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - namespace CarlaLaneInvasionEvent_Constants { - - - - - } //End of namespace CarlaLaneInvasionEvent_Constants - CarlaLaneInvasionEventPubSubType::CarlaLaneInvasionEventPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaLaneInvasionEvent_"); - auto type_size = CarlaLaneInvasionEvent::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaLaneInvasionEvent::isKeyDefined(); - size_t keyLength = CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize() > 16 ? - CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaLaneInvasionEventPubSubType::~CarlaLaneInvasionEventPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaLaneInvasionEventPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaLaneInvasionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaLaneInvasionEventPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaLaneInvasionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaLaneInvasionEventPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaLaneInvasionEventPubSubType::createData() - { - return reinterpret_cast(new CarlaLaneInvasionEvent()); - } - - void CarlaLaneInvasionEventPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaLaneInvasionEventPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaLaneInvasionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaLaneInvasionEvent::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace CarlaLaneInvasionEvent_Constants { + + + + + + + +} //End of namespace CarlaLaneInvasionEvent_Constants + + + + + +CarlaLaneInvasionEventPubSubType::CarlaLaneInvasionEventPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaLaneInvasionEvent_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaLaneInvasionEvent::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaLaneInvasionEvent_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaLaneInvasionEventPubSubType::~CarlaLaneInvasionEventPubSubType() +{ +} + +bool CarlaLaneInvasionEventPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaLaneInvasionEvent* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaLaneInvasionEventPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaLaneInvasionEvent* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaLaneInvasionEventPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaLaneInvasionEventPubSubType::createData() +{ + return reinterpret_cast(new CarlaLaneInvasionEvent()); +} + +void CarlaLaneInvasionEventPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaLaneInvasionEventPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.h index 6e6bb375272..80a5d3c02b5 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionEventPubSubTypes.h @@ -16,98 +16,131 @@ * @file CarlaLaneInvasionEventPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaLaneInvasionEvent.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaLaneInvasionEvent is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs -{ - namespace msg - { - namespace CarlaLaneInvasionEvent_Constants - { +namespace carla_msgs { +namespace msg { +namespace CarlaLaneInvasionEvent_Constants { + + + + +} // namespace CarlaLaneInvasionEvent_Constants + + + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaLaneInvasionEvent defined by the user in the IDL file. + * @ingroup CarlaLaneInvasionEvent + */ +class CarlaLaneInvasionEventPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - } - /*! - * @brief This class represents the TopicDataType of the type CarlaLaneInvasionEvent defined by the user in the IDL file. - * @ingroup CARLALANEINVASIONEVENT - */ - class CarlaLaneInvasionEventPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef CarlaLaneInvasionEvent type; - typedef CarlaLaneInvasionEvent type; + eProsima_user_DllExport CarlaLaneInvasionEventPubSubType(); - eProsima_user_DllExport CarlaLaneInvasionEventPubSubType(); + eProsima_user_DllExport ~CarlaLaneInvasionEventPubSubType() override; - eProsima_user_DllExport virtual ~CarlaLaneInvasionEventPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLALANEINVASIONEVENT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.cxx deleted file mode 100644 index 65535475f00..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.cxx +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CarlaLaneInvasionPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#include -#include - -#include "CarlaLaneInvasionPubSubTypes.h" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; - -namespace carla_msgs { - namespace msg { - LaneInvasionEventPubSubType::LaneInvasionEventPubSubType() - { - setName("carla_msgs::msg::dds_::LaneInvasionEvent_"); - auto type_size = LaneInvasionEvent::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LaneInvasionEvent::isKeyDefined(); - size_t keyLength = LaneInvasionEvent::getKeyMaxCdrSerializedSize() > 16 ? - LaneInvasionEvent::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LaneInvasionEventPubSubType::~LaneInvasionEventPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LaneInvasionEventPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LaneInvasionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LaneInvasionEventPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - LaneInvasionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LaneInvasionEventPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LaneInvasionEventPubSubType::createData() - { - return reinterpret_cast(new LaneInvasionEvent()); - } - - void LaneInvasionEventPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LaneInvasionEventPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LaneInvasionEvent* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LaneInvasionEvent::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LaneInvasionEvent::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg -} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.h deleted file mode 100644 index 2c5620a95a6..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaLaneInvasionPubSubTypes.h +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CarlaLaneInvasionPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_PUBSUBTYPES_H_ - -#include -#include - -#include "CarlaLaneInvasion.h" -#include "std_msgs/msg/HeaderPubSubTypes.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated CarlaLaneInvasion is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace carla_msgs { -namespace msg { -/*! - * @brief This class represents the TopicDataType of the type LaneInvasionEvent defined by the user in the IDL file. - * @ingroup CarlaLaneInvasion - */ -class LaneInvasionEventPubSubType : public eprosima::fastdds::dds::TopicDataType { -public: - typedef LaneInvasionEvent type; - - eProsima_user_DllExport LaneInvasionEventPubSubType(); - - eProsima_user_DllExport virtual ~LaneInvasionEventPubSubType() override; - - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; - - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData(void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; -}; -} // namespace msg -} // namespace carla_msgs - -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CarlaLaneInvasion_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.cxx index 54cb5c9a42d..3f46db33e80 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaStatus.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,37 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaStatus.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaStatus::CarlaStatus() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@769a1df5 - // m_episode_settings com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@41f69e84 +namespace carla_msgs { - // m_frame com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7975d1d8 - m_frame = 0; - // m_synchronous_mode_participant_states com.eprosima.idl.parser.typecode.SequenceTypeCode@2438dcd +namespace msg { - // m_game_running com.eprosima.idl.parser.typecode.PrimitiveTypeCode@24105dc5 - m_game_running = false; -} -carla_msgs::msg::CarlaStatus::~CarlaStatus() +CarlaStatus::CarlaStatus() { +} - - - +CarlaStatus::~CarlaStatus() +{ } -carla_msgs::msg::CarlaStatus::CarlaStatus( +CarlaStatus::CarlaStatus( const CarlaStatus& x) { m_header = x.m_header; @@ -67,8 +61,8 @@ carla_msgs::msg::CarlaStatus::CarlaStatus( m_game_running = x.m_game_running; } -carla_msgs::msg::CarlaStatus::CarlaStatus( - CarlaStatus&& x) +CarlaStatus::CarlaStatus( + CarlaStatus&& x) noexcept { m_header = std::move(x.m_header); m_episode_settings = std::move(x.m_episode_settings); @@ -77,7 +71,7 @@ carla_msgs::msg::CarlaStatus::CarlaStatus( m_game_running = x.m_game_running; } -carla_msgs::msg::CarlaStatus& carla_msgs::msg::CarlaStatus::operator =( +CarlaStatus& CarlaStatus::operator =( const CarlaStatus& x) { @@ -86,12 +80,11 @@ carla_msgs::msg::CarlaStatus& carla_msgs::msg::CarlaStatus::operator =( m_frame = x.m_frame; m_synchronous_mode_participant_states = x.m_synchronous_mode_participant_states; m_game_running = x.m_game_running; - return *this; } -carla_msgs::msg::CarlaStatus& carla_msgs::msg::CarlaStatus::operator =( - CarlaStatus&& x) +CarlaStatus& CarlaStatus::operator =( + CarlaStatus&& x) noexcept { m_header = std::move(x.m_header); @@ -99,103 +92,30 @@ carla_msgs::msg::CarlaStatus& carla_msgs::msg::CarlaStatus::operator =( m_frame = x.m_frame; m_synchronous_mode_participant_states = std::move(x.m_synchronous_mode_participant_states); m_game_running = x.m_game_running; - return *this; } -bool carla_msgs::msg::CarlaStatus::operator ==( +bool CarlaStatus::operator ==( const CarlaStatus& x) const { - - return (m_header == x.m_header && m_episode_settings == x.m_episode_settings && m_frame == x.m_frame && m_synchronous_mode_participant_states == x.m_synchronous_mode_participant_states && m_game_running == x.m_game_running); + return (m_header == x.m_header && + m_episode_settings == x.m_episode_settings && + m_frame == x.m_frame && + m_synchronous_mode_participant_states == x.m_synchronous_mode_participant_states && + m_game_running == x.m_game_running); } -bool carla_msgs::msg::CarlaStatus::operator !=( +bool CarlaStatus::operator !=( const CarlaStatus& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaStatus::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += carla_msgs::msg::CarlaEpisodeSettings::getMaxCdrSerializedSize(current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getMaxCdrSerializedSize(current_alignment);} - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaStatus::getCdrSerializedSize( - const carla_msgs::msg::CarlaStatus& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += carla_msgs::msg::CarlaEpisodeSettings::getCdrSerializedSize(data.episode_settings(), current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.synchronous_mode_participant_states().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getCdrSerializedSize(data.synchronous_mode_participant_states().at(a), current_alignment);} - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaStatus::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_episode_settings; - scdr << m_frame; - scdr << m_synchronous_mode_participant_states; - scdr << m_game_running; - -} - -void carla_msgs::msg::CarlaStatus::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_episode_settings; - dcdr >> m_frame; - dcdr >> m_synchronous_mode_participant_states; - dcdr >> m_game_running; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaStatus::header( +void CarlaStatus::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -205,7 +125,7 @@ void carla_msgs::msg::CarlaStatus::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaStatus::header( +void CarlaStatus::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -215,7 +135,7 @@ void carla_msgs::msg::CarlaStatus::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& carla_msgs::msg::CarlaStatus::header() const +const std_msgs::msg::Header& CarlaStatus::header() const { return m_header; } @@ -224,15 +144,17 @@ const std_msgs::msg::Header& carla_msgs::msg::CarlaStatus::header() const * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& carla_msgs::msg::CarlaStatus::header() +std_msgs::msg::Header& CarlaStatus::header() { return m_header; } + + /*! * @brief This function copies the value in member episode_settings * @param _episode_settings New value to be copied in member episode_settings */ -void carla_msgs::msg::CarlaStatus::episode_settings( +void CarlaStatus::episode_settings( const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings) { m_episode_settings = _episode_settings; @@ -242,7 +164,7 @@ void carla_msgs::msg::CarlaStatus::episode_settings( * @brief This function moves the value in member episode_settings * @param _episode_settings New value to be moved in member episode_settings */ -void carla_msgs::msg::CarlaStatus::episode_settings( +void CarlaStatus::episode_settings( carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings) { m_episode_settings = std::move(_episode_settings); @@ -252,7 +174,7 @@ void carla_msgs::msg::CarlaStatus::episode_settings( * @brief This function returns a constant reference to member episode_settings * @return Constant reference to member episode_settings */ -const carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaStatus::episode_settings() const +const carla_msgs::msg::CarlaEpisodeSettings& CarlaStatus::episode_settings() const { return m_episode_settings; } @@ -261,15 +183,17 @@ const carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaStatus::episo * @brief This function returns a reference to member episode_settings * @return Reference to member episode_settings */ -carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::msg::CarlaStatus::episode_settings() +carla_msgs::msg::CarlaEpisodeSettings& CarlaStatus::episode_settings() { return m_episode_settings; } + + /*! * @brief This function sets a value in member frame * @param _frame New value for member frame */ -void carla_msgs::msg::CarlaStatus::frame( +void CarlaStatus::frame( uint64_t _frame) { m_frame = _frame; @@ -279,7 +203,7 @@ void carla_msgs::msg::CarlaStatus::frame( * @brief This function returns the value of member frame * @return Value of member frame */ -uint64_t carla_msgs::msg::CarlaStatus::frame() const +uint64_t CarlaStatus::frame() const { return m_frame; } @@ -288,16 +212,17 @@ uint64_t carla_msgs::msg::CarlaStatus::frame() const * @brief This function returns a reference to member frame * @return Reference to member frame */ -uint64_t& carla_msgs::msg::CarlaStatus::frame() +uint64_t& CarlaStatus::frame() { return m_frame; } + /*! * @brief This function copies the value in member synchronous_mode_participant_states * @param _synchronous_mode_participant_states New value to be copied in member synchronous_mode_participant_states */ -void carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states( +void CarlaStatus::synchronous_mode_participant_states( const std::vector& _synchronous_mode_participant_states) { m_synchronous_mode_participant_states = _synchronous_mode_participant_states; @@ -307,7 +232,7 @@ void carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states( * @brief This function moves the value in member synchronous_mode_participant_states * @param _synchronous_mode_participant_states New value to be moved in member synchronous_mode_participant_states */ -void carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states( +void CarlaStatus::synchronous_mode_participant_states( std::vector&& _synchronous_mode_participant_states) { m_synchronous_mode_participant_states = std::move(_synchronous_mode_participant_states); @@ -317,7 +242,7 @@ void carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states( * @brief This function returns a constant reference to member synchronous_mode_participant_states * @return Constant reference to member synchronous_mode_participant_states */ -const std::vector& carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states() const +const std::vector& CarlaStatus::synchronous_mode_participant_states() const { return m_synchronous_mode_participant_states; } @@ -326,15 +251,17 @@ const std::vector& * @brief This function returns a reference to member synchronous_mode_participant_states * @return Reference to member synchronous_mode_participant_states */ -std::vector& carla_msgs::msg::CarlaStatus::synchronous_mode_participant_states() +std::vector& CarlaStatus::synchronous_mode_participant_states() { return m_synchronous_mode_participant_states; } + + /*! * @brief This function sets a value in member game_running * @param _game_running New value for member game_running */ -void carla_msgs::msg::CarlaStatus::game_running( +void CarlaStatus::game_running( bool _game_running) { m_game_running = _game_running; @@ -344,7 +271,7 @@ void carla_msgs::msg::CarlaStatus::game_running( * @brief This function returns the value of member game_running * @return Value of member game_running */ -bool carla_msgs::msg::CarlaStatus::game_running() const +bool CarlaStatus::game_running() const { return m_game_running; } @@ -353,32 +280,18 @@ bool carla_msgs::msg::CarlaStatus::game_running() const * @brief This function returns a reference to member game_running * @return Reference to member game_running */ -bool& carla_msgs::msg::CarlaStatus::game_running() +bool& CarlaStatus::game_running() { return m_game_running; } -size_t carla_msgs::msg::CarlaStatus::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool carla_msgs::msg::CarlaStatus::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaStatus::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaStatusCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.h index 3866c796204..369d7e84539 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatus.h @@ -16,22 +16,27 @@ * @file CarlaStatus.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_H_ -#include "carla_msgs/msg/CarlaEpisodeSettings.h" -#include "carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h" -#include "std_msgs/msg/Header.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaSynchronizationWindowParticipantState.h" +#include "std_msgs/msg/Header.h" +#include "CarlaEpisodeSettings.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -45,267 +50,228 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaStatus_SOURCE) -#define CarlaStatus_DllAPI __declspec( dllexport ) +#if defined(CARLASTATUS_SOURCE) +#define CARLASTATUS_DllAPI __declspec( dllexport ) #else -#define CarlaStatus_DllAPI __declspec( dllimport ) -#endif // CarlaStatus_SOURCE +#define CARLASTATUS_DllAPI __declspec( dllimport ) +#endif // CARLASTATUS_SOURCE #else -#define CarlaStatus_DllAPI +#define CARLASTATUS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaStatus_DllAPI +#define CARLASTATUS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaStatus defined by the user in the IDL file. - * @ingroup CARLASTATUS - */ - class CarlaStatus - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaStatus(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaStatus(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. - */ - eProsima_user_DllExport CarlaStatus( - const CarlaStatus& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. - */ - eProsima_user_DllExport CarlaStatus( - CarlaStatus&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. - */ - eProsima_user_DllExport CarlaStatus& operator =( - const CarlaStatus& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. - */ - eProsima_user_DllExport CarlaStatus& operator =( - CarlaStatus&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaStatus object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaStatus& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaStatus object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaStatus& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member episode_settings - * @param _episode_settings New value to be copied in member episode_settings - */ - eProsima_user_DllExport void episode_settings( - const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings); - - /*! - * @brief This function moves the value in member episode_settings - * @param _episode_settings New value to be moved in member episode_settings - */ - eProsima_user_DllExport void episode_settings( - carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings); - - /*! - * @brief This function returns a constant reference to member episode_settings - * @return Constant reference to member episode_settings - */ - eProsima_user_DllExport const carla_msgs::msg::CarlaEpisodeSettings& episode_settings() const; - - /*! - * @brief This function returns a reference to member episode_settings - * @return Reference to member episode_settings - */ - eProsima_user_DllExport carla_msgs::msg::CarlaEpisodeSettings& episode_settings(); - /*! - * @brief This function sets a value in member frame - * @param _frame New value for member frame - */ - eProsima_user_DllExport void frame( - uint64_t _frame); - - /*! - * @brief This function returns the value of member frame - * @return Value of member frame - */ - eProsima_user_DllExport uint64_t frame() const; - - /*! - * @brief This function returns a reference to member frame - * @return Reference to member frame - */ - eProsima_user_DllExport uint64_t& frame(); - - /*! - * @brief This function copies the value in member synchronous_mode_participant_states - * @param _synchronous_mode_participant_states New value to be copied in member synchronous_mode_participant_states - */ - eProsima_user_DllExport void synchronous_mode_participant_states( - const std::vector& _synchronous_mode_participant_states); - - /*! - * @brief This function moves the value in member synchronous_mode_participant_states - * @param _synchronous_mode_participant_states New value to be moved in member synchronous_mode_participant_states - */ - eProsima_user_DllExport void synchronous_mode_participant_states( - std::vector&& _synchronous_mode_participant_states); - - /*! - * @brief This function returns a constant reference to member synchronous_mode_participant_states - * @return Constant reference to member synchronous_mode_participant_states - */ - eProsima_user_DllExport const std::vector& synchronous_mode_participant_states() const; - - /*! - * @brief This function returns a reference to member synchronous_mode_participant_states - * @return Reference to member synchronous_mode_participant_states - */ - eProsima_user_DllExport std::vector& synchronous_mode_participant_states(); - /*! - * @brief This function sets a value in member game_running - * @param _game_running New value for member game_running - */ - eProsima_user_DllExport void game_running( - bool _game_running); - - /*! - * @brief This function returns the value of member game_running - * @return Value of member game_running - */ - eProsima_user_DllExport bool game_running() const; - - /*! - * @brief This function returns a reference to member game_running - * @return Reference to member game_running - */ - eProsima_user_DllExport bool& game_running(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaStatus& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - carla_msgs::msg::CarlaEpisodeSettings m_episode_settings; - uint64_t m_frame; - std::vector m_synchronous_mode_participant_states; - bool m_game_running; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaStatus defined by the user in the IDL file. + * @ingroup CarlaStatus + */ +class CarlaStatus +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. + */ + eProsima_user_DllExport CarlaStatus( + const CarlaStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. + */ + eProsima_user_DllExport CarlaStatus( + CarlaStatus&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. + */ + eProsima_user_DllExport CarlaStatus& operator =( + const CarlaStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaStatus that will be copied. + */ + eProsima_user_DllExport CarlaStatus& operator =( + CarlaStatus&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaStatus& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member episode_settings + * @param _episode_settings New value to be copied in member episode_settings + */ + eProsima_user_DllExport void episode_settings( + const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings); + + /*! + * @brief This function moves the value in member episode_settings + * @param _episode_settings New value to be moved in member episode_settings + */ + eProsima_user_DllExport void episode_settings( + carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings); + + /*! + * @brief This function returns a constant reference to member episode_settings + * @return Constant reference to member episode_settings + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaEpisodeSettings& episode_settings() const; + + /*! + * @brief This function returns a reference to member episode_settings + * @return Reference to member episode_settings + */ + eProsima_user_DllExport carla_msgs::msg::CarlaEpisodeSettings& episode_settings(); + + + /*! + * @brief This function sets a value in member frame + * @param _frame New value for member frame + */ + eProsima_user_DllExport void frame( + uint64_t _frame); + + /*! + * @brief This function returns the value of member frame + * @return Value of member frame + */ + eProsima_user_DllExport uint64_t frame() const; + + /*! + * @brief This function returns a reference to member frame + * @return Reference to member frame + */ + eProsima_user_DllExport uint64_t& frame(); + + + /*! + * @brief This function copies the value in member synchronous_mode_participant_states + * @param _synchronous_mode_participant_states New value to be copied in member synchronous_mode_participant_states + */ + eProsima_user_DllExport void synchronous_mode_participant_states( + const std::vector& _synchronous_mode_participant_states); + + /*! + * @brief This function moves the value in member synchronous_mode_participant_states + * @param _synchronous_mode_participant_states New value to be moved in member synchronous_mode_participant_states + */ + eProsima_user_DllExport void synchronous_mode_participant_states( + std::vector&& _synchronous_mode_participant_states); + + /*! + * @brief This function returns a constant reference to member synchronous_mode_participant_states + * @return Constant reference to member synchronous_mode_participant_states + */ + eProsima_user_DllExport const std::vector& synchronous_mode_participant_states() const; + + /*! + * @brief This function returns a reference to member synchronous_mode_participant_states + * @return Reference to member synchronous_mode_participant_states + */ + eProsima_user_DllExport std::vector& synchronous_mode_participant_states(); + + + /*! + * @brief This function sets a value in member game_running + * @param _game_running New value for member game_running + */ + eProsima_user_DllExport void game_running( + bool _game_running); + + /*! + * @brief This function returns the value of member game_running + * @return Value of member game_running + */ + eProsima_user_DllExport bool game_running() const; + + /*! + * @brief This function returns a reference to member game_running + * @return Reference to member game_running + */ + eProsima_user_DllExport bool& game_running(); + +private: + + std_msgs::msg::Header m_header; + carla_msgs::msg::CarlaEpisodeSettings m_episode_settings; + uint64_t m_frame{0}; + std::vector m_synchronous_mode_participant_states; + bool m_game_running{false}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusCdrAux.hpp new file mode 100644 index 00000000000..b47c6ca83c9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaStatusCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUSCDRAUX_HPP_ + +#include "CarlaStatus.h" + +constexpr uint32_t carla_msgs_msg_CarlaStatus_max_cdr_typesize {28353UL}; +constexpr uint32_t carla_msgs_msg_CarlaStatus_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaStatus& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusCdrAux.ipp new file mode 100644 index 00000000000..9737b4f00d8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusCdrAux.ipp @@ -0,0 +1,162 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaStatusCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUSCDRAUX_IPP_ + +#include "CarlaStatusCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaStatus& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.episode_settings(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.frame(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.synchronous_mode_participant_states(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.game_running(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaStatus& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.episode_settings() + << eprosima::fastcdr::MemberId(2) << data.frame() + << eprosima::fastcdr::MemberId(3) << data.synchronous_mode_participant_states() + << eprosima::fastcdr::MemberId(4) << data.game_running() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaStatus& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.episode_settings(); + break; + + case 2: + dcdr >> data.frame(); + break; + + case 3: + dcdr >> data.synchronous_mode_participant_states(); + break; + + case 4: + dcdr >> data.game_running(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaStatus& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.cxx index 4726108d66c..dbfa9d0908c 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaStatusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaStatusPubSubTypes.h" +#include "CarlaStatusCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaStatusPubSubType::CarlaStatusPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaStatus_"); - auto type_size = CarlaStatus::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaStatus::isKeyDefined(); - size_t keyLength = CarlaStatus::getKeyMaxCdrSerializedSize() > 16 ? - CarlaStatus::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaStatusPubSubType::~CarlaStatusPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaStatusPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaStatusPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaStatusPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaStatusPubSubType::createData() - { - return reinterpret_cast(new CarlaStatus()); - } - - void CarlaStatusPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaStatusPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaStatus::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaStatus::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaStatusPubSubType::CarlaStatusPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaStatus_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaStatus::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaStatus_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaStatusPubSubType::~CarlaStatusPubSubType() +{ +} + +bool CarlaStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaStatusPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaStatusPubSubType::createData() +{ + return reinterpret_cast(new CarlaStatus()); +} + +void CarlaStatusPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.h index 3ab5acb6ec7..9619ff2d46f 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaStatusPubSubTypes.h @@ -16,92 +16,123 @@ * @file CarlaStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaStatus.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaSynchronizationWindowParticipantStatePubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" +#include "CarlaEpisodeSettingsPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaStatus defined by the user in the IDL file. + * @ingroup CarlaStatus + */ +class CarlaStatusPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaStatus defined by the user in the IDL file. - * @ingroup CARLASTATUS - */ - class CarlaStatusPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaStatus type; + typedef CarlaStatus type; - eProsima_user_DllExport CarlaStatusPubSubType(); + eProsima_user_DllExport CarlaStatusPubSubType(); - eProsima_user_DllExport virtual ~CarlaStatusPubSubType(); + eProsima_user_DllExport ~CarlaStatusPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASTATUS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.cxx index 5e360641bb2..cebc732b317 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaSynchronizationWindow.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,113 +27,75 @@ char dummy; #endif // _WIN32 #include "CarlaSynchronizationWindow.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaSynchronizationWindow::CarlaSynchronizationWindow() -{ - // m_synchronization_window_target_game_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2c78324b - m_synchronization_window_target_game_time = 0.0; +namespace carla_msgs { + +namespace msg { + + + +CarlaSynchronizationWindow::CarlaSynchronizationWindow() +{ } -carla_msgs::msg::CarlaSynchronizationWindow::~CarlaSynchronizationWindow() +CarlaSynchronizationWindow::~CarlaSynchronizationWindow() { } -carla_msgs::msg::CarlaSynchronizationWindow::CarlaSynchronizationWindow( +CarlaSynchronizationWindow::CarlaSynchronizationWindow( const CarlaSynchronizationWindow& x) { m_synchronization_window_target_game_time = x.m_synchronization_window_target_game_time; } -carla_msgs::msg::CarlaSynchronizationWindow::CarlaSynchronizationWindow( - CarlaSynchronizationWindow&& x) +CarlaSynchronizationWindow::CarlaSynchronizationWindow( + CarlaSynchronizationWindow&& x) noexcept { m_synchronization_window_target_game_time = x.m_synchronization_window_target_game_time; } -carla_msgs::msg::CarlaSynchronizationWindow& carla_msgs::msg::CarlaSynchronizationWindow::operator =( +CarlaSynchronizationWindow& CarlaSynchronizationWindow::operator =( const CarlaSynchronizationWindow& x) { m_synchronization_window_target_game_time = x.m_synchronization_window_target_game_time; - return *this; } -carla_msgs::msg::CarlaSynchronizationWindow& carla_msgs::msg::CarlaSynchronizationWindow::operator =( - CarlaSynchronizationWindow&& x) +CarlaSynchronizationWindow& CarlaSynchronizationWindow::operator =( + CarlaSynchronizationWindow&& x) noexcept { m_synchronization_window_target_game_time = x.m_synchronization_window_target_game_time; - return *this; } -bool carla_msgs::msg::CarlaSynchronizationWindow::operator ==( +bool CarlaSynchronizationWindow::operator ==( const CarlaSynchronizationWindow& x) const { - return (m_synchronization_window_target_game_time == x.m_synchronization_window_target_game_time); } -bool carla_msgs::msg::CarlaSynchronizationWindow::operator !=( +bool CarlaSynchronizationWindow::operator !=( const CarlaSynchronizationWindow& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaSynchronizationWindow::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaSynchronizationWindow::getCdrSerializedSize( - const carla_msgs::msg::CarlaSynchronizationWindow& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaSynchronizationWindow::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_synchronization_window_target_game_time; - -} - -void carla_msgs::msg::CarlaSynchronizationWindow::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_synchronization_window_target_game_time; -} - /*! * @brief This function sets a value in member synchronization_window_target_game_time * @param _synchronization_window_target_game_time New value for member synchronization_window_target_game_time */ -void carla_msgs::msg::CarlaSynchronizationWindow::synchronization_window_target_game_time( +void CarlaSynchronizationWindow::synchronization_window_target_game_time( float _synchronization_window_target_game_time) { m_synchronization_window_target_game_time = _synchronization_window_target_game_time; @@ -143,7 +105,7 @@ void carla_msgs::msg::CarlaSynchronizationWindow::synchronization_window_target_ * @brief This function returns the value of member synchronization_window_target_game_time * @return Value of member synchronization_window_target_game_time */ -float carla_msgs::msg::CarlaSynchronizationWindow::synchronization_window_target_game_time() const +float CarlaSynchronizationWindow::synchronization_window_target_game_time() const { return m_synchronization_window_target_game_time; } @@ -152,32 +114,18 @@ float carla_msgs::msg::CarlaSynchronizationWindow::synchronization_window_target * @brief This function returns a reference to member synchronization_window_target_game_time * @return Reference to member synchronization_window_target_game_time */ -float& carla_msgs::msg::CarlaSynchronizationWindow::synchronization_window_target_game_time() +float& CarlaSynchronizationWindow::synchronization_window_target_game_time() { return m_synchronization_window_target_game_time; } -size_t carla_msgs::msg::CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool carla_msgs::msg::CarlaSynchronizationWindow::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaSynchronizationWindow::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaSynchronizationWindowCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.h index 8288f455158..8483c2b0664 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindow.h @@ -16,19 +16,24 @@ * @file CarlaSynchronizationWindow.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,169 +47,123 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaSynchronizationWindow_SOURCE) -#define CarlaSynchronizationWindow_DllAPI __declspec( dllexport ) +#if defined(CARLASYNCHRONIZATIONWINDOW_SOURCE) +#define CARLASYNCHRONIZATIONWINDOW_DllAPI __declspec( dllexport ) #else -#define CarlaSynchronizationWindow_DllAPI __declspec( dllimport ) -#endif // CarlaSynchronizationWindow_SOURCE +#define CARLASYNCHRONIZATIONWINDOW_DllAPI __declspec( dllimport ) +#endif // CARLASYNCHRONIZATIONWINDOW_SOURCE #else -#define CarlaSynchronizationWindow_DllAPI +#define CARLASYNCHRONIZATIONWINDOW_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaSynchronizationWindow_DllAPI +#define CARLASYNCHRONIZATIONWINDOW_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaSynchronizationWindow defined by the user in the IDL file. - * @ingroup CARLASYNCHRONIZATIONWINDOW - */ - class CarlaSynchronizationWindow - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaSynchronizationWindow(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaSynchronizationWindow(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. - */ - eProsima_user_DllExport CarlaSynchronizationWindow( - const CarlaSynchronizationWindow& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. - */ - eProsima_user_DllExport CarlaSynchronizationWindow( - CarlaSynchronizationWindow&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. - */ - eProsima_user_DllExport CarlaSynchronizationWindow& operator =( - const CarlaSynchronizationWindow& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. - */ - eProsima_user_DllExport CarlaSynchronizationWindow& operator =( - CarlaSynchronizationWindow&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaSynchronizationWindow object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaSynchronizationWindow& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaSynchronizationWindow object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaSynchronizationWindow& x) const; - - /*! - * @brief This function sets a value in member synchronization_window_target_game_time - * @param _synchronization_window_target_game_time New value for member synchronization_window_target_game_time - */ - eProsima_user_DllExport void synchronization_window_target_game_time( - float _synchronization_window_target_game_time); - - /*! - * @brief This function returns the value of member synchronization_window_target_game_time - * @return Value of member synchronization_window_target_game_time - */ - eProsima_user_DllExport float synchronization_window_target_game_time() const; - - /*! - * @brief This function returns a reference to member synchronization_window_target_game_time - * @return Reference to member synchronization_window_target_game_time - */ - eProsima_user_DllExport float& synchronization_window_target_game_time(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaSynchronizationWindow& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - float m_synchronization_window_target_game_time; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaSynchronizationWindow defined by the user in the IDL file. + * @ingroup CarlaSynchronizationWindow + */ +class CarlaSynchronizationWindow +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaSynchronizationWindow(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaSynchronizationWindow(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindow( + const CarlaSynchronizationWindow& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindow( + CarlaSynchronizationWindow&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindow& operator =( + const CarlaSynchronizationWindow& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindow that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindow& operator =( + CarlaSynchronizationWindow&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaSynchronizationWindow object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaSynchronizationWindow& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaSynchronizationWindow object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaSynchronizationWindow& x) const; + + /*! + * @brief This function sets a value in member synchronization_window_target_game_time + * @param _synchronization_window_target_game_time New value for member synchronization_window_target_game_time + */ + eProsima_user_DllExport void synchronization_window_target_game_time( + float _synchronization_window_target_game_time); + + /*! + * @brief This function returns the value of member synchronization_window_target_game_time + * @return Value of member synchronization_window_target_game_time + */ + eProsima_user_DllExport float synchronization_window_target_game_time() const; + + /*! + * @brief This function returns a reference to member synchronization_window_target_game_time + * @return Reference to member synchronization_window_target_game_time + */ + eProsima_user_DllExport float& synchronization_window_target_game_time(); + +private: + + float m_synchronization_window_target_game_time{0.0}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowCdrAux.hpp new file mode 100644 index 00000000000..1faab0e79f9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWCDRAUX_HPP_ + +#include "CarlaSynchronizationWindow.h" + +constexpr uint32_t carla_msgs_msg_CarlaSynchronizationWindow_max_cdr_typesize {8UL}; +constexpr uint32_t carla_msgs_msg_CarlaSynchronizationWindow_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaSynchronizationWindow& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowCdrAux.ipp new file mode 100644 index 00000000000..e1b418d04d6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowCdrAux.ipp @@ -0,0 +1,130 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWCDRAUX_IPP_ + +#include "CarlaSynchronizationWindowCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaSynchronizationWindow& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.synchronization_window_target_game_time(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaSynchronizationWindow& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.synchronization_window_target_game_time() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaSynchronizationWindow& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.synchronization_window_target_game_time(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaSynchronizationWindow& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.cxx index ccebc7f826f..d2f580cf455 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaSynchronizationWindowParticipantState.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaSynchronizationWindowParticipantState.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState() -{ - // m_client_id com.eprosima.idl.parser.typecode.StringTypeCode@2e570ded - m_client_id =""; - // m_participant_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@b86de0d - m_participant_id = 0; - // m_target_game_time com.eprosima.idl.parser.typecode.PrimitiveTypeCode@81d9a72 - m_target_game_time = 0.0; -} +namespace carla_msgs { + +namespace msg { + -carla_msgs::msg::CarlaSynchronizationWindowParticipantState::~CarlaSynchronizationWindowParticipantState() -{ +CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState() +{ +} +CarlaSynchronizationWindowParticipantState::~CarlaSynchronizationWindowParticipantState() +{ } -carla_msgs::msg::CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState( +CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState( const CarlaSynchronizationWindowParticipantState& x) { m_client_id = x.m_client_id; @@ -59,111 +59,53 @@ carla_msgs::msg::CarlaSynchronizationWindowParticipantState::CarlaSynchronizatio m_target_game_time = x.m_target_game_time; } -carla_msgs::msg::CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState( - CarlaSynchronizationWindowParticipantState&& x) +CarlaSynchronizationWindowParticipantState::CarlaSynchronizationWindowParticipantState( + CarlaSynchronizationWindowParticipantState&& x) noexcept { m_client_id = std::move(x.m_client_id); m_participant_id = x.m_participant_id; m_target_game_time = x.m_target_game_time; } -carla_msgs::msg::CarlaSynchronizationWindowParticipantState& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::operator =( +CarlaSynchronizationWindowParticipantState& CarlaSynchronizationWindowParticipantState::operator =( const CarlaSynchronizationWindowParticipantState& x) { m_client_id = x.m_client_id; m_participant_id = x.m_participant_id; m_target_game_time = x.m_target_game_time; - return *this; } -carla_msgs::msg::CarlaSynchronizationWindowParticipantState& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::operator =( - CarlaSynchronizationWindowParticipantState&& x) +CarlaSynchronizationWindowParticipantState& CarlaSynchronizationWindowParticipantState::operator =( + CarlaSynchronizationWindowParticipantState&& x) noexcept { m_client_id = std::move(x.m_client_id); m_participant_id = x.m_participant_id; m_target_game_time = x.m_target_game_time; - return *this; } -bool carla_msgs::msg::CarlaSynchronizationWindowParticipantState::operator ==( +bool CarlaSynchronizationWindowParticipantState::operator ==( const CarlaSynchronizationWindowParticipantState& x) const { - - return (m_client_id == x.m_client_id && m_participant_id == x.m_participant_id && m_target_game_time == x.m_target_game_time); + return (m_client_id == x.m_client_id && + m_participant_id == x.m_participant_id && + m_target_game_time == x.m_target_game_time); } -bool carla_msgs::msg::CarlaSynchronizationWindowParticipantState::operator !=( +bool CarlaSynchronizationWindowParticipantState::operator !=( const CarlaSynchronizationWindowParticipantState& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getCdrSerializedSize( - const carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.client_id().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_client_id; - scdr << m_participant_id; - scdr << m_target_game_time; - -} - -void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_client_id; - dcdr >> m_participant_id; - dcdr >> m_target_game_time; -} - /*! * @brief This function copies the value in member client_id * @param _client_id New value to be copied in member client_id */ -void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id( +void CarlaSynchronizationWindowParticipantState::client_id( const std::string& _client_id) { m_client_id = _client_id; @@ -173,7 +115,7 @@ void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id( * @brief This function moves the value in member client_id * @param _client_id New value to be moved in member client_id */ -void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id( +void CarlaSynchronizationWindowParticipantState::client_id( std::string&& _client_id) { m_client_id = std::move(_client_id); @@ -183,7 +125,7 @@ void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id( * @brief This function returns a constant reference to member client_id * @return Constant reference to member client_id */ -const std::string& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id() const +const std::string& CarlaSynchronizationWindowParticipantState::client_id() const { return m_client_id; } @@ -192,15 +134,17 @@ const std::string& carla_msgs::msg::CarlaSynchronizationWindowParticipantState:: * @brief This function returns a reference to member client_id * @return Reference to member client_id */ -std::string& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::client_id() +std::string& CarlaSynchronizationWindowParticipantState::client_id() { return m_client_id; } + + /*! * @brief This function sets a value in member participant_id * @param _participant_id New value for member participant_id */ -void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::participant_id( +void CarlaSynchronizationWindowParticipantState::participant_id( uint32_t _participant_id) { m_participant_id = _participant_id; @@ -210,7 +154,7 @@ void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::participant_id * @brief This function returns the value of member participant_id * @return Value of member participant_id */ -uint32_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::participant_id() const +uint32_t CarlaSynchronizationWindowParticipantState::participant_id() const { return m_participant_id; } @@ -219,16 +163,17 @@ uint32_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::participan * @brief This function returns a reference to member participant_id * @return Reference to member participant_id */ -uint32_t& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::participant_id() +uint32_t& CarlaSynchronizationWindowParticipantState::participant_id() { return m_participant_id; } + /*! * @brief This function sets a value in member target_game_time * @param _target_game_time New value for member target_game_time */ -void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::target_game_time( +void CarlaSynchronizationWindowParticipantState::target_game_time( double _target_game_time) { m_target_game_time = _target_game_time; @@ -238,7 +183,7 @@ void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::target_game_ti * @brief This function returns the value of member target_game_time * @return Value of member target_game_time */ -double carla_msgs::msg::CarlaSynchronizationWindowParticipantState::target_game_time() const +double CarlaSynchronizationWindowParticipantState::target_game_time() const { return m_target_game_time; } @@ -247,32 +192,18 @@ double carla_msgs::msg::CarlaSynchronizationWindowParticipantState::target_game_ * @brief This function returns a reference to member target_game_time * @return Reference to member target_game_time */ -double& carla_msgs::msg::CarlaSynchronizationWindowParticipantState::target_game_time() +double& CarlaSynchronizationWindowParticipantState::target_game_time() { return m_target_game_time; } -size_t carla_msgs::msg::CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool carla_msgs::msg::CarlaSynchronizationWindowParticipantState::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaSynchronizationWindowParticipantState::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaSynchronizationWindowParticipantStateCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h index 75431586354..92002e722fd 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantState.h @@ -16,19 +16,24 @@ * @file CarlaSynchronizationWindowParticipantState.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,215 +47,172 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaSynchronizationWindowParticipantState_SOURCE) -#define CarlaSynchronizationWindowParticipantState_DllAPI __declspec( dllexport ) +#if defined(CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_SOURCE) +#define CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_DllAPI __declspec( dllexport ) #else -#define CarlaSynchronizationWindowParticipantState_DllAPI __declspec( dllimport ) -#endif // CarlaSynchronizationWindowParticipantState_SOURCE +#define CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_DllAPI __declspec( dllimport ) +#endif // CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_SOURCE #else -#define CarlaSynchronizationWindowParticipantState_DllAPI +#define CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaSynchronizationWindowParticipantState_DllAPI +#define CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaSynchronizationWindowParticipantState defined by the user in the IDL file. - * @ingroup CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE - */ - class CarlaSynchronizationWindowParticipantState - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaSynchronizationWindowParticipantState(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaSynchronizationWindowParticipantState(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. - */ - eProsima_user_DllExport CarlaSynchronizationWindowParticipantState( - const CarlaSynchronizationWindowParticipantState& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. - */ - eProsima_user_DllExport CarlaSynchronizationWindowParticipantState( - CarlaSynchronizationWindowParticipantState&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. - */ - eProsima_user_DllExport CarlaSynchronizationWindowParticipantState& operator =( - const CarlaSynchronizationWindowParticipantState& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. - */ - eProsima_user_DllExport CarlaSynchronizationWindowParticipantState& operator =( - CarlaSynchronizationWindowParticipantState&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaSynchronizationWindowParticipantState object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaSynchronizationWindowParticipantState& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaSynchronizationWindowParticipantState object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaSynchronizationWindowParticipantState& x) const; - - /*! - * @brief This function copies the value in member client_id - * @param _client_id New value to be copied in member client_id - */ - eProsima_user_DllExport void client_id( - const std::string& _client_id); - - /*! - * @brief This function moves the value in member client_id - * @param _client_id New value to be moved in member client_id - */ - eProsima_user_DllExport void client_id( - std::string&& _client_id); - - /*! - * @brief This function returns a constant reference to member client_id - * @return Constant reference to member client_id - */ - eProsima_user_DllExport const std::string& client_id() const; - - /*! - * @brief This function returns a reference to member client_id - * @return Reference to member client_id - */ - eProsima_user_DllExport std::string& client_id(); - /*! - * @brief This function sets a value in member participant_id - * @param _participant_id New value for member participant_id - */ - eProsima_user_DllExport void participant_id( - uint32_t _participant_id); - - /*! - * @brief This function returns the value of member participant_id - * @return Value of member participant_id - */ - eProsima_user_DllExport uint32_t participant_id() const; - - /*! - * @brief This function returns a reference to member participant_id - * @return Reference to member participant_id - */ - eProsima_user_DllExport uint32_t& participant_id(); - - /*! - * @brief This function sets a value in member target_game_time - * @param _target_game_time New value for member target_game_time - */ - eProsima_user_DllExport void target_game_time( - double _target_game_time); - - /*! - * @brief This function returns the value of member target_game_time - * @return Value of member target_game_time - */ - eProsima_user_DllExport double target_game_time() const; - - /*! - * @brief This function returns a reference to member target_game_time - * @return Reference to member target_game_time - */ - eProsima_user_DllExport double& target_game_time(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::string m_client_id; - uint32_t m_participant_id; - double m_target_game_time; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaSynchronizationWindowParticipantState defined by the user in the IDL file. + * @ingroup CarlaSynchronizationWindowParticipantState + */ +class CarlaSynchronizationWindowParticipantState +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaSynchronizationWindowParticipantState(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState( + const CarlaSynchronizationWindowParticipantState& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState( + CarlaSynchronizationWindowParticipantState&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState& operator =( + const CarlaSynchronizationWindowParticipantState& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaSynchronizationWindowParticipantState that will be copied. + */ + eProsima_user_DllExport CarlaSynchronizationWindowParticipantState& operator =( + CarlaSynchronizationWindowParticipantState&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaSynchronizationWindowParticipantState object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaSynchronizationWindowParticipantState& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaSynchronizationWindowParticipantState object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaSynchronizationWindowParticipantState& x) const; + + /*! + * @brief This function copies the value in member client_id + * @param _client_id New value to be copied in member client_id + */ + eProsima_user_DllExport void client_id( + const std::string& _client_id); + + /*! + * @brief This function moves the value in member client_id + * @param _client_id New value to be moved in member client_id + */ + eProsima_user_DllExport void client_id( + std::string&& _client_id); + + /*! + * @brief This function returns a constant reference to member client_id + * @return Constant reference to member client_id + */ + eProsima_user_DllExport const std::string& client_id() const; + + /*! + * @brief This function returns a reference to member client_id + * @return Reference to member client_id + */ + eProsima_user_DllExport std::string& client_id(); + + + /*! + * @brief This function sets a value in member participant_id + * @param _participant_id New value for member participant_id + */ + eProsima_user_DllExport void participant_id( + uint32_t _participant_id); + + /*! + * @brief This function returns the value of member participant_id + * @return Value of member participant_id + */ + eProsima_user_DllExport uint32_t participant_id() const; + + /*! + * @brief This function returns a reference to member participant_id + * @return Reference to member participant_id + */ + eProsima_user_DllExport uint32_t& participant_id(); + + + /*! + * @brief This function sets a value in member target_game_time + * @param _target_game_time New value for member target_game_time + */ + eProsima_user_DllExport void target_game_time( + double _target_game_time); + + /*! + * @brief This function returns the value of member target_game_time + * @return Value of member target_game_time + */ + eProsima_user_DllExport double target_game_time() const; + + /*! + * @brief This function returns a reference to member target_game_time + * @return Reference to member target_game_time + */ + eProsima_user_DllExport double& target_game_time(); + +private: + + std::string m_client_id; + uint32_t m_participant_id{0}; + double m_target_game_time{0.0}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStateCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStateCdrAux.hpp new file mode 100644 index 00000000000..5afe8177b60 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStateCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowParticipantStateCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATECDRAUX_HPP_ + +#include "CarlaSynchronizationWindowParticipantState.h" + +constexpr uint32_t carla_msgs_msg_CarlaSynchronizationWindowParticipantState_max_cdr_typesize {280UL}; +constexpr uint32_t carla_msgs_msg_CarlaSynchronizationWindowParticipantState_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStateCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStateCdrAux.ipp new file mode 100644 index 00000000000..93f0343e25e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStateCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaSynchronizationWindowParticipantStateCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATECDRAUX_IPP_ + +#include "CarlaSynchronizationWindowParticipantStateCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.client_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.participant_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.target_game_time(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.client_id() + << eprosima::fastcdr::MemberId(1) << data.participant_id() + << eprosima::fastcdr::MemberId(2) << data.target_game_time() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.client_id(); + break; + + case 1: + dcdr >> data.participant_id(); + break; + + case 2: + dcdr >> data.target_game_time(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaSynchronizationWindowParticipantState& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.cxx index 0df7f36926b..1a280e5c54b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaSynchronizationWindowParticipantStatePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaSynchronizationWindowParticipantStatePubSubTypes.h" +#include "CarlaSynchronizationWindowParticipantStateCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaSynchronizationWindowParticipantStatePubSubType::CarlaSynchronizationWindowParticipantStatePubSubType() - { - setName("carla_msgs::msg::dds_::CarlaSynchronizationWindowParticipantState_"); - auto type_size = CarlaSynchronizationWindowParticipantState::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaSynchronizationWindowParticipantState::isKeyDefined(); - size_t keyLength = CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize() > 16 ? - CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaSynchronizationWindowParticipantStatePubSubType::~CarlaSynchronizationWindowParticipantStatePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaSynchronizationWindowParticipantStatePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaSynchronizationWindowParticipantState* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaSynchronizationWindowParticipantStatePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaSynchronizationWindowParticipantState* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaSynchronizationWindowParticipantStatePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaSynchronizationWindowParticipantStatePubSubType::createData() - { - return reinterpret_cast(new CarlaSynchronizationWindowParticipantState()); - } - - void CarlaSynchronizationWindowParticipantStatePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaSynchronizationWindowParticipantStatePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaSynchronizationWindowParticipantState* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaSynchronizationWindowParticipantState::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaSynchronizationWindowParticipantStatePubSubType::CarlaSynchronizationWindowParticipantStatePubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaSynchronizationWindowParticipantState_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaSynchronizationWindowParticipantState::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaSynchronizationWindowParticipantState_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaSynchronizationWindowParticipantStatePubSubType::~CarlaSynchronizationWindowParticipantStatePubSubType() +{ +} + +bool CarlaSynchronizationWindowParticipantStatePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaSynchronizationWindowParticipantState* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaSynchronizationWindowParticipantStatePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaSynchronizationWindowParticipantState* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaSynchronizationWindowParticipantStatePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaSynchronizationWindowParticipantStatePubSubType::createData() +{ + return reinterpret_cast(new CarlaSynchronizationWindowParticipantState()); +} + +void CarlaSynchronizationWindowParticipantStatePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaSynchronizationWindowParticipantStatePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.h index 13850848bc3..745f2d68aa7 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowParticipantStatePubSubTypes.h @@ -16,92 +16,120 @@ * @file CarlaSynchronizationWindowParticipantStatePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaSynchronizationWindowParticipantState.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaSynchronizationWindowParticipantState is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaSynchronizationWindowParticipantState defined by the user in the IDL file. + * @ingroup CarlaSynchronizationWindowParticipantState + */ +class CarlaSynchronizationWindowParticipantStatePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaSynchronizationWindowParticipantState defined by the user in the IDL file. - * @ingroup CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE - */ - class CarlaSynchronizationWindowParticipantStatePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaSynchronizationWindowParticipantState type; + typedef CarlaSynchronizationWindowParticipantState type; - eProsima_user_DllExport CarlaSynchronizationWindowParticipantStatePubSubType(); + eProsima_user_DllExport CarlaSynchronizationWindowParticipantStatePubSubType(); - eProsima_user_DllExport virtual ~CarlaSynchronizationWindowParticipantStatePubSubType(); + eProsima_user_DllExport ~CarlaSynchronizationWindowParticipantStatePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOWPARTICIPANTSTATE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.cxx index f3b17091359..c7780e41d69 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaSynchronizationWindowPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaSynchronizationWindowPubSubTypes.h" +#include "CarlaSynchronizationWindowCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaSynchronizationWindowPubSubType::CarlaSynchronizationWindowPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaSynchronizationWindow_"); - auto type_size = CarlaSynchronizationWindow::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaSynchronizationWindow::isKeyDefined(); - size_t keyLength = CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize() > 16 ? - CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaSynchronizationWindowPubSubType::~CarlaSynchronizationWindowPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaSynchronizationWindowPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaSynchronizationWindow* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaSynchronizationWindowPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaSynchronizationWindow* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaSynchronizationWindowPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaSynchronizationWindowPubSubType::createData() - { - return reinterpret_cast(new CarlaSynchronizationWindow()); - } - - void CarlaSynchronizationWindowPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaSynchronizationWindowPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaSynchronizationWindow* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaSynchronizationWindow::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaSynchronizationWindowPubSubType::CarlaSynchronizationWindowPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaSynchronizationWindow_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaSynchronizationWindow::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaSynchronizationWindow_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaSynchronizationWindowPubSubType::~CarlaSynchronizationWindowPubSubType() +{ +} + +bool CarlaSynchronizationWindowPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaSynchronizationWindow* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaSynchronizationWindowPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaSynchronizationWindow* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaSynchronizationWindowPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaSynchronizationWindowPubSubType::createData() +{ + return reinterpret_cast(new CarlaSynchronizationWindow()); +} + +void CarlaSynchronizationWindowPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaSynchronizationWindowPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h index 450288b0418..c9ffdf1081c 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaSynchronizationWindowPubSubTypes.h @@ -16,92 +16,120 @@ * @file CarlaSynchronizationWindowPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaSynchronizationWindow.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaSynchronizationWindow is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaSynchronizationWindow defined by the user in the IDL file. + * @ingroup CarlaSynchronizationWindow + */ +class CarlaSynchronizationWindowPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaSynchronizationWindow defined by the user in the IDL file. - * @ingroup CARLASYNCHRONIZATIONWINDOW - */ - class CarlaSynchronizationWindowPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaSynchronizationWindow type; + typedef CarlaSynchronizationWindow type; - eProsima_user_DllExport CarlaSynchronizationWindowPubSubType(); + eProsima_user_DllExport CarlaSynchronizationWindowPubSubType(); - eProsima_user_DllExport virtual ~CarlaSynchronizationWindowPubSubType(); + eProsima_user_DllExport ~CarlaSynchronizationWindowPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaSynchronizationWindow(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLASYNCHRONIZATIONWINDOW_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.cxx index 843647e1e29..884c77e172a 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaTrafficLightInfo.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaTrafficLightInfo.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaTrafficLightInfo::CarlaTrafficLightInfo() -{ - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f8e8894 - m_id = 0; - // m_transform com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3cfdd820 - // m_trigger_volume com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@928763c +namespace carla_msgs { +namespace msg { -} -carla_msgs::msg::CarlaTrafficLightInfo::~CarlaTrafficLightInfo() -{ +CarlaTrafficLightInfo::CarlaTrafficLightInfo() +{ +} +CarlaTrafficLightInfo::~CarlaTrafficLightInfo() +{ } -carla_msgs::msg::CarlaTrafficLightInfo::CarlaTrafficLightInfo( +CarlaTrafficLightInfo::CarlaTrafficLightInfo( const CarlaTrafficLightInfo& x) { m_id = x.m_id; @@ -59,105 +59,53 @@ carla_msgs::msg::CarlaTrafficLightInfo::CarlaTrafficLightInfo( m_trigger_volume = x.m_trigger_volume; } -carla_msgs::msg::CarlaTrafficLightInfo::CarlaTrafficLightInfo( - CarlaTrafficLightInfo&& x) +CarlaTrafficLightInfo::CarlaTrafficLightInfo( + CarlaTrafficLightInfo&& x) noexcept { m_id = x.m_id; m_transform = std::move(x.m_transform); m_trigger_volume = std::move(x.m_trigger_volume); } -carla_msgs::msg::CarlaTrafficLightInfo& carla_msgs::msg::CarlaTrafficLightInfo::operator =( +CarlaTrafficLightInfo& CarlaTrafficLightInfo::operator =( const CarlaTrafficLightInfo& x) { m_id = x.m_id; m_transform = x.m_transform; m_trigger_volume = x.m_trigger_volume; - return *this; } -carla_msgs::msg::CarlaTrafficLightInfo& carla_msgs::msg::CarlaTrafficLightInfo::operator =( - CarlaTrafficLightInfo&& x) +CarlaTrafficLightInfo& CarlaTrafficLightInfo::operator =( + CarlaTrafficLightInfo&& x) noexcept { m_id = x.m_id; m_transform = std::move(x.m_transform); m_trigger_volume = std::move(x.m_trigger_volume); - return *this; } -bool carla_msgs::msg::CarlaTrafficLightInfo::operator ==( +bool CarlaTrafficLightInfo::operator ==( const CarlaTrafficLightInfo& x) const { - - return (m_id == x.m_id && m_transform == x.m_transform && m_trigger_volume == x.m_trigger_volume); + return (m_id == x.m_id && + m_transform == x.m_transform && + m_trigger_volume == x.m_trigger_volume); } -bool carla_msgs::msg::CarlaTrafficLightInfo::operator !=( +bool CarlaTrafficLightInfo::operator !=( const CarlaTrafficLightInfo& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaTrafficLightInfo::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Pose::getMaxCdrSerializedSize(current_alignment); - current_alignment += carla_msgs::msg::CarlaBoundingBox::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaTrafficLightInfo::getCdrSerializedSize( - const carla_msgs::msg::CarlaTrafficLightInfo& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.transform(), current_alignment); - current_alignment += carla_msgs::msg::CarlaBoundingBox::getCdrSerializedSize(data.trigger_volume(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaTrafficLightInfo::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_id; - scdr << m_transform; - scdr << m_trigger_volume; - -} - -void carla_msgs::msg::CarlaTrafficLightInfo::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_id; - dcdr >> m_transform; - dcdr >> m_trigger_volume; -} - /*! * @brief This function sets a value in member id * @param _id New value for member id */ -void carla_msgs::msg::CarlaTrafficLightInfo::id( +void CarlaTrafficLightInfo::id( uint32_t _id) { m_id = _id; @@ -167,7 +115,7 @@ void carla_msgs::msg::CarlaTrafficLightInfo::id( * @brief This function returns the value of member id * @return Value of member id */ -uint32_t carla_msgs::msg::CarlaTrafficLightInfo::id() const +uint32_t CarlaTrafficLightInfo::id() const { return m_id; } @@ -176,16 +124,17 @@ uint32_t carla_msgs::msg::CarlaTrafficLightInfo::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -uint32_t& carla_msgs::msg::CarlaTrafficLightInfo::id() +uint32_t& CarlaTrafficLightInfo::id() { return m_id; } + /*! * @brief This function copies the value in member transform * @param _transform New value to be copied in member transform */ -void carla_msgs::msg::CarlaTrafficLightInfo::transform( +void CarlaTrafficLightInfo::transform( const geometry_msgs::msg::Pose& _transform) { m_transform = _transform; @@ -195,7 +144,7 @@ void carla_msgs::msg::CarlaTrafficLightInfo::transform( * @brief This function moves the value in member transform * @param _transform New value to be moved in member transform */ -void carla_msgs::msg::CarlaTrafficLightInfo::transform( +void CarlaTrafficLightInfo::transform( geometry_msgs::msg::Pose&& _transform) { m_transform = std::move(_transform); @@ -205,7 +154,7 @@ void carla_msgs::msg::CarlaTrafficLightInfo::transform( * @brief This function returns a constant reference to member transform * @return Constant reference to member transform */ -const geometry_msgs::msg::Pose& carla_msgs::msg::CarlaTrafficLightInfo::transform() const +const geometry_msgs::msg::Pose& CarlaTrafficLightInfo::transform() const { return m_transform; } @@ -214,15 +163,17 @@ const geometry_msgs::msg::Pose& carla_msgs::msg::CarlaTrafficLightInfo::transfor * @brief This function returns a reference to member transform * @return Reference to member transform */ -geometry_msgs::msg::Pose& carla_msgs::msg::CarlaTrafficLightInfo::transform() +geometry_msgs::msg::Pose& CarlaTrafficLightInfo::transform() { return m_transform; } + + /*! * @brief This function copies the value in member trigger_volume * @param _trigger_volume New value to be copied in member trigger_volume */ -void carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume( +void CarlaTrafficLightInfo::trigger_volume( const carla_msgs::msg::CarlaBoundingBox& _trigger_volume) { m_trigger_volume = _trigger_volume; @@ -232,7 +183,7 @@ void carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume( * @brief This function moves the value in member trigger_volume * @param _trigger_volume New value to be moved in member trigger_volume */ -void carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume( +void CarlaTrafficLightInfo::trigger_volume( carla_msgs::msg::CarlaBoundingBox&& _trigger_volume) { m_trigger_volume = std::move(_trigger_volume); @@ -242,7 +193,7 @@ void carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume( * @brief This function returns a constant reference to member trigger_volume * @return Constant reference to member trigger_volume */ -const carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume() const +const carla_msgs::msg::CarlaBoundingBox& CarlaTrafficLightInfo::trigger_volume() const { return m_trigger_volume; } @@ -251,31 +202,18 @@ const carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaTrafficLightInfo: * @brief This function returns a reference to member trigger_volume * @return Reference to member trigger_volume */ -carla_msgs::msg::CarlaBoundingBox& carla_msgs::msg::CarlaTrafficLightInfo::trigger_volume() +carla_msgs::msg::CarlaBoundingBox& CarlaTrafficLightInfo::trigger_volume() { return m_trigger_volume; } -size_t carla_msgs::msg::CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool carla_msgs::msg::CarlaTrafficLightInfo::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaTrafficLightInfo::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaTrafficLightInfoCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.h index 79a8363dc7a..4c7b34aee07 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfo.h @@ -16,21 +16,26 @@ * @file CarlaTrafficLightInfo.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_H_ -#include "carla_msgs/msg/CarlaBoundingBox.h" -#include "geometry_msgs/msg/Pose.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaBoundingBox.h" +#include "geometry_msgs/msg/Pose.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,221 +49,179 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaTrafficLightInfo_SOURCE) -#define CarlaTrafficLightInfo_DllAPI __declspec( dllexport ) +#if defined(CARLATRAFFICLIGHTINFO_SOURCE) +#define CARLATRAFFICLIGHTINFO_DllAPI __declspec( dllexport ) #else -#define CarlaTrafficLightInfo_DllAPI __declspec( dllimport ) -#endif // CarlaTrafficLightInfo_SOURCE +#define CARLATRAFFICLIGHTINFO_DllAPI __declspec( dllimport ) +#endif // CARLATRAFFICLIGHTINFO_SOURCE #else -#define CarlaTrafficLightInfo_DllAPI +#define CARLATRAFFICLIGHTINFO_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaTrafficLightInfo_DllAPI +#define CARLATRAFFICLIGHTINFO_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaTrafficLightInfo defined by the user in the IDL file. - * @ingroup CARLATRAFFICLIGHTINFO - */ - class CarlaTrafficLightInfo - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaTrafficLightInfo(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaTrafficLightInfo(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightInfo( - const CarlaTrafficLightInfo& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightInfo( - CarlaTrafficLightInfo&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightInfo& operator =( - const CarlaTrafficLightInfo& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightInfo& operator =( - CarlaTrafficLightInfo&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaTrafficLightInfo object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaTrafficLightInfo& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaTrafficLightInfo object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaTrafficLightInfo& x) const; - - /*! - * @brief This function sets a value in member id - * @param _id New value for member id - */ - eProsima_user_DllExport void id( - uint32_t _id); - - /*! - * @brief This function returns the value of member id - * @return Value of member id - */ - eProsima_user_DllExport uint32_t id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport uint32_t& id(); - - /*! - * @brief This function copies the value in member transform - * @param _transform New value to be copied in member transform - */ - eProsima_user_DllExport void transform( - const geometry_msgs::msg::Pose& _transform); - - /*! - * @brief This function moves the value in member transform - * @param _transform New value to be moved in member transform - */ - eProsima_user_DllExport void transform( - geometry_msgs::msg::Pose&& _transform); - - /*! - * @brief This function returns a constant reference to member transform - * @return Constant reference to member transform - */ - eProsima_user_DllExport const geometry_msgs::msg::Pose& transform() const; - - /*! - * @brief This function returns a reference to member transform - * @return Reference to member transform - */ - eProsima_user_DllExport geometry_msgs::msg::Pose& transform(); - /*! - * @brief This function copies the value in member trigger_volume - * @param _trigger_volume New value to be copied in member trigger_volume - */ - eProsima_user_DllExport void trigger_volume( - const carla_msgs::msg::CarlaBoundingBox& _trigger_volume); - - /*! - * @brief This function moves the value in member trigger_volume - * @param _trigger_volume New value to be moved in member trigger_volume - */ - eProsima_user_DllExport void trigger_volume( - carla_msgs::msg::CarlaBoundingBox&& _trigger_volume); - - /*! - * @brief This function returns a constant reference to member trigger_volume - * @return Constant reference to member trigger_volume - */ - eProsima_user_DllExport const carla_msgs::msg::CarlaBoundingBox& trigger_volume() const; - - /*! - * @brief This function returns a reference to member trigger_volume - * @return Reference to member trigger_volume - */ - eProsima_user_DllExport carla_msgs::msg::CarlaBoundingBox& trigger_volume(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaTrafficLightInfo& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint32_t m_id; - geometry_msgs::msg::Pose m_transform; - carla_msgs::msg::CarlaBoundingBox m_trigger_volume; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaTrafficLightInfo defined by the user in the IDL file. + * @ingroup CarlaTrafficLightInfo + */ +class CarlaTrafficLightInfo +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaTrafficLightInfo(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaTrafficLightInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfo( + const CarlaTrafficLightInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfo( + CarlaTrafficLightInfo&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfo& operator =( + const CarlaTrafficLightInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfo that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfo& operator =( + CarlaTrafficLightInfo&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaTrafficLightInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaTrafficLightInfo& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + + /*! + * @brief This function copies the value in member transform + * @param _transform New value to be copied in member transform + */ + eProsima_user_DllExport void transform( + const geometry_msgs::msg::Pose& _transform); + + /*! + * @brief This function moves the value in member transform + * @param _transform New value to be moved in member transform + */ + eProsima_user_DllExport void transform( + geometry_msgs::msg::Pose&& _transform); + + /*! + * @brief This function returns a constant reference to member transform + * @return Constant reference to member transform + */ + eProsima_user_DllExport const geometry_msgs::msg::Pose& transform() const; + + /*! + * @brief This function returns a reference to member transform + * @return Reference to member transform + */ + eProsima_user_DllExport geometry_msgs::msg::Pose& transform(); + + + /*! + * @brief This function copies the value in member trigger_volume + * @param _trigger_volume New value to be copied in member trigger_volume + */ + eProsima_user_DllExport void trigger_volume( + const carla_msgs::msg::CarlaBoundingBox& _trigger_volume); + + /*! + * @brief This function moves the value in member trigger_volume + * @param _trigger_volume New value to be moved in member trigger_volume + */ + eProsima_user_DllExport void trigger_volume( + carla_msgs::msg::CarlaBoundingBox&& _trigger_volume); + + /*! + * @brief This function returns a constant reference to member trigger_volume + * @return Constant reference to member trigger_volume + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaBoundingBox& trigger_volume() const; + + /*! + * @brief This function returns a reference to member trigger_volume + * @return Reference to member trigger_volume + */ + eProsima_user_DllExport carla_msgs::msg::CarlaBoundingBox& trigger_volume(); + +private: + + uint32_t m_id{0}; + geometry_msgs::msg::Pose m_transform; + carla_msgs::msg::CarlaBoundingBox m_trigger_volume; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoCdrAux.hpp new file mode 100644 index 00000000000..0ecece2a533 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOCDRAUX_HPP_ + +#include "CarlaTrafficLightInfo.h" + +constexpr uint32_t carla_msgs_msg_CarlaTrafficLightInfo_max_cdr_typesize {144UL}; +constexpr uint32_t carla_msgs_msg_CarlaTrafficLightInfo_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightInfo& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoCdrAux.ipp new file mode 100644 index 00000000000..235e3304223 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOCDRAUX_IPP_ + +#include "CarlaTrafficLightInfoCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaTrafficLightInfo& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.transform(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.trigger_volume(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightInfo& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.id() + << eprosima::fastcdr::MemberId(1) << data.transform() + << eprosima::fastcdr::MemberId(2) << data.trigger_volume() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaTrafficLightInfo& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.id(); + break; + + case 1: + dcdr >> data.transform(); + break; + + case 2: + dcdr >> data.trigger_volume(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightInfo& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.cxx index 1880ab1b645..377afff7791 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaTrafficLightInfoList.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,77 @@ char dummy; #endif // _WIN32 #include "CarlaTrafficLightInfoList.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaTrafficLightInfoList::CarlaTrafficLightInfoList() -{ - // m_traffic_lights com.eprosima.idl.parser.typecode.SequenceTypeCode@7ba8c737 + +namespace carla_msgs { + +namespace msg { + + + +CarlaTrafficLightInfoList::CarlaTrafficLightInfoList() +{ } -carla_msgs::msg::CarlaTrafficLightInfoList::~CarlaTrafficLightInfoList() +CarlaTrafficLightInfoList::~CarlaTrafficLightInfoList() { } -carla_msgs::msg::CarlaTrafficLightInfoList::CarlaTrafficLightInfoList( +CarlaTrafficLightInfoList::CarlaTrafficLightInfoList( const CarlaTrafficLightInfoList& x) { m_traffic_lights = x.m_traffic_lights; } -carla_msgs::msg::CarlaTrafficLightInfoList::CarlaTrafficLightInfoList( - CarlaTrafficLightInfoList&& x) +CarlaTrafficLightInfoList::CarlaTrafficLightInfoList( + CarlaTrafficLightInfoList&& x) noexcept { m_traffic_lights = std::move(x.m_traffic_lights); } -carla_msgs::msg::CarlaTrafficLightInfoList& carla_msgs::msg::CarlaTrafficLightInfoList::operator =( +CarlaTrafficLightInfoList& CarlaTrafficLightInfoList::operator =( const CarlaTrafficLightInfoList& x) { m_traffic_lights = x.m_traffic_lights; - return *this; } -carla_msgs::msg::CarlaTrafficLightInfoList& carla_msgs::msg::CarlaTrafficLightInfoList::operator =( - CarlaTrafficLightInfoList&& x) +CarlaTrafficLightInfoList& CarlaTrafficLightInfoList::operator =( + CarlaTrafficLightInfoList&& x) noexcept { m_traffic_lights = std::move(x.m_traffic_lights); - return *this; } -bool carla_msgs::msg::CarlaTrafficLightInfoList::operator ==( +bool CarlaTrafficLightInfoList::operator ==( const CarlaTrafficLightInfoList& x) const { - return (m_traffic_lights == x.m_traffic_lights); } -bool carla_msgs::msg::CarlaTrafficLightInfoList::operator !=( +bool CarlaTrafficLightInfoList::operator !=( const CarlaTrafficLightInfoList& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaTrafficLightInfoList::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaTrafficLightInfo::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaTrafficLightInfoList::getCdrSerializedSize( - const carla_msgs::msg::CarlaTrafficLightInfoList& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.traffic_lights().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaTrafficLightInfo::getCdrSerializedSize(data.traffic_lights().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaTrafficLightInfoList::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_traffic_lights; -} - -void carla_msgs::msg::CarlaTrafficLightInfoList::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_traffic_lights;} - /*! * @brief This function copies the value in member traffic_lights * @param _traffic_lights New value to be copied in member traffic_lights */ -void carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights( +void CarlaTrafficLightInfoList::traffic_lights( const std::vector& _traffic_lights) { m_traffic_lights = _traffic_lights; @@ -149,7 +107,7 @@ void carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights( * @brief This function moves the value in member traffic_lights * @param _traffic_lights New value to be moved in member traffic_lights */ -void carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights( +void CarlaTrafficLightInfoList::traffic_lights( std::vector&& _traffic_lights) { m_traffic_lights = std::move(_traffic_lights); @@ -159,7 +117,7 @@ void carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights( * @brief This function returns a constant reference to member traffic_lights * @return Constant reference to member traffic_lights */ -const std::vector& carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights() const +const std::vector& CarlaTrafficLightInfoList::traffic_lights() const { return m_traffic_lights; } @@ -168,31 +126,18 @@ const std::vector& carla_msgs::msg::Carl * @brief This function returns a reference to member traffic_lights * @return Reference to member traffic_lights */ -std::vector& carla_msgs::msg::CarlaTrafficLightInfoList::traffic_lights() +std::vector& CarlaTrafficLightInfoList::traffic_lights() { return m_traffic_lights; } -size_t carla_msgs::msg::CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaTrafficLightInfoList::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaTrafficLightInfoList::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaTrafficLightInfoListCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.h index 60700da478b..9970f7d0ba0 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoList.h @@ -16,20 +16,25 @@ * @file CarlaTrafficLightInfoList.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_H_ -#include "carla_msgs/msg/CarlaTrafficLightInfo.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaTrafficLightInfo.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaTrafficLightInfoList_SOURCE) -#define CarlaTrafficLightInfoList_DllAPI __declspec( dllexport ) +#if defined(CARLATRAFFICLIGHTINFOLIST_SOURCE) +#define CARLATRAFFICLIGHTINFOLIST_DllAPI __declspec( dllexport ) #else -#define CarlaTrafficLightInfoList_DllAPI __declspec( dllimport ) -#endif // CarlaTrafficLightInfoList_SOURCE +#define CARLATRAFFICLIGHTINFOLIST_DllAPI __declspec( dllimport ) +#endif // CARLATRAFFICLIGHTINFOLIST_SOURCE #else -#define CarlaTrafficLightInfoList_DllAPI +#define CARLATRAFFICLIGHTINFOLIST_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaTrafficLightInfoList_DllAPI +#define CARLATRAFFICLIGHTINFOLIST_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaTrafficLightInfoList defined by the user in the IDL file. - * @ingroup CARLATRAFFICLIGHTINFOLIST - */ - class CarlaTrafficLightInfoList - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaTrafficLightInfoList(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaTrafficLightInfoList(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightInfoList( - const CarlaTrafficLightInfoList& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightInfoList( - CarlaTrafficLightInfoList&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightInfoList& operator =( - const CarlaTrafficLightInfoList& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightInfoList& operator =( - CarlaTrafficLightInfoList&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaTrafficLightInfoList object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaTrafficLightInfoList& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaTrafficLightInfoList object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaTrafficLightInfoList& x) const; - - /*! - * @brief This function copies the value in member traffic_lights - * @param _traffic_lights New value to be copied in member traffic_lights - */ - eProsima_user_DllExport void traffic_lights( - const std::vector& _traffic_lights); - - /*! - * @brief This function moves the value in member traffic_lights - * @param _traffic_lights New value to be moved in member traffic_lights - */ - eProsima_user_DllExport void traffic_lights( - std::vector&& _traffic_lights); - - /*! - * @brief This function returns a constant reference to member traffic_lights - * @return Constant reference to member traffic_lights - */ - eProsima_user_DllExport const std::vector& traffic_lights() const; - - /*! - * @brief This function returns a reference to member traffic_lights - * @return Reference to member traffic_lights - */ - eProsima_user_DllExport std::vector& traffic_lights(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaTrafficLightInfoList& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_traffic_lights; - }; - } // namespace msg + +namespace msg { + + + + + +/*! + * @brief This class represents the structure CarlaTrafficLightInfoList defined by the user in the IDL file. + * @ingroup CarlaTrafficLightInfoList + */ +class CarlaTrafficLightInfoList +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaTrafficLightInfoList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList( + const CarlaTrafficLightInfoList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList( + CarlaTrafficLightInfoList&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList& operator =( + const CarlaTrafficLightInfoList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightInfoList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightInfoList& operator =( + CarlaTrafficLightInfoList&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightInfoList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaTrafficLightInfoList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightInfoList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaTrafficLightInfoList& x) const; + + /*! + * @brief This function copies the value in member traffic_lights + * @param _traffic_lights New value to be copied in member traffic_lights + */ + eProsima_user_DllExport void traffic_lights( + const std::vector& _traffic_lights); + + /*! + * @brief This function moves the value in member traffic_lights + * @param _traffic_lights New value to be moved in member traffic_lights + */ + eProsima_user_DllExport void traffic_lights( + std::vector&& _traffic_lights); + + /*! + * @brief This function returns a constant reference to member traffic_lights + * @return Constant reference to member traffic_lights + */ + eProsima_user_DllExport const std::vector& traffic_lights() const; + + /*! + * @brief This function returns a reference to member traffic_lights + * @return Reference to member traffic_lights + */ + eProsima_user_DllExport std::vector& traffic_lights(); + +private: + + std::vector m_traffic_lights; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListCdrAux.hpp new file mode 100644 index 00000000000..d270b57bf87 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListCdrAux.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoListCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLISTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLISTCDRAUX_HPP_ + +#include "CarlaTrafficLightInfoList.h" + +constexpr uint32_t carla_msgs_msg_CarlaTrafficLightInfoList_max_cdr_typesize {14416UL}; +constexpr uint32_t carla_msgs_msg_CarlaTrafficLightInfoList_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightInfoList& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLISTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListCdrAux.ipp new file mode 100644 index 00000000000..901821e32e4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListCdrAux.ipp @@ -0,0 +1,132 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightInfoListCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLISTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLISTCDRAUX_IPP_ + +#include "CarlaTrafficLightInfoListCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaTrafficLightInfoList& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.traffic_lights(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightInfoList& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.traffic_lights() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaTrafficLightInfoList& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.traffic_lights(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightInfoList& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLISTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.cxx index c2ac4109ae0..cc1be3971c4 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file CarlaTrafficLightInfoListPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaTrafficLightInfoListPubSubTypes.h" +#include "CarlaTrafficLightInfoListCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaTrafficLightInfoListPubSubType::CarlaTrafficLightInfoListPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaTrafficLightInfoList_"); - auto type_size = CarlaTrafficLightInfoList::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaTrafficLightInfoList::isKeyDefined(); - size_t keyLength = CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize() > 16 ? - CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaTrafficLightInfoListPubSubType::~CarlaTrafficLightInfoListPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaTrafficLightInfoListPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaTrafficLightInfoList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaTrafficLightInfoListPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaTrafficLightInfoList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaTrafficLightInfoListPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaTrafficLightInfoListPubSubType::createData() - { - return reinterpret_cast(new CarlaTrafficLightInfoList()); - } - - void CarlaTrafficLightInfoListPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaTrafficLightInfoListPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaTrafficLightInfoList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaTrafficLightInfoList::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +CarlaTrafficLightInfoListPubSubType::CarlaTrafficLightInfoListPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaTrafficLightInfoList_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaTrafficLightInfoList::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaTrafficLightInfoList_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaTrafficLightInfoListPubSubType::~CarlaTrafficLightInfoListPubSubType() +{ +} + +bool CarlaTrafficLightInfoListPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaTrafficLightInfoList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaTrafficLightInfoListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaTrafficLightInfoList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaTrafficLightInfoListPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaTrafficLightInfoListPubSubType::createData() +{ + return reinterpret_cast(new CarlaTrafficLightInfoList()); +} + +void CarlaTrafficLightInfoListPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaTrafficLightInfoListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h index e6b2ebe2ca6..bcb2c282436 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h @@ -16,92 +16,123 @@ * @file CarlaTrafficLightInfoListPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaTrafficLightInfoList.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaTrafficLightInfoPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaTrafficLightInfoList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaTrafficLightInfoList defined by the user in the IDL file. + * @ingroup CarlaTrafficLightInfoList + */ +class CarlaTrafficLightInfoListPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaTrafficLightInfoList defined by the user in the IDL file. - * @ingroup CARLATRAFFICLIGHTINFOLIST - */ - class CarlaTrafficLightInfoListPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaTrafficLightInfoList type; + typedef CarlaTrafficLightInfoList type; - eProsima_user_DllExport CarlaTrafficLightInfoListPubSubType(); + eProsima_user_DllExport CarlaTrafficLightInfoListPubSubType(); - eProsima_user_DllExport virtual ~CarlaTrafficLightInfoListPubSubType(); + eProsima_user_DllExport ~CarlaTrafficLightInfoListPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFOLIST_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.cxx index d371004b517..ab684ccba26 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaTrafficLightInfoPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaTrafficLightInfoPubSubTypes.h" +#include "CarlaTrafficLightInfoCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaTrafficLightInfoPubSubType::CarlaTrafficLightInfoPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaTrafficLightInfo_"); - auto type_size = CarlaTrafficLightInfo::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaTrafficLightInfo::isKeyDefined(); - size_t keyLength = CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize() > 16 ? - CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaTrafficLightInfoPubSubType::~CarlaTrafficLightInfoPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaTrafficLightInfoPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaTrafficLightInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaTrafficLightInfoPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaTrafficLightInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaTrafficLightInfoPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaTrafficLightInfoPubSubType::createData() - { - return reinterpret_cast(new CarlaTrafficLightInfo()); - } - - void CarlaTrafficLightInfoPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaTrafficLightInfoPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaTrafficLightInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaTrafficLightInfo::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaTrafficLightInfoPubSubType::CarlaTrafficLightInfoPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaTrafficLightInfo_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaTrafficLightInfo::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaTrafficLightInfo_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaTrafficLightInfoPubSubType::~CarlaTrafficLightInfoPubSubType() +{ +} + +bool CarlaTrafficLightInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaTrafficLightInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaTrafficLightInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaTrafficLightInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaTrafficLightInfoPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaTrafficLightInfoPubSubType::createData() +{ + return reinterpret_cast(new CarlaTrafficLightInfo()); +} + +void CarlaTrafficLightInfoPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaTrafficLightInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h index 8bbaff04a96..fc2c3697bee 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightInfoPubSubTypes.h @@ -16,92 +16,122 @@ * @file CarlaTrafficLightInfoPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaTrafficLightInfo.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaBoundingBoxPubSubTypes.h" +#include "geometry_msgs/msg/PosePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaTrafficLightInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaTrafficLightInfo defined by the user in the IDL file. + * @ingroup CarlaTrafficLightInfo + */ +class CarlaTrafficLightInfoPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaTrafficLightInfo defined by the user in the IDL file. - * @ingroup CARLATRAFFICLIGHTINFO - */ - class CarlaTrafficLightInfoPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaTrafficLightInfo type; + typedef CarlaTrafficLightInfo type; - eProsima_user_DllExport CarlaTrafficLightInfoPubSubType(); + eProsima_user_DllExport CarlaTrafficLightInfoPubSubType(); - eProsima_user_DllExport virtual ~CarlaTrafficLightInfoPubSubType(); + eProsima_user_DllExport ~CarlaTrafficLightInfoPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaTrafficLightInfo(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTINFO_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.cxx index 0477dd03897..d4b21c7ae6f 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaTrafficLightStatus.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,37 +27,35 @@ char dummy; #endif // _WIN32 #include "CarlaTrafficLightStatus.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace carla_msgs { +namespace msg { +namespace CarlaTrafficLightStatus_Constants { +} // namespace CarlaTrafficLightStatus_Constants -carla_msgs::msg::CarlaTrafficLightStatus::CarlaTrafficLightStatus() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@37911f88 - - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f1c29b7 - m_id = 0; - // m_state com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4d6025c5 - m_state = 0; +CarlaTrafficLightStatus::CarlaTrafficLightStatus() +{ } -carla_msgs::msg::CarlaTrafficLightStatus::~CarlaTrafficLightStatus() +CarlaTrafficLightStatus::~CarlaTrafficLightStatus() { - - } -carla_msgs::msg::CarlaTrafficLightStatus::CarlaTrafficLightStatus( +CarlaTrafficLightStatus::CarlaTrafficLightStatus( const CarlaTrafficLightStatus& x) { m_header = x.m_header; @@ -65,109 +63,53 @@ carla_msgs::msg::CarlaTrafficLightStatus::CarlaTrafficLightStatus( m_state = x.m_state; } -carla_msgs::msg::CarlaTrafficLightStatus::CarlaTrafficLightStatus( - CarlaTrafficLightStatus&& x) +CarlaTrafficLightStatus::CarlaTrafficLightStatus( + CarlaTrafficLightStatus&& x) noexcept { m_header = std::move(x.m_header); m_id = x.m_id; m_state = x.m_state; } -carla_msgs::msg::CarlaTrafficLightStatus& carla_msgs::msg::CarlaTrafficLightStatus::operator =( +CarlaTrafficLightStatus& CarlaTrafficLightStatus::operator =( const CarlaTrafficLightStatus& x) { m_header = x.m_header; m_id = x.m_id; m_state = x.m_state; - return *this; } -carla_msgs::msg::CarlaTrafficLightStatus& carla_msgs::msg::CarlaTrafficLightStatus::operator =( - CarlaTrafficLightStatus&& x) +CarlaTrafficLightStatus& CarlaTrafficLightStatus::operator =( + CarlaTrafficLightStatus&& x) noexcept { m_header = std::move(x.m_header); m_id = x.m_id; m_state = x.m_state; - return *this; } -bool carla_msgs::msg::CarlaTrafficLightStatus::operator ==( +bool CarlaTrafficLightStatus::operator ==( const CarlaTrafficLightStatus& x) const { - - return (m_header == x.m_header && m_id == x.m_id && m_state == x.m_state); + return (m_header == x.m_header && + m_id == x.m_id && + m_state == x.m_state); } -bool carla_msgs::msg::CarlaTrafficLightStatus::operator !=( +bool CarlaTrafficLightStatus::operator !=( const CarlaTrafficLightStatus& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaTrafficLightStatus::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaTrafficLightStatus::getCdrSerializedSize( - const carla_msgs::msg::CarlaTrafficLightStatus& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaTrafficLightStatus::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_id; - scdr << m_state; - -} - -void carla_msgs::msg::CarlaTrafficLightStatus::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_id; - dcdr >> m_state; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaTrafficLightStatus::header( +void CarlaTrafficLightStatus::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -177,7 +119,7 @@ void carla_msgs::msg::CarlaTrafficLightStatus::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaTrafficLightStatus::header( +void CarlaTrafficLightStatus::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -187,7 +129,7 @@ void carla_msgs::msg::CarlaTrafficLightStatus::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& carla_msgs::msg::CarlaTrafficLightStatus::header() const +const std_msgs::msg::Header& CarlaTrafficLightStatus::header() const { return m_header; } @@ -196,15 +138,17 @@ const std_msgs::msg::Header& carla_msgs::msg::CarlaTrafficLightStatus::header() * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& carla_msgs::msg::CarlaTrafficLightStatus::header() +std_msgs::msg::Header& CarlaTrafficLightStatus::header() { return m_header; } + + /*! * @brief This function sets a value in member id * @param _id New value for member id */ -void carla_msgs::msg::CarlaTrafficLightStatus::id( +void CarlaTrafficLightStatus::id( uint32_t _id) { m_id = _id; @@ -214,7 +158,7 @@ void carla_msgs::msg::CarlaTrafficLightStatus::id( * @brief This function returns the value of member id * @return Value of member id */ -uint32_t carla_msgs::msg::CarlaTrafficLightStatus::id() const +uint32_t CarlaTrafficLightStatus::id() const { return m_id; } @@ -223,16 +167,17 @@ uint32_t carla_msgs::msg::CarlaTrafficLightStatus::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -uint32_t& carla_msgs::msg::CarlaTrafficLightStatus::id() +uint32_t& CarlaTrafficLightStatus::id() { return m_id; } + /*! * @brief This function sets a value in member state * @param _state New value for member state */ -void carla_msgs::msg::CarlaTrafficLightStatus::state( +void CarlaTrafficLightStatus::state( uint8_t _state) { m_state = _state; @@ -242,7 +187,7 @@ void carla_msgs::msg::CarlaTrafficLightStatus::state( * @brief This function returns the value of member state * @return Value of member state */ -uint8_t carla_msgs::msg::CarlaTrafficLightStatus::state() const +uint8_t CarlaTrafficLightStatus::state() const { return m_state; } @@ -251,32 +196,18 @@ uint8_t carla_msgs::msg::CarlaTrafficLightStatus::state() const * @brief This function returns a reference to member state * @return Reference to member state */ -uint8_t& carla_msgs::msg::CarlaTrafficLightStatus::state() +uint8_t& CarlaTrafficLightStatus::state() { return m_state; } -size_t carla_msgs::msg::CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool carla_msgs::msg::CarlaTrafficLightStatus::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaTrafficLightStatus::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaTrafficLightStatusCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.h index c96d050333c..24659ad6e31 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatus.h @@ -16,20 +16,25 @@ * @file CarlaTrafficLightStatus.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_H_ -#include "std_msgs/msg/Header.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "std_msgs/msg/Header.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,222 +48,181 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaTrafficLightStatus_SOURCE) -#define CarlaTrafficLightStatus_DllAPI __declspec( dllexport ) +#if defined(CARLATRAFFICLIGHTSTATUS_SOURCE) +#define CARLATRAFFICLIGHTSTATUS_DllAPI __declspec( dllexport ) #else -#define CarlaTrafficLightStatus_DllAPI __declspec( dllimport ) -#endif // CarlaTrafficLightStatus_SOURCE +#define CARLATRAFFICLIGHTSTATUS_DllAPI __declspec( dllimport ) +#endif // CARLATRAFFICLIGHTSTATUS_SOURCE #else -#define CarlaTrafficLightStatus_DllAPI +#define CARLATRAFFICLIGHTSTATUS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaTrafficLightStatus_DllAPI +#define CARLATRAFFICLIGHTSTATUS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - namespace CarlaTrafficLightStatus_Constants { - const uint8_t RED = 0; - const uint8_t YELLOW = 1; - const uint8_t GREEN = 2; - const uint8_t OFF = 3; - const uint8_t UNKNOWN = 4; - } // namespace CarlaTrafficLightStatus_Constants - /*! - * @brief This class represents the structure CarlaTrafficLightStatus defined by the user in the IDL file. - * @ingroup CARLATRAFFICLIGHTSTATUS - */ - class CarlaTrafficLightStatus - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaTrafficLightStatus(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaTrafficLightStatus(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightStatus( - const CarlaTrafficLightStatus& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightStatus( - CarlaTrafficLightStatus&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightStatus& operator =( - const CarlaTrafficLightStatus& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightStatus& operator =( - CarlaTrafficLightStatus&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaTrafficLightStatus object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaTrafficLightStatus& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaTrafficLightStatus object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaTrafficLightStatus& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member id - * @param _id New value for member id - */ - eProsima_user_DllExport void id( - uint32_t _id); - - /*! - * @brief This function returns the value of member id - * @return Value of member id - */ - eProsima_user_DllExport uint32_t id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport uint32_t& id(); - - /*! - * @brief This function sets a value in member state - * @param _state New value for member state - */ - eProsima_user_DllExport void state( - uint8_t _state); - - /*! - * @brief This function returns the value of member state - * @return Value of member state - */ - eProsima_user_DllExport uint8_t state() const; - - /*! - * @brief This function returns a reference to member state - * @return Reference to member state - */ - eProsima_user_DllExport uint8_t& state(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaTrafficLightStatus& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - uint32_t m_id; - uint8_t m_state; - }; - } // namespace msg + +namespace msg { + +namespace CarlaTrafficLightStatus_Constants { + +const uint8_t RED = 0; +const uint8_t YELLOW = 1; +const uint8_t GREEN = 2; +const uint8_t OFF = 3; +const uint8_t UNKNOWN = 4; + +} // namespace CarlaTrafficLightStatus_Constants + + +/*! + * @brief This class represents the structure CarlaTrafficLightStatus defined by the user in the IDL file. + * @ingroup CarlaTrafficLightStatus + */ +class CarlaTrafficLightStatus +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaTrafficLightStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaTrafficLightStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatus( + const CarlaTrafficLightStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatus( + CarlaTrafficLightStatus&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatus& operator =( + const CarlaTrafficLightStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatus that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatus& operator =( + CarlaTrafficLightStatus&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaTrafficLightStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaTrafficLightStatus& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + + /*! + * @brief This function sets a value in member state + * @param _state New value for member state + */ + eProsima_user_DllExport void state( + uint8_t _state); + + /*! + * @brief This function returns the value of member state + * @return Value of member state + */ + eProsima_user_DllExport uint8_t state() const; + + /*! + * @brief This function returns a reference to member state + * @return Reference to member state + */ + eProsima_user_DllExport uint8_t& state(); + +private: + + std_msgs::msg::Header m_header; + uint32_t m_id{0}; + uint8_t m_state{0}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusCdrAux.hpp new file mode 100644 index 00000000000..5fbbcbff3b0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusCdrAux.hpp @@ -0,0 +1,62 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSCDRAUX_HPP_ + +#include "CarlaTrafficLightStatus.h" + +constexpr uint32_t carla_msgs_msg_CarlaTrafficLightStatus_max_cdr_typesize {285UL}; +constexpr uint32_t carla_msgs_msg_CarlaTrafficLightStatus_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightStatus& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusCdrAux.ipp new file mode 100644 index 00000000000..2ee59cf9795 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusCdrAux.ipp @@ -0,0 +1,157 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSCDRAUX_IPP_ + +#include "CarlaTrafficLightStatusCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaTrafficLightStatus& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.state(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightStatus& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.id() + << eprosima::fastcdr::MemberId(2) << data.state() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaTrafficLightStatus& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.id(); + break; + + case 2: + dcdr >> data.state(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightStatus& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.cxx index d6d3b2c25cf..b0f85bb9aee 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaTrafficLightStatusList.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,77 @@ char dummy; #endif // _WIN32 #include "CarlaTrafficLightStatusList.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaTrafficLightStatusList::CarlaTrafficLightStatusList() -{ - // m_traffic_lights com.eprosima.idl.parser.typecode.SequenceTypeCode@5456afaa + +namespace carla_msgs { + +namespace msg { + + + +CarlaTrafficLightStatusList::CarlaTrafficLightStatusList() +{ } -carla_msgs::msg::CarlaTrafficLightStatusList::~CarlaTrafficLightStatusList() +CarlaTrafficLightStatusList::~CarlaTrafficLightStatusList() { } -carla_msgs::msg::CarlaTrafficLightStatusList::CarlaTrafficLightStatusList( +CarlaTrafficLightStatusList::CarlaTrafficLightStatusList( const CarlaTrafficLightStatusList& x) { m_traffic_lights = x.m_traffic_lights; } -carla_msgs::msg::CarlaTrafficLightStatusList::CarlaTrafficLightStatusList( - CarlaTrafficLightStatusList&& x) +CarlaTrafficLightStatusList::CarlaTrafficLightStatusList( + CarlaTrafficLightStatusList&& x) noexcept { m_traffic_lights = std::move(x.m_traffic_lights); } -carla_msgs::msg::CarlaTrafficLightStatusList& carla_msgs::msg::CarlaTrafficLightStatusList::operator =( +CarlaTrafficLightStatusList& CarlaTrafficLightStatusList::operator =( const CarlaTrafficLightStatusList& x) { m_traffic_lights = x.m_traffic_lights; - return *this; } -carla_msgs::msg::CarlaTrafficLightStatusList& carla_msgs::msg::CarlaTrafficLightStatusList::operator =( - CarlaTrafficLightStatusList&& x) +CarlaTrafficLightStatusList& CarlaTrafficLightStatusList::operator =( + CarlaTrafficLightStatusList&& x) noexcept { m_traffic_lights = std::move(x.m_traffic_lights); - return *this; } -bool carla_msgs::msg::CarlaTrafficLightStatusList::operator ==( +bool CarlaTrafficLightStatusList::operator ==( const CarlaTrafficLightStatusList& x) const { - return (m_traffic_lights == x.m_traffic_lights); } -bool carla_msgs::msg::CarlaTrafficLightStatusList::operator !=( +bool CarlaTrafficLightStatusList::operator !=( const CarlaTrafficLightStatusList& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaTrafficLightStatusList::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaTrafficLightStatus::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaTrafficLightStatusList::getCdrSerializedSize( - const carla_msgs::msg::CarlaTrafficLightStatusList& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.traffic_lights().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaTrafficLightStatus::getCdrSerializedSize(data.traffic_lights().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaTrafficLightStatusList::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_traffic_lights; -} - -void carla_msgs::msg::CarlaTrafficLightStatusList::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_traffic_lights;} - /*! * @brief This function copies the value in member traffic_lights * @param _traffic_lights New value to be copied in member traffic_lights */ -void carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights( +void CarlaTrafficLightStatusList::traffic_lights( const std::vector& _traffic_lights) { m_traffic_lights = _traffic_lights; @@ -149,7 +107,7 @@ void carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights( * @brief This function moves the value in member traffic_lights * @param _traffic_lights New value to be moved in member traffic_lights */ -void carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights( +void CarlaTrafficLightStatusList::traffic_lights( std::vector&& _traffic_lights) { m_traffic_lights = std::move(_traffic_lights); @@ -159,7 +117,7 @@ void carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights( * @brief This function returns a constant reference to member traffic_lights * @return Constant reference to member traffic_lights */ -const std::vector& carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights() const +const std::vector& CarlaTrafficLightStatusList::traffic_lights() const { return m_traffic_lights; } @@ -168,31 +126,18 @@ const std::vector& carla_msgs::msg::Ca * @brief This function returns a reference to member traffic_lights * @return Reference to member traffic_lights */ -std::vector& carla_msgs::msg::CarlaTrafficLightStatusList::traffic_lights() +std::vector& CarlaTrafficLightStatusList::traffic_lights() { return m_traffic_lights; } -size_t carla_msgs::msg::CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaTrafficLightStatusList::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaTrafficLightStatusList::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaTrafficLightStatusListCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.h index e1a44ccbdc8..e029ab64e35 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusList.h @@ -16,20 +16,25 @@ * @file CarlaTrafficLightStatusList.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_H_ -#include "carla_msgs/msg/CarlaTrafficLightStatus.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaTrafficLightStatus.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaTrafficLightStatusList_SOURCE) -#define CarlaTrafficLightStatusList_DllAPI __declspec( dllexport ) +#if defined(CARLATRAFFICLIGHTSTATUSLIST_SOURCE) +#define CARLATRAFFICLIGHTSTATUSLIST_DllAPI __declspec( dllexport ) #else -#define CarlaTrafficLightStatusList_DllAPI __declspec( dllimport ) -#endif // CarlaTrafficLightStatusList_SOURCE +#define CARLATRAFFICLIGHTSTATUSLIST_DllAPI __declspec( dllimport ) +#endif // CARLATRAFFICLIGHTSTATUSLIST_SOURCE #else -#define CarlaTrafficLightStatusList_DllAPI +#define CARLATRAFFICLIGHTSTATUSLIST_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaTrafficLightStatusList_DllAPI +#define CARLATRAFFICLIGHTSTATUSLIST_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaTrafficLightStatusList defined by the user in the IDL file. - * @ingroup CARLATRAFFICLIGHTSTATUSLIST - */ - class CarlaTrafficLightStatusList - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaTrafficLightStatusList(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaTrafficLightStatusList(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightStatusList( - const CarlaTrafficLightStatusList& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightStatusList( - CarlaTrafficLightStatusList&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightStatusList& operator =( - const CarlaTrafficLightStatusList& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. - */ - eProsima_user_DllExport CarlaTrafficLightStatusList& operator =( - CarlaTrafficLightStatusList&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaTrafficLightStatusList object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaTrafficLightStatusList& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaTrafficLightStatusList object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaTrafficLightStatusList& x) const; - - /*! - * @brief This function copies the value in member traffic_lights - * @param _traffic_lights New value to be copied in member traffic_lights - */ - eProsima_user_DllExport void traffic_lights( - const std::vector& _traffic_lights); - - /*! - * @brief This function moves the value in member traffic_lights - * @param _traffic_lights New value to be moved in member traffic_lights - */ - eProsima_user_DllExport void traffic_lights( - std::vector&& _traffic_lights); - - /*! - * @brief This function returns a constant reference to member traffic_lights - * @return Constant reference to member traffic_lights - */ - eProsima_user_DllExport const std::vector& traffic_lights() const; - - /*! - * @brief This function returns a reference to member traffic_lights - * @return Reference to member traffic_lights - */ - eProsima_user_DllExport std::vector& traffic_lights(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaTrafficLightStatusList& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_traffic_lights; - }; - } // namespace msg + +namespace msg { + + + + + +/*! + * @brief This class represents the structure CarlaTrafficLightStatusList defined by the user in the IDL file. + * @ingroup CarlaTrafficLightStatusList + */ +class CarlaTrafficLightStatusList +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaTrafficLightStatusList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList( + const CarlaTrafficLightStatusList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList( + CarlaTrafficLightStatusList&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList& operator =( + const CarlaTrafficLightStatusList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaTrafficLightStatusList that will be copied. + */ + eProsima_user_DllExport CarlaTrafficLightStatusList& operator =( + CarlaTrafficLightStatusList&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightStatusList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaTrafficLightStatusList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaTrafficLightStatusList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaTrafficLightStatusList& x) const; + + /*! + * @brief This function copies the value in member traffic_lights + * @param _traffic_lights New value to be copied in member traffic_lights + */ + eProsima_user_DllExport void traffic_lights( + const std::vector& _traffic_lights); + + /*! + * @brief This function moves the value in member traffic_lights + * @param _traffic_lights New value to be moved in member traffic_lights + */ + eProsima_user_DllExport void traffic_lights( + std::vector&& _traffic_lights); + + /*! + * @brief This function returns a constant reference to member traffic_lights + * @return Constant reference to member traffic_lights + */ + eProsima_user_DllExport const std::vector& traffic_lights() const; + + /*! + * @brief This function returns a reference to member traffic_lights + * @return Reference to member traffic_lights + */ + eProsima_user_DllExport std::vector& traffic_lights(); + +private: + + std::vector m_traffic_lights; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListCdrAux.hpp new file mode 100644 index 00000000000..d217f600e7c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListCdrAux.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusListCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLISTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLISTCDRAUX_HPP_ + +#include "CarlaTrafficLightStatusList.h" + +constexpr uint32_t carla_msgs_msg_CarlaTrafficLightStatusList_max_cdr_typesize {28809UL}; +constexpr uint32_t carla_msgs_msg_CarlaTrafficLightStatusList_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightStatusList& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLISTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListCdrAux.ipp new file mode 100644 index 00000000000..0d531791fb3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListCdrAux.ipp @@ -0,0 +1,132 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaTrafficLightStatusListCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLISTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLISTCDRAUX_IPP_ + +#include "CarlaTrafficLightStatusListCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaTrafficLightStatusList& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.traffic_lights(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightStatusList& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.traffic_lights() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaTrafficLightStatusList& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.traffic_lights(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaTrafficLightStatusList& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLISTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.cxx index d31612840d4..055c9a48324 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file CarlaTrafficLightStatusListPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaTrafficLightStatusListPubSubTypes.h" +#include "CarlaTrafficLightStatusListCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaTrafficLightStatusListPubSubType::CarlaTrafficLightStatusListPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaTrafficLightStatusList_"); - auto type_size = CarlaTrafficLightStatusList::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaTrafficLightStatusList::isKeyDefined(); - size_t keyLength = CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize() > 16 ? - CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaTrafficLightStatusListPubSubType::~CarlaTrafficLightStatusListPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaTrafficLightStatusListPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaTrafficLightStatusList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaTrafficLightStatusListPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaTrafficLightStatusList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaTrafficLightStatusListPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaTrafficLightStatusListPubSubType::createData() - { - return reinterpret_cast(new CarlaTrafficLightStatusList()); - } - - void CarlaTrafficLightStatusListPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaTrafficLightStatusListPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaTrafficLightStatusList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaTrafficLightStatusList::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +CarlaTrafficLightStatusListPubSubType::CarlaTrafficLightStatusListPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaTrafficLightStatusList_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaTrafficLightStatusList::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaTrafficLightStatusList_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaTrafficLightStatusListPubSubType::~CarlaTrafficLightStatusListPubSubType() +{ +} + +bool CarlaTrafficLightStatusListPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaTrafficLightStatusList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaTrafficLightStatusListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaTrafficLightStatusList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaTrafficLightStatusListPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaTrafficLightStatusListPubSubType::createData() +{ + return reinterpret_cast(new CarlaTrafficLightStatusList()); +} + +void CarlaTrafficLightStatusListPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaTrafficLightStatusListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h index 185f5c53918..76051662e1a 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h @@ -16,92 +16,123 @@ * @file CarlaTrafficLightStatusListPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaTrafficLightStatusList.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaTrafficLightStatusPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaTrafficLightStatusList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaTrafficLightStatusList defined by the user in the IDL file. + * @ingroup CarlaTrafficLightStatusList + */ +class CarlaTrafficLightStatusListPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaTrafficLightStatusList defined by the user in the IDL file. - * @ingroup CARLATRAFFICLIGHTSTATUSLIST - */ - class CarlaTrafficLightStatusListPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaTrafficLightStatusList type; + typedef CarlaTrafficLightStatusList type; - eProsima_user_DllExport CarlaTrafficLightStatusListPubSubType(); + eProsima_user_DllExport CarlaTrafficLightStatusListPubSubType(); - eProsima_user_DllExport virtual ~CarlaTrafficLightStatusListPubSubType(); + eProsima_user_DllExport ~CarlaTrafficLightStatusListPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUSLIST_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.cxx index 1f461e58653..c42bce0d454 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.cxx @@ -16,169 +16,197 @@ * @file CarlaTrafficLightStatusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaTrafficLightStatusPubSubTypes.h" +#include "CarlaTrafficLightStatusCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - namespace CarlaTrafficLightStatus_Constants { - - - - - - - } //End of namespace CarlaTrafficLightStatus_Constants - CarlaTrafficLightStatusPubSubType::CarlaTrafficLightStatusPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaTrafficLightStatus_"); - auto type_size = CarlaTrafficLightStatus::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaTrafficLightStatus::isKeyDefined(); - size_t keyLength = CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize() > 16 ? - CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaTrafficLightStatusPubSubType::~CarlaTrafficLightStatusPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaTrafficLightStatusPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaTrafficLightStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaTrafficLightStatusPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaTrafficLightStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaTrafficLightStatusPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaTrafficLightStatusPubSubType::createData() - { - return reinterpret_cast(new CarlaTrafficLightStatus()); - } - - void CarlaTrafficLightStatusPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaTrafficLightStatusPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaTrafficLightStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaTrafficLightStatus::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace CarlaTrafficLightStatus_Constants { + + + + + + + + + + + +} //End of namespace CarlaTrafficLightStatus_Constants + + + +CarlaTrafficLightStatusPubSubType::CarlaTrafficLightStatusPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaTrafficLightStatus_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaTrafficLightStatus::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaTrafficLightStatus_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaTrafficLightStatusPubSubType::~CarlaTrafficLightStatusPubSubType() +{ +} + +bool CarlaTrafficLightStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaTrafficLightStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaTrafficLightStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaTrafficLightStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaTrafficLightStatusPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaTrafficLightStatusPubSubType::createData() +{ + return reinterpret_cast(new CarlaTrafficLightStatus()); +} + +void CarlaTrafficLightStatusPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaTrafficLightStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h index b842189b98a..6871d6a379e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaTrafficLightStatusPubSubTypes.h @@ -16,100 +16,133 @@ * @file CarlaTrafficLightStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaTrafficLightStatus.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaTrafficLightStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs -{ - namespace msg - { - namespace CarlaTrafficLightStatus_Constants - { +namespace carla_msgs { +namespace msg { +namespace CarlaTrafficLightStatus_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type CarlaTrafficLightStatus defined by the user in the IDL file. - * @ingroup CARLATRAFFICLIGHTSTATUS - */ - class CarlaTrafficLightStatusPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef CarlaTrafficLightStatus type; +} // namespace CarlaTrafficLightStatus_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaTrafficLightStatus defined by the user in the IDL file. + * @ingroup CarlaTrafficLightStatus + */ +class CarlaTrafficLightStatusPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CarlaTrafficLightStatus type; + + eProsima_user_DllExport CarlaTrafficLightStatusPubSubType(); - eProsima_user_DllExport CarlaTrafficLightStatusPubSubType(); + eProsima_user_DllExport ~CarlaTrafficLightStatusPubSubType() override; - eProsima_user_DllExport virtual ~CarlaTrafficLightStatusPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLATRAFFICLIGHTSTATUS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.cxx index 1c310bd2a7d..e4c61c2466e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaV2XByteArray.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,135 +27,80 @@ char dummy; #endif // _WIN32 #include "CarlaV2XByteArray.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaV2XByteArray::CarlaV2XByteArray() -{ - // m_data_size com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1a75e76a - m_data_size = 0; - // m_bytes com.eprosima.idl.parser.typecode.AliasTypeCode@5524cca1 - memset(&m_bytes, 0, (100) * 1); +namespace carla_msgs { -} +namespace msg { -carla_msgs::msg::CarlaV2XByteArray::~CarlaV2XByteArray() + + +CarlaV2XByteArray::CarlaV2XByteArray() { +} +CarlaV2XByteArray::~CarlaV2XByteArray() +{ } -carla_msgs::msg::CarlaV2XByteArray::CarlaV2XByteArray( +CarlaV2XByteArray::CarlaV2XByteArray( const CarlaV2XByteArray& x) { m_data_size = x.m_data_size; m_bytes = x.m_bytes; } -carla_msgs::msg::CarlaV2XByteArray::CarlaV2XByteArray( - CarlaV2XByteArray&& x) +CarlaV2XByteArray::CarlaV2XByteArray( + CarlaV2XByteArray&& x) noexcept { m_data_size = x.m_data_size; m_bytes = std::move(x.m_bytes); } -carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XByteArray::operator =( +CarlaV2XByteArray& CarlaV2XByteArray::operator =( const CarlaV2XByteArray& x) { m_data_size = x.m_data_size; m_bytes = x.m_bytes; - return *this; } -carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XByteArray::operator =( - CarlaV2XByteArray&& x) +CarlaV2XByteArray& CarlaV2XByteArray::operator =( + CarlaV2XByteArray&& x) noexcept { m_data_size = x.m_data_size; m_bytes = std::move(x.m_bytes); - return *this; } -bool carla_msgs::msg::CarlaV2XByteArray::operator ==( +bool CarlaV2XByteArray::operator ==( const CarlaV2XByteArray& x) const { - - return (m_data_size == x.m_data_size && m_bytes == x.m_bytes); + return (m_data_size == x.m_data_size && + m_bytes == x.m_bytes); } -bool carla_msgs::msg::CarlaV2XByteArray::operator !=( +bool CarlaV2XByteArray::operator !=( const CarlaV2XByteArray& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaV2XByteArray::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += ((100) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaV2XByteArray::getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XByteArray& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - if ((100) > 0) - { - current_alignment += ((100) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaV2XByteArray::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_data_size; - scdr << m_bytes; - - -} - -void carla_msgs::msg::CarlaV2XByteArray::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_data_size; - dcdr >> m_bytes; - -} - /*! * @brief This function sets a value in member data_size * @param _data_size New value for member data_size */ -void carla_msgs::msg::CarlaV2XByteArray::data_size( +void CarlaV2XByteArray::data_size( uint8_t _data_size) { m_data_size = _data_size; @@ -165,7 +110,7 @@ void carla_msgs::msg::CarlaV2XByteArray::data_size( * @brief This function returns the value of member data_size * @return Value of member data_size */ -uint8_t carla_msgs::msg::CarlaV2XByteArray::data_size() const +uint8_t CarlaV2XByteArray::data_size() const { return m_data_size; } @@ -174,16 +119,17 @@ uint8_t carla_msgs::msg::CarlaV2XByteArray::data_size() const * @brief This function returns a reference to member data_size * @return Reference to member data_size */ -uint8_t& carla_msgs::msg::CarlaV2XByteArray::data_size() +uint8_t& CarlaV2XByteArray::data_size() { return m_data_size; } + /*! * @brief This function copies the value in member bytes * @param _bytes New value to be copied in member bytes */ -void carla_msgs::msg::CarlaV2XByteArray::bytes( +void CarlaV2XByteArray::bytes( const carla_msgs::msg::octet__100& _bytes) { m_bytes = _bytes; @@ -193,7 +139,7 @@ void carla_msgs::msg::CarlaV2XByteArray::bytes( * @brief This function moves the value in member bytes * @param _bytes New value to be moved in member bytes */ -void carla_msgs::msg::CarlaV2XByteArray::bytes( +void CarlaV2XByteArray::bytes( carla_msgs::msg::octet__100&& _bytes) { m_bytes = std::move(_bytes); @@ -203,7 +149,7 @@ void carla_msgs::msg::CarlaV2XByteArray::bytes( * @brief This function returns a constant reference to member bytes * @return Constant reference to member bytes */ -const carla_msgs::msg::octet__100& carla_msgs::msg::CarlaV2XByteArray::bytes() const +const carla_msgs::msg::octet__100& CarlaV2XByteArray::bytes() const { return m_bytes; } @@ -212,31 +158,18 @@ const carla_msgs::msg::octet__100& carla_msgs::msg::CarlaV2XByteArray::bytes() c * @brief This function returns a reference to member bytes * @return Reference to member bytes */ -carla_msgs::msg::octet__100& carla_msgs::msg::CarlaV2XByteArray::bytes() +carla_msgs::msg::octet__100& CarlaV2XByteArray::bytes() { return m_bytes; } -size_t carla_msgs::msg::CarlaV2XByteArray::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaV2XByteArray::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaV2XByteArray::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaV2XByteArrayCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.h index 2e7ff27a1af..7a071a0b77e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArray.h @@ -16,19 +16,24 @@ * @file CarlaV2XByteArray.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,196 +47,153 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaV2XByteArray_SOURCE) -#define CarlaV2XByteArray_DllAPI __declspec( dllexport ) +#if defined(CARLAV2XBYTEARRAY_SOURCE) +#define CARLAV2XBYTEARRAY_DllAPI __declspec( dllexport ) #else -#define CarlaV2XByteArray_DllAPI __declspec( dllimport ) -#endif // CarlaV2XByteArray_SOURCE +#define CARLAV2XBYTEARRAY_DllAPI __declspec( dllimport ) +#endif // CARLAV2XBYTEARRAY_SOURCE #else -#define CarlaV2XByteArray_DllAPI +#define CARLAV2XBYTEARRAY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaV2XByteArray_DllAPI +#define CARLAV2XBYTEARRAY_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - typedef std::array octet__100; - /*! - * @brief This class represents the structure CarlaV2XByteArray defined by the user in the IDL file. - * @ingroup CARLAV2XBYTEARRAY - */ - class CarlaV2XByteArray - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaV2XByteArray(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaV2XByteArray(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. - */ - eProsima_user_DllExport CarlaV2XByteArray( - const CarlaV2XByteArray& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. - */ - eProsima_user_DllExport CarlaV2XByteArray( - CarlaV2XByteArray&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. - */ - eProsima_user_DllExport CarlaV2XByteArray& operator =( - const CarlaV2XByteArray& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. - */ - eProsima_user_DllExport CarlaV2XByteArray& operator =( - CarlaV2XByteArray&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XByteArray object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaV2XByteArray& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XByteArray object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaV2XByteArray& x) const; - - /*! - * @brief This function sets a value in member data_size - * @param _data_size New value for member data_size - */ - eProsima_user_DllExport void data_size( - uint8_t _data_size); - - /*! - * @brief This function returns the value of member data_size - * @return Value of member data_size - */ - eProsima_user_DllExport uint8_t data_size() const; - - /*! - * @brief This function returns a reference to member data_size - * @return Reference to member data_size - */ - eProsima_user_DllExport uint8_t& data_size(); - - /*! - * @brief This function copies the value in member bytes - * @param _bytes New value to be copied in member bytes - */ - eProsima_user_DllExport void bytes( - const carla_msgs::msg::octet__100& _bytes); - - /*! - * @brief This function moves the value in member bytes - * @param _bytes New value to be moved in member bytes - */ - eProsima_user_DllExport void bytes( - carla_msgs::msg::octet__100&& _bytes); - - /*! - * @brief This function returns a constant reference to member bytes - * @return Constant reference to member bytes - */ - eProsima_user_DllExport const carla_msgs::msg::octet__100& bytes() const; - - /*! - * @brief This function returns a reference to member bytes - * @return Reference to member bytes - */ - eProsima_user_DllExport carla_msgs::msg::octet__100& bytes(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XByteArray& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_data_size; - carla_msgs::msg::octet__100 m_bytes; - }; - } // namespace msg + +namespace msg { + +typedef std::array octet__100; + + + +/*! + * @brief This class represents the structure CarlaV2XByteArray defined by the user in the IDL file. + * @ingroup CarlaV2XByteArray + */ +class CarlaV2XByteArray +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XByteArray(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XByteArray(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. + */ + eProsima_user_DllExport CarlaV2XByteArray( + const CarlaV2XByteArray& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. + */ + eProsima_user_DllExport CarlaV2XByteArray( + CarlaV2XByteArray&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. + */ + eProsima_user_DllExport CarlaV2XByteArray& operator =( + const CarlaV2XByteArray& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XByteArray that will be copied. + */ + eProsima_user_DllExport CarlaV2XByteArray& operator =( + CarlaV2XByteArray&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XByteArray object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XByteArray& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XByteArray object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XByteArray& x) const; + + /*! + * @brief This function sets a value in member data_size + * @param _data_size New value for member data_size + */ + eProsima_user_DllExport void data_size( + uint8_t _data_size); + + /*! + * @brief This function returns the value of member data_size + * @return Value of member data_size + */ + eProsima_user_DllExport uint8_t data_size() const; + + /*! + * @brief This function returns a reference to member data_size + * @return Reference to member data_size + */ + eProsima_user_DllExport uint8_t& data_size(); + + + /*! + * @brief This function copies the value in member bytes + * @param _bytes New value to be copied in member bytes + */ + eProsima_user_DllExport void bytes( + const carla_msgs::msg::octet__100& _bytes); + + /*! + * @brief This function moves the value in member bytes + * @param _bytes New value to be moved in member bytes + */ + eProsima_user_DllExport void bytes( + carla_msgs::msg::octet__100&& _bytes); + + /*! + * @brief This function returns a constant reference to member bytes + * @return Constant reference to member bytes + */ + eProsima_user_DllExport const carla_msgs::msg::octet__100& bytes() const; + + /*! + * @brief This function returns a reference to member bytes + * @return Reference to member bytes + */ + eProsima_user_DllExport carla_msgs::msg::octet__100& bytes(); + +private: + + uint8_t m_data_size{0}; + carla_msgs::msg::octet__100 m_bytes{0}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayCdrAux.hpp new file mode 100644 index 00000000000..5c50e1cb184 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayCdrAux.hpp @@ -0,0 +1,53 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XByteArrayCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAYCDRAUX_HPP_ + +#include "CarlaV2XByteArray.h" + +constexpr uint32_t carla_msgs_msg_CarlaV2XByteArray_max_cdr_typesize {105UL}; +constexpr uint32_t carla_msgs_msg_CarlaV2XByteArray_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XByteArray& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayCdrAux.ipp new file mode 100644 index 00000000000..4e62f1401d1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayCdrAux.ipp @@ -0,0 +1,140 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XByteArrayCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAYCDRAUX_IPP_ + +#include "CarlaV2XByteArrayCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaV2XByteArray& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.data_size(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bytes(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XByteArray& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.data_size() + << eprosima::fastcdr::MemberId(1) << data.bytes() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaV2XByteArray& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.data_size(); + break; + + case 1: + dcdr >> data.bytes(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XByteArray& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.cxx index 7780afaa68f..31086ef5b74 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.cxx @@ -16,162 +16,185 @@ * @file CarlaV2XByteArrayPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaV2XByteArrayPubSubTypes.h" +#include "CarlaV2XByteArrayCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - - CarlaV2XByteArrayPubSubType::CarlaV2XByteArrayPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaV2XByteArray_"); - auto type_size = CarlaV2XByteArray::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaV2XByteArray::isKeyDefined(); - size_t keyLength = CarlaV2XByteArray::getKeyMaxCdrSerializedSize() > 16 ? - CarlaV2XByteArray::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaV2XByteArrayPubSubType::~CarlaV2XByteArrayPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaV2XByteArrayPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaV2XByteArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaV2XByteArrayPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaV2XByteArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaV2XByteArrayPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaV2XByteArrayPubSubType::createData() - { - return reinterpret_cast(new CarlaV2XByteArray()); - } - - void CarlaV2XByteArrayPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaV2XByteArrayPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaV2XByteArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaV2XByteArray::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaV2XByteArray::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +CarlaV2XByteArrayPubSubType::CarlaV2XByteArrayPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaV2XByteArray_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaV2XByteArray::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaV2XByteArray_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaV2XByteArrayPubSubType::~CarlaV2XByteArrayPubSubType() +{ +} + +bool CarlaV2XByteArrayPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaV2XByteArray* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaV2XByteArrayPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaV2XByteArray* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaV2XByteArrayPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaV2XByteArrayPubSubType::createData() +{ + return reinterpret_cast(new CarlaV2XByteArray()); +} + +void CarlaV2XByteArrayPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaV2XByteArrayPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h index e8fa6fafc18..de35164add3 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XByteArrayPubSubTypes.h @@ -16,93 +16,121 @@ * @file CarlaV2XByteArrayPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaV2XByteArray.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaV2XByteArray is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { +typedef std::array octet__100; + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaV2XByteArray defined by the user in the IDL file. + * @ingroup CarlaV2XByteArray + */ +class CarlaV2XByteArrayPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - typedef std::array octet__100; - /*! - * @brief This class represents the TopicDataType of the type CarlaV2XByteArray defined by the user in the IDL file. - * @ingroup CARLAV2XBYTEARRAY - */ - class CarlaV2XByteArrayPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaV2XByteArray type; + typedef CarlaV2XByteArray type; - eProsima_user_DllExport CarlaV2XByteArrayPubSubType(); + eProsima_user_DllExport CarlaV2XByteArrayPubSubType(); - eProsima_user_DllExport virtual ~CarlaV2XByteArrayPubSubType(); + eProsima_user_DllExport ~CarlaV2XByteArrayPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaV2XByteArray(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XBYTEARRAY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.cxx deleted file mode 100644 index 5d9c94909e1..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.cxx +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CarlaV2XCustom.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "CarlaV2XCustom.h" -#include - -#include -using namespace eprosima::fastcdr::exception; - -#include - -carla_msgs::msg::CarlaV2XCustom::CarlaV2XCustom() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5fdcaa40 - - // m_message com.eprosima.idl.parser.typecode.StringTypeCode@6dc17b83 - m_message =""; - -} - -carla_msgs::msg::CarlaV2XCustom::~CarlaV2XCustom() -{ - -} - -carla_msgs::msg::CarlaV2XCustom::CarlaV2XCustom( - const CarlaV2XCustom& x) -{ - m_header = x.m_header; - m_message = x.m_message; -} - -carla_msgs::msg::CarlaV2XCustom::CarlaV2XCustom( - CarlaV2XCustom&& x) -{ - m_header = std::move(x.m_header); - m_message = std::move(x.m_message); -} - -carla_msgs::msg::CarlaV2XCustom& carla_msgs::msg::CarlaV2XCustom::operator =( - const CarlaV2XCustom& x) -{ - - m_header = x.m_header; - m_message = x.m_message; - - return *this; -} - -carla_msgs::msg::CarlaV2XCustom& carla_msgs::msg::CarlaV2XCustom::operator =( - CarlaV2XCustom&& x) -{ - - m_header = std::move(x.m_header); - m_message = std::move(x.m_message); - - return *this; -} - -bool carla_msgs::msg::CarlaV2XCustom::operator ==( - const CarlaV2XCustom& x) const -{ - - return (m_header == x.m_header && m_message == x.m_message); -} - -bool carla_msgs::msg::CarlaV2XCustom::operator !=( - const CarlaV2XCustom& x) const -{ - return !(*this == x); -} - -size_t carla_msgs::msg::CarlaV2XCustom::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaV2XCustom::getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XCustom& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaV2XCustom::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_message; - -} - -void carla_msgs::msg::CarlaV2XCustom::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_message; -} - -/*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ -void carla_msgs::msg::CarlaV2XCustom::header( - const etsi_its_cam_msgs::msg::ItsPduHeader& _header) -{ - m_header = _header; -} - -/*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ -void carla_msgs::msg::CarlaV2XCustom::header( - etsi_its_cam_msgs::msg::ItsPduHeader&& _header) -{ - m_header = std::move(_header); -} - -/*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ -const etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustom::header() const -{ - return m_header; -} - -/*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ -etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustom::header() -{ - return m_header; -} -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void carla_msgs::msg::CarlaV2XCustom::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void carla_msgs::msg::CarlaV2XCustom::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& carla_msgs::msg::CarlaV2XCustom::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& carla_msgs::msg::CarlaV2XCustom::message() -{ - return m_message; -} - -size_t carla_msgs::msg::CarlaV2XCustom::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - - return current_align; -} - -bool carla_msgs::msg::CarlaV2XCustom::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaV2XCustom::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} - - diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.h deleted file mode 100644 index e07b55ef863..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustom.h +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CarlaV2XCustom.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_H_ -#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_H_ - -#include "etsi_its_cam_msgs/msg/ItsPduHeader.h" - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaV2XCustom_SOURCE) -#define CarlaV2XCustom_DllAPI __declspec( dllexport ) -#else -#define CarlaV2XCustom_DllAPI __declspec( dllimport ) -#endif // CarlaV2XCustom_SOURCE -#else -#define CarlaV2XCustom_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CarlaV2XCustom_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - -namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaV2XCustom defined by the user in the IDL file. - * @ingroup CARLAV2XCUSTOM - */ - class CarlaV2XCustom - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaV2XCustom(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaV2XCustom(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustom that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustom( - const CarlaV2XCustom& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustom that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustom( - CarlaV2XCustom&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustom that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustom& operator =( - const CarlaV2XCustom& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustom that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustom& operator =( - CarlaV2XCustom&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XCustom object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaV2XCustom& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XCustom object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaV2XCustom& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const etsi_its_cam_msgs::msg::ItsPduHeader& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - etsi_its_cam_msgs::msg::ItsPduHeader&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ItsPduHeader& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ItsPduHeader& header(); - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XCustom& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::ItsPduHeader m_header; - std::string m_message; - }; - } // namespace msg -} // namespace carla_msgs - -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.cxx index 9c2e642ea8e..87b7f8cf186 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaV2XCustomData.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,126 +27,80 @@ char dummy; #endif // _WIN32 #include "CarlaV2XCustomData.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaV2XCustomData::CarlaV2XCustomData() -{ - // m_power com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6be968ce - m_power = 0.0; - // m_message com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7c37508a + +namespace carla_msgs { + +namespace msg { -} -carla_msgs::msg::CarlaV2XCustomData::~CarlaV2XCustomData() +CarlaV2XCustomData::CarlaV2XCustomData() { +} +CarlaV2XCustomData::~CarlaV2XCustomData() +{ } -carla_msgs::msg::CarlaV2XCustomData::CarlaV2XCustomData( +CarlaV2XCustomData::CarlaV2XCustomData( const CarlaV2XCustomData& x) { m_power = x.m_power; m_message = x.m_message; } -carla_msgs::msg::CarlaV2XCustomData::CarlaV2XCustomData( - CarlaV2XCustomData&& x) +CarlaV2XCustomData::CarlaV2XCustomData( + CarlaV2XCustomData&& x) noexcept { m_power = x.m_power; m_message = std::move(x.m_message); } -carla_msgs::msg::CarlaV2XCustomData& carla_msgs::msg::CarlaV2XCustomData::operator =( +CarlaV2XCustomData& CarlaV2XCustomData::operator =( const CarlaV2XCustomData& x) { m_power = x.m_power; m_message = x.m_message; - return *this; } -carla_msgs::msg::CarlaV2XCustomData& carla_msgs::msg::CarlaV2XCustomData::operator =( - CarlaV2XCustomData&& x) +CarlaV2XCustomData& CarlaV2XCustomData::operator =( + CarlaV2XCustomData&& x) noexcept { m_power = x.m_power; m_message = std::move(x.m_message); - return *this; } -bool carla_msgs::msg::CarlaV2XCustomData::operator ==( +bool CarlaV2XCustomData::operator ==( const CarlaV2XCustomData& x) const { - - return (m_power == x.m_power && m_message == x.m_message); + return (m_power == x.m_power && + m_message == x.m_message); } -bool carla_msgs::msg::CarlaV2XCustomData::operator !=( +bool CarlaV2XCustomData::operator !=( const CarlaV2XCustomData& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaV2XCustomData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += carla_msgs::msg::CarlaV2XCustomMessage::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaV2XCustomData::getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XCustomData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += carla_msgs::msg::CarlaV2XCustomMessage::getCdrSerializedSize(data.message(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaV2XCustomData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_power; - scdr << m_message; - -} - -void carla_msgs::msg::CarlaV2XCustomData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_power; - dcdr >> m_message; -} - /*! * @brief This function sets a value in member power * @param _power New value for member power */ -void carla_msgs::msg::CarlaV2XCustomData::power( +void CarlaV2XCustomData::power( float _power) { m_power = _power; @@ -156,7 +110,7 @@ void carla_msgs::msg::CarlaV2XCustomData::power( * @brief This function returns the value of member power * @return Value of member power */ -float carla_msgs::msg::CarlaV2XCustomData::power() const +float CarlaV2XCustomData::power() const { return m_power; } @@ -165,16 +119,17 @@ float carla_msgs::msg::CarlaV2XCustomData::power() const * @brief This function returns a reference to member power * @return Reference to member power */ -float& carla_msgs::msg::CarlaV2XCustomData::power() +float& CarlaV2XCustomData::power() { return m_power; } + /*! * @brief This function copies the value in member message * @param _message New value to be copied in member message */ -void carla_msgs::msg::CarlaV2XCustomData::message( +void CarlaV2XCustomData::message( const carla_msgs::msg::CarlaV2XCustomMessage& _message) { m_message = _message; @@ -184,7 +139,7 @@ void carla_msgs::msg::CarlaV2XCustomData::message( * @brief This function moves the value in member message * @param _message New value to be moved in member message */ -void carla_msgs::msg::CarlaV2XCustomData::message( +void CarlaV2XCustomData::message( carla_msgs::msg::CarlaV2XCustomMessage&& _message) { m_message = std::move(_message); @@ -194,7 +149,7 @@ void carla_msgs::msg::CarlaV2XCustomData::message( * @brief This function returns a constant reference to member message * @return Constant reference to member message */ -const carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomData::message() const +const carla_msgs::msg::CarlaV2XCustomMessage& CarlaV2XCustomData::message() const { return m_message; } @@ -203,31 +158,18 @@ const carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomDat * @brief This function returns a reference to member message * @return Reference to member message */ -carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomData::message() +carla_msgs::msg::CarlaV2XCustomMessage& CarlaV2XCustomData::message() { return m_message; } -size_t carla_msgs::msg::CarlaV2XCustomData::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool carla_msgs::msg::CarlaV2XCustomData::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaV2XCustomData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaV2XCustomDataCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.h index c41a1ece1d0..a0fb0a0b270 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomData.h @@ -16,20 +16,25 @@ * @file CarlaV2XCustomData.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_H_ -#include "CarlaV2XCustomMessage.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaV2XCustomMessage.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,195 +48,151 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaV2XCustomData_SOURCE) -#define CarlaV2XCustomData_DllAPI __declspec( dllexport ) +#if defined(CARLAV2XCUSTOMDATA_SOURCE) +#define CARLAV2XCUSTOMDATA_DllAPI __declspec( dllexport ) #else -#define CarlaV2XCustomData_DllAPI __declspec( dllimport ) -#endif // CarlaV2XCustomData_SOURCE +#define CARLAV2XCUSTOMDATA_DllAPI __declspec( dllimport ) +#endif // CARLAV2XCUSTOMDATA_SOURCE #else -#define CarlaV2XCustomData_DllAPI +#define CARLAV2XCUSTOMDATA_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaV2XCustomData_DllAPI +#define CARLAV2XCUSTOMDATA_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaV2XCustomData defined by the user in the IDL file. - * @ingroup CARLAV2XCUSTOMDATA - */ - class CarlaV2XCustomData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaV2XCustomData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaV2XCustomData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomData( - const CarlaV2XCustomData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomData( - CarlaV2XCustomData&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomData& operator =( - const CarlaV2XCustomData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomData& operator =( - CarlaV2XCustomData&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XCustomData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaV2XCustomData& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XCustomData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaV2XCustomData& x) const; - - /*! - * @brief This function sets a value in member power - * @param _power New value for member power - */ - eProsima_user_DllExport void power( - float _power); - - /*! - * @brief This function returns the value of member power - * @return Value of member power - */ - eProsima_user_DllExport float power() const; - - /*! - * @brief This function returns a reference to member power - * @return Reference to member power - */ - eProsima_user_DllExport float& power(); - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const carla_msgs::msg::CarlaV2XCustomMessage& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - carla_msgs::msg::CarlaV2XCustomMessage&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const carla_msgs::msg::CarlaV2XCustomMessage& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport carla_msgs::msg::CarlaV2XCustomMessage& message(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XCustomData& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - float m_power; - carla_msgs::msg::CarlaV2XCustomMessage m_message; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaV2XCustomData defined by the user in the IDL file. + * @ingroup CarlaV2XCustomData + */ +class CarlaV2XCustomData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XCustomData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XCustomData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomData( + const CarlaV2XCustomData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomData( + CarlaV2XCustomData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomData& operator =( + const CarlaV2XCustomData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomData that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomData& operator =( + CarlaV2XCustomData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XCustomData& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XCustomData& x) const; + + /*! + * @brief This function sets a value in member power + * @param _power New value for member power + */ + eProsima_user_DllExport void power( + float _power); + + /*! + * @brief This function returns the value of member power + * @return Value of member power + */ + eProsima_user_DllExport float power() const; + + /*! + * @brief This function returns a reference to member power + * @return Reference to member power + */ + eProsima_user_DllExport float& power(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const carla_msgs::msg::CarlaV2XCustomMessage& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + carla_msgs::msg::CarlaV2XCustomMessage&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaV2XCustomMessage& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport carla_msgs::msg::CarlaV2XCustomMessage& message(); + +private: + + float m_power{0.0}; + carla_msgs::msg::CarlaV2XCustomMessage m_message; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataCdrAux.hpp new file mode 100644 index 00000000000..c13d8a38c84 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataCdrAux.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATACDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATACDRAUX_HPP_ + +#include "CarlaV2XCustomData.h" + +constexpr uint32_t carla_msgs_msg_CarlaV2XCustomData_max_cdr_typesize {133UL}; +constexpr uint32_t carla_msgs_msg_CarlaV2XCustomData_max_key_cdr_typesize {0UL}; + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomData& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATACDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataCdrAux.ipp new file mode 100644 index 00000000000..0fe5f44a10f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATACDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATACDRAUX_IPP_ + +#include "CarlaV2XCustomDataCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaV2XCustomData& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.power(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.message(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomData& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.power() + << eprosima::fastcdr::MemberId(1) << data.message() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaV2XCustomData& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.power(); + break; + + case 1: + dcdr >> data.message(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomData& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATACDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.cxx index d55fe266e57..f5a0ee05f84 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaV2XCustomDataList.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,77 @@ char dummy; #endif // _WIN32 #include "CarlaV2XCustomDataList.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaV2XCustomDataList::CarlaV2XCustomDataList() -{ - // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@723ca036 + +namespace carla_msgs { + +namespace msg { + + + +CarlaV2XCustomDataList::CarlaV2XCustomDataList() +{ } -carla_msgs::msg::CarlaV2XCustomDataList::~CarlaV2XCustomDataList() +CarlaV2XCustomDataList::~CarlaV2XCustomDataList() { } -carla_msgs::msg::CarlaV2XCustomDataList::CarlaV2XCustomDataList( +CarlaV2XCustomDataList::CarlaV2XCustomDataList( const CarlaV2XCustomDataList& x) { m_data = x.m_data; } -carla_msgs::msg::CarlaV2XCustomDataList::CarlaV2XCustomDataList( - CarlaV2XCustomDataList&& x) +CarlaV2XCustomDataList::CarlaV2XCustomDataList( + CarlaV2XCustomDataList&& x) noexcept { m_data = std::move(x.m_data); } -carla_msgs::msg::CarlaV2XCustomDataList& carla_msgs::msg::CarlaV2XCustomDataList::operator =( +CarlaV2XCustomDataList& CarlaV2XCustomDataList::operator =( const CarlaV2XCustomDataList& x) { m_data = x.m_data; - return *this; } -carla_msgs::msg::CarlaV2XCustomDataList& carla_msgs::msg::CarlaV2XCustomDataList::operator =( - CarlaV2XCustomDataList&& x) +CarlaV2XCustomDataList& CarlaV2XCustomDataList::operator =( + CarlaV2XCustomDataList&& x) noexcept { m_data = std::move(x.m_data); - return *this; } -bool carla_msgs::msg::CarlaV2XCustomDataList::operator ==( +bool CarlaV2XCustomDataList::operator ==( const CarlaV2XCustomDataList& x) const { - return (m_data == x.m_data); } -bool carla_msgs::msg::CarlaV2XCustomDataList::operator !=( +bool CarlaV2XCustomDataList::operator !=( const CarlaV2XCustomDataList& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaV2XCustomDataList::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaV2XCustomData::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaV2XCustomDataList::getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XCustomDataList& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.data().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaV2XCustomData::getCdrSerializedSize(data.data().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaV2XCustomDataList::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_data; -} - -void carla_msgs::msg::CarlaV2XCustomDataList::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_data;} - /*! * @brief This function copies the value in member data * @param _data New value to be copied in member data */ -void carla_msgs::msg::CarlaV2XCustomDataList::data( +void CarlaV2XCustomDataList::data( const std::vector& _data) { m_data = _data; @@ -149,7 +107,7 @@ void carla_msgs::msg::CarlaV2XCustomDataList::data( * @brief This function moves the value in member data * @param _data New value to be moved in member data */ -void carla_msgs::msg::CarlaV2XCustomDataList::data( +void CarlaV2XCustomDataList::data( std::vector&& _data) { m_data = std::move(_data); @@ -159,7 +117,7 @@ void carla_msgs::msg::CarlaV2XCustomDataList::data( * @brief This function returns a constant reference to member data * @return Constant reference to member data */ -const std::vector& carla_msgs::msg::CarlaV2XCustomDataList::data() const +const std::vector& CarlaV2XCustomDataList::data() const { return m_data; } @@ -168,31 +126,18 @@ const std::vector& carla_msgs::msg::CarlaV2 * @brief This function returns a reference to member data * @return Reference to member data */ -std::vector& carla_msgs::msg::CarlaV2XCustomDataList::data() +std::vector& CarlaV2XCustomDataList::data() { return m_data; } -size_t carla_msgs::msg::CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaV2XCustomDataList::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaV2XCustomDataList::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaV2XCustomDataListCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.h index 7a3e80a10fe..1cc9be9d3df 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataList.h @@ -16,20 +16,25 @@ * @file CarlaV2XCustomDataList.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_H_ -#include "CarlaV2XCustomData.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaV2XCustomData.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaV2XCustomDataList_SOURCE) -#define CarlaV2XCustomDataList_DllAPI __declspec( dllexport ) +#if defined(CARLAV2XCUSTOMDATALIST_SOURCE) +#define CARLAV2XCUSTOMDATALIST_DllAPI __declspec( dllexport ) #else -#define CarlaV2XCustomDataList_DllAPI __declspec( dllimport ) -#endif // CarlaV2XCustomDataList_SOURCE +#define CARLAV2XCUSTOMDATALIST_DllAPI __declspec( dllimport ) +#endif // CARLAV2XCUSTOMDATALIST_SOURCE #else -#define CarlaV2XCustomDataList_DllAPI +#define CARLAV2XCUSTOMDATALIST_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaV2XCustomDataList_DllAPI +#define CARLAV2XCUSTOMDATALIST_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaV2XCustomDataList defined by the user in the IDL file. - * @ingroup CARLAV2XCUSTOMDATALIST - */ - class CarlaV2XCustomDataList - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaV2XCustomDataList(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaV2XCustomDataList(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomDataList( - const CarlaV2XCustomDataList& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomDataList( - CarlaV2XCustomDataList&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomDataList& operator =( - const CarlaV2XCustomDataList& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomDataList& operator =( - CarlaV2XCustomDataList&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XCustomDataList object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaV2XCustomDataList& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XCustomDataList object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaV2XCustomDataList& x) const; - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XCustomDataList& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_data; - }; - } // namespace msg + +namespace msg { + + + + + +/*! + * @brief This class represents the structure CarlaV2XCustomDataList defined by the user in the IDL file. + * @ingroup CarlaV2XCustomDataList + */ +class CarlaV2XCustomDataList +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XCustomDataList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XCustomDataList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomDataList( + const CarlaV2XCustomDataList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomDataList( + CarlaV2XCustomDataList&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomDataList& operator =( + const CarlaV2XCustomDataList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomDataList& operator =( + CarlaV2XCustomDataList&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomDataList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XCustomDataList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomDataList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XCustomDataList& x) const; + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data(); + +private: + + std::vector m_data; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListCdrAux.hpp new file mode 100644 index 00000000000..873e0c0393b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataListCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALISTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALISTCDRAUX_HPP_ + +#include "CarlaV2XCustomDataList.h" + +constexpr uint32_t carla_msgs_msg_CarlaV2XCustomDataList_max_cdr_typesize {13609UL}; +constexpr uint32_t carla_msgs_msg_CarlaV2XCustomDataList_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomDataList& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALISTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListCdrAux.ipp new file mode 100644 index 00000000000..78cc6d3388f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListCdrAux.ipp @@ -0,0 +1,132 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomDataListCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALISTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALISTCDRAUX_IPP_ + +#include "CarlaV2XCustomDataListCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaV2XCustomDataList& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomDataList& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.data() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaV2XCustomDataList& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomDataList& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALISTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.cxx index c2886fe3a52..042edb61e32 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file CarlaV2XCustomDataListPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaV2XCustomDataListPubSubTypes.h" +#include "CarlaV2XCustomDataListCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaV2XCustomDataListPubSubType::CarlaV2XCustomDataListPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaV2XCustomDataList_"); - auto type_size = CarlaV2XCustomDataList::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaV2XCustomDataList::isKeyDefined(); - size_t keyLength = CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize() > 16 ? - CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaV2XCustomDataListPubSubType::~CarlaV2XCustomDataListPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaV2XCustomDataListPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaV2XCustomDataList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaV2XCustomDataListPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaV2XCustomDataList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaV2XCustomDataListPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaV2XCustomDataListPubSubType::createData() - { - return reinterpret_cast(new CarlaV2XCustomDataList()); - } - - void CarlaV2XCustomDataListPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaV2XCustomDataListPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaV2XCustomDataList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaV2XCustomDataList::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +CarlaV2XCustomDataListPubSubType::CarlaV2XCustomDataListPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaV2XCustomDataList_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaV2XCustomDataList::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaV2XCustomDataList_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaV2XCustomDataListPubSubType::~CarlaV2XCustomDataListPubSubType() +{ +} + +bool CarlaV2XCustomDataListPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaV2XCustomDataList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaV2XCustomDataListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaV2XCustomDataList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaV2XCustomDataListPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaV2XCustomDataListPubSubType::createData() +{ + return reinterpret_cast(new CarlaV2XCustomDataList()); +} + +void CarlaV2XCustomDataListPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaV2XCustomDataListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h index fba673efa29..39e6a571979 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h @@ -16,92 +16,123 @@ * @file CarlaV2XCustomDataListPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaV2XCustomDataList.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaV2XCustomDataPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaV2XCustomDataList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaV2XCustomDataList defined by the user in the IDL file. + * @ingroup CarlaV2XCustomDataList + */ +class CarlaV2XCustomDataListPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaV2XCustomDataList defined by the user in the IDL file. - * @ingroup CARLAV2XCUSTOMDATALIST - */ - class CarlaV2XCustomDataListPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaV2XCustomDataList type; + typedef CarlaV2XCustomDataList type; - eProsima_user_DllExport CarlaV2XCustomDataListPubSubType(); + eProsima_user_DllExport CarlaV2XCustomDataListPubSubType(); - eProsima_user_DllExport virtual ~CarlaV2XCustomDataListPubSubType(); + eProsima_user_DllExport ~CarlaV2XCustomDataListPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATALIST_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.cxx index ed8788995cf..f675c35522c 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaV2XCustomDataPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaV2XCustomDataPubSubTypes.h" +#include "CarlaV2XCustomDataCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaV2XCustomDataPubSubType::CarlaV2XCustomDataPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaV2XCustomData_"); - auto type_size = CarlaV2XCustomData::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaV2XCustomData::isKeyDefined(); - size_t keyLength = CarlaV2XCustomData::getKeyMaxCdrSerializedSize() > 16 ? - CarlaV2XCustomData::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaV2XCustomDataPubSubType::~CarlaV2XCustomDataPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaV2XCustomDataPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaV2XCustomData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaV2XCustomDataPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaV2XCustomData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaV2XCustomDataPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaV2XCustomDataPubSubType::createData() - { - return reinterpret_cast(new CarlaV2XCustomData()); - } - - void CarlaV2XCustomDataPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaV2XCustomDataPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaV2XCustomData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaV2XCustomData::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaV2XCustomData::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaV2XCustomDataPubSubType::CarlaV2XCustomDataPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaV2XCustomData_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaV2XCustomData::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaV2XCustomData_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaV2XCustomDataPubSubType::~CarlaV2XCustomDataPubSubType() +{ +} + +bool CarlaV2XCustomDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaV2XCustomData* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaV2XCustomDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaV2XCustomData* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaV2XCustomDataPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaV2XCustomDataPubSubType::createData() +{ + return reinterpret_cast(new CarlaV2XCustomData()); +} + +void CarlaV2XCustomDataPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaV2XCustomDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.h index 7fc1b67991d..efdaeea27d5 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomDataPubSubTypes.h @@ -16,92 +16,121 @@ * @file CarlaV2XCustomDataPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaV2XCustomData.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaV2XCustomMessagePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaV2XCustomData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaV2XCustomData defined by the user in the IDL file. + * @ingroup CarlaV2XCustomData + */ +class CarlaV2XCustomDataPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaV2XCustomData defined by the user in the IDL file. - * @ingroup CARLAV2XCUSTOMDATA - */ - class CarlaV2XCustomDataPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaV2XCustomData type; + typedef CarlaV2XCustomData type; - eProsima_user_DllExport CarlaV2XCustomDataPubSubType(); + eProsima_user_DllExport CarlaV2XCustomDataPubSubType(); - eProsima_user_DllExport virtual ~CarlaV2XCustomDataPubSubType(); + eProsima_user_DllExport ~CarlaV2XCustomDataPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaV2XCustomData(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMDATA_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.cxx index 68d63e62954..74331a63d61 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaV2XCustomMessage.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "CarlaV2XCustomMessage.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaV2XCustomMessage::CarlaV2XCustomMessage() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3de8f619 - // m_data com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2ab4bc72 +namespace carla_msgs { + +namespace msg { -} -carla_msgs::msg::CarlaV2XCustomMessage::~CarlaV2XCustomMessage() +CarlaV2XCustomMessage::CarlaV2XCustomMessage() { +} +CarlaV2XCustomMessage::~CarlaV2XCustomMessage() +{ } -carla_msgs::msg::CarlaV2XCustomMessage::CarlaV2XCustomMessage( +CarlaV2XCustomMessage::CarlaV2XCustomMessage( const CarlaV2XCustomMessage& x) { m_header = x.m_header; m_data = x.m_data; } -carla_msgs::msg::CarlaV2XCustomMessage::CarlaV2XCustomMessage( - CarlaV2XCustomMessage&& x) +CarlaV2XCustomMessage::CarlaV2XCustomMessage( + CarlaV2XCustomMessage&& x) noexcept { m_header = std::move(x.m_header); m_data = std::move(x.m_data); } -carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomMessage::operator =( +CarlaV2XCustomMessage& CarlaV2XCustomMessage::operator =( const CarlaV2XCustomMessage& x) { m_header = x.m_header; m_data = x.m_data; - return *this; } -carla_msgs::msg::CarlaV2XCustomMessage& carla_msgs::msg::CarlaV2XCustomMessage::operator =( - CarlaV2XCustomMessage&& x) +CarlaV2XCustomMessage& CarlaV2XCustomMessage::operator =( + CarlaV2XCustomMessage&& x) noexcept { m_header = std::move(x.m_header); m_data = std::move(x.m_data); - return *this; } -bool carla_msgs::msg::CarlaV2XCustomMessage::operator ==( +bool CarlaV2XCustomMessage::operator ==( const CarlaV2XCustomMessage& x) const { - - return (m_header == x.m_header && m_data == x.m_data); + return (m_header == x.m_header && + m_data == x.m_data); } -bool carla_msgs::msg::CarlaV2XCustomMessage::operator !=( +bool CarlaV2XCustomMessage::operator !=( const CarlaV2XCustomMessage& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaV2XCustomMessage::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getMaxCdrSerializedSize(current_alignment); - current_alignment += carla_msgs::msg::CarlaV2XByteArray::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaV2XCustomMessage::getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XCustomMessage& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += carla_msgs::msg::CarlaV2XByteArray::getCdrSerializedSize(data.data(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaV2XCustomMessage::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_data; - -} - -void carla_msgs::msg::CarlaV2XCustomMessage::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_data; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaV2XCustomMessage::header( +void CarlaV2XCustomMessage::header( const etsi_its_cam_msgs::msg::ItsPduHeader& _header) { m_header = _header; @@ -152,7 +110,7 @@ void carla_msgs::msg::CarlaV2XCustomMessage::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaV2XCustomMessage::header( +void CarlaV2XCustomMessage::header( etsi_its_cam_msgs::msg::ItsPduHeader&& _header) { m_header = std::move(_header); @@ -162,7 +120,7 @@ void carla_msgs::msg::CarlaV2XCustomMessage::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustomMessage::header() const +const etsi_its_cam_msgs::msg::ItsPduHeader& CarlaV2XCustomMessage::header() const { return m_header; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustomMessa * @brief This function returns a reference to member header * @return Reference to member header */ -etsi_its_cam_msgs::msg::ItsPduHeader& carla_msgs::msg::CarlaV2XCustomMessage::header() +etsi_its_cam_msgs::msg::ItsPduHeader& CarlaV2XCustomMessage::header() { return m_header; } + + /*! * @brief This function copies the value in member data * @param _data New value to be copied in member data */ -void carla_msgs::msg::CarlaV2XCustomMessage::data( +void CarlaV2XCustomMessage::data( const carla_msgs::msg::CarlaV2XByteArray& _data) { m_data = _data; @@ -189,7 +149,7 @@ void carla_msgs::msg::CarlaV2XCustomMessage::data( * @brief This function moves the value in member data * @param _data New value to be moved in member data */ -void carla_msgs::msg::CarlaV2XCustomMessage::data( +void CarlaV2XCustomMessage::data( carla_msgs::msg::CarlaV2XByteArray&& _data) { m_data = std::move(_data); @@ -199,7 +159,7 @@ void carla_msgs::msg::CarlaV2XCustomMessage::data( * @brief This function returns a constant reference to member data * @return Constant reference to member data */ -const carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XCustomMessage::data() const +const carla_msgs::msg::CarlaV2XByteArray& CarlaV2XCustomMessage::data() const { return m_data; } @@ -208,31 +168,18 @@ const carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XCustomMessage * @brief This function returns a reference to member data * @return Reference to member data */ -carla_msgs::msg::CarlaV2XByteArray& carla_msgs::msg::CarlaV2XCustomMessage::data() +carla_msgs::msg::CarlaV2XByteArray& CarlaV2XCustomMessage::data() { return m_data; } -size_t carla_msgs::msg::CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaV2XCustomMessage::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaV2XCustomMessage::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaV2XCustomMessageCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.h index a922fc393a0..45f62093824 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessage.h @@ -16,21 +16,26 @@ * @file CarlaV2XCustomMessage.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_H_ -#include "etsi_its_cam_msgs/msg/ItsPduHeader.h" -#include "CarlaV2XByteArray.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "etsi_its_cam_msgs/msg/ItsPduHeader.h" +#include "CarlaV2XByteArray.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaV2XCustomMessage_SOURCE) -#define CarlaV2XCustomMessage_DllAPI __declspec( dllexport ) +#if defined(CARLAV2XCUSTOMMESSAGE_SOURCE) +#define CARLAV2XCUSTOMMESSAGE_DllAPI __declspec( dllexport ) #else -#define CarlaV2XCustomMessage_DllAPI __declspec( dllimport ) -#endif // CarlaV2XCustomMessage_SOURCE +#define CARLAV2XCUSTOMMESSAGE_DllAPI __declspec( dllimport ) +#endif // CARLAV2XCUSTOMMESSAGE_SOURCE #else -#define CarlaV2XCustomMessage_DllAPI +#define CARLAV2XCUSTOMMESSAGE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaV2XCustomMessage_DllAPI +#define CARLAV2XCUSTOMMESSAGE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaV2XCustomMessage defined by the user in the IDL file. - * @ingroup CARLAV2XCUSTOMMESSAGE - */ - class CarlaV2XCustomMessage - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaV2XCustomMessage(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaV2XCustomMessage(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomMessage( - const CarlaV2XCustomMessage& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomMessage( - CarlaV2XCustomMessage&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomMessage& operator =( - const CarlaV2XCustomMessage& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. - */ - eProsima_user_DllExport CarlaV2XCustomMessage& operator =( - CarlaV2XCustomMessage&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XCustomMessage object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaV2XCustomMessage& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XCustomMessage object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaV2XCustomMessage& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const etsi_its_cam_msgs::msg::ItsPduHeader& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - etsi_its_cam_msgs::msg::ItsPduHeader&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ItsPduHeader& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ItsPduHeader& header(); - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const carla_msgs::msg::CarlaV2XByteArray& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - carla_msgs::msg::CarlaV2XByteArray&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const carla_msgs::msg::CarlaV2XByteArray& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport carla_msgs::msg::CarlaV2XByteArray& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XCustomMessage& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::ItsPduHeader m_header; - carla_msgs::msg::CarlaV2XByteArray m_data; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaV2XCustomMessage defined by the user in the IDL file. + * @ingroup CarlaV2XCustomMessage + */ +class CarlaV2XCustomMessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XCustomMessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XCustomMessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomMessage( + const CarlaV2XCustomMessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomMessage( + CarlaV2XCustomMessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomMessage& operator =( + const CarlaV2XCustomMessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XCustomMessage that will be copied. + */ + eProsima_user_DllExport CarlaV2XCustomMessage& operator =( + CarlaV2XCustomMessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomMessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XCustomMessage& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XCustomMessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XCustomMessage& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const etsi_its_cam_msgs::msg::ItsPduHeader& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + etsi_its_cam_msgs::msg::ItsPduHeader&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ItsPduHeader& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ItsPduHeader& header(); + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const carla_msgs::msg::CarlaV2XByteArray& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + carla_msgs::msg::CarlaV2XByteArray&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaV2XByteArray& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport carla_msgs::msg::CarlaV2XByteArray& data(); + +private: + + etsi_its_cam_msgs::msg::ItsPduHeader m_header; + carla_msgs::msg::CarlaV2XByteArray m_data; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessageCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessageCdrAux.hpp new file mode 100644 index 00000000000..b69e18cba75 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessageCdrAux.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomMessageCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGECDRAUX_HPP_ + +#include "CarlaV2XCustomMessage.h" + +constexpr uint32_t carla_msgs_msg_CarlaV2XCustomMessage_max_cdr_typesize {125UL}; +constexpr uint32_t carla_msgs_msg_CarlaV2XCustomMessage_max_key_cdr_typesize {0UL}; + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomMessage& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessageCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessageCdrAux.ipp new file mode 100644 index 00000000000..c7d891f6c34 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessageCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XCustomMessageCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGECDRAUX_IPP_ + +#include "CarlaV2XCustomMessageCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaV2XCustomMessage& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomMessage& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.data() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaV2XCustomMessage& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XCustomMessage& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.cxx index 873197c3293..46b6fb68edb 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaV2XCustomMessagePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaV2XCustomMessagePubSubTypes.h" +#include "CarlaV2XCustomMessageCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaV2XCustomMessagePubSubType::CarlaV2XCustomMessagePubSubType() - { - setName("carla_msgs::msg::dds_::CarlaV2XCustomMessage_"); - auto type_size = CarlaV2XCustomMessage::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaV2XCustomMessage::isKeyDefined(); - size_t keyLength = CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize() > 16 ? - CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaV2XCustomMessagePubSubType::~CarlaV2XCustomMessagePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaV2XCustomMessagePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaV2XCustomMessage* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaV2XCustomMessagePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaV2XCustomMessage* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaV2XCustomMessagePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaV2XCustomMessagePubSubType::createData() - { - return reinterpret_cast(new CarlaV2XCustomMessage()); - } - - void CarlaV2XCustomMessagePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaV2XCustomMessagePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaV2XCustomMessage* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaV2XCustomMessage::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaV2XCustomMessagePubSubType::CarlaV2XCustomMessagePubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaV2XCustomMessage_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaV2XCustomMessage::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaV2XCustomMessage_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaV2XCustomMessagePubSubType::~CarlaV2XCustomMessagePubSubType() +{ +} + +bool CarlaV2XCustomMessagePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaV2XCustomMessage* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaV2XCustomMessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaV2XCustomMessage* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaV2XCustomMessagePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaV2XCustomMessagePubSubType::createData() +{ + return reinterpret_cast(new CarlaV2XCustomMessage()); +} + +void CarlaV2XCustomMessagePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaV2XCustomMessagePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.h index 77c8d6cafde..77b52d097e9 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomMessagePubSubTypes.h @@ -16,92 +16,122 @@ * @file CarlaV2XCustomMessagePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaV2XCustomMessage.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h" +#include "CarlaV2XByteArrayPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaV2XCustomMessage is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaV2XCustomMessage defined by the user in the IDL file. + * @ingroup CarlaV2XCustomMessage + */ +class CarlaV2XCustomMessagePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaV2XCustomMessage defined by the user in the IDL file. - * @ingroup CARLAV2XCUSTOMMESSAGE - */ - class CarlaV2XCustomMessagePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaV2XCustomMessage type; + typedef CarlaV2XCustomMessage type; - eProsima_user_DllExport CarlaV2XCustomMessagePubSubType(); + eProsima_user_DllExport CarlaV2XCustomMessagePubSubType(); - eProsima_user_DllExport virtual ~CarlaV2XCustomMessagePubSubType(); + eProsima_user_DllExport ~CarlaV2XCustomMessagePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaV2XCustomMessage(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOMMESSAGE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.cxx deleted file mode 100644 index 83520b6d783..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.cxx +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CarlaV2XCustomPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - - -#include -#include - -#include "CarlaV2XCustomPubSubTypes.h" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; - -namespace carla_msgs { - namespace msg { - CarlaV2XCustomPubSubType::CarlaV2XCustomPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaV2XCustom_"); - auto type_size = CarlaV2XCustom::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaV2XCustom::isKeyDefined(); - size_t keyLength = CarlaV2XCustom::getKeyMaxCdrSerializedSize() > 16 ? - CarlaV2XCustom::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaV2XCustomPubSubType::~CarlaV2XCustomPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaV2XCustomPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaV2XCustom* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaV2XCustomPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaV2XCustom* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaV2XCustomPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaV2XCustomPubSubType::createData() - { - return reinterpret_cast(new CarlaV2XCustom()); - } - - void CarlaV2XCustomPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaV2XCustomPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaV2XCustom* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaV2XCustom::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaV2XCustom::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg - -} //End of namespace carla_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.h deleted file mode 100644 index 5f8f40b70fb..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XCustomPubSubTypes.h +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CarlaV2XCustomPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - - -#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_PUBSUBTYPES_H_ - -#include -#include - -#include "CarlaV2XCustom.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated CarlaV2XCustom is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace carla_msgs -{ - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaV2XCustom defined by the user in the IDL file. - * @ingroup CARLAV2XCUSTOM - */ - class CarlaV2XCustomPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef CarlaV2XCustom type; - - eProsima_user_DllExport CarlaV2XCustomPubSubType(); - - eProsima_user_DllExport virtual ~CarlaV2XCustomPubSubType(); - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - }; - } -} - -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XCUSTOM_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.cxx index d47aa161353..fbc86a77da7 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaV2XData.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,126 +27,80 @@ char dummy; #endif // _WIN32 #include "CarlaV2XData.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaV2XData::CarlaV2XData() -{ - // m_power com.eprosima.idl.parser.typecode.PrimitiveTypeCode@f1da57d - m_power = 0.0; - // m_message com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@72c8e7b + +namespace carla_msgs { + +namespace msg { -} -carla_msgs::msg::CarlaV2XData::~CarlaV2XData() +CarlaV2XData::CarlaV2XData() { +} +CarlaV2XData::~CarlaV2XData() +{ } -carla_msgs::msg::CarlaV2XData::CarlaV2XData( +CarlaV2XData::CarlaV2XData( const CarlaV2XData& x) { m_power = x.m_power; m_message = x.m_message; } -carla_msgs::msg::CarlaV2XData::CarlaV2XData( - CarlaV2XData&& x) +CarlaV2XData::CarlaV2XData( + CarlaV2XData&& x) noexcept { m_power = x.m_power; m_message = std::move(x.m_message); } -carla_msgs::msg::CarlaV2XData& carla_msgs::msg::CarlaV2XData::operator =( +CarlaV2XData& CarlaV2XData::operator =( const CarlaV2XData& x) { m_power = x.m_power; m_message = x.m_message; - return *this; } -carla_msgs::msg::CarlaV2XData& carla_msgs::msg::CarlaV2XData::operator =( - CarlaV2XData&& x) +CarlaV2XData& CarlaV2XData::operator =( + CarlaV2XData&& x) noexcept { m_power = x.m_power; m_message = std::move(x.m_message); - return *this; } -bool carla_msgs::msg::CarlaV2XData::operator ==( +bool CarlaV2XData::operator ==( const CarlaV2XData& x) const { - - return (m_power == x.m_power && m_message == x.m_message); + return (m_power == x.m_power && + m_message == x.m_message); } -bool carla_msgs::msg::CarlaV2XData::operator !=( +bool CarlaV2XData::operator !=( const CarlaV2XData& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaV2XData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += etsi_its_cam_msgs::msg::CAM::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaV2XData::getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += etsi_its_cam_msgs::msg::CAM::getCdrSerializedSize(data.message(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaV2XData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_power; - scdr << m_message; - -} - -void carla_msgs::msg::CarlaV2XData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_power; - dcdr >> m_message; -} - /*! * @brief This function sets a value in member power * @param _power New value for member power */ -void carla_msgs::msg::CarlaV2XData::power( +void CarlaV2XData::power( float _power) { m_power = _power; @@ -156,7 +110,7 @@ void carla_msgs::msg::CarlaV2XData::power( * @brief This function returns the value of member power * @return Value of member power */ -float carla_msgs::msg::CarlaV2XData::power() const +float CarlaV2XData::power() const { return m_power; } @@ -165,16 +119,17 @@ float carla_msgs::msg::CarlaV2XData::power() const * @brief This function returns a reference to member power * @return Reference to member power */ -float& carla_msgs::msg::CarlaV2XData::power() +float& CarlaV2XData::power() { return m_power; } + /*! * @brief This function copies the value in member message * @param _message New value to be copied in member message */ -void carla_msgs::msg::CarlaV2XData::message( +void CarlaV2XData::message( const etsi_its_cam_msgs::msg::CAM& _message) { m_message = _message; @@ -184,7 +139,7 @@ void carla_msgs::msg::CarlaV2XData::message( * @brief This function moves the value in member message * @param _message New value to be moved in member message */ -void carla_msgs::msg::CarlaV2XData::message( +void CarlaV2XData::message( etsi_its_cam_msgs::msg::CAM&& _message) { m_message = std::move(_message); @@ -194,7 +149,7 @@ void carla_msgs::msg::CarlaV2XData::message( * @brief This function returns a constant reference to member message * @return Constant reference to member message */ -const etsi_its_cam_msgs::msg::CAM& carla_msgs::msg::CarlaV2XData::message() const +const etsi_its_cam_msgs::msg::CAM& CarlaV2XData::message() const { return m_message; } @@ -203,31 +158,18 @@ const etsi_its_cam_msgs::msg::CAM& carla_msgs::msg::CarlaV2XData::message() cons * @brief This function returns a reference to member message * @return Reference to member message */ -etsi_its_cam_msgs::msg::CAM& carla_msgs::msg::CarlaV2XData::message() +etsi_its_cam_msgs::msg::CAM& CarlaV2XData::message() { return m_message; } -size_t carla_msgs::msg::CarlaV2XData::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool carla_msgs::msg::CarlaV2XData::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaV2XData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaV2XDataCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.h index 55f36360acb..7eae7d5546c 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XData.h @@ -16,20 +16,25 @@ * @file CarlaV2XData.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_H_ -#include "etsi_its_cam_msgs/msg/CAM.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "etsi_its_cam_msgs/msg/CAM.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,195 +48,151 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaV2XData_SOURCE) -#define CarlaV2XData_DllAPI __declspec( dllexport ) +#if defined(CARLAV2XDATA_SOURCE) +#define CARLAV2XDATA_DllAPI __declspec( dllexport ) #else -#define CarlaV2XData_DllAPI __declspec( dllimport ) -#endif // CarlaV2XData_SOURCE +#define CARLAV2XDATA_DllAPI __declspec( dllimport ) +#endif // CARLAV2XDATA_SOURCE #else -#define CarlaV2XData_DllAPI +#define CARLAV2XDATA_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaV2XData_DllAPI +#define CARLAV2XDATA_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaV2XData defined by the user in the IDL file. - * @ingroup CARLAV2XDATA - */ - class CarlaV2XData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaV2XData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaV2XData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. - */ - eProsima_user_DllExport CarlaV2XData( - const CarlaV2XData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. - */ - eProsima_user_DllExport CarlaV2XData( - CarlaV2XData&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. - */ - eProsima_user_DllExport CarlaV2XData& operator =( - const CarlaV2XData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. - */ - eProsima_user_DllExport CarlaV2XData& operator =( - CarlaV2XData&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaV2XData& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaV2XData& x) const; - - /*! - * @brief This function sets a value in member power - * @param _power New value for member power - */ - eProsima_user_DllExport void power( - float _power); - - /*! - * @brief This function returns the value of member power - * @return Value of member power - */ - eProsima_user_DllExport float power() const; - - /*! - * @brief This function returns a reference to member power - * @return Reference to member power - */ - eProsima_user_DllExport float& power(); - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const etsi_its_cam_msgs::msg::CAM& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - etsi_its_cam_msgs::msg::CAM&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CAM& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CAM& message(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XData& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - float m_power; - etsi_its_cam_msgs::msg::CAM m_message; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaV2XData defined by the user in the IDL file. + * @ingroup CarlaV2XData + */ +class CarlaV2XData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. + */ + eProsima_user_DllExport CarlaV2XData( + const CarlaV2XData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. + */ + eProsima_user_DllExport CarlaV2XData( + CarlaV2XData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. + */ + eProsima_user_DllExport CarlaV2XData& operator =( + const CarlaV2XData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XData that will be copied. + */ + eProsima_user_DllExport CarlaV2XData& operator =( + CarlaV2XData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XData& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XData& x) const; + + /*! + * @brief This function sets a value in member power + * @param _power New value for member power + */ + eProsima_user_DllExport void power( + float _power); + + /*! + * @brief This function returns the value of member power + * @return Value of member power + */ + eProsima_user_DllExport float power() const; + + /*! + * @brief This function returns a reference to member power + * @return Reference to member power + */ + eProsima_user_DllExport float& power(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const etsi_its_cam_msgs::msg::CAM& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + etsi_its_cam_msgs::msg::CAM&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CAM& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CAM& message(); + +private: + + float m_power{0.0}; + etsi_its_cam_msgs::msg::CAM m_message; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataCdrAux.hpp new file mode 100644 index 00000000000..7910d091819 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataCdrAux.hpp @@ -0,0 +1,107 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XDataCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATACDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATACDRAUX_HPP_ + +#include "CarlaV2XData.h" + +constexpr uint32_t carla_msgs_msg_CarlaV2XData_max_cdr_typesize {12219UL}; +constexpr uint32_t carla_msgs_msg_CarlaV2XData_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XData& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATACDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataCdrAux.ipp new file mode 100644 index 00000000000..b4ee2a6c36c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XDataCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATACDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATACDRAUX_IPP_ + +#include "CarlaV2XDataCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaV2XData& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.power(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.message(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XData& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.power() + << eprosima::fastcdr::MemberId(1) << data.message() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaV2XData& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.power(); + break; + + case 1: + dcdr >> data.message(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XData& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATACDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.cxx index dbe4e1b9de1..99f69f6a719 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaV2XDataList.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,77 @@ char dummy; #endif // _WIN32 #include "CarlaV2XDataList.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaV2XDataList::CarlaV2XDataList() -{ - // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@60f00693 + +namespace carla_msgs { + +namespace msg { + + + +CarlaV2XDataList::CarlaV2XDataList() +{ } -carla_msgs::msg::CarlaV2XDataList::~CarlaV2XDataList() +CarlaV2XDataList::~CarlaV2XDataList() { } -carla_msgs::msg::CarlaV2XDataList::CarlaV2XDataList( +CarlaV2XDataList::CarlaV2XDataList( const CarlaV2XDataList& x) { m_data = x.m_data; } -carla_msgs::msg::CarlaV2XDataList::CarlaV2XDataList( - CarlaV2XDataList&& x) +CarlaV2XDataList::CarlaV2XDataList( + CarlaV2XDataList&& x) noexcept { m_data = std::move(x.m_data); } -carla_msgs::msg::CarlaV2XDataList& carla_msgs::msg::CarlaV2XDataList::operator =( +CarlaV2XDataList& CarlaV2XDataList::operator =( const CarlaV2XDataList& x) { m_data = x.m_data; - return *this; } -carla_msgs::msg::CarlaV2XDataList& carla_msgs::msg::CarlaV2XDataList::operator =( - CarlaV2XDataList&& x) +CarlaV2XDataList& CarlaV2XDataList::operator =( + CarlaV2XDataList&& x) noexcept { m_data = std::move(x.m_data); - return *this; } -bool carla_msgs::msg::CarlaV2XDataList::operator ==( +bool CarlaV2XDataList::operator ==( const CarlaV2XDataList& x) const { - return (m_data == x.m_data); } -bool carla_msgs::msg::CarlaV2XDataList::operator !=( +bool CarlaV2XDataList::operator !=( const CarlaV2XDataList& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaV2XDataList::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaV2XData::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaV2XDataList::getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XDataList& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.data().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaV2XData::getCdrSerializedSize(data.data().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaV2XDataList::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_data; -} - -void carla_msgs::msg::CarlaV2XDataList::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_data;} - /*! * @brief This function copies the value in member data * @param _data New value to be copied in member data */ -void carla_msgs::msg::CarlaV2XDataList::data( +void CarlaV2XDataList::data( const std::vector& _data) { m_data = _data; @@ -149,7 +107,7 @@ void carla_msgs::msg::CarlaV2XDataList::data( * @brief This function moves the value in member data * @param _data New value to be moved in member data */ -void carla_msgs::msg::CarlaV2XDataList::data( +void CarlaV2XDataList::data( std::vector&& _data) { m_data = std::move(_data); @@ -159,7 +117,7 @@ void carla_msgs::msg::CarlaV2XDataList::data( * @brief This function returns a constant reference to member data * @return Constant reference to member data */ -const std::vector& carla_msgs::msg::CarlaV2XDataList::data() const +const std::vector& CarlaV2XDataList::data() const { return m_data; } @@ -168,31 +126,18 @@ const std::vector& carla_msgs::msg::CarlaV2XDataL * @brief This function returns a reference to member data * @return Reference to member data */ -std::vector& carla_msgs::msg::CarlaV2XDataList::data() +std::vector& CarlaV2XDataList::data() { return m_data; } -size_t carla_msgs::msg::CarlaV2XDataList::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaV2XDataList::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaV2XDataList::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaV2XDataListCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.h index c223f5f2e55..ecb38146bd8 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataList.h @@ -16,20 +16,25 @@ * @file CarlaV2XDataList.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_H_ -#include "CarlaV2XData.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CarlaV2XData.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaV2XDataList_SOURCE) -#define CarlaV2XDataList_DllAPI __declspec( dllexport ) +#if defined(CARLAV2XDATALIST_SOURCE) +#define CARLAV2XDATALIST_DllAPI __declspec( dllexport ) #else -#define CarlaV2XDataList_DllAPI __declspec( dllimport ) -#endif // CarlaV2XDataList_SOURCE +#define CARLAV2XDATALIST_DllAPI __declspec( dllimport ) +#endif // CARLAV2XDATALIST_SOURCE #else -#define CarlaV2XDataList_DllAPI +#define CARLAV2XDATALIST_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaV2XDataList_DllAPI +#define CARLAV2XDATALIST_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaV2XDataList defined by the user in the IDL file. - * @ingroup CARLAV2XDATALIST - */ - class CarlaV2XDataList - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaV2XDataList(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaV2XDataList(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. - */ - eProsima_user_DllExport CarlaV2XDataList( - const CarlaV2XDataList& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. - */ - eProsima_user_DllExport CarlaV2XDataList( - CarlaV2XDataList&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. - */ - eProsima_user_DllExport CarlaV2XDataList& operator =( - const CarlaV2XDataList& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. - */ - eProsima_user_DllExport CarlaV2XDataList& operator =( - CarlaV2XDataList&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XDataList object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaV2XDataList& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaV2XDataList object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaV2XDataList& x) const; - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaV2XDataList& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_data; - }; - } // namespace msg + +namespace msg { + + + + + +/*! + * @brief This class represents the structure CarlaV2XDataList defined by the user in the IDL file. + * @ingroup CarlaV2XDataList + */ +class CarlaV2XDataList +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaV2XDataList(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaV2XDataList(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XDataList( + const CarlaV2XDataList& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XDataList( + CarlaV2XDataList&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XDataList& operator =( + const CarlaV2XDataList& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaV2XDataList that will be copied. + */ + eProsima_user_DllExport CarlaV2XDataList& operator =( + CarlaV2XDataList&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XDataList object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaV2XDataList& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaV2XDataList object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaV2XDataList& x) const; + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data(); + +private: + + std::vector m_data; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListCdrAux.hpp new file mode 100644 index 00000000000..9c55906a91f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListCdrAux.hpp @@ -0,0 +1,64 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XDataListCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALISTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALISTCDRAUX_HPP_ + +#include "CarlaV2XDataList.h" + +constexpr uint32_t carla_msgs_msg_CarlaV2XDataList_max_cdr_typesize {1222411UL}; +constexpr uint32_t carla_msgs_msg_CarlaV2XDataList_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XDataList& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALISTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListCdrAux.ipp new file mode 100644 index 00000000000..e3c4bb237cd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListCdrAux.ipp @@ -0,0 +1,132 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaV2XDataListCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALISTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALISTCDRAUX_IPP_ + +#include "CarlaV2XDataListCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaV2XDataList& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XDataList& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.data() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaV2XDataList& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaV2XDataList& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALISTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.cxx index 6fa29800f84..38eae96f550 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file CarlaV2XDataListPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaV2XDataListPubSubTypes.h" +#include "CarlaV2XDataListCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaV2XDataListPubSubType::CarlaV2XDataListPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaV2XDataList_"); - auto type_size = CarlaV2XDataList::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaV2XDataList::isKeyDefined(); - size_t keyLength = CarlaV2XDataList::getKeyMaxCdrSerializedSize() > 16 ? - CarlaV2XDataList::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaV2XDataListPubSubType::~CarlaV2XDataListPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaV2XDataListPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaV2XDataList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaV2XDataListPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaV2XDataList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaV2XDataListPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaV2XDataListPubSubType::createData() - { - return reinterpret_cast(new CarlaV2XDataList()); - } - - void CarlaV2XDataListPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaV2XDataListPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaV2XDataList* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaV2XDataList::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaV2XDataList::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +CarlaV2XDataListPubSubType::CarlaV2XDataListPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaV2XDataList_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaV2XDataList::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaV2XDataList_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaV2XDataListPubSubType::~CarlaV2XDataListPubSubType() +{ +} + +bool CarlaV2XDataListPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaV2XDataList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaV2XDataListPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaV2XDataList* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaV2XDataListPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaV2XDataListPubSubType::createData() +{ + return reinterpret_cast(new CarlaV2XDataList()); +} + +void CarlaV2XDataListPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaV2XDataListPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.h index 787738b46c3..69e81de7e3b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataListPubSubTypes.h @@ -16,92 +16,123 @@ * @file CarlaV2XDataListPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaV2XDataList.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CarlaV2XDataPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaV2XDataList is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaV2XDataList defined by the user in the IDL file. + * @ingroup CarlaV2XDataList + */ +class CarlaV2XDataListPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaV2XDataList defined by the user in the IDL file. - * @ingroup CARLAV2XDATALIST - */ - class CarlaV2XDataListPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaV2XDataList type; + typedef CarlaV2XDataList type; - eProsima_user_DllExport CarlaV2XDataListPubSubType(); + eProsima_user_DllExport CarlaV2XDataListPubSubType(); - eProsima_user_DllExport virtual ~CarlaV2XDataListPubSubType(); + eProsima_user_DllExport ~CarlaV2XDataListPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATALIST_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.cxx index 43a907f6064..a1dace40945 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaV2XDataPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaV2XDataPubSubTypes.h" +#include "CarlaV2XDataCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaV2XDataPubSubType::CarlaV2XDataPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaV2XData_"); - auto type_size = CarlaV2XData::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaV2XData::isKeyDefined(); - size_t keyLength = CarlaV2XData::getKeyMaxCdrSerializedSize() > 16 ? - CarlaV2XData::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaV2XDataPubSubType::~CarlaV2XDataPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaV2XDataPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaV2XData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaV2XDataPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaV2XData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaV2XDataPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaV2XDataPubSubType::createData() - { - return reinterpret_cast(new CarlaV2XData()); - } - - void CarlaV2XDataPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaV2XDataPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaV2XData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaV2XData::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaV2XData::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaV2XDataPubSubType::CarlaV2XDataPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaV2XData_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaV2XData::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaV2XData_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaV2XDataPubSubType::~CarlaV2XDataPubSubType() +{ +} + +bool CarlaV2XDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaV2XData* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaV2XDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaV2XData* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaV2XDataPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaV2XDataPubSubType::createData() +{ + return reinterpret_cast(new CarlaV2XData()); +} + +void CarlaV2XDataPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaV2XDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.h index d073f9fbc41..d9e06a6e093 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaV2XDataPubSubTypes.h @@ -16,92 +16,121 @@ * @file CarlaV2XDataPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaV2XData.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "etsi_its_cam_msgs/msg/CAMPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaV2XData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaV2XData defined by the user in the IDL file. + * @ingroup CarlaV2XData + */ +class CarlaV2XDataPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaV2XData defined by the user in the IDL file. - * @ingroup CARLAV2XDATA - */ - class CarlaV2XDataPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaV2XData type; + typedef CarlaV2XData type; - eProsima_user_DllExport CarlaV2XDataPubSubType(); + eProsima_user_DllExport CarlaV2XDataPubSubType(); - eProsima_user_DllExport virtual ~CarlaV2XDataPubSubType(); + eProsima_user_DllExport ~CarlaV2XDataPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAV2XDATA_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.cxx index b4bad442772..d44c271486b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaWalkerControl.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,34 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaWalkerControl.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaWalkerControl::CarlaWalkerControl() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5d99c6b5 - // m_direction com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@266374ef +namespace carla_msgs { - // m_speed com.eprosima.idl.parser.typecode.PrimitiveTypeCode@13b3d178 - m_speed = 0.0; - // m_jump com.eprosima.idl.parser.typecode.PrimitiveTypeCode@24c4ddae - m_jump = false; +namespace msg { -} - -carla_msgs::msg::CarlaWalkerControl::~CarlaWalkerControl() -{ +CarlaWalkerControl::CarlaWalkerControl() +{ +} +CarlaWalkerControl::~CarlaWalkerControl() +{ } -carla_msgs::msg::CarlaWalkerControl::CarlaWalkerControl( +CarlaWalkerControl::CarlaWalkerControl( const CarlaWalkerControl& x) { m_header = x.m_header; @@ -63,8 +60,8 @@ carla_msgs::msg::CarlaWalkerControl::CarlaWalkerControl( m_jump = x.m_jump; } -carla_msgs::msg::CarlaWalkerControl::CarlaWalkerControl( - CarlaWalkerControl&& x) +CarlaWalkerControl::CarlaWalkerControl( + CarlaWalkerControl&& x) noexcept { m_header = std::move(x.m_header); m_direction = std::move(x.m_direction); @@ -72,7 +69,7 @@ carla_msgs::msg::CarlaWalkerControl::CarlaWalkerControl( m_jump = x.m_jump; } -carla_msgs::msg::CarlaWalkerControl& carla_msgs::msg::CarlaWalkerControl::operator =( +CarlaWalkerControl& CarlaWalkerControl::operator =( const CarlaWalkerControl& x) { @@ -80,99 +77,40 @@ carla_msgs::msg::CarlaWalkerControl& carla_msgs::msg::CarlaWalkerControl::operat m_direction = x.m_direction; m_speed = x.m_speed; m_jump = x.m_jump; - return *this; } -carla_msgs::msg::CarlaWalkerControl& carla_msgs::msg::CarlaWalkerControl::operator =( - CarlaWalkerControl&& x) +CarlaWalkerControl& CarlaWalkerControl::operator =( + CarlaWalkerControl&& x) noexcept { m_header = std::move(x.m_header); m_direction = std::move(x.m_direction); m_speed = x.m_speed; m_jump = x.m_jump; - return *this; } -bool carla_msgs::msg::CarlaWalkerControl::operator ==( +bool CarlaWalkerControl::operator ==( const CarlaWalkerControl& x) const { - - return (m_header == x.m_header && m_direction == x.m_direction && m_speed == x.m_speed && m_jump == x.m_jump); + return (m_header == x.m_header && + m_direction == x.m_direction && + m_speed == x.m_speed && + m_jump == x.m_jump); } -bool carla_msgs::msg::CarlaWalkerControl::operator !=( +bool CarlaWalkerControl::operator !=( const CarlaWalkerControl& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaWalkerControl::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaWalkerControl::getCdrSerializedSize( - const carla_msgs::msg::CarlaWalkerControl& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.direction(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaWalkerControl::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_direction; - scdr << m_speed; - scdr << m_jump; - -} - -void carla_msgs::msg::CarlaWalkerControl::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_direction; - dcdr >> m_speed; - dcdr >> m_jump; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void carla_msgs::msg::CarlaWalkerControl::header( +void CarlaWalkerControl::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -182,7 +120,7 @@ void carla_msgs::msg::CarlaWalkerControl::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void carla_msgs::msg::CarlaWalkerControl::header( +void CarlaWalkerControl::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -192,7 +130,7 @@ void carla_msgs::msg::CarlaWalkerControl::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& carla_msgs::msg::CarlaWalkerControl::header() const +const std_msgs::msg::Header& CarlaWalkerControl::header() const { return m_header; } @@ -201,15 +139,17 @@ const std_msgs::msg::Header& carla_msgs::msg::CarlaWalkerControl::header() const * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& carla_msgs::msg::CarlaWalkerControl::header() +std_msgs::msg::Header& CarlaWalkerControl::header() { return m_header; } + + /*! * @brief This function copies the value in member direction * @param _direction New value to be copied in member direction */ -void carla_msgs::msg::CarlaWalkerControl::direction( +void CarlaWalkerControl::direction( const geometry_msgs::msg::Vector3& _direction) { m_direction = _direction; @@ -219,7 +159,7 @@ void carla_msgs::msg::CarlaWalkerControl::direction( * @brief This function moves the value in member direction * @param _direction New value to be moved in member direction */ -void carla_msgs::msg::CarlaWalkerControl::direction( +void CarlaWalkerControl::direction( geometry_msgs::msg::Vector3&& _direction) { m_direction = std::move(_direction); @@ -229,7 +169,7 @@ void carla_msgs::msg::CarlaWalkerControl::direction( * @brief This function returns a constant reference to member direction * @return Constant reference to member direction */ -const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaWalkerControl::direction() const +const geometry_msgs::msg::Vector3& CarlaWalkerControl::direction() const { return m_direction; } @@ -238,15 +178,17 @@ const geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaWalkerControl::directio * @brief This function returns a reference to member direction * @return Reference to member direction */ -geometry_msgs::msg::Vector3& carla_msgs::msg::CarlaWalkerControl::direction() +geometry_msgs::msg::Vector3& CarlaWalkerControl::direction() { return m_direction; } + + /*! * @brief This function sets a value in member speed * @param _speed New value for member speed */ -void carla_msgs::msg::CarlaWalkerControl::speed( +void CarlaWalkerControl::speed( float _speed) { m_speed = _speed; @@ -256,7 +198,7 @@ void carla_msgs::msg::CarlaWalkerControl::speed( * @brief This function returns the value of member speed * @return Value of member speed */ -float carla_msgs::msg::CarlaWalkerControl::speed() const +float CarlaWalkerControl::speed() const { return m_speed; } @@ -265,16 +207,17 @@ float carla_msgs::msg::CarlaWalkerControl::speed() const * @brief This function returns a reference to member speed * @return Reference to member speed */ -float& carla_msgs::msg::CarlaWalkerControl::speed() +float& CarlaWalkerControl::speed() { return m_speed; } + /*! * @brief This function sets a value in member jump * @param _jump New value for member jump */ -void carla_msgs::msg::CarlaWalkerControl::jump( +void CarlaWalkerControl::jump( bool _jump) { m_jump = _jump; @@ -284,7 +227,7 @@ void carla_msgs::msg::CarlaWalkerControl::jump( * @brief This function returns the value of member jump * @return Value of member jump */ -bool carla_msgs::msg::CarlaWalkerControl::jump() const +bool CarlaWalkerControl::jump() const { return m_jump; } @@ -293,32 +236,18 @@ bool carla_msgs::msg::CarlaWalkerControl::jump() const * @brief This function returns a reference to member jump * @return Reference to member jump */ -bool& carla_msgs::msg::CarlaWalkerControl::jump() +bool& CarlaWalkerControl::jump() { return m_jump; } -size_t carla_msgs::msg::CarlaWalkerControl::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool carla_msgs::msg::CarlaWalkerControl::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaWalkerControl::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaWalkerControlCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.h index 262e21061da..e254790aeef 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControl.h @@ -16,21 +16,26 @@ * @file CarlaWalkerControl.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_H_ -#include "geometry_msgs/msg/Vector3.h" -#include "std_msgs/msg/Header.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "geometry_msgs/msg/Vector3.h" +#include "std_msgs/msg/Header.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,241 +49,200 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaWalkerControl_SOURCE) -#define CarlaWalkerControl_DllAPI __declspec( dllexport ) +#if defined(CARLAWALKERCONTROL_SOURCE) +#define CARLAWALKERCONTROL_DllAPI __declspec( dllexport ) #else -#define CarlaWalkerControl_DllAPI __declspec( dllimport ) -#endif // CarlaWalkerControl_SOURCE +#define CARLAWALKERCONTROL_DllAPI __declspec( dllimport ) +#endif // CARLAWALKERCONTROL_SOURCE #else -#define CarlaWalkerControl_DllAPI +#define CARLAWALKERCONTROL_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaWalkerControl_DllAPI +#define CARLAWALKERCONTROL_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaWalkerControl defined by the user in the IDL file. - * @ingroup CARLAWALKERCONTROL - */ - class CarlaWalkerControl - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaWalkerControl(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaWalkerControl(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. - */ - eProsima_user_DllExport CarlaWalkerControl( - const CarlaWalkerControl& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. - */ - eProsima_user_DllExport CarlaWalkerControl( - CarlaWalkerControl&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. - */ - eProsima_user_DllExport CarlaWalkerControl& operator =( - const CarlaWalkerControl& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. - */ - eProsima_user_DllExport CarlaWalkerControl& operator =( - CarlaWalkerControl&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaWalkerControl object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaWalkerControl& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaWalkerControl object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaWalkerControl& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member direction - * @param _direction New value to be copied in member direction - */ - eProsima_user_DllExport void direction( - const geometry_msgs::msg::Vector3& _direction); - - /*! - * @brief This function moves the value in member direction - * @param _direction New value to be moved in member direction - */ - eProsima_user_DllExport void direction( - geometry_msgs::msg::Vector3&& _direction); - - /*! - * @brief This function returns a constant reference to member direction - * @return Constant reference to member direction - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& direction() const; - - /*! - * @brief This function returns a reference to member direction - * @return Reference to member direction - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& direction(); - /*! - * @brief This function sets a value in member speed - * @param _speed New value for member speed - */ - eProsima_user_DllExport void speed( - float _speed); - - /*! - * @brief This function returns the value of member speed - * @return Value of member speed - */ - eProsima_user_DllExport float speed() const; - - /*! - * @brief This function returns a reference to member speed - * @return Reference to member speed - */ - eProsima_user_DllExport float& speed(); - - /*! - * @brief This function sets a value in member jump - * @param _jump New value for member jump - */ - eProsima_user_DllExport void jump( - bool _jump); - - /*! - * @brief This function returns the value of member jump - * @return Value of member jump - */ - eProsima_user_DllExport bool jump() const; - - /*! - * @brief This function returns a reference to member jump - * @return Reference to member jump - */ - eProsima_user_DllExport bool& jump(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaWalkerControl& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - geometry_msgs::msg::Vector3 m_direction; - float m_speed; - bool m_jump; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaWalkerControl defined by the user in the IDL file. + * @ingroup CarlaWalkerControl + */ +class CarlaWalkerControl +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaWalkerControl(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaWalkerControl(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. + */ + eProsima_user_DllExport CarlaWalkerControl( + const CarlaWalkerControl& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. + */ + eProsima_user_DllExport CarlaWalkerControl( + CarlaWalkerControl&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. + */ + eProsima_user_DllExport CarlaWalkerControl& operator =( + const CarlaWalkerControl& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWalkerControl that will be copied. + */ + eProsima_user_DllExport CarlaWalkerControl& operator =( + CarlaWalkerControl&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWalkerControl object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaWalkerControl& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWalkerControl object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaWalkerControl& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member direction + * @param _direction New value to be copied in member direction + */ + eProsima_user_DllExport void direction( + const geometry_msgs::msg::Vector3& _direction); + + /*! + * @brief This function moves the value in member direction + * @param _direction New value to be moved in member direction + */ + eProsima_user_DllExport void direction( + geometry_msgs::msg::Vector3&& _direction); + + /*! + * @brief This function returns a constant reference to member direction + * @return Constant reference to member direction + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& direction() const; + + /*! + * @brief This function returns a reference to member direction + * @return Reference to member direction + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& direction(); + + + /*! + * @brief This function sets a value in member speed + * @param _speed New value for member speed + */ + eProsima_user_DllExport void speed( + float _speed); + + /*! + * @brief This function returns the value of member speed + * @return Value of member speed + */ + eProsima_user_DllExport float speed() const; + + /*! + * @brief This function returns a reference to member speed + * @return Reference to member speed + */ + eProsima_user_DllExport float& speed(); + + + /*! + * @brief This function sets a value in member jump + * @param _jump New value for member jump + */ + eProsima_user_DllExport void jump( + bool _jump); + + /*! + * @brief This function returns the value of member jump + * @return Value of member jump + */ + eProsima_user_DllExport bool jump() const; + + /*! + * @brief This function returns a reference to member jump + * @return Reference to member jump + */ + eProsima_user_DllExport bool& jump(); + +private: + + std_msgs::msg::Header m_header; + geometry_msgs::msg::Vector3 m_direction; + float m_speed{0.0}; + bool m_jump{false}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlCdrAux.hpp new file mode 100644 index 00000000000..bee8cce69f8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWalkerControlCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROLCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROLCDRAUX_HPP_ + +#include "CarlaWalkerControl.h" + +constexpr uint32_t carla_msgs_msg_CarlaWalkerControl_max_cdr_typesize {317UL}; +constexpr uint32_t carla_msgs_msg_CarlaWalkerControl_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWalkerControl& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROLCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlCdrAux.ipp new file mode 100644 index 00000000000..7cffeeee60d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlCdrAux.ipp @@ -0,0 +1,154 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWalkerControlCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROLCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROLCDRAUX_IPP_ + +#include "CarlaWalkerControlCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaWalkerControl& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.direction(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.speed(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.jump(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWalkerControl& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.direction() + << eprosima::fastcdr::MemberId(2) << data.speed() + << eprosima::fastcdr::MemberId(3) << data.jump() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaWalkerControl& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.direction(); + break; + + case 2: + dcdr >> data.speed(); + break; + + case 3: + dcdr >> data.jump(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWalkerControl& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROLCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.cxx index 20477573866..e77cbb3f7bb 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaWalkerControlPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaWalkerControlPubSubTypes.h" +#include "CarlaWalkerControlCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaWalkerControlPubSubType::CarlaWalkerControlPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaWalkerControl_"); - auto type_size = CarlaWalkerControl::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaWalkerControl::isKeyDefined(); - size_t keyLength = CarlaWalkerControl::getKeyMaxCdrSerializedSize() > 16 ? - CarlaWalkerControl::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaWalkerControlPubSubType::~CarlaWalkerControlPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaWalkerControlPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaWalkerControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaWalkerControlPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaWalkerControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaWalkerControlPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaWalkerControlPubSubType::createData() - { - return reinterpret_cast(new CarlaWalkerControl()); - } - - void CarlaWalkerControlPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaWalkerControlPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaWalkerControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaWalkerControl::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaWalkerControl::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaWalkerControlPubSubType::CarlaWalkerControlPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaWalkerControl_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaWalkerControl::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaWalkerControl_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaWalkerControlPubSubType::~CarlaWalkerControlPubSubType() +{ +} + +bool CarlaWalkerControlPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaWalkerControl* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaWalkerControlPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaWalkerControl* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaWalkerControlPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaWalkerControlPubSubType::createData() +{ + return reinterpret_cast(new CarlaWalkerControl()); +} + +void CarlaWalkerControlPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaWalkerControlPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.h index e9aff523706..9089189eca9 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWalkerControlPubSubTypes.h @@ -16,92 +16,122 @@ * @file CarlaWalkerControlPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaWalkerControl.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "geometry_msgs/msg/Vector3PubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaWalkerControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaWalkerControl defined by the user in the IDL file. + * @ingroup CarlaWalkerControl + */ +class CarlaWalkerControlPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaWalkerControl defined by the user in the IDL file. - * @ingroup CARLAWALKERCONTROL - */ - class CarlaWalkerControlPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaWalkerControl type; + typedef CarlaWalkerControl type; - eProsima_user_DllExport CarlaWalkerControlPubSubType(); + eProsima_user_DllExport CarlaWalkerControlPubSubType(); - eProsima_user_DllExport virtual ~CarlaWalkerControlPubSubType(); + eProsima_user_DllExport ~CarlaWalkerControlPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWALKERCONTROL_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx index 374a0da076f..1d1b0022dc4 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaWeatherParameters.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,64 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaWeatherParameters.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters() -{ - // m_cloudiness com.eprosima.idl.parser.typecode.PrimitiveTypeCode@32a068d1 - m_cloudiness = 0.0; - // m_precipitation com.eprosima.idl.parser.typecode.PrimitiveTypeCode@33cb5951 - m_precipitation = 0.0; - // m_precipitation_deposits com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fad8c79 - m_precipitation_deposits = 0.0; - // m_wind_intensity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71a794e5 - m_wind_intensity = 0.0; - // m_sun_azimuth_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@76329302 - m_sun_azimuth_angle = 0.0; - // m_sun_altitude_angle com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e25a92e - m_sun_altitude_angle = 0.0; - // m_fog_density com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4df828d7 - m_fog_density = 0.0; - // m_fog_distance com.eprosima.idl.parser.typecode.PrimitiveTypeCode@b59d31 - m_fog_distance = 0.0; - // m_fog_falloff com.eprosima.idl.parser.typecode.PrimitiveTypeCode@62fdb4a6 - m_fog_falloff = 0.0; - // m_wetness com.eprosima.idl.parser.typecode.PrimitiveTypeCode@11e21d0e - m_wetness = 0.0; - // m_scattering_intensity com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1dd02175 - m_scattering_intensity = 0.0; - // m_mie_scattering_scale com.eprosima.idl.parser.typecode.PrimitiveTypeCode@31206beb - m_mie_scattering_scale = 0.0; - // m_rayleigh_scattering_scale com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3e77a1ed - m_rayleigh_scattering_scale = 0.0331; - // m_dust_storm com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3ffcd140 - m_dust_storm = 0.0; - -} - -carla_msgs::msg::CarlaWeatherParameters::~CarlaWeatherParameters() -{ - - - - - - - +namespace carla_msgs { +namespace msg { +CarlaWeatherParameters::CarlaWeatherParameters() +{ +} +CarlaWeatherParameters::~CarlaWeatherParameters() +{ } -carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( +CarlaWeatherParameters::CarlaWeatherParameters( const CarlaWeatherParameters& x) { m_cloudiness = x.m_cloudiness; @@ -103,8 +70,8 @@ carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( m_dust_storm = x.m_dust_storm; } -carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( - CarlaWeatherParameters&& x) +CarlaWeatherParameters::CarlaWeatherParameters( + CarlaWeatherParameters&& x) noexcept { m_cloudiness = x.m_cloudiness; m_precipitation = x.m_precipitation; @@ -122,7 +89,7 @@ carla_msgs::msg::CarlaWeatherParameters::CarlaWeatherParameters( m_dust_storm = x.m_dust_storm; } -carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters::operator =( +CarlaWeatherParameters& CarlaWeatherParameters::operator =( const CarlaWeatherParameters& x) { @@ -140,12 +107,11 @@ carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters m_mie_scattering_scale = x.m_mie_scattering_scale; m_rayleigh_scattering_scale = x.m_rayleigh_scattering_scale; m_dust_storm = x.m_dust_storm; - return *this; } -carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters::operator =( - CarlaWeatherParameters&& x) +CarlaWeatherParameters& CarlaWeatherParameters::operator =( + CarlaWeatherParameters&& x) noexcept { m_cloudiness = x.m_cloudiness; @@ -162,175 +128,39 @@ carla_msgs::msg::CarlaWeatherParameters& carla_msgs::msg::CarlaWeatherParameters m_mie_scattering_scale = x.m_mie_scattering_scale; m_rayleigh_scattering_scale = x.m_rayleigh_scattering_scale; m_dust_storm = x.m_dust_storm; - return *this; } -bool carla_msgs::msg::CarlaWeatherParameters::operator ==( +bool CarlaWeatherParameters::operator ==( const CarlaWeatherParameters& x) const { - - return (m_cloudiness == x.m_cloudiness && m_precipitation == x.m_precipitation && m_precipitation_deposits == x.m_precipitation_deposits && m_wind_intensity == x.m_wind_intensity && m_sun_azimuth_angle == x.m_sun_azimuth_angle && m_sun_altitude_angle == x.m_sun_altitude_angle && m_fog_density == x.m_fog_density && m_fog_distance == x.m_fog_distance && m_fog_falloff == x.m_fog_falloff && m_wetness == x.m_wetness && m_scattering_intensity == x.m_scattering_intensity && m_mie_scattering_scale == x.m_mie_scattering_scale && m_rayleigh_scattering_scale == x.m_rayleigh_scattering_scale && m_dust_storm == x.m_dust_storm); -} - -bool carla_msgs::msg::CarlaWeatherParameters::operator !=( + return (m_cloudiness == x.m_cloudiness && + m_precipitation == x.m_precipitation && + m_precipitation_deposits == x.m_precipitation_deposits && + m_wind_intensity == x.m_wind_intensity && + m_sun_azimuth_angle == x.m_sun_azimuth_angle && + m_sun_altitude_angle == x.m_sun_altitude_angle && + m_fog_density == x.m_fog_density && + m_fog_distance == x.m_fog_distance && + m_fog_falloff == x.m_fog_falloff && + m_wetness == x.m_wetness && + m_scattering_intensity == x.m_scattering_intensity && + m_mie_scattering_scale == x.m_mie_scattering_scale && + m_rayleigh_scattering_scale == x.m_rayleigh_scattering_scale && + m_dust_storm == x.m_dust_storm); +} + +bool CarlaWeatherParameters::operator !=( const CarlaWeatherParameters& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaWeatherParameters::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaWeatherParameters::getCdrSerializedSize( - const carla_msgs::msg::CarlaWeatherParameters& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaWeatherParameters::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_cloudiness; - scdr << m_precipitation; - scdr << m_precipitation_deposits; - scdr << m_wind_intensity; - scdr << m_sun_azimuth_angle; - scdr << m_sun_altitude_angle; - scdr << m_fog_density; - scdr << m_fog_distance; - scdr << m_fog_falloff; - scdr << m_wetness; - scdr << m_scattering_intensity; - scdr << m_mie_scattering_scale; - scdr << m_rayleigh_scattering_scale; - scdr << m_dust_storm; - -} - -void carla_msgs::msg::CarlaWeatherParameters::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_cloudiness; - dcdr >> m_precipitation; - dcdr >> m_precipitation_deposits; - dcdr >> m_wind_intensity; - dcdr >> m_sun_azimuth_angle; - dcdr >> m_sun_altitude_angle; - dcdr >> m_fog_density; - dcdr >> m_fog_distance; - dcdr >> m_fog_falloff; - dcdr >> m_wetness; - dcdr >> m_scattering_intensity; - dcdr >> m_mie_scattering_scale; - dcdr >> m_rayleigh_scattering_scale; - dcdr >> m_dust_storm; -} - /*! * @brief This function sets a value in member cloudiness * @param _cloudiness New value for member cloudiness */ -void carla_msgs::msg::CarlaWeatherParameters::cloudiness( +void CarlaWeatherParameters::cloudiness( float _cloudiness) { m_cloudiness = _cloudiness; @@ -340,7 +170,7 @@ void carla_msgs::msg::CarlaWeatherParameters::cloudiness( * @brief This function returns the value of member cloudiness * @return Value of member cloudiness */ -float carla_msgs::msg::CarlaWeatherParameters::cloudiness() const +float CarlaWeatherParameters::cloudiness() const { return m_cloudiness; } @@ -349,16 +179,17 @@ float carla_msgs::msg::CarlaWeatherParameters::cloudiness() const * @brief This function returns a reference to member cloudiness * @return Reference to member cloudiness */ -float& carla_msgs::msg::CarlaWeatherParameters::cloudiness() +float& CarlaWeatherParameters::cloudiness() { return m_cloudiness; } + /*! * @brief This function sets a value in member precipitation * @param _precipitation New value for member precipitation */ -void carla_msgs::msg::CarlaWeatherParameters::precipitation( +void CarlaWeatherParameters::precipitation( float _precipitation) { m_precipitation = _precipitation; @@ -368,7 +199,7 @@ void carla_msgs::msg::CarlaWeatherParameters::precipitation( * @brief This function returns the value of member precipitation * @return Value of member precipitation */ -float carla_msgs::msg::CarlaWeatherParameters::precipitation() const +float CarlaWeatherParameters::precipitation() const { return m_precipitation; } @@ -377,16 +208,17 @@ float carla_msgs::msg::CarlaWeatherParameters::precipitation() const * @brief This function returns a reference to member precipitation * @return Reference to member precipitation */ -float& carla_msgs::msg::CarlaWeatherParameters::precipitation() +float& CarlaWeatherParameters::precipitation() { return m_precipitation; } + /*! * @brief This function sets a value in member precipitation_deposits * @param _precipitation_deposits New value for member precipitation_deposits */ -void carla_msgs::msg::CarlaWeatherParameters::precipitation_deposits( +void CarlaWeatherParameters::precipitation_deposits( float _precipitation_deposits) { m_precipitation_deposits = _precipitation_deposits; @@ -396,7 +228,7 @@ void carla_msgs::msg::CarlaWeatherParameters::precipitation_deposits( * @brief This function returns the value of member precipitation_deposits * @return Value of member precipitation_deposits */ -float carla_msgs::msg::CarlaWeatherParameters::precipitation_deposits() const +float CarlaWeatherParameters::precipitation_deposits() const { return m_precipitation_deposits; } @@ -405,16 +237,17 @@ float carla_msgs::msg::CarlaWeatherParameters::precipitation_deposits() const * @brief This function returns a reference to member precipitation_deposits * @return Reference to member precipitation_deposits */ -float& carla_msgs::msg::CarlaWeatherParameters::precipitation_deposits() +float& CarlaWeatherParameters::precipitation_deposits() { return m_precipitation_deposits; } + /*! * @brief This function sets a value in member wind_intensity * @param _wind_intensity New value for member wind_intensity */ -void carla_msgs::msg::CarlaWeatherParameters::wind_intensity( +void CarlaWeatherParameters::wind_intensity( float _wind_intensity) { m_wind_intensity = _wind_intensity; @@ -424,7 +257,7 @@ void carla_msgs::msg::CarlaWeatherParameters::wind_intensity( * @brief This function returns the value of member wind_intensity * @return Value of member wind_intensity */ -float carla_msgs::msg::CarlaWeatherParameters::wind_intensity() const +float CarlaWeatherParameters::wind_intensity() const { return m_wind_intensity; } @@ -433,16 +266,17 @@ float carla_msgs::msg::CarlaWeatherParameters::wind_intensity() const * @brief This function returns a reference to member wind_intensity * @return Reference to member wind_intensity */ -float& carla_msgs::msg::CarlaWeatherParameters::wind_intensity() +float& CarlaWeatherParameters::wind_intensity() { return m_wind_intensity; } + /*! * @brief This function sets a value in member sun_azimuth_angle * @param _sun_azimuth_angle New value for member sun_azimuth_angle */ -void carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle( +void CarlaWeatherParameters::sun_azimuth_angle( float _sun_azimuth_angle) { m_sun_azimuth_angle = _sun_azimuth_angle; @@ -452,7 +286,7 @@ void carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle( * @brief This function returns the value of member sun_azimuth_angle * @return Value of member sun_azimuth_angle */ -float carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() const +float CarlaWeatherParameters::sun_azimuth_angle() const { return m_sun_azimuth_angle; } @@ -461,16 +295,17 @@ float carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() const * @brief This function returns a reference to member sun_azimuth_angle * @return Reference to member sun_azimuth_angle */ -float& carla_msgs::msg::CarlaWeatherParameters::sun_azimuth_angle() +float& CarlaWeatherParameters::sun_azimuth_angle() { return m_sun_azimuth_angle; } + /*! * @brief This function sets a value in member sun_altitude_angle * @param _sun_altitude_angle New value for member sun_altitude_angle */ -void carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle( +void CarlaWeatherParameters::sun_altitude_angle( float _sun_altitude_angle) { m_sun_altitude_angle = _sun_altitude_angle; @@ -480,7 +315,7 @@ void carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle( * @brief This function returns the value of member sun_altitude_angle * @return Value of member sun_altitude_angle */ -float carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() const +float CarlaWeatherParameters::sun_altitude_angle() const { return m_sun_altitude_angle; } @@ -489,16 +324,17 @@ float carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() const * @brief This function returns a reference to member sun_altitude_angle * @return Reference to member sun_altitude_angle */ -float& carla_msgs::msg::CarlaWeatherParameters::sun_altitude_angle() +float& CarlaWeatherParameters::sun_altitude_angle() { return m_sun_altitude_angle; } + /*! * @brief This function sets a value in member fog_density * @param _fog_density New value for member fog_density */ -void carla_msgs::msg::CarlaWeatherParameters::fog_density( +void CarlaWeatherParameters::fog_density( float _fog_density) { m_fog_density = _fog_density; @@ -508,7 +344,7 @@ void carla_msgs::msg::CarlaWeatherParameters::fog_density( * @brief This function returns the value of member fog_density * @return Value of member fog_density */ -float carla_msgs::msg::CarlaWeatherParameters::fog_density() const +float CarlaWeatherParameters::fog_density() const { return m_fog_density; } @@ -517,16 +353,17 @@ float carla_msgs::msg::CarlaWeatherParameters::fog_density() const * @brief This function returns a reference to member fog_density * @return Reference to member fog_density */ -float& carla_msgs::msg::CarlaWeatherParameters::fog_density() +float& CarlaWeatherParameters::fog_density() { return m_fog_density; } + /*! * @brief This function sets a value in member fog_distance * @param _fog_distance New value for member fog_distance */ -void carla_msgs::msg::CarlaWeatherParameters::fog_distance( +void CarlaWeatherParameters::fog_distance( float _fog_distance) { m_fog_distance = _fog_distance; @@ -536,7 +373,7 @@ void carla_msgs::msg::CarlaWeatherParameters::fog_distance( * @brief This function returns the value of member fog_distance * @return Value of member fog_distance */ -float carla_msgs::msg::CarlaWeatherParameters::fog_distance() const +float CarlaWeatherParameters::fog_distance() const { return m_fog_distance; } @@ -545,16 +382,17 @@ float carla_msgs::msg::CarlaWeatherParameters::fog_distance() const * @brief This function returns a reference to member fog_distance * @return Reference to member fog_distance */ -float& carla_msgs::msg::CarlaWeatherParameters::fog_distance() +float& CarlaWeatherParameters::fog_distance() { return m_fog_distance; } + /*! * @brief This function sets a value in member fog_falloff * @param _fog_falloff New value for member fog_falloff */ -void carla_msgs::msg::CarlaWeatherParameters::fog_falloff( +void CarlaWeatherParameters::fog_falloff( float _fog_falloff) { m_fog_falloff = _fog_falloff; @@ -564,7 +402,7 @@ void carla_msgs::msg::CarlaWeatherParameters::fog_falloff( * @brief This function returns the value of member fog_falloff * @return Value of member fog_falloff */ -float carla_msgs::msg::CarlaWeatherParameters::fog_falloff() const +float CarlaWeatherParameters::fog_falloff() const { return m_fog_falloff; } @@ -573,16 +411,17 @@ float carla_msgs::msg::CarlaWeatherParameters::fog_falloff() const * @brief This function returns a reference to member fog_falloff * @return Reference to member fog_falloff */ -float& carla_msgs::msg::CarlaWeatherParameters::fog_falloff() +float& CarlaWeatherParameters::fog_falloff() { return m_fog_falloff; } + /*! * @brief This function sets a value in member wetness * @param _wetness New value for member wetness */ -void carla_msgs::msg::CarlaWeatherParameters::wetness( +void CarlaWeatherParameters::wetness( float _wetness) { m_wetness = _wetness; @@ -592,7 +431,7 @@ void carla_msgs::msg::CarlaWeatherParameters::wetness( * @brief This function returns the value of member wetness * @return Value of member wetness */ -float carla_msgs::msg::CarlaWeatherParameters::wetness() const +float CarlaWeatherParameters::wetness() const { return m_wetness; } @@ -601,16 +440,17 @@ float carla_msgs::msg::CarlaWeatherParameters::wetness() const * @brief This function returns a reference to member wetness * @return Reference to member wetness */ -float& carla_msgs::msg::CarlaWeatherParameters::wetness() +float& CarlaWeatherParameters::wetness() { return m_wetness; } + /*! * @brief This function sets a value in member scattering_intensity * @param _scattering_intensity New value for member scattering_intensity */ -void carla_msgs::msg::CarlaWeatherParameters::scattering_intensity( +void CarlaWeatherParameters::scattering_intensity( float _scattering_intensity) { m_scattering_intensity = _scattering_intensity; @@ -620,7 +460,7 @@ void carla_msgs::msg::CarlaWeatherParameters::scattering_intensity( * @brief This function returns the value of member scattering_intensity * @return Value of member scattering_intensity */ -float carla_msgs::msg::CarlaWeatherParameters::scattering_intensity() const +float CarlaWeatherParameters::scattering_intensity() const { return m_scattering_intensity; } @@ -629,16 +469,17 @@ float carla_msgs::msg::CarlaWeatherParameters::scattering_intensity() const * @brief This function returns a reference to member scattering_intensity * @return Reference to member scattering_intensity */ -float& carla_msgs::msg::CarlaWeatherParameters::scattering_intensity() +float& CarlaWeatherParameters::scattering_intensity() { return m_scattering_intensity; } + /*! * @brief This function sets a value in member mie_scattering_scale * @param _mie_scattering_scale New value for member mie_scattering_scale */ -void carla_msgs::msg::CarlaWeatherParameters::mie_scattering_scale( +void CarlaWeatherParameters::mie_scattering_scale( float _mie_scattering_scale) { m_mie_scattering_scale = _mie_scattering_scale; @@ -648,7 +489,7 @@ void carla_msgs::msg::CarlaWeatherParameters::mie_scattering_scale( * @brief This function returns the value of member mie_scattering_scale * @return Value of member mie_scattering_scale */ -float carla_msgs::msg::CarlaWeatherParameters::mie_scattering_scale() const +float CarlaWeatherParameters::mie_scattering_scale() const { return m_mie_scattering_scale; } @@ -657,16 +498,17 @@ float carla_msgs::msg::CarlaWeatherParameters::mie_scattering_scale() const * @brief This function returns a reference to member mie_scattering_scale * @return Reference to member mie_scattering_scale */ -float& carla_msgs::msg::CarlaWeatherParameters::mie_scattering_scale() +float& CarlaWeatherParameters::mie_scattering_scale() { return m_mie_scattering_scale; } + /*! * @brief This function sets a value in member rayleigh_scattering_scale * @param _rayleigh_scattering_scale New value for member rayleigh_scattering_scale */ -void carla_msgs::msg::CarlaWeatherParameters::rayleigh_scattering_scale( +void CarlaWeatherParameters::rayleigh_scattering_scale( float _rayleigh_scattering_scale) { m_rayleigh_scattering_scale = _rayleigh_scattering_scale; @@ -676,7 +518,7 @@ void carla_msgs::msg::CarlaWeatherParameters::rayleigh_scattering_scale( * @brief This function returns the value of member rayleigh_scattering_scale * @return Value of member rayleigh_scattering_scale */ -float carla_msgs::msg::CarlaWeatherParameters::rayleigh_scattering_scale() const +float CarlaWeatherParameters::rayleigh_scattering_scale() const { return m_rayleigh_scattering_scale; } @@ -685,16 +527,17 @@ float carla_msgs::msg::CarlaWeatherParameters::rayleigh_scattering_scale() const * @brief This function returns a reference to member rayleigh_scattering_scale * @return Reference to member rayleigh_scattering_scale */ -float& carla_msgs::msg::CarlaWeatherParameters::rayleigh_scattering_scale() +float& CarlaWeatherParameters::rayleigh_scattering_scale() { return m_rayleigh_scattering_scale; } + /*! * @brief This function sets a value in member dust_storm * @param _dust_storm New value for member dust_storm */ -void carla_msgs::msg::CarlaWeatherParameters::dust_storm( +void CarlaWeatherParameters::dust_storm( float _dust_storm) { m_dust_storm = _dust_storm; @@ -704,7 +547,7 @@ void carla_msgs::msg::CarlaWeatherParameters::dust_storm( * @brief This function returns the value of member dust_storm * @return Value of member dust_storm */ -float carla_msgs::msg::CarlaWeatherParameters::dust_storm() const +float CarlaWeatherParameters::dust_storm() const { return m_dust_storm; } @@ -713,32 +556,18 @@ float carla_msgs::msg::CarlaWeatherParameters::dust_storm() const * @brief This function returns a reference to member dust_storm * @return Reference to member dust_storm */ -float& carla_msgs::msg::CarlaWeatherParameters::dust_storm() +float& CarlaWeatherParameters::dust_storm() { return m_dust_storm; } -size_t carla_msgs::msg::CarlaWeatherParameters::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool carla_msgs::msg::CarlaWeatherParameters::isKeyDefined() -{ - return false; -} - -void carla_msgs::msg::CarlaWeatherParameters::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaWeatherParametersCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h index 82399313c6c..0e09ed8e343 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParameters.h @@ -16,19 +16,24 @@ * @file CarlaWeatherParameters.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,429 +47,396 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaWeatherParameters_SOURCE) -#define CarlaWeatherParameters_DllAPI __declspec( dllexport ) +#if defined(CARLAWEATHERPARAMETERS_SOURCE) +#define CARLAWEATHERPARAMETERS_DllAPI __declspec( dllexport ) #else -#define CarlaWeatherParameters_DllAPI __declspec( dllimport ) -#endif // CarlaWeatherParameters_SOURCE +#define CARLAWEATHERPARAMETERS_DllAPI __declspec( dllimport ) +#endif // CARLAWEATHERPARAMETERS_SOURCE #else -#define CarlaWeatherParameters_DllAPI +#define CARLAWEATHERPARAMETERS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaWeatherParameters_DllAPI +#define CARLAWEATHERPARAMETERS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaWeatherParameters defined by the user in the IDL file. - * @ingroup CARLAWEATHERPARAMETERS - */ - class CarlaWeatherParameters - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaWeatherParameters(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaWeatherParameters(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. - */ - eProsima_user_DllExport CarlaWeatherParameters( - const CarlaWeatherParameters& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. - */ - eProsima_user_DllExport CarlaWeatherParameters( - CarlaWeatherParameters&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. - */ - eProsima_user_DllExport CarlaWeatherParameters& operator =( - const CarlaWeatherParameters& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. - */ - eProsima_user_DllExport CarlaWeatherParameters& operator =( - CarlaWeatherParameters&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaWeatherParameters object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaWeatherParameters& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaWeatherParameters object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaWeatherParameters& x) const; - - /*! - * @brief This function sets a value in member cloudiness - * @param _cloudiness New value for member cloudiness - */ - eProsima_user_DllExport void cloudiness( - float _cloudiness); - - /*! - * @brief This function returns the value of member cloudiness - * @return Value of member cloudiness - */ - eProsima_user_DllExport float cloudiness() const; - - /*! - * @brief This function returns a reference to member cloudiness - * @return Reference to member cloudiness - */ - eProsima_user_DllExport float& cloudiness(); - - /*! - * @brief This function sets a value in member precipitation - * @param _precipitation New value for member precipitation - */ - eProsima_user_DllExport void precipitation( - float _precipitation); - - /*! - * @brief This function returns the value of member precipitation - * @return Value of member precipitation - */ - eProsima_user_DllExport float precipitation() const; - - /*! - * @brief This function returns a reference to member precipitation - * @return Reference to member precipitation - */ - eProsima_user_DllExport float& precipitation(); - - /*! - * @brief This function sets a value in member precipitation_deposits - * @param _precipitation_deposits New value for member precipitation_deposits - */ - eProsima_user_DllExport void precipitation_deposits( - float _precipitation_deposits); - - /*! - * @brief This function returns the value of member precipitation_deposits - * @return Value of member precipitation_deposits - */ - eProsima_user_DllExport float precipitation_deposits() const; - - /*! - * @brief This function returns a reference to member precipitation_deposits - * @return Reference to member precipitation_deposits - */ - eProsima_user_DllExport float& precipitation_deposits(); - - /*! - * @brief This function sets a value in member wind_intensity - * @param _wind_intensity New value for member wind_intensity - */ - eProsima_user_DllExport void wind_intensity( - float _wind_intensity); - - /*! - * @brief This function returns the value of member wind_intensity - * @return Value of member wind_intensity - */ - eProsima_user_DllExport float wind_intensity() const; - - /*! - * @brief This function returns a reference to member wind_intensity - * @return Reference to member wind_intensity - */ - eProsima_user_DllExport float& wind_intensity(); - - /*! - * @brief This function sets a value in member sun_azimuth_angle - * @param _sun_azimuth_angle New value for member sun_azimuth_angle - */ - eProsima_user_DllExport void sun_azimuth_angle( - float _sun_azimuth_angle); - - /*! - * @brief This function returns the value of member sun_azimuth_angle - * @return Value of member sun_azimuth_angle - */ - eProsima_user_DllExport float sun_azimuth_angle() const; - - /*! - * @brief This function returns a reference to member sun_azimuth_angle - * @return Reference to member sun_azimuth_angle - */ - eProsima_user_DllExport float& sun_azimuth_angle(); - - /*! - * @brief This function sets a value in member sun_altitude_angle - * @param _sun_altitude_angle New value for member sun_altitude_angle - */ - eProsima_user_DllExport void sun_altitude_angle( - float _sun_altitude_angle); - - /*! - * @brief This function returns the value of member sun_altitude_angle - * @return Value of member sun_altitude_angle - */ - eProsima_user_DllExport float sun_altitude_angle() const; - - /*! - * @brief This function returns a reference to member sun_altitude_angle - * @return Reference to member sun_altitude_angle - */ - eProsima_user_DllExport float& sun_altitude_angle(); - - /*! - * @brief This function sets a value in member fog_density - * @param _fog_density New value for member fog_density - */ - eProsima_user_DllExport void fog_density( - float _fog_density); - - /*! - * @brief This function returns the value of member fog_density - * @return Value of member fog_density - */ - eProsima_user_DllExport float fog_density() const; - - /*! - * @brief This function returns a reference to member fog_density - * @return Reference to member fog_density - */ - eProsima_user_DllExport float& fog_density(); - - /*! - * @brief This function sets a value in member fog_distance - * @param _fog_distance New value for member fog_distance - */ - eProsima_user_DllExport void fog_distance( - float _fog_distance); - - /*! - * @brief This function returns the value of member fog_distance - * @return Value of member fog_distance - */ - eProsima_user_DllExport float fog_distance() const; - - /*! - * @brief This function returns a reference to member fog_distance - * @return Reference to member fog_distance - */ - eProsima_user_DllExport float& fog_distance(); - - /*! - * @brief This function sets a value in member fog_falloff - * @param _fog_falloff New value for member fog_falloff - */ - eProsima_user_DllExport void fog_falloff( - float _fog_falloff); - - /*! - * @brief This function returns the value of member fog_falloff - * @return Value of member fog_falloff - */ - eProsima_user_DllExport float fog_falloff() const; - - /*! - * @brief This function returns a reference to member fog_falloff - * @return Reference to member fog_falloff - */ - eProsima_user_DllExport float& fog_falloff(); - - /*! - * @brief This function sets a value in member wetness - * @param _wetness New value for member wetness - */ - eProsima_user_DllExport void wetness( - float _wetness); - - /*! - * @brief This function returns the value of member wetness - * @return Value of member wetness - */ - eProsima_user_DllExport float wetness() const; - - /*! - * @brief This function returns a reference to member wetness - * @return Reference to member wetness - */ - eProsima_user_DllExport float& wetness(); - - /*! - * @brief This function sets a value in member scattering_intensity - * @param _scattering_intensity New value for member scattering_intensity - */ - eProsima_user_DllExport void scattering_intensity( - float _scattering_intensity); - - /*! - * @brief This function returns the value of member scattering_intensity - * @return Value of member scattering_intensity - */ - eProsima_user_DllExport float scattering_intensity() const; - - /*! - * @brief This function returns a reference to member scattering_intensity - * @return Reference to member scattering_intensity - */ - eProsima_user_DllExport float& scattering_intensity(); - - /*! - * @brief This function sets a value in member mie_scattering_scale - * @param _mie_scattering_scale New value for member mie_scattering_scale - */ - eProsima_user_DllExport void mie_scattering_scale( - float _mie_scattering_scale); - - /*! - * @brief This function returns the value of member mie_scattering_scale - * @return Value of member mie_scattering_scale - */ - eProsima_user_DllExport float mie_scattering_scale() const; - - /*! - * @brief This function returns a reference to member mie_scattering_scale - * @return Reference to member mie_scattering_scale - */ - eProsima_user_DllExport float& mie_scattering_scale(); - - /*! - * @brief This function sets a value in member rayleigh_scattering_scale - * @param _rayleigh_scattering_scale New value for member rayleigh_scattering_scale - */ - eProsima_user_DllExport void rayleigh_scattering_scale( - float _rayleigh_scattering_scale); - - /*! - * @brief This function returns the value of member rayleigh_scattering_scale - * @return Value of member rayleigh_scattering_scale - */ - eProsima_user_DllExport float rayleigh_scattering_scale() const; - - /*! - * @brief This function returns a reference to member rayleigh_scattering_scale - * @return Reference to member rayleigh_scattering_scale - */ - eProsima_user_DllExport float& rayleigh_scattering_scale(); - - /*! - * @brief This function sets a value in member dust_storm - * @param _dust_storm New value for member dust_storm - */ - eProsima_user_DllExport void dust_storm( - float _dust_storm); - - /*! - * @brief This function returns the value of member dust_storm - * @return Value of member dust_storm - */ - eProsima_user_DllExport float dust_storm() const; - - /*! - * @brief This function returns a reference to member dust_storm - * @return Reference to member dust_storm - */ - eProsima_user_DllExport float& dust_storm(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaWeatherParameters& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - float m_cloudiness; - float m_precipitation; - float m_precipitation_deposits; - float m_wind_intensity; - float m_sun_azimuth_angle; - float m_sun_altitude_angle; - float m_fog_density; - float m_fog_distance; - float m_fog_falloff; - float m_wetness; - float m_scattering_intensity; - float m_mie_scattering_scale; - float m_rayleigh_scattering_scale; - float m_dust_storm; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaWeatherParameters defined by the user in the IDL file. + * @ingroup CarlaWeatherParameters + */ +class CarlaWeatherParameters +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaWeatherParameters(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaWeatherParameters(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. + */ + eProsima_user_DllExport CarlaWeatherParameters( + const CarlaWeatherParameters& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. + */ + eProsima_user_DllExport CarlaWeatherParameters( + CarlaWeatherParameters&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. + */ + eProsima_user_DllExport CarlaWeatherParameters& operator =( + const CarlaWeatherParameters& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWeatherParameters that will be copied. + */ + eProsima_user_DllExport CarlaWeatherParameters& operator =( + CarlaWeatherParameters&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWeatherParameters object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaWeatherParameters& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWeatherParameters object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaWeatherParameters& x) const; + + /*! + * @brief This function sets a value in member cloudiness + * @param _cloudiness New value for member cloudiness + */ + eProsima_user_DllExport void cloudiness( + float _cloudiness); + + /*! + * @brief This function returns the value of member cloudiness + * @return Value of member cloudiness + */ + eProsima_user_DllExport float cloudiness() const; + + /*! + * @brief This function returns a reference to member cloudiness + * @return Reference to member cloudiness + */ + eProsima_user_DllExport float& cloudiness(); + + + /*! + * @brief This function sets a value in member precipitation + * @param _precipitation New value for member precipitation + */ + eProsima_user_DllExport void precipitation( + float _precipitation); + + /*! + * @brief This function returns the value of member precipitation + * @return Value of member precipitation + */ + eProsima_user_DllExport float precipitation() const; + + /*! + * @brief This function returns a reference to member precipitation + * @return Reference to member precipitation + */ + eProsima_user_DllExport float& precipitation(); + + + /*! + * @brief This function sets a value in member precipitation_deposits + * @param _precipitation_deposits New value for member precipitation_deposits + */ + eProsima_user_DllExport void precipitation_deposits( + float _precipitation_deposits); + + /*! + * @brief This function returns the value of member precipitation_deposits + * @return Value of member precipitation_deposits + */ + eProsima_user_DllExport float precipitation_deposits() const; + + /*! + * @brief This function returns a reference to member precipitation_deposits + * @return Reference to member precipitation_deposits + */ + eProsima_user_DllExport float& precipitation_deposits(); + + + /*! + * @brief This function sets a value in member wind_intensity + * @param _wind_intensity New value for member wind_intensity + */ + eProsima_user_DllExport void wind_intensity( + float _wind_intensity); + + /*! + * @brief This function returns the value of member wind_intensity + * @return Value of member wind_intensity + */ + eProsima_user_DllExport float wind_intensity() const; + + /*! + * @brief This function returns a reference to member wind_intensity + * @return Reference to member wind_intensity + */ + eProsima_user_DllExport float& wind_intensity(); + + + /*! + * @brief This function sets a value in member sun_azimuth_angle + * @param _sun_azimuth_angle New value for member sun_azimuth_angle + */ + eProsima_user_DllExport void sun_azimuth_angle( + float _sun_azimuth_angle); + + /*! + * @brief This function returns the value of member sun_azimuth_angle + * @return Value of member sun_azimuth_angle + */ + eProsima_user_DllExport float sun_azimuth_angle() const; + + /*! + * @brief This function returns a reference to member sun_azimuth_angle + * @return Reference to member sun_azimuth_angle + */ + eProsima_user_DllExport float& sun_azimuth_angle(); + + + /*! + * @brief This function sets a value in member sun_altitude_angle + * @param _sun_altitude_angle New value for member sun_altitude_angle + */ + eProsima_user_DllExport void sun_altitude_angle( + float _sun_altitude_angle); + + /*! + * @brief This function returns the value of member sun_altitude_angle + * @return Value of member sun_altitude_angle + */ + eProsima_user_DllExport float sun_altitude_angle() const; + + /*! + * @brief This function returns a reference to member sun_altitude_angle + * @return Reference to member sun_altitude_angle + */ + eProsima_user_DllExport float& sun_altitude_angle(); + + + /*! + * @brief This function sets a value in member fog_density + * @param _fog_density New value for member fog_density + */ + eProsima_user_DllExport void fog_density( + float _fog_density); + + /*! + * @brief This function returns the value of member fog_density + * @return Value of member fog_density + */ + eProsima_user_DllExport float fog_density() const; + + /*! + * @brief This function returns a reference to member fog_density + * @return Reference to member fog_density + */ + eProsima_user_DllExport float& fog_density(); + + + /*! + * @brief This function sets a value in member fog_distance + * @param _fog_distance New value for member fog_distance + */ + eProsima_user_DllExport void fog_distance( + float _fog_distance); + + /*! + * @brief This function returns the value of member fog_distance + * @return Value of member fog_distance + */ + eProsima_user_DllExport float fog_distance() const; + + /*! + * @brief This function returns a reference to member fog_distance + * @return Reference to member fog_distance + */ + eProsima_user_DllExport float& fog_distance(); + + + /*! + * @brief This function sets a value in member fog_falloff + * @param _fog_falloff New value for member fog_falloff + */ + eProsima_user_DllExport void fog_falloff( + float _fog_falloff); + + /*! + * @brief This function returns the value of member fog_falloff + * @return Value of member fog_falloff + */ + eProsima_user_DllExport float fog_falloff() const; + + /*! + * @brief This function returns a reference to member fog_falloff + * @return Reference to member fog_falloff + */ + eProsima_user_DllExport float& fog_falloff(); + + + /*! + * @brief This function sets a value in member wetness + * @param _wetness New value for member wetness + */ + eProsima_user_DllExport void wetness( + float _wetness); + + /*! + * @brief This function returns the value of member wetness + * @return Value of member wetness + */ + eProsima_user_DllExport float wetness() const; + + /*! + * @brief This function returns a reference to member wetness + * @return Reference to member wetness + */ + eProsima_user_DllExport float& wetness(); + + + /*! + * @brief This function sets a value in member scattering_intensity + * @param _scattering_intensity New value for member scattering_intensity + */ + eProsima_user_DllExport void scattering_intensity( + float _scattering_intensity); + + /*! + * @brief This function returns the value of member scattering_intensity + * @return Value of member scattering_intensity + */ + eProsima_user_DllExport float scattering_intensity() const; + + /*! + * @brief This function returns a reference to member scattering_intensity + * @return Reference to member scattering_intensity + */ + eProsima_user_DllExport float& scattering_intensity(); + + + /*! + * @brief This function sets a value in member mie_scattering_scale + * @param _mie_scattering_scale New value for member mie_scattering_scale + */ + eProsima_user_DllExport void mie_scattering_scale( + float _mie_scattering_scale); + + /*! + * @brief This function returns the value of member mie_scattering_scale + * @return Value of member mie_scattering_scale + */ + eProsima_user_DllExport float mie_scattering_scale() const; + + /*! + * @brief This function returns a reference to member mie_scattering_scale + * @return Reference to member mie_scattering_scale + */ + eProsima_user_DllExport float& mie_scattering_scale(); + + + /*! + * @brief This function sets a value in member rayleigh_scattering_scale + * @param _rayleigh_scattering_scale New value for member rayleigh_scattering_scale + */ + eProsima_user_DllExport void rayleigh_scattering_scale( + float _rayleigh_scattering_scale); + + /*! + * @brief This function returns the value of member rayleigh_scattering_scale + * @return Value of member rayleigh_scattering_scale + */ + eProsima_user_DllExport float rayleigh_scattering_scale() const; + + /*! + * @brief This function returns a reference to member rayleigh_scattering_scale + * @return Reference to member rayleigh_scattering_scale + */ + eProsima_user_DllExport float& rayleigh_scattering_scale(); + + + /*! + * @brief This function sets a value in member dust_storm + * @param _dust_storm New value for member dust_storm + */ + eProsima_user_DllExport void dust_storm( + float _dust_storm); + + /*! + * @brief This function returns the value of member dust_storm + * @return Value of member dust_storm + */ + eProsima_user_DllExport float dust_storm() const; + + /*! + * @brief This function returns a reference to member dust_storm + * @return Reference to member dust_storm + */ + eProsima_user_DllExport float& dust_storm(); + +private: + + float m_cloudiness{0.0}; + float m_precipitation{0.0}; + float m_precipitation_deposits{0.0}; + float m_wind_intensity{0.0}; + float m_sun_azimuth_angle{0.0}; + float m_sun_altitude_angle{0.0}; + float m_fog_density{0.0}; + float m_fog_distance{0.0}; + float m_fog_falloff{0.0}; + float m_wetness{0.0}; + float m_scattering_intensity{0.0}; + float m_mie_scattering_scale{0.0}; + float m_rayleigh_scattering_scale{0.0331}; + float m_dust_storm{0.0}; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersCdrAux.hpp new file mode 100644 index 00000000000..a191ff15c62 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWeatherParametersCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERSCDRAUX_HPP_ + +#include "CarlaWeatherParameters.h" + +constexpr uint32_t carla_msgs_msg_CarlaWeatherParameters_max_cdr_typesize {60UL}; +constexpr uint32_t carla_msgs_msg_CarlaWeatherParameters_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWeatherParameters& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersCdrAux.ipp new file mode 100644 index 00000000000..e5807082ee4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersCdrAux.ipp @@ -0,0 +1,234 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWeatherParametersCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERSCDRAUX_IPP_ + +#include "CarlaWeatherParametersCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaWeatherParameters& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.cloudiness(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.precipitation(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.precipitation_deposits(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.wind_intensity(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.sun_azimuth_angle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.sun_altitude_angle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.fog_density(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.fog_distance(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.fog_falloff(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.wetness(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.scattering_intensity(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.mie_scattering_scale(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), + data.rayleigh_scattering_scale(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), + data.dust_storm(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWeatherParameters& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.cloudiness() + << eprosima::fastcdr::MemberId(1) << data.precipitation() + << eprosima::fastcdr::MemberId(2) << data.precipitation_deposits() + << eprosima::fastcdr::MemberId(3) << data.wind_intensity() + << eprosima::fastcdr::MemberId(4) << data.sun_azimuth_angle() + << eprosima::fastcdr::MemberId(5) << data.sun_altitude_angle() + << eprosima::fastcdr::MemberId(6) << data.fog_density() + << eprosima::fastcdr::MemberId(7) << data.fog_distance() + << eprosima::fastcdr::MemberId(8) << data.fog_falloff() + << eprosima::fastcdr::MemberId(9) << data.wetness() + << eprosima::fastcdr::MemberId(10) << data.scattering_intensity() + << eprosima::fastcdr::MemberId(11) << data.mie_scattering_scale() + << eprosima::fastcdr::MemberId(12) << data.rayleigh_scattering_scale() + << eprosima::fastcdr::MemberId(13) << data.dust_storm() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaWeatherParameters& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.cloudiness(); + break; + + case 1: + dcdr >> data.precipitation(); + break; + + case 2: + dcdr >> data.precipitation_deposits(); + break; + + case 3: + dcdr >> data.wind_intensity(); + break; + + case 4: + dcdr >> data.sun_azimuth_angle(); + break; + + case 5: + dcdr >> data.sun_altitude_angle(); + break; + + case 6: + dcdr >> data.fog_density(); + break; + + case 7: + dcdr >> data.fog_distance(); + break; + + case 8: + dcdr >> data.fog_falloff(); + break; + + case 9: + dcdr >> data.wetness(); + break; + + case 10: + dcdr >> data.scattering_intensity(); + break; + + case 11: + dcdr >> data.mie_scattering_scale(); + break; + + case 12: + dcdr >> data.rayleigh_scattering_scale(); + break; + + case 13: + dcdr >> data.dust_storm(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWeatherParameters& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.cxx index 514e3bfc24e..d0242058cda 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaWeatherParametersPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaWeatherParametersPubSubTypes.h" +#include "CarlaWeatherParametersCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaWeatherParametersPubSubType::CarlaWeatherParametersPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaWeatherParameters_"); - auto type_size = CarlaWeatherParameters::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaWeatherParameters::isKeyDefined(); - size_t keyLength = CarlaWeatherParameters::getKeyMaxCdrSerializedSize() > 16 ? - CarlaWeatherParameters::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaWeatherParametersPubSubType::~CarlaWeatherParametersPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaWeatherParametersPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaWeatherParameters* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaWeatherParametersPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaWeatherParameters* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaWeatherParametersPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaWeatherParametersPubSubType::createData() - { - return reinterpret_cast(new CarlaWeatherParameters()); - } - - void CarlaWeatherParametersPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaWeatherParametersPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaWeatherParameters* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaWeatherParameters::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaWeatherParameters::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaWeatherParametersPubSubType::CarlaWeatherParametersPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaWeatherParameters_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaWeatherParameters::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaWeatherParameters_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaWeatherParametersPubSubType::~CarlaWeatherParametersPubSubType() +{ +} + +bool CarlaWeatherParametersPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaWeatherParameters* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaWeatherParametersPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaWeatherParameters* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaWeatherParametersPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaWeatherParametersPubSubType::createData() +{ + return reinterpret_cast(new CarlaWeatherParameters()); +} + +void CarlaWeatherParametersPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaWeatherParametersPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h index 5bac31db030..3e85a27b640 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWeatherParametersPubSubTypes.h @@ -16,92 +16,120 @@ * @file CarlaWeatherParametersPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaWeatherParameters.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaWeatherParameters is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaWeatherParameters defined by the user in the IDL file. + * @ingroup CarlaWeatherParameters + */ +class CarlaWeatherParametersPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaWeatherParameters defined by the user in the IDL file. - * @ingroup CARLAWEATHERPARAMETERS - */ - class CarlaWeatherParametersPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaWeatherParameters type; + typedef CarlaWeatherParameters type; - eProsima_user_DllExport CarlaWeatherParametersPubSubType(); + eProsima_user_DllExport CarlaWeatherParametersPubSubType(); - eProsima_user_DllExport virtual ~CarlaWeatherParametersPubSubType(); + eProsima_user_DllExport ~CarlaWeatherParametersPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CarlaWeatherParameters(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWEATHERPARAMETERS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx index e7080d1379e..cb845866356 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.cxx @@ -14,9 +14,9 @@ /*! * @file CarlaWorldInfo.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "CarlaWorldInfo.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo() -{ - // m_carla_version com.eprosima.idl.parser.typecode.StringTypeCode@45afc369 - m_carla_version =""; - // m_map_name com.eprosima.idl.parser.typecode.StringTypeCode@799d4f69 - m_map_name =""; - // m_opendrive com.eprosima.idl.parser.typecode.StringTypeCode@49c43f4e - m_opendrive =""; -} +namespace carla_msgs { + +namespace msg { -carla_msgs::msg::CarlaWorldInfo::~CarlaWorldInfo() -{ +CarlaWorldInfo::CarlaWorldInfo() +{ } -carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo( +CarlaWorldInfo::~CarlaWorldInfo() +{ +} + +CarlaWorldInfo::CarlaWorldInfo( const CarlaWorldInfo& x) { m_carla_version = x.m_carla_version; @@ -59,107 +59,53 @@ carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo( m_opendrive = x.m_opendrive; } -carla_msgs::msg::CarlaWorldInfo::CarlaWorldInfo( - CarlaWorldInfo&& x) +CarlaWorldInfo::CarlaWorldInfo( + CarlaWorldInfo&& x) noexcept { m_carla_version = std::move(x.m_carla_version); m_map_name = std::move(x.m_map_name); m_opendrive = std::move(x.m_opendrive); } -carla_msgs::msg::CarlaWorldInfo& carla_msgs::msg::CarlaWorldInfo::operator =( +CarlaWorldInfo& CarlaWorldInfo::operator =( const CarlaWorldInfo& x) { m_carla_version = x.m_carla_version; m_map_name = x.m_map_name; m_opendrive = x.m_opendrive; - return *this; } -carla_msgs::msg::CarlaWorldInfo& carla_msgs::msg::CarlaWorldInfo::operator =( - CarlaWorldInfo&& x) +CarlaWorldInfo& CarlaWorldInfo::operator =( + CarlaWorldInfo&& x) noexcept { m_carla_version = std::move(x.m_carla_version); m_map_name = std::move(x.m_map_name); m_opendrive = std::move(x.m_opendrive); - return *this; } -bool carla_msgs::msg::CarlaWorldInfo::operator ==( +bool CarlaWorldInfo::operator ==( const CarlaWorldInfo& x) const { - - return (m_carla_version == x.m_carla_version && m_map_name == x.m_map_name && m_opendrive == x.m_opendrive); + return (m_carla_version == x.m_carla_version && + m_map_name == x.m_map_name && + m_opendrive == x.m_opendrive); } -bool carla_msgs::msg::CarlaWorldInfo::operator !=( +bool CarlaWorldInfo::operator !=( const CarlaWorldInfo& x) const { return !(*this == x); } -size_t carla_msgs::msg::CarlaWorldInfo::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::msg::CarlaWorldInfo::getCdrSerializedSize( - const carla_msgs::msg::CarlaWorldInfo& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.carla_version().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.map_name().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.opendrive().size() + 1; - - - return current_alignment - initial_alignment; -} - -void carla_msgs::msg::CarlaWorldInfo::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_carla_version; - scdr << m_map_name; - scdr << m_opendrive; - -} - -void carla_msgs::msg::CarlaWorldInfo::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_carla_version; - dcdr >> m_map_name; - dcdr >> m_opendrive; -} - /*! * @brief This function copies the value in member carla_version * @param _carla_version New value to be copied in member carla_version */ -void carla_msgs::msg::CarlaWorldInfo::carla_version( +void CarlaWorldInfo::carla_version( const std::string& _carla_version) { m_carla_version = _carla_version; @@ -169,7 +115,7 @@ void carla_msgs::msg::CarlaWorldInfo::carla_version( * @brief This function moves the value in member carla_version * @param _carla_version New value to be moved in member carla_version */ -void carla_msgs::msg::CarlaWorldInfo::carla_version( +void CarlaWorldInfo::carla_version( std::string&& _carla_version) { m_carla_version = std::move(_carla_version); @@ -179,7 +125,7 @@ void carla_msgs::msg::CarlaWorldInfo::carla_version( * @brief This function returns a constant reference to member carla_version * @return Constant reference to member carla_version */ -const std::string& carla_msgs::msg::CarlaWorldInfo::carla_version() const +const std::string& CarlaWorldInfo::carla_version() const { return m_carla_version; } @@ -188,15 +134,17 @@ const std::string& carla_msgs::msg::CarlaWorldInfo::carla_version() const * @brief This function returns a reference to member carla_version * @return Reference to member carla_version */ -std::string& carla_msgs::msg::CarlaWorldInfo::carla_version() +std::string& CarlaWorldInfo::carla_version() { return m_carla_version; } + + /*! * @brief This function copies the value in member map_name * @param _map_name New value to be copied in member map_name */ -void carla_msgs::msg::CarlaWorldInfo::map_name( +void CarlaWorldInfo::map_name( const std::string& _map_name) { m_map_name = _map_name; @@ -206,7 +154,7 @@ void carla_msgs::msg::CarlaWorldInfo::map_name( * @brief This function moves the value in member map_name * @param _map_name New value to be moved in member map_name */ -void carla_msgs::msg::CarlaWorldInfo::map_name( +void CarlaWorldInfo::map_name( std::string&& _map_name) { m_map_name = std::move(_map_name); @@ -216,7 +164,7 @@ void carla_msgs::msg::CarlaWorldInfo::map_name( * @brief This function returns a constant reference to member map_name * @return Constant reference to member map_name */ -const std::string& carla_msgs::msg::CarlaWorldInfo::map_name() const +const std::string& CarlaWorldInfo::map_name() const { return m_map_name; } @@ -225,15 +173,17 @@ const std::string& carla_msgs::msg::CarlaWorldInfo::map_name() const * @brief This function returns a reference to member map_name * @return Reference to member map_name */ -std::string& carla_msgs::msg::CarlaWorldInfo::map_name() +std::string& CarlaWorldInfo::map_name() { return m_map_name; } + + /*! * @brief This function copies the value in member opendrive * @param _opendrive New value to be copied in member opendrive */ -void carla_msgs::msg::CarlaWorldInfo::opendrive( +void CarlaWorldInfo::opendrive( const std::string& _opendrive) { m_opendrive = _opendrive; @@ -243,7 +193,7 @@ void carla_msgs::msg::CarlaWorldInfo::opendrive( * @brief This function moves the value in member opendrive * @param _opendrive New value to be moved in member opendrive */ -void carla_msgs::msg::CarlaWorldInfo::opendrive( +void CarlaWorldInfo::opendrive( std::string&& _opendrive) { m_opendrive = std::move(_opendrive); @@ -253,7 +203,7 @@ void carla_msgs::msg::CarlaWorldInfo::opendrive( * @brief This function returns a constant reference to member opendrive * @return Constant reference to member opendrive */ -const std::string& carla_msgs::msg::CarlaWorldInfo::opendrive() const +const std::string& CarlaWorldInfo::opendrive() const { return m_opendrive; } @@ -262,31 +212,18 @@ const std::string& carla_msgs::msg::CarlaWorldInfo::opendrive() const * @brief This function returns a reference to member opendrive * @return Reference to member opendrive */ -std::string& carla_msgs::msg::CarlaWorldInfo::opendrive() +std::string& CarlaWorldInfo::opendrive() { return m_opendrive; } -size_t carla_msgs::msg::CarlaWorldInfo::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::msg::CarlaWorldInfo::isKeyDefined() -{ - return false; -} +} // namespace msg -void carla_msgs::msg::CarlaWorldInfo::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CarlaWorldInfoCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h index 26caf4d0810..f5b29f1fdb8 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfo.h @@ -16,19 +16,24 @@ * @file CarlaWorldInfo.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,227 +47,186 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CarlaWorldInfo_SOURCE) -#define CarlaWorldInfo_DllAPI __declspec( dllexport ) +#if defined(CARLAWORLDINFO_SOURCE) +#define CARLAWORLDINFO_DllAPI __declspec( dllexport ) #else -#define CarlaWorldInfo_DllAPI __declspec( dllimport ) -#endif // CarlaWorldInfo_SOURCE +#define CARLAWORLDINFO_DllAPI __declspec( dllimport ) +#endif // CARLAWORLDINFO_SOURCE #else -#define CarlaWorldInfo_DllAPI +#define CARLAWORLDINFO_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CarlaWorldInfo_DllAPI +#define CARLAWORLDINFO_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace msg { - /*! - * @brief This class represents the structure CarlaWorldInfo defined by the user in the IDL file. - * @ingroup CARLAWORLDINFO - */ - class CarlaWorldInfo - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CarlaWorldInfo(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CarlaWorldInfo(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. - */ - eProsima_user_DllExport CarlaWorldInfo( - const CarlaWorldInfo& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. - */ - eProsima_user_DllExport CarlaWorldInfo( - CarlaWorldInfo&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. - */ - eProsima_user_DllExport CarlaWorldInfo& operator =( - const CarlaWorldInfo& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. - */ - eProsima_user_DllExport CarlaWorldInfo& operator =( - CarlaWorldInfo&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaWorldInfo object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CarlaWorldInfo& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::msg::CarlaWorldInfo object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CarlaWorldInfo& x) const; - - /*! - * @brief This function copies the value in member carla_version - * @param _carla_version New value to be copied in member carla_version - */ - eProsima_user_DllExport void carla_version( - const std::string& _carla_version); - - /*! - * @brief This function moves the value in member carla_version - * @param _carla_version New value to be moved in member carla_version - */ - eProsima_user_DllExport void carla_version( - std::string&& _carla_version); - - /*! - * @brief This function returns a constant reference to member carla_version - * @return Constant reference to member carla_version - */ - eProsima_user_DllExport const std::string& carla_version() const; - - /*! - * @brief This function returns a reference to member carla_version - * @return Reference to member carla_version - */ - eProsima_user_DllExport std::string& carla_version(); - /*! - * @brief This function copies the value in member map_name - * @param _map_name New value to be copied in member map_name - */ - eProsima_user_DllExport void map_name( - const std::string& _map_name); - - /*! - * @brief This function moves the value in member map_name - * @param _map_name New value to be moved in member map_name - */ - eProsima_user_DllExport void map_name( - std::string&& _map_name); - - /*! - * @brief This function returns a constant reference to member map_name - * @return Constant reference to member map_name - */ - eProsima_user_DllExport const std::string& map_name() const; - - /*! - * @brief This function returns a reference to member map_name - * @return Reference to member map_name - */ - eProsima_user_DllExport std::string& map_name(); - /*! - * @brief This function copies the value in member opendrive - * @param _opendrive New value to be copied in member opendrive - */ - eProsima_user_DllExport void opendrive( - const std::string& _opendrive); - - /*! - * @brief This function moves the value in member opendrive - * @param _opendrive New value to be moved in member opendrive - */ - eProsima_user_DllExport void opendrive( - std::string&& _opendrive); - - /*! - * @brief This function returns a constant reference to member opendrive - * @return Constant reference to member opendrive - */ - eProsima_user_DllExport const std::string& opendrive() const; - - /*! - * @brief This function returns a reference to member opendrive - * @return Reference to member opendrive - */ - eProsima_user_DllExport std::string& opendrive(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::msg::CarlaWorldInfo& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::string m_carla_version; - std::string m_map_name; - std::string m_opendrive; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CarlaWorldInfo defined by the user in the IDL file. + * @ingroup CarlaWorldInfo + */ +class CarlaWorldInfo +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CarlaWorldInfo(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CarlaWorldInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. + */ + eProsima_user_DllExport CarlaWorldInfo( + const CarlaWorldInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. + */ + eProsima_user_DllExport CarlaWorldInfo( + CarlaWorldInfo&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. + */ + eProsima_user_DllExport CarlaWorldInfo& operator =( + const CarlaWorldInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::msg::CarlaWorldInfo that will be copied. + */ + eProsima_user_DllExport CarlaWorldInfo& operator =( + CarlaWorldInfo&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWorldInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CarlaWorldInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::msg::CarlaWorldInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CarlaWorldInfo& x) const; + + /*! + * @brief This function copies the value in member carla_version + * @param _carla_version New value to be copied in member carla_version + */ + eProsima_user_DllExport void carla_version( + const std::string& _carla_version); + + /*! + * @brief This function moves the value in member carla_version + * @param _carla_version New value to be moved in member carla_version + */ + eProsima_user_DllExport void carla_version( + std::string&& _carla_version); + + /*! + * @brief This function returns a constant reference to member carla_version + * @return Constant reference to member carla_version + */ + eProsima_user_DllExport const std::string& carla_version() const; + + /*! + * @brief This function returns a reference to member carla_version + * @return Reference to member carla_version + */ + eProsima_user_DllExport std::string& carla_version(); + + + /*! + * @brief This function copies the value in member map_name + * @param _map_name New value to be copied in member map_name + */ + eProsima_user_DllExport void map_name( + const std::string& _map_name); + + /*! + * @brief This function moves the value in member map_name + * @param _map_name New value to be moved in member map_name + */ + eProsima_user_DllExport void map_name( + std::string&& _map_name); + + /*! + * @brief This function returns a constant reference to member map_name + * @return Constant reference to member map_name + */ + eProsima_user_DllExport const std::string& map_name() const; + + /*! + * @brief This function returns a reference to member map_name + * @return Reference to member map_name + */ + eProsima_user_DllExport std::string& map_name(); + + + /*! + * @brief This function copies the value in member opendrive + * @param _opendrive New value to be copied in member opendrive + */ + eProsima_user_DllExport void opendrive( + const std::string& _opendrive); + + /*! + * @brief This function moves the value in member opendrive + * @param _opendrive New value to be moved in member opendrive + */ + eProsima_user_DllExport void opendrive( + std::string&& _opendrive); + + /*! + * @brief This function returns a constant reference to member opendrive + * @return Constant reference to member opendrive + */ + eProsima_user_DllExport const std::string& opendrive() const; + + /*! + * @brief This function returns a reference to member opendrive + * @return Reference to member opendrive + */ + eProsima_user_DllExport std::string& opendrive(); + +private: + + std::string m_carla_version; + std::string m_map_name; + std::string m_opendrive; + +}; + +} // namespace msg + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoCdrAux.hpp new file mode 100644 index 00000000000..d100bc283f5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWorldInfoCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFOCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFOCDRAUX_HPP_ + +#include "CarlaWorldInfo.h" + +constexpr uint32_t carla_msgs_msg_CarlaWorldInfo_max_cdr_typesize {784UL}; +constexpr uint32_t carla_msgs_msg_CarlaWorldInfo_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWorldInfo& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFOCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoCdrAux.ipp new file mode 100644 index 00000000000..cdd0d2b7b4a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CarlaWorldInfoCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFOCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFOCDRAUX_IPP_ + +#include "CarlaWorldInfoCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::msg::CarlaWorldInfo& data, + size_t& current_alignment) +{ + using namespace carla_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.carla_version(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.map_name(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.opendrive(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWorldInfo& data) +{ + using namespace carla_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.carla_version() + << eprosima::fastcdr::MemberId(1) << data.map_name() + << eprosima::fastcdr::MemberId(2) << data.opendrive() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::msg::CarlaWorldInfo& data) +{ + using namespace carla_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.carla_version(); + break; + + case 1: + dcdr >> data.map_name(); + break; + + case 2: + dcdr >> data.opendrive(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::msg::CarlaWorldInfo& data) +{ + using namespace carla_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFOCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.cxx index 5fbc333d593..d7a5abcd5a4 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CarlaWorldInfoPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CarlaWorldInfoPubSubTypes.h" +#include "CarlaWorldInfoCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace msg { - CarlaWorldInfoPubSubType::CarlaWorldInfoPubSubType() - { - setName("carla_msgs::msg::dds_::CarlaWorldInfo_"); - auto type_size = CarlaWorldInfo::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CarlaWorldInfo::isKeyDefined(); - size_t keyLength = CarlaWorldInfo::getKeyMaxCdrSerializedSize() > 16 ? - CarlaWorldInfo::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CarlaWorldInfoPubSubType::~CarlaWorldInfoPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CarlaWorldInfoPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CarlaWorldInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CarlaWorldInfoPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CarlaWorldInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CarlaWorldInfoPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CarlaWorldInfoPubSubType::createData() - { - return reinterpret_cast(new CarlaWorldInfo()); - } - - void CarlaWorldInfoPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CarlaWorldInfoPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CarlaWorldInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CarlaWorldInfo::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CarlaWorldInfo::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CarlaWorldInfoPubSubType::CarlaWorldInfoPubSubType() +{ + setName("carla_msgs::msg::dds_::CarlaWorldInfo_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CarlaWorldInfo::getMaxCdrSerializedSize()); +#else + carla_msgs_msg_CarlaWorldInfo_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CarlaWorldInfoPubSubType::~CarlaWorldInfoPubSubType() +{ +} + +bool CarlaWorldInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CarlaWorldInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CarlaWorldInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CarlaWorldInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CarlaWorldInfoPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CarlaWorldInfoPubSubType::createData() +{ + return reinterpret_cast(new CarlaWorldInfo()); +} + +void CarlaWorldInfoPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CarlaWorldInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.h index 4ae4a0036e8..9e411a456f0 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/msg/CarlaWorldInfoPubSubTypes.h @@ -16,92 +16,120 @@ * @file CarlaWorldInfoPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CarlaWorldInfo.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CarlaWorldInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CarlaWorldInfo defined by the user in the IDL file. + * @ingroup CarlaWorldInfo + */ +class CarlaWorldInfoPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CarlaWorldInfo defined by the user in the IDL file. - * @ingroup CARLAWORLDINFO - */ - class CarlaWorldInfoPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CarlaWorldInfo type; + typedef CarlaWorldInfo type; - eProsima_user_DllExport CarlaWorldInfoPubSubType(); + eProsima_user_DllExport CarlaWorldInfoPubSubType(); - eProsima_user_DllExport virtual ~CarlaWorldInfoPubSubType(); + eProsima_user_DllExport ~CarlaWorldInfoPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_MSG_CARLAWORLDINFO_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.cxx index dc5fa93adfc..142a0e7218b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.cxx @@ -14,9 +14,9 @@ /*! * @file DestroyObject.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,113 +27,75 @@ char dummy; #endif // _WIN32 #include "DestroyObject.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::srv::DestroyObject_Request::DestroyObject_Request() -{ - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@32a068d1 - m_id = 0; +namespace carla_msgs { + +namespace srv { + + + +DestroyObject_Request::DestroyObject_Request() +{ } -carla_msgs::srv::DestroyObject_Request::~DestroyObject_Request() +DestroyObject_Request::~DestroyObject_Request() { } -carla_msgs::srv::DestroyObject_Request::DestroyObject_Request( +DestroyObject_Request::DestroyObject_Request( const DestroyObject_Request& x) { m_id = x.m_id; } -carla_msgs::srv::DestroyObject_Request::DestroyObject_Request( - DestroyObject_Request&& x) +DestroyObject_Request::DestroyObject_Request( + DestroyObject_Request&& x) noexcept { m_id = x.m_id; } -carla_msgs::srv::DestroyObject_Request& carla_msgs::srv::DestroyObject_Request::operator =( +DestroyObject_Request& DestroyObject_Request::operator =( const DestroyObject_Request& x) { m_id = x.m_id; - return *this; } -carla_msgs::srv::DestroyObject_Request& carla_msgs::srv::DestroyObject_Request::operator =( - DestroyObject_Request&& x) +DestroyObject_Request& DestroyObject_Request::operator =( + DestroyObject_Request&& x) noexcept { m_id = x.m_id; - return *this; } -bool carla_msgs::srv::DestroyObject_Request::operator ==( +bool DestroyObject_Request::operator ==( const DestroyObject_Request& x) const { - return (m_id == x.m_id); } -bool carla_msgs::srv::DestroyObject_Request::operator !=( +bool DestroyObject_Request::operator !=( const DestroyObject_Request& x) const { return !(*this == x); } -size_t carla_msgs::srv::DestroyObject_Request::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::DestroyObject_Request::getCdrSerializedSize( - const carla_msgs::srv::DestroyObject_Request& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::DestroyObject_Request::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_id; - -} - -void carla_msgs::srv::DestroyObject_Request::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_id; -} - /*! * @brief This function sets a value in member id * @param _id New value for member id */ -void carla_msgs::srv::DestroyObject_Request::id( +void DestroyObject_Request::id( int32_t _id) { m_id = _id; @@ -143,7 +105,7 @@ void carla_msgs::srv::DestroyObject_Request::id( * @brief This function returns the value of member id * @return Value of member id */ -int32_t carla_msgs::srv::DestroyObject_Request::id() const +int32_t DestroyObject_Request::id() const { return m_id; } @@ -152,134 +114,67 @@ int32_t carla_msgs::srv::DestroyObject_Request::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -int32_t& carla_msgs::srv::DestroyObject_Request::id() +int32_t& DestroyObject_Request::id() { return m_id; } -size_t carla_msgs::srv::DestroyObject_Request::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool carla_msgs::srv::DestroyObject_Request::isKeyDefined() +DestroyObject_Response::DestroyObject_Response() { - return false; } -void carla_msgs::srv::DestroyObject_Request::serializeKey( - eprosima::fastcdr::Cdr& scdr) const +DestroyObject_Response::~DestroyObject_Response() { - (void) scdr; - } -carla_msgs::srv::DestroyObject_Response::DestroyObject_Response() -{ - // m_success com.eprosima.idl.parser.typecode.PrimitiveTypeCode@62fdb4a6 - m_success = false; - -} - -carla_msgs::srv::DestroyObject_Response::~DestroyObject_Response() -{ -} - -carla_msgs::srv::DestroyObject_Response::DestroyObject_Response( +DestroyObject_Response::DestroyObject_Response( const DestroyObject_Response& x) { m_success = x.m_success; } -carla_msgs::srv::DestroyObject_Response::DestroyObject_Response( - DestroyObject_Response&& x) +DestroyObject_Response::DestroyObject_Response( + DestroyObject_Response&& x) noexcept { m_success = x.m_success; } -carla_msgs::srv::DestroyObject_Response& carla_msgs::srv::DestroyObject_Response::operator =( +DestroyObject_Response& DestroyObject_Response::operator =( const DestroyObject_Response& x) { m_success = x.m_success; - return *this; } -carla_msgs::srv::DestroyObject_Response& carla_msgs::srv::DestroyObject_Response::operator =( - DestroyObject_Response&& x) +DestroyObject_Response& DestroyObject_Response::operator =( + DestroyObject_Response&& x) noexcept { m_success = x.m_success; - return *this; } -bool carla_msgs::srv::DestroyObject_Response::operator ==( +bool DestroyObject_Response::operator ==( const DestroyObject_Response& x) const { - return (m_success == x.m_success); } -bool carla_msgs::srv::DestroyObject_Response::operator !=( +bool DestroyObject_Response::operator !=( const DestroyObject_Response& x) const { return !(*this == x); } -size_t carla_msgs::srv::DestroyObject_Response::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::DestroyObject_Response::getCdrSerializedSize( - const carla_msgs::srv::DestroyObject_Response& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::DestroyObject_Response::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_success; - -} - -void carla_msgs::srv::DestroyObject_Response::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_success; -} - /*! * @brief This function sets a value in member success * @param _success New value for member success */ -void carla_msgs::srv::DestroyObject_Response::success( +void DestroyObject_Response::success( bool _success) { m_success = _success; @@ -289,7 +184,7 @@ void carla_msgs::srv::DestroyObject_Response::success( * @brief This function returns the value of member success * @return Value of member success */ -bool carla_msgs::srv::DestroyObject_Response::success() const +bool DestroyObject_Response::success() const { return m_success; } @@ -298,32 +193,18 @@ bool carla_msgs::srv::DestroyObject_Response::success() const * @brief This function returns a reference to member success * @return Reference to member success */ -bool& carla_msgs::srv::DestroyObject_Response::success() +bool& DestroyObject_Response::success() { return m_success; } -size_t carla_msgs::srv::DestroyObject_Response::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace srv - return current_align; -} - -bool carla_msgs::srv::DestroyObject_Response::isKeyDefined() -{ - return false; -} - -void carla_msgs::srv::DestroyObject_Response::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DestroyObjectCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.h index f505e6a1f17..290ece54122 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObject.h @@ -16,19 +16,24 @@ * @file DestroyObject.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,310 +47,209 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DestroyObject_SOURCE) -#define DestroyObject_DllAPI __declspec( dllexport ) +#if defined(DESTROYOBJECT_SOURCE) +#define DESTROYOBJECT_DllAPI __declspec( dllexport ) #else -#define DestroyObject_DllAPI __declspec( dllimport ) -#endif // DestroyObject_SOURCE +#define DESTROYOBJECT_DllAPI __declspec( dllimport ) +#endif // DESTROYOBJECT_SOURCE #else -#define DestroyObject_DllAPI +#define DESTROYOBJECT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DestroyObject_DllAPI +#define DESTROYOBJECT_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace srv { - /*! - * @brief This class represents the structure DestroyObject_Request defined by the user in the IDL file. - * @ingroup DESTROYOBJECT - */ - class DestroyObject_Request - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DestroyObject_Request(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DestroyObject_Request(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. - */ - eProsima_user_DllExport DestroyObject_Request( - const DestroyObject_Request& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. - */ - eProsima_user_DllExport DestroyObject_Request( - DestroyObject_Request&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. - */ - eProsima_user_DllExport DestroyObject_Request& operator =( - const DestroyObject_Request& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. - */ - eProsima_user_DllExport DestroyObject_Request& operator =( - DestroyObject_Request&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::DestroyObject_Request object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DestroyObject_Request& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::DestroyObject_Request object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DestroyObject_Request& x) const; - - /*! - * @brief This function sets a value in member id - * @param _id New value for member id - */ - eProsima_user_DllExport void id( - int32_t _id); - - /*! - * @brief This function returns the value of member id - * @return Value of member id - */ - eProsima_user_DllExport int32_t id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport int32_t& id(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::DestroyObject_Request& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int32_t m_id; - }; - /*! - * @brief This class represents the structure DestroyObject_Response defined by the user in the IDL file. - * @ingroup DESTROYOBJECT - */ - class DestroyObject_Response - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DestroyObject_Response(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DestroyObject_Response(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. - */ - eProsima_user_DllExport DestroyObject_Response( - const DestroyObject_Response& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. - */ - eProsima_user_DllExport DestroyObject_Response( - DestroyObject_Response&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. - */ - eProsima_user_DllExport DestroyObject_Response& operator =( - const DestroyObject_Response& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. - */ - eProsima_user_DllExport DestroyObject_Response& operator =( - DestroyObject_Response&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::DestroyObject_Response object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DestroyObject_Response& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::DestroyObject_Response object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DestroyObject_Response& x) const; - - /*! - * @brief This function sets a value in member success - * @param _success New value for member success - */ - eProsima_user_DllExport void success( - bool _success); - - /*! - * @brief This function returns the value of member success - * @return Value of member success - */ - eProsima_user_DllExport bool success() const; - - /*! - * @brief This function returns a reference to member success - * @return Reference to member success - */ - eProsima_user_DllExport bool& success(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::DestroyObject_Response& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - bool m_success; - }; - } // namespace srv + +namespace srv { + + + +/*! + * @brief This class represents the structure DestroyObject_Request defined by the user in the IDL file. + * @ingroup DestroyObject + */ +class DestroyObject_Request +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DestroyObject_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DestroyObject_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. + */ + eProsima_user_DllExport DestroyObject_Request( + const DestroyObject_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. + */ + eProsima_user_DllExport DestroyObject_Request( + DestroyObject_Request&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. + */ + eProsima_user_DllExport DestroyObject_Request& operator =( + const DestroyObject_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Request that will be copied. + */ + eProsima_user_DllExport DestroyObject_Request& operator =( + DestroyObject_Request&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::DestroyObject_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DestroyObject_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::DestroyObject_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DestroyObject_Request& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + int32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport int32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport int32_t& id(); + +private: + + int32_t m_id{0}; + +}; + + +/*! + * @brief This class represents the structure DestroyObject_Response defined by the user in the IDL file. + * @ingroup DestroyObject + */ +class DestroyObject_Response +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DestroyObject_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DestroyObject_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. + */ + eProsima_user_DllExport DestroyObject_Response( + const DestroyObject_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. + */ + eProsima_user_DllExport DestroyObject_Response( + DestroyObject_Response&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. + */ + eProsima_user_DllExport DestroyObject_Response& operator =( + const DestroyObject_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::DestroyObject_Response that will be copied. + */ + eProsima_user_DllExport DestroyObject_Response& operator =( + DestroyObject_Response&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::DestroyObject_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DestroyObject_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::DestroyObject_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DestroyObject_Response& x) const; + + /*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ + eProsima_user_DllExport void success( + bool _success); + + /*! + * @brief This function returns the value of member success + * @return Value of member success + */ + eProsima_user_DllExport bool success() const; + + /*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ + eProsima_user_DllExport bool& success(); + +private: + + bool m_success{false}; + +}; + +} // namespace srv + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectCdrAux.hpp new file mode 100644 index 00000000000..11b9f35ff91 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectCdrAux.hpp @@ -0,0 +1,59 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DestroyObjectCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECTCDRAUX_HPP_ + +#include "DestroyObject.h" + +constexpr uint32_t carla_msgs_srv_DestroyObject_Request_max_cdr_typesize {8UL}; +constexpr uint32_t carla_msgs_srv_DestroyObject_Request_max_key_cdr_typesize {0UL}; + +constexpr uint32_t carla_msgs_srv_DestroyObject_Response_max_cdr_typesize {5UL}; +constexpr uint32_t carla_msgs_srv_DestroyObject_Response_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::DestroyObject_Request& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::DestroyObject_Response& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectCdrAux.ipp new file mode 100644 index 00000000000..719e8389fd8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectCdrAux.ipp @@ -0,0 +1,216 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DestroyObjectCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECTCDRAUX_IPP_ + +#include "DestroyObjectCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::DestroyObject_Request& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::DestroyObject_Request& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::DestroyObject_Request& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::DestroyObject_Request& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::DestroyObject_Response& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.success(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::DestroyObject_Response& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.success() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::DestroyObject_Response& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.success(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::DestroyObject_Response& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.cxx index 0b32cd6ee2f..2e0a4ae892b 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.cxx @@ -16,301 +16,339 @@ * @file DestroyObjectPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DestroyObjectPubSubTypes.h" +#include "DestroyObjectCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace srv { - DestroyObject_RequestPubSubType::DestroyObject_RequestPubSubType() - { - setName("carla_msgs::srv::dds_::DestroyObject_Request_"); - auto type_size = DestroyObject_Request::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DestroyObject_Request::isKeyDefined(); - size_t keyLength = DestroyObject_Request::getKeyMaxCdrSerializedSize() > 16 ? - DestroyObject_Request::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DestroyObject_RequestPubSubType::~DestroyObject_RequestPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DestroyObject_RequestPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DestroyObject_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DestroyObject_RequestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DestroyObject_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DestroyObject_RequestPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DestroyObject_RequestPubSubType::createData() - { - return reinterpret_cast(new DestroyObject_Request()); - } - - void DestroyObject_RequestPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DestroyObject_RequestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DestroyObject_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DestroyObject_Request::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DestroyObject_Request::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - DestroyObject_ResponsePubSubType::DestroyObject_ResponsePubSubType() - { - setName("carla_msgs::srv::dds_::DestroyObject_Response_"); - auto type_size = DestroyObject_Response::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DestroyObject_Response::isKeyDefined(); - size_t keyLength = DestroyObject_Response::getKeyMaxCdrSerializedSize() > 16 ? - DestroyObject_Response::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DestroyObject_ResponsePubSubType::~DestroyObject_ResponsePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DestroyObject_ResponsePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DestroyObject_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DestroyObject_ResponsePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DestroyObject_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DestroyObject_ResponsePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DestroyObject_ResponsePubSubType::createData() - { - return reinterpret_cast(new DestroyObject_Response()); - } - - void DestroyObject_ResponsePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DestroyObject_ResponsePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DestroyObject_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DestroyObject_Response::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DestroyObject_Response::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace srv +namespace srv { + + +DestroyObject_RequestPubSubType::DestroyObject_RequestPubSubType() +{ + setName("carla_msgs::srv::dds_::DestroyObject_Request_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DestroyObject_Request::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_DestroyObject_Request_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DestroyObject_RequestPubSubType::~DestroyObject_RequestPubSubType() +{ +} + +bool DestroyObject_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DestroyObject_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DestroyObject_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DestroyObject_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DestroyObject_RequestPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DestroyObject_RequestPubSubType::createData() +{ + return reinterpret_cast(new DestroyObject_Request()); +} + +void DestroyObject_RequestPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DestroyObject_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + + +DestroyObject_ResponsePubSubType::DestroyObject_ResponsePubSubType() +{ + setName("carla_msgs::srv::dds_::DestroyObject_Response_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DestroyObject_Response::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_DestroyObject_Response_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DestroyObject_ResponsePubSubType::~DestroyObject_ResponsePubSubType() +{ +} + +bool DestroyObject_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DestroyObject_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DestroyObject_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DestroyObject_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DestroyObject_ResponsePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DestroyObject_ResponsePubSubType::createData() +{ + return reinterpret_cast(new DestroyObject_Response()); +} + +void DestroyObject_ResponsePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DestroyObject_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace srv + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.h index 06d7a601072..ec7a8d06b49 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/DestroyObjectPubSubTypes.h @@ -16,156 +16,207 @@ * @file DestroyObjectPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DestroyObject.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DestroyObject is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace srv { + + + +/*! + * @brief This class represents the TopicDataType of the type DestroyObject_Request defined by the user in the IDL file. + * @ingroup DestroyObject + */ +class DestroyObject_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace srv +public: + + typedef DestroyObject_Request type; + + eProsima_user_DllExport DestroyObject_RequestPubSubType(); + + eProsima_user_DllExport ~DestroyObject_RequestPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override { - /*! - * @brief This class represents the TopicDataType of the type DestroyObject_Request defined by the user in the IDL file. - * @ingroup DESTROYOBJECT - */ - class DestroyObject_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - typedef DestroyObject_Request type; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport DestroyObject_RequestPubSubType(); + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual ~DestroyObject_RequestPubSubType(); + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport void deleteData( + void* data) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +}; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DestroyObject_Request(); - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +/*! + * @brief This class represents the TopicDataType of the type DestroyObject_Response defined by the user in the IDL file. + * @ingroup DestroyObject + */ +class DestroyObject_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - MD5 m_md5; - unsigned char* m_keyBuffer; - }; - /*! - * @brief This class represents the TopicDataType of the type DestroyObject_Response defined by the user in the IDL file. - * @ingroup DESTROYOBJECT - */ - class DestroyObject_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef DestroyObject_Response type; - typedef DestroyObject_Response type; + eProsima_user_DllExport DestroyObject_ResponsePubSubType(); - eProsima_user_DllExport DestroyObject_ResponsePubSubType(); + eProsima_user_DllExport ~DestroyObject_ResponsePubSubType() override; - eProsima_user_DllExport virtual ~DestroyObject_ResponsePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DestroyObject_Response(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_DESTROYOBJECT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.cxx index 86a1288538a..92b3ce682f6 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.cxx @@ -14,9 +14,9 @@ /*! * @file GetAvailableMaps.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,113 +27,75 @@ char dummy; #endif // _WIN32 #include "GetAvailableMaps.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::srv::GetAvailableMaps_Request::GetAvailableMaps_Request() -{ - // m_structure_needs_at_least_one_member com.eprosima.idl.parser.typecode.PrimitiveTypeCode@70b0b186 - m_structure_needs_at_least_one_member = 0; +namespace carla_msgs { + +namespace srv { + + + +GetAvailableMaps_Request::GetAvailableMaps_Request() +{ } -carla_msgs::srv::GetAvailableMaps_Request::~GetAvailableMaps_Request() +GetAvailableMaps_Request::~GetAvailableMaps_Request() { } -carla_msgs::srv::GetAvailableMaps_Request::GetAvailableMaps_Request( +GetAvailableMaps_Request::GetAvailableMaps_Request( const GetAvailableMaps_Request& x) { m_structure_needs_at_least_one_member = x.m_structure_needs_at_least_one_member; } -carla_msgs::srv::GetAvailableMaps_Request::GetAvailableMaps_Request( - GetAvailableMaps_Request&& x) +GetAvailableMaps_Request::GetAvailableMaps_Request( + GetAvailableMaps_Request&& x) noexcept { m_structure_needs_at_least_one_member = x.m_structure_needs_at_least_one_member; } -carla_msgs::srv::GetAvailableMaps_Request& carla_msgs::srv::GetAvailableMaps_Request::operator =( +GetAvailableMaps_Request& GetAvailableMaps_Request::operator =( const GetAvailableMaps_Request& x) { m_structure_needs_at_least_one_member = x.m_structure_needs_at_least_one_member; - return *this; } -carla_msgs::srv::GetAvailableMaps_Request& carla_msgs::srv::GetAvailableMaps_Request::operator =( - GetAvailableMaps_Request&& x) +GetAvailableMaps_Request& GetAvailableMaps_Request::operator =( + GetAvailableMaps_Request&& x) noexcept { m_structure_needs_at_least_one_member = x.m_structure_needs_at_least_one_member; - return *this; } -bool carla_msgs::srv::GetAvailableMaps_Request::operator ==( +bool GetAvailableMaps_Request::operator ==( const GetAvailableMaps_Request& x) const { - return (m_structure_needs_at_least_one_member == x.m_structure_needs_at_least_one_member); } -bool carla_msgs::srv::GetAvailableMaps_Request::operator !=( +bool GetAvailableMaps_Request::operator !=( const GetAvailableMaps_Request& x) const { return !(*this == x); } -size_t carla_msgs::srv::GetAvailableMaps_Request::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::GetAvailableMaps_Request::getCdrSerializedSize( - const carla_msgs::srv::GetAvailableMaps_Request& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::GetAvailableMaps_Request::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_structure_needs_at_least_one_member; - -} - -void carla_msgs::srv::GetAvailableMaps_Request::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_structure_needs_at_least_one_member; -} - /*! * @brief This function sets a value in member structure_needs_at_least_one_member * @param _structure_needs_at_least_one_member New value for member structure_needs_at_least_one_member */ -void carla_msgs::srv::GetAvailableMaps_Request::structure_needs_at_least_one_member( +void GetAvailableMaps_Request::structure_needs_at_least_one_member( uint8_t _structure_needs_at_least_one_member) { m_structure_needs_at_least_one_member = _structure_needs_at_least_one_member; @@ -143,7 +105,7 @@ void carla_msgs::srv::GetAvailableMaps_Request::structure_needs_at_least_one_mem * @brief This function returns the value of member structure_needs_at_least_one_member * @return Value of member structure_needs_at_least_one_member */ -uint8_t carla_msgs::srv::GetAvailableMaps_Request::structure_needs_at_least_one_member() const +uint8_t GetAvailableMaps_Request::structure_needs_at_least_one_member() const { return m_structure_needs_at_least_one_member; } @@ -152,140 +114,69 @@ uint8_t carla_msgs::srv::GetAvailableMaps_Request::structure_needs_at_least_one_ * @brief This function returns a reference to member structure_needs_at_least_one_member * @return Reference to member structure_needs_at_least_one_member */ -uint8_t& carla_msgs::srv::GetAvailableMaps_Request::structure_needs_at_least_one_member() +uint8_t& GetAvailableMaps_Request::structure_needs_at_least_one_member() { return m_structure_needs_at_least_one_member; } -size_t carla_msgs::srv::GetAvailableMaps_Request::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool carla_msgs::srv::GetAvailableMaps_Request::isKeyDefined() -{ - return false; -} -void carla_msgs::srv::GetAvailableMaps_Request::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} -carla_msgs::srv::GetAvailableMaps_Response::GetAvailableMaps_Response() +GetAvailableMaps_Response::GetAvailableMaps_Response() { - // m_maps com.eprosima.idl.parser.typecode.SequenceTypeCode@1e67a849 - - } -carla_msgs::srv::GetAvailableMaps_Response::~GetAvailableMaps_Response() +GetAvailableMaps_Response::~GetAvailableMaps_Response() { } -carla_msgs::srv::GetAvailableMaps_Response::GetAvailableMaps_Response( +GetAvailableMaps_Response::GetAvailableMaps_Response( const GetAvailableMaps_Response& x) { m_maps = x.m_maps; } -carla_msgs::srv::GetAvailableMaps_Response::GetAvailableMaps_Response( - GetAvailableMaps_Response&& x) +GetAvailableMaps_Response::GetAvailableMaps_Response( + GetAvailableMaps_Response&& x) noexcept { m_maps = std::move(x.m_maps); } -carla_msgs::srv::GetAvailableMaps_Response& carla_msgs::srv::GetAvailableMaps_Response::operator =( +GetAvailableMaps_Response& GetAvailableMaps_Response::operator =( const GetAvailableMaps_Response& x) { m_maps = x.m_maps; - return *this; } -carla_msgs::srv::GetAvailableMaps_Response& carla_msgs::srv::GetAvailableMaps_Response::operator =( - GetAvailableMaps_Response&& x) +GetAvailableMaps_Response& GetAvailableMaps_Response::operator =( + GetAvailableMaps_Response&& x) noexcept { m_maps = std::move(x.m_maps); - return *this; } -bool carla_msgs::srv::GetAvailableMaps_Response::operator ==( +bool GetAvailableMaps_Response::operator ==( const GetAvailableMaps_Response& x) const { - return (m_maps == x.m_maps); } -bool carla_msgs::srv::GetAvailableMaps_Response::operator !=( +bool GetAvailableMaps_Response::operator !=( const GetAvailableMaps_Response& x) const { return !(*this == x); } -size_t carla_msgs::srv::GetAvailableMaps_Response::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - } - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::GetAvailableMaps_Response::getCdrSerializedSize( - const carla_msgs::srv::GetAvailableMaps_Response& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.maps().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - data.maps().at(a).size() + 1; - } - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::GetAvailableMaps_Response::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_maps;} - -void carla_msgs::srv::GetAvailableMaps_Response::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_maps;} - /*! * @brief This function copies the value in member maps * @param _maps New value to be copied in member maps */ -void carla_msgs::srv::GetAvailableMaps_Response::maps( +void GetAvailableMaps_Response::maps( const std::vector& _maps) { m_maps = _maps; @@ -295,7 +186,7 @@ void carla_msgs::srv::GetAvailableMaps_Response::maps( * @brief This function moves the value in member maps * @param _maps New value to be moved in member maps */ -void carla_msgs::srv::GetAvailableMaps_Response::maps( +void GetAvailableMaps_Response::maps( std::vector&& _maps) { m_maps = std::move(_maps); @@ -305,7 +196,7 @@ void carla_msgs::srv::GetAvailableMaps_Response::maps( * @brief This function returns a constant reference to member maps * @return Constant reference to member maps */ -const std::vector& carla_msgs::srv::GetAvailableMaps_Response::maps() const +const std::vector& GetAvailableMaps_Response::maps() const { return m_maps; } @@ -314,31 +205,18 @@ const std::vector& carla_msgs::srv::GetAvailableMaps_Response::maps * @brief This function returns a reference to member maps * @return Reference to member maps */ -std::vector& carla_msgs::srv::GetAvailableMaps_Response::maps() +std::vector& GetAvailableMaps_Response::maps() { return m_maps; } -size_t carla_msgs::srv::GetAvailableMaps_Response::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace srv -bool carla_msgs::srv::GetAvailableMaps_Response::isKeyDefined() -{ - return false; -} - -void carla_msgs::srv::GetAvailableMaps_Response::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "GetAvailableMapsCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.h index a58220f60c4..ebff2b05aa5 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMaps.h @@ -16,19 +16,24 @@ * @file GetAvailableMaps.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,316 +47,218 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(GetAvailableMaps_SOURCE) -#define GetAvailableMaps_DllAPI __declspec( dllexport ) +#if defined(GETAVAILABLEMAPS_SOURCE) +#define GETAVAILABLEMAPS_DllAPI __declspec( dllexport ) #else -#define GetAvailableMaps_DllAPI __declspec( dllimport ) -#endif // GetAvailableMaps_SOURCE +#define GETAVAILABLEMAPS_DllAPI __declspec( dllimport ) +#endif // GETAVAILABLEMAPS_SOURCE #else -#define GetAvailableMaps_DllAPI +#define GETAVAILABLEMAPS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define GetAvailableMaps_DllAPI +#define GETAVAILABLEMAPS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace srv { - /*! - * @brief This class represents the structure GetAvailableMaps_Request defined by the user in the IDL file. - * @ingroup GETAVAILABLEMAPS - */ - class GetAvailableMaps_Request - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GetAvailableMaps_Request(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GetAvailableMaps_Request(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. - */ - eProsima_user_DllExport GetAvailableMaps_Request( - const GetAvailableMaps_Request& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. - */ - eProsima_user_DllExport GetAvailableMaps_Request( - GetAvailableMaps_Request&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. - */ - eProsima_user_DllExport GetAvailableMaps_Request& operator =( - const GetAvailableMaps_Request& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. - */ - eProsima_user_DllExport GetAvailableMaps_Request& operator =( - GetAvailableMaps_Request&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::GetAvailableMaps_Request object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GetAvailableMaps_Request& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::GetAvailableMaps_Request object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GetAvailableMaps_Request& x) const; - - /*! - * @brief This function sets a value in member structure_needs_at_least_one_member - * @param _structure_needs_at_least_one_member New value for member structure_needs_at_least_one_member - */ - eProsima_user_DllExport void structure_needs_at_least_one_member( - uint8_t _structure_needs_at_least_one_member); - - /*! - * @brief This function returns the value of member structure_needs_at_least_one_member - * @return Value of member structure_needs_at_least_one_member - */ - eProsima_user_DllExport uint8_t structure_needs_at_least_one_member() const; - - /*! - * @brief This function returns a reference to member structure_needs_at_least_one_member - * @return Reference to member structure_needs_at_least_one_member - */ - eProsima_user_DllExport uint8_t& structure_needs_at_least_one_member(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::GetAvailableMaps_Request& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_structure_needs_at_least_one_member; - }; - /*! - * @brief This class represents the structure GetAvailableMaps_Response defined by the user in the IDL file. - * @ingroup GETAVAILABLEMAPS - */ - class GetAvailableMaps_Response - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GetAvailableMaps_Response(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GetAvailableMaps_Response(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. - */ - eProsima_user_DllExport GetAvailableMaps_Response( - const GetAvailableMaps_Response& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. - */ - eProsima_user_DllExport GetAvailableMaps_Response( - GetAvailableMaps_Response&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. - */ - eProsima_user_DllExport GetAvailableMaps_Response& operator =( - const GetAvailableMaps_Response& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. - */ - eProsima_user_DllExport GetAvailableMaps_Response& operator =( - GetAvailableMaps_Response&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::GetAvailableMaps_Response object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GetAvailableMaps_Response& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::GetAvailableMaps_Response object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GetAvailableMaps_Response& x) const; - - /*! - * @brief This function copies the value in member maps - * @param _maps New value to be copied in member maps - */ - eProsima_user_DllExport void maps( - const std::vector& _maps); - - /*! - * @brief This function moves the value in member maps - * @param _maps New value to be moved in member maps - */ - eProsima_user_DllExport void maps( - std::vector&& _maps); - - /*! - * @brief This function returns a constant reference to member maps - * @return Constant reference to member maps - */ - eProsima_user_DllExport const std::vector& maps() const; - - /*! - * @brief This function returns a reference to member maps - * @return Reference to member maps - */ - eProsima_user_DllExport std::vector& maps(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::GetAvailableMaps_Response& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_maps; - }; - } // namespace srv + +namespace srv { + + + +/*! + * @brief This class represents the structure GetAvailableMaps_Request defined by the user in the IDL file. + * @ingroup GetAvailableMaps + */ +class GetAvailableMaps_Request +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GetAvailableMaps_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GetAvailableMaps_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Request( + const GetAvailableMaps_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Request( + GetAvailableMaps_Request&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Request& operator =( + const GetAvailableMaps_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Request that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Request& operator =( + GetAvailableMaps_Request&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetAvailableMaps_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GetAvailableMaps_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetAvailableMaps_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GetAvailableMaps_Request& x) const; + + /*! + * @brief This function sets a value in member structure_needs_at_least_one_member + * @param _structure_needs_at_least_one_member New value for member structure_needs_at_least_one_member + */ + eProsima_user_DllExport void structure_needs_at_least_one_member( + uint8_t _structure_needs_at_least_one_member); + + /*! + * @brief This function returns the value of member structure_needs_at_least_one_member + * @return Value of member structure_needs_at_least_one_member + */ + eProsima_user_DllExport uint8_t structure_needs_at_least_one_member() const; + + /*! + * @brief This function returns a reference to member structure_needs_at_least_one_member + * @return Reference to member structure_needs_at_least_one_member + */ + eProsima_user_DllExport uint8_t& structure_needs_at_least_one_member(); + +private: + + uint8_t m_structure_needs_at_least_one_member{0}; + +}; + + + + +/*! + * @brief This class represents the structure GetAvailableMaps_Response defined by the user in the IDL file. + * @ingroup GetAvailableMaps + */ +class GetAvailableMaps_Response +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GetAvailableMaps_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GetAvailableMaps_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Response( + const GetAvailableMaps_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Response( + GetAvailableMaps_Response&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Response& operator =( + const GetAvailableMaps_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::GetAvailableMaps_Response that will be copied. + */ + eProsima_user_DllExport GetAvailableMaps_Response& operator =( + GetAvailableMaps_Response&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetAvailableMaps_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GetAvailableMaps_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetAvailableMaps_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GetAvailableMaps_Response& x) const; + + /*! + * @brief This function copies the value in member maps + * @param _maps New value to be copied in member maps + */ + eProsima_user_DllExport void maps( + const std::vector& _maps); + + /*! + * @brief This function moves the value in member maps + * @param _maps New value to be moved in member maps + */ + eProsima_user_DllExport void maps( + std::vector&& _maps); + + /*! + * @brief This function returns a constant reference to member maps + * @return Constant reference to member maps + */ + eProsima_user_DllExport const std::vector& maps() const; + + /*! + * @brief This function returns a reference to member maps + * @return Reference to member maps + */ + eProsima_user_DllExport std::vector& maps(); + +private: + + std::vector m_maps; + +}; + +} // namespace srv + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsCdrAux.hpp new file mode 100644 index 00000000000..a43330ce08b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetAvailableMapsCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPSCDRAUX_HPP_ + +#include "GetAvailableMaps.h" + +constexpr uint32_t carla_msgs_srv_GetAvailableMaps_Response_max_cdr_typesize {26012UL}; +constexpr uint32_t carla_msgs_srv_GetAvailableMaps_Response_max_key_cdr_typesize {0UL}; + +constexpr uint32_t carla_msgs_srv_GetAvailableMaps_Request_max_cdr_typesize {5UL}; +constexpr uint32_t carla_msgs_srv_GetAvailableMaps_Request_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetAvailableMaps_Request& data); + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetAvailableMaps_Response& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsCdrAux.ipp new file mode 100644 index 00000000000..30dbfe2cbd1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsCdrAux.ipp @@ -0,0 +1,218 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetAvailableMapsCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPSCDRAUX_IPP_ + +#include "GetAvailableMapsCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::GetAvailableMaps_Request& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.structure_needs_at_least_one_member(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetAvailableMaps_Request& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.structure_needs_at_least_one_member() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::GetAvailableMaps_Request& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.structure_needs_at_least_one_member(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetAvailableMaps_Request& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::GetAvailableMaps_Response& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.maps(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetAvailableMaps_Response& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.maps() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::GetAvailableMaps_Response& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.maps(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetAvailableMaps_Response& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.cxx index dc46fb0e1a3..1f133d1745a 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.cxx @@ -16,301 +16,341 @@ * @file GetAvailableMapsPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "GetAvailableMapsPubSubTypes.h" +#include "GetAvailableMapsCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace srv { - GetAvailableMaps_RequestPubSubType::GetAvailableMaps_RequestPubSubType() - { - setName("carla_msgs::srv::dds_::GetAvailableMaps_Request_"); - auto type_size = GetAvailableMaps_Request::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = GetAvailableMaps_Request::isKeyDefined(); - size_t keyLength = GetAvailableMaps_Request::getKeyMaxCdrSerializedSize() > 16 ? - GetAvailableMaps_Request::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - GetAvailableMaps_RequestPubSubType::~GetAvailableMaps_RequestPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool GetAvailableMaps_RequestPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - GetAvailableMaps_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool GetAvailableMaps_RequestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - GetAvailableMaps_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function GetAvailableMaps_RequestPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* GetAvailableMaps_RequestPubSubType::createData() - { - return reinterpret_cast(new GetAvailableMaps_Request()); - } - - void GetAvailableMaps_RequestPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool GetAvailableMaps_RequestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - GetAvailableMaps_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - GetAvailableMaps_Request::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || GetAvailableMaps_Request::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - GetAvailableMaps_ResponsePubSubType::GetAvailableMaps_ResponsePubSubType() - { - setName("carla_msgs::srv::dds_::GetAvailableMaps_Response_"); - auto type_size = GetAvailableMaps_Response::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = GetAvailableMaps_Response::isKeyDefined(); - size_t keyLength = GetAvailableMaps_Response::getKeyMaxCdrSerializedSize() > 16 ? - GetAvailableMaps_Response::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - GetAvailableMaps_ResponsePubSubType::~GetAvailableMaps_ResponsePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool GetAvailableMaps_ResponsePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - GetAvailableMaps_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool GetAvailableMaps_ResponsePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - GetAvailableMaps_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function GetAvailableMaps_ResponsePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* GetAvailableMaps_ResponsePubSubType::createData() - { - return reinterpret_cast(new GetAvailableMaps_Response()); - } - - void GetAvailableMaps_ResponsePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool GetAvailableMaps_ResponsePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - GetAvailableMaps_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - GetAvailableMaps_Response::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || GetAvailableMaps_Response::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace srv +namespace srv { + + +GetAvailableMaps_RequestPubSubType::GetAvailableMaps_RequestPubSubType() +{ + setName("carla_msgs::srv::dds_::GetAvailableMaps_Request_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(GetAvailableMaps_Request::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_GetAvailableMaps_Request_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +GetAvailableMaps_RequestPubSubType::~GetAvailableMaps_RequestPubSubType() +{ +} + +bool GetAvailableMaps_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + GetAvailableMaps_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool GetAvailableMaps_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + GetAvailableMaps_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function GetAvailableMaps_RequestPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* GetAvailableMaps_RequestPubSubType::createData() +{ + return reinterpret_cast(new GetAvailableMaps_Request()); +} + +void GetAvailableMaps_RequestPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool GetAvailableMaps_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + + + + +GetAvailableMaps_ResponsePubSubType::GetAvailableMaps_ResponsePubSubType() +{ + setName("carla_msgs::srv::dds_::GetAvailableMaps_Response_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(GetAvailableMaps_Response::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_GetAvailableMaps_Response_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +GetAvailableMaps_ResponsePubSubType::~GetAvailableMaps_ResponsePubSubType() +{ +} + +bool GetAvailableMaps_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + GetAvailableMaps_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool GetAvailableMaps_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + GetAvailableMaps_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function GetAvailableMaps_ResponsePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* GetAvailableMaps_ResponsePubSubType::createData() +{ + return reinterpret_cast(new GetAvailableMaps_Response()); +} + +void GetAvailableMaps_ResponsePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool GetAvailableMaps_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace srv + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.h index d9da4b72170..924d392bae3 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetAvailableMapsPubSubTypes.h @@ -16,156 +16,209 @@ * @file GetAvailableMapsPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "GetAvailableMaps.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated GetAvailableMaps is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace srv { + + + +/*! + * @brief This class represents the TopicDataType of the type GetAvailableMaps_Request defined by the user in the IDL file. + * @ingroup GetAvailableMaps + */ +class GetAvailableMaps_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace srv +public: + + typedef GetAvailableMaps_Request type; + + eProsima_user_DllExport GetAvailableMaps_RequestPubSubType(); + + eProsima_user_DllExport ~GetAvailableMaps_RequestPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override { - /*! - * @brief This class represents the TopicDataType of the type GetAvailableMaps_Request defined by the user in the IDL file. - * @ingroup GETAVAILABLEMAPS - */ - class GetAvailableMaps_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - typedef GetAvailableMaps_Request type; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport GetAvailableMaps_RequestPubSubType(); + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual ~GetAvailableMaps_RequestPubSubType(); + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport void deleteData( + void* data) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport virtual void* createData() override; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } +}; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) GetAvailableMaps_Request(); - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +/*! + * @brief This class represents the TopicDataType of the type GetAvailableMaps_Response defined by the user in the IDL file. + * @ingroup GetAvailableMaps + */ +class GetAvailableMaps_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - MD5 m_md5; - unsigned char* m_keyBuffer; - }; - /*! - * @brief This class represents the TopicDataType of the type GetAvailableMaps_Response defined by the user in the IDL file. - * @ingroup GETAVAILABLEMAPS - */ - class GetAvailableMaps_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef GetAvailableMaps_Response type; - typedef GetAvailableMaps_Response type; + eProsima_user_DllExport GetAvailableMaps_ResponsePubSubType(); - eProsima_user_DllExport GetAvailableMaps_ResponsePubSubType(); + eProsima_user_DllExport ~GetAvailableMaps_ResponsePubSubType() override; - eProsima_user_DllExport virtual ~GetAvailableMaps_ResponsePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETAVAILABLEMAPS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.cxx index 8110bf119b9..b8e40530f49 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.cxx @@ -14,9 +14,9 @@ /*! * @file GetBlueprints.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,111 +27,75 @@ char dummy; #endif // _WIN32 #include "GetBlueprints.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::srv::GetBlueprints_Request::GetBlueprints_Request() -{ - // m_filter com.eprosima.idl.parser.typecode.StringTypeCode@7c417213 - m_filter =""; +namespace carla_msgs { + +namespace srv { + + + +GetBlueprints_Request::GetBlueprints_Request() +{ } -carla_msgs::srv::GetBlueprints_Request::~GetBlueprints_Request() +GetBlueprints_Request::~GetBlueprints_Request() { } -carla_msgs::srv::GetBlueprints_Request::GetBlueprints_Request( +GetBlueprints_Request::GetBlueprints_Request( const GetBlueprints_Request& x) { m_filter = x.m_filter; } -carla_msgs::srv::GetBlueprints_Request::GetBlueprints_Request( - GetBlueprints_Request&& x) +GetBlueprints_Request::GetBlueprints_Request( + GetBlueprints_Request&& x) noexcept { m_filter = std::move(x.m_filter); } -carla_msgs::srv::GetBlueprints_Request& carla_msgs::srv::GetBlueprints_Request::operator =( +GetBlueprints_Request& GetBlueprints_Request::operator =( const GetBlueprints_Request& x) { m_filter = x.m_filter; - return *this; } -carla_msgs::srv::GetBlueprints_Request& carla_msgs::srv::GetBlueprints_Request::operator =( - GetBlueprints_Request&& x) +GetBlueprints_Request& GetBlueprints_Request::operator =( + GetBlueprints_Request&& x) noexcept { m_filter = std::move(x.m_filter); - return *this; } -bool carla_msgs::srv::GetBlueprints_Request::operator ==( +bool GetBlueprints_Request::operator ==( const GetBlueprints_Request& x) const { - return (m_filter == x.m_filter); } -bool carla_msgs::srv::GetBlueprints_Request::operator !=( +bool GetBlueprints_Request::operator !=( const GetBlueprints_Request& x) const { return !(*this == x); } -size_t carla_msgs::srv::GetBlueprints_Request::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::GetBlueprints_Request::getCdrSerializedSize( - const carla_msgs::srv::GetBlueprints_Request& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.filter().size() + 1; - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::GetBlueprints_Request::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_filter; - -} - -void carla_msgs::srv::GetBlueprints_Request::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_filter; -} - /*! * @brief This function copies the value in member filter * @param _filter New value to be copied in member filter */ -void carla_msgs::srv::GetBlueprints_Request::filter( +void GetBlueprints_Request::filter( const std::string& _filter) { m_filter = _filter; @@ -141,7 +105,7 @@ void carla_msgs::srv::GetBlueprints_Request::filter( * @brief This function moves the value in member filter * @param _filter New value to be moved in member filter */ -void carla_msgs::srv::GetBlueprints_Request::filter( +void GetBlueprints_Request::filter( std::string&& _filter) { m_filter = std::move(_filter); @@ -151,7 +115,7 @@ void carla_msgs::srv::GetBlueprints_Request::filter( * @brief This function returns a constant reference to member filter * @return Constant reference to member filter */ -const std::string& carla_msgs::srv::GetBlueprints_Request::filter() const +const std::string& GetBlueprints_Request::filter() const { return m_filter; } @@ -160,139 +124,69 @@ const std::string& carla_msgs::srv::GetBlueprints_Request::filter() const * @brief This function returns a reference to member filter * @return Reference to member filter */ -std::string& carla_msgs::srv::GetBlueprints_Request::filter() +std::string& GetBlueprints_Request::filter() { return m_filter; } -size_t carla_msgs::srv::GetBlueprints_Request::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} - -bool carla_msgs::srv::GetBlueprints_Request::isKeyDefined() -{ - return false; -} -void carla_msgs::srv::GetBlueprints_Request::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} -carla_msgs::srv::GetBlueprints_Response::GetBlueprints_Response() +GetBlueprints_Response::GetBlueprints_Response() { - // m_blueprints com.eprosima.idl.parser.typecode.SequenceTypeCode@5e4c8041 - - } -carla_msgs::srv::GetBlueprints_Response::~GetBlueprints_Response() +GetBlueprints_Response::~GetBlueprints_Response() { } -carla_msgs::srv::GetBlueprints_Response::GetBlueprints_Response( +GetBlueprints_Response::GetBlueprints_Response( const GetBlueprints_Response& x) { m_blueprints = x.m_blueprints; } -carla_msgs::srv::GetBlueprints_Response::GetBlueprints_Response( - GetBlueprints_Response&& x) +GetBlueprints_Response::GetBlueprints_Response( + GetBlueprints_Response&& x) noexcept { m_blueprints = std::move(x.m_blueprints); } -carla_msgs::srv::GetBlueprints_Response& carla_msgs::srv::GetBlueprints_Response::operator =( +GetBlueprints_Response& GetBlueprints_Response::operator =( const GetBlueprints_Response& x) { m_blueprints = x.m_blueprints; - return *this; } -carla_msgs::srv::GetBlueprints_Response& carla_msgs::srv::GetBlueprints_Response::operator =( - GetBlueprints_Response&& x) +GetBlueprints_Response& GetBlueprints_Response::operator =( + GetBlueprints_Response&& x) noexcept { m_blueprints = std::move(x.m_blueprints); - return *this; } -bool carla_msgs::srv::GetBlueprints_Response::operator ==( +bool GetBlueprints_Response::operator ==( const GetBlueprints_Response& x) const { - return (m_blueprints == x.m_blueprints); } -bool carla_msgs::srv::GetBlueprints_Response::operator !=( +bool GetBlueprints_Response::operator !=( const GetBlueprints_Response& x) const { return !(*this == x); } -size_t carla_msgs::srv::GetBlueprints_Response::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += carla_msgs::msg::CarlaActorBlueprint::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::GetBlueprints_Response::getCdrSerializedSize( - const carla_msgs::srv::GetBlueprints_Response& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.blueprints().size(); ++a) - { - current_alignment += carla_msgs::msg::CarlaActorBlueprint::getCdrSerializedSize(data.blueprints().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::GetBlueprints_Response::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_blueprints; -} - -void carla_msgs::srv::GetBlueprints_Response::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_blueprints;} - /*! * @brief This function copies the value in member blueprints * @param _blueprints New value to be copied in member blueprints */ -void carla_msgs::srv::GetBlueprints_Response::blueprints( +void GetBlueprints_Response::blueprints( const std::vector& _blueprints) { m_blueprints = _blueprints; @@ -302,7 +196,7 @@ void carla_msgs::srv::GetBlueprints_Response::blueprints( * @brief This function moves the value in member blueprints * @param _blueprints New value to be moved in member blueprints */ -void carla_msgs::srv::GetBlueprints_Response::blueprints( +void GetBlueprints_Response::blueprints( std::vector&& _blueprints) { m_blueprints = std::move(_blueprints); @@ -312,7 +206,7 @@ void carla_msgs::srv::GetBlueprints_Response::blueprints( * @brief This function returns a constant reference to member blueprints * @return Constant reference to member blueprints */ -const std::vector& carla_msgs::srv::GetBlueprints_Response::blueprints() const +const std::vector& GetBlueprints_Response::blueprints() const { return m_blueprints; } @@ -321,31 +215,18 @@ const std::vector& carla_msgs::srv::GetBlu * @brief This function returns a reference to member blueprints * @return Reference to member blueprints */ -std::vector& carla_msgs::srv::GetBlueprints_Response::blueprints() +std::vector& GetBlueprints_Response::blueprints() { return m_blueprints; } -size_t carla_msgs::srv::GetBlueprints_Response::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace srv -bool carla_msgs::srv::GetBlueprints_Response::isKeyDefined() -{ - return false; -} - -void carla_msgs::srv::GetBlueprints_Response::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "GetBlueprintsCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.h index 548a7b44cf1..2084f75f48e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprints.h @@ -16,20 +16,25 @@ * @file GetBlueprints.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_H_ -#include "carla_msgs/msg/CarlaActorBlueprint.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "carla_msgs/msg/CarlaActorBlueprint.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,322 +48,225 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(GetBlueprints_SOURCE) -#define GetBlueprints_DllAPI __declspec( dllexport ) +#if defined(GETBLUEPRINTS_SOURCE) +#define GETBLUEPRINTS_DllAPI __declspec( dllexport ) #else -#define GetBlueprints_DllAPI __declspec( dllimport ) -#endif // GetBlueprints_SOURCE +#define GETBLUEPRINTS_DllAPI __declspec( dllimport ) +#endif // GETBLUEPRINTS_SOURCE #else -#define GetBlueprints_DllAPI +#define GETBLUEPRINTS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define GetBlueprints_DllAPI +#define GETBLUEPRINTS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace srv { - /*! - * @brief This class represents the structure GetBlueprints_Request defined by the user in the IDL file. - * @ingroup GETBLUEPRINTS - */ - class GetBlueprints_Request - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GetBlueprints_Request(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GetBlueprints_Request(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. - */ - eProsima_user_DllExport GetBlueprints_Request( - const GetBlueprints_Request& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. - */ - eProsima_user_DllExport GetBlueprints_Request( - GetBlueprints_Request&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. - */ - eProsima_user_DllExport GetBlueprints_Request& operator =( - const GetBlueprints_Request& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. - */ - eProsima_user_DllExport GetBlueprints_Request& operator =( - GetBlueprints_Request&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::GetBlueprints_Request object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GetBlueprints_Request& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::GetBlueprints_Request object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GetBlueprints_Request& x) const; - - /*! - * @brief This function copies the value in member filter - * @param _filter New value to be copied in member filter - */ - eProsima_user_DllExport void filter( - const std::string& _filter); - - /*! - * @brief This function moves the value in member filter - * @param _filter New value to be moved in member filter - */ - eProsima_user_DllExport void filter( - std::string&& _filter); - - /*! - * @brief This function returns a constant reference to member filter - * @return Constant reference to member filter - */ - eProsima_user_DllExport const std::string& filter() const; - - /*! - * @brief This function returns a reference to member filter - * @return Reference to member filter - */ - eProsima_user_DllExport std::string& filter(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::GetBlueprints_Request& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::string m_filter; - }; - /*! - * @brief This class represents the structure GetBlueprints_Response defined by the user in the IDL file. - * @ingroup GETBLUEPRINTS - */ - class GetBlueprints_Response - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GetBlueprints_Response(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GetBlueprints_Response(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. - */ - eProsima_user_DllExport GetBlueprints_Response( - const GetBlueprints_Response& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. - */ - eProsima_user_DllExport GetBlueprints_Response( - GetBlueprints_Response&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. - */ - eProsima_user_DllExport GetBlueprints_Response& operator =( - const GetBlueprints_Response& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. - */ - eProsima_user_DllExport GetBlueprints_Response& operator =( - GetBlueprints_Response&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::GetBlueprints_Response object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GetBlueprints_Response& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::GetBlueprints_Response object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GetBlueprints_Response& x) const; - - /*! - * @brief This function copies the value in member blueprints - * @param _blueprints New value to be copied in member blueprints - */ - eProsima_user_DllExport void blueprints( - const std::vector& _blueprints); - - /*! - * @brief This function moves the value in member blueprints - * @param _blueprints New value to be moved in member blueprints - */ - eProsima_user_DllExport void blueprints( - std::vector&& _blueprints); - - /*! - * @brief This function returns a constant reference to member blueprints - * @return Constant reference to member blueprints - */ - eProsima_user_DllExport const std::vector& blueprints() const; - - /*! - * @brief This function returns a reference to member blueprints - * @return Reference to member blueprints - */ - eProsima_user_DllExport std::vector& blueprints(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::GetBlueprints_Response& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_blueprints; - }; - } // namespace srv + +namespace srv { + + + +/*! + * @brief This class represents the structure GetBlueprints_Request defined by the user in the IDL file. + * @ingroup GetBlueprints + */ +class GetBlueprints_Request +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GetBlueprints_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GetBlueprints_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Request( + const GetBlueprints_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Request( + GetBlueprints_Request&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Request& operator =( + const GetBlueprints_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Request that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Request& operator =( + GetBlueprints_Request&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetBlueprints_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GetBlueprints_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetBlueprints_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GetBlueprints_Request& x) const; + + /*! + * @brief This function copies the value in member filter + * @param _filter New value to be copied in member filter + */ + eProsima_user_DllExport void filter( + const std::string& _filter); + + /*! + * @brief This function moves the value in member filter + * @param _filter New value to be moved in member filter + */ + eProsima_user_DllExport void filter( + std::string&& _filter); + + /*! + * @brief This function returns a constant reference to member filter + * @return Constant reference to member filter + */ + eProsima_user_DllExport const std::string& filter() const; + + /*! + * @brief This function returns a reference to member filter + * @return Reference to member filter + */ + eProsima_user_DllExport std::string& filter(); + +private: + + std::string m_filter; + +}; + + + + +/*! + * @brief This class represents the structure GetBlueprints_Response defined by the user in the IDL file. + * @ingroup GetBlueprints + */ +class GetBlueprints_Response +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GetBlueprints_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GetBlueprints_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Response( + const GetBlueprints_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Response( + GetBlueprints_Response&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Response& operator =( + const GetBlueprints_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::GetBlueprints_Response that will be copied. + */ + eProsima_user_DllExport GetBlueprints_Response& operator =( + GetBlueprints_Response&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetBlueprints_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GetBlueprints_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::GetBlueprints_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GetBlueprints_Response& x) const; + + /*! + * @brief This function copies the value in member blueprints + * @param _blueprints New value to be copied in member blueprints + */ + eProsima_user_DllExport void blueprints( + const std::vector& _blueprints); + + /*! + * @brief This function moves the value in member blueprints + * @param _blueprints New value to be moved in member blueprints + */ + eProsima_user_DllExport void blueprints( + std::vector&& _blueprints); + + /*! + * @brief This function returns a constant reference to member blueprints + * @return Constant reference to member blueprints + */ + eProsima_user_DllExport const std::vector& blueprints() const; + + /*! + * @brief This function returns a reference to member blueprints + * @return Reference to member blueprints + */ + eProsima_user_DllExport std::vector& blueprints(); + +private: + + std::vector m_blueprints; + +}; + +} // namespace srv + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsCdrAux.hpp new file mode 100644 index 00000000000..a3d52629c30 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsCdrAux.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetBlueprintsCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTSCDRAUX_HPP_ + +#include "GetBlueprints.h" + +constexpr uint32_t carla_msgs_srv_GetBlueprints_Response_max_cdr_typesize {7868012UL}; +constexpr uint32_t carla_msgs_srv_GetBlueprints_Response_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t carla_msgs_srv_GetBlueprints_Request_max_cdr_typesize {264UL}; +constexpr uint32_t carla_msgs_srv_GetBlueprints_Request_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetBlueprints_Request& data); + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetBlueprints_Response& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsCdrAux.ipp new file mode 100644 index 00000000000..453bc1298e0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsCdrAux.ipp @@ -0,0 +1,218 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GetBlueprintsCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTSCDRAUX_IPP_ + +#include "GetBlueprintsCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::GetBlueprints_Request& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.filter(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetBlueprints_Request& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.filter() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::GetBlueprints_Request& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.filter(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetBlueprints_Request& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::GetBlueprints_Response& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.blueprints(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetBlueprints_Response& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.blueprints() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::GetBlueprints_Response& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.blueprints(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::GetBlueprints_Response& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.cxx index 5c0b0f12ec1..b7ba162d329 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.cxx @@ -16,301 +16,341 @@ * @file GetBlueprintsPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "GetBlueprintsPubSubTypes.h" +#include "GetBlueprintsCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace srv { - GetBlueprints_RequestPubSubType::GetBlueprints_RequestPubSubType() - { - setName("carla_msgs::srv::dds_::GetBlueprints_Request_"); - auto type_size = GetBlueprints_Request::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = GetBlueprints_Request::isKeyDefined(); - size_t keyLength = GetBlueprints_Request::getKeyMaxCdrSerializedSize() > 16 ? - GetBlueprints_Request::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - GetBlueprints_RequestPubSubType::~GetBlueprints_RequestPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool GetBlueprints_RequestPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - GetBlueprints_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool GetBlueprints_RequestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - GetBlueprints_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function GetBlueprints_RequestPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* GetBlueprints_RequestPubSubType::createData() - { - return reinterpret_cast(new GetBlueprints_Request()); - } - - void GetBlueprints_RequestPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool GetBlueprints_RequestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - GetBlueprints_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - GetBlueprints_Request::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || GetBlueprints_Request::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - GetBlueprints_ResponsePubSubType::GetBlueprints_ResponsePubSubType() - { - setName("carla_msgs::srv::dds_::GetBlueprints_Response_"); - auto type_size = GetBlueprints_Response::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = GetBlueprints_Response::isKeyDefined(); - size_t keyLength = GetBlueprints_Response::getKeyMaxCdrSerializedSize() > 16 ? - GetBlueprints_Response::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - GetBlueprints_ResponsePubSubType::~GetBlueprints_ResponsePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool GetBlueprints_ResponsePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - GetBlueprints_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool GetBlueprints_ResponsePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - GetBlueprints_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function GetBlueprints_ResponsePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* GetBlueprints_ResponsePubSubType::createData() - { - return reinterpret_cast(new GetBlueprints_Response()); - } - - void GetBlueprints_ResponsePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool GetBlueprints_ResponsePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - GetBlueprints_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - GetBlueprints_Response::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || GetBlueprints_Response::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace srv +namespace srv { + + +GetBlueprints_RequestPubSubType::GetBlueprints_RequestPubSubType() +{ + setName("carla_msgs::srv::dds_::GetBlueprints_Request_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(GetBlueprints_Request::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_GetBlueprints_Request_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +GetBlueprints_RequestPubSubType::~GetBlueprints_RequestPubSubType() +{ +} + +bool GetBlueprints_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + GetBlueprints_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool GetBlueprints_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + GetBlueprints_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function GetBlueprints_RequestPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* GetBlueprints_RequestPubSubType::createData() +{ + return reinterpret_cast(new GetBlueprints_Request()); +} + +void GetBlueprints_RequestPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool GetBlueprints_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + + + + +GetBlueprints_ResponsePubSubType::GetBlueprints_ResponsePubSubType() +{ + setName("carla_msgs::srv::dds_::GetBlueprints_Response_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(GetBlueprints_Response::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_GetBlueprints_Response_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +GetBlueprints_ResponsePubSubType::~GetBlueprints_ResponsePubSubType() +{ +} + +bool GetBlueprints_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + GetBlueprints_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool GetBlueprints_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + GetBlueprints_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function GetBlueprints_ResponsePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* GetBlueprints_ResponsePubSubType::createData() +{ + return reinterpret_cast(new GetBlueprints_Response()); +} + +void GetBlueprints_ResponsePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool GetBlueprints_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace srv + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.h index d609fa66c15..e7f947565e2 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/GetBlueprintsPubSubTypes.h @@ -16,156 +16,210 @@ * @file GetBlueprintsPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "GetBlueprints.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated GetBlueprints is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace srv { + + + +/*! + * @brief This class represents the TopicDataType of the type GetBlueprints_Request defined by the user in the IDL file. + * @ingroup GetBlueprints + */ +class GetBlueprints_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace srv +public: + + typedef GetBlueprints_Request type; + + eProsima_user_DllExport GetBlueprints_RequestPubSubType(); + + eProsima_user_DllExport ~GetBlueprints_RequestPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override { - /*! - * @brief This class represents the TopicDataType of the type GetBlueprints_Request defined by the user in the IDL file. - * @ingroup GETBLUEPRINTS - */ - class GetBlueprints_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - typedef GetBlueprints_Request type; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport GetBlueprints_RequestPubSubType(); + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual ~GetBlueprints_RequestPubSubType(); + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport void deleteData( + void* data) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport virtual void* createData() override; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } +}; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +/*! + * @brief This class represents the TopicDataType of the type GetBlueprints_Response defined by the user in the IDL file. + * @ingroup GetBlueprints + */ +class GetBlueprints_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - MD5 m_md5; - unsigned char* m_keyBuffer; - }; - /*! - * @brief This class represents the TopicDataType of the type GetBlueprints_Response defined by the user in the IDL file. - * @ingroup GETBLUEPRINTS - */ - class GetBlueprints_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef GetBlueprints_Response type; - typedef GetBlueprints_Response type; + eProsima_user_DllExport GetBlueprints_ResponsePubSubType(); - eProsima_user_DllExport GetBlueprints_ResponsePubSubType(); + eProsima_user_DllExport ~GetBlueprints_ResponsePubSubType() override; - eProsima_user_DllExport virtual ~GetBlueprints_ResponsePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_GETBLUEPRINTS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.cxx index 8b0e9aab91a..aa9a8667a02 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.cxx @@ -14,9 +14,9 @@ /*! * @file LoadMap.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,46 +27,35 @@ char dummy; #endif // _WIN32 #include "LoadMap.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace carla_msgs { +namespace srv { +namespace LoadMap_Request_Constants { +} // namespace LoadMap_Request_Constants - - - - - -carla_msgs::srv::LoadMap_Request::LoadMap_Request() +LoadMap_Request::LoadMap_Request() { - // m_mapname com.eprosima.idl.parser.typecode.StringTypeCode@3d3fcdb0 - m_mapname =""; - // m_force_reload com.eprosima.idl.parser.typecode.PrimitiveTypeCode@641147d0 - m_force_reload = false; - // m_reset_episode_settings com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e38921c - m_reset_episode_settings = true; - // m_map_layers com.eprosima.idl.parser.typecode.PrimitiveTypeCode@64d7f7e0 - m_map_layers = 65535; - } -carla_msgs::srv::LoadMap_Request::~LoadMap_Request() +LoadMap_Request::~LoadMap_Request() { - - - } -carla_msgs::srv::LoadMap_Request::LoadMap_Request( +LoadMap_Request::LoadMap_Request( const LoadMap_Request& x) { m_mapname = x.m_mapname; @@ -75,8 +64,8 @@ carla_msgs::srv::LoadMap_Request::LoadMap_Request( m_map_layers = x.m_map_layers; } -carla_msgs::srv::LoadMap_Request::LoadMap_Request( - LoadMap_Request&& x) +LoadMap_Request::LoadMap_Request( + LoadMap_Request&& x) noexcept { m_mapname = std::move(x.m_mapname); m_force_reload = x.m_force_reload; @@ -84,7 +73,7 @@ carla_msgs::srv::LoadMap_Request::LoadMap_Request( m_map_layers = x.m_map_layers; } -carla_msgs::srv::LoadMap_Request& carla_msgs::srv::LoadMap_Request::operator =( +LoadMap_Request& LoadMap_Request::operator =( const LoadMap_Request& x) { @@ -92,105 +81,40 @@ carla_msgs::srv::LoadMap_Request& carla_msgs::srv::LoadMap_Request::operator =( m_force_reload = x.m_force_reload; m_reset_episode_settings = x.m_reset_episode_settings; m_map_layers = x.m_map_layers; - return *this; } -carla_msgs::srv::LoadMap_Request& carla_msgs::srv::LoadMap_Request::operator =( - LoadMap_Request&& x) +LoadMap_Request& LoadMap_Request::operator =( + LoadMap_Request&& x) noexcept { m_mapname = std::move(x.m_mapname); m_force_reload = x.m_force_reload; m_reset_episode_settings = x.m_reset_episode_settings; m_map_layers = x.m_map_layers; - return *this; } -bool carla_msgs::srv::LoadMap_Request::operator ==( +bool LoadMap_Request::operator ==( const LoadMap_Request& x) const { - - return (m_mapname == x.m_mapname && m_force_reload == x.m_force_reload && m_reset_episode_settings == x.m_reset_episode_settings && m_map_layers == x.m_map_layers); + return (m_mapname == x.m_mapname && + m_force_reload == x.m_force_reload && + m_reset_episode_settings == x.m_reset_episode_settings && + m_map_layers == x.m_map_layers); } -bool carla_msgs::srv::LoadMap_Request::operator !=( +bool LoadMap_Request::operator !=( const LoadMap_Request& x) const { return !(*this == x); } -size_t carla_msgs::srv::LoadMap_Request::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::LoadMap_Request::getCdrSerializedSize( - const carla_msgs::srv::LoadMap_Request& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.mapname().size() + 1; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::LoadMap_Request::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_mapname; - scdr << m_force_reload; - scdr << m_reset_episode_settings; - scdr << m_map_layers; - -} - -void carla_msgs::srv::LoadMap_Request::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_mapname; - dcdr >> m_force_reload; - dcdr >> m_reset_episode_settings; - dcdr >> m_map_layers; -} - /*! * @brief This function copies the value in member mapname * @param _mapname New value to be copied in member mapname */ -void carla_msgs::srv::LoadMap_Request::mapname( +void LoadMap_Request::mapname( const std::string& _mapname) { m_mapname = _mapname; @@ -200,7 +124,7 @@ void carla_msgs::srv::LoadMap_Request::mapname( * @brief This function moves the value in member mapname * @param _mapname New value to be moved in member mapname */ -void carla_msgs::srv::LoadMap_Request::mapname( +void LoadMap_Request::mapname( std::string&& _mapname) { m_mapname = std::move(_mapname); @@ -210,7 +134,7 @@ void carla_msgs::srv::LoadMap_Request::mapname( * @brief This function returns a constant reference to member mapname * @return Constant reference to member mapname */ -const std::string& carla_msgs::srv::LoadMap_Request::mapname() const +const std::string& LoadMap_Request::mapname() const { return m_mapname; } @@ -219,15 +143,17 @@ const std::string& carla_msgs::srv::LoadMap_Request::mapname() const * @brief This function returns a reference to member mapname * @return Reference to member mapname */ -std::string& carla_msgs::srv::LoadMap_Request::mapname() +std::string& LoadMap_Request::mapname() { return m_mapname; } + + /*! * @brief This function sets a value in member force_reload * @param _force_reload New value for member force_reload */ -void carla_msgs::srv::LoadMap_Request::force_reload( +void LoadMap_Request::force_reload( bool _force_reload) { m_force_reload = _force_reload; @@ -237,7 +163,7 @@ void carla_msgs::srv::LoadMap_Request::force_reload( * @brief This function returns the value of member force_reload * @return Value of member force_reload */ -bool carla_msgs::srv::LoadMap_Request::force_reload() const +bool LoadMap_Request::force_reload() const { return m_force_reload; } @@ -246,16 +172,17 @@ bool carla_msgs::srv::LoadMap_Request::force_reload() const * @brief This function returns a reference to member force_reload * @return Reference to member force_reload */ -bool& carla_msgs::srv::LoadMap_Request::force_reload() +bool& LoadMap_Request::force_reload() { return m_force_reload; } + /*! * @brief This function sets a value in member reset_episode_settings * @param _reset_episode_settings New value for member reset_episode_settings */ -void carla_msgs::srv::LoadMap_Request::reset_episode_settings( +void LoadMap_Request::reset_episode_settings( bool _reset_episode_settings) { m_reset_episode_settings = _reset_episode_settings; @@ -265,7 +192,7 @@ void carla_msgs::srv::LoadMap_Request::reset_episode_settings( * @brief This function returns the value of member reset_episode_settings * @return Value of member reset_episode_settings */ -bool carla_msgs::srv::LoadMap_Request::reset_episode_settings() const +bool LoadMap_Request::reset_episode_settings() const { return m_reset_episode_settings; } @@ -274,16 +201,17 @@ bool carla_msgs::srv::LoadMap_Request::reset_episode_settings() const * @brief This function returns a reference to member reset_episode_settings * @return Reference to member reset_episode_settings */ -bool& carla_msgs::srv::LoadMap_Request::reset_episode_settings() +bool& LoadMap_Request::reset_episode_settings() { return m_reset_episode_settings; } + /*! * @brief This function sets a value in member map_layers * @param _map_layers New value for member map_layers */ -void carla_msgs::srv::LoadMap_Request::map_layers( +void LoadMap_Request::map_layers( uint16_t _map_layers) { m_map_layers = _map_layers; @@ -293,7 +221,7 @@ void carla_msgs::srv::LoadMap_Request::map_layers( * @brief This function returns the value of member map_layers * @return Value of member map_layers */ -uint16_t carla_msgs::srv::LoadMap_Request::map_layers() const +uint16_t LoadMap_Request::map_layers() const { return m_map_layers; } @@ -302,134 +230,67 @@ uint16_t carla_msgs::srv::LoadMap_Request::map_layers() const * @brief This function returns a reference to member map_layers * @return Reference to member map_layers */ -uint16_t& carla_msgs::srv::LoadMap_Request::map_layers() +uint16_t& LoadMap_Request::map_layers() { return m_map_layers; } -size_t carla_msgs::srv::LoadMap_Request::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} - -bool carla_msgs::srv::LoadMap_Request::isKeyDefined() -{ - return false; -} - -void carla_msgs::srv::LoadMap_Request::serializeKey( - eprosima::fastcdr::Cdr& scdr) const +LoadMap_Response::LoadMap_Response() { - (void) scdr; - } -carla_msgs::srv::LoadMap_Response::LoadMap_Response() +LoadMap_Response::~LoadMap_Response() { - // m_success com.eprosima.idl.parser.typecode.PrimitiveTypeCode@ba8d91c - m_success = false; - } -carla_msgs::srv::LoadMap_Response::~LoadMap_Response() -{ -} - -carla_msgs::srv::LoadMap_Response::LoadMap_Response( +LoadMap_Response::LoadMap_Response( const LoadMap_Response& x) { m_success = x.m_success; } -carla_msgs::srv::LoadMap_Response::LoadMap_Response( - LoadMap_Response&& x) +LoadMap_Response::LoadMap_Response( + LoadMap_Response&& x) noexcept { m_success = x.m_success; } -carla_msgs::srv::LoadMap_Response& carla_msgs::srv::LoadMap_Response::operator =( +LoadMap_Response& LoadMap_Response::operator =( const LoadMap_Response& x) { m_success = x.m_success; - return *this; } -carla_msgs::srv::LoadMap_Response& carla_msgs::srv::LoadMap_Response::operator =( - LoadMap_Response&& x) +LoadMap_Response& LoadMap_Response::operator =( + LoadMap_Response&& x) noexcept { m_success = x.m_success; - return *this; } -bool carla_msgs::srv::LoadMap_Response::operator ==( +bool LoadMap_Response::operator ==( const LoadMap_Response& x) const { - return (m_success == x.m_success); } -bool carla_msgs::srv::LoadMap_Response::operator !=( +bool LoadMap_Response::operator !=( const LoadMap_Response& x) const { return !(*this == x); } -size_t carla_msgs::srv::LoadMap_Response::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::LoadMap_Response::getCdrSerializedSize( - const carla_msgs::srv::LoadMap_Response& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::LoadMap_Response::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_success; - -} - -void carla_msgs::srv::LoadMap_Response::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_success; -} - /*! * @brief This function sets a value in member success * @param _success New value for member success */ -void carla_msgs::srv::LoadMap_Response::success( +void LoadMap_Response::success( bool _success) { m_success = _success; @@ -439,7 +300,7 @@ void carla_msgs::srv::LoadMap_Response::success( * @brief This function returns the value of member success * @return Value of member success */ -bool carla_msgs::srv::LoadMap_Response::success() const +bool LoadMap_Response::success() const { return m_success; } @@ -448,32 +309,18 @@ bool carla_msgs::srv::LoadMap_Response::success() const * @brief This function returns a reference to member success * @return Reference to member success */ -bool& carla_msgs::srv::LoadMap_Response::success() +bool& LoadMap_Response::success() { return m_success; } -size_t carla_msgs::srv::LoadMap_Response::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool carla_msgs::srv::LoadMap_Response::isKeyDefined() -{ - return false; -} +} // namespace srv -void carla_msgs::srv::LoadMap_Response::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LoadMapCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.h index a990e38e04c..28338a5daa2 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMap.h @@ -16,19 +16,24 @@ * @file LoadMap.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,389 +47,294 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LoadMap_SOURCE) -#define LoadMap_DllAPI __declspec( dllexport ) +#if defined(LOADMAP_SOURCE) +#define LOADMAP_DllAPI __declspec( dllexport ) #else -#define LoadMap_DllAPI __declspec( dllimport ) -#endif // LoadMap_SOURCE +#define LOADMAP_DllAPI __declspec( dllimport ) +#endif // LOADMAP_SOURCE #else -#define LoadMap_DllAPI +#define LOADMAP_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define LoadMap_DllAPI +#define LOADMAP_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace srv { - namespace LoadMap_Request_Constants { - const uint16_t MAPLAYERFLAG_NONE = 0; - const uint16_t MAPLAYERFLAG_BUILDINGS = 1; - const uint16_t MAPLAYERFLAG_DECALS = 2; - const uint16_t MAPLAYERFLAG_FOLIAGE = 4; - const uint16_t MAPLAYERFLAG_GROUND = 8; - const uint16_t MAPLAYERFLAG_PARKEDVEHICLES = 16; - const uint16_t MAPLAYERFLAG_PARTICLES = 32; - const uint16_t MAPLAYERFLAG_PROPS = 64; - const uint16_t MAPLAYERFLAG_STREETLIGHTS = 128; - const uint16_t MAPLAYERFLAG_WALLS = 256; - const uint16_t MAPLAYERFLAG_ALL = 65535; - } // namespace LoadMap_Request_Constants - /*! - * @brief This class represents the structure LoadMap_Request defined by the user in the IDL file. - * @ingroup LOADMAP - */ - class LoadMap_Request - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LoadMap_Request(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LoadMap_Request(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. - */ - eProsima_user_DllExport LoadMap_Request( - const LoadMap_Request& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. - */ - eProsima_user_DllExport LoadMap_Request( - LoadMap_Request&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. - */ - eProsima_user_DllExport LoadMap_Request& operator =( - const LoadMap_Request& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. - */ - eProsima_user_DllExport LoadMap_Request& operator =( - LoadMap_Request&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::LoadMap_Request object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LoadMap_Request& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::LoadMap_Request object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LoadMap_Request& x) const; - - /*! - * @brief This function copies the value in member mapname - * @param _mapname New value to be copied in member mapname - */ - eProsima_user_DllExport void mapname( - const std::string& _mapname); - - /*! - * @brief This function moves the value in member mapname - * @param _mapname New value to be moved in member mapname - */ - eProsima_user_DllExport void mapname( - std::string&& _mapname); - - /*! - * @brief This function returns a constant reference to member mapname - * @return Constant reference to member mapname - */ - eProsima_user_DllExport const std::string& mapname() const; - - /*! - * @brief This function returns a reference to member mapname - * @return Reference to member mapname - */ - eProsima_user_DllExport std::string& mapname(); - /*! - * @brief This function sets a value in member force_reload - * @param _force_reload New value for member force_reload - */ - eProsima_user_DllExport void force_reload( - bool _force_reload); - - /*! - * @brief This function returns the value of member force_reload - * @return Value of member force_reload - */ - eProsima_user_DllExport bool force_reload() const; - - /*! - * @brief This function returns a reference to member force_reload - * @return Reference to member force_reload - */ - eProsima_user_DllExport bool& force_reload(); - - /*! - * @brief This function sets a value in member reset_episode_settings - * @param _reset_episode_settings New value for member reset_episode_settings - */ - eProsima_user_DllExport void reset_episode_settings( - bool _reset_episode_settings); - - /*! - * @brief This function returns the value of member reset_episode_settings - * @return Value of member reset_episode_settings - */ - eProsima_user_DllExport bool reset_episode_settings() const; - - /*! - * @brief This function returns a reference to member reset_episode_settings - * @return Reference to member reset_episode_settings - */ - eProsima_user_DllExport bool& reset_episode_settings(); - - /*! - * @brief This function sets a value in member map_layers - * @param _map_layers New value for member map_layers - */ - eProsima_user_DllExport void map_layers( - uint16_t _map_layers); - - /*! - * @brief This function returns the value of member map_layers - * @return Value of member map_layers - */ - eProsima_user_DllExport uint16_t map_layers() const; - - /*! - * @brief This function returns a reference to member map_layers - * @return Reference to member map_layers - */ - eProsima_user_DllExport uint16_t& map_layers(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::LoadMap_Request& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::string m_mapname; - bool m_force_reload; - bool m_reset_episode_settings; - uint16_t m_map_layers; - }; - /*! - * @brief This class represents the structure LoadMap_Response defined by the user in the IDL file. - * @ingroup LOADMAP - */ - class LoadMap_Response - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LoadMap_Response(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LoadMap_Response(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. - */ - eProsima_user_DllExport LoadMap_Response( - const LoadMap_Response& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. - */ - eProsima_user_DllExport LoadMap_Response( - LoadMap_Response&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. - */ - eProsima_user_DllExport LoadMap_Response& operator =( - const LoadMap_Response& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. - */ - eProsima_user_DllExport LoadMap_Response& operator =( - LoadMap_Response&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::LoadMap_Response object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LoadMap_Response& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::LoadMap_Response object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LoadMap_Response& x) const; - - /*! - * @brief This function sets a value in member success - * @param _success New value for member success - */ - eProsima_user_DllExport void success( - bool _success); - - /*! - * @brief This function returns the value of member success - * @return Value of member success - */ - eProsima_user_DllExport bool success() const; - - /*! - * @brief This function returns a reference to member success - * @return Reference to member success - */ - eProsima_user_DllExport bool& success(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::LoadMap_Response& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - bool m_success; - }; - } // namespace srv + +namespace srv { + +namespace LoadMap_Request_Constants { + +const uint16_t MAPLAYERFLAG_NONE = 0; +const uint16_t MAPLAYERFLAG_BUILDINGS = 1; +const uint16_t MAPLAYERFLAG_DECALS = 2; +const uint16_t MAPLAYERFLAG_FOLIAGE = 4; +const uint16_t MAPLAYERFLAG_GROUND = 8; +const uint16_t MAPLAYERFLAG_PARKEDVEHICLES = 16; +const uint16_t MAPLAYERFLAG_PARTICLES = 32; +const uint16_t MAPLAYERFLAG_PROPS = 64; +const uint16_t MAPLAYERFLAG_STREETLIGHTS = 128; +const uint16_t MAPLAYERFLAG_WALLS = 256; +const uint16_t MAPLAYERFLAG_ALL = 65535; + +} // namespace LoadMap_Request_Constants + + +/*! + * @brief This class represents the structure LoadMap_Request defined by the user in the IDL file. + * @ingroup LoadMap + */ +class LoadMap_Request +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LoadMap_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LoadMap_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. + */ + eProsima_user_DllExport LoadMap_Request( + const LoadMap_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. + */ + eProsima_user_DllExport LoadMap_Request( + LoadMap_Request&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. + */ + eProsima_user_DllExport LoadMap_Request& operator =( + const LoadMap_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::LoadMap_Request that will be copied. + */ + eProsima_user_DllExport LoadMap_Request& operator =( + LoadMap_Request&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::LoadMap_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LoadMap_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::LoadMap_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LoadMap_Request& x) const; + + /*! + * @brief This function copies the value in member mapname + * @param _mapname New value to be copied in member mapname + */ + eProsima_user_DllExport void mapname( + const std::string& _mapname); + + /*! + * @brief This function moves the value in member mapname + * @param _mapname New value to be moved in member mapname + */ + eProsima_user_DllExport void mapname( + std::string&& _mapname); + + /*! + * @brief This function returns a constant reference to member mapname + * @return Constant reference to member mapname + */ + eProsima_user_DllExport const std::string& mapname() const; + + /*! + * @brief This function returns a reference to member mapname + * @return Reference to member mapname + */ + eProsima_user_DllExport std::string& mapname(); + + + /*! + * @brief This function sets a value in member force_reload + * @param _force_reload New value for member force_reload + */ + eProsima_user_DllExport void force_reload( + bool _force_reload); + + /*! + * @brief This function returns the value of member force_reload + * @return Value of member force_reload + */ + eProsima_user_DllExport bool force_reload() const; + + /*! + * @brief This function returns a reference to member force_reload + * @return Reference to member force_reload + */ + eProsima_user_DllExport bool& force_reload(); + + + /*! + * @brief This function sets a value in member reset_episode_settings + * @param _reset_episode_settings New value for member reset_episode_settings + */ + eProsima_user_DllExport void reset_episode_settings( + bool _reset_episode_settings); + + /*! + * @brief This function returns the value of member reset_episode_settings + * @return Value of member reset_episode_settings + */ + eProsima_user_DllExport bool reset_episode_settings() const; + + /*! + * @brief This function returns a reference to member reset_episode_settings + * @return Reference to member reset_episode_settings + */ + eProsima_user_DllExport bool& reset_episode_settings(); + + + /*! + * @brief This function sets a value in member map_layers + * @param _map_layers New value for member map_layers + */ + eProsima_user_DllExport void map_layers( + uint16_t _map_layers); + + /*! + * @brief This function returns the value of member map_layers + * @return Value of member map_layers + */ + eProsima_user_DllExport uint16_t map_layers() const; + + /*! + * @brief This function returns a reference to member map_layers + * @return Reference to member map_layers + */ + eProsima_user_DllExport uint16_t& map_layers(); + +private: + + std::string m_mapname; + bool m_force_reload{false}; + bool m_reset_episode_settings{true}; + uint16_t m_map_layers{65535}; + +}; + + +/*! + * @brief This class represents the structure LoadMap_Response defined by the user in the IDL file. + * @ingroup LoadMap + */ +class LoadMap_Response +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LoadMap_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LoadMap_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. + */ + eProsima_user_DllExport LoadMap_Response( + const LoadMap_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. + */ + eProsima_user_DllExport LoadMap_Response( + LoadMap_Response&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. + */ + eProsima_user_DllExport LoadMap_Response& operator =( + const LoadMap_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::LoadMap_Response that will be copied. + */ + eProsima_user_DllExport LoadMap_Response& operator =( + LoadMap_Response&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::LoadMap_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LoadMap_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::LoadMap_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LoadMap_Response& x) const; + + /*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ + eProsima_user_DllExport void success( + bool _success); + + /*! + * @brief This function returns the value of member success + * @return Value of member success + */ + eProsima_user_DllExport bool success() const; + + /*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ + eProsima_user_DllExport bool& success(); + +private: + + bool m_success{false}; + +}; + +} // namespace srv + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapCdrAux.hpp new file mode 100644 index 00000000000..ee0f2674bef --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapCdrAux.hpp @@ -0,0 +1,82 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoadMapCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAPCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAPCDRAUX_HPP_ + +#include "LoadMap.h" + +constexpr uint32_t carla_msgs_srv_LoadMap_Response_max_cdr_typesize {5UL}; +constexpr uint32_t carla_msgs_srv_LoadMap_Response_max_key_cdr_typesize {0UL}; + +constexpr uint32_t carla_msgs_srv_LoadMap_Request_max_cdr_typesize {268UL}; +constexpr uint32_t carla_msgs_srv_LoadMap_Request_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::LoadMap_Request& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::LoadMap_Response& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAPCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapCdrAux.ipp new file mode 100644 index 00000000000..7ba17e5a32a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapCdrAux.ipp @@ -0,0 +1,263 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoadMapCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAPCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAPCDRAUX_IPP_ + +#include "LoadMapCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::LoadMap_Request& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.mapname(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.force_reload(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.reset_episode_settings(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.map_layers(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::LoadMap_Request& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.mapname() + << eprosima::fastcdr::MemberId(1) << data.force_reload() + << eprosima::fastcdr::MemberId(2) << data.reset_episode_settings() + << eprosima::fastcdr::MemberId(3) << data.map_layers() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::LoadMap_Request& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.mapname(); + break; + + case 1: + dcdr >> data.force_reload(); + break; + + case 2: + dcdr >> data.reset_episode_settings(); + break; + + case 3: + dcdr >> data.map_layers(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::LoadMap_Request& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::LoadMap_Response& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.success(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::LoadMap_Response& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.success() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::LoadMap_Response& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.success(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::LoadMap_Response& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAPCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.cxx index f1832f0b6fc..b6f7a11a2cc 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.cxx @@ -16,315 +16,365 @@ * @file LoadMapPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LoadMapPubSubTypes.h" +#include "LoadMapCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace srv { - namespace LoadMap_Request_Constants { - - - - - - - - - - - - - } //End of namespace LoadMap_Request_Constants - LoadMap_RequestPubSubType::LoadMap_RequestPubSubType() - { - setName("carla_msgs::srv::dds_::LoadMap_Request_"); - auto type_size = LoadMap_Request::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LoadMap_Request::isKeyDefined(); - size_t keyLength = LoadMap_Request::getKeyMaxCdrSerializedSize() > 16 ? - LoadMap_Request::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LoadMap_RequestPubSubType::~LoadMap_RequestPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LoadMap_RequestPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LoadMap_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LoadMap_RequestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LoadMap_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LoadMap_RequestPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LoadMap_RequestPubSubType::createData() - { - return reinterpret_cast(new LoadMap_Request()); - } - - void LoadMap_RequestPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LoadMap_RequestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LoadMap_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LoadMap_Request::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LoadMap_Request::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - LoadMap_ResponsePubSubType::LoadMap_ResponsePubSubType() - { - setName("carla_msgs::srv::dds_::LoadMap_Response_"); - auto type_size = LoadMap_Response::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LoadMap_Response::isKeyDefined(); - size_t keyLength = LoadMap_Response::getKeyMaxCdrSerializedSize() > 16 ? - LoadMap_Response::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LoadMap_ResponsePubSubType::~LoadMap_ResponsePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LoadMap_ResponsePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LoadMap_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LoadMap_ResponsePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LoadMap_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LoadMap_ResponsePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LoadMap_ResponsePubSubType::createData() - { - return reinterpret_cast(new LoadMap_Response()); - } - - void LoadMap_ResponsePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LoadMap_ResponsePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LoadMap_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LoadMap_Response::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LoadMap_Response::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace srv +namespace srv { +namespace LoadMap_Request_Constants { + + + + + + + + + + + + + + + + + + + + + + + +} //End of namespace LoadMap_Request_Constants + + + +LoadMap_RequestPubSubType::LoadMap_RequestPubSubType() +{ + setName("carla_msgs::srv::dds_::LoadMap_Request_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LoadMap_Request::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_LoadMap_Request_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LoadMap_RequestPubSubType::~LoadMap_RequestPubSubType() +{ +} + +bool LoadMap_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LoadMap_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LoadMap_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LoadMap_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LoadMap_RequestPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LoadMap_RequestPubSubType::createData() +{ + return reinterpret_cast(new LoadMap_Request()); +} + +void LoadMap_RequestPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LoadMap_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + + +LoadMap_ResponsePubSubType::LoadMap_ResponsePubSubType() +{ + setName("carla_msgs::srv::dds_::LoadMap_Response_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LoadMap_Response::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_LoadMap_Response_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LoadMap_ResponsePubSubType::~LoadMap_ResponsePubSubType() +{ +} + +bool LoadMap_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LoadMap_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LoadMap_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LoadMap_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LoadMap_ResponsePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LoadMap_ResponsePubSubType::createData() +{ + return reinterpret_cast(new LoadMap_Response()); +} + +void LoadMap_ResponsePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LoadMap_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace srv + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.h index 49c03382c12..8d6451f71f3 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/LoadMapPubSubTypes.h @@ -16,29 +16,32 @@ * @file LoadMapPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "LoadMap.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated LoadMap is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs -{ - namespace srv - { - namespace LoadMap_Request_Constants - { +namespace carla_msgs { +namespace srv { +namespace LoadMap_Request_Constants { @@ -50,136 +53,194 @@ namespace carla_msgs - } - /*! - * @brief This class represents the TopicDataType of the type LoadMap_Request defined by the user in the IDL file. - * @ingroup LOADMAP - */ - class LoadMap_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef LoadMap_Request type; - eProsima_user_DllExport LoadMap_RequestPubSubType(); - eProsima_user_DllExport virtual ~LoadMap_RequestPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +} // namespace LoadMap_Request_Constants - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +/*! + * @brief This class represents the TopicDataType of the type LoadMap_Request defined by the user in the IDL file. + * @ingroup LoadMap + */ +class LoadMap_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + typedef LoadMap_Request type; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; - /*! - * @brief This class represents the TopicDataType of the type LoadMap_Response defined by the user in the IDL file. - * @ingroup LOADMAP - */ - class LoadMap_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + eProsima_user_DllExport LoadMap_RequestPubSubType(); - typedef LoadMap_Response type; + eProsima_user_DllExport ~LoadMap_RequestPubSubType() override; - eProsima_user_DllExport LoadMap_ResponsePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual ~LoadMap_ResponsePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; + + + +/*! + * @brief This class represents the TopicDataType of the type LoadMap_Response defined by the user in the IDL file. + * @ingroup LoadMap + */ +class LoadMap_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) LoadMap_Response(); - return true; - } + typedef LoadMap_Response type; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport LoadMap_ResponsePubSubType(); - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport ~LoadMap_ResponsePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_LOADMAP_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.cxx index d799de62933..3465804bd83 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.cxx @@ -14,9 +14,9 @@ /*! * @file SetEpisodeSettings.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,111 +27,75 @@ char dummy; #endif // _WIN32 #include "SetEpisodeSettings.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::srv::SetEpisodeSettings_Request::SetEpisodeSettings_Request() -{ - // m_episode_settings com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@79ca92b9 + +namespace carla_msgs { + +namespace srv { + +SetEpisodeSettings_Request::SetEpisodeSettings_Request() +{ } -carla_msgs::srv::SetEpisodeSettings_Request::~SetEpisodeSettings_Request() +SetEpisodeSettings_Request::~SetEpisodeSettings_Request() { } -carla_msgs::srv::SetEpisodeSettings_Request::SetEpisodeSettings_Request( +SetEpisodeSettings_Request::SetEpisodeSettings_Request( const SetEpisodeSettings_Request& x) { m_episode_settings = x.m_episode_settings; } -carla_msgs::srv::SetEpisodeSettings_Request::SetEpisodeSettings_Request( - SetEpisodeSettings_Request&& x) +SetEpisodeSettings_Request::SetEpisodeSettings_Request( + SetEpisodeSettings_Request&& x) noexcept { m_episode_settings = std::move(x.m_episode_settings); } -carla_msgs::srv::SetEpisodeSettings_Request& carla_msgs::srv::SetEpisodeSettings_Request::operator =( +SetEpisodeSettings_Request& SetEpisodeSettings_Request::operator =( const SetEpisodeSettings_Request& x) { m_episode_settings = x.m_episode_settings; - return *this; } -carla_msgs::srv::SetEpisodeSettings_Request& carla_msgs::srv::SetEpisodeSettings_Request::operator =( - SetEpisodeSettings_Request&& x) +SetEpisodeSettings_Request& SetEpisodeSettings_Request::operator =( + SetEpisodeSettings_Request&& x) noexcept { m_episode_settings = std::move(x.m_episode_settings); - return *this; } -bool carla_msgs::srv::SetEpisodeSettings_Request::operator ==( +bool SetEpisodeSettings_Request::operator ==( const SetEpisodeSettings_Request& x) const { - return (m_episode_settings == x.m_episode_settings); } -bool carla_msgs::srv::SetEpisodeSettings_Request::operator !=( +bool SetEpisodeSettings_Request::operator !=( const SetEpisodeSettings_Request& x) const { return !(*this == x); } -size_t carla_msgs::srv::SetEpisodeSettings_Request::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += carla_msgs::msg::CarlaEpisodeSettings::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::SetEpisodeSettings_Request::getCdrSerializedSize( - const carla_msgs::srv::SetEpisodeSettings_Request& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += carla_msgs::msg::CarlaEpisodeSettings::getCdrSerializedSize(data.episode_settings(), current_alignment); - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::SetEpisodeSettings_Request::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_episode_settings; - -} - -void carla_msgs::srv::SetEpisodeSettings_Request::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_episode_settings; -} - /*! * @brief This function copies the value in member episode_settings * @param _episode_settings New value to be copied in member episode_settings */ -void carla_msgs::srv::SetEpisodeSettings_Request::episode_settings( +void SetEpisodeSettings_Request::episode_settings( const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings) { m_episode_settings = _episode_settings; @@ -141,7 +105,7 @@ void carla_msgs::srv::SetEpisodeSettings_Request::episode_settings( * @brief This function moves the value in member episode_settings * @param _episode_settings New value to be moved in member episode_settings */ -void carla_msgs::srv::SetEpisodeSettings_Request::episode_settings( +void SetEpisodeSettings_Request::episode_settings( carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings) { m_episode_settings = std::move(_episode_settings); @@ -151,7 +115,7 @@ void carla_msgs::srv::SetEpisodeSettings_Request::episode_settings( * @brief This function returns a constant reference to member episode_settings * @return Constant reference to member episode_settings */ -const carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::srv::SetEpisodeSettings_Request::episode_settings() const +const carla_msgs::msg::CarlaEpisodeSettings& SetEpisodeSettings_Request::episode_settings() const { return m_episode_settings; } @@ -160,133 +124,67 @@ const carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::srv::SetEpisodeSettings * @brief This function returns a reference to member episode_settings * @return Reference to member episode_settings */ -carla_msgs::msg::CarlaEpisodeSettings& carla_msgs::srv::SetEpisodeSettings_Request::episode_settings() +carla_msgs::msg::CarlaEpisodeSettings& SetEpisodeSettings_Request::episode_settings() { return m_episode_settings; } -size_t carla_msgs::srv::SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} - -bool carla_msgs::srv::SetEpisodeSettings_Request::isKeyDefined() +SetEpisodeSettings_Response::SetEpisodeSettings_Response() { - return false; } -void carla_msgs::srv::SetEpisodeSettings_Request::serializeKey( - eprosima::fastcdr::Cdr& scdr) const +SetEpisodeSettings_Response::~SetEpisodeSettings_Response() { - (void) scdr; - -} - -carla_msgs::srv::SetEpisodeSettings_Response::SetEpisodeSettings_Response() -{ - // m_success com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2aa3cd93 - m_success = false; - } -carla_msgs::srv::SetEpisodeSettings_Response::~SetEpisodeSettings_Response() -{ -} - -carla_msgs::srv::SetEpisodeSettings_Response::SetEpisodeSettings_Response( +SetEpisodeSettings_Response::SetEpisodeSettings_Response( const SetEpisodeSettings_Response& x) { m_success = x.m_success; } -carla_msgs::srv::SetEpisodeSettings_Response::SetEpisodeSettings_Response( - SetEpisodeSettings_Response&& x) +SetEpisodeSettings_Response::SetEpisodeSettings_Response( + SetEpisodeSettings_Response&& x) noexcept { m_success = x.m_success; } -carla_msgs::srv::SetEpisodeSettings_Response& carla_msgs::srv::SetEpisodeSettings_Response::operator =( +SetEpisodeSettings_Response& SetEpisodeSettings_Response::operator =( const SetEpisodeSettings_Response& x) { m_success = x.m_success; - return *this; } -carla_msgs::srv::SetEpisodeSettings_Response& carla_msgs::srv::SetEpisodeSettings_Response::operator =( - SetEpisodeSettings_Response&& x) +SetEpisodeSettings_Response& SetEpisodeSettings_Response::operator =( + SetEpisodeSettings_Response&& x) noexcept { m_success = x.m_success; - return *this; } -bool carla_msgs::srv::SetEpisodeSettings_Response::operator ==( +bool SetEpisodeSettings_Response::operator ==( const SetEpisodeSettings_Response& x) const { - return (m_success == x.m_success); } -bool carla_msgs::srv::SetEpisodeSettings_Response::operator !=( +bool SetEpisodeSettings_Response::operator !=( const SetEpisodeSettings_Response& x) const { return !(*this == x); } -size_t carla_msgs::srv::SetEpisodeSettings_Response::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::SetEpisodeSettings_Response::getCdrSerializedSize( - const carla_msgs::srv::SetEpisodeSettings_Response& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::SetEpisodeSettings_Response::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_success; - -} - -void carla_msgs::srv::SetEpisodeSettings_Response::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_success; -} - /*! * @brief This function sets a value in member success * @param _success New value for member success */ -void carla_msgs::srv::SetEpisodeSettings_Response::success( +void SetEpisodeSettings_Response::success( bool _success) { m_success = _success; @@ -296,7 +194,7 @@ void carla_msgs::srv::SetEpisodeSettings_Response::success( * @brief This function returns the value of member success * @return Value of member success */ -bool carla_msgs::srv::SetEpisodeSettings_Response::success() const +bool SetEpisodeSettings_Response::success() const { return m_success; } @@ -305,32 +203,18 @@ bool carla_msgs::srv::SetEpisodeSettings_Response::success() const * @brief This function returns a reference to member success * @return Reference to member success */ -bool& carla_msgs::srv::SetEpisodeSettings_Response::success() +bool& SetEpisodeSettings_Response::success() { return m_success; } -size_t carla_msgs::srv::SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace srv - return current_align; -} - -bool carla_msgs::srv::SetEpisodeSettings_Response::isKeyDefined() -{ - return false; -} - -void carla_msgs::srv::SetEpisodeSettings_Response::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SetEpisodeSettingsCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.h index 3663969b5ee..5e0b7902e75 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettings.h @@ -16,20 +16,25 @@ * @file SetEpisodeSettings.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_H_ -#include "carla_msgs/msg/CarlaEpisodeSettings.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "carla_msgs/msg/CarlaEpisodeSettings.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,316 +48,216 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SetEpisodeSettings_SOURCE) -#define SetEpisodeSettings_DllAPI __declspec( dllexport ) +#if defined(SETEPISODESETTINGS_SOURCE) +#define SETEPISODESETTINGS_DllAPI __declspec( dllexport ) #else -#define SetEpisodeSettings_DllAPI __declspec( dllimport ) -#endif // SetEpisodeSettings_SOURCE +#define SETEPISODESETTINGS_DllAPI __declspec( dllimport ) +#endif // SETEPISODESETTINGS_SOURCE #else -#define SetEpisodeSettings_DllAPI +#define SETEPISODESETTINGS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SetEpisodeSettings_DllAPI +#define SETEPISODESETTINGS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace srv { - /*! - * @brief This class represents the structure SetEpisodeSettings_Request defined by the user in the IDL file. - * @ingroup SETEPISODESETTINGS - */ - class SetEpisodeSettings_Request - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SetEpisodeSettings_Request(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SetEpisodeSettings_Request(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. - */ - eProsima_user_DllExport SetEpisodeSettings_Request( - const SetEpisodeSettings_Request& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. - */ - eProsima_user_DllExport SetEpisodeSettings_Request( - SetEpisodeSettings_Request&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. - */ - eProsima_user_DllExport SetEpisodeSettings_Request& operator =( - const SetEpisodeSettings_Request& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. - */ - eProsima_user_DllExport SetEpisodeSettings_Request& operator =( - SetEpisodeSettings_Request&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::SetEpisodeSettings_Request object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SetEpisodeSettings_Request& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::SetEpisodeSettings_Request object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SetEpisodeSettings_Request& x) const; - - /*! - * @brief This function copies the value in member episode_settings - * @param _episode_settings New value to be copied in member episode_settings - */ - eProsima_user_DllExport void episode_settings( - const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings); - - /*! - * @brief This function moves the value in member episode_settings - * @param _episode_settings New value to be moved in member episode_settings - */ - eProsima_user_DllExport void episode_settings( - carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings); - - /*! - * @brief This function returns a constant reference to member episode_settings - * @return Constant reference to member episode_settings - */ - eProsima_user_DllExport const carla_msgs::msg::CarlaEpisodeSettings& episode_settings() const; - - /*! - * @brief This function returns a reference to member episode_settings - * @return Reference to member episode_settings - */ - eProsima_user_DllExport carla_msgs::msg::CarlaEpisodeSettings& episode_settings(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::SetEpisodeSettings_Request& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - carla_msgs::msg::CarlaEpisodeSettings m_episode_settings; - }; - /*! - * @brief This class represents the structure SetEpisodeSettings_Response defined by the user in the IDL file. - * @ingroup SETEPISODESETTINGS - */ - class SetEpisodeSettings_Response - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SetEpisodeSettings_Response(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SetEpisodeSettings_Response(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. - */ - eProsima_user_DllExport SetEpisodeSettings_Response( - const SetEpisodeSettings_Response& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. - */ - eProsima_user_DllExport SetEpisodeSettings_Response( - SetEpisodeSettings_Response&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. - */ - eProsima_user_DllExport SetEpisodeSettings_Response& operator =( - const SetEpisodeSettings_Response& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. - */ - eProsima_user_DllExport SetEpisodeSettings_Response& operator =( - SetEpisodeSettings_Response&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::SetEpisodeSettings_Response object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SetEpisodeSettings_Response& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::SetEpisodeSettings_Response object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SetEpisodeSettings_Response& x) const; - - /*! - * @brief This function sets a value in member success - * @param _success New value for member success - */ - eProsima_user_DllExport void success( - bool _success); - - /*! - * @brief This function returns the value of member success - * @return Value of member success - */ - eProsima_user_DllExport bool success() const; - - /*! - * @brief This function returns a reference to member success - * @return Reference to member success - */ - eProsima_user_DllExport bool& success(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::SetEpisodeSettings_Response& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - bool m_success; - }; - } // namespace srv + +namespace srv { + + + +/*! + * @brief This class represents the structure SetEpisodeSettings_Request defined by the user in the IDL file. + * @ingroup SetEpisodeSettings + */ +class SetEpisodeSettings_Request +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SetEpisodeSettings_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SetEpisodeSettings_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Request( + const SetEpisodeSettings_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Request( + SetEpisodeSettings_Request&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Request& operator =( + const SetEpisodeSettings_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Request that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Request& operator =( + SetEpisodeSettings_Request&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SetEpisodeSettings_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SetEpisodeSettings_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SetEpisodeSettings_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SetEpisodeSettings_Request& x) const; + + /*! + * @brief This function copies the value in member episode_settings + * @param _episode_settings New value to be copied in member episode_settings + */ + eProsima_user_DllExport void episode_settings( + const carla_msgs::msg::CarlaEpisodeSettings& _episode_settings); + + /*! + * @brief This function moves the value in member episode_settings + * @param _episode_settings New value to be moved in member episode_settings + */ + eProsima_user_DllExport void episode_settings( + carla_msgs::msg::CarlaEpisodeSettings&& _episode_settings); + + /*! + * @brief This function returns a constant reference to member episode_settings + * @return Constant reference to member episode_settings + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaEpisodeSettings& episode_settings() const; + + /*! + * @brief This function returns a reference to member episode_settings + * @return Reference to member episode_settings + */ + eProsima_user_DllExport carla_msgs::msg::CarlaEpisodeSettings& episode_settings(); + +private: + + carla_msgs::msg::CarlaEpisodeSettings m_episode_settings; + +}; + + +/*! + * @brief This class represents the structure SetEpisodeSettings_Response defined by the user in the IDL file. + * @ingroup SetEpisodeSettings + */ +class SetEpisodeSettings_Response +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SetEpisodeSettings_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SetEpisodeSettings_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Response( + const SetEpisodeSettings_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Response( + SetEpisodeSettings_Response&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Response& operator =( + const SetEpisodeSettings_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::SetEpisodeSettings_Response that will be copied. + */ + eProsima_user_DllExport SetEpisodeSettings_Response& operator =( + SetEpisodeSettings_Response&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SetEpisodeSettings_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SetEpisodeSettings_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SetEpisodeSettings_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SetEpisodeSettings_Response& x) const; + + /*! + * @brief This function sets a value in member success + * @param _success New value for member success + */ + eProsima_user_DllExport void success( + bool _success); + + /*! + * @brief This function returns the value of member success + * @return Value of member success + */ + eProsima_user_DllExport bool success() const; + + /*! + * @brief This function returns a reference to member success + * @return Reference to member success + */ + eProsima_user_DllExport bool& success(); + +private: + + bool m_success{false}; + +}; + +} // namespace srv + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsCdrAux.hpp new file mode 100644 index 00000000000..d6c16789774 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsCdrAux.hpp @@ -0,0 +1,59 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SetEpisodeSettingsCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGSCDRAUX_HPP_ + +#include "SetEpisodeSettings.h" + +constexpr uint32_t carla_msgs_srv_SetEpisodeSettings_Request_max_cdr_typesize {61UL}; +constexpr uint32_t carla_msgs_srv_SetEpisodeSettings_Request_max_key_cdr_typesize {0UL}; + +constexpr uint32_t carla_msgs_srv_SetEpisodeSettings_Response_max_cdr_typesize {5UL}; +constexpr uint32_t carla_msgs_srv_SetEpisodeSettings_Response_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SetEpisodeSettings_Request& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SetEpisodeSettings_Response& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsCdrAux.ipp new file mode 100644 index 00000000000..f9c8d83118f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsCdrAux.ipp @@ -0,0 +1,216 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SetEpisodeSettingsCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGSCDRAUX_IPP_ + +#include "SetEpisodeSettingsCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::SetEpisodeSettings_Request& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.episode_settings(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SetEpisodeSettings_Request& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.episode_settings() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::SetEpisodeSettings_Request& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.episode_settings(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SetEpisodeSettings_Request& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::SetEpisodeSettings_Response& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.success(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SetEpisodeSettings_Response& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.success() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::SetEpisodeSettings_Response& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.success(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SetEpisodeSettings_Response& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.cxx index 7b146a803f2..76bc4d4b48e 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.cxx @@ -16,301 +16,339 @@ * @file SetEpisodeSettingsPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SetEpisodeSettingsPubSubTypes.h" +#include "SetEpisodeSettingsCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace srv { - SetEpisodeSettings_RequestPubSubType::SetEpisodeSettings_RequestPubSubType() - { - setName("carla_msgs::srv::dds_::SetEpisodeSettings_Request_"); - auto type_size = SetEpisodeSettings_Request::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SetEpisodeSettings_Request::isKeyDefined(); - size_t keyLength = SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize() > 16 ? - SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SetEpisodeSettings_RequestPubSubType::~SetEpisodeSettings_RequestPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SetEpisodeSettings_RequestPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SetEpisodeSettings_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SetEpisodeSettings_RequestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SetEpisodeSettings_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SetEpisodeSettings_RequestPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SetEpisodeSettings_RequestPubSubType::createData() - { - return reinterpret_cast(new SetEpisodeSettings_Request()); - } - - void SetEpisodeSettings_RequestPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SetEpisodeSettings_RequestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SetEpisodeSettings_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SetEpisodeSettings_Request::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - SetEpisodeSettings_ResponsePubSubType::SetEpisodeSettings_ResponsePubSubType() - { - setName("carla_msgs::srv::dds_::SetEpisodeSettings_Response_"); - auto type_size = SetEpisodeSettings_Response::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SetEpisodeSettings_Response::isKeyDefined(); - size_t keyLength = SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize() > 16 ? - SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SetEpisodeSettings_ResponsePubSubType::~SetEpisodeSettings_ResponsePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SetEpisodeSettings_ResponsePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SetEpisodeSettings_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SetEpisodeSettings_ResponsePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SetEpisodeSettings_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SetEpisodeSettings_ResponsePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SetEpisodeSettings_ResponsePubSubType::createData() - { - return reinterpret_cast(new SetEpisodeSettings_Response()); - } - - void SetEpisodeSettings_ResponsePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SetEpisodeSettings_ResponsePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SetEpisodeSettings_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SetEpisodeSettings_Response::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace srv +namespace srv { + + +SetEpisodeSettings_RequestPubSubType::SetEpisodeSettings_RequestPubSubType() +{ + setName("carla_msgs::srv::dds_::SetEpisodeSettings_Request_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SetEpisodeSettings_Request::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_SetEpisodeSettings_Request_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SetEpisodeSettings_RequestPubSubType::~SetEpisodeSettings_RequestPubSubType() +{ +} + +bool SetEpisodeSettings_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SetEpisodeSettings_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SetEpisodeSettings_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SetEpisodeSettings_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SetEpisodeSettings_RequestPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SetEpisodeSettings_RequestPubSubType::createData() +{ + return reinterpret_cast(new SetEpisodeSettings_Request()); +} + +void SetEpisodeSettings_RequestPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SetEpisodeSettings_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + + +SetEpisodeSettings_ResponsePubSubType::SetEpisodeSettings_ResponsePubSubType() +{ + setName("carla_msgs::srv::dds_::SetEpisodeSettings_Response_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SetEpisodeSettings_Response::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_SetEpisodeSettings_Response_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SetEpisodeSettings_ResponsePubSubType::~SetEpisodeSettings_ResponsePubSubType() +{ +} + +bool SetEpisodeSettings_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SetEpisodeSettings_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SetEpisodeSettings_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SetEpisodeSettings_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SetEpisodeSettings_ResponsePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SetEpisodeSettings_ResponsePubSubType::createData() +{ + return reinterpret_cast(new SetEpisodeSettings_Response()); +} + +void SetEpisodeSettings_ResponsePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SetEpisodeSettings_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace srv + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h index 0257b5be409..2d9906066c2 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SetEpisodeSettingsPubSubTypes.h @@ -16,156 +16,208 @@ * @file SetEpisodeSettingsPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SetEpisodeSettings.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "carla_msgs/msg/CarlaEpisodeSettingsPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SetEpisodeSettings is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace srv { + + + +/*! + * @brief This class represents the TopicDataType of the type SetEpisodeSettings_Request defined by the user in the IDL file. + * @ingroup SetEpisodeSettings + */ +class SetEpisodeSettings_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace srv +public: + + typedef SetEpisodeSettings_Request type; + + eProsima_user_DllExport SetEpisodeSettings_RequestPubSubType(); + + eProsima_user_DllExport ~SetEpisodeSettings_RequestPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override { - /*! - * @brief This class represents the TopicDataType of the type SetEpisodeSettings_Request defined by the user in the IDL file. - * @ingroup SETEPISODESETTINGS - */ - class SetEpisodeSettings_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - typedef SetEpisodeSettings_Request type; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport SetEpisodeSettings_RequestPubSubType(); + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual ~SetEpisodeSettings_RequestPubSubType(); + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport void deleteData( + void* data) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +}; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SetEpisodeSettings_Request(); - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +/*! + * @brief This class represents the TopicDataType of the type SetEpisodeSettings_Response defined by the user in the IDL file. + * @ingroup SetEpisodeSettings + */ +class SetEpisodeSettings_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - MD5 m_md5; - unsigned char* m_keyBuffer; - }; - /*! - * @brief This class represents the TopicDataType of the type SetEpisodeSettings_Response defined by the user in the IDL file. - * @ingroup SETEPISODESETTINGS - */ - class SetEpisodeSettings_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef SetEpisodeSettings_Response type; - typedef SetEpisodeSettings_Response type; + eProsima_user_DllExport SetEpisodeSettings_ResponsePubSubType(); - eProsima_user_DllExport SetEpisodeSettings_ResponsePubSubType(); + eProsima_user_DllExport ~SetEpisodeSettings_ResponsePubSubType() override; - eProsima_user_DllExport virtual ~SetEpisodeSettings_ResponsePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SetEpisodeSettings_Response(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SETEPISODESETTINGS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.cxx index 9edb18c717b..cadb1298aa9 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.cxx @@ -14,9 +14,9 @@ /*! * @file SpawnObject.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,34 +27,31 @@ char dummy; #endif // _WIN32 #include "SpawnObject.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -carla_msgs::srv::SpawnObject_Request::SpawnObject_Request() -{ - // m_blueprint com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1622f1b - - // m_transform com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@72a7c7e0 - // m_attach_to com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2e4b8173 - m_attach_to = 0; - // m_random_pose com.eprosima.idl.parser.typecode.PrimitiveTypeCode@70e8f8e - m_random_pose = false; +namespace carla_msgs { -} +namespace srv { -carla_msgs::srv::SpawnObject_Request::~SpawnObject_Request() -{ +SpawnObject_Request::SpawnObject_Request() +{ +} +SpawnObject_Request::~SpawnObject_Request() +{ } -carla_msgs::srv::SpawnObject_Request::SpawnObject_Request( +SpawnObject_Request::SpawnObject_Request( const SpawnObject_Request& x) { m_blueprint = x.m_blueprint; @@ -63,8 +60,8 @@ carla_msgs::srv::SpawnObject_Request::SpawnObject_Request( m_random_pose = x.m_random_pose; } -carla_msgs::srv::SpawnObject_Request::SpawnObject_Request( - SpawnObject_Request&& x) +SpawnObject_Request::SpawnObject_Request( + SpawnObject_Request&& x) noexcept { m_blueprint = std::move(x.m_blueprint); m_transform = std::move(x.m_transform); @@ -72,7 +69,7 @@ carla_msgs::srv::SpawnObject_Request::SpawnObject_Request( m_random_pose = x.m_random_pose; } -carla_msgs::srv::SpawnObject_Request& carla_msgs::srv::SpawnObject_Request::operator =( +SpawnObject_Request& SpawnObject_Request::operator =( const SpawnObject_Request& x) { @@ -80,99 +77,40 @@ carla_msgs::srv::SpawnObject_Request& carla_msgs::srv::SpawnObject_Request::oper m_transform = x.m_transform; m_attach_to = x.m_attach_to; m_random_pose = x.m_random_pose; - return *this; } -carla_msgs::srv::SpawnObject_Request& carla_msgs::srv::SpawnObject_Request::operator =( - SpawnObject_Request&& x) +SpawnObject_Request& SpawnObject_Request::operator =( + SpawnObject_Request&& x) noexcept { m_blueprint = std::move(x.m_blueprint); m_transform = std::move(x.m_transform); m_attach_to = x.m_attach_to; m_random_pose = x.m_random_pose; - return *this; } -bool carla_msgs::srv::SpawnObject_Request::operator ==( +bool SpawnObject_Request::operator ==( const SpawnObject_Request& x) const { - - return (m_blueprint == x.m_blueprint && m_transform == x.m_transform && m_attach_to == x.m_attach_to && m_random_pose == x.m_random_pose); + return (m_blueprint == x.m_blueprint && + m_transform == x.m_transform && + m_attach_to == x.m_attach_to && + m_random_pose == x.m_random_pose); } -bool carla_msgs::srv::SpawnObject_Request::operator !=( +bool SpawnObject_Request::operator !=( const SpawnObject_Request& x) const { return !(*this == x); } -size_t carla_msgs::srv::SpawnObject_Request::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += carla_msgs::msg::CarlaActorBlueprint::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Pose::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::SpawnObject_Request::getCdrSerializedSize( - const carla_msgs::srv::SpawnObject_Request& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += carla_msgs::msg::CarlaActorBlueprint::getCdrSerializedSize(data.blueprint(), current_alignment); - current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.transform(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::SpawnObject_Request::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_blueprint; - scdr << m_transform; - scdr << m_attach_to; - scdr << m_random_pose; - -} - -void carla_msgs::srv::SpawnObject_Request::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_blueprint; - dcdr >> m_transform; - dcdr >> m_attach_to; - dcdr >> m_random_pose; -} - /*! * @brief This function copies the value in member blueprint * @param _blueprint New value to be copied in member blueprint */ -void carla_msgs::srv::SpawnObject_Request::blueprint( +void SpawnObject_Request::blueprint( const carla_msgs::msg::CarlaActorBlueprint& _blueprint) { m_blueprint = _blueprint; @@ -182,7 +120,7 @@ void carla_msgs::srv::SpawnObject_Request::blueprint( * @brief This function moves the value in member blueprint * @param _blueprint New value to be moved in member blueprint */ -void carla_msgs::srv::SpawnObject_Request::blueprint( +void SpawnObject_Request::blueprint( carla_msgs::msg::CarlaActorBlueprint&& _blueprint) { m_blueprint = std::move(_blueprint); @@ -192,7 +130,7 @@ void carla_msgs::srv::SpawnObject_Request::blueprint( * @brief This function returns a constant reference to member blueprint * @return Constant reference to member blueprint */ -const carla_msgs::msg::CarlaActorBlueprint& carla_msgs::srv::SpawnObject_Request::blueprint() const +const carla_msgs::msg::CarlaActorBlueprint& SpawnObject_Request::blueprint() const { return m_blueprint; } @@ -201,15 +139,17 @@ const carla_msgs::msg::CarlaActorBlueprint& carla_msgs::srv::SpawnObject_Request * @brief This function returns a reference to member blueprint * @return Reference to member blueprint */ -carla_msgs::msg::CarlaActorBlueprint& carla_msgs::srv::SpawnObject_Request::blueprint() +carla_msgs::msg::CarlaActorBlueprint& SpawnObject_Request::blueprint() { return m_blueprint; } + + /*! * @brief This function copies the value in member transform * @param _transform New value to be copied in member transform */ -void carla_msgs::srv::SpawnObject_Request::transform( +void SpawnObject_Request::transform( const geometry_msgs::msg::Pose& _transform) { m_transform = _transform; @@ -219,7 +159,7 @@ void carla_msgs::srv::SpawnObject_Request::transform( * @brief This function moves the value in member transform * @param _transform New value to be moved in member transform */ -void carla_msgs::srv::SpawnObject_Request::transform( +void SpawnObject_Request::transform( geometry_msgs::msg::Pose&& _transform) { m_transform = std::move(_transform); @@ -229,7 +169,7 @@ void carla_msgs::srv::SpawnObject_Request::transform( * @brief This function returns a constant reference to member transform * @return Constant reference to member transform */ -const geometry_msgs::msg::Pose& carla_msgs::srv::SpawnObject_Request::transform() const +const geometry_msgs::msg::Pose& SpawnObject_Request::transform() const { return m_transform; } @@ -238,15 +178,17 @@ const geometry_msgs::msg::Pose& carla_msgs::srv::SpawnObject_Request::transform( * @brief This function returns a reference to member transform * @return Reference to member transform */ -geometry_msgs::msg::Pose& carla_msgs::srv::SpawnObject_Request::transform() +geometry_msgs::msg::Pose& SpawnObject_Request::transform() { return m_transform; } + + /*! * @brief This function sets a value in member attach_to * @param _attach_to New value for member attach_to */ -void carla_msgs::srv::SpawnObject_Request::attach_to( +void SpawnObject_Request::attach_to( uint32_t _attach_to) { m_attach_to = _attach_to; @@ -256,7 +198,7 @@ void carla_msgs::srv::SpawnObject_Request::attach_to( * @brief This function returns the value of member attach_to * @return Value of member attach_to */ -uint32_t carla_msgs::srv::SpawnObject_Request::attach_to() const +uint32_t SpawnObject_Request::attach_to() const { return m_attach_to; } @@ -265,16 +207,17 @@ uint32_t carla_msgs::srv::SpawnObject_Request::attach_to() const * @brief This function returns a reference to member attach_to * @return Reference to member attach_to */ -uint32_t& carla_msgs::srv::SpawnObject_Request::attach_to() +uint32_t& SpawnObject_Request::attach_to() { return m_attach_to; } + /*! * @brief This function sets a value in member random_pose * @param _random_pose New value for member random_pose */ -void carla_msgs::srv::SpawnObject_Request::random_pose( +void SpawnObject_Request::random_pose( bool _random_pose) { m_random_pose = _random_pose; @@ -284,7 +227,7 @@ void carla_msgs::srv::SpawnObject_Request::random_pose( * @brief This function returns the value of member random_pose * @return Value of member random_pose */ -bool carla_msgs::srv::SpawnObject_Request::random_pose() const +bool SpawnObject_Request::random_pose() const { return m_random_pose; } @@ -293,149 +236,72 @@ bool carla_msgs::srv::SpawnObject_Request::random_pose() const * @brief This function returns a reference to member random_pose * @return Reference to member random_pose */ -bool& carla_msgs::srv::SpawnObject_Request::random_pose() +bool& SpawnObject_Request::random_pose() { return m_random_pose; } -size_t carla_msgs::srv::SpawnObject_Request::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - - return current_align; -} - -bool carla_msgs::srv::SpawnObject_Request::isKeyDefined() -{ - return false; -} -void carla_msgs::srv::SpawnObject_Request::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} -carla_msgs::srv::SpawnObject_Response::SpawnObject_Response() +SpawnObject_Response::SpawnObject_Response() { - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5e82df6a - m_id = 0; - // m_error_string com.eprosima.idl.parser.typecode.StringTypeCode@3f197a46 - m_error_string =""; - } -carla_msgs::srv::SpawnObject_Response::~SpawnObject_Response() +SpawnObject_Response::~SpawnObject_Response() { - } -carla_msgs::srv::SpawnObject_Response::SpawnObject_Response( +SpawnObject_Response::SpawnObject_Response( const SpawnObject_Response& x) { m_id = x.m_id; m_error_string = x.m_error_string; } -carla_msgs::srv::SpawnObject_Response::SpawnObject_Response( - SpawnObject_Response&& x) +SpawnObject_Response::SpawnObject_Response( + SpawnObject_Response&& x) noexcept { m_id = x.m_id; m_error_string = std::move(x.m_error_string); } -carla_msgs::srv::SpawnObject_Response& carla_msgs::srv::SpawnObject_Response::operator =( +SpawnObject_Response& SpawnObject_Response::operator =( const SpawnObject_Response& x) { m_id = x.m_id; m_error_string = x.m_error_string; - return *this; } -carla_msgs::srv::SpawnObject_Response& carla_msgs::srv::SpawnObject_Response::operator =( - SpawnObject_Response&& x) +SpawnObject_Response& SpawnObject_Response::operator =( + SpawnObject_Response&& x) noexcept { m_id = x.m_id; m_error_string = std::move(x.m_error_string); - return *this; } -bool carla_msgs::srv::SpawnObject_Response::operator ==( +bool SpawnObject_Response::operator ==( const SpawnObject_Response& x) const { - - return (m_id == x.m_id && m_error_string == x.m_error_string); + return (m_id == x.m_id && + m_error_string == x.m_error_string); } -bool carla_msgs::srv::SpawnObject_Response::operator !=( +bool SpawnObject_Response::operator !=( const SpawnObject_Response& x) const { return !(*this == x); } -size_t carla_msgs::srv::SpawnObject_Response::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; -} - -size_t carla_msgs::srv::SpawnObject_Response::getCdrSerializedSize( - const carla_msgs::srv::SpawnObject_Response& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.error_string().size() + 1; - - - return current_alignment - initial_alignment; -} - -void carla_msgs::srv::SpawnObject_Response::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_id; - scdr << m_error_string; - -} - -void carla_msgs::srv::SpawnObject_Response::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_id; - dcdr >> m_error_string; -} - /*! * @brief This function sets a value in member id * @param _id New value for member id */ -void carla_msgs::srv::SpawnObject_Response::id( +void SpawnObject_Response::id( int32_t _id) { m_id = _id; @@ -445,7 +311,7 @@ void carla_msgs::srv::SpawnObject_Response::id( * @brief This function returns the value of member id * @return Value of member id */ -int32_t carla_msgs::srv::SpawnObject_Response::id() const +int32_t SpawnObject_Response::id() const { return m_id; } @@ -454,16 +320,17 @@ int32_t carla_msgs::srv::SpawnObject_Response::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -int32_t& carla_msgs::srv::SpawnObject_Response::id() +int32_t& SpawnObject_Response::id() { return m_id; } + /*! * @brief This function copies the value in member error_string * @param _error_string New value to be copied in member error_string */ -void carla_msgs::srv::SpawnObject_Response::error_string( +void SpawnObject_Response::error_string( const std::string& _error_string) { m_error_string = _error_string; @@ -473,7 +340,7 @@ void carla_msgs::srv::SpawnObject_Response::error_string( * @brief This function moves the value in member error_string * @param _error_string New value to be moved in member error_string */ -void carla_msgs::srv::SpawnObject_Response::error_string( +void SpawnObject_Response::error_string( std::string&& _error_string) { m_error_string = std::move(_error_string); @@ -483,7 +350,7 @@ void carla_msgs::srv::SpawnObject_Response::error_string( * @brief This function returns a constant reference to member error_string * @return Constant reference to member error_string */ -const std::string& carla_msgs::srv::SpawnObject_Response::error_string() const +const std::string& SpawnObject_Response::error_string() const { return m_error_string; } @@ -492,31 +359,18 @@ const std::string& carla_msgs::srv::SpawnObject_Response::error_string() const * @brief This function returns a reference to member error_string * @return Reference to member error_string */ -std::string& carla_msgs::srv::SpawnObject_Response::error_string() +std::string& SpawnObject_Response::error_string() { return m_error_string; } -size_t carla_msgs::srv::SpawnObject_Response::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool carla_msgs::srv::SpawnObject_Response::isKeyDefined() -{ - return false; -} +} // namespace srv -void carla_msgs::srv::SpawnObject_Response::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace carla_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SpawnObjectCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.h index 5d2a9d4d783..c701ca4d44c 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObject.h @@ -16,21 +16,26 @@ * @file SpawnObject.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_H_ -#include "carla_msgs/msg/CarlaActorBlueprint.h" -#include "geometry_msgs/msg/Pose.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "carla_msgs/msg/CarlaActorBlueprint.h" +#include "geometry_msgs/msg/Pose.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,408 +49,314 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SpawnObject_SOURCE) -#define SpawnObject_DllAPI __declspec( dllexport ) +#if defined(SPAWNOBJECT_SOURCE) +#define SPAWNOBJECT_DllAPI __declspec( dllexport ) #else -#define SpawnObject_DllAPI __declspec( dllimport ) -#endif // SpawnObject_SOURCE +#define SPAWNOBJECT_DllAPI __declspec( dllimport ) +#endif // SPAWNOBJECT_SOURCE #else -#define SpawnObject_DllAPI +#define SPAWNOBJECT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SpawnObject_DllAPI +#define SPAWNOBJECT_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace carla_msgs { - namespace srv { - /*! - * @brief This class represents the structure SpawnObject_Request defined by the user in the IDL file. - * @ingroup SPAWNOBJECT - */ - class SpawnObject_Request - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SpawnObject_Request(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SpawnObject_Request(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. - */ - eProsima_user_DllExport SpawnObject_Request( - const SpawnObject_Request& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. - */ - eProsima_user_DllExport SpawnObject_Request( - SpawnObject_Request&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. - */ - eProsima_user_DllExport SpawnObject_Request& operator =( - const SpawnObject_Request& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. - */ - eProsima_user_DllExport SpawnObject_Request& operator =( - SpawnObject_Request&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::SpawnObject_Request object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SpawnObject_Request& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::SpawnObject_Request object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SpawnObject_Request& x) const; - - /*! - * @brief This function copies the value in member blueprint - * @param _blueprint New value to be copied in member blueprint - */ - eProsima_user_DllExport void blueprint( - const carla_msgs::msg::CarlaActorBlueprint& _blueprint); - - /*! - * @brief This function moves the value in member blueprint - * @param _blueprint New value to be moved in member blueprint - */ - eProsima_user_DllExport void blueprint( - carla_msgs::msg::CarlaActorBlueprint&& _blueprint); - - /*! - * @brief This function returns a constant reference to member blueprint - * @return Constant reference to member blueprint - */ - eProsima_user_DllExport const carla_msgs::msg::CarlaActorBlueprint& blueprint() const; - - /*! - * @brief This function returns a reference to member blueprint - * @return Reference to member blueprint - */ - eProsima_user_DllExport carla_msgs::msg::CarlaActorBlueprint& blueprint(); - /*! - * @brief This function copies the value in member transform - * @param _transform New value to be copied in member transform - */ - eProsima_user_DllExport void transform( - const geometry_msgs::msg::Pose& _transform); - - /*! - * @brief This function moves the value in member transform - * @param _transform New value to be moved in member transform - */ - eProsima_user_DllExport void transform( - geometry_msgs::msg::Pose&& _transform); - - /*! - * @brief This function returns a constant reference to member transform - * @return Constant reference to member transform - */ - eProsima_user_DllExport const geometry_msgs::msg::Pose& transform() const; - - /*! - * @brief This function returns a reference to member transform - * @return Reference to member transform - */ - eProsima_user_DllExport geometry_msgs::msg::Pose& transform(); - /*! - * @brief This function sets a value in member attach_to - * @param _attach_to New value for member attach_to - */ - eProsima_user_DllExport void attach_to( - uint32_t _attach_to); - - /*! - * @brief This function returns the value of member attach_to - * @return Value of member attach_to - */ - eProsima_user_DllExport uint32_t attach_to() const; - - /*! - * @brief This function returns a reference to member attach_to - * @return Reference to member attach_to - */ - eProsima_user_DllExport uint32_t& attach_to(); - - /*! - * @brief This function sets a value in member random_pose - * @param _random_pose New value for member random_pose - */ - eProsima_user_DllExport void random_pose( - bool _random_pose); - - /*! - * @brief This function returns the value of member random_pose - * @return Value of member random_pose - */ - eProsima_user_DllExport bool random_pose() const; - - /*! - * @brief This function returns a reference to member random_pose - * @return Reference to member random_pose - */ - eProsima_user_DllExport bool& random_pose(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::SpawnObject_Request& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - carla_msgs::msg::CarlaActorBlueprint m_blueprint; - geometry_msgs::msg::Pose m_transform; - uint32_t m_attach_to; - bool m_random_pose; - }; - /*! - * @brief This class represents the structure SpawnObject_Response defined by the user in the IDL file. - * @ingroup SPAWNOBJECT - */ - class SpawnObject_Response - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SpawnObject_Response(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SpawnObject_Response(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. - */ - eProsima_user_DllExport SpawnObject_Response( - const SpawnObject_Response& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. - */ - eProsima_user_DllExport SpawnObject_Response( - SpawnObject_Response&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. - */ - eProsima_user_DllExport SpawnObject_Response& operator =( - const SpawnObject_Response& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. - */ - eProsima_user_DllExport SpawnObject_Response& operator =( - SpawnObject_Response&& x); - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::SpawnObject_Response object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SpawnObject_Response& x) const; - - /*! - * @brief Comparison operator. - * @param x carla_msgs::srv::SpawnObject_Response object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SpawnObject_Response& x) const; - - /*! - * @brief This function sets a value in member id - * @param _id New value for member id - */ - eProsima_user_DllExport void id( - int32_t _id); - - /*! - * @brief This function returns the value of member id - * @return Value of member id - */ - eProsima_user_DllExport int32_t id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport int32_t& id(); - - /*! - * @brief This function copies the value in member error_string - * @param _error_string New value to be copied in member error_string - */ - eProsima_user_DllExport void error_string( - const std::string& _error_string); - - /*! - * @brief This function moves the value in member error_string - * @param _error_string New value to be moved in member error_string - */ - eProsima_user_DllExport void error_string( - std::string&& _error_string); - - /*! - * @brief This function returns a constant reference to member error_string - * @return Constant reference to member error_string - */ - eProsima_user_DllExport const std::string& error_string() const; - - /*! - * @brief This function returns a reference to member error_string - * @return Reference to member error_string - */ - eProsima_user_DllExport std::string& error_string(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const carla_msgs::srv::SpawnObject_Response& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int32_t m_id; - std::string m_error_string; - }; - } // namespace srv + +namespace srv { + + + +/*! + * @brief This class represents the structure SpawnObject_Request defined by the user in the IDL file. + * @ingroup SpawnObject + */ +class SpawnObject_Request +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpawnObject_Request(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpawnObject_Request(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. + */ + eProsima_user_DllExport SpawnObject_Request( + const SpawnObject_Request& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. + */ + eProsima_user_DllExport SpawnObject_Request( + SpawnObject_Request&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. + */ + eProsima_user_DllExport SpawnObject_Request& operator =( + const SpawnObject_Request& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Request that will be copied. + */ + eProsima_user_DllExport SpawnObject_Request& operator =( + SpawnObject_Request&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SpawnObject_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpawnObject_Request& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SpawnObject_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpawnObject_Request& x) const; + + /*! + * @brief This function copies the value in member blueprint + * @param _blueprint New value to be copied in member blueprint + */ + eProsima_user_DllExport void blueprint( + const carla_msgs::msg::CarlaActorBlueprint& _blueprint); + + /*! + * @brief This function moves the value in member blueprint + * @param _blueprint New value to be moved in member blueprint + */ + eProsima_user_DllExport void blueprint( + carla_msgs::msg::CarlaActorBlueprint&& _blueprint); + + /*! + * @brief This function returns a constant reference to member blueprint + * @return Constant reference to member blueprint + */ + eProsima_user_DllExport const carla_msgs::msg::CarlaActorBlueprint& blueprint() const; + + /*! + * @brief This function returns a reference to member blueprint + * @return Reference to member blueprint + */ + eProsima_user_DllExport carla_msgs::msg::CarlaActorBlueprint& blueprint(); + + + /*! + * @brief This function copies the value in member transform + * @param _transform New value to be copied in member transform + */ + eProsima_user_DllExport void transform( + const geometry_msgs::msg::Pose& _transform); + + /*! + * @brief This function moves the value in member transform + * @param _transform New value to be moved in member transform + */ + eProsima_user_DllExport void transform( + geometry_msgs::msg::Pose&& _transform); + + /*! + * @brief This function returns a constant reference to member transform + * @return Constant reference to member transform + */ + eProsima_user_DllExport const geometry_msgs::msg::Pose& transform() const; + + /*! + * @brief This function returns a reference to member transform + * @return Reference to member transform + */ + eProsima_user_DllExport geometry_msgs::msg::Pose& transform(); + + + /*! + * @brief This function sets a value in member attach_to + * @param _attach_to New value for member attach_to + */ + eProsima_user_DllExport void attach_to( + uint32_t _attach_to); + + /*! + * @brief This function returns the value of member attach_to + * @return Value of member attach_to + */ + eProsima_user_DllExport uint32_t attach_to() const; + + /*! + * @brief This function returns a reference to member attach_to + * @return Reference to member attach_to + */ + eProsima_user_DllExport uint32_t& attach_to(); + + + /*! + * @brief This function sets a value in member random_pose + * @param _random_pose New value for member random_pose + */ + eProsima_user_DllExport void random_pose( + bool _random_pose); + + /*! + * @brief This function returns the value of member random_pose + * @return Value of member random_pose + */ + eProsima_user_DllExport bool random_pose() const; + + /*! + * @brief This function returns a reference to member random_pose + * @return Reference to member random_pose + */ + eProsima_user_DllExport bool& random_pose(); + +private: + + carla_msgs::msg::CarlaActorBlueprint m_blueprint; + geometry_msgs::msg::Pose m_transform; + uint32_t m_attach_to{0}; + bool m_random_pose{false}; + +}; + + +/*! + * @brief This class represents the structure SpawnObject_Response defined by the user in the IDL file. + * @ingroup SpawnObject + */ +class SpawnObject_Response +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpawnObject_Response(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpawnObject_Response(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. + */ + eProsima_user_DllExport SpawnObject_Response( + const SpawnObject_Response& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. + */ + eProsima_user_DllExport SpawnObject_Response( + SpawnObject_Response&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. + */ + eProsima_user_DllExport SpawnObject_Response& operator =( + const SpawnObject_Response& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object carla_msgs::srv::SpawnObject_Response that will be copied. + */ + eProsima_user_DllExport SpawnObject_Response& operator =( + SpawnObject_Response&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SpawnObject_Response object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpawnObject_Response& x) const; + + /*! + * @brief Comparison operator. + * @param x carla_msgs::srv::SpawnObject_Response object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpawnObject_Response& x) const; + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + int32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport int32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport int32_t& id(); + + + /*! + * @brief This function copies the value in member error_string + * @param _error_string New value to be copied in member error_string + */ + eProsima_user_DllExport void error_string( + const std::string& _error_string); + + /*! + * @brief This function moves the value in member error_string + * @param _error_string New value to be moved in member error_string + */ + eProsima_user_DllExport void error_string( + std::string&& _error_string); + + /*! + * @brief This function returns a constant reference to member error_string + * @return Constant reference to member error_string + */ + eProsima_user_DllExport const std::string& error_string() const; + + /*! + * @brief This function returns a reference to member error_string + * @return Reference to member error_string + */ + eProsima_user_DllExport std::string& error_string(); + +private: + + int32_t m_id{0}; + std::string m_error_string; + +}; + +} // namespace srv + } // namespace carla_msgs -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectCdrAux.hpp new file mode 100644 index 00000000000..1cb4baee142 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectCdrAux.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpawnObjectCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECTCDRAUX_HPP_ + +#include "SpawnObject.h" + +constexpr uint32_t carla_msgs_srv_SpawnObject_Request_max_cdr_typesize {78765UL}; +constexpr uint32_t carla_msgs_srv_SpawnObject_Request_max_key_cdr_typesize {0UL}; + +constexpr uint32_t carla_msgs_srv_SpawnObject_Response_max_cdr_typesize {268UL}; +constexpr uint32_t carla_msgs_srv_SpawnObject_Response_max_key_cdr_typesize {0UL}; + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SpawnObject_Request& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SpawnObject_Response& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectCdrAux.ipp new file mode 100644 index 00000000000..3a1c5446dc5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectCdrAux.ipp @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpawnObjectCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECTCDRAUX_IPP_ + +#include "SpawnObjectCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::SpawnObject_Request& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.blueprint(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.transform(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.attach_to(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.random_pose(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SpawnObject_Request& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.blueprint() + << eprosima::fastcdr::MemberId(1) << data.transform() + << eprosima::fastcdr::MemberId(2) << data.attach_to() + << eprosima::fastcdr::MemberId(3) << data.random_pose() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::SpawnObject_Request& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.blueprint(); + break; + + case 1: + dcdr >> data.transform(); + break; + + case 2: + dcdr >> data.attach_to(); + break; + + case 3: + dcdr >> data.random_pose(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SpawnObject_Request& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const carla_msgs::srv::SpawnObject_Response& data, + size_t& current_alignment) +{ + using namespace carla_msgs::srv; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.error_string(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SpawnObject_Response& data) +{ + using namespace carla_msgs::srv; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.id() + << eprosima::fastcdr::MemberId(1) << data.error_string() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + carla_msgs::srv::SpawnObject_Response& data) +{ + using namespace carla_msgs::srv; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.id(); + break; + + case 1: + dcdr >> data.error_string(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const carla_msgs::srv::SpawnObject_Response& data) +{ + using namespace carla_msgs::srv; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.cxx index 4ead5374baf..118d6c0f829 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.cxx @@ -16,301 +16,339 @@ * @file SpawnObjectPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SpawnObjectPubSubTypes.h" +#include "SpawnObjectCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace carla_msgs { - namespace srv { - SpawnObject_RequestPubSubType::SpawnObject_RequestPubSubType() - { - setName("carla_msgs::srv::dds_::SpawnObject_Request_"); - auto type_size = SpawnObject_Request::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SpawnObject_Request::isKeyDefined(); - size_t keyLength = SpawnObject_Request::getKeyMaxCdrSerializedSize() > 16 ? - SpawnObject_Request::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpawnObject_RequestPubSubType::~SpawnObject_RequestPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpawnObject_RequestPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SpawnObject_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpawnObject_RequestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SpawnObject_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpawnObject_RequestPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpawnObject_RequestPubSubType::createData() - { - return reinterpret_cast(new SpawnObject_Request()); - } - - void SpawnObject_RequestPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpawnObject_RequestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SpawnObject_Request* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SpawnObject_Request::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SpawnObject_Request::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - SpawnObject_ResponsePubSubType::SpawnObject_ResponsePubSubType() - { - setName("carla_msgs::srv::dds_::SpawnObject_Response_"); - auto type_size = SpawnObject_Response::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SpawnObject_Response::isKeyDefined(); - size_t keyLength = SpawnObject_Response::getKeyMaxCdrSerializedSize() > 16 ? - SpawnObject_Response::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpawnObject_ResponsePubSubType::~SpawnObject_ResponsePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpawnObject_ResponsePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SpawnObject_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpawnObject_ResponsePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SpawnObject_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpawnObject_ResponsePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpawnObject_ResponsePubSubType::createData() - { - return reinterpret_cast(new SpawnObject_Response()); - } - - void SpawnObject_ResponsePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpawnObject_ResponsePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SpawnObject_Response* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SpawnObject_Response::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SpawnObject_Response::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace srv +namespace srv { + + +SpawnObject_RequestPubSubType::SpawnObject_RequestPubSubType() +{ + setName("carla_msgs::srv::dds_::SpawnObject_Request_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SpawnObject_Request::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_SpawnObject_Request_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpawnObject_RequestPubSubType::~SpawnObject_RequestPubSubType() +{ +} + +bool SpawnObject_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SpawnObject_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpawnObject_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SpawnObject_Request* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpawnObject_RequestPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpawnObject_RequestPubSubType::createData() +{ + return reinterpret_cast(new SpawnObject_Request()); +} + +void SpawnObject_RequestPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpawnObject_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + + +SpawnObject_ResponsePubSubType::SpawnObject_ResponsePubSubType() +{ + setName("carla_msgs::srv::dds_::SpawnObject_Response_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SpawnObject_Response::getMaxCdrSerializedSize()); +#else + carla_msgs_srv_SpawnObject_Response_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpawnObject_ResponsePubSubType::~SpawnObject_ResponsePubSubType() +{ +} + +bool SpawnObject_ResponsePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SpawnObject_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpawnObject_ResponsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SpawnObject_Response* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpawnObject_ResponsePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpawnObject_ResponsePubSubType::createData() +{ + return reinterpret_cast(new SpawnObject_Response()); +} + +void SpawnObject_ResponsePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpawnObject_ResponsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace srv + } //End of namespace carla_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.h index a0cd80095ab..1a90f669c6d 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/carla_msgs/srv/SpawnObjectPubSubTypes.h @@ -16,156 +16,209 @@ * @file SpawnObjectPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SpawnObject.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "carla_msgs/msg/CarlaActorBlueprintPubSubTypes.h" +#include "geometry_msgs/msg/PosePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SpawnObject is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace carla_msgs +namespace carla_msgs { +namespace srv { + + + +/*! + * @brief This class represents the TopicDataType of the type SpawnObject_Request defined by the user in the IDL file. + * @ingroup SpawnObject + */ +class SpawnObject_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace srv +public: + + typedef SpawnObject_Request type; + + eProsima_user_DllExport SpawnObject_RequestPubSubType(); + + eProsima_user_DllExport ~SpawnObject_RequestPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override { - /*! - * @brief This class represents the TopicDataType of the type SpawnObject_Request defined by the user in the IDL file. - * @ingroup SPAWNOBJECT - */ - class SpawnObject_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - typedef SpawnObject_Request type; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport SpawnObject_RequestPubSubType(); + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual ~SpawnObject_RequestPubSubType(); + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport void deleteData( + void* data) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +}; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +/*! + * @brief This class represents the TopicDataType of the type SpawnObject_Response defined by the user in the IDL file. + * @ingroup SpawnObject + */ +class SpawnObject_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - MD5 m_md5; - unsigned char* m_keyBuffer; - }; - /*! - * @brief This class represents the TopicDataType of the type SpawnObject_Response defined by the user in the IDL file. - * @ingroup SPAWNOBJECT - */ - class SpawnObject_ResponsePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef SpawnObject_Response type; - typedef SpawnObject_Response type; + eProsima_user_DllExport SpawnObject_ResponsePubSubType(); - eProsima_user_DllExport SpawnObject_ResponsePubSubType(); + eProsima_user_DllExport ~SpawnObject_ResponsePubSubType() override; - eProsima_user_DllExport virtual ~SpawnObject_ResponsePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace srv +} // namespace carla_msgs + +#endif // _FAST_DDS_GENERATED_CARLA_MSGS_SRV_SPAWNOBJECT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/clean_idl_file.bash b/LibCarla/source/carla/ros2/fastdds/clean_idl_file.bash new file mode 100755 index 00000000000..04b6d060038 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/clean_idl_file.bash @@ -0,0 +1,55 @@ +#!/bin/bash + +CLEAN_FILE=$1 + +if [ -z "$CLEAN_FILE" ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ ! -f "$CLEAN_FILE" ]; then + echo "Provided file '$CLEAN_FILE' not a regular file" + echo "Usage: $0 " + exit 1 +fi + +echo "--- Processing: $CLEAN_FILE ---" + +# 1. CHECK & REPLACE: #pragma once (Smart Placement) +if ! grep -qi "#pragma once" "$CLEAN_FILE"; then + # Find the line number of the first line that does NOT start with / or * + # We use grep -n to get line numbers, then head -n1 to get the first match + FIRST_CODE_LINE=$(grep -nE -v "^([[:space:]]*[/]|([[:space:]]*[*]))" "$CLEAN_FILE" | head -n1 | cut -d: -f1) + + # If the file is all comments or empty, default to line 1 + if [ -z "$FIRST_CODE_LINE" ]; then FIRST_CODE_LINE=1; fi + + # Insert at the calculated line + sed -i "${FIRST_CODE_LINE}i #pragma once\n" "$CLEAN_FILE" + echo "[ADDED] #pragma once inserted at line $FIRST_CODE_LINE (after comments)." +else + echo "[SKIP] #pragma once already present." +fi + +# 2. CHECK & REPLACE: \" with ' +# Count matches before replacement +#COUNT=$(grep -c '\\"' "$CLEAN_FILE") + +#if [ "$COUNT" -gt 0 ]; then + # Perform replacement using the safe hex code for single quote +# sed -i "s/\\\\\"/\x27/g" "$CLEAN_FILE" + + # Verify if any are left (should be 0) +# REMAINING=$(grep -c '\\"' "$CLEAN_FILE") +# SUCCESS_COUNT=$((COUNT - REMAINING)) + +# echo "[FIXED] Replaced $SUCCESS_COUNT instance(s) of escaped quotes." + +# if [ "$REMAINING" -gt 0 ]; then +# echo "[WARN] $REMAINING instances could not be replaced (check file permissions)." +# fi +#else +# echo "[SKIP] No escaped double quotes (\\\") found." +#fi + +echo "--- Finished $CLEAN_FILE ---" \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.cxx index 3c4ed7cb410..1f216479402 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.cxx @@ -14,9 +14,9 @@ /*! * @file Object.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,73 +27,35 @@ char dummy; #endif // _WIN32 #include "Object.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace derived_object_msgs { +namespace msg { +namespace Object_Constants { +} // namespace Object_Constants - - - - - - - - -derived_object_msgs::msg::Object::Object() +Object::Object() { - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3cc1435c - - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6bf0219d - m_id = 0; - // m_detection_level com.eprosima.idl.parser.typecode.PrimitiveTypeCode@dd0c991 - m_detection_level = 0; - // m_object_classified com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5f16132a - m_object_classified = false; - // m_pose com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@69fb6037 - - // m_twist com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@36d585c - - // m_accel com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@87a85e1 - - // m_polygon com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@671a5887 - - // m_shape com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5552768b - - // m_classification com.eprosima.idl.parser.typecode.PrimitiveTypeCode@55f616cf - m_classification = 0; - // m_classification_certainty com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1356d4d4 - m_classification_certainty = 0; - // m_classification_age com.eprosima.idl.parser.typecode.PrimitiveTypeCode@c03cf28 - m_classification_age = 0; - } -derived_object_msgs::msg::Object::~Object() +Object::~Object() { - - - - - - - - - - - } -derived_object_msgs::msg::Object::Object( +Object::Object( const Object& x) { m_header = x.m_header; @@ -110,8 +72,8 @@ derived_object_msgs::msg::Object::Object( m_classification_age = x.m_classification_age; } -derived_object_msgs::msg::Object::Object( - Object&& x) +Object::Object( + Object&& x) noexcept { m_header = std::move(x.m_header); m_id = x.m_id; @@ -127,7 +89,7 @@ derived_object_msgs::msg::Object::Object( m_classification_age = x.m_classification_age; } -derived_object_msgs::msg::Object& derived_object_msgs::msg::Object::operator =( +Object& Object::operator =( const Object& x) { @@ -143,12 +105,11 @@ derived_object_msgs::msg::Object& derived_object_msgs::msg::Object::operator =( m_classification = x.m_classification; m_classification_certainty = x.m_classification_certainty; m_classification_age = x.m_classification_age; - return *this; } -derived_object_msgs::msg::Object& derived_object_msgs::msg::Object::operator =( - Object&& x) +Object& Object::operator =( + Object&& x) noexcept { m_header = std::move(x.m_header); @@ -163,135 +124,37 @@ derived_object_msgs::msg::Object& derived_object_msgs::msg::Object::operator =( m_classification = x.m_classification; m_classification_certainty = x.m_classification_certainty; m_classification_age = x.m_classification_age; - return *this; } -bool derived_object_msgs::msg::Object::operator ==( +bool Object::operator ==( const Object& x) const { - - return (m_header == x.m_header && m_id == x.m_id && m_detection_level == x.m_detection_level && m_object_classified == x.m_object_classified && m_pose == x.m_pose && m_twist == x.m_twist && m_accel == x.m_accel && m_polygon == x.m_polygon && m_shape == x.m_shape && m_classification == x.m_classification && m_classification_certainty == x.m_classification_certainty && m_classification_age == x.m_classification_age); -} - -bool derived_object_msgs::msg::Object::operator !=( + return (m_header == x.m_header && + m_id == x.m_id && + m_detection_level == x.m_detection_level && + m_object_classified == x.m_object_classified && + m_pose == x.m_pose && + m_twist == x.m_twist && + m_accel == x.m_accel && + m_polygon == x.m_polygon && + m_shape == x.m_shape && + m_classification == x.m_classification && + m_classification_certainty == x.m_classification_certainty && + m_classification_age == x.m_classification_age); +} + +bool Object::operator !=( const Object& x) const { return !(*this == x); } -size_t derived_object_msgs::msg::Object::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += geometry_msgs::msg::Pose::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Twist::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Accel::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Polygon::getMaxCdrSerializedSize(current_alignment); - current_alignment += shape_msgs::msg::SolidPrimitive::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -size_t derived_object_msgs::msg::Object::getCdrSerializedSize( - const derived_object_msgs::msg::Object& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.pose(), current_alignment); - current_alignment += geometry_msgs::msg::Twist::getCdrSerializedSize(data.twist(), current_alignment); - current_alignment += geometry_msgs::msg::Accel::getCdrSerializedSize(data.accel(), current_alignment); - current_alignment += geometry_msgs::msg::Polygon::getCdrSerializedSize(data.polygon(), current_alignment); - current_alignment += shape_msgs::msg::SolidPrimitive::getCdrSerializedSize(data.shape(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void derived_object_msgs::msg::Object::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_id; - scdr << m_detection_level; - scdr << m_object_classified; - scdr << m_pose; - scdr << m_twist; - scdr << m_accel; - scdr << m_polygon; - scdr << m_shape; - scdr << m_classification; - scdr << m_classification_certainty; - scdr << m_classification_age; - -} - -void derived_object_msgs::msg::Object::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_id; - dcdr >> m_detection_level; - dcdr >> m_object_classified; - dcdr >> m_pose; - dcdr >> m_twist; - dcdr >> m_accel; - dcdr >> m_polygon; - dcdr >> m_shape; - dcdr >> m_classification; - dcdr >> m_classification_certainty; - dcdr >> m_classification_age; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void derived_object_msgs::msg::Object::header( +void Object::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -301,7 +164,7 @@ void derived_object_msgs::msg::Object::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void derived_object_msgs::msg::Object::header( +void Object::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -311,7 +174,7 @@ void derived_object_msgs::msg::Object::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& derived_object_msgs::msg::Object::header() const +const std_msgs::msg::Header& Object::header() const { return m_header; } @@ -320,15 +183,17 @@ const std_msgs::msg::Header& derived_object_msgs::msg::Object::header() const * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& derived_object_msgs::msg::Object::header() +std_msgs::msg::Header& Object::header() { return m_header; } + + /*! * @brief This function sets a value in member id * @param _id New value for member id */ -void derived_object_msgs::msg::Object::id( +void Object::id( uint32_t _id) { m_id = _id; @@ -338,7 +203,7 @@ void derived_object_msgs::msg::Object::id( * @brief This function returns the value of member id * @return Value of member id */ -uint32_t derived_object_msgs::msg::Object::id() const +uint32_t Object::id() const { return m_id; } @@ -347,16 +212,17 @@ uint32_t derived_object_msgs::msg::Object::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -uint32_t& derived_object_msgs::msg::Object::id() +uint32_t& Object::id() { return m_id; } + /*! * @brief This function sets a value in member detection_level * @param _detection_level New value for member detection_level */ -void derived_object_msgs::msg::Object::detection_level( +void Object::detection_level( uint8_t _detection_level) { m_detection_level = _detection_level; @@ -366,7 +232,7 @@ void derived_object_msgs::msg::Object::detection_level( * @brief This function returns the value of member detection_level * @return Value of member detection_level */ -uint8_t derived_object_msgs::msg::Object::detection_level() const +uint8_t Object::detection_level() const { return m_detection_level; } @@ -375,16 +241,17 @@ uint8_t derived_object_msgs::msg::Object::detection_level() const * @brief This function returns a reference to member detection_level * @return Reference to member detection_level */ -uint8_t& derived_object_msgs::msg::Object::detection_level() +uint8_t& Object::detection_level() { return m_detection_level; } + /*! * @brief This function sets a value in member object_classified * @param _object_classified New value for member object_classified */ -void derived_object_msgs::msg::Object::object_classified( +void Object::object_classified( bool _object_classified) { m_object_classified = _object_classified; @@ -394,7 +261,7 @@ void derived_object_msgs::msg::Object::object_classified( * @brief This function returns the value of member object_classified * @return Value of member object_classified */ -bool derived_object_msgs::msg::Object::object_classified() const +bool Object::object_classified() const { return m_object_classified; } @@ -403,16 +270,17 @@ bool derived_object_msgs::msg::Object::object_classified() const * @brief This function returns a reference to member object_classified * @return Reference to member object_classified */ -bool& derived_object_msgs::msg::Object::object_classified() +bool& Object::object_classified() { return m_object_classified; } + /*! * @brief This function copies the value in member pose * @param _pose New value to be copied in member pose */ -void derived_object_msgs::msg::Object::pose( +void Object::pose( const geometry_msgs::msg::Pose& _pose) { m_pose = _pose; @@ -422,7 +290,7 @@ void derived_object_msgs::msg::Object::pose( * @brief This function moves the value in member pose * @param _pose New value to be moved in member pose */ -void derived_object_msgs::msg::Object::pose( +void Object::pose( geometry_msgs::msg::Pose&& _pose) { m_pose = std::move(_pose); @@ -432,7 +300,7 @@ void derived_object_msgs::msg::Object::pose( * @brief This function returns a constant reference to member pose * @return Constant reference to member pose */ -const geometry_msgs::msg::Pose& derived_object_msgs::msg::Object::pose() const +const geometry_msgs::msg::Pose& Object::pose() const { return m_pose; } @@ -441,15 +309,17 @@ const geometry_msgs::msg::Pose& derived_object_msgs::msg::Object::pose() const * @brief This function returns a reference to member pose * @return Reference to member pose */ -geometry_msgs::msg::Pose& derived_object_msgs::msg::Object::pose() +geometry_msgs::msg::Pose& Object::pose() { return m_pose; } + + /*! * @brief This function copies the value in member twist * @param _twist New value to be copied in member twist */ -void derived_object_msgs::msg::Object::twist( +void Object::twist( const geometry_msgs::msg::Twist& _twist) { m_twist = _twist; @@ -459,7 +329,7 @@ void derived_object_msgs::msg::Object::twist( * @brief This function moves the value in member twist * @param _twist New value to be moved in member twist */ -void derived_object_msgs::msg::Object::twist( +void Object::twist( geometry_msgs::msg::Twist&& _twist) { m_twist = std::move(_twist); @@ -469,7 +339,7 @@ void derived_object_msgs::msg::Object::twist( * @brief This function returns a constant reference to member twist * @return Constant reference to member twist */ -const geometry_msgs::msg::Twist& derived_object_msgs::msg::Object::twist() const +const geometry_msgs::msg::Twist& Object::twist() const { return m_twist; } @@ -478,15 +348,17 @@ const geometry_msgs::msg::Twist& derived_object_msgs::msg::Object::twist() const * @brief This function returns a reference to member twist * @return Reference to member twist */ -geometry_msgs::msg::Twist& derived_object_msgs::msg::Object::twist() +geometry_msgs::msg::Twist& Object::twist() { return m_twist; } + + /*! * @brief This function copies the value in member accel * @param _accel New value to be copied in member accel */ -void derived_object_msgs::msg::Object::accel( +void Object::accel( const geometry_msgs::msg::Accel& _accel) { m_accel = _accel; @@ -496,7 +368,7 @@ void derived_object_msgs::msg::Object::accel( * @brief This function moves the value in member accel * @param _accel New value to be moved in member accel */ -void derived_object_msgs::msg::Object::accel( +void Object::accel( geometry_msgs::msg::Accel&& _accel) { m_accel = std::move(_accel); @@ -506,7 +378,7 @@ void derived_object_msgs::msg::Object::accel( * @brief This function returns a constant reference to member accel * @return Constant reference to member accel */ -const geometry_msgs::msg::Accel& derived_object_msgs::msg::Object::accel() const +const geometry_msgs::msg::Accel& Object::accel() const { return m_accel; } @@ -515,15 +387,17 @@ const geometry_msgs::msg::Accel& derived_object_msgs::msg::Object::accel() const * @brief This function returns a reference to member accel * @return Reference to member accel */ -geometry_msgs::msg::Accel& derived_object_msgs::msg::Object::accel() +geometry_msgs::msg::Accel& Object::accel() { return m_accel; } + + /*! * @brief This function copies the value in member polygon * @param _polygon New value to be copied in member polygon */ -void derived_object_msgs::msg::Object::polygon( +void Object::polygon( const geometry_msgs::msg::Polygon& _polygon) { m_polygon = _polygon; @@ -533,7 +407,7 @@ void derived_object_msgs::msg::Object::polygon( * @brief This function moves the value in member polygon * @param _polygon New value to be moved in member polygon */ -void derived_object_msgs::msg::Object::polygon( +void Object::polygon( geometry_msgs::msg::Polygon&& _polygon) { m_polygon = std::move(_polygon); @@ -543,7 +417,7 @@ void derived_object_msgs::msg::Object::polygon( * @brief This function returns a constant reference to member polygon * @return Constant reference to member polygon */ -const geometry_msgs::msg::Polygon& derived_object_msgs::msg::Object::polygon() const +const geometry_msgs::msg::Polygon& Object::polygon() const { return m_polygon; } @@ -552,15 +426,17 @@ const geometry_msgs::msg::Polygon& derived_object_msgs::msg::Object::polygon() c * @brief This function returns a reference to member polygon * @return Reference to member polygon */ -geometry_msgs::msg::Polygon& derived_object_msgs::msg::Object::polygon() +geometry_msgs::msg::Polygon& Object::polygon() { return m_polygon; } + + /*! * @brief This function copies the value in member shape * @param _shape New value to be copied in member shape */ -void derived_object_msgs::msg::Object::shape( +void Object::shape( const shape_msgs::msg::SolidPrimitive& _shape) { m_shape = _shape; @@ -570,7 +446,7 @@ void derived_object_msgs::msg::Object::shape( * @brief This function moves the value in member shape * @param _shape New value to be moved in member shape */ -void derived_object_msgs::msg::Object::shape( +void Object::shape( shape_msgs::msg::SolidPrimitive&& _shape) { m_shape = std::move(_shape); @@ -580,7 +456,7 @@ void derived_object_msgs::msg::Object::shape( * @brief This function returns a constant reference to member shape * @return Constant reference to member shape */ -const shape_msgs::msg::SolidPrimitive& derived_object_msgs::msg::Object::shape() const +const shape_msgs::msg::SolidPrimitive& Object::shape() const { return m_shape; } @@ -589,15 +465,17 @@ const shape_msgs::msg::SolidPrimitive& derived_object_msgs::msg::Object::shape() * @brief This function returns a reference to member shape * @return Reference to member shape */ -shape_msgs::msg::SolidPrimitive& derived_object_msgs::msg::Object::shape() +shape_msgs::msg::SolidPrimitive& Object::shape() { return m_shape; } + + /*! * @brief This function sets a value in member classification * @param _classification New value for member classification */ -void derived_object_msgs::msg::Object::classification( +void Object::classification( uint8_t _classification) { m_classification = _classification; @@ -607,7 +485,7 @@ void derived_object_msgs::msg::Object::classification( * @brief This function returns the value of member classification * @return Value of member classification */ -uint8_t derived_object_msgs::msg::Object::classification() const +uint8_t Object::classification() const { return m_classification; } @@ -616,16 +494,17 @@ uint8_t derived_object_msgs::msg::Object::classification() const * @brief This function returns a reference to member classification * @return Reference to member classification */ -uint8_t& derived_object_msgs::msg::Object::classification() +uint8_t& Object::classification() { return m_classification; } + /*! * @brief This function sets a value in member classification_certainty * @param _classification_certainty New value for member classification_certainty */ -void derived_object_msgs::msg::Object::classification_certainty( +void Object::classification_certainty( uint8_t _classification_certainty) { m_classification_certainty = _classification_certainty; @@ -635,7 +514,7 @@ void derived_object_msgs::msg::Object::classification_certainty( * @brief This function returns the value of member classification_certainty * @return Value of member classification_certainty */ -uint8_t derived_object_msgs::msg::Object::classification_certainty() const +uint8_t Object::classification_certainty() const { return m_classification_certainty; } @@ -644,16 +523,17 @@ uint8_t derived_object_msgs::msg::Object::classification_certainty() const * @brief This function returns a reference to member classification_certainty * @return Reference to member classification_certainty */ -uint8_t& derived_object_msgs::msg::Object::classification_certainty() +uint8_t& Object::classification_certainty() { return m_classification_certainty; } + /*! * @brief This function sets a value in member classification_age * @param _classification_age New value for member classification_age */ -void derived_object_msgs::msg::Object::classification_age( +void Object::classification_age( uint32_t _classification_age) { m_classification_age = _classification_age; @@ -663,7 +543,7 @@ void derived_object_msgs::msg::Object::classification_age( * @brief This function returns the value of member classification_age * @return Value of member classification_age */ -uint32_t derived_object_msgs::msg::Object::classification_age() const +uint32_t Object::classification_age() const { return m_classification_age; } @@ -672,32 +552,18 @@ uint32_t derived_object_msgs::msg::Object::classification_age() const * @brief This function returns a reference to member classification_age * @return Reference to member classification_age */ -uint32_t& derived_object_msgs::msg::Object::classification_age() +uint32_t& Object::classification_age() { return m_classification_age; } -size_t derived_object_msgs::msg::Object::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool derived_object_msgs::msg::Object::isKeyDefined() -{ - return false; -} +} // namespace msg -void derived_object_msgs::msg::Object::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace derived_object_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ObjectCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.h index 5b24ea2ba73..7a66693ea75 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/Object.h @@ -16,29 +16,34 @@ * @file Object.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_H_ -#include "geometry_msgs/msg/Accel.h" -#include "geometry_msgs/msg/Polygon.h" -#include "geometry_msgs/msg/Pose.h" -#include "geometry_msgs/msg/Twist.h" -#include "shape_msgs/msg/SolidPrimitive.h" -#include "std_msgs/msg/Header.h" - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "geometry_msgs/msg/Polygon.h" +#include "geometry_msgs/msg/Twist.h" +#include "std_msgs/msg/Header.h" +#include "shape_msgs/msg/SolidPrimitive.h" +#include "geometry_msgs/msg/Accel.h" +#include "geometry_msgs/msg/Pose.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -48,27 +53,33 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Object_SOURCE) -#define Object_DllAPI __declspec(dllexport) +#if defined(OBJECT_SOURCE) +#define OBJECT_DllAPI __declspec( dllexport ) #else -#define Object_DllAPI __declspec(dllimport) -#endif // Object_SOURCE +#define OBJECT_DllAPI __declspec( dllimport ) +#endif // OBJECT_SOURCE #else -#define Object_DllAPI +#define OBJECT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Object_DllAPI -#endif // _WIN32 +#define OBJECT_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace derived_object_msgs { + namespace msg { + namespace Object_Constants { + const uint8_t OBJECT_DETECTED = 0; const uint8_t OBJECT_TRACKED = 1; const uint8_t CLASSIFICATION_UNKNOWN = 0; @@ -83,368 +94,373 @@ const uint8_t CLASSIFICATION_MOTORCYCLE = 8; const uint8_t CLASSIFICATION_OTHER_VEHICLE = 9; const uint8_t CLASSIFICATION_BARRIER = 10; const uint8_t CLASSIFICATION_SIGN = 11; -} // namespace Object_Constants + +} // namespace Object_Constants + + /*! * @brief This class represents the structure Object defined by the user in the IDL file. - * @ingroup OBJECT + * @ingroup Object */ -class Object { +class Object +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Object(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Object(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. - */ - eProsima_user_DllExport Object(const Object& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. - */ - eProsima_user_DllExport Object(Object&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. - */ - eProsima_user_DllExport Object& operator=(const Object& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. - */ - eProsima_user_DllExport Object& operator=(Object&& x); - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::Object object to compare. - */ - eProsima_user_DllExport bool operator==(const Object& x) const; - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::Object object to compare. - */ - eProsima_user_DllExport bool operator!=(const Object& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member id - * @param _id New value for member id - */ - eProsima_user_DllExport void id(uint32_t _id); - - /*! - * @brief This function returns the value of member id - * @return Value of member id - */ - eProsima_user_DllExport uint32_t id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport uint32_t& id(); - - /*! - * @brief This function sets a value in member detection_level - * @param _detection_level New value for member detection_level - */ - eProsima_user_DllExport void detection_level(uint8_t _detection_level); - - /*! - * @brief This function returns the value of member detection_level - * @return Value of member detection_level - */ - eProsima_user_DllExport uint8_t detection_level() const; - - /*! - * @brief This function returns a reference to member detection_level - * @return Reference to member detection_level - */ - eProsima_user_DllExport uint8_t& detection_level(); - - /*! - * @brief This function sets a value in member object_classified - * @param _object_classified New value for member object_classified - */ - eProsima_user_DllExport void object_classified(bool _object_classified); - - /*! - * @brief This function returns the value of member object_classified - * @return Value of member object_classified - */ - eProsima_user_DllExport bool object_classified() const; - - /*! - * @brief This function returns a reference to member object_classified - * @return Reference to member object_classified - */ - eProsima_user_DllExport bool& object_classified(); - - /*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ - eProsima_user_DllExport void pose(const geometry_msgs::msg::Pose& _pose); - - /*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ - eProsima_user_DllExport void pose(geometry_msgs::msg::Pose&& _pose); - - /*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ - eProsima_user_DllExport const geometry_msgs::msg::Pose& pose() const; - - /*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ - eProsima_user_DllExport geometry_msgs::msg::Pose& pose(); - /*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ - eProsima_user_DllExport void twist(const geometry_msgs::msg::Twist& _twist); - - /*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ - eProsima_user_DllExport void twist(geometry_msgs::msg::Twist&& _twist); - - /*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ - eProsima_user_DllExport const geometry_msgs::msg::Twist& twist() const; - - /*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ - eProsima_user_DllExport geometry_msgs::msg::Twist& twist(); - /*! - * @brief This function copies the value in member accel - * @param _accel New value to be copied in member accel - */ - eProsima_user_DllExport void accel(const geometry_msgs::msg::Accel& _accel); - - /*! - * @brief This function moves the value in member accel - * @param _accel New value to be moved in member accel - */ - eProsima_user_DllExport void accel(geometry_msgs::msg::Accel&& _accel); - - /*! - * @brief This function returns a constant reference to member accel - * @return Constant reference to member accel - */ - eProsima_user_DllExport const geometry_msgs::msg::Accel& accel() const; - - /*! - * @brief This function returns a reference to member accel - * @return Reference to member accel - */ - eProsima_user_DllExport geometry_msgs::msg::Accel& accel(); - /*! - * @brief This function copies the value in member polygon - * @param _polygon New value to be copied in member polygon - */ - eProsima_user_DllExport void polygon(const geometry_msgs::msg::Polygon& _polygon); - - /*! - * @brief This function moves the value in member polygon - * @param _polygon New value to be moved in member polygon - */ - eProsima_user_DllExport void polygon(geometry_msgs::msg::Polygon&& _polygon); - - /*! - * @brief This function returns a constant reference to member polygon - * @return Constant reference to member polygon - */ - eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; - - /*! - * @brief This function returns a reference to member polygon - * @return Reference to member polygon - */ - eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); - /*! - * @brief This function copies the value in member shape - * @param _shape New value to be copied in member shape - */ - eProsima_user_DllExport void shape(const shape_msgs::msg::SolidPrimitive& _shape); - - /*! - * @brief This function moves the value in member shape - * @param _shape New value to be moved in member shape - */ - eProsima_user_DllExport void shape(shape_msgs::msg::SolidPrimitive&& _shape); - - /*! - * @brief This function returns a constant reference to member shape - * @return Constant reference to member shape - */ - eProsima_user_DllExport const shape_msgs::msg::SolidPrimitive& shape() const; - - /*! - * @brief This function returns a reference to member shape - * @return Reference to member shape - */ - eProsima_user_DllExport shape_msgs::msg::SolidPrimitive& shape(); - /*! - * @brief This function sets a value in member classification - * @param _classification New value for member classification - */ - eProsima_user_DllExport void classification(uint8_t _classification); - - /*! - * @brief This function returns the value of member classification - * @return Value of member classification - */ - eProsima_user_DllExport uint8_t classification() const; - - /*! - * @brief This function returns a reference to member classification - * @return Reference to member classification - */ - eProsima_user_DllExport uint8_t& classification(); - - /*! - * @brief This function sets a value in member classification_certainty - * @param _classification_certainty New value for member classification_certainty - */ - eProsima_user_DllExport void classification_certainty(uint8_t _classification_certainty); - - /*! - * @brief This function returns the value of member classification_certainty - * @return Value of member classification_certainty - */ - eProsima_user_DllExport uint8_t classification_certainty() const; - - /*! - * @brief This function returns a reference to member classification_certainty - * @return Reference to member classification_certainty - */ - eProsima_user_DllExport uint8_t& classification_certainty(); - - /*! - * @brief This function sets a value in member classification_age - * @param _classification_age New value for member classification_age - */ - eProsima_user_DllExport void classification_age(uint32_t _classification_age); - - /*! - * @brief This function returns the value of member classification_age - * @return Value of member classification_age - */ - eProsima_user_DllExport uint32_t classification_age() const; - - /*! - * @brief This function returns a reference to member classification_age - * @return Reference to member classification_age - */ - eProsima_user_DllExport uint32_t& classification_age(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const derived_object_msgs::msg::Object& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Object(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Object(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. + */ + eProsima_user_DllExport Object( + const Object& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. + */ + eProsima_user_DllExport Object( + Object&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. + */ + eProsima_user_DllExport Object& operator =( + const Object& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::Object that will be copied. + */ + eProsima_user_DllExport Object& operator =( + Object&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::Object object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Object& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::Object object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Object& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + + /*! + * @brief This function sets a value in member detection_level + * @param _detection_level New value for member detection_level + */ + eProsima_user_DllExport void detection_level( + uint8_t _detection_level); + + /*! + * @brief This function returns the value of member detection_level + * @return Value of member detection_level + */ + eProsima_user_DllExport uint8_t detection_level() const; + + /*! + * @brief This function returns a reference to member detection_level + * @return Reference to member detection_level + */ + eProsima_user_DllExport uint8_t& detection_level(); + + + /*! + * @brief This function sets a value in member object_classified + * @param _object_classified New value for member object_classified + */ + eProsima_user_DllExport void object_classified( + bool _object_classified); + + /*! + * @brief This function returns the value of member object_classified + * @return Value of member object_classified + */ + eProsima_user_DllExport bool object_classified() const; + + /*! + * @brief This function returns a reference to member object_classified + * @return Reference to member object_classified + */ + eProsima_user_DllExport bool& object_classified(); + + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose( + const geometry_msgs::msg::Pose& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose( + geometry_msgs::msg::Pose&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::Pose& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::Pose& pose(); + + + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist( + const geometry_msgs::msg::Twist& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist( + geometry_msgs::msg::Twist&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::Twist& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::Twist& twist(); + + + /*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ + eProsima_user_DllExport void accel( + const geometry_msgs::msg::Accel& _accel); + + /*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ + eProsima_user_DllExport void accel( + geometry_msgs::msg::Accel&& _accel); + + /*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ + eProsima_user_DllExport const geometry_msgs::msg::Accel& accel() const; + + /*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ + eProsima_user_DllExport geometry_msgs::msg::Accel& accel(); + + + /*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ + eProsima_user_DllExport void polygon( + const geometry_msgs::msg::Polygon& _polygon); + + /*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ + eProsima_user_DllExport void polygon( + geometry_msgs::msg::Polygon&& _polygon); + + /*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ + eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; + + /*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ + eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); + + + /*! + * @brief This function copies the value in member shape + * @param _shape New value to be copied in member shape + */ + eProsima_user_DllExport void shape( + const shape_msgs::msg::SolidPrimitive& _shape); + + /*! + * @brief This function moves the value in member shape + * @param _shape New value to be moved in member shape + */ + eProsima_user_DllExport void shape( + shape_msgs::msg::SolidPrimitive&& _shape); + + /*! + * @brief This function returns a constant reference to member shape + * @return Constant reference to member shape + */ + eProsima_user_DllExport const shape_msgs::msg::SolidPrimitive& shape() const; + + /*! + * @brief This function returns a reference to member shape + * @return Reference to member shape + */ + eProsima_user_DllExport shape_msgs::msg::SolidPrimitive& shape(); + + + /*! + * @brief This function sets a value in member classification + * @param _classification New value for member classification + */ + eProsima_user_DllExport void classification( + uint8_t _classification); + + /*! + * @brief This function returns the value of member classification + * @return Value of member classification + */ + eProsima_user_DllExport uint8_t classification() const; + + /*! + * @brief This function returns a reference to member classification + * @return Reference to member classification + */ + eProsima_user_DllExport uint8_t& classification(); + + + /*! + * @brief This function sets a value in member classification_certainty + * @param _classification_certainty New value for member classification_certainty + */ + eProsima_user_DllExport void classification_certainty( + uint8_t _classification_certainty); + + /*! + * @brief This function returns the value of member classification_certainty + * @return Value of member classification_certainty + */ + eProsima_user_DllExport uint8_t classification_certainty() const; + + /*! + * @brief This function returns a reference to member classification_certainty + * @return Reference to member classification_certainty + */ + eProsima_user_DllExport uint8_t& classification_certainty(); + + + /*! + * @brief This function sets a value in member classification_age + * @param _classification_age New value for member classification_age + */ + eProsima_user_DllExport void classification_age( + uint32_t _classification_age); + + /*! + * @brief This function returns the value of member classification_age + * @return Value of member classification_age + */ + eProsima_user_DllExport uint32_t classification_age() const; + + /*! + * @brief This function returns a reference to member classification_age + * @return Reference to member classification_age + */ + eProsima_user_DllExport uint32_t& classification_age(); private: - std_msgs::msg::Header m_header; - uint32_t m_id; - uint8_t m_detection_level; - bool m_object_classified; - geometry_msgs::msg::Pose m_pose; - geometry_msgs::msg::Twist m_twist; - geometry_msgs::msg::Accel m_accel; - geometry_msgs::msg::Polygon m_polygon; - shape_msgs::msg::SolidPrimitive m_shape; - uint8_t m_classification; - uint8_t m_classification_certainty; - uint32_t m_classification_age; + + std_msgs::msg::Header m_header; + uint32_t m_id{0}; + uint8_t m_detection_level{0}; + bool m_object_classified{false}; + geometry_msgs::msg::Pose m_pose; + geometry_msgs::msg::Twist m_twist; + geometry_msgs::msg::Accel m_accel; + geometry_msgs::msg::Polygon m_polygon; + shape_msgs::msg::SolidPrimitive m_shape; + uint8_t m_classification{0}; + uint8_t m_classification_certainty{0}; + uint32_t m_classification_age{0}; + }; -} // namespace msg -} // namespace derived_object_msgs -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_H_ \ No newline at end of file +} // namespace msg + +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.cxx index 18c2b27b437..75ea503e72a 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.cxx @@ -14,9 +14,9 @@ /*! * @file ObjectArray.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,134 +27,82 @@ char dummy; #endif // _WIN32 #include "ObjectArray.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -derived_object_msgs::msg::ObjectArray::ObjectArray() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6db9f5a4 - // m_objects com.eprosima.idl.parser.typecode.SequenceTypeCode@1ebd319f +namespace derived_object_msgs { + +namespace msg { + -} -derived_object_msgs::msg::ObjectArray::~ObjectArray() + +ObjectArray::ObjectArray() { +} +ObjectArray::~ObjectArray() +{ } -derived_object_msgs::msg::ObjectArray::ObjectArray( +ObjectArray::ObjectArray( const ObjectArray& x) { m_header = x.m_header; m_objects = x.m_objects; } -derived_object_msgs::msg::ObjectArray::ObjectArray( - ObjectArray&& x) +ObjectArray::ObjectArray( + ObjectArray&& x) noexcept { m_header = std::move(x.m_header); m_objects = std::move(x.m_objects); } -derived_object_msgs::msg::ObjectArray& derived_object_msgs::msg::ObjectArray::operator =( +ObjectArray& ObjectArray::operator =( const ObjectArray& x) { m_header = x.m_header; m_objects = x.m_objects; - return *this; } -derived_object_msgs::msg::ObjectArray& derived_object_msgs::msg::ObjectArray::operator =( - ObjectArray&& x) +ObjectArray& ObjectArray::operator =( + ObjectArray&& x) noexcept { m_header = std::move(x.m_header); m_objects = std::move(x.m_objects); - return *this; } -bool derived_object_msgs::msg::ObjectArray::operator ==( +bool ObjectArray::operator ==( const ObjectArray& x) const { - - return (m_header == x.m_header && m_objects == x.m_objects); + return (m_header == x.m_header && + m_objects == x.m_objects); } -bool derived_object_msgs::msg::ObjectArray::operator !=( +bool ObjectArray::operator !=( const ObjectArray& x) const { return !(*this == x); } -size_t derived_object_msgs::msg::ObjectArray::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += derived_object_msgs::msg::Object::getMaxCdrSerializedSize(current_alignment);} - - - return current_alignment - initial_alignment; -} - -size_t derived_object_msgs::msg::ObjectArray::getCdrSerializedSize( - const derived_object_msgs::msg::ObjectArray& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.objects().size(); ++a) - { - current_alignment += derived_object_msgs::msg::Object::getCdrSerializedSize(data.objects().at(a), current_alignment);} - - - return current_alignment - initial_alignment; -} - -void derived_object_msgs::msg::ObjectArray::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_objects; - -} - -void derived_object_msgs::msg::ObjectArray::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_objects; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void derived_object_msgs::msg::ObjectArray::header( +void ObjectArray::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -164,7 +112,7 @@ void derived_object_msgs::msg::ObjectArray::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void derived_object_msgs::msg::ObjectArray::header( +void ObjectArray::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -174,7 +122,7 @@ void derived_object_msgs::msg::ObjectArray::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& derived_object_msgs::msg::ObjectArray::header() const +const std_msgs::msg::Header& ObjectArray::header() const { return m_header; } @@ -183,15 +131,17 @@ const std_msgs::msg::Header& derived_object_msgs::msg::ObjectArray::header() con * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& derived_object_msgs::msg::ObjectArray::header() +std_msgs::msg::Header& ObjectArray::header() { return m_header; } + + /*! * @brief This function copies the value in member objects * @param _objects New value to be copied in member objects */ -void derived_object_msgs::msg::ObjectArray::objects( +void ObjectArray::objects( const std::vector& _objects) { m_objects = _objects; @@ -201,7 +151,7 @@ void derived_object_msgs::msg::ObjectArray::objects( * @brief This function moves the value in member objects * @param _objects New value to be moved in member objects */ -void derived_object_msgs::msg::ObjectArray::objects( +void ObjectArray::objects( std::vector&& _objects) { m_objects = std::move(_objects); @@ -211,7 +161,7 @@ void derived_object_msgs::msg::ObjectArray::objects( * @brief This function returns a constant reference to member objects * @return Constant reference to member objects */ -const std::vector& derived_object_msgs::msg::ObjectArray::objects() const +const std::vector& ObjectArray::objects() const { return m_objects; } @@ -220,31 +170,18 @@ const std::vector& derived_object_msgs::msg::O * @brief This function returns a reference to member objects * @return Reference to member objects */ -std::vector& derived_object_msgs::msg::ObjectArray::objects() +std::vector& ObjectArray::objects() { return m_objects; } -size_t derived_object_msgs::msg::ObjectArray::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool derived_object_msgs::msg::ObjectArray::isKeyDefined() -{ - return false; -} +} // namespace msg -void derived_object_msgs::msg::ObjectArray::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace derived_object_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ObjectArrayCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.h index d4f8f2f0540..791c0bd2c0f 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArray.h @@ -16,24 +16,29 @@ * @file ObjectArray.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_H_ -#include "Object.h" - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "Object.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -43,178 +48,160 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ObjectArray_SOURCE) -#define ObjectArray_DllAPI __declspec(dllexport) +#if defined(OBJECTARRAY_SOURCE) +#define OBJECTARRAY_DllAPI __declspec( dllexport ) #else -#define ObjectArray_DllAPI __declspec(dllimport) -#endif // ObjectArray_SOURCE +#define OBJECTARRAY_DllAPI __declspec( dllimport ) +#endif // OBJECTARRAY_SOURCE #else -#define ObjectArray_DllAPI +#define OBJECTARRAY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ObjectArray_DllAPI -#endif // _WIN32 +#define OBJECTARRAY_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace derived_object_msgs { + namespace msg { + + + + + /*! * @brief This class represents the structure ObjectArray defined by the user in the IDL file. - * @ingroup OBJECTARRAY + * @ingroup ObjectArray */ -class ObjectArray { +class ObjectArray +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ObjectArray(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ObjectArray(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. - */ - eProsima_user_DllExport ObjectArray(const ObjectArray& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. - */ - eProsima_user_DllExport ObjectArray(ObjectArray&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. - */ - eProsima_user_DllExport ObjectArray& operator=(const ObjectArray& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. - */ - eProsima_user_DllExport ObjectArray& operator=(ObjectArray&& x); - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::ObjectArray object to compare. - */ - eProsima_user_DllExport bool operator==(const ObjectArray& x) const; - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::ObjectArray object to compare. - */ - eProsima_user_DllExport bool operator!=(const ObjectArray& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member objects - * @param _objects New value to be copied in member objects - */ - eProsima_user_DllExport void objects(const std::vector& _objects); - - /*! - * @brief This function moves the value in member objects - * @param _objects New value to be moved in member objects - */ - eProsima_user_DllExport void objects(std::vector&& _objects); - - /*! - * @brief This function returns a constant reference to member objects - * @return Constant reference to member objects - */ - eProsima_user_DllExport const std::vector& objects() const; - - /*! - * @brief This function returns a reference to member objects - * @return Reference to member objects - */ - eProsima_user_DllExport std::vector& objects(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const derived_object_msgs::msg::ObjectArray& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ObjectArray(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ObjectArray(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. + */ + eProsima_user_DllExport ObjectArray( + const ObjectArray& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. + */ + eProsima_user_DllExport ObjectArray( + ObjectArray&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. + */ + eProsima_user_DllExport ObjectArray& operator =( + const ObjectArray& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectArray that will be copied. + */ + eProsima_user_DllExport ObjectArray& operator =( + ObjectArray&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectArray object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ObjectArray& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectArray object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ObjectArray& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member objects + * @param _objects New value to be copied in member objects + */ + eProsima_user_DllExport void objects( + const std::vector& _objects); + + /*! + * @brief This function moves the value in member objects + * @param _objects New value to be moved in member objects + */ + eProsima_user_DllExport void objects( + std::vector&& _objects); + + /*! + * @brief This function returns a constant reference to member objects + * @return Constant reference to member objects + */ + eProsima_user_DllExport const std::vector& objects() const; + + /*! + * @brief This function returns a reference to member objects + * @return Reference to member objects + */ + eProsima_user_DllExport std::vector& objects(); private: - std_msgs::msg::Header m_header; - std::vector m_objects; + + std_msgs::msg::Header m_header; + std::vector m_objects; + }; -} // namespace msg -} // namespace derived_object_msgs -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_H_ \ No newline at end of file +} // namespace msg + +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayCdrAux.hpp new file mode 100644 index 00000000000..64fb884f10d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayCdrAux.hpp @@ -0,0 +1,58 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectArrayCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAYCDRAUX_HPP_ + +#include "ObjectArray.h" + +constexpr uint32_t derived_object_msgs_msg_ObjectArray_max_cdr_typesize {376284UL}; +constexpr uint32_t derived_object_msgs_msg_ObjectArray_max_key_cdr_typesize {0UL}; + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectArray& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayCdrAux.ipp new file mode 100644 index 00000000000..cf2b2cae671 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayCdrAux.ipp @@ -0,0 +1,140 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectArrayCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAYCDRAUX_IPP_ + +#include "ObjectArrayCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const derived_object_msgs::msg::ObjectArray& data, + size_t& current_alignment) +{ + using namespace derived_object_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.objects(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectArray& data) +{ + using namespace derived_object_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.objects() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + derived_object_msgs::msg::ObjectArray& data) +{ + using namespace derived_object_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.objects(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectArray& data) +{ + using namespace derived_object_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.cxx index 4d78bea9736..1582126cc95 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file ObjectArrayPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ObjectArrayPubSubTypes.h" +#include "ObjectArrayCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace derived_object_msgs { - namespace msg { - ObjectArrayPubSubType::ObjectArrayPubSubType() - { - setName("derived_object_msgs::msg::dds_::ObjectArray_"); - auto type_size = ObjectArray::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ObjectArray::isKeyDefined(); - size_t keyLength = ObjectArray::getKeyMaxCdrSerializedSize() > 16 ? - ObjectArray::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ObjectArrayPubSubType::~ObjectArrayPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ObjectArrayPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ObjectArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ObjectArrayPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ObjectArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ObjectArrayPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ObjectArrayPubSubType::createData() - { - return reinterpret_cast(new ObjectArray()); - } - - void ObjectArrayPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ObjectArrayPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ObjectArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ObjectArray::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ObjectArray::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +ObjectArrayPubSubType::ObjectArrayPubSubType() +{ + setName("derived_object_msgs::msg::dds_::ObjectArray_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ObjectArray::getMaxCdrSerializedSize()); +#else + derived_object_msgs_msg_ObjectArray_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ObjectArrayPubSubType::~ObjectArrayPubSubType() +{ +} + +bool ObjectArrayPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ObjectArray* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ObjectArrayPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ObjectArray* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ObjectArrayPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ObjectArrayPubSubType::createData() +{ + return reinterpret_cast(new ObjectArray()); +} + +void ObjectArrayPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ObjectArrayPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace derived_object_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.h index 1818dee0a77..8e070d02d21 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectArrayPubSubTypes.h @@ -16,76 +16,123 @@ * @file ObjectArrayPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "ObjectArray.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated ObjectArray is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#include "ObjectPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated ObjectArray is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace derived_object_msgs { namespace msg { + + + + + /*! * @brief This class represents the TopicDataType of the type ObjectArray defined by the user in the IDL file. - * @ingroup OBJECTARRAY + * @ingroup ObjectArray */ -class ObjectArrayPubSubType : public eprosima::fastdds::dds::TopicDataType { +class ObjectArrayPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef ObjectArray type; - eProsima_user_DllExport ObjectArrayPubSubType(); + typedef ObjectArray type; + + eProsima_user_DllExport ObjectArrayPubSubType(); - eProsima_user_DllExport virtual ~ObjectArrayPubSubType(); + eProsima_user_DllExport ~ObjectArrayPubSubType() override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; }; } // namespace msg } // namespace derived_object_msgs -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTARRAY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectCdrAux.hpp new file mode 100644 index 00000000000..3b26c70c9ab --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectCdrAux.hpp @@ -0,0 +1,82 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTCDRAUX_HPP_ + +#include "Object.h" + +constexpr uint32_t derived_object_msgs_msg_Object_max_cdr_typesize {3756UL}; +constexpr uint32_t derived_object_msgs_msg_Object_max_key_cdr_typesize {0UL}; + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::Object& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectCdrAux.ipp new file mode 100644 index 00000000000..cd3795519af --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectCdrAux.ipp @@ -0,0 +1,247 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTCDRAUX_IPP_ + +#include "ObjectCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const derived_object_msgs::msg::Object& data, + size_t& current_alignment) +{ + using namespace derived_object_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.detection_level(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.object_classified(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.pose(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.twist(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.accel(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.polygon(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.shape(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.classification(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.classification_certainty(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.classification_age(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::Object& data) +{ + using namespace derived_object_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.id() + << eprosima::fastcdr::MemberId(2) << data.detection_level() + << eprosima::fastcdr::MemberId(3) << data.object_classified() + << eprosima::fastcdr::MemberId(4) << data.pose() + << eprosima::fastcdr::MemberId(5) << data.twist() + << eprosima::fastcdr::MemberId(6) << data.accel() + << eprosima::fastcdr::MemberId(7) << data.polygon() + << eprosima::fastcdr::MemberId(8) << data.shape() + << eprosima::fastcdr::MemberId(9) << data.classification() + << eprosima::fastcdr::MemberId(10) << data.classification_certainty() + << eprosima::fastcdr::MemberId(11) << data.classification_age() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + derived_object_msgs::msg::Object& data) +{ + using namespace derived_object_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.id(); + break; + + case 2: + dcdr >> data.detection_level(); + break; + + case 3: + dcdr >> data.object_classified(); + break; + + case 4: + dcdr >> data.pose(); + break; + + case 5: + dcdr >> data.twist(); + break; + + case 6: + dcdr >> data.accel(); + break; + + case 7: + dcdr >> data.polygon(); + break; + + case 8: + dcdr >> data.shape(); + break; + + case 9: + dcdr >> data.classification(); + break; + + case 10: + dcdr >> data.classification_certainty(); + break; + + case 11: + dcdr >> data.classification_age(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::Object& data) +{ + using namespace derived_object_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.cxx index a8f3b22d08a..2df23c80e9c 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.cxx @@ -16,21 +16,37 @@ * @file ObjectPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ObjectPubSubTypes.h" +#include "ObjectCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace derived_object_msgs { - namespace msg { - namespace Object_Constants { +namespace msg { +namespace Object_Constants { + + + + + + + + + + + + @@ -46,148 +62,169 @@ namespace derived_object_msgs { - } //End of namespace Object_Constants - ObjectPubSubType::ObjectPubSubType() - { - setName("derived_object_msgs::msg::dds_::Object_"); - auto type_size = Object::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Object::isKeyDefined(); - size_t keyLength = Object::getKeyMaxCdrSerializedSize() > 16 ? - Object::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - ObjectPubSubType::~ObjectPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ObjectPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Object* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ObjectPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Object* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ObjectPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ObjectPubSubType::createData() - { - return reinterpret_cast(new Object()); - } - - void ObjectPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ObjectPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Object* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Object::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Object::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + +} //End of namespace Object_Constants + + + +ObjectPubSubType::ObjectPubSubType() +{ + setName("derived_object_msgs::msg::dds_::Object_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Object::getMaxCdrSerializedSize()); +#else + derived_object_msgs_msg_Object_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ObjectPubSubType::~ObjectPubSubType() +{ +} + +bool ObjectPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Object* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ObjectPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Object* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ObjectPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ObjectPubSubType::createData() +{ + return reinterpret_cast(new Object()); +} + +void ObjectPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ObjectPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace derived_object_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.h index 7cb94c9e9a9..78df9f8c5b4 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectPubSubTypes.h @@ -16,77 +16,156 @@ * @file ObjectPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "Object.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Object is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#include "geometry_msgs/msg/PolygonPubSubTypes.h" +#include "geometry_msgs/msg/TwistPubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" +#include "shape_msgs/msg/SolidPrimitivePubSubTypes.h" +#include "geometry_msgs/msg/AccelPubSubTypes.h" +#include "geometry_msgs/msg/PosePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Object is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace derived_object_msgs { namespace msg { -namespace Object_Constants {} +namespace Object_Constants { + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} // namespace Object_Constants + + + /*! * @brief This class represents the TopicDataType of the type Object defined by the user in the IDL file. - * @ingroup OBJECT + * @ingroup Object */ -class ObjectPubSubType : public eprosima::fastdds::dds::TopicDataType { +class ObjectPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef Object type; - eProsima_user_DllExport ObjectPubSubType(); + typedef Object type; + + eProsima_user_DllExport ObjectPubSubType(); + + eProsima_user_DllExport ~ObjectPubSubType() override; - eProsima_user_DllExport virtual ~ObjectPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; }; } // namespace msg } // namespace derived_object_msgs -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.cxx index 3bdd73f14f7..65dee47d1c4 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.cxx @@ -14,9 +14,9 @@ /*! * @file ObjectWithCovariance.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,73 +27,35 @@ char dummy; #endif // _WIN32 #include "ObjectWithCovariance.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace derived_object_msgs { +namespace msg { +namespace ObjectWithCovariance_Constants { +} // namespace ObjectWithCovariance_Constants - - - - - - - - -derived_object_msgs::msg::ObjectWithCovariance::ObjectWithCovariance() +ObjectWithCovariance::ObjectWithCovariance() { - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5552768b - - // m_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3c947bc5 - m_id = 0; - // m_detection_level com.eprosima.idl.parser.typecode.PrimitiveTypeCode@609db43b - m_detection_level = 0; - // m_object_classified com.eprosima.idl.parser.typecode.PrimitiveTypeCode@55f616cf - m_object_classified = false; - // m_pose com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1356d4d4 - - // m_twist com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@c03cf28 - - // m_accel com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1329eff - - // m_polygon com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6497b078 - - // m_shape com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@41c2284a - - // m_classification com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1fb700ee - m_classification = 0; - // m_classification_certainty com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f67eb2a - m_classification_certainty = 0; - // m_classification_age com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4a668b6e - m_classification_age = 0; - } -derived_object_msgs::msg::ObjectWithCovariance::~ObjectWithCovariance() +ObjectWithCovariance::~ObjectWithCovariance() { - - - - - - - - - - - } -derived_object_msgs::msg::ObjectWithCovariance::ObjectWithCovariance( +ObjectWithCovariance::ObjectWithCovariance( const ObjectWithCovariance& x) { m_header = x.m_header; @@ -110,8 +72,8 @@ derived_object_msgs::msg::ObjectWithCovariance::ObjectWithCovariance( m_classification_age = x.m_classification_age; } -derived_object_msgs::msg::ObjectWithCovariance::ObjectWithCovariance( - ObjectWithCovariance&& x) +ObjectWithCovariance::ObjectWithCovariance( + ObjectWithCovariance&& x) noexcept { m_header = std::move(x.m_header); m_id = x.m_id; @@ -127,7 +89,7 @@ derived_object_msgs::msg::ObjectWithCovariance::ObjectWithCovariance( m_classification_age = x.m_classification_age; } -derived_object_msgs::msg::ObjectWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::operator =( +ObjectWithCovariance& ObjectWithCovariance::operator =( const ObjectWithCovariance& x) { @@ -143,12 +105,11 @@ derived_object_msgs::msg::ObjectWithCovariance& derived_object_msgs::msg::Object m_classification = x.m_classification; m_classification_certainty = x.m_classification_certainty; m_classification_age = x.m_classification_age; - return *this; } -derived_object_msgs::msg::ObjectWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::operator =( - ObjectWithCovariance&& x) +ObjectWithCovariance& ObjectWithCovariance::operator =( + ObjectWithCovariance&& x) noexcept { m_header = std::move(x.m_header); @@ -163,135 +124,37 @@ derived_object_msgs::msg::ObjectWithCovariance& derived_object_msgs::msg::Object m_classification = x.m_classification; m_classification_certainty = x.m_classification_certainty; m_classification_age = x.m_classification_age; - return *this; } -bool derived_object_msgs::msg::ObjectWithCovariance::operator ==( +bool ObjectWithCovariance::operator ==( const ObjectWithCovariance& x) const { - - return (m_header == x.m_header && m_id == x.m_id && m_detection_level == x.m_detection_level && m_object_classified == x.m_object_classified && m_pose == x.m_pose && m_twist == x.m_twist && m_accel == x.m_accel && m_polygon == x.m_polygon && m_shape == x.m_shape && m_classification == x.m_classification && m_classification_certainty == x.m_classification_certainty && m_classification_age == x.m_classification_age); -} - -bool derived_object_msgs::msg::ObjectWithCovariance::operator !=( + return (m_header == x.m_header && + m_id == x.m_id && + m_detection_level == x.m_detection_level && + m_object_classified == x.m_object_classified && + m_pose == x.m_pose && + m_twist == x.m_twist && + m_accel == x.m_accel && + m_polygon == x.m_polygon && + m_shape == x.m_shape && + m_classification == x.m_classification && + m_classification_certainty == x.m_classification_certainty && + m_classification_age == x.m_classification_age); +} + +bool ObjectWithCovariance::operator !=( const ObjectWithCovariance& x) const { return !(*this == x); } -size_t derived_object_msgs::msg::ObjectWithCovariance::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += geometry_msgs::msg::PoseWithCovariance::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::TwistWithCovariance::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::AccelWithCovariance::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Polygon::getMaxCdrSerializedSize(current_alignment); - current_alignment += derived_object_msgs::msg::SolidPrimitiveWithCovariance::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -size_t derived_object_msgs::msg::ObjectWithCovariance::getCdrSerializedSize( - const derived_object_msgs::msg::ObjectWithCovariance& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += geometry_msgs::msg::PoseWithCovariance::getCdrSerializedSize(data.pose(), current_alignment); - current_alignment += geometry_msgs::msg::TwistWithCovariance::getCdrSerializedSize(data.twist(), current_alignment); - current_alignment += geometry_msgs::msg::AccelWithCovariance::getCdrSerializedSize(data.accel(), current_alignment); - current_alignment += geometry_msgs::msg::Polygon::getCdrSerializedSize(data.polygon(), current_alignment); - current_alignment += derived_object_msgs::msg::SolidPrimitiveWithCovariance::getCdrSerializedSize(data.shape(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void derived_object_msgs::msg::ObjectWithCovariance::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_id; - scdr << m_detection_level; - scdr << m_object_classified; - scdr << m_pose; - scdr << m_twist; - scdr << m_accel; - scdr << m_polygon; - scdr << m_shape; - scdr << m_classification; - scdr << m_classification_certainty; - scdr << m_classification_age; - -} - -void derived_object_msgs::msg::ObjectWithCovariance::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_id; - dcdr >> m_detection_level; - dcdr >> m_object_classified; - dcdr >> m_pose; - dcdr >> m_twist; - dcdr >> m_accel; - dcdr >> m_polygon; - dcdr >> m_shape; - dcdr >> m_classification; - dcdr >> m_classification_certainty; - dcdr >> m_classification_age; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void derived_object_msgs::msg::ObjectWithCovariance::header( +void ObjectWithCovariance::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -301,7 +164,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void derived_object_msgs::msg::ObjectWithCovariance::header( +void ObjectWithCovariance::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -311,7 +174,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovariance::header() const +const std_msgs::msg::Header& ObjectWithCovariance::header() const { return m_header; } @@ -320,15 +183,17 @@ const std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovariance::hea * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovariance::header() +std_msgs::msg::Header& ObjectWithCovariance::header() { return m_header; } + + /*! * @brief This function sets a value in member id * @param _id New value for member id */ -void derived_object_msgs::msg::ObjectWithCovariance::id( +void ObjectWithCovariance::id( uint32_t _id) { m_id = _id; @@ -338,7 +203,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::id( * @brief This function returns the value of member id * @return Value of member id */ -uint32_t derived_object_msgs::msg::ObjectWithCovariance::id() const +uint32_t ObjectWithCovariance::id() const { return m_id; } @@ -347,16 +212,17 @@ uint32_t derived_object_msgs::msg::ObjectWithCovariance::id() const * @brief This function returns a reference to member id * @return Reference to member id */ -uint32_t& derived_object_msgs::msg::ObjectWithCovariance::id() +uint32_t& ObjectWithCovariance::id() { return m_id; } + /*! * @brief This function sets a value in member detection_level * @param _detection_level New value for member detection_level */ -void derived_object_msgs::msg::ObjectWithCovariance::detection_level( +void ObjectWithCovariance::detection_level( uint8_t _detection_level) { m_detection_level = _detection_level; @@ -366,7 +232,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::detection_level( * @brief This function returns the value of member detection_level * @return Value of member detection_level */ -uint8_t derived_object_msgs::msg::ObjectWithCovariance::detection_level() const +uint8_t ObjectWithCovariance::detection_level() const { return m_detection_level; } @@ -375,16 +241,17 @@ uint8_t derived_object_msgs::msg::ObjectWithCovariance::detection_level() const * @brief This function returns a reference to member detection_level * @return Reference to member detection_level */ -uint8_t& derived_object_msgs::msg::ObjectWithCovariance::detection_level() +uint8_t& ObjectWithCovariance::detection_level() { return m_detection_level; } + /*! * @brief This function sets a value in member object_classified * @param _object_classified New value for member object_classified */ -void derived_object_msgs::msg::ObjectWithCovariance::object_classified( +void ObjectWithCovariance::object_classified( bool _object_classified) { m_object_classified = _object_classified; @@ -394,7 +261,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::object_classified( * @brief This function returns the value of member object_classified * @return Value of member object_classified */ -bool derived_object_msgs::msg::ObjectWithCovariance::object_classified() const +bool ObjectWithCovariance::object_classified() const { return m_object_classified; } @@ -403,16 +270,17 @@ bool derived_object_msgs::msg::ObjectWithCovariance::object_classified() const * @brief This function returns a reference to member object_classified * @return Reference to member object_classified */ -bool& derived_object_msgs::msg::ObjectWithCovariance::object_classified() +bool& ObjectWithCovariance::object_classified() { return m_object_classified; } + /*! * @brief This function copies the value in member pose * @param _pose New value to be copied in member pose */ -void derived_object_msgs::msg::ObjectWithCovariance::pose( +void ObjectWithCovariance::pose( const geometry_msgs::msg::PoseWithCovariance& _pose) { m_pose = _pose; @@ -422,7 +290,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::pose( * @brief This function moves the value in member pose * @param _pose New value to be moved in member pose */ -void derived_object_msgs::msg::ObjectWithCovariance::pose( +void ObjectWithCovariance::pose( geometry_msgs::msg::PoseWithCovariance&& _pose) { m_pose = std::move(_pose); @@ -432,7 +300,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::pose( * @brief This function returns a constant reference to member pose * @return Constant reference to member pose */ -const geometry_msgs::msg::PoseWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::pose() const +const geometry_msgs::msg::PoseWithCovariance& ObjectWithCovariance::pose() const { return m_pose; } @@ -441,15 +309,17 @@ const geometry_msgs::msg::PoseWithCovariance& derived_object_msgs::msg::ObjectWi * @brief This function returns a reference to member pose * @return Reference to member pose */ -geometry_msgs::msg::PoseWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::pose() +geometry_msgs::msg::PoseWithCovariance& ObjectWithCovariance::pose() { return m_pose; } + + /*! * @brief This function copies the value in member twist * @param _twist New value to be copied in member twist */ -void derived_object_msgs::msg::ObjectWithCovariance::twist( +void ObjectWithCovariance::twist( const geometry_msgs::msg::TwistWithCovariance& _twist) { m_twist = _twist; @@ -459,7 +329,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::twist( * @brief This function moves the value in member twist * @param _twist New value to be moved in member twist */ -void derived_object_msgs::msg::ObjectWithCovariance::twist( +void ObjectWithCovariance::twist( geometry_msgs::msg::TwistWithCovariance&& _twist) { m_twist = std::move(_twist); @@ -469,7 +339,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::twist( * @brief This function returns a constant reference to member twist * @return Constant reference to member twist */ -const geometry_msgs::msg::TwistWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::twist() const +const geometry_msgs::msg::TwistWithCovariance& ObjectWithCovariance::twist() const { return m_twist; } @@ -478,15 +348,17 @@ const geometry_msgs::msg::TwistWithCovariance& derived_object_msgs::msg::ObjectW * @brief This function returns a reference to member twist * @return Reference to member twist */ -geometry_msgs::msg::TwistWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::twist() +geometry_msgs::msg::TwistWithCovariance& ObjectWithCovariance::twist() { return m_twist; } + + /*! * @brief This function copies the value in member accel * @param _accel New value to be copied in member accel */ -void derived_object_msgs::msg::ObjectWithCovariance::accel( +void ObjectWithCovariance::accel( const geometry_msgs::msg::AccelWithCovariance& _accel) { m_accel = _accel; @@ -496,7 +368,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::accel( * @brief This function moves the value in member accel * @param _accel New value to be moved in member accel */ -void derived_object_msgs::msg::ObjectWithCovariance::accel( +void ObjectWithCovariance::accel( geometry_msgs::msg::AccelWithCovariance&& _accel) { m_accel = std::move(_accel); @@ -506,7 +378,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::accel( * @brief This function returns a constant reference to member accel * @return Constant reference to member accel */ -const geometry_msgs::msg::AccelWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::accel() const +const geometry_msgs::msg::AccelWithCovariance& ObjectWithCovariance::accel() const { return m_accel; } @@ -515,15 +387,17 @@ const geometry_msgs::msg::AccelWithCovariance& derived_object_msgs::msg::ObjectW * @brief This function returns a reference to member accel * @return Reference to member accel */ -geometry_msgs::msg::AccelWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::accel() +geometry_msgs::msg::AccelWithCovariance& ObjectWithCovariance::accel() { return m_accel; } + + /*! * @brief This function copies the value in member polygon * @param _polygon New value to be copied in member polygon */ -void derived_object_msgs::msg::ObjectWithCovariance::polygon( +void ObjectWithCovariance::polygon( const geometry_msgs::msg::Polygon& _polygon) { m_polygon = _polygon; @@ -533,7 +407,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::polygon( * @brief This function moves the value in member polygon * @param _polygon New value to be moved in member polygon */ -void derived_object_msgs::msg::ObjectWithCovariance::polygon( +void ObjectWithCovariance::polygon( geometry_msgs::msg::Polygon&& _polygon) { m_polygon = std::move(_polygon); @@ -543,7 +417,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::polygon( * @brief This function returns a constant reference to member polygon * @return Constant reference to member polygon */ -const geometry_msgs::msg::Polygon& derived_object_msgs::msg::ObjectWithCovariance::polygon() const +const geometry_msgs::msg::Polygon& ObjectWithCovariance::polygon() const { return m_polygon; } @@ -552,15 +426,17 @@ const geometry_msgs::msg::Polygon& derived_object_msgs::msg::ObjectWithCovarianc * @brief This function returns a reference to member polygon * @return Reference to member polygon */ -geometry_msgs::msg::Polygon& derived_object_msgs::msg::ObjectWithCovariance::polygon() +geometry_msgs::msg::Polygon& ObjectWithCovariance::polygon() { return m_polygon; } + + /*! * @brief This function copies the value in member shape * @param _shape New value to be copied in member shape */ -void derived_object_msgs::msg::ObjectWithCovariance::shape( +void ObjectWithCovariance::shape( const derived_object_msgs::msg::SolidPrimitiveWithCovariance& _shape) { m_shape = _shape; @@ -570,7 +446,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::shape( * @brief This function moves the value in member shape * @param _shape New value to be moved in member shape */ -void derived_object_msgs::msg::ObjectWithCovariance::shape( +void ObjectWithCovariance::shape( derived_object_msgs::msg::SolidPrimitiveWithCovariance&& _shape) { m_shape = std::move(_shape); @@ -580,7 +456,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::shape( * @brief This function returns a constant reference to member shape * @return Constant reference to member shape */ -const derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::shape() const +const derived_object_msgs::msg::SolidPrimitiveWithCovariance& ObjectWithCovariance::shape() const { return m_shape; } @@ -589,15 +465,17 @@ const derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msg * @brief This function returns a reference to member shape * @return Reference to member shape */ -derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msgs::msg::ObjectWithCovariance::shape() +derived_object_msgs::msg::SolidPrimitiveWithCovariance& ObjectWithCovariance::shape() { return m_shape; } + + /*! * @brief This function sets a value in member classification * @param _classification New value for member classification */ -void derived_object_msgs::msg::ObjectWithCovariance::classification( +void ObjectWithCovariance::classification( uint8_t _classification) { m_classification = _classification; @@ -607,7 +485,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::classification( * @brief This function returns the value of member classification * @return Value of member classification */ -uint8_t derived_object_msgs::msg::ObjectWithCovariance::classification() const +uint8_t ObjectWithCovariance::classification() const { return m_classification; } @@ -616,16 +494,17 @@ uint8_t derived_object_msgs::msg::ObjectWithCovariance::classification() const * @brief This function returns a reference to member classification * @return Reference to member classification */ -uint8_t& derived_object_msgs::msg::ObjectWithCovariance::classification() +uint8_t& ObjectWithCovariance::classification() { return m_classification; } + /*! * @brief This function sets a value in member classification_certainty * @param _classification_certainty New value for member classification_certainty */ -void derived_object_msgs::msg::ObjectWithCovariance::classification_certainty( +void ObjectWithCovariance::classification_certainty( uint8_t _classification_certainty) { m_classification_certainty = _classification_certainty; @@ -635,7 +514,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::classification_certainty( * @brief This function returns the value of member classification_certainty * @return Value of member classification_certainty */ -uint8_t derived_object_msgs::msg::ObjectWithCovariance::classification_certainty() const +uint8_t ObjectWithCovariance::classification_certainty() const { return m_classification_certainty; } @@ -644,16 +523,17 @@ uint8_t derived_object_msgs::msg::ObjectWithCovariance::classification_certainty * @brief This function returns a reference to member classification_certainty * @return Reference to member classification_certainty */ -uint8_t& derived_object_msgs::msg::ObjectWithCovariance::classification_certainty() +uint8_t& ObjectWithCovariance::classification_certainty() { return m_classification_certainty; } + /*! * @brief This function sets a value in member classification_age * @param _classification_age New value for member classification_age */ -void derived_object_msgs::msg::ObjectWithCovariance::classification_age( +void ObjectWithCovariance::classification_age( uint32_t _classification_age) { m_classification_age = _classification_age; @@ -663,7 +543,7 @@ void derived_object_msgs::msg::ObjectWithCovariance::classification_age( * @brief This function returns the value of member classification_age * @return Value of member classification_age */ -uint32_t derived_object_msgs::msg::ObjectWithCovariance::classification_age() const +uint32_t ObjectWithCovariance::classification_age() const { return m_classification_age; } @@ -672,32 +552,18 @@ uint32_t derived_object_msgs::msg::ObjectWithCovariance::classification_age() co * @brief This function returns a reference to member classification_age * @return Reference to member classification_age */ -uint32_t& derived_object_msgs::msg::ObjectWithCovariance::classification_age() +uint32_t& ObjectWithCovariance::classification_age() { return m_classification_age; } -size_t derived_object_msgs::msg::ObjectWithCovariance::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool derived_object_msgs::msg::ObjectWithCovariance::isKeyDefined() -{ - return false; -} +} // namespace msg -void derived_object_msgs::msg::ObjectWithCovariance::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace derived_object_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ObjectWithCovarianceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.h index 20b7cb1dcf9..4c37bc9644d 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariance.h @@ -16,12 +16,23 @@ * @file ObjectWithCovariance.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "geometry_msgs/msg/PoseWithCovariance.h" #include "geometry_msgs/msg/TwistWithCovariance.h" #include "SolidPrimitiveWithCovariance.h" @@ -29,12 +40,6 @@ #include "std_msgs/msg/Header.h" #include "geometry_msgs/msg/AccelWithCovariance.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -48,441 +53,414 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ObjectWithCovariance_SOURCE) -#define ObjectWithCovariance_DllAPI __declspec( dllexport ) +#if defined(OBJECTWITHCOVARIANCE_SOURCE) +#define OBJECTWITHCOVARIANCE_DllAPI __declspec( dllexport ) #else -#define ObjectWithCovariance_DllAPI __declspec( dllimport ) -#endif // ObjectWithCovariance_SOURCE +#define OBJECTWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // OBJECTWITHCOVARIANCE_SOURCE #else -#define ObjectWithCovariance_DllAPI +#define OBJECTWITHCOVARIANCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ObjectWithCovariance_DllAPI +#define OBJECTWITHCOVARIANCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace derived_object_msgs { - namespace msg { - namespace ObjectWithCovariance_Constants { - const uint8_t OBJECT_DETECTED = 0; - const uint8_t OBJECT_TRACKED = 1; - const uint8_t CLASSIFICATION_UNKNOWN = 0; - const uint8_t CLASSIFICATION_UNKNOWN_SMALL = 1; - const uint8_t CLASSIFICATION_UNKNOWN_MEDIUM = 2; - const uint8_t CLASSIFICATION_UNKNOWN_BIG = 3; - const uint8_t CLASSIFICATION_PEDESTRIAN = 4; - const uint8_t CLASSIFICATION_BIKE = 5; - const uint8_t CLASSIFICATION_CAR = 6; - const uint8_t CLASSIFICATION_TRUCK = 7; - const uint8_t CLASSIFICATION_MOTORCYCLE = 8; - const uint8_t CLASSIFICATION_OTHER_VEHICLE = 9; - const uint8_t CLASSIFICATION_BARRIER = 10; - const uint8_t CLASSIFICATION_SIGN = 11; - } // namespace ObjectWithCovariance_Constants - /*! - * @brief This class represents the structure ObjectWithCovariance defined by the user in the IDL file. - * @ingroup OBJECTWITHCOVARIANCE - */ - class ObjectWithCovariance - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ObjectWithCovariance(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ObjectWithCovariance(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. - */ - eProsima_user_DllExport ObjectWithCovariance( - const ObjectWithCovariance& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. - */ - eProsima_user_DllExport ObjectWithCovariance( - ObjectWithCovariance&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. - */ - eProsima_user_DllExport ObjectWithCovariance& operator =( - const ObjectWithCovariance& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. - */ - eProsima_user_DllExport ObjectWithCovariance& operator =( - ObjectWithCovariance&& x); - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::ObjectWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ObjectWithCovariance& x) const; - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::ObjectWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ObjectWithCovariance& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member id - * @param _id New value for member id - */ - eProsima_user_DllExport void id( - uint32_t _id); - - /*! - * @brief This function returns the value of member id - * @return Value of member id - */ - eProsima_user_DllExport uint32_t id() const; - - /*! - * @brief This function returns a reference to member id - * @return Reference to member id - */ - eProsima_user_DllExport uint32_t& id(); - - /*! - * @brief This function sets a value in member detection_level - * @param _detection_level New value for member detection_level - */ - eProsima_user_DllExport void detection_level( - uint8_t _detection_level); - - /*! - * @brief This function returns the value of member detection_level - * @return Value of member detection_level - */ - eProsima_user_DllExport uint8_t detection_level() const; - - /*! - * @brief This function returns a reference to member detection_level - * @return Reference to member detection_level - */ - eProsima_user_DllExport uint8_t& detection_level(); - - /*! - * @brief This function sets a value in member object_classified - * @param _object_classified New value for member object_classified - */ - eProsima_user_DllExport void object_classified( - bool _object_classified); - - /*! - * @brief This function returns the value of member object_classified - * @return Value of member object_classified - */ - eProsima_user_DllExport bool object_classified() const; - - /*! - * @brief This function returns a reference to member object_classified - * @return Reference to member object_classified - */ - eProsima_user_DllExport bool& object_classified(); - - /*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ - eProsima_user_DllExport void pose( - const geometry_msgs::msg::PoseWithCovariance& _pose); - - /*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ - eProsima_user_DllExport void pose( - geometry_msgs::msg::PoseWithCovariance&& _pose); - - /*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ - eProsima_user_DllExport const geometry_msgs::msg::PoseWithCovariance& pose() const; - - /*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ - eProsima_user_DllExport geometry_msgs::msg::PoseWithCovariance& pose(); - /*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ - eProsima_user_DllExport void twist( - const geometry_msgs::msg::TwistWithCovariance& _twist); - - /*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ - eProsima_user_DllExport void twist( - geometry_msgs::msg::TwistWithCovariance&& _twist); - - /*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ - eProsima_user_DllExport const geometry_msgs::msg::TwistWithCovariance& twist() const; - - /*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ - eProsima_user_DllExport geometry_msgs::msg::TwistWithCovariance& twist(); - /*! - * @brief This function copies the value in member accel - * @param _accel New value to be copied in member accel - */ - eProsima_user_DllExport void accel( - const geometry_msgs::msg::AccelWithCovariance& _accel); - - /*! - * @brief This function moves the value in member accel - * @param _accel New value to be moved in member accel - */ - eProsima_user_DllExport void accel( - geometry_msgs::msg::AccelWithCovariance&& _accel); - - /*! - * @brief This function returns a constant reference to member accel - * @return Constant reference to member accel - */ - eProsima_user_DllExport const geometry_msgs::msg::AccelWithCovariance& accel() const; - - /*! - * @brief This function returns a reference to member accel - * @return Reference to member accel - */ - eProsima_user_DllExport geometry_msgs::msg::AccelWithCovariance& accel(); - /*! - * @brief This function copies the value in member polygon - * @param _polygon New value to be copied in member polygon - */ - eProsima_user_DllExport void polygon( - const geometry_msgs::msg::Polygon& _polygon); - - /*! - * @brief This function moves the value in member polygon - * @param _polygon New value to be moved in member polygon - */ - eProsima_user_DllExport void polygon( - geometry_msgs::msg::Polygon&& _polygon); - - /*! - * @brief This function returns a constant reference to member polygon - * @return Constant reference to member polygon - */ - eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; - - /*! - * @brief This function returns a reference to member polygon - * @return Reference to member polygon - */ - eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); - /*! - * @brief This function copies the value in member shape - * @param _shape New value to be copied in member shape - */ - eProsima_user_DllExport void shape( - const derived_object_msgs::msg::SolidPrimitiveWithCovariance& _shape); - - /*! - * @brief This function moves the value in member shape - * @param _shape New value to be moved in member shape - */ - eProsima_user_DllExport void shape( - derived_object_msgs::msg::SolidPrimitiveWithCovariance&& _shape); - - /*! - * @brief This function returns a constant reference to member shape - * @return Constant reference to member shape - */ - eProsima_user_DllExport const derived_object_msgs::msg::SolidPrimitiveWithCovariance& shape() const; - - /*! - * @brief This function returns a reference to member shape - * @return Reference to member shape - */ - eProsima_user_DllExport derived_object_msgs::msg::SolidPrimitiveWithCovariance& shape(); - /*! - * @brief This function sets a value in member classification - * @param _classification New value for member classification - */ - eProsima_user_DllExport void classification( - uint8_t _classification); - - /*! - * @brief This function returns the value of member classification - * @return Value of member classification - */ - eProsima_user_DllExport uint8_t classification() const; - - /*! - * @brief This function returns a reference to member classification - * @return Reference to member classification - */ - eProsima_user_DllExport uint8_t& classification(); - - /*! - * @brief This function sets a value in member classification_certainty - * @param _classification_certainty New value for member classification_certainty - */ - eProsima_user_DllExport void classification_certainty( - uint8_t _classification_certainty); - - /*! - * @brief This function returns the value of member classification_certainty - * @return Value of member classification_certainty - */ - eProsima_user_DllExport uint8_t classification_certainty() const; - - /*! - * @brief This function returns a reference to member classification_certainty - * @return Reference to member classification_certainty - */ - eProsima_user_DllExport uint8_t& classification_certainty(); - - /*! - * @brief This function sets a value in member classification_age - * @param _classification_age New value for member classification_age - */ - eProsima_user_DllExport void classification_age( - uint32_t _classification_age); - - /*! - * @brief This function returns the value of member classification_age - * @return Value of member classification_age - */ - eProsima_user_DllExport uint32_t classification_age() const; - - /*! - * @brief This function returns a reference to member classification_age - * @return Reference to member classification_age - */ - eProsima_user_DllExport uint32_t& classification_age(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const derived_object_msgs::msg::ObjectWithCovariance& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - uint32_t m_id; - uint8_t m_detection_level; - bool m_object_classified; - geometry_msgs::msg::PoseWithCovariance m_pose; - geometry_msgs::msg::TwistWithCovariance m_twist; - geometry_msgs::msg::AccelWithCovariance m_accel; - geometry_msgs::msg::Polygon m_polygon; - derived_object_msgs::msg::SolidPrimitiveWithCovariance m_shape; - uint8_t m_classification; - uint8_t m_classification_certainty; - uint32_t m_classification_age; - }; - } // namespace msg + +namespace msg { + +namespace ObjectWithCovariance_Constants { + +const uint8_t OBJECT_DETECTED = 0; +const uint8_t OBJECT_TRACKED = 1; +const uint8_t CLASSIFICATION_UNKNOWN = 0; +const uint8_t CLASSIFICATION_UNKNOWN_SMALL = 1; +const uint8_t CLASSIFICATION_UNKNOWN_MEDIUM = 2; +const uint8_t CLASSIFICATION_UNKNOWN_BIG = 3; +const uint8_t CLASSIFICATION_PEDESTRIAN = 4; +const uint8_t CLASSIFICATION_BIKE = 5; +const uint8_t CLASSIFICATION_CAR = 6; +const uint8_t CLASSIFICATION_TRUCK = 7; +const uint8_t CLASSIFICATION_MOTORCYCLE = 8; +const uint8_t CLASSIFICATION_OTHER_VEHICLE = 9; +const uint8_t CLASSIFICATION_BARRIER = 10; +const uint8_t CLASSIFICATION_SIGN = 11; + +} // namespace ObjectWithCovariance_Constants + + +/*! + * @brief This class represents the structure ObjectWithCovariance defined by the user in the IDL file. + * @ingroup ObjectWithCovariance + */ +class ObjectWithCovariance +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ObjectWithCovariance(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ObjectWithCovariance(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. + */ + eProsima_user_DllExport ObjectWithCovariance( + const ObjectWithCovariance& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. + */ + eProsima_user_DllExport ObjectWithCovariance( + ObjectWithCovariance&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. + */ + eProsima_user_DllExport ObjectWithCovariance& operator =( + const ObjectWithCovariance& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovariance that will be copied. + */ + eProsima_user_DllExport ObjectWithCovariance& operator =( + ObjectWithCovariance&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ObjectWithCovariance& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ObjectWithCovariance& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member id + * @param _id New value for member id + */ + eProsima_user_DllExport void id( + uint32_t _id); + + /*! + * @brief This function returns the value of member id + * @return Value of member id + */ + eProsima_user_DllExport uint32_t id() const; + + /*! + * @brief This function returns a reference to member id + * @return Reference to member id + */ + eProsima_user_DllExport uint32_t& id(); + + + /*! + * @brief This function sets a value in member detection_level + * @param _detection_level New value for member detection_level + */ + eProsima_user_DllExport void detection_level( + uint8_t _detection_level); + + /*! + * @brief This function returns the value of member detection_level + * @return Value of member detection_level + */ + eProsima_user_DllExport uint8_t detection_level() const; + + /*! + * @brief This function returns a reference to member detection_level + * @return Reference to member detection_level + */ + eProsima_user_DllExport uint8_t& detection_level(); + + + /*! + * @brief This function sets a value in member object_classified + * @param _object_classified New value for member object_classified + */ + eProsima_user_DllExport void object_classified( + bool _object_classified); + + /*! + * @brief This function returns the value of member object_classified + * @return Value of member object_classified + */ + eProsima_user_DllExport bool object_classified() const; + + /*! + * @brief This function returns a reference to member object_classified + * @return Reference to member object_classified + */ + eProsima_user_DllExport bool& object_classified(); + + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose( + const geometry_msgs::msg::PoseWithCovariance& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose( + geometry_msgs::msg::PoseWithCovariance&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::PoseWithCovariance& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::PoseWithCovariance& pose(); + + + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist( + const geometry_msgs::msg::TwistWithCovariance& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist( + geometry_msgs::msg::TwistWithCovariance&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::TwistWithCovariance& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::TwistWithCovariance& twist(); + + + /*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ + eProsima_user_DllExport void accel( + const geometry_msgs::msg::AccelWithCovariance& _accel); + + /*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ + eProsima_user_DllExport void accel( + geometry_msgs::msg::AccelWithCovariance&& _accel); + + /*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ + eProsima_user_DllExport const geometry_msgs::msg::AccelWithCovariance& accel() const; + + /*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ + eProsima_user_DllExport geometry_msgs::msg::AccelWithCovariance& accel(); + + + /*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ + eProsima_user_DllExport void polygon( + const geometry_msgs::msg::Polygon& _polygon); + + /*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ + eProsima_user_DllExport void polygon( + geometry_msgs::msg::Polygon&& _polygon); + + /*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ + eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; + + /*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ + eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); + + + /*! + * @brief This function copies the value in member shape + * @param _shape New value to be copied in member shape + */ + eProsima_user_DllExport void shape( + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& _shape); + + /*! + * @brief This function moves the value in member shape + * @param _shape New value to be moved in member shape + */ + eProsima_user_DllExport void shape( + derived_object_msgs::msg::SolidPrimitiveWithCovariance&& _shape); + + /*! + * @brief This function returns a constant reference to member shape + * @return Constant reference to member shape + */ + eProsima_user_DllExport const derived_object_msgs::msg::SolidPrimitiveWithCovariance& shape() const; + + /*! + * @brief This function returns a reference to member shape + * @return Reference to member shape + */ + eProsima_user_DllExport derived_object_msgs::msg::SolidPrimitiveWithCovariance& shape(); + + + /*! + * @brief This function sets a value in member classification + * @param _classification New value for member classification + */ + eProsima_user_DllExport void classification( + uint8_t _classification); + + /*! + * @brief This function returns the value of member classification + * @return Value of member classification + */ + eProsima_user_DllExport uint8_t classification() const; + + /*! + * @brief This function returns a reference to member classification + * @return Reference to member classification + */ + eProsima_user_DllExport uint8_t& classification(); + + + /*! + * @brief This function sets a value in member classification_certainty + * @param _classification_certainty New value for member classification_certainty + */ + eProsima_user_DllExport void classification_certainty( + uint8_t _classification_certainty); + + /*! + * @brief This function returns the value of member classification_certainty + * @return Value of member classification_certainty + */ + eProsima_user_DllExport uint8_t classification_certainty() const; + + /*! + * @brief This function returns a reference to member classification_certainty + * @return Reference to member classification_certainty + */ + eProsima_user_DllExport uint8_t& classification_certainty(); + + + /*! + * @brief This function sets a value in member classification_age + * @param _classification_age New value for member classification_age + */ + eProsima_user_DllExport void classification_age( + uint32_t _classification_age); + + /*! + * @brief This function returns the value of member classification_age + * @return Value of member classification_age + */ + eProsima_user_DllExport uint32_t classification_age() const; + + /*! + * @brief This function returns a reference to member classification_age + * @return Reference to member classification_age + */ + eProsima_user_DllExport uint32_t& classification_age(); + +private: + + std_msgs::msg::Header m_header; + uint32_t m_id{0}; + uint8_t m_detection_level{0}; + bool m_object_classified{false}; + geometry_msgs::msg::PoseWithCovariance m_pose; + geometry_msgs::msg::TwistWithCovariance m_twist; + geometry_msgs::msg::AccelWithCovariance m_accel; + geometry_msgs::msg::Polygon m_polygon; + derived_object_msgs::msg::SolidPrimitiveWithCovariance m_shape; + uint8_t m_classification{0}; + uint8_t m_classification_certainty{0}; + uint32_t m_classification_age{0}; + +}; + +} // namespace msg + } // namespace derived_object_msgs -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.cxx index 1cb2d8f6329..2d27c0a82ec 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.cxx @@ -14,9 +14,9 @@ /*! * @file ObjectWithCovarianceArray.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,134 +27,82 @@ char dummy; #endif // _WIN32 #include "ObjectWithCovarianceArray.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -derived_object_msgs::msg::ObjectWithCovarianceArray::ObjectWithCovarianceArray() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6e509ffa - // m_objects com.eprosima.idl.parser.typecode.SequenceTypeCode@68267da0 +namespace derived_object_msgs { + +namespace msg { + -} -derived_object_msgs::msg::ObjectWithCovarianceArray::~ObjectWithCovarianceArray() + +ObjectWithCovarianceArray::ObjectWithCovarianceArray() { +} +ObjectWithCovarianceArray::~ObjectWithCovarianceArray() +{ } -derived_object_msgs::msg::ObjectWithCovarianceArray::ObjectWithCovarianceArray( +ObjectWithCovarianceArray::ObjectWithCovarianceArray( const ObjectWithCovarianceArray& x) { m_header = x.m_header; m_objects = x.m_objects; } -derived_object_msgs::msg::ObjectWithCovarianceArray::ObjectWithCovarianceArray( - ObjectWithCovarianceArray&& x) +ObjectWithCovarianceArray::ObjectWithCovarianceArray( + ObjectWithCovarianceArray&& x) noexcept { m_header = std::move(x.m_header); m_objects = std::move(x.m_objects); } -derived_object_msgs::msg::ObjectWithCovarianceArray& derived_object_msgs::msg::ObjectWithCovarianceArray::operator =( +ObjectWithCovarianceArray& ObjectWithCovarianceArray::operator =( const ObjectWithCovarianceArray& x) { m_header = x.m_header; m_objects = x.m_objects; - return *this; } -derived_object_msgs::msg::ObjectWithCovarianceArray& derived_object_msgs::msg::ObjectWithCovarianceArray::operator =( - ObjectWithCovarianceArray&& x) +ObjectWithCovarianceArray& ObjectWithCovarianceArray::operator =( + ObjectWithCovarianceArray&& x) noexcept { m_header = std::move(x.m_header); m_objects = std::move(x.m_objects); - return *this; } -bool derived_object_msgs::msg::ObjectWithCovarianceArray::operator ==( +bool ObjectWithCovarianceArray::operator ==( const ObjectWithCovarianceArray& x) const { - - return (m_header == x.m_header && m_objects == x.m_objects); + return (m_header == x.m_header && + m_objects == x.m_objects); } -bool derived_object_msgs::msg::ObjectWithCovarianceArray::operator !=( +bool ObjectWithCovarianceArray::operator !=( const ObjectWithCovarianceArray& x) const { return !(*this == x); } -size_t derived_object_msgs::msg::ObjectWithCovarianceArray::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += derived_object_msgs::msg::ObjectWithCovariance::getMaxCdrSerializedSize(current_alignment);} - - - return current_alignment - initial_alignment; -} - -size_t derived_object_msgs::msg::ObjectWithCovarianceArray::getCdrSerializedSize( - const derived_object_msgs::msg::ObjectWithCovarianceArray& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.objects().size(); ++a) - { - current_alignment += derived_object_msgs::msg::ObjectWithCovariance::getCdrSerializedSize(data.objects().at(a), current_alignment);} - - - return current_alignment - initial_alignment; -} - -void derived_object_msgs::msg::ObjectWithCovarianceArray::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_objects; - -} - -void derived_object_msgs::msg::ObjectWithCovarianceArray::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_objects; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void derived_object_msgs::msg::ObjectWithCovarianceArray::header( +void ObjectWithCovarianceArray::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -164,7 +112,7 @@ void derived_object_msgs::msg::ObjectWithCovarianceArray::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void derived_object_msgs::msg::ObjectWithCovarianceArray::header( +void ObjectWithCovarianceArray::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -174,7 +122,7 @@ void derived_object_msgs::msg::ObjectWithCovarianceArray::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovarianceArray::header() const +const std_msgs::msg::Header& ObjectWithCovarianceArray::header() const { return m_header; } @@ -183,15 +131,17 @@ const std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovarianceArray * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& derived_object_msgs::msg::ObjectWithCovarianceArray::header() +std_msgs::msg::Header& ObjectWithCovarianceArray::header() { return m_header; } + + /*! * @brief This function copies the value in member objects * @param _objects New value to be copied in member objects */ -void derived_object_msgs::msg::ObjectWithCovarianceArray::objects( +void ObjectWithCovarianceArray::objects( const std::vector& _objects) { m_objects = _objects; @@ -201,7 +151,7 @@ void derived_object_msgs::msg::ObjectWithCovarianceArray::objects( * @brief This function moves the value in member objects * @param _objects New value to be moved in member objects */ -void derived_object_msgs::msg::ObjectWithCovarianceArray::objects( +void ObjectWithCovarianceArray::objects( std::vector&& _objects) { m_objects = std::move(_objects); @@ -211,7 +161,7 @@ void derived_object_msgs::msg::ObjectWithCovarianceArray::objects( * @brief This function returns a constant reference to member objects * @return Constant reference to member objects */ -const std::vector& derived_object_msgs::msg::ObjectWithCovarianceArray::objects() const +const std::vector& ObjectWithCovarianceArray::objects() const { return m_objects; } @@ -220,31 +170,18 @@ const std::vector& derived_objec * @brief This function returns a reference to member objects * @return Reference to member objects */ -std::vector& derived_object_msgs::msg::ObjectWithCovarianceArray::objects() +std::vector& ObjectWithCovarianceArray::objects() { return m_objects; } -size_t derived_object_msgs::msg::ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool derived_object_msgs::msg::ObjectWithCovarianceArray::isKeyDefined() -{ - return false; -} +} // namespace msg -void derived_object_msgs::msg::ObjectWithCovarianceArray::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace derived_object_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ObjectWithCovarianceArrayCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.h index e2f2985c278..eb42530be31 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArray.h @@ -16,20 +16,25 @@ * @file ObjectWithCovarianceArray.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_H_ -#include "ObjectWithCovariance.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "ObjectWithCovariance.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,201 +48,160 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ObjectWithCovarianceArray_SOURCE) -#define ObjectWithCovarianceArray_DllAPI __declspec( dllexport ) +#if defined(OBJECTWITHCOVARIANCEARRAY_SOURCE) +#define OBJECTWITHCOVARIANCEARRAY_DllAPI __declspec( dllexport ) #else -#define ObjectWithCovarianceArray_DllAPI __declspec( dllimport ) -#endif // ObjectWithCovarianceArray_SOURCE +#define OBJECTWITHCOVARIANCEARRAY_DllAPI __declspec( dllimport ) +#endif // OBJECTWITHCOVARIANCEARRAY_SOURCE #else -#define ObjectWithCovarianceArray_DllAPI +#define OBJECTWITHCOVARIANCEARRAY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ObjectWithCovarianceArray_DllAPI +#define OBJECTWITHCOVARIANCEARRAY_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace derived_object_msgs { - namespace msg { - /*! - * @brief This class represents the structure ObjectWithCovarianceArray defined by the user in the IDL file. - * @ingroup OBJECTWITHCOVARIANCEARRAY - */ - class ObjectWithCovarianceArray - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ObjectWithCovarianceArray(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ObjectWithCovarianceArray(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. - */ - eProsima_user_DllExport ObjectWithCovarianceArray( - const ObjectWithCovarianceArray& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. - */ - eProsima_user_DllExport ObjectWithCovarianceArray( - ObjectWithCovarianceArray&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. - */ - eProsima_user_DllExport ObjectWithCovarianceArray& operator =( - const ObjectWithCovarianceArray& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. - */ - eProsima_user_DllExport ObjectWithCovarianceArray& operator =( - ObjectWithCovarianceArray&& x); - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::ObjectWithCovarianceArray object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ObjectWithCovarianceArray& x) const; - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::ObjectWithCovarianceArray object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ObjectWithCovarianceArray& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member objects - * @param _objects New value to be copied in member objects - */ - eProsima_user_DllExport void objects( - const std::vector& _objects); - - /*! - * @brief This function moves the value in member objects - * @param _objects New value to be moved in member objects - */ - eProsima_user_DllExport void objects( - std::vector&& _objects); - - /*! - * @brief This function returns a constant reference to member objects - * @return Constant reference to member objects - */ - eProsima_user_DllExport const std::vector& objects() const; - - /*! - * @brief This function returns a reference to member objects - * @return Reference to member objects - */ - eProsima_user_DllExport std::vector& objects(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const derived_object_msgs::msg::ObjectWithCovarianceArray& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std_msgs::msg::Header m_header; - std::vector m_objects; - }; - } // namespace msg + +namespace msg { + + + + + +/*! + * @brief This class represents the structure ObjectWithCovarianceArray defined by the user in the IDL file. + * @ingroup ObjectWithCovarianceArray + */ +class ObjectWithCovarianceArray +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ObjectWithCovarianceArray(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ObjectWithCovarianceArray(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. + */ + eProsima_user_DllExport ObjectWithCovarianceArray( + const ObjectWithCovarianceArray& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. + */ + eProsima_user_DllExport ObjectWithCovarianceArray( + ObjectWithCovarianceArray&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. + */ + eProsima_user_DllExport ObjectWithCovarianceArray& operator =( + const ObjectWithCovarianceArray& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::ObjectWithCovarianceArray that will be copied. + */ + eProsima_user_DllExport ObjectWithCovarianceArray& operator =( + ObjectWithCovarianceArray&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectWithCovarianceArray object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ObjectWithCovarianceArray& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::ObjectWithCovarianceArray object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ObjectWithCovarianceArray& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member objects + * @param _objects New value to be copied in member objects + */ + eProsima_user_DllExport void objects( + const std::vector& _objects); + + /*! + * @brief This function moves the value in member objects + * @param _objects New value to be moved in member objects + */ + eProsima_user_DllExport void objects( + std::vector&& _objects); + + /*! + * @brief This function returns a constant reference to member objects + * @return Constant reference to member objects + */ + eProsima_user_DllExport const std::vector& objects() const; + + /*! + * @brief This function returns a reference to member objects + * @return Reference to member objects + */ + eProsima_user_DllExport std::vector& objects(); + +private: + + std_msgs::msg::Header m_header; + std::vector m_objects; + +}; + +} // namespace msg + } // namespace derived_object_msgs -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayCdrAux.hpp new file mode 100644 index 00000000000..9d37833b10f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayCdrAux.hpp @@ -0,0 +1,67 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovarianceArrayCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAYCDRAUX_HPP_ + +#include "ObjectWithCovarianceArray.h" + +constexpr uint32_t derived_object_msgs_msg_ObjectWithCovarianceArray_max_cdr_typesize {461888UL}; +constexpr uint32_t derived_object_msgs_msg_ObjectWithCovarianceArray_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectWithCovarianceArray& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayCdrAux.ipp new file mode 100644 index 00000000000..294f1897b93 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayCdrAux.ipp @@ -0,0 +1,140 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovarianceArrayCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAYCDRAUX_IPP_ + +#include "ObjectWithCovarianceArrayCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const derived_object_msgs::msg::ObjectWithCovarianceArray& data, + size_t& current_alignment) +{ + using namespace derived_object_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.objects(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectWithCovarianceArray& data) +{ + using namespace derived_object_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.objects() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + derived_object_msgs::msg::ObjectWithCovarianceArray& data) +{ + using namespace derived_object_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.objects(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectWithCovarianceArray& data) +{ + using namespace derived_object_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.cxx index e0f71c8f0a8..24cbfe771f2 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file ObjectWithCovarianceArrayPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ObjectWithCovarianceArrayPubSubTypes.h" +#include "ObjectWithCovarianceArrayCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace derived_object_msgs { - namespace msg { - ObjectWithCovarianceArrayPubSubType::ObjectWithCovarianceArrayPubSubType() - { - setName("derived_object_msgs::msg::dds_::ObjectWithCovarianceArray_"); - auto type_size = ObjectWithCovarianceArray::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ObjectWithCovarianceArray::isKeyDefined(); - size_t keyLength = ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize() > 16 ? - ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ObjectWithCovarianceArrayPubSubType::~ObjectWithCovarianceArrayPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ObjectWithCovarianceArrayPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ObjectWithCovarianceArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ObjectWithCovarianceArrayPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ObjectWithCovarianceArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ObjectWithCovarianceArrayPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ObjectWithCovarianceArrayPubSubType::createData() - { - return reinterpret_cast(new ObjectWithCovarianceArray()); - } - - void ObjectWithCovarianceArrayPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ObjectWithCovarianceArrayPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ObjectWithCovarianceArray* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ObjectWithCovarianceArray::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +ObjectWithCovarianceArrayPubSubType::ObjectWithCovarianceArrayPubSubType() +{ + setName("derived_object_msgs::msg::dds_::ObjectWithCovarianceArray_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ObjectWithCovarianceArray::getMaxCdrSerializedSize()); +#else + derived_object_msgs_msg_ObjectWithCovarianceArray_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ObjectWithCovarianceArrayPubSubType::~ObjectWithCovarianceArrayPubSubType() +{ +} + +bool ObjectWithCovarianceArrayPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ObjectWithCovarianceArray* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ObjectWithCovarianceArrayPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ObjectWithCovarianceArray* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ObjectWithCovarianceArrayPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ObjectWithCovarianceArrayPubSubType::createData() +{ + return reinterpret_cast(new ObjectWithCovarianceArray()); +} + +void ObjectWithCovarianceArrayPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ObjectWithCovarianceArrayPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace derived_object_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h index 359c8aa8a63..0935f587241 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h @@ -16,92 +16,123 @@ * @file ObjectWithCovarianceArrayPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ObjectWithCovarianceArray.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "ObjectWithCovariancePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ObjectWithCovarianceArray is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace derived_object_msgs +namespace derived_object_msgs { +namespace msg { + + + + + +/*! + * @brief This class represents the TopicDataType of the type ObjectWithCovarianceArray defined by the user in the IDL file. + * @ingroup ObjectWithCovarianceArray + */ +class ObjectWithCovarianceArrayPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type ObjectWithCovarianceArray defined by the user in the IDL file. - * @ingroup OBJECTWITHCOVARIANCEARRAY - */ - class ObjectWithCovarianceArrayPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef ObjectWithCovarianceArray type; + typedef ObjectWithCovarianceArray type; - eProsima_user_DllExport ObjectWithCovarianceArrayPubSubType(); + eProsima_user_DllExport ObjectWithCovarianceArrayPubSubType(); - eProsima_user_DllExport virtual ~ObjectWithCovarianceArrayPubSubType(); + eProsima_user_DllExport ~ObjectWithCovarianceArrayPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCEARRAY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceCdrAux.hpp new file mode 100644 index 00000000000..69db62db34c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceCdrAux.hpp @@ -0,0 +1,95 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCECDRAUX_HPP_ + +#include "ObjectWithCovariance.h" + +constexpr uint32_t derived_object_msgs_msg_ObjectWithCovariance_max_cdr_typesize {4616UL}; +constexpr uint32_t derived_object_msgs_msg_ObjectWithCovariance_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectWithCovariance& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceCdrAux.ipp new file mode 100644 index 00000000000..f00dfaa253c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovarianceCdrAux.ipp @@ -0,0 +1,247 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ObjectWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCECDRAUX_IPP_ + +#include "ObjectWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const derived_object_msgs::msg::ObjectWithCovariance& data, + size_t& current_alignment) +{ + using namespace derived_object_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.detection_level(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.object_classified(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.pose(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.twist(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.accel(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.polygon(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.shape(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.classification(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.classification_certainty(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.classification_age(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectWithCovariance& data) +{ + using namespace derived_object_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.id() + << eprosima::fastcdr::MemberId(2) << data.detection_level() + << eprosima::fastcdr::MemberId(3) << data.object_classified() + << eprosima::fastcdr::MemberId(4) << data.pose() + << eprosima::fastcdr::MemberId(5) << data.twist() + << eprosima::fastcdr::MemberId(6) << data.accel() + << eprosima::fastcdr::MemberId(7) << data.polygon() + << eprosima::fastcdr::MemberId(8) << data.shape() + << eprosima::fastcdr::MemberId(9) << data.classification() + << eprosima::fastcdr::MemberId(10) << data.classification_certainty() + << eprosima::fastcdr::MemberId(11) << data.classification_age() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + derived_object_msgs::msg::ObjectWithCovariance& data) +{ + using namespace derived_object_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.id(); + break; + + case 2: + dcdr >> data.detection_level(); + break; + + case 3: + dcdr >> data.object_classified(); + break; + + case 4: + dcdr >> data.pose(); + break; + + case 5: + dcdr >> data.twist(); + break; + + case 6: + dcdr >> data.accel(); + break; + + case 7: + dcdr >> data.polygon(); + break; + + case 8: + dcdr >> data.shape(); + break; + + case 9: + dcdr >> data.classification(); + break; + + case 10: + dcdr >> data.classification_certainty(); + break; + + case 11: + dcdr >> data.classification_age(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::ObjectWithCovariance& data) +{ + using namespace derived_object_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.cxx index d5f4af276e3..a7149ab09dc 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.cxx @@ -16,21 +16,37 @@ * @file ObjectWithCovariancePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ObjectWithCovariancePubSubTypes.h" +#include "ObjectWithCovarianceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace derived_object_msgs { - namespace msg { - namespace ObjectWithCovariance_Constants { +namespace msg { +namespace ObjectWithCovariance_Constants { + + + + + + + + + + + + @@ -46,148 +62,169 @@ namespace derived_object_msgs { - } //End of namespace ObjectWithCovariance_Constants - ObjectWithCovariancePubSubType::ObjectWithCovariancePubSubType() - { - setName("derived_object_msgs::msg::dds_::ObjectWithCovariance_"); - auto type_size = ObjectWithCovariance::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ObjectWithCovariance::isKeyDefined(); - size_t keyLength = ObjectWithCovariance::getKeyMaxCdrSerializedSize() > 16 ? - ObjectWithCovariance::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - ObjectWithCovariancePubSubType::~ObjectWithCovariancePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ObjectWithCovariancePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ObjectWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ObjectWithCovariancePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ObjectWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ObjectWithCovariancePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ObjectWithCovariancePubSubType::createData() - { - return reinterpret_cast(new ObjectWithCovariance()); - } - - void ObjectWithCovariancePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ObjectWithCovariancePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ObjectWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ObjectWithCovariance::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ObjectWithCovariance::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + +} //End of namespace ObjectWithCovariance_Constants + + + +ObjectWithCovariancePubSubType::ObjectWithCovariancePubSubType() +{ + setName("derived_object_msgs::msg::dds_::ObjectWithCovariance_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ObjectWithCovariance::getMaxCdrSerializedSize()); +#else + derived_object_msgs_msg_ObjectWithCovariance_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ObjectWithCovariancePubSubType::~ObjectWithCovariancePubSubType() +{ +} + +bool ObjectWithCovariancePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ObjectWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ObjectWithCovariancePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ObjectWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ObjectWithCovariancePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ObjectWithCovariancePubSubType::createData() +{ + return reinterpret_cast(new ObjectWithCovariance()); +} + +void ObjectWithCovariancePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ObjectWithCovariancePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace derived_object_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h index b29521ecfe9..7f6bc2bed86 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/ObjectWithCovariancePubSubTypes.h @@ -16,29 +16,44 @@ * @file ObjectWithCovariancePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ObjectWithCovariance.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "geometry_msgs/msg/PoseWithCovariancePubSubTypes.h" +#include "geometry_msgs/msg/TwistWithCovariancePubSubTypes.h" +#include "SolidPrimitiveWithCovariancePubSubTypes.h" +#include "geometry_msgs/msg/PolygonPubSubTypes.h" +#include "std_msgs/msg/HeaderPubSubTypes.h" +#include "geometry_msgs/msg/AccelWithCovariancePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ObjectWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace derived_object_msgs -{ - namespace msg - { - namespace ObjectWithCovariance_Constants - { +namespace derived_object_msgs { +namespace msg { +namespace ObjectWithCovariance_Constants { + + + + + + @@ -53,72 +68,104 @@ namespace derived_object_msgs - } - /*! - * @brief This class represents the TopicDataType of the type ObjectWithCovariance defined by the user in the IDL file. - * @ingroup OBJECTWITHCOVARIANCE - */ - class ObjectWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef ObjectWithCovariance type; - eProsima_user_DllExport ObjectWithCovariancePubSubType(); - eProsima_user_DllExport virtual ~ObjectWithCovariancePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; +} // namespace ObjectWithCovariance_Constants - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +/*! + * @brief This class represents the TopicDataType of the type ObjectWithCovariance defined by the user in the IDL file. + * @ingroup ObjectWithCovariance + */ +class ObjectWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef ObjectWithCovariance type; + + eProsima_user_DllExport ObjectWithCovariancePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport ~ObjectWithCovariancePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_OBJECTWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.cxx index c147b3ba564..757c8874c77 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.cxx @@ -14,9 +14,9 @@ /*! * @file SolidPrimitiveWithCovariance.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,44 +27,37 @@ char dummy; #endif // _WIN32 #include "SolidPrimitiveWithCovariance.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace derived_object_msgs { +namespace msg { +namespace SolidPrimitiveWithCovariance_Constants { +} // namespace SolidPrimitiveWithCovariance_Constants - - - - -derived_object_msgs::msg::SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance() +SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance() { - // m_type com.eprosima.idl.parser.typecode.PrimitiveTypeCode@48075da3 - m_type = 0; - // m_dimensions com.eprosima.idl.parser.typecode.SequenceTypeCode@68c9133c - - // m_covariance com.eprosima.idl.parser.typecode.SequenceTypeCode@7a35b0f5 - - } -derived_object_msgs::msg::SolidPrimitiveWithCovariance::~SolidPrimitiveWithCovariance() +SolidPrimitiveWithCovariance::~SolidPrimitiveWithCovariance() { - - } -derived_object_msgs::msg::SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance( +SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance( const SolidPrimitiveWithCovariance& x) { m_type = x.m_type; @@ -72,131 +65,53 @@ derived_object_msgs::msg::SolidPrimitiveWithCovariance::SolidPrimitiveWithCovari m_covariance = x.m_covariance; } -derived_object_msgs::msg::SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance( - SolidPrimitiveWithCovariance&& x) +SolidPrimitiveWithCovariance::SolidPrimitiveWithCovariance( + SolidPrimitiveWithCovariance&& x) noexcept { m_type = x.m_type; m_dimensions = std::move(x.m_dimensions); m_covariance = std::move(x.m_covariance); } -derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msgs::msg::SolidPrimitiveWithCovariance::operator =( +SolidPrimitiveWithCovariance& SolidPrimitiveWithCovariance::operator =( const SolidPrimitiveWithCovariance& x) { m_type = x.m_type; m_dimensions = x.m_dimensions; m_covariance = x.m_covariance; - return *this; } -derived_object_msgs::msg::SolidPrimitiveWithCovariance& derived_object_msgs::msg::SolidPrimitiveWithCovariance::operator =( - SolidPrimitiveWithCovariance&& x) +SolidPrimitiveWithCovariance& SolidPrimitiveWithCovariance::operator =( + SolidPrimitiveWithCovariance&& x) noexcept { m_type = x.m_type; m_dimensions = std::move(x.m_dimensions); m_covariance = std::move(x.m_covariance); - return *this; } -bool derived_object_msgs::msg::SolidPrimitiveWithCovariance::operator ==( +bool SolidPrimitiveWithCovariance::operator ==( const SolidPrimitiveWithCovariance& x) const { - - return (m_type == x.m_type && m_dimensions == x.m_dimensions && m_covariance == x.m_covariance); + return (m_type == x.m_type && + m_dimensions == x.m_dimensions && + m_covariance == x.m_covariance); } -bool derived_object_msgs::msg::SolidPrimitiveWithCovariance::operator !=( +bool SolidPrimitiveWithCovariance::operator !=( const SolidPrimitiveWithCovariance& x) const { return !(*this == x); } -size_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - - return current_alignment - initial_alignment; -} - -size_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::getCdrSerializedSize( - const derived_object_msgs::msg::SolidPrimitiveWithCovariance& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.dimensions().size() > 0) - { - current_alignment += (data.dimensions().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.covariance().size() > 0) - { - current_alignment += (data.covariance().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - - return current_alignment - initial_alignment; -} - -void derived_object_msgs::msg::SolidPrimitiveWithCovariance::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_type; - scdr << m_dimensions; - scdr << m_covariance; - -} - -void derived_object_msgs::msg::SolidPrimitiveWithCovariance::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_type; - dcdr >> m_dimensions; - dcdr >> m_covariance; -} - /*! * @brief This function sets a value in member type * @param _type New value for member type */ -void derived_object_msgs::msg::SolidPrimitiveWithCovariance::type( +void SolidPrimitiveWithCovariance::type( uint8_t _type) { m_type = _type; @@ -206,7 +121,7 @@ void derived_object_msgs::msg::SolidPrimitiveWithCovariance::type( * @brief This function returns the value of member type * @return Value of member type */ -uint8_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::type() const +uint8_t SolidPrimitiveWithCovariance::type() const { return m_type; } @@ -215,16 +130,17 @@ uint8_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::type() const * @brief This function returns a reference to member type * @return Reference to member type */ -uint8_t& derived_object_msgs::msg::SolidPrimitiveWithCovariance::type() +uint8_t& SolidPrimitiveWithCovariance::type() { return m_type; } + /*! * @brief This function copies the value in member dimensions * @param _dimensions New value to be copied in member dimensions */ -void derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions( +void SolidPrimitiveWithCovariance::dimensions( const std::vector& _dimensions) { m_dimensions = _dimensions; @@ -234,7 +150,7 @@ void derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions( * @brief This function moves the value in member dimensions * @param _dimensions New value to be moved in member dimensions */ -void derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions( +void SolidPrimitiveWithCovariance::dimensions( std::vector&& _dimensions) { m_dimensions = std::move(_dimensions); @@ -244,7 +160,7 @@ void derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions( * @brief This function returns a constant reference to member dimensions * @return Constant reference to member dimensions */ -const std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions() const +const std::vector& SolidPrimitiveWithCovariance::dimensions() const { return m_dimensions; } @@ -253,15 +169,17 @@ const std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovarianc * @brief This function returns a reference to member dimensions * @return Reference to member dimensions */ -std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovariance::dimensions() +std::vector& SolidPrimitiveWithCovariance::dimensions() { return m_dimensions; } + + /*! * @brief This function copies the value in member covariance * @param _covariance New value to be copied in member covariance */ -void derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance( +void SolidPrimitiveWithCovariance::covariance( const std::vector& _covariance) { m_covariance = _covariance; @@ -271,7 +189,7 @@ void derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance( * @brief This function moves the value in member covariance * @param _covariance New value to be moved in member covariance */ -void derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance( +void SolidPrimitiveWithCovariance::covariance( std::vector&& _covariance) { m_covariance = std::move(_covariance); @@ -281,7 +199,7 @@ void derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance( * @brief This function returns a constant reference to member covariance * @return Constant reference to member covariance */ -const std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance() const +const std::vector& SolidPrimitiveWithCovariance::covariance() const { return m_covariance; } @@ -290,31 +208,18 @@ const std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovarianc * @brief This function returns a reference to member covariance * @return Reference to member covariance */ -std::vector& derived_object_msgs::msg::SolidPrimitiveWithCovariance::covariance() +std::vector& SolidPrimitiveWithCovariance::covariance() { return m_covariance; } -size_t derived_object_msgs::msg::SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool derived_object_msgs::msg::SolidPrimitiveWithCovariance::isKeyDefined() -{ - return false; -} +} // namespace msg -void derived_object_msgs::msg::SolidPrimitiveWithCovariance::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace derived_object_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SolidPrimitiveWithCovarianceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.h index 702fe4746ff..a1091033e5f 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariance.h @@ -16,19 +16,24 @@ * @file SolidPrimitiveWithCovariance.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,235 +47,197 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SolidPrimitiveWithCovariance_SOURCE) -#define SolidPrimitiveWithCovariance_DllAPI __declspec( dllexport ) +#if defined(SOLIDPRIMITIVEWITHCOVARIANCE_SOURCE) +#define SOLIDPRIMITIVEWITHCOVARIANCE_DllAPI __declspec( dllexport ) #else -#define SolidPrimitiveWithCovariance_DllAPI __declspec( dllimport ) -#endif // SolidPrimitiveWithCovariance_SOURCE +#define SOLIDPRIMITIVEWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // SOLIDPRIMITIVEWITHCOVARIANCE_SOURCE #else -#define SolidPrimitiveWithCovariance_DllAPI +#define SOLIDPRIMITIVEWITHCOVARIANCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SolidPrimitiveWithCovariance_DllAPI +#define SOLIDPRIMITIVEWITHCOVARIANCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace derived_object_msgs { - namespace msg { - namespace SolidPrimitiveWithCovariance_Constants { - const uint8_t BOX = 1; - const uint8_t SPHERE = 2; - const uint8_t CYLINDER = 3; - const uint8_t CONE = 4; - const uint8_t BOX_X = 0; - const uint8_t BOX_Y = 1; - const uint8_t BOX_Z = 2; - const uint8_t SPHERE_RADIUS = 0; - const uint8_t CYLINDER_HEIGHT = 0; - const uint8_t CYLINDER_RADIUS = 1; - const uint8_t CONE_HEIGHT = 0; - const uint8_t CONE_RADIUS = 1; - } // namespace SolidPrimitiveWithCovariance_Constants - /*! - * @brief This class represents the structure SolidPrimitiveWithCovariance defined by the user in the IDL file. - * @ingroup SOLIDPRIMITIVEWITHCOVARIANCE - */ - class SolidPrimitiveWithCovariance - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SolidPrimitiveWithCovariance(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SolidPrimitiveWithCovariance(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. - */ - eProsima_user_DllExport SolidPrimitiveWithCovariance( - const SolidPrimitiveWithCovariance& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. - */ - eProsima_user_DllExport SolidPrimitiveWithCovariance( - SolidPrimitiveWithCovariance&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. - */ - eProsima_user_DllExport SolidPrimitiveWithCovariance& operator =( - const SolidPrimitiveWithCovariance& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. - */ - eProsima_user_DllExport SolidPrimitiveWithCovariance& operator =( - SolidPrimitiveWithCovariance&& x); - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::SolidPrimitiveWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SolidPrimitiveWithCovariance& x) const; - - /*! - * @brief Comparison operator. - * @param x derived_object_msgs::msg::SolidPrimitiveWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SolidPrimitiveWithCovariance& x) const; - - /*! - * @brief This function sets a value in member type - * @param _type New value for member type - */ - eProsima_user_DllExport void type( - uint8_t _type); - - /*! - * @brief This function returns the value of member type - * @return Value of member type - */ - eProsima_user_DllExport uint8_t type() const; - - /*! - * @brief This function returns a reference to member type - * @return Reference to member type - */ - eProsima_user_DllExport uint8_t& type(); - - /*! - * @brief This function copies the value in member dimensions - * @param _dimensions New value to be copied in member dimensions - */ - eProsima_user_DllExport void dimensions( - const std::vector& _dimensions); - - /*! - * @brief This function moves the value in member dimensions - * @param _dimensions New value to be moved in member dimensions - */ - eProsima_user_DllExport void dimensions( - std::vector&& _dimensions); - - /*! - * @brief This function returns a constant reference to member dimensions - * @return Constant reference to member dimensions - */ - eProsima_user_DllExport const std::vector& dimensions() const; - - /*! - * @brief This function returns a reference to member dimensions - * @return Reference to member dimensions - */ - eProsima_user_DllExport std::vector& dimensions(); - /*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ - eProsima_user_DllExport void covariance( - const std::vector& _covariance); - - /*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ - eProsima_user_DllExport void covariance( - std::vector&& _covariance); - - /*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ - eProsima_user_DllExport const std::vector& covariance() const; - - /*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ - eProsima_user_DllExport std::vector& covariance(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const derived_object_msgs::msg::SolidPrimitiveWithCovariance& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_type; - std::vector m_dimensions; - std::vector m_covariance; - }; - } // namespace msg + +namespace msg { + +namespace SolidPrimitiveWithCovariance_Constants { + +const uint8_t BOX = 1; +const uint8_t SPHERE = 2; +const uint8_t CYLINDER = 3; +const uint8_t CONE = 4; +const uint8_t BOX_X = 0; +const uint8_t BOX_Y = 1; +const uint8_t BOX_Z = 2; +const uint8_t SPHERE_RADIUS = 0; +const uint8_t CYLINDER_HEIGHT = 0; +const uint8_t CYLINDER_RADIUS = 1; +const uint8_t CONE_HEIGHT = 0; +const uint8_t CONE_RADIUS = 1; + +} // namespace SolidPrimitiveWithCovariance_Constants + + + + +/*! + * @brief This class represents the structure SolidPrimitiveWithCovariance defined by the user in the IDL file. + * @ingroup SolidPrimitiveWithCovariance + */ +class SolidPrimitiveWithCovariance +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SolidPrimitiveWithCovariance(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance( + const SolidPrimitiveWithCovariance& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance( + SolidPrimitiveWithCovariance&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance& operator =( + const SolidPrimitiveWithCovariance& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object derived_object_msgs::msg::SolidPrimitiveWithCovariance that will be copied. + */ + eProsima_user_DllExport SolidPrimitiveWithCovariance& operator =( + SolidPrimitiveWithCovariance&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::SolidPrimitiveWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SolidPrimitiveWithCovariance& x) const; + + /*! + * @brief Comparison operator. + * @param x derived_object_msgs::msg::SolidPrimitiveWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SolidPrimitiveWithCovariance& x) const; + + /*! + * @brief This function sets a value in member type + * @param _type New value for member type + */ + eProsima_user_DllExport void type( + uint8_t _type); + + /*! + * @brief This function returns the value of member type + * @return Value of member type + */ + eProsima_user_DllExport uint8_t type() const; + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport uint8_t& type(); + + + /*! + * @brief This function copies the value in member dimensions + * @param _dimensions New value to be copied in member dimensions + */ + eProsima_user_DllExport void dimensions( + const std::vector& _dimensions); + + /*! + * @brief This function moves the value in member dimensions + * @param _dimensions New value to be moved in member dimensions + */ + eProsima_user_DllExport void dimensions( + std::vector&& _dimensions); + + /*! + * @brief This function returns a constant reference to member dimensions + * @return Constant reference to member dimensions + */ + eProsima_user_DllExport const std::vector& dimensions() const; + + /*! + * @brief This function returns a reference to member dimensions + * @return Reference to member dimensions + */ + eProsima_user_DllExport std::vector& dimensions(); + + + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const std::vector& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + std::vector&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const std::vector& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport std::vector& covariance(); + +private: + + uint8_t m_type{0}; + std::vector m_dimensions; + std::vector m_covariance; + +}; + +} // namespace msg + } // namespace derived_object_msgs -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovarianceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovarianceCdrAux.hpp new file mode 100644 index 00000000000..18ecbad3251 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovarianceCdrAux.hpp @@ -0,0 +1,77 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitiveWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCECDRAUX_HPP_ + +#include "SolidPrimitiveWithCovariance.h" + +constexpr uint32_t derived_object_msgs_msg_SolidPrimitiveWithCovariance_max_cdr_typesize {1624UL}; +constexpr uint32_t derived_object_msgs_msg_SolidPrimitiveWithCovariance_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovarianceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovarianceCdrAux.ipp new file mode 100644 index 00000000000..8045296c745 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovarianceCdrAux.ipp @@ -0,0 +1,173 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitiveWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCECDRAUX_IPP_ + +#include "SolidPrimitiveWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& data, + size_t& current_alignment) +{ + using namespace derived_object_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.dimensions(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& data) +{ + using namespace derived_object_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.type() + << eprosima::fastcdr::MemberId(1) << data.dimensions() + << eprosima::fastcdr::MemberId(2) << data.covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + derived_object_msgs::msg::SolidPrimitiveWithCovariance& data) +{ + using namespace derived_object_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.type(); + break; + + case 1: + dcdr >> data.dimensions(); + break; + + case 2: + dcdr >> data.covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const derived_object_msgs::msg::SolidPrimitiveWithCovariance& data) +{ + using namespace derived_object_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.cxx index 0c23b089740..3c0bc11dcbf 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.cxx @@ -16,176 +16,213 @@ * @file SolidPrimitiveWithCovariancePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SolidPrimitiveWithCovariancePubSubTypes.h" +#include "SolidPrimitiveWithCovarianceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace derived_object_msgs { - namespace msg { - namespace SolidPrimitiveWithCovariance_Constants { - - - - - +namespace msg { +namespace SolidPrimitiveWithCovariance_Constants { + + + + + + + + + + + + + + + + + - - - - } //End of namespace SolidPrimitiveWithCovariance_Constants - SolidPrimitiveWithCovariancePubSubType::SolidPrimitiveWithCovariancePubSubType() - { - setName("derived_object_msgs::msg::dds_::SolidPrimitiveWithCovariance_"); - auto type_size = SolidPrimitiveWithCovariance::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SolidPrimitiveWithCovariance::isKeyDefined(); - size_t keyLength = SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize() > 16 ? - SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SolidPrimitiveWithCovariancePubSubType::~SolidPrimitiveWithCovariancePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SolidPrimitiveWithCovariancePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SolidPrimitiveWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SolidPrimitiveWithCovariancePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SolidPrimitiveWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SolidPrimitiveWithCovariancePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SolidPrimitiveWithCovariancePubSubType::createData() - { - return reinterpret_cast(new SolidPrimitiveWithCovariance()); - } - - void SolidPrimitiveWithCovariancePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SolidPrimitiveWithCovariancePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SolidPrimitiveWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SolidPrimitiveWithCovariance::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg - + + + +} //End of namespace SolidPrimitiveWithCovariance_Constants + + + + + +SolidPrimitiveWithCovariancePubSubType::SolidPrimitiveWithCovariancePubSubType() +{ + setName("derived_object_msgs::msg::dds_::SolidPrimitiveWithCovariance_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SolidPrimitiveWithCovariance::getMaxCdrSerializedSize()); +#else + derived_object_msgs_msg_SolidPrimitiveWithCovariance_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SolidPrimitiveWithCovariancePubSubType::~SolidPrimitiveWithCovariancePubSubType() +{ +} + +bool SolidPrimitiveWithCovariancePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SolidPrimitiveWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SolidPrimitiveWithCovariancePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SolidPrimitiveWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SolidPrimitiveWithCovariancePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SolidPrimitiveWithCovariancePubSubType::createData() +{ + return reinterpret_cast(new SolidPrimitiveWithCovariance()); +} + +void SolidPrimitiveWithCovariancePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SolidPrimitiveWithCovariancePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace derived_object_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.h index b63468cab18..c85969d88f4 100644 --- a/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/derived_object_msgs/msg/SolidPrimitiveWithCovariancePubSubTypes.h @@ -16,29 +16,38 @@ * @file SolidPrimitiveWithCovariancePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SolidPrimitiveWithCovariance.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SolidPrimitiveWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace derived_object_msgs -{ - namespace msg - { - namespace SolidPrimitiveWithCovariance_Constants - { +namespace derived_object_msgs { +namespace msg { +namespace SolidPrimitiveWithCovariance_Constants { + + + + + + @@ -51,72 +60,104 @@ namespace derived_object_msgs - } - /*! - * @brief This class represents the TopicDataType of the type SolidPrimitiveWithCovariance defined by the user in the IDL file. - * @ingroup SOLIDPRIMITIVEWITHCOVARIANCE - */ - class SolidPrimitiveWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SolidPrimitiveWithCovariance type; - eProsima_user_DllExport SolidPrimitiveWithCovariancePubSubType(); - eProsima_user_DllExport virtual ~SolidPrimitiveWithCovariancePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +} // namespace SolidPrimitiveWithCovariance_Constants - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +/*! + * @brief This class represents the TopicDataType of the type SolidPrimitiveWithCovariance defined by the user in the IDL file. + * @ingroup SolidPrimitiveWithCovariance + */ +class SolidPrimitiveWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SolidPrimitiveWithCovariance type; + + eProsima_user_DllExport SolidPrimitiveWithCovariancePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport ~SolidPrimitiveWithCovariancePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace derived_object_msgs + +#endif // _FAST_DDS_GENERATED_DERIVED_OBJECT_MSGS_MSG_SOLIDPRIMITIVEWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.cxx b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.cxx index d6c663435b8..fbb0f008759 100644 --- a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.cxx @@ -14,9 +14,9 @@ /*! * @file KeyValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,126 +27,80 @@ char dummy; #endif // _WIN32 #include "KeyValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -diagnostic_msgs::msg::KeyValue::KeyValue() -{ - // m_key com.eprosima.idl.parser.typecode.StringTypeCode@77888435 - m_key =""; - // m_value com.eprosima.idl.parser.typecode.StringTypeCode@73a1e9a9 - m_value =""; -} +namespace diagnostic_msgs { + +namespace msg { + -diagnostic_msgs::msg::KeyValue::~KeyValue() + +KeyValue::KeyValue() { +} +KeyValue::~KeyValue() +{ } -diagnostic_msgs::msg::KeyValue::KeyValue( +KeyValue::KeyValue( const KeyValue& x) { m_key = x.m_key; m_value = x.m_value; } -diagnostic_msgs::msg::KeyValue::KeyValue( - KeyValue&& x) +KeyValue::KeyValue( + KeyValue&& x) noexcept { m_key = std::move(x.m_key); m_value = std::move(x.m_value); } -diagnostic_msgs::msg::KeyValue& diagnostic_msgs::msg::KeyValue::operator =( +KeyValue& KeyValue::operator =( const KeyValue& x) { m_key = x.m_key; m_value = x.m_value; - return *this; } -diagnostic_msgs::msg::KeyValue& diagnostic_msgs::msg::KeyValue::operator =( - KeyValue&& x) +KeyValue& KeyValue::operator =( + KeyValue&& x) noexcept { m_key = std::move(x.m_key); m_value = std::move(x.m_value); - return *this; } -bool diagnostic_msgs::msg::KeyValue::operator ==( +bool KeyValue::operator ==( const KeyValue& x) const { - - return (m_key == x.m_key && m_value == x.m_value); + return (m_key == x.m_key && + m_value == x.m_value); } -bool diagnostic_msgs::msg::KeyValue::operator !=( +bool KeyValue::operator !=( const KeyValue& x) const { return !(*this == x); } -size_t diagnostic_msgs::msg::KeyValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; -} - -size_t diagnostic_msgs::msg::KeyValue::getCdrSerializedSize( - const diagnostic_msgs::msg::KeyValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.key().size() + 1; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.value().size() + 1; - - - return current_alignment - initial_alignment; -} - -void diagnostic_msgs::msg::KeyValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_key; - scdr << m_value; - -} - -void diagnostic_msgs::msg::KeyValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_key; - dcdr >> m_value; -} - /*! * @brief This function copies the value in member key * @param _key New value to be copied in member key */ -void diagnostic_msgs::msg::KeyValue::key( +void KeyValue::key( const std::string& _key) { m_key = _key; @@ -156,7 +110,7 @@ void diagnostic_msgs::msg::KeyValue::key( * @brief This function moves the value in member key * @param _key New value to be moved in member key */ -void diagnostic_msgs::msg::KeyValue::key( +void KeyValue::key( std::string&& _key) { m_key = std::move(_key); @@ -166,7 +120,7 @@ void diagnostic_msgs::msg::KeyValue::key( * @brief This function returns a constant reference to member key * @return Constant reference to member key */ -const std::string& diagnostic_msgs::msg::KeyValue::key() const +const std::string& KeyValue::key() const { return m_key; } @@ -175,15 +129,17 @@ const std::string& diagnostic_msgs::msg::KeyValue::key() const * @brief This function returns a reference to member key * @return Reference to member key */ -std::string& diagnostic_msgs::msg::KeyValue::key() +std::string& KeyValue::key() { return m_key; } + + /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void diagnostic_msgs::msg::KeyValue::value( +void KeyValue::value( const std::string& _value) { m_value = _value; @@ -193,7 +149,7 @@ void diagnostic_msgs::msg::KeyValue::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void diagnostic_msgs::msg::KeyValue::value( +void KeyValue::value( std::string&& _value) { m_value = std::move(_value); @@ -203,7 +159,7 @@ void diagnostic_msgs::msg::KeyValue::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::string& diagnostic_msgs::msg::KeyValue::value() const +const std::string& KeyValue::value() const { return m_value; } @@ -212,31 +168,18 @@ const std::string& diagnostic_msgs::msg::KeyValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -std::string& diagnostic_msgs::msg::KeyValue::value() +std::string& KeyValue::value() { return m_value; } -size_t diagnostic_msgs::msg::KeyValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool diagnostic_msgs::msg::KeyValue::isKeyDefined() -{ - return false; -} - -void diagnostic_msgs::msg::KeyValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace diagnostic_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "KeyValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.h b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.h index 4d5ecac164d..0fc17be8420 100644 --- a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.h +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValue.h @@ -16,22 +16,28 @@ * @file KeyValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_H_ #define _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_H_ -#include #include #include +#include #include #include #include +#include +#include +#include + + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -41,178 +47,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(KeyValue_SOURCE) -#define KeyValue_DllAPI __declspec(dllexport) +#if defined(KEYVALUE_SOURCE) +#define KEYVALUE_DllAPI __declspec( dllexport ) #else -#define KeyValue_DllAPI __declspec(dllimport) -#endif // KeyValue_SOURCE +#define KEYVALUE_DllAPI __declspec( dllimport ) +#endif // KEYVALUE_SOURCE #else -#define KeyValue_DllAPI +#define KEYVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define KeyValue_DllAPI -#endif // _WIN32 +#define KEYVALUE_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace diagnostic_msgs { + namespace msg { + + + /*! * @brief This class represents the structure KeyValue defined by the user in the IDL file. - * @ingroup KEYVALUE + * @ingroup KeyValue */ -class KeyValue { +class KeyValue +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport KeyValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~KeyValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. - */ - eProsima_user_DllExport KeyValue(const KeyValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. - */ - eProsima_user_DllExport KeyValue(KeyValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. - */ - eProsima_user_DllExport KeyValue& operator=(const KeyValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. - */ - eProsima_user_DllExport KeyValue& operator=(KeyValue&& x); - - /*! - * @brief Comparison operator. - * @param x diagnostic_msgs::msg::KeyValue object to compare. - */ - eProsima_user_DllExport bool operator==(const KeyValue& x) const; - - /*! - * @brief Comparison operator. - * @param x diagnostic_msgs::msg::KeyValue object to compare. - */ - eProsima_user_DllExport bool operator!=(const KeyValue& x) const; - - /*! - * @brief This function copies the value in member key - * @param _key New value to be copied in member key - */ - eProsima_user_DllExport void key(const std::string& _key); - - /*! - * @brief This function moves the value in member key - * @param _key New value to be moved in member key - */ - eProsima_user_DllExport void key(std::string&& _key); - - /*! - * @brief This function returns a constant reference to member key - * @return Constant reference to member key - */ - eProsima_user_DllExport const std::string& key() const; - - /*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ - eProsima_user_DllExport std::string& key(); - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value(const std::string& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value(std::string&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::string& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::string& value(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const diagnostic_msgs::msg::KeyValue& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport KeyValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~KeyValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. + */ + eProsima_user_DllExport KeyValue( + const KeyValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. + */ + eProsima_user_DllExport KeyValue( + KeyValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. + */ + eProsima_user_DllExport KeyValue& operator =( + const KeyValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object diagnostic_msgs::msg::KeyValue that will be copied. + */ + eProsima_user_DllExport KeyValue& operator =( + KeyValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x diagnostic_msgs::msg::KeyValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const KeyValue& x) const; + + /*! + * @brief Comparison operator. + * @param x diagnostic_msgs::msg::KeyValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const KeyValue& x) const; + + /*! + * @brief This function copies the value in member key + * @param _key New value to be copied in member key + */ + eProsima_user_DllExport void key( + const std::string& _key); + + /*! + * @brief This function moves the value in member key + * @param _key New value to be moved in member key + */ + eProsima_user_DllExport void key( + std::string&& _key); + + /*! + * @brief This function returns a constant reference to member key + * @return Constant reference to member key + */ + eProsima_user_DllExport const std::string& key() const; + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport std::string& key(); + + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::string& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::string&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::string& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::string& value(); private: - std::string m_key; - std::string m_value; + + std::string m_key; + std::string m_value; + }; -} // namespace msg -} // namespace diagnostic_msgs -#endif // _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_H_ \ No newline at end of file +} // namespace msg + +} // namespace diagnostic_msgs + +#endif // _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValueCdrAux.hpp new file mode 100644 index 00000000000..3d552a173e0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValueCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUECDRAUX_HPP_ + +#include "KeyValue.h" + +constexpr uint32_t diagnostic_msgs_msg_KeyValue_max_cdr_typesize {524UL}; +constexpr uint32_t diagnostic_msgs_msg_KeyValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const diagnostic_msgs::msg::KeyValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValueCdrAux.ipp new file mode 100644 index 00000000000..4d41fd8bc87 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValueCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUECDRAUX_IPP_ + +#include "KeyValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const diagnostic_msgs::msg::KeyValue& data, + size_t& current_alignment) +{ + using namespace diagnostic_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.key(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const diagnostic_msgs::msg::KeyValue& data) +{ + using namespace diagnostic_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.key() + << eprosima::fastcdr::MemberId(1) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + diagnostic_msgs::msg::KeyValue& data) +{ + using namespace diagnostic_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.key(); + break; + + case 1: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const diagnostic_msgs::msg::KeyValue& data) +{ + using namespace diagnostic_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.cxx index 1ef029471c8..e7283e64618 100644 --- a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file KeyValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "KeyValuePubSubTypes.h" +#include "KeyValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace diagnostic_msgs { - namespace msg { - KeyValuePubSubType::KeyValuePubSubType() - { - setName("diagnostic_msgs::msg::dds_::KeyValue_"); - auto type_size = KeyValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = KeyValue::isKeyDefined(); - size_t keyLength = KeyValue::getKeyMaxCdrSerializedSize() > 16 ? - KeyValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - KeyValuePubSubType::~KeyValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool KeyValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - KeyValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool KeyValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - KeyValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function KeyValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* KeyValuePubSubType::createData() - { - return reinterpret_cast(new KeyValue()); - } - - void KeyValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool KeyValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - KeyValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - KeyValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || KeyValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +KeyValuePubSubType::KeyValuePubSubType() +{ + setName("diagnostic_msgs::msg::dds_::KeyValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(KeyValue::getMaxCdrSerializedSize()); +#else + diagnostic_msgs_msg_KeyValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +KeyValuePubSubType::~KeyValuePubSubType() +{ +} + +bool KeyValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + KeyValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool KeyValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + KeyValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function KeyValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* KeyValuePubSubType::createData() +{ + return reinterpret_cast(new KeyValue()); +} + +void KeyValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool KeyValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace diagnostic_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.h index c8294a09b09..1a4c072f66a 100644 --- a/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/diagnostic_msgs/msg/KeyValuePubSubTypes.h @@ -16,76 +16,120 @@ * @file KeyValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "KeyValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated KeyValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated KeyValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace diagnostic_msgs { namespace msg { + + + /*! * @brief This class represents the TopicDataType of the type KeyValue defined by the user in the IDL file. - * @ingroup KEYVALUE + * @ingroup KeyValue */ -class KeyValuePubSubType : public eprosima::fastdds::dds::TopicDataType { +class KeyValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef KeyValue type; - eProsima_user_DllExport KeyValuePubSubType(); + typedef KeyValue type; + + eProsima_user_DllExport KeyValuePubSubType(); - eProsima_user_DllExport virtual ~KeyValuePubSubType(); + eProsima_user_DllExport ~KeyValuePubSubType() override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; }; } // namespace msg } // namespace diagnostic_msgs -#endif // _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DIAGNOSTIC_MSGS_MSG_KEYVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.cxx index 01057ba7cc3..2f15546539e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.cxx @@ -14,9 +14,9 @@ /*! * @file AccelerationConfidence.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "AccelerationConfidence.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace AccelerationConfidence_Constants { +} // namespace AccelerationConfidence_Constants -etsi_its_cam_msgs::msg::AccelerationConfidence::AccelerationConfidence() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@488b50ec - m_value = 0; +AccelerationConfidence::AccelerationConfidence() +{ } -etsi_its_cam_msgs::msg::AccelerationConfidence::~AccelerationConfidence() +AccelerationConfidence::~AccelerationConfidence() { } -etsi_its_cam_msgs::msg::AccelerationConfidence::AccelerationConfidence( +AccelerationConfidence::AccelerationConfidence( const AccelerationConfidence& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::AccelerationConfidence::AccelerationConfidence( - AccelerationConfidence&& x) +AccelerationConfidence::AccelerationConfidence( + AccelerationConfidence&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::AccelerationConfidence::operator =( +AccelerationConfidence& AccelerationConfidence::operator =( const AccelerationConfidence& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::AccelerationConfidence::operator =( - AccelerationConfidence&& x) +AccelerationConfidence& AccelerationConfidence::operator =( + AccelerationConfidence&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::AccelerationConfidence::operator ==( +bool AccelerationConfidence::operator ==( const AccelerationConfidence& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::AccelerationConfidence::operator !=( +bool AccelerationConfidence::operator !=( const AccelerationConfidence& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::AccelerationConfidence::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::AccelerationConfidence::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::AccelerationConfidence& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::AccelerationConfidence::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::AccelerationConfidence::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::AccelerationConfidence::value( +void AccelerationConfidence::value( uint8_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::AccelerationConfidence::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::AccelerationConfidence::value() const +uint8_t AccelerationConfidence::value() const { return m_value; } @@ -158,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::AccelerationConfidence::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::AccelerationConfidence::value() +uint8_t& AccelerationConfidence::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::AccelerationConfidence::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::AccelerationConfidence::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::AccelerationConfidence::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AccelerationConfidenceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.h index 77772770cf0..75ed7d561d0 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidence.h @@ -16,19 +16,24 @@ * @file AccelerationConfidence.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(AccelerationConfidence_SOURCE) -#define AccelerationConfidence_DllAPI __declspec( dllexport ) +#if defined(ACCELERATIONCONFIDENCE_SOURCE) +#define ACCELERATIONCONFIDENCE_DllAPI __declspec( dllexport ) #else -#define AccelerationConfidence_DllAPI __declspec( dllimport ) -#endif // AccelerationConfidence_SOURCE +#define ACCELERATIONCONFIDENCE_DllAPI __declspec( dllimport ) +#endif // ACCELERATIONCONFIDENCE_SOURCE #else -#define AccelerationConfidence_DllAPI +#define ACCELERATIONCONFIDENCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define AccelerationConfidence_DllAPI +#define ACCELERATIONCONFIDENCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace AccelerationConfidence_Constants { - const uint8_t MIN = 0; - const uint8_t MAX = 102; - const uint8_t POINT_ONE_METER_PER_SEC_SQUARED = 1; - const uint8_t OUT_OF_RANGE = 101; - const uint8_t UNAVAILABLE = 102; - } // namespace AccelerationConfidence_Constants - /*! - * @brief This class represents the structure AccelerationConfidence defined by the user in the IDL file. - * @ingroup ACCELERATIONCONFIDENCE - */ - class AccelerationConfidence - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AccelerationConfidence(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AccelerationConfidence(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. - */ - eProsima_user_DllExport AccelerationConfidence( - const AccelerationConfidence& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. - */ - eProsima_user_DllExport AccelerationConfidence( - AccelerationConfidence&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. - */ - eProsima_user_DllExport AccelerationConfidence& operator =( - const AccelerationConfidence& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. - */ - eProsima_user_DllExport AccelerationConfidence& operator =( - AccelerationConfidence&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::AccelerationConfidence object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AccelerationConfidence& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::AccelerationConfidence object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AccelerationConfidence& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::AccelerationConfidence& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace AccelerationConfidence_Constants { + +const uint8_t MIN = 0; +const uint8_t MAX = 102; +const uint8_t POINT_ONE_METER_PER_SEC_SQUARED = 1; +const uint8_t OUT_OF_RANGE = 101; +const uint8_t UNAVAILABLE = 102; + +} // namespace AccelerationConfidence_Constants + + +/*! + * @brief This class represents the structure AccelerationConfidence defined by the user in the IDL file. + * @ingroup AccelerationConfidence + */ +class AccelerationConfidence +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AccelerationConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AccelerationConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. + */ + eProsima_user_DllExport AccelerationConfidence( + const AccelerationConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. + */ + eProsima_user_DllExport AccelerationConfidence( + AccelerationConfidence&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. + */ + eProsima_user_DllExport AccelerationConfidence& operator =( + const AccelerationConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationConfidence that will be copied. + */ + eProsima_user_DllExport AccelerationConfidence& operator =( + AccelerationConfidence&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AccelerationConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AccelerationConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AccelerationConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AccelerationConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidenceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidenceCdrAux.hpp new file mode 100644 index 00000000000..d3cb92fb844 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidenceCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationConfidenceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCECDRAUX_HPP_ + +#include "AccelerationConfidence.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_AccelerationConfidence_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_AccelerationConfidence_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AccelerationConfidence& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidenceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidenceCdrAux.ipp new file mode 100644 index 00000000000..f98135584df --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidenceCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationConfidenceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCECDRAUX_IPP_ + +#include "AccelerationConfidenceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::AccelerationConfidence& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AccelerationConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::AccelerationConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AccelerationConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.cxx index 364f536aaea..932212071dc 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file AccelerationConfidencePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AccelerationConfidencePubSubTypes.h" +#include "AccelerationConfidenceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace AccelerationConfidence_Constants { - - - - - - - } //End of namespace AccelerationConfidence_Constants - AccelerationConfidencePubSubType::AccelerationConfidencePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::AccelerationConfidence_"); - auto type_size = AccelerationConfidence::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = AccelerationConfidence::isKeyDefined(); - size_t keyLength = AccelerationConfidence::getKeyMaxCdrSerializedSize() > 16 ? - AccelerationConfidence::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - AccelerationConfidencePubSubType::~AccelerationConfidencePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool AccelerationConfidencePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - AccelerationConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AccelerationConfidencePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - AccelerationConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AccelerationConfidencePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AccelerationConfidencePubSubType::createData() - { - return reinterpret_cast(new AccelerationConfidence()); - } - - void AccelerationConfidencePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AccelerationConfidencePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - AccelerationConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AccelerationConfidence::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || AccelerationConfidence::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace AccelerationConfidence_Constants { + + + + + + + + + + + +} //End of namespace AccelerationConfidence_Constants + + + +AccelerationConfidencePubSubType::AccelerationConfidencePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::AccelerationConfidence_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AccelerationConfidence::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_AccelerationConfidence_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AccelerationConfidencePubSubType::~AccelerationConfidencePubSubType() +{ +} + +bool AccelerationConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AccelerationConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AccelerationConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AccelerationConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AccelerationConfidencePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AccelerationConfidencePubSubType::createData() +{ + return reinterpret_cast(new AccelerationConfidence()); +} + +void AccelerationConfidencePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AccelerationConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.h index d8b8905bb0c..2f47d89b1bd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationConfidencePubSubTypes.h @@ -16,100 +16,132 @@ * @file AccelerationConfidencePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "AccelerationConfidence.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated AccelerationConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace AccelerationConfidence_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace AccelerationConfidence_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type AccelerationConfidence defined by the user in the IDL file. - * @ingroup ACCELERATIONCONFIDENCE - */ - class AccelerationConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef AccelerationConfidence type; +} // namespace AccelerationConfidence_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type AccelerationConfidence defined by the user in the IDL file. + * @ingroup AccelerationConfidence + */ +class AccelerationConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AccelerationConfidence type; + + eProsima_user_DllExport AccelerationConfidencePubSubType(); - eProsima_user_DllExport AccelerationConfidencePubSubType(); + eProsima_user_DllExport ~AccelerationConfidencePubSubType() override; - eProsima_user_DllExport virtual ~AccelerationConfidencePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) AccelerationConfidence(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONFIDENCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.cxx index c383be637fc..3ad9c3cd699 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.cxx @@ -14,9 +14,9 @@ /*! * @file AccelerationControl.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,148 +27,84 @@ char dummy; #endif // _WIN32 #include "AccelerationControl.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace AccelerationControl_Constants { +} // namespace AccelerationControl_Constants - - -etsi_its_cam_msgs::msg::AccelerationControl::AccelerationControl() +AccelerationControl::AccelerationControl() { - // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@7fab4be7 - - // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@a64e035 - m_bits_unused = 0; - } -etsi_its_cam_msgs::msg::AccelerationControl::~AccelerationControl() +AccelerationControl::~AccelerationControl() { - } -etsi_its_cam_msgs::msg::AccelerationControl::AccelerationControl( +AccelerationControl::AccelerationControl( const AccelerationControl& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::AccelerationControl::AccelerationControl( - AccelerationControl&& x) +AccelerationControl::AccelerationControl( + AccelerationControl&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::AccelerationControl::operator =( +AccelerationControl& AccelerationControl::operator =( const AccelerationControl& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; - return *this; } -etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::AccelerationControl::operator =( - AccelerationControl&& x) +AccelerationControl& AccelerationControl::operator =( + AccelerationControl&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; - return *this; } -bool etsi_its_cam_msgs::msg::AccelerationControl::operator ==( +bool AccelerationControl::operator ==( const AccelerationControl& x) const { - - return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); + return (m_value == x.m_value && + m_bits_unused == x.m_bits_unused); } -bool etsi_its_cam_msgs::msg::AccelerationControl::operator !=( +bool AccelerationControl::operator !=( const AccelerationControl& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::AccelerationControl::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::AccelerationControl::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::AccelerationControl& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.value().size() > 0) - { - current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::AccelerationControl::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - scdr << m_bits_unused; - -} - -void etsi_its_cam_msgs::msg::AccelerationControl::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; - dcdr >> m_bits_unused; -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void etsi_its_cam_msgs::msg::AccelerationControl::value( +void AccelerationControl::value( const std::vector& _value) { m_value = _value; @@ -178,7 +114,7 @@ void etsi_its_cam_msgs::msg::AccelerationControl::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void etsi_its_cam_msgs::msg::AccelerationControl::value( +void AccelerationControl::value( std::vector&& _value) { m_value = std::move(_value); @@ -188,7 +124,7 @@ void etsi_its_cam_msgs::msg::AccelerationControl::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::vector& etsi_its_cam_msgs::msg::AccelerationControl::value() const +const std::vector& AccelerationControl::value() const { return m_value; } @@ -197,15 +133,17 @@ const std::vector& etsi_its_cam_msgs::msg::AccelerationControl::value() * @brief This function returns a reference to member value * @return Reference to member value */ -std::vector& etsi_its_cam_msgs::msg::AccelerationControl::value() +std::vector& AccelerationControl::value() { return m_value; } + + /*! * @brief This function sets a value in member bits_unused * @param _bits_unused New value for member bits_unused */ -void etsi_its_cam_msgs::msg::AccelerationControl::bits_unused( +void AccelerationControl::bits_unused( uint8_t _bits_unused) { m_bits_unused = _bits_unused; @@ -215,7 +153,7 @@ void etsi_its_cam_msgs::msg::AccelerationControl::bits_unused( * @brief This function returns the value of member bits_unused * @return Value of member bits_unused */ -uint8_t etsi_its_cam_msgs::msg::AccelerationControl::bits_unused() const +uint8_t AccelerationControl::bits_unused() const { return m_bits_unused; } @@ -224,32 +162,18 @@ uint8_t etsi_its_cam_msgs::msg::AccelerationControl::bits_unused() const * @brief This function returns a reference to member bits_unused * @return Reference to member bits_unused */ -uint8_t& etsi_its_cam_msgs::msg::AccelerationControl::bits_unused() +uint8_t& AccelerationControl::bits_unused() { return m_bits_unused; } -size_t etsi_its_cam_msgs::msg::AccelerationControl::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::AccelerationControl::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::AccelerationControl::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AccelerationControlCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.h index 752a9644c16..16b760bb5c8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControl.h @@ -16,19 +16,24 @@ * @file AccelerationControl.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,205 +47,163 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(AccelerationControl_SOURCE) -#define AccelerationControl_DllAPI __declspec( dllexport ) +#if defined(ACCELERATIONCONTROL_SOURCE) +#define ACCELERATIONCONTROL_DllAPI __declspec( dllexport ) #else -#define AccelerationControl_DllAPI __declspec( dllimport ) -#endif // AccelerationControl_SOURCE +#define ACCELERATIONCONTROL_DllAPI __declspec( dllimport ) +#endif // ACCELERATIONCONTROL_SOURCE #else -#define AccelerationControl_DllAPI +#define ACCELERATIONCONTROL_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define AccelerationControl_DllAPI +#define ACCELERATIONCONTROL_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace AccelerationControl_Constants { - const uint8_t SIZE_BITS = 7; - const uint8_t BIT_INDEX_BRAKE_PEDAL_ENGAGED = 0; - const uint8_t BIT_INDEX_GAS_PEDAL_ENGAGED = 1; - const uint8_t BIT_INDEX_EMERGENCY_BRAKE_ENGAGED = 2; - const uint8_t BIT_INDEX_COLLISION_WARNING_ENGAGED = 3; - const uint8_t BIT_INDEX_ACC_ENGAGED = 4; - const uint8_t BIT_INDEX_CRUISE_CONTROL_ENGAGED = 5; - const uint8_t BIT_INDEX_SPEED_LIMITER_ENGAGED = 6; - } // namespace AccelerationControl_Constants - /*! - * @brief This class represents the structure AccelerationControl defined by the user in the IDL file. - * @ingroup ACCELERATIONCONTROL - */ - class AccelerationControl - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AccelerationControl(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AccelerationControl(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. - */ - eProsima_user_DllExport AccelerationControl( - const AccelerationControl& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. - */ - eProsima_user_DllExport AccelerationControl( - AccelerationControl&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. - */ - eProsima_user_DllExport AccelerationControl& operator =( - const AccelerationControl& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. - */ - eProsima_user_DllExport AccelerationControl& operator =( - AccelerationControl&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::AccelerationControl object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AccelerationControl& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::AccelerationControl object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AccelerationControl& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::vector& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::vector&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::vector& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::vector& value(); - /*! - * @brief This function sets a value in member bits_unused - * @param _bits_unused New value for member bits_unused - */ - eProsima_user_DllExport void bits_unused( - uint8_t _bits_unused); - - /*! - * @brief This function returns the value of member bits_unused - * @return Value of member bits_unused - */ - eProsima_user_DllExport uint8_t bits_unused() const; - - /*! - * @brief This function returns a reference to member bits_unused - * @return Reference to member bits_unused - */ - eProsima_user_DllExport uint8_t& bits_unused(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::AccelerationControl& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_value; - uint8_t m_bits_unused; - }; - } // namespace msg + +namespace msg { + +namespace AccelerationControl_Constants { + +const uint8_t SIZE_BITS = 7; +const uint8_t BIT_INDEX_BRAKE_PEDAL_ENGAGED = 0; +const uint8_t BIT_INDEX_GAS_PEDAL_ENGAGED = 1; +const uint8_t BIT_INDEX_EMERGENCY_BRAKE_ENGAGED = 2; +const uint8_t BIT_INDEX_COLLISION_WARNING_ENGAGED = 3; +const uint8_t BIT_INDEX_ACC_ENGAGED = 4; +const uint8_t BIT_INDEX_CRUISE_CONTROL_ENGAGED = 5; +const uint8_t BIT_INDEX_SPEED_LIMITER_ENGAGED = 6; + +} // namespace AccelerationControl_Constants + + +/*! + * @brief This class represents the structure AccelerationControl defined by the user in the IDL file. + * @ingroup AccelerationControl + */ +class AccelerationControl +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AccelerationControl(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AccelerationControl(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. + */ + eProsima_user_DllExport AccelerationControl( + const AccelerationControl& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. + */ + eProsima_user_DllExport AccelerationControl( + AccelerationControl&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. + */ + eProsima_user_DllExport AccelerationControl& operator =( + const AccelerationControl& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AccelerationControl that will be copied. + */ + eProsima_user_DllExport AccelerationControl& operator =( + AccelerationControl&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AccelerationControl object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AccelerationControl& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AccelerationControl object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AccelerationControl& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + + + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + +private: + + std::vector m_value; + uint8_t m_bits_unused{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlCdrAux.hpp new file mode 100644 index 00000000000..a7900a9d01e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlCdrAux.hpp @@ -0,0 +1,67 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationControlCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROLCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROLCDRAUX_HPP_ + +#include "AccelerationControl.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_AccelerationControl_max_cdr_typesize {109UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_AccelerationControl_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AccelerationControl& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROLCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlCdrAux.ipp new file mode 100644 index 00000000000..47831a367f0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlCdrAux.ipp @@ -0,0 +1,155 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelerationControlCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROLCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROLCDRAUX_IPP_ + +#include "AccelerationControlCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::AccelerationControl& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bits_unused(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AccelerationControl& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() + << eprosima::fastcdr::MemberId(1) << data.bits_unused() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::AccelerationControl& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + case 1: + dcdr >> data.bits_unused(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AccelerationControl& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROLCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.cxx index 5c820a04f00..88a4bf20b3b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.cxx @@ -16,172 +16,203 @@ * @file AccelerationControlPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AccelerationControlPubSubTypes.h" +#include "AccelerationControlCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace AccelerationControl_Constants { - - - - - - - - - - } //End of namespace AccelerationControl_Constants - AccelerationControlPubSubType::AccelerationControlPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::AccelerationControl_"); - auto type_size = AccelerationControl::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = AccelerationControl::isKeyDefined(); - size_t keyLength = AccelerationControl::getKeyMaxCdrSerializedSize() > 16 ? - AccelerationControl::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - AccelerationControlPubSubType::~AccelerationControlPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool AccelerationControlPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - AccelerationControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AccelerationControlPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - AccelerationControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AccelerationControlPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AccelerationControlPubSubType::createData() - { - return reinterpret_cast(new AccelerationControl()); - } - - void AccelerationControlPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AccelerationControlPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - AccelerationControl* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AccelerationControl::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || AccelerationControl::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace AccelerationControl_Constants { + + + + + + + + + + + + + + + + + +} //End of namespace AccelerationControl_Constants + + + +AccelerationControlPubSubType::AccelerationControlPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::AccelerationControl_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AccelerationControl::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_AccelerationControl_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AccelerationControlPubSubType::~AccelerationControlPubSubType() +{ +} + +bool AccelerationControlPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AccelerationControl* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AccelerationControlPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AccelerationControl* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AccelerationControlPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AccelerationControlPubSubType::createData() +{ + return reinterpret_cast(new AccelerationControl()); +} + +void AccelerationControlPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AccelerationControlPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.h index e3209bc69bf..52136ff642a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AccelerationControlPubSubTypes.h @@ -16,29 +16,32 @@ * @file AccelerationControlPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "AccelerationControl.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated AccelerationControl is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace AccelerationControl_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace AccelerationControl_Constants { @@ -47,72 +50,104 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type AccelerationControl defined by the user in the IDL file. - * @ingroup ACCELERATIONCONTROL - */ - class AccelerationControlPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef AccelerationControl type; - eProsima_user_DllExport AccelerationControlPubSubType(); - eProsima_user_DllExport virtual ~AccelerationControlPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; +} // namespace AccelerationControl_Constants - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +/*! + * @brief This class represents the TopicDataType of the type AccelerationControl defined by the user in the IDL file. + * @ingroup AccelerationControl + */ +class AccelerationControlPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + typedef AccelerationControl type; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport AccelerationControlPubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport ~AccelerationControlPubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ACCELERATIONCONTROL_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.cxx index 46655cfa36f..fb03785e0ce 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.cxx @@ -14,9 +14,9 @@ /*! * @file Altitude.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "Altitude.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::Altitude::Altitude() -{ - // m_altitude_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@476a736d - // m_altitude_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5f80fa43 +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::Altitude::~Altitude() +Altitude::Altitude() { +} +Altitude::~Altitude() +{ } -etsi_its_cam_msgs::msg::Altitude::Altitude( +Altitude::Altitude( const Altitude& x) { m_altitude_value = x.m_altitude_value; m_altitude_confidence = x.m_altitude_confidence; } -etsi_its_cam_msgs::msg::Altitude::Altitude( - Altitude&& x) +Altitude::Altitude( + Altitude&& x) noexcept { m_altitude_value = std::move(x.m_altitude_value); m_altitude_confidence = std::move(x.m_altitude_confidence); } -etsi_its_cam_msgs::msg::Altitude& etsi_its_cam_msgs::msg::Altitude::operator =( +Altitude& Altitude::operator =( const Altitude& x) { m_altitude_value = x.m_altitude_value; m_altitude_confidence = x.m_altitude_confidence; - return *this; } -etsi_its_cam_msgs::msg::Altitude& etsi_its_cam_msgs::msg::Altitude::operator =( - Altitude&& x) +Altitude& Altitude::operator =( + Altitude&& x) noexcept { m_altitude_value = std::move(x.m_altitude_value); m_altitude_confidence = std::move(x.m_altitude_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::Altitude::operator ==( +bool Altitude::operator ==( const Altitude& x) const { - - return (m_altitude_value == x.m_altitude_value && m_altitude_confidence == x.m_altitude_confidence); + return (m_altitude_value == x.m_altitude_value && + m_altitude_confidence == x.m_altitude_confidence); } -bool etsi_its_cam_msgs::msg::Altitude::operator !=( +bool Altitude::operator !=( const Altitude& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::Altitude::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::AltitudeValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AltitudeConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::Altitude::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Altitude& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::AltitudeValue::getCdrSerializedSize(data.altitude_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AltitudeConfidence::getCdrSerializedSize(data.altitude_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::Altitude::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_altitude_value; - scdr << m_altitude_confidence; - -} - -void etsi_its_cam_msgs::msg::Altitude::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_altitude_value; - dcdr >> m_altitude_confidence; -} - /*! * @brief This function copies the value in member altitude_value * @param _altitude_value New value to be copied in member altitude_value */ -void etsi_its_cam_msgs::msg::Altitude::altitude_value( +void Altitude::altitude_value( const etsi_its_cam_msgs::msg::AltitudeValue& _altitude_value) { m_altitude_value = _altitude_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::Altitude::altitude_value( * @brief This function moves the value in member altitude_value * @param _altitude_value New value to be moved in member altitude_value */ -void etsi_its_cam_msgs::msg::Altitude::altitude_value( +void Altitude::altitude_value( etsi_its_cam_msgs::msg::AltitudeValue&& _altitude_value) { m_altitude_value = std::move(_altitude_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::Altitude::altitude_value( * @brief This function returns a constant reference to member altitude_value * @return Constant reference to member altitude_value */ -const etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::Altitude::altitude_value() const +const etsi_its_cam_msgs::msg::AltitudeValue& Altitude::altitude_value() const { return m_altitude_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::Altitude::a * @brief This function returns a reference to member altitude_value * @return Reference to member altitude_value */ -etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::Altitude::altitude_value() +etsi_its_cam_msgs::msg::AltitudeValue& Altitude::altitude_value() { return m_altitude_value; } + + /*! * @brief This function copies the value in member altitude_confidence * @param _altitude_confidence New value to be copied in member altitude_confidence */ -void etsi_its_cam_msgs::msg::Altitude::altitude_confidence( +void Altitude::altitude_confidence( const etsi_its_cam_msgs::msg::AltitudeConfidence& _altitude_confidence) { m_altitude_confidence = _altitude_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::Altitude::altitude_confidence( * @brief This function moves the value in member altitude_confidence * @param _altitude_confidence New value to be moved in member altitude_confidence */ -void etsi_its_cam_msgs::msg::Altitude::altitude_confidence( +void Altitude::altitude_confidence( etsi_its_cam_msgs::msg::AltitudeConfidence&& _altitude_confidence) { m_altitude_confidence = std::move(_altitude_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::Altitude::altitude_confidence( * @brief This function returns a constant reference to member altitude_confidence * @return Constant reference to member altitude_confidence */ -const etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::Altitude::altitude_confidence() const +const etsi_its_cam_msgs::msg::AltitudeConfidence& Altitude::altitude_confidence() const { return m_altitude_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::Altitu * @brief This function returns a reference to member altitude_confidence * @return Reference to member altitude_confidence */ -etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::Altitude::altitude_confidence() +etsi_its_cam_msgs::msg::AltitudeConfidence& Altitude::altitude_confidence() { return m_altitude_confidence; } -size_t etsi_its_cam_msgs::msg::Altitude::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::Altitude::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::Altitude::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AltitudeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.h index 7ca4d3a2a24..dd65a6f29bf 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Altitude.h @@ -16,21 +16,26 @@ * @file Altitude.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_H_ -#include "AltitudeConfidence.h" -#include "AltitudeValue.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "AltitudeConfidence.h" +#include "AltitudeValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Altitude_SOURCE) -#define Altitude_DllAPI __declspec( dllexport ) +#if defined(ALTITUDE_SOURCE) +#define ALTITUDE_DllAPI __declspec( dllexport ) #else -#define Altitude_DllAPI __declspec( dllimport ) -#endif // Altitude_SOURCE +#define ALTITUDE_DllAPI __declspec( dllimport ) +#endif // ALTITUDE_SOURCE #else -#define Altitude_DllAPI +#define ALTITUDE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Altitude_DllAPI +#define ALTITUDE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure Altitude defined by the user in the IDL file. - * @ingroup ALTITUDE - */ - class Altitude - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Altitude(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Altitude(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. - */ - eProsima_user_DllExport Altitude( - const Altitude& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. - */ - eProsima_user_DllExport Altitude( - Altitude&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. - */ - eProsima_user_DllExport Altitude& operator =( - const Altitude& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. - */ - eProsima_user_DllExport Altitude& operator =( - Altitude&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Altitude object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Altitude& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Altitude object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Altitude& x) const; - - /*! - * @brief This function copies the value in member altitude_value - * @param _altitude_value New value to be copied in member altitude_value - */ - eProsima_user_DllExport void altitude_value( - const etsi_its_cam_msgs::msg::AltitudeValue& _altitude_value); - - /*! - * @brief This function moves the value in member altitude_value - * @param _altitude_value New value to be moved in member altitude_value - */ - eProsima_user_DllExport void altitude_value( - etsi_its_cam_msgs::msg::AltitudeValue&& _altitude_value); - - /*! - * @brief This function returns a constant reference to member altitude_value - * @return Constant reference to member altitude_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::AltitudeValue& altitude_value() const; - - /*! - * @brief This function returns a reference to member altitude_value - * @return Reference to member altitude_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::AltitudeValue& altitude_value(); - /*! - * @brief This function copies the value in member altitude_confidence - * @param _altitude_confidence New value to be copied in member altitude_confidence - */ - eProsima_user_DllExport void altitude_confidence( - const etsi_its_cam_msgs::msg::AltitudeConfidence& _altitude_confidence); - - /*! - * @brief This function moves the value in member altitude_confidence - * @param _altitude_confidence New value to be moved in member altitude_confidence - */ - eProsima_user_DllExport void altitude_confidence( - etsi_its_cam_msgs::msg::AltitudeConfidence&& _altitude_confidence); - - /*! - * @brief This function returns a constant reference to member altitude_confidence - * @return Constant reference to member altitude_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::AltitudeConfidence& altitude_confidence() const; - - /*! - * @brief This function returns a reference to member altitude_confidence - * @return Reference to member altitude_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::AltitudeConfidence& altitude_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Altitude& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::AltitudeValue m_altitude_value; - etsi_its_cam_msgs::msg::AltitudeConfidence m_altitude_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Altitude defined by the user in the IDL file. + * @ingroup Altitude + */ +class Altitude +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Altitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Altitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. + */ + eProsima_user_DllExport Altitude( + const Altitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. + */ + eProsima_user_DllExport Altitude( + Altitude&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. + */ + eProsima_user_DllExport Altitude& operator =( + const Altitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Altitude that will be copied. + */ + eProsima_user_DllExport Altitude& operator =( + Altitude&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Altitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Altitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Altitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Altitude& x) const; + + /*! + * @brief This function copies the value in member altitude_value + * @param _altitude_value New value to be copied in member altitude_value + */ + eProsima_user_DllExport void altitude_value( + const etsi_its_cam_msgs::msg::AltitudeValue& _altitude_value); + + /*! + * @brief This function moves the value in member altitude_value + * @param _altitude_value New value to be moved in member altitude_value + */ + eProsima_user_DllExport void altitude_value( + etsi_its_cam_msgs::msg::AltitudeValue&& _altitude_value); + + /*! + * @brief This function returns a constant reference to member altitude_value + * @return Constant reference to member altitude_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AltitudeValue& altitude_value() const; + + /*! + * @brief This function returns a reference to member altitude_value + * @return Reference to member altitude_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AltitudeValue& altitude_value(); + + + /*! + * @brief This function copies the value in member altitude_confidence + * @param _altitude_confidence New value to be copied in member altitude_confidence + */ + eProsima_user_DllExport void altitude_confidence( + const etsi_its_cam_msgs::msg::AltitudeConfidence& _altitude_confidence); + + /*! + * @brief This function moves the value in member altitude_confidence + * @param _altitude_confidence New value to be moved in member altitude_confidence + */ + eProsima_user_DllExport void altitude_confidence( + etsi_its_cam_msgs::msg::AltitudeConfidence&& _altitude_confidence); + + /*! + * @brief This function returns a constant reference to member altitude_confidence + * @return Constant reference to member altitude_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AltitudeConfidence& altitude_confidence() const; + + /*! + * @brief This function returns a reference to member altitude_confidence + * @return Reference to member altitude_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AltitudeConfidence& altitude_confidence(); + +private: + + etsi_its_cam_msgs::msg::AltitudeValue m_altitude_value; + etsi_its_cam_msgs::msg::AltitudeConfidence m_altitude_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeCdrAux.hpp new file mode 100644 index 00000000000..4aa420c01d9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECDRAUX_HPP_ + +#include "Altitude.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_Altitude_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_Altitude_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Altitude& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeCdrAux.ipp new file mode 100644 index 00000000000..e11a6727863 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECDRAUX_IPP_ + +#include "AltitudeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::Altitude& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.altitude_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.altitude_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Altitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.altitude_value() + << eprosima::fastcdr::MemberId(1) << data.altitude_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::Altitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.altitude_value(); + break; + + case 1: + dcdr >> data.altitude_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Altitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.cxx index 56d8de4d586..edff54a059b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.cxx @@ -14,9 +14,9 @@ /*! * @file AltitudeConfidence.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,130 +27,79 @@ char dummy; #endif // _WIN32 #include "AltitudeConfidence.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace AltitudeConfidence_Constants { +} // namespace AltitudeConfidence_Constants - - - - - - - - - - -etsi_its_cam_msgs::msg::AltitudeConfidence::AltitudeConfidence() +AltitudeConfidence::AltitudeConfidence() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@540dbda9 - m_value = 0; - } -etsi_its_cam_msgs::msg::AltitudeConfidence::~AltitudeConfidence() +AltitudeConfidence::~AltitudeConfidence() { } -etsi_its_cam_msgs::msg::AltitudeConfidence::AltitudeConfidence( +AltitudeConfidence::AltitudeConfidence( const AltitudeConfidence& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::AltitudeConfidence::AltitudeConfidence( - AltitudeConfidence&& x) +AltitudeConfidence::AltitudeConfidence( + AltitudeConfidence&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::AltitudeConfidence::operator =( +AltitudeConfidence& AltitudeConfidence::operator =( const AltitudeConfidence& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::AltitudeConfidence& etsi_its_cam_msgs::msg::AltitudeConfidence::operator =( - AltitudeConfidence&& x) +AltitudeConfidence& AltitudeConfidence::operator =( + AltitudeConfidence&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::AltitudeConfidence::operator ==( +bool AltitudeConfidence::operator ==( const AltitudeConfidence& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::AltitudeConfidence::operator !=( +bool AltitudeConfidence::operator !=( const AltitudeConfidence& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::AltitudeConfidence::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::AltitudeConfidence::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::AltitudeConfidence& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::AltitudeConfidence::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::AltitudeConfidence::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::AltitudeConfidence::value( +void AltitudeConfidence::value( uint8_t _value) { m_value = _value; @@ -160,7 +109,7 @@ void etsi_its_cam_msgs::msg::AltitudeConfidence::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::AltitudeConfidence::value() const +uint8_t AltitudeConfidence::value() const { return m_value; } @@ -169,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::AltitudeConfidence::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::AltitudeConfidence::value() +uint8_t& AltitudeConfidence::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::AltitudeConfidence::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::AltitudeConfidence::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::AltitudeConfidence::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AltitudeConfidenceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.h index 0c35bb1ce82..3ef6e186e0b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidence.h @@ -16,19 +16,24 @@ * @file AltitudeConfidence.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,187 +47,143 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(AltitudeConfidence_SOURCE) -#define AltitudeConfidence_DllAPI __declspec( dllexport ) +#if defined(ALTITUDECONFIDENCE_SOURCE) +#define ALTITUDECONFIDENCE_DllAPI __declspec( dllexport ) #else -#define AltitudeConfidence_DllAPI __declspec( dllimport ) -#endif // AltitudeConfidence_SOURCE +#define ALTITUDECONFIDENCE_DllAPI __declspec( dllimport ) +#endif // ALTITUDECONFIDENCE_SOURCE #else -#define AltitudeConfidence_DllAPI +#define ALTITUDECONFIDENCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define AltitudeConfidence_DllAPI +#define ALTITUDECONFIDENCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace AltitudeConfidence_Constants { - const uint8_t ALT_000_01 = 0; - const uint8_t ALT_000_02 = 1; - const uint8_t ALT_000_05 = 2; - const uint8_t ALT_000_10 = 3; - const uint8_t ALT_000_20 = 4; - const uint8_t ALT_000_50 = 5; - const uint8_t ALT_001_00 = 6; - const uint8_t ALT_002_00 = 7; - const uint8_t ALT_005_00 = 8; - const uint8_t ALT_010_00 = 9; - const uint8_t ALT_020_00 = 10; - const uint8_t ALT_050_00 = 11; - const uint8_t ALT_100_00 = 12; - const uint8_t ALT_200_00 = 13; - const uint8_t OUT_OF_RANGE = 14; - const uint8_t UNAVAILABLE = 15; - } // namespace AltitudeConfidence_Constants - /*! - * @brief This class represents the structure AltitudeConfidence defined by the user in the IDL file. - * @ingroup ALTITUDECONFIDENCE - */ - class AltitudeConfidence - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AltitudeConfidence(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AltitudeConfidence(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. - */ - eProsima_user_DllExport AltitudeConfidence( - const AltitudeConfidence& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. - */ - eProsima_user_DllExport AltitudeConfidence( - AltitudeConfidence&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. - */ - eProsima_user_DllExport AltitudeConfidence& operator =( - const AltitudeConfidence& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. - */ - eProsima_user_DllExport AltitudeConfidence& operator =( - AltitudeConfidence&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::AltitudeConfidence object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AltitudeConfidence& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::AltitudeConfidence object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AltitudeConfidence& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::AltitudeConfidence& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace AltitudeConfidence_Constants { + +const uint8_t ALT_000_01 = 0; +const uint8_t ALT_000_02 = 1; +const uint8_t ALT_000_05 = 2; +const uint8_t ALT_000_10 = 3; +const uint8_t ALT_000_20 = 4; +const uint8_t ALT_000_50 = 5; +const uint8_t ALT_001_00 = 6; +const uint8_t ALT_002_00 = 7; +const uint8_t ALT_005_00 = 8; +const uint8_t ALT_010_00 = 9; +const uint8_t ALT_020_00 = 10; +const uint8_t ALT_050_00 = 11; +const uint8_t ALT_100_00 = 12; +const uint8_t ALT_200_00 = 13; +const uint8_t OUT_OF_RANGE = 14; +const uint8_t UNAVAILABLE = 15; + +} // namespace AltitudeConfidence_Constants + + +/*! + * @brief This class represents the structure AltitudeConfidence defined by the user in the IDL file. + * @ingroup AltitudeConfidence + */ +class AltitudeConfidence +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AltitudeConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AltitudeConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. + */ + eProsima_user_DllExport AltitudeConfidence( + const AltitudeConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. + */ + eProsima_user_DllExport AltitudeConfidence( + AltitudeConfidence&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. + */ + eProsima_user_DllExport AltitudeConfidence& operator =( + const AltitudeConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeConfidence that will be copied. + */ + eProsima_user_DllExport AltitudeConfidence& operator =( + AltitudeConfidence&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AltitudeConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AltitudeConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AltitudeConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AltitudeConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidenceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidenceCdrAux.hpp new file mode 100644 index 00000000000..a9ba6d1dd2b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidenceCdrAux.hpp @@ -0,0 +1,83 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeConfidenceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCECDRAUX_HPP_ + +#include "AltitudeConfidence.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_AltitudeConfidence_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_AltitudeConfidence_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AltitudeConfidence& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidenceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidenceCdrAux.ipp new file mode 100644 index 00000000000..21c2b7556ab --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidenceCdrAux.ipp @@ -0,0 +1,163 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeConfidenceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCECDRAUX_IPP_ + +#include "AltitudeConfidenceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::AltitudeConfidence& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AltitudeConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::AltitudeConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AltitudeConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.cxx index 4759559641f..f78d53f0838 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.cxx @@ -16,21 +16,38 @@ * @file AltitudeConfidencePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AltitudeConfidencePubSubTypes.h" +#include "AltitudeConfidenceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace AltitudeConfidence_Constants { +namespace msg { +namespace AltitudeConfidence_Constants { + + + + + + + + + + + + + @@ -48,148 +65,170 @@ namespace etsi_its_cam_msgs { - } //End of namespace AltitudeConfidence_Constants - AltitudeConfidencePubSubType::AltitudeConfidencePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::AltitudeConfidence_"); - auto type_size = AltitudeConfidence::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = AltitudeConfidence::isKeyDefined(); - size_t keyLength = AltitudeConfidence::getKeyMaxCdrSerializedSize() > 16 ? - AltitudeConfidence::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - AltitudeConfidencePubSubType::~AltitudeConfidencePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - bool AltitudeConfidencePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - AltitudeConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AltitudeConfidencePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - AltitudeConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AltitudeConfidencePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AltitudeConfidencePubSubType::createData() - { - return reinterpret_cast(new AltitudeConfidence()); - } - - void AltitudeConfidencePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AltitudeConfidencePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - AltitudeConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AltitudeConfidence::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || AltitudeConfidence::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + +} //End of namespace AltitudeConfidence_Constants + + + +AltitudeConfidencePubSubType::AltitudeConfidencePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::AltitudeConfidence_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AltitudeConfidence::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_AltitudeConfidence_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AltitudeConfidencePubSubType::~AltitudeConfidencePubSubType() +{ +} + +bool AltitudeConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AltitudeConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AltitudeConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AltitudeConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AltitudeConfidencePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AltitudeConfidencePubSubType::createData() +{ + return reinterpret_cast(new AltitudeConfidence()); +} + +void AltitudeConfidencePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AltitudeConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.h index c1fbf19f3b7..603c4444696 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeConfidencePubSubTypes.h @@ -16,29 +16,34 @@ * @file AltitudeConfidencePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "AltitudeConfidence.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated AltitudeConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace AltitudeConfidence_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace AltitudeConfidence_Constants { + + @@ -55,72 +60,110 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type AltitudeConfidence defined by the user in the IDL file. - * @ingroup ALTITUDECONFIDENCE - */ - class AltitudeConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef AltitudeConfidence type; - eProsima_user_DllExport AltitudeConfidencePubSubType(); - eProsima_user_DllExport virtual ~AltitudeConfidencePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) AltitudeConfidence(); - return true; - } +} // namespace AltitudeConfidence_Constants - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + +/*! + * @brief This class represents the TopicDataType of the type AltitudeConfidence defined by the user in the IDL file. + * @ingroup AltitudeConfidence + */ +class AltitudeConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AltitudeConfidence type; + + eProsima_user_DllExport AltitudeConfidencePubSubType(); + + eProsima_user_DllExport ~AltitudeConfidencePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDECONFIDENCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.cxx index a7a18adfcca..579a016a838 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file AltitudePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AltitudePubSubTypes.h" +#include "AltitudeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - AltitudePubSubType::AltitudePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::Altitude_"); - auto type_size = Altitude::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Altitude::isKeyDefined(); - size_t keyLength = Altitude::getKeyMaxCdrSerializedSize() > 16 ? - Altitude::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - AltitudePubSubType::~AltitudePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool AltitudePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Altitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AltitudePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Altitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AltitudePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AltitudePubSubType::createData() - { - return reinterpret_cast(new Altitude()); - } - - void AltitudePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AltitudePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Altitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Altitude::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Altitude::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +AltitudePubSubType::AltitudePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::Altitude_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Altitude::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_Altitude_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AltitudePubSubType::~AltitudePubSubType() +{ +} + +bool AltitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Altitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AltitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Altitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AltitudePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AltitudePubSubType::createData() +{ + return reinterpret_cast(new Altitude()); +} + +void AltitudePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AltitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.h index 7389ed241dc..5cd0c42a1b6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudePubSubTypes.h @@ -16,92 +16,122 @@ * @file AltitudePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Altitude.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "AltitudeConfidencePubSubTypes.h" +#include "AltitudeValuePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Altitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Altitude defined by the user in the IDL file. + * @ingroup Altitude + */ +class AltitudePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Altitude defined by the user in the IDL file. - * @ingroup ALTITUDE - */ - class AltitudePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Altitude type; + typedef Altitude type; - eProsima_user_DllExport AltitudePubSubType(); + eProsima_user_DllExport AltitudePubSubType(); - eProsima_user_DllExport virtual ~AltitudePubSubType(); + eProsima_user_DllExport ~AltitudePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Altitude(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.cxx index a61347e9cfb..0efb4697ac2 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.cxx @@ -14,9 +14,9 @@ /*! * @file AltitudeValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "AltitudeValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace AltitudeValue_Constants { +} // namespace AltitudeValue_Constants -etsi_its_cam_msgs::msg::AltitudeValue::AltitudeValue() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@22bd2039 - m_value = 0; +AltitudeValue::AltitudeValue() +{ } -etsi_its_cam_msgs::msg::AltitudeValue::~AltitudeValue() +AltitudeValue::~AltitudeValue() { } -etsi_its_cam_msgs::msg::AltitudeValue::AltitudeValue( +AltitudeValue::AltitudeValue( const AltitudeValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::AltitudeValue::AltitudeValue( - AltitudeValue&& x) +AltitudeValue::AltitudeValue( + AltitudeValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::AltitudeValue::operator =( +AltitudeValue& AltitudeValue::operator =( const AltitudeValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::AltitudeValue& etsi_its_cam_msgs::msg::AltitudeValue::operator =( - AltitudeValue&& x) +AltitudeValue& AltitudeValue::operator =( + AltitudeValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::AltitudeValue::operator ==( +bool AltitudeValue::operator ==( const AltitudeValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::AltitudeValue::operator !=( +bool AltitudeValue::operator !=( const AltitudeValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::AltitudeValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::AltitudeValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::AltitudeValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::AltitudeValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::AltitudeValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::AltitudeValue::value( +void AltitudeValue::value( int32_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::AltitudeValue::value( * @brief This function returns the value of member value * @return Value of member value */ -int32_t etsi_its_cam_msgs::msg::AltitudeValue::value() const +int32_t AltitudeValue::value() const { return m_value; } @@ -158,32 +118,18 @@ int32_t etsi_its_cam_msgs::msg::AltitudeValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int32_t& etsi_its_cam_msgs::msg::AltitudeValue::value() +int32_t& AltitudeValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::AltitudeValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::AltitudeValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::AltitudeValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AltitudeValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.h index 7e85c6cb2fe..39d58febb62 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValue.h @@ -16,19 +16,24 @@ * @file AltitudeValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(AltitudeValue_SOURCE) -#define AltitudeValue_DllAPI __declspec( dllexport ) +#if defined(ALTITUDEVALUE_SOURCE) +#define ALTITUDEVALUE_DllAPI __declspec( dllexport ) #else -#define AltitudeValue_DllAPI __declspec( dllimport ) -#endif // AltitudeValue_SOURCE +#define ALTITUDEVALUE_DllAPI __declspec( dllimport ) +#endif // ALTITUDEVALUE_SOURCE #else -#define AltitudeValue_DllAPI +#define ALTITUDEVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define AltitudeValue_DllAPI +#define ALTITUDEVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace AltitudeValue_Constants { - const int32_t MIN = -100000; - const int32_t MAX = 800001; - const int32_t REFERENCE_ELLIPSOID_SURFACE = 0; - const int32_t ONE_CENTIMETER = 1; - const int32_t UNAVAILABLE = 800001; - } // namespace AltitudeValue_Constants - /*! - * @brief This class represents the structure AltitudeValue defined by the user in the IDL file. - * @ingroup ALTITUDEVALUE - */ - class AltitudeValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AltitudeValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AltitudeValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. - */ - eProsima_user_DllExport AltitudeValue( - const AltitudeValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. - */ - eProsima_user_DllExport AltitudeValue( - AltitudeValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. - */ - eProsima_user_DllExport AltitudeValue& operator =( - const AltitudeValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. - */ - eProsima_user_DllExport AltitudeValue& operator =( - AltitudeValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::AltitudeValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AltitudeValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::AltitudeValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AltitudeValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int32_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int32_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int32_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::AltitudeValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int32_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace AltitudeValue_Constants { + +const int32_t MIN = -100000; +const int32_t MAX = 800001; +const int32_t REFERENCE_ELLIPSOID_SURFACE = 0; +const int32_t ONE_CENTIMETER = 1; +const int32_t UNAVAILABLE = 800001; + +} // namespace AltitudeValue_Constants + + +/*! + * @brief This class represents the structure AltitudeValue defined by the user in the IDL file. + * @ingroup AltitudeValue + */ +class AltitudeValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AltitudeValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AltitudeValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. + */ + eProsima_user_DllExport AltitudeValue( + const AltitudeValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. + */ + eProsima_user_DllExport AltitudeValue( + AltitudeValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. + */ + eProsima_user_DllExport AltitudeValue& operator =( + const AltitudeValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::AltitudeValue that will be copied. + */ + eProsima_user_DllExport AltitudeValue& operator =( + AltitudeValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AltitudeValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AltitudeValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::AltitudeValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AltitudeValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + +private: + + int32_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValueCdrAux.hpp new file mode 100644 index 00000000000..6538d5cf498 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValueCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUECDRAUX_HPP_ + +#include "AltitudeValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_AltitudeValue_max_cdr_typesize {8UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_AltitudeValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AltitudeValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValueCdrAux.ipp new file mode 100644 index 00000000000..e61d9247dd7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValueCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AltitudeValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUECDRAUX_IPP_ + +#include "AltitudeValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::AltitudeValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AltitudeValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::AltitudeValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::AltitudeValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.cxx index 2757a77d662..d861eddaabd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file AltitudeValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AltitudeValuePubSubTypes.h" +#include "AltitudeValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace AltitudeValue_Constants { - - - - - - - } //End of namespace AltitudeValue_Constants - AltitudeValuePubSubType::AltitudeValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::AltitudeValue_"); - auto type_size = AltitudeValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = AltitudeValue::isKeyDefined(); - size_t keyLength = AltitudeValue::getKeyMaxCdrSerializedSize() > 16 ? - AltitudeValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - AltitudeValuePubSubType::~AltitudeValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool AltitudeValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - AltitudeValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AltitudeValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - AltitudeValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AltitudeValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AltitudeValuePubSubType::createData() - { - return reinterpret_cast(new AltitudeValue()); - } - - void AltitudeValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AltitudeValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - AltitudeValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AltitudeValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || AltitudeValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace AltitudeValue_Constants { + + + + + + + + + + + +} //End of namespace AltitudeValue_Constants + + + +AltitudeValuePubSubType::AltitudeValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::AltitudeValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AltitudeValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_AltitudeValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AltitudeValuePubSubType::~AltitudeValuePubSubType() +{ +} + +bool AltitudeValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AltitudeValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AltitudeValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AltitudeValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AltitudeValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AltitudeValuePubSubType::createData() +{ + return reinterpret_cast(new AltitudeValue()); +} + +void AltitudeValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AltitudeValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.h index d347db612ac..0b5fd497255 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/AltitudeValuePubSubTypes.h @@ -16,100 +16,132 @@ * @file AltitudeValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "AltitudeValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated AltitudeValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace AltitudeValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace AltitudeValue_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type AltitudeValue defined by the user in the IDL file. - * @ingroup ALTITUDEVALUE - */ - class AltitudeValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef AltitudeValue type; +} // namespace AltitudeValue_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type AltitudeValue defined by the user in the IDL file. + * @ingroup AltitudeValue + */ +class AltitudeValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AltitudeValue type; + + eProsima_user_DllExport AltitudeValuePubSubType(); - eProsima_user_DllExport AltitudeValuePubSubType(); + eProsima_user_DllExport ~AltitudeValuePubSubType() override; - eProsima_user_DllExport virtual ~AltitudeValuePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) AltitudeValue(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ALTITUDEVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.cxx index 50f3dbfe26d..6bc9d6a2ec9 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.cxx @@ -14,9 +14,9 @@ /*! * @file BasicContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "BasicContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::BasicContainer::BasicContainer() -{ - // m_station_type com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@432034a - // m_reference_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@78de58ea +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::BasicContainer::~BasicContainer() +BasicContainer::BasicContainer() { +} +BasicContainer::~BasicContainer() +{ } -etsi_its_cam_msgs::msg::BasicContainer::BasicContainer( +BasicContainer::BasicContainer( const BasicContainer& x) { m_station_type = x.m_station_type; m_reference_position = x.m_reference_position; } -etsi_its_cam_msgs::msg::BasicContainer::BasicContainer( - BasicContainer&& x) +BasicContainer::BasicContainer( + BasicContainer&& x) noexcept { m_station_type = std::move(x.m_station_type); m_reference_position = std::move(x.m_reference_position); } -etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::BasicContainer::operator =( +BasicContainer& BasicContainer::operator =( const BasicContainer& x) { m_station_type = x.m_station_type; m_reference_position = x.m_reference_position; - return *this; } -etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::BasicContainer::operator =( - BasicContainer&& x) +BasicContainer& BasicContainer::operator =( + BasicContainer&& x) noexcept { m_station_type = std::move(x.m_station_type); m_reference_position = std::move(x.m_reference_position); - return *this; } -bool etsi_its_cam_msgs::msg::BasicContainer::operator ==( +bool BasicContainer::operator ==( const BasicContainer& x) const { - - return (m_station_type == x.m_station_type && m_reference_position == x.m_reference_position); + return (m_station_type == x.m_station_type && + m_reference_position == x.m_reference_position); } -bool etsi_its_cam_msgs::msg::BasicContainer::operator !=( +bool BasicContainer::operator !=( const BasicContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::BasicContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::StationType::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::ReferencePosition::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::BasicContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::BasicContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::StationType::getCdrSerializedSize(data.station_type(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::ReferencePosition::getCdrSerializedSize(data.reference_position(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::BasicContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_station_type; - scdr << m_reference_position; - -} - -void etsi_its_cam_msgs::msg::BasicContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_station_type; - dcdr >> m_reference_position; -} - /*! * @brief This function copies the value in member station_type * @param _station_type New value to be copied in member station_type */ -void etsi_its_cam_msgs::msg::BasicContainer::station_type( +void BasicContainer::station_type( const etsi_its_cam_msgs::msg::StationType& _station_type) { m_station_type = _station_type; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::BasicContainer::station_type( * @brief This function moves the value in member station_type * @param _station_type New value to be moved in member station_type */ -void etsi_its_cam_msgs::msg::BasicContainer::station_type( +void BasicContainer::station_type( etsi_its_cam_msgs::msg::StationType&& _station_type) { m_station_type = std::move(_station_type); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::BasicContainer::station_type( * @brief This function returns a constant reference to member station_type * @return Constant reference to member station_type */ -const etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::BasicContainer::station_type() const +const etsi_its_cam_msgs::msg::StationType& BasicContainer::station_type() const { return m_station_type; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::BasicContaine * @brief This function returns a reference to member station_type * @return Reference to member station_type */ -etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::BasicContainer::station_type() +etsi_its_cam_msgs::msg::StationType& BasicContainer::station_type() { return m_station_type; } + + /*! * @brief This function copies the value in member reference_position * @param _reference_position New value to be copied in member reference_position */ -void etsi_its_cam_msgs::msg::BasicContainer::reference_position( +void BasicContainer::reference_position( const etsi_its_cam_msgs::msg::ReferencePosition& _reference_position) { m_reference_position = _reference_position; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::BasicContainer::reference_position( * @brief This function moves the value in member reference_position * @param _reference_position New value to be moved in member reference_position */ -void etsi_its_cam_msgs::msg::BasicContainer::reference_position( +void BasicContainer::reference_position( etsi_its_cam_msgs::msg::ReferencePosition&& _reference_position) { m_reference_position = std::move(_reference_position); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::BasicContainer::reference_position( * @brief This function returns a constant reference to member reference_position * @return Constant reference to member reference_position */ -const etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::BasicContainer::reference_position() const +const etsi_its_cam_msgs::msg::ReferencePosition& BasicContainer::reference_position() const { return m_reference_position; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::BasicCo * @brief This function returns a reference to member reference_position * @return Reference to member reference_position */ -etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::BasicContainer::reference_position() +etsi_its_cam_msgs::msg::ReferencePosition& BasicContainer::reference_position() { return m_reference_position; } -size_t etsi_its_cam_msgs::msg::BasicContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::BasicContainer::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::BasicContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "BasicContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.h index 632ceafad36..4ae14db4e61 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainer.h @@ -16,21 +16,26 @@ * @file BasicContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_H_ -#include "ReferencePosition.h" -#include "StationType.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "ReferencePosition.h" +#include "StationType.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(BasicContainer_SOURCE) -#define BasicContainer_DllAPI __declspec( dllexport ) +#if defined(BASICCONTAINER_SOURCE) +#define BASICCONTAINER_DllAPI __declspec( dllexport ) #else -#define BasicContainer_DllAPI __declspec( dllimport ) -#endif // BasicContainer_SOURCE +#define BASICCONTAINER_DllAPI __declspec( dllimport ) +#endif // BASICCONTAINER_SOURCE #else -#define BasicContainer_DllAPI +#define BASICCONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define BasicContainer_DllAPI +#define BASICCONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure BasicContainer defined by the user in the IDL file. - * @ingroup BASICCONTAINER - */ - class BasicContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. - */ - eProsima_user_DllExport BasicContainer( - const BasicContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. - */ - eProsima_user_DllExport BasicContainer( - BasicContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. - */ - eProsima_user_DllExport BasicContainer& operator =( - const BasicContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. - */ - eProsima_user_DllExport BasicContainer& operator =( - BasicContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::BasicContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::BasicContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicContainer& x) const; - - /*! - * @brief This function copies the value in member station_type - * @param _station_type New value to be copied in member station_type - */ - eProsima_user_DllExport void station_type( - const etsi_its_cam_msgs::msg::StationType& _station_type); - - /*! - * @brief This function moves the value in member station_type - * @param _station_type New value to be moved in member station_type - */ - eProsima_user_DllExport void station_type( - etsi_its_cam_msgs::msg::StationType&& _station_type); - - /*! - * @brief This function returns a constant reference to member station_type - * @return Constant reference to member station_type - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::StationType& station_type() const; - - /*! - * @brief This function returns a reference to member station_type - * @return Reference to member station_type - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::StationType& station_type(); - /*! - * @brief This function copies the value in member reference_position - * @param _reference_position New value to be copied in member reference_position - */ - eProsima_user_DllExport void reference_position( - const etsi_its_cam_msgs::msg::ReferencePosition& _reference_position); - - /*! - * @brief This function moves the value in member reference_position - * @param _reference_position New value to be moved in member reference_position - */ - eProsima_user_DllExport void reference_position( - etsi_its_cam_msgs::msg::ReferencePosition&& _reference_position); - - /*! - * @brief This function returns a constant reference to member reference_position - * @return Constant reference to member reference_position - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ReferencePosition& reference_position() const; - - /*! - * @brief This function returns a reference to member reference_position - * @return Reference to member reference_position - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ReferencePosition& reference_position(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::BasicContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::StationType m_station_type; - etsi_its_cam_msgs::msg::ReferencePosition m_reference_position; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure BasicContainer defined by the user in the IDL file. + * @ingroup BasicContainer + */ +class BasicContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. + */ + eProsima_user_DllExport BasicContainer( + const BasicContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. + */ + eProsima_user_DllExport BasicContainer( + BasicContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. + */ + eProsima_user_DllExport BasicContainer& operator =( + const BasicContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicContainer that will be copied. + */ + eProsima_user_DllExport BasicContainer& operator =( + BasicContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicContainer& x) const; + + /*! + * @brief This function copies the value in member station_type + * @param _station_type New value to be copied in member station_type + */ + eProsima_user_DllExport void station_type( + const etsi_its_cam_msgs::msg::StationType& _station_type); + + /*! + * @brief This function moves the value in member station_type + * @param _station_type New value to be moved in member station_type + */ + eProsima_user_DllExport void station_type( + etsi_its_cam_msgs::msg::StationType&& _station_type); + + /*! + * @brief This function returns a constant reference to member station_type + * @return Constant reference to member station_type + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::StationType& station_type() const; + + /*! + * @brief This function returns a reference to member station_type + * @return Reference to member station_type + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::StationType& station_type(); + + + /*! + * @brief This function copies the value in member reference_position + * @param _reference_position New value to be copied in member reference_position + */ + eProsima_user_DllExport void reference_position( + const etsi_its_cam_msgs::msg::ReferencePosition& _reference_position); + + /*! + * @brief This function moves the value in member reference_position + * @param _reference_position New value to be moved in member reference_position + */ + eProsima_user_DllExport void reference_position( + etsi_its_cam_msgs::msg::ReferencePosition&& _reference_position); + + /*! + * @brief This function returns a constant reference to member reference_position + * @return Constant reference to member reference_position + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ReferencePosition& reference_position() const; + + /*! + * @brief This function returns a reference to member reference_position + * @return Reference to member reference_position + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ReferencePosition& reference_position(); + +private: + + etsi_its_cam_msgs::msg::StationType m_station_type; + etsi_its_cam_msgs::msg::ReferencePosition m_reference_position; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerCdrAux.hpp new file mode 100644 index 00000000000..6f703f5a250 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerCdrAux.hpp @@ -0,0 +1,59 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINERCDRAUX_HPP_ + +#include "BasicContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_BasicContainer_max_cdr_typesize {77UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_BasicContainer_max_key_cdr_typesize {0UL}; + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerCdrAux.ipp new file mode 100644 index 00000000000..344bebfeb22 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINERCDRAUX_IPP_ + +#include "BasicContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::BasicContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.station_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.reference_position(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.station_type() + << eprosima::fastcdr::MemberId(1) << data.reference_position() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::BasicContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.station_type(); + break; + + case 1: + dcdr >> data.reference_position(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.cxx index 16e86f50ad3..9070831aaa3 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file BasicContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "BasicContainerPubSubTypes.h" +#include "BasicContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - BasicContainerPubSubType::BasicContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::BasicContainer_"); - auto type_size = BasicContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = BasicContainer::isKeyDefined(); - size_t keyLength = BasicContainer::getKeyMaxCdrSerializedSize() > 16 ? - BasicContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BasicContainerPubSubType::~BasicContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BasicContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - BasicContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool BasicContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - BasicContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function BasicContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* BasicContainerPubSubType::createData() - { - return reinterpret_cast(new BasicContainer()); - } - - void BasicContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BasicContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - BasicContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || BasicContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +BasicContainerPubSubType::BasicContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::BasicContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_BasicContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +BasicContainerPubSubType::~BasicContainerPubSubType() +{ +} + +bool BasicContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + BasicContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool BasicContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + BasicContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function BasicContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* BasicContainerPubSubType::createData() +{ + return reinterpret_cast(new BasicContainer()); +} + +void BasicContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool BasicContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.h index 22c59616956..331670d2373 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicContainerPubSubTypes.h @@ -16,92 +16,122 @@ * @file BasicContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "BasicContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "ReferencePositionPubSubTypes.h" +#include "StationTypePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated BasicContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type BasicContainer defined by the user in the IDL file. + * @ingroup BasicContainer + */ +class BasicContainerPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type BasicContainer defined by the user in the IDL file. - * @ingroup BASICCONTAINER - */ - class BasicContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef BasicContainer type; + typedef BasicContainer type; - eProsima_user_DllExport BasicContainerPubSubType(); + eProsima_user_DllExport BasicContainerPubSubType(); - eProsima_user_DllExport virtual ~BasicContainerPubSubType(); + eProsima_user_DllExport ~BasicContainerPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) BasicContainer(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICCONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.cxx index c954bbbbf21..f321cad4474 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.cxx @@ -14,9 +14,9 @@ /*! * @file BasicVehicleContainerHighFrequency.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,91 +27,31 @@ char dummy; #endif // _WIN32 #include "BasicVehicleContainerHighFrequency.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency() -{ - // m_heading com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5aa6202e - - // m_speed com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3af9aa66 - - // m_drive_direction com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@771158fb - - // m_vehicle_length com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@91c4a3f - - // m_vehicle_width com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@62d0ac62 - - // m_longitudinal_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@150d80c4 - - // m_curvature com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6826c41e - // m_curvature_calculation_mode com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3003697 +namespace etsi_its_cam_msgs { - // m_yaw_rate com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@64d43929 +namespace msg { - // m_acceleration_control com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1d269ed7 - // m_acceleration_control_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@437ebf59 - m_acceleration_control_is_present = false; - // m_lane_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@41c89d2f - - // m_lane_position_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@410e94e - m_lane_position_is_present = false; - // m_steering_wheel_angle com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2d691f3d - - // m_steering_wheel_angle_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1bdbf9be - m_steering_wheel_angle_is_present = false; - // m_lateral_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1e7f2e0f - - // m_lateral_acceleration_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1da6ee17 - m_lateral_acceleration_is_present = false; - // m_vertical_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@78d39a69 - - // m_vertical_acceleration_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3c818ac4 - m_vertical_acceleration_is_present = false; - // m_performance_class com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5b69d40d - - // m_performance_class_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71154f21 - m_performance_class_is_present = false; - // m_cen_dsrc_tolling_zone com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@15f193b8 - - // m_cen_dsrc_tolling_zone_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2516fc68 - m_cen_dsrc_tolling_zone_is_present = false; +BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency() +{ } -etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::~BasicVehicleContainerHighFrequency() +BasicVehicleContainerHighFrequency::~BasicVehicleContainerHighFrequency() { - - - - - - - - - - - - - - - - - - - - - - } -etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency( +BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency( const BasicVehicleContainerHighFrequency& x) { m_heading = x.m_heading; @@ -139,8 +79,8 @@ etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::BasicVehicleContaine m_cen_dsrc_tolling_zone_is_present = x.m_cen_dsrc_tolling_zone_is_present; } -etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency( - BasicVehicleContainerHighFrequency&& x) +BasicVehicleContainerHighFrequency::BasicVehicleContainerHighFrequency( + BasicVehicleContainerHighFrequency&& x) noexcept { m_heading = std::move(x.m_heading); m_speed = std::move(x.m_speed); @@ -167,7 +107,7 @@ etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::BasicVehicleContaine m_cen_dsrc_tolling_zone_is_present = x.m_cen_dsrc_tolling_zone_is_present; } -etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::operator =( +BasicVehicleContainerHighFrequency& BasicVehicleContainerHighFrequency::operator =( const BasicVehicleContainerHighFrequency& x) { @@ -194,12 +134,11 @@ etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::m m_performance_class_is_present = x.m_performance_class_is_present; m_cen_dsrc_tolling_zone = x.m_cen_dsrc_tolling_zone; m_cen_dsrc_tolling_zone_is_present = x.m_cen_dsrc_tolling_zone_is_present; - return *this; } -etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::operator =( - BasicVehicleContainerHighFrequency&& x) +BasicVehicleContainerHighFrequency& BasicVehicleContainerHighFrequency::operator =( + BasicVehicleContainerHighFrequency&& x) noexcept { m_heading = std::move(x.m_heading); @@ -225,257 +164,126 @@ etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::m m_performance_class_is_present = x.m_performance_class_is_present; m_cen_dsrc_tolling_zone = std::move(x.m_cen_dsrc_tolling_zone); m_cen_dsrc_tolling_zone_is_present = x.m_cen_dsrc_tolling_zone_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::operator ==( +bool BasicVehicleContainerHighFrequency::operator ==( const BasicVehicleContainerHighFrequency& x) const { - - return (m_heading == x.m_heading && m_speed == x.m_speed && m_drive_direction == x.m_drive_direction && m_vehicle_length == x.m_vehicle_length && m_vehicle_width == x.m_vehicle_width && m_longitudinal_acceleration == x.m_longitudinal_acceleration && m_curvature == x.m_curvature && m_curvature_calculation_mode == x.m_curvature_calculation_mode && m_yaw_rate == x.m_yaw_rate && m_acceleration_control == x.m_acceleration_control && m_acceleration_control_is_present == x.m_acceleration_control_is_present && m_lane_position == x.m_lane_position && m_lane_position_is_present == x.m_lane_position_is_present && m_steering_wheel_angle == x.m_steering_wheel_angle && m_steering_wheel_angle_is_present == x.m_steering_wheel_angle_is_present && m_lateral_acceleration == x.m_lateral_acceleration && m_lateral_acceleration_is_present == x.m_lateral_acceleration_is_present && m_vertical_acceleration == x.m_vertical_acceleration && m_vertical_acceleration_is_present == x.m_vertical_acceleration_is_present && m_performance_class == x.m_performance_class && m_performance_class_is_present == x.m_performance_class_is_present && m_cen_dsrc_tolling_zone == x.m_cen_dsrc_tolling_zone && m_cen_dsrc_tolling_zone_is_present == x.m_cen_dsrc_tolling_zone_is_present); -} - -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::operator !=( + return (m_heading == x.m_heading && + m_speed == x.m_speed && + m_drive_direction == x.m_drive_direction && + m_vehicle_length == x.m_vehicle_length && + m_vehicle_width == x.m_vehicle_width && + m_longitudinal_acceleration == x.m_longitudinal_acceleration && + m_curvature == x.m_curvature && + m_curvature_calculation_mode == x.m_curvature_calculation_mode && + m_yaw_rate == x.m_yaw_rate && + m_acceleration_control == x.m_acceleration_control && + m_acceleration_control_is_present == x.m_acceleration_control_is_present && + m_lane_position == x.m_lane_position && + m_lane_position_is_present == x.m_lane_position_is_present && + m_steering_wheel_angle == x.m_steering_wheel_angle && + m_steering_wheel_angle_is_present == x.m_steering_wheel_angle_is_present && + m_lateral_acceleration == x.m_lateral_acceleration && + m_lateral_acceleration_is_present == x.m_lateral_acceleration_is_present && + m_vertical_acceleration == x.m_vertical_acceleration && + m_vertical_acceleration_is_present == x.m_vertical_acceleration_is_present && + m_performance_class == x.m_performance_class && + m_performance_class_is_present == x.m_performance_class_is_present && + m_cen_dsrc_tolling_zone == x.m_cen_dsrc_tolling_zone && + m_cen_dsrc_tolling_zone_is_present == x.m_cen_dsrc_tolling_zone_is_present); +} + +bool BasicVehicleContainerHighFrequency::operator !=( const BasicVehicleContainerHighFrequency& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::Heading::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Speed::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::DriveDirection::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::VehicleLength::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::VehicleWidth::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::LongitudinalAcceleration::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Curvature::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CurvatureCalculationMode::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::YawRate::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AccelerationControl::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::LanePosition::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngle::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::LateralAcceleration::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::VerticalAcceleration::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::PerformanceClass::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::CenDsrcTollingZone::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::Heading::getCdrSerializedSize(data.heading(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Speed::getCdrSerializedSize(data.speed(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::DriveDirection::getCdrSerializedSize(data.drive_direction(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::VehicleLength::getCdrSerializedSize(data.vehicle_length(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::VehicleWidth::getCdrSerializedSize(data.vehicle_width(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::LongitudinalAcceleration::getCdrSerializedSize(data.longitudinal_acceleration(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Curvature::getCdrSerializedSize(data.curvature(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CurvatureCalculationMode::getCdrSerializedSize(data.curvature_calculation_mode(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::YawRate::getCdrSerializedSize(data.yaw_rate(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AccelerationControl::getCdrSerializedSize(data.acceleration_control(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::LanePosition::getCdrSerializedSize(data.lane_position(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngle::getCdrSerializedSize(data.steering_wheel_angle(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::LateralAcceleration::getCdrSerializedSize(data.lateral_acceleration(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::VerticalAcceleration::getCdrSerializedSize(data.vertical_acceleration(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::PerformanceClass::getCdrSerializedSize(data.performance_class(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::CenDsrcTollingZone::getCdrSerializedSize(data.cen_dsrc_tolling_zone(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_heading; - scdr << m_speed; - scdr << m_drive_direction; - scdr << m_vehicle_length; - scdr << m_vehicle_width; - scdr << m_longitudinal_acceleration; - scdr << m_curvature; - scdr << m_curvature_calculation_mode; - scdr << m_yaw_rate; - scdr << m_acceleration_control; - scdr << m_acceleration_control_is_present; - scdr << m_lane_position; - scdr << m_lane_position_is_present; - scdr << m_steering_wheel_angle; - scdr << m_steering_wheel_angle_is_present; - scdr << m_lateral_acceleration; - scdr << m_lateral_acceleration_is_present; - scdr << m_vertical_acceleration; - scdr << m_vertical_acceleration_is_present; - scdr << m_performance_class; - scdr << m_performance_class_is_present; - scdr << m_cen_dsrc_tolling_zone; - scdr << m_cen_dsrc_tolling_zone_is_present; - -} - -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_heading; - dcdr >> m_speed; - dcdr >> m_drive_direction; - dcdr >> m_vehicle_length; - dcdr >> m_vehicle_width; - dcdr >> m_longitudinal_acceleration; - dcdr >> m_curvature; - dcdr >> m_curvature_calculation_mode; - dcdr >> m_yaw_rate; - dcdr >> m_acceleration_control; - dcdr >> m_acceleration_control_is_present; - dcdr >> m_lane_position; - dcdr >> m_lane_position_is_present; - dcdr >> m_steering_wheel_angle; - dcdr >> m_steering_wheel_angle_is_present; - dcdr >> m_lateral_acceleration; - dcdr >> m_lateral_acceleration_is_present; - dcdr >> m_vertical_acceleration; - dcdr >> m_vertical_acceleration_is_present; - dcdr >> m_performance_class; - dcdr >> m_performance_class_is_present; - dcdr >> m_cen_dsrc_tolling_zone; - dcdr >> m_cen_dsrc_tolling_zone_is_present; -} - /*! - * @brief This function copies the value in member heading_ - * @param _heading New value to be copied in member heading_ + * @brief This function copies the value in member heading + * @param _heading New value to be copied in member heading */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::heading( +void BasicVehicleContainerHighFrequency::heading( const etsi_its_cam_msgs::msg::Heading& _heading) { m_heading = _heading; } /*! - * @brief This function moves the value in member heading_ - * @param _heading New value to be moved in member heading_ + * @brief This function moves the value in member heading + * @param _heading New value to be moved in member heading */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::heading( +void BasicVehicleContainerHighFrequency::heading( etsi_its_cam_msgs::msg::Heading&& _heading) { m_heading = std::move(_heading); } /*! - * @brief This function returns a constant reference to member heading_ - * @return Constant reference to member heading_ + * @brief This function returns a constant reference to member heading + * @return Constant reference to member heading */ -const etsi_its_cam_msgs::msg::Heading& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::heading() const +const etsi_its_cam_msgs::msg::Heading& BasicVehicleContainerHighFrequency::heading() const { return m_heading; } /*! - * @brief This function returns a reference to member heading_ - * @return Reference to member heading_ + * @brief This function returns a reference to member heading + * @return Reference to member heading */ -etsi_its_cam_msgs::msg::Heading& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::heading() +etsi_its_cam_msgs::msg::Heading& BasicVehicleContainerHighFrequency::heading() { return m_heading; } + + /*! - * @brief This function copies the value in member speed_ - * @param _speed New value to be copied in member speed_ + * @brief This function copies the value in member speed + * @param _speed New value to be copied in member speed */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::speed( +void BasicVehicleContainerHighFrequency::speed( const etsi_its_cam_msgs::msg::Speed& _speed) { m_speed = _speed; } /*! - * @brief This function moves the value in member speed_ - * @param _speed New value to be moved in member speed_ + * @brief This function moves the value in member speed + * @param _speed New value to be moved in member speed */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::speed( +void BasicVehicleContainerHighFrequency::speed( etsi_its_cam_msgs::msg::Speed&& _speed) { m_speed = std::move(_speed); } /*! - * @brief This function returns a constant reference to member speed_ - * @return Constant reference to member speed_ + * @brief This function returns a constant reference to member speed + * @return Constant reference to member speed */ -const etsi_its_cam_msgs::msg::Speed& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::speed() const +const etsi_its_cam_msgs::msg::Speed& BasicVehicleContainerHighFrequency::speed() const { return m_speed; } /*! - * @brief This function returns a reference to member speed_ - * @return Reference to member speed_ + * @brief This function returns a reference to member speed + * @return Reference to member speed */ -etsi_its_cam_msgs::msg::Speed& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::speed() +etsi_its_cam_msgs::msg::Speed& BasicVehicleContainerHighFrequency::speed() { return m_speed; } + + /*! * @brief This function copies the value in member drive_direction * @param _drive_direction New value to be copied in member drive_direction */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction( +void BasicVehicleContainerHighFrequency::drive_direction( const etsi_its_cam_msgs::msg::DriveDirection& _drive_direction) { m_drive_direction = _drive_direction; @@ -485,7 +293,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction * @brief This function moves the value in member drive_direction * @param _drive_direction New value to be moved in member drive_direction */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction( +void BasicVehicleContainerHighFrequency::drive_direction( etsi_its_cam_msgs::msg::DriveDirection&& _drive_direction) { m_drive_direction = std::move(_drive_direction); @@ -495,7 +303,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction * @brief This function returns a constant reference to member drive_direction * @return Constant reference to member drive_direction */ -const etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction() const +const etsi_its_cam_msgs::msg::DriveDirection& BasicVehicleContainerHighFrequency::drive_direction() const { return m_drive_direction; } @@ -504,15 +312,17 @@ const etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::BasicVehic * @brief This function returns a reference to member drive_direction * @return Reference to member drive_direction */ -etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::drive_direction() +etsi_its_cam_msgs::msg::DriveDirection& BasicVehicleContainerHighFrequency::drive_direction() { return m_drive_direction; } + + /*! * @brief This function copies the value in member vehicle_length * @param _vehicle_length New value to be copied in member vehicle_length */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length( +void BasicVehicleContainerHighFrequency::vehicle_length( const etsi_its_cam_msgs::msg::VehicleLength& _vehicle_length) { m_vehicle_length = _vehicle_length; @@ -522,7 +332,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length( * @brief This function moves the value in member vehicle_length * @param _vehicle_length New value to be moved in member vehicle_length */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length( +void BasicVehicleContainerHighFrequency::vehicle_length( etsi_its_cam_msgs::msg::VehicleLength&& _vehicle_length) { m_vehicle_length = std::move(_vehicle_length); @@ -532,7 +342,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length( * @brief This function returns a constant reference to member vehicle_length * @return Constant reference to member vehicle_length */ -const etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length() const +const etsi_its_cam_msgs::msg::VehicleLength& BasicVehicleContainerHighFrequency::vehicle_length() const { return m_vehicle_length; } @@ -541,15 +351,17 @@ const etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::BasicVehicl * @brief This function returns a reference to member vehicle_length * @return Reference to member vehicle_length */ -etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_length() +etsi_its_cam_msgs::msg::VehicleLength& BasicVehicleContainerHighFrequency::vehicle_length() { return m_vehicle_length; } + + /*! * @brief This function copies the value in member vehicle_width * @param _vehicle_width New value to be copied in member vehicle_width */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width( +void BasicVehicleContainerHighFrequency::vehicle_width( const etsi_its_cam_msgs::msg::VehicleWidth& _vehicle_width) { m_vehicle_width = _vehicle_width; @@ -559,7 +371,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width( * @brief This function moves the value in member vehicle_width * @param _vehicle_width New value to be moved in member vehicle_width */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width( +void BasicVehicleContainerHighFrequency::vehicle_width( etsi_its_cam_msgs::msg::VehicleWidth&& _vehicle_width) { m_vehicle_width = std::move(_vehicle_width); @@ -569,7 +381,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width( * @brief This function returns a constant reference to member vehicle_width * @return Constant reference to member vehicle_width */ -const etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width() const +const etsi_its_cam_msgs::msg::VehicleWidth& BasicVehicleContainerHighFrequency::vehicle_width() const { return m_vehicle_width; } @@ -578,15 +390,17 @@ const etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::BasicVehicle * @brief This function returns a reference to member vehicle_width * @return Reference to member vehicle_width */ -etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vehicle_width() +etsi_its_cam_msgs::msg::VehicleWidth& BasicVehicleContainerHighFrequency::vehicle_width() { return m_vehicle_width; } + + /*! * @brief This function copies the value in member longitudinal_acceleration * @param _longitudinal_acceleration New value to be copied in member longitudinal_acceleration */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_acceleration( +void BasicVehicleContainerHighFrequency::longitudinal_acceleration( const etsi_its_cam_msgs::msg::LongitudinalAcceleration& _longitudinal_acceleration) { m_longitudinal_acceleration = _longitudinal_acceleration; @@ -596,7 +410,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_ac * @brief This function moves the value in member longitudinal_acceleration * @param _longitudinal_acceleration New value to be moved in member longitudinal_acceleration */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_acceleration( +void BasicVehicleContainerHighFrequency::longitudinal_acceleration( etsi_its_cam_msgs::msg::LongitudinalAcceleration&& _longitudinal_acceleration) { m_longitudinal_acceleration = std::move(_longitudinal_acceleration); @@ -606,7 +420,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_ac * @brief This function returns a constant reference to member longitudinal_acceleration * @return Constant reference to member longitudinal_acceleration */ -const etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_acceleration() const +const etsi_its_cam_msgs::msg::LongitudinalAcceleration& BasicVehicleContainerHighFrequency::longitudinal_acceleration() const { return m_longitudinal_acceleration; } @@ -615,52 +429,56 @@ const etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg:: * @brief This function returns a reference to member longitudinal_acceleration * @return Reference to member longitudinal_acceleration */ -etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::longitudinal_acceleration() +etsi_its_cam_msgs::msg::LongitudinalAcceleration& BasicVehicleContainerHighFrequency::longitudinal_acceleration() { return m_longitudinal_acceleration; } + + /*! - * @brief This function copies the value in member curvature_ - * @param _curvature New value to be copied in member curvature_ + * @brief This function copies the value in member curvature + * @param _curvature New value to be copied in member curvature */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature( +void BasicVehicleContainerHighFrequency::curvature( const etsi_its_cam_msgs::msg::Curvature& _curvature) { m_curvature = _curvature; } /*! - * @brief This function moves the value in member curvature_ - * @param _curvature New value to be moved in member curvature_ + * @brief This function moves the value in member curvature + * @param _curvature New value to be moved in member curvature */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature( +void BasicVehicleContainerHighFrequency::curvature( etsi_its_cam_msgs::msg::Curvature&& _curvature) { m_curvature = std::move(_curvature); } /*! - * @brief This function returns a constant reference to member curvature_ - * @return Constant reference to member curvature_ + * @brief This function returns a constant reference to member curvature + * @return Constant reference to member curvature */ -const etsi_its_cam_msgs::msg::Curvature& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature() const +const etsi_its_cam_msgs::msg::Curvature& BasicVehicleContainerHighFrequency::curvature() const { return m_curvature; } /*! - * @brief This function returns a reference to member curvature_ - * @return Reference to member curvature_ + * @brief This function returns a reference to member curvature + * @return Reference to member curvature */ -etsi_its_cam_msgs::msg::Curvature& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature() +etsi_its_cam_msgs::msg::Curvature& BasicVehicleContainerHighFrequency::curvature() { return m_curvature; } + + /*! * @brief This function copies the value in member curvature_calculation_mode * @param _curvature_calculation_mode New value to be copied in member curvature_calculation_mode */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calculation_mode( +void BasicVehicleContainerHighFrequency::curvature_calculation_mode( const etsi_its_cam_msgs::msg::CurvatureCalculationMode& _curvature_calculation_mode) { m_curvature_calculation_mode = _curvature_calculation_mode; @@ -670,7 +488,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calcu * @brief This function moves the value in member curvature_calculation_mode * @param _curvature_calculation_mode New value to be moved in member curvature_calculation_mode */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calculation_mode( +void BasicVehicleContainerHighFrequency::curvature_calculation_mode( etsi_its_cam_msgs::msg::CurvatureCalculationMode&& _curvature_calculation_mode) { m_curvature_calculation_mode = std::move(_curvature_calculation_mode); @@ -680,7 +498,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calcu * @brief This function returns a constant reference to member curvature_calculation_mode * @return Constant reference to member curvature_calculation_mode */ -const etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calculation_mode() const +const etsi_its_cam_msgs::msg::CurvatureCalculationMode& BasicVehicleContainerHighFrequency::curvature_calculation_mode() const { return m_curvature_calculation_mode; } @@ -689,15 +507,17 @@ const etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg:: * @brief This function returns a reference to member curvature_calculation_mode * @return Reference to member curvature_calculation_mode */ -etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::curvature_calculation_mode() +etsi_its_cam_msgs::msg::CurvatureCalculationMode& BasicVehicleContainerHighFrequency::curvature_calculation_mode() { return m_curvature_calculation_mode; } + + /*! * @brief This function copies the value in member yaw_rate * @param _yaw_rate New value to be copied in member yaw_rate */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate( +void BasicVehicleContainerHighFrequency::yaw_rate( const etsi_its_cam_msgs::msg::YawRate& _yaw_rate) { m_yaw_rate = _yaw_rate; @@ -707,7 +527,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate( * @brief This function moves the value in member yaw_rate * @param _yaw_rate New value to be moved in member yaw_rate */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate( +void BasicVehicleContainerHighFrequency::yaw_rate( etsi_its_cam_msgs::msg::YawRate&& _yaw_rate) { m_yaw_rate = std::move(_yaw_rate); @@ -717,7 +537,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate( * @brief This function returns a constant reference to member yaw_rate * @return Constant reference to member yaw_rate */ -const etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate() const +const etsi_its_cam_msgs::msg::YawRate& BasicVehicleContainerHighFrequency::yaw_rate() const { return m_yaw_rate; } @@ -726,15 +546,17 @@ const etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::BasicVehicleConta * @brief This function returns a reference to member yaw_rate * @return Reference to member yaw_rate */ -etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::yaw_rate() +etsi_its_cam_msgs::msg::YawRate& BasicVehicleContainerHighFrequency::yaw_rate() { return m_yaw_rate; } + + /*! * @brief This function copies the value in member acceleration_control * @param _acceleration_control New value to be copied in member acceleration_control */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control( +void BasicVehicleContainerHighFrequency::acceleration_control( const etsi_its_cam_msgs::msg::AccelerationControl& _acceleration_control) { m_acceleration_control = _acceleration_control; @@ -744,7 +566,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_co * @brief This function moves the value in member acceleration_control * @param _acceleration_control New value to be moved in member acceleration_control */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control( +void BasicVehicleContainerHighFrequency::acceleration_control( etsi_its_cam_msgs::msg::AccelerationControl&& _acceleration_control) { m_acceleration_control = std::move(_acceleration_control); @@ -754,7 +576,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_co * @brief This function returns a constant reference to member acceleration_control * @return Constant reference to member acceleration_control */ -const etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control() const +const etsi_its_cam_msgs::msg::AccelerationControl& BasicVehicleContainerHighFrequency::acceleration_control() const { return m_acceleration_control; } @@ -763,15 +585,17 @@ const etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::Basic * @brief This function returns a reference to member acceleration_control * @return Reference to member acceleration_control */ -etsi_its_cam_msgs::msg::AccelerationControl& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control() +etsi_its_cam_msgs::msg::AccelerationControl& BasicVehicleContainerHighFrequency::acceleration_control() { return m_acceleration_control; } + + /*! * @brief This function sets a value in member acceleration_control_is_present * @param _acceleration_control_is_present New value for member acceleration_control_is_present */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control_is_present( +void BasicVehicleContainerHighFrequency::acceleration_control_is_present( bool _acceleration_control_is_present) { m_acceleration_control_is_present = _acceleration_control_is_present; @@ -781,7 +605,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_co * @brief This function returns the value of member acceleration_control_is_present * @return Value of member acceleration_control_is_present */ -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control_is_present() const +bool BasicVehicleContainerHighFrequency::acceleration_control_is_present() const { return m_acceleration_control_is_present; } @@ -790,16 +614,17 @@ bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_co * @brief This function returns a reference to member acceleration_control_is_present * @return Reference to member acceleration_control_is_present */ -bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::acceleration_control_is_present() +bool& BasicVehicleContainerHighFrequency::acceleration_control_is_present() { return m_acceleration_control_is_present; } + /*! * @brief This function copies the value in member lane_position * @param _lane_position New value to be copied in member lane_position */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position( +void BasicVehicleContainerHighFrequency::lane_position( const etsi_its_cam_msgs::msg::LanePosition& _lane_position) { m_lane_position = _lane_position; @@ -809,7 +634,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position( * @brief This function moves the value in member lane_position * @param _lane_position New value to be moved in member lane_position */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position( +void BasicVehicleContainerHighFrequency::lane_position( etsi_its_cam_msgs::msg::LanePosition&& _lane_position) { m_lane_position = std::move(_lane_position); @@ -819,7 +644,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position( * @brief This function returns a constant reference to member lane_position * @return Constant reference to member lane_position */ -const etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position() const +const etsi_its_cam_msgs::msg::LanePosition& BasicVehicleContainerHighFrequency::lane_position() const { return m_lane_position; } @@ -828,15 +653,17 @@ const etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::BasicVehicle * @brief This function returns a reference to member lane_position * @return Reference to member lane_position */ -etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position() +etsi_its_cam_msgs::msg::LanePosition& BasicVehicleContainerHighFrequency::lane_position() { return m_lane_position; } + + /*! * @brief This function sets a value in member lane_position_is_present * @param _lane_position_is_present New value for member lane_position_is_present */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position_is_present( +void BasicVehicleContainerHighFrequency::lane_position_is_present( bool _lane_position_is_present) { m_lane_position_is_present = _lane_position_is_present; @@ -846,7 +673,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position_i * @brief This function returns the value of member lane_position_is_present * @return Value of member lane_position_is_present */ -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position_is_present() const +bool BasicVehicleContainerHighFrequency::lane_position_is_present() const { return m_lane_position_is_present; } @@ -855,16 +682,17 @@ bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position_i * @brief This function returns a reference to member lane_position_is_present * @return Reference to member lane_position_is_present */ -bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lane_position_is_present() +bool& BasicVehicleContainerHighFrequency::lane_position_is_present() { return m_lane_position_is_present; } + /*! * @brief This function copies the value in member steering_wheel_angle * @param _steering_wheel_angle New value to be copied in member steering_wheel_angle */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle( +void BasicVehicleContainerHighFrequency::steering_wheel_angle( const etsi_its_cam_msgs::msg::SteeringWheelAngle& _steering_wheel_angle) { m_steering_wheel_angle = _steering_wheel_angle; @@ -874,7 +702,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_ * @brief This function moves the value in member steering_wheel_angle * @param _steering_wheel_angle New value to be moved in member steering_wheel_angle */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle( +void BasicVehicleContainerHighFrequency::steering_wheel_angle( etsi_its_cam_msgs::msg::SteeringWheelAngle&& _steering_wheel_angle) { m_steering_wheel_angle = std::move(_steering_wheel_angle); @@ -884,7 +712,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_ * @brief This function returns a constant reference to member steering_wheel_angle * @return Constant reference to member steering_wheel_angle */ -const etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle() const +const etsi_its_cam_msgs::msg::SteeringWheelAngle& BasicVehicleContainerHighFrequency::steering_wheel_angle() const { return m_steering_wheel_angle; } @@ -893,15 +721,17 @@ const etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::BasicV * @brief This function returns a reference to member steering_wheel_angle * @return Reference to member steering_wheel_angle */ -etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle() +etsi_its_cam_msgs::msg::SteeringWheelAngle& BasicVehicleContainerHighFrequency::steering_wheel_angle() { return m_steering_wheel_angle; } + + /*! * @brief This function sets a value in member steering_wheel_angle_is_present * @param _steering_wheel_angle_is_present New value for member steering_wheel_angle_is_present */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present( +void BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present( bool _steering_wheel_angle_is_present) { m_steering_wheel_angle_is_present = _steering_wheel_angle_is_present; @@ -911,7 +741,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_ * @brief This function returns the value of member steering_wheel_angle_is_present * @return Value of member steering_wheel_angle_is_present */ -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present() const +bool BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present() const { return m_steering_wheel_angle_is_present; } @@ -920,16 +750,17 @@ bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_ * @brief This function returns a reference to member steering_wheel_angle_is_present * @return Reference to member steering_wheel_angle_is_present */ -bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present() +bool& BasicVehicleContainerHighFrequency::steering_wheel_angle_is_present() { return m_steering_wheel_angle_is_present; } + /*! * @brief This function copies the value in member lateral_acceleration * @param _lateral_acceleration New value to be copied in member lateral_acceleration */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration( +void BasicVehicleContainerHighFrequency::lateral_acceleration( const etsi_its_cam_msgs::msg::LateralAcceleration& _lateral_acceleration) { m_lateral_acceleration = _lateral_acceleration; @@ -939,7 +770,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceler * @brief This function moves the value in member lateral_acceleration * @param _lateral_acceleration New value to be moved in member lateral_acceleration */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration( +void BasicVehicleContainerHighFrequency::lateral_acceleration( etsi_its_cam_msgs::msg::LateralAcceleration&& _lateral_acceleration) { m_lateral_acceleration = std::move(_lateral_acceleration); @@ -949,7 +780,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceler * @brief This function returns a constant reference to member lateral_acceleration * @return Constant reference to member lateral_acceleration */ -const etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration() const +const etsi_its_cam_msgs::msg::LateralAcceleration& BasicVehicleContainerHighFrequency::lateral_acceleration() const { return m_lateral_acceleration; } @@ -958,15 +789,17 @@ const etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::Basic * @brief This function returns a reference to member lateral_acceleration * @return Reference to member lateral_acceleration */ -etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration() +etsi_its_cam_msgs::msg::LateralAcceleration& BasicVehicleContainerHighFrequency::lateral_acceleration() { return m_lateral_acceleration; } + + /*! * @brief This function sets a value in member lateral_acceleration_is_present * @param _lateral_acceleration_is_present New value for member lateral_acceleration_is_present */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration_is_present( +void BasicVehicleContainerHighFrequency::lateral_acceleration_is_present( bool _lateral_acceleration_is_present) { m_lateral_acceleration_is_present = _lateral_acceleration_is_present; @@ -976,7 +809,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceler * @brief This function returns the value of member lateral_acceleration_is_present * @return Value of member lateral_acceleration_is_present */ -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration_is_present() const +bool BasicVehicleContainerHighFrequency::lateral_acceleration_is_present() const { return m_lateral_acceleration_is_present; } @@ -985,16 +818,17 @@ bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceler * @brief This function returns a reference to member lateral_acceleration_is_present * @return Reference to member lateral_acceleration_is_present */ -bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::lateral_acceleration_is_present() +bool& BasicVehicleContainerHighFrequency::lateral_acceleration_is_present() { return m_lateral_acceleration_is_present; } + /*! * @brief This function copies the value in member vertical_acceleration * @param _vertical_acceleration New value to be copied in member vertical_acceleration */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration( +void BasicVehicleContainerHighFrequency::vertical_acceleration( const etsi_its_cam_msgs::msg::VerticalAcceleration& _vertical_acceleration) { m_vertical_acceleration = _vertical_acceleration; @@ -1004,7 +838,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_accele * @brief This function moves the value in member vertical_acceleration * @param _vertical_acceleration New value to be moved in member vertical_acceleration */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration( +void BasicVehicleContainerHighFrequency::vertical_acceleration( etsi_its_cam_msgs::msg::VerticalAcceleration&& _vertical_acceleration) { m_vertical_acceleration = std::move(_vertical_acceleration); @@ -1014,7 +848,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_accele * @brief This function returns a constant reference to member vertical_acceleration * @return Constant reference to member vertical_acceleration */ -const etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration() const +const etsi_its_cam_msgs::msg::VerticalAcceleration& BasicVehicleContainerHighFrequency::vertical_acceleration() const { return m_vertical_acceleration; } @@ -1023,15 +857,17 @@ const etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::Basi * @brief This function returns a reference to member vertical_acceleration * @return Reference to member vertical_acceleration */ -etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration() +etsi_its_cam_msgs::msg::VerticalAcceleration& BasicVehicleContainerHighFrequency::vertical_acceleration() { return m_vertical_acceleration; } + + /*! * @brief This function sets a value in member vertical_acceleration_is_present * @param _vertical_acceleration_is_present New value for member vertical_acceleration_is_present */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration_is_present( +void BasicVehicleContainerHighFrequency::vertical_acceleration_is_present( bool _vertical_acceleration_is_present) { m_vertical_acceleration_is_present = _vertical_acceleration_is_present; @@ -1041,7 +877,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_accele * @brief This function returns the value of member vertical_acceleration_is_present * @return Value of member vertical_acceleration_is_present */ -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration_is_present() const +bool BasicVehicleContainerHighFrequency::vertical_acceleration_is_present() const { return m_vertical_acceleration_is_present; } @@ -1050,16 +886,17 @@ bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_accele * @brief This function returns a reference to member vertical_acceleration_is_present * @return Reference to member vertical_acceleration_is_present */ -bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::vertical_acceleration_is_present() +bool& BasicVehicleContainerHighFrequency::vertical_acceleration_is_present() { return m_vertical_acceleration_is_present; } + /*! * @brief This function copies the value in member performance_class * @param _performance_class New value to be copied in member performance_class */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class( +void BasicVehicleContainerHighFrequency::performance_class( const etsi_its_cam_msgs::msg::PerformanceClass& _performance_class) { m_performance_class = _performance_class; @@ -1069,7 +906,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_cla * @brief This function moves the value in member performance_class * @param _performance_class New value to be moved in member performance_class */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class( +void BasicVehicleContainerHighFrequency::performance_class( etsi_its_cam_msgs::msg::PerformanceClass&& _performance_class) { m_performance_class = std::move(_performance_class); @@ -1079,7 +916,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_cla * @brief This function returns a constant reference to member performance_class * @return Constant reference to member performance_class */ -const etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class() const +const etsi_its_cam_msgs::msg::PerformanceClass& BasicVehicleContainerHighFrequency::performance_class() const { return m_performance_class; } @@ -1088,15 +925,17 @@ const etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::BasicVeh * @brief This function returns a reference to member performance_class * @return Reference to member performance_class */ -etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class() +etsi_its_cam_msgs::msg::PerformanceClass& BasicVehicleContainerHighFrequency::performance_class() { return m_performance_class; } + + /*! * @brief This function sets a value in member performance_class_is_present * @param _performance_class_is_present New value for member performance_class_is_present */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class_is_present( +void BasicVehicleContainerHighFrequency::performance_class_is_present( bool _performance_class_is_present) { m_performance_class_is_present = _performance_class_is_present; @@ -1106,7 +945,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_cla * @brief This function returns the value of member performance_class_is_present * @return Value of member performance_class_is_present */ -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class_is_present() const +bool BasicVehicleContainerHighFrequency::performance_class_is_present() const { return m_performance_class_is_present; } @@ -1115,16 +954,17 @@ bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_cla * @brief This function returns a reference to member performance_class_is_present * @return Reference to member performance_class_is_present */ -bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::performance_class_is_present() +bool& BasicVehicleContainerHighFrequency::performance_class_is_present() { return m_performance_class_is_present; } + /*! * @brief This function copies the value in member cen_dsrc_tolling_zone * @param _cen_dsrc_tolling_zone New value to be copied in member cen_dsrc_tolling_zone */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone( +void BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone( const etsi_its_cam_msgs::msg::CenDsrcTollingZone& _cen_dsrc_tolling_zone) { m_cen_dsrc_tolling_zone = _cen_dsrc_tolling_zone; @@ -1134,7 +974,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tollin * @brief This function moves the value in member cen_dsrc_tolling_zone * @param _cen_dsrc_tolling_zone New value to be moved in member cen_dsrc_tolling_zone */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone( +void BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone( etsi_its_cam_msgs::msg::CenDsrcTollingZone&& _cen_dsrc_tolling_zone) { m_cen_dsrc_tolling_zone = std::move(_cen_dsrc_tolling_zone); @@ -1144,7 +984,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tollin * @brief This function returns a constant reference to member cen_dsrc_tolling_zone * @return Constant reference to member cen_dsrc_tolling_zone */ -const etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone() const +const etsi_its_cam_msgs::msg::CenDsrcTollingZone& BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone() const { return m_cen_dsrc_tolling_zone; } @@ -1153,15 +993,17 @@ const etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::BasicV * @brief This function returns a reference to member cen_dsrc_tolling_zone * @return Reference to member cen_dsrc_tolling_zone */ -etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone() +etsi_its_cam_msgs::msg::CenDsrcTollingZone& BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone() { return m_cen_dsrc_tolling_zone; } + + /*! * @brief This function sets a value in member cen_dsrc_tolling_zone_is_present * @param _cen_dsrc_tolling_zone_is_present New value for member cen_dsrc_tolling_zone_is_present */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present( +void BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present( bool _cen_dsrc_tolling_zone_is_present) { m_cen_dsrc_tolling_zone_is_present = _cen_dsrc_tolling_zone_is_present; @@ -1171,7 +1013,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tollin * @brief This function returns the value of member cen_dsrc_tolling_zone_is_present * @return Value of member cen_dsrc_tolling_zone_is_present */ -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present() const +bool BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present() const { return m_cen_dsrc_tolling_zone_is_present; } @@ -1180,32 +1022,18 @@ bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tollin * @brief This function returns a reference to member cen_dsrc_tolling_zone_is_present * @return Reference to member cen_dsrc_tolling_zone_is_present */ -bool& etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present() +bool& BasicVehicleContainerHighFrequency::cen_dsrc_tolling_zone_is_present() { return m_cen_dsrc_tolling_zone_is_present; } -size_t etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} - -bool etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "BasicVehicleContainerHighFrequencyCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.h index 2ebb6a5f341..03387d831c6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequency.h @@ -16,12 +16,23 @@ * @file BasicVehicleContainerHighFrequency.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "DriveDirection.h" #include "Speed.h" #include "Heading.h" @@ -39,12 +50,6 @@ #include "PerformanceClass.h" #include "AccelerationControl.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -58,705 +63,697 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(BasicVehicleContainerHighFrequency_SOURCE) -#define BasicVehicleContainerHighFrequency_DllAPI __declspec( dllexport ) +#if defined(BASICVEHICLECONTAINERHIGHFREQUENCY_SOURCE) +#define BASICVEHICLECONTAINERHIGHFREQUENCY_DllAPI __declspec( dllexport ) #else -#define BasicVehicleContainerHighFrequency_DllAPI __declspec( dllimport ) -#endif // BasicVehicleContainerHighFrequency_SOURCE +#define BASICVEHICLECONTAINERHIGHFREQUENCY_DllAPI __declspec( dllimport ) +#endif // BASICVEHICLECONTAINERHIGHFREQUENCY_SOURCE #else -#define BasicVehicleContainerHighFrequency_DllAPI +#define BASICVEHICLECONTAINERHIGHFREQUENCY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define BasicVehicleContainerHighFrequency_DllAPI +#define BASICVEHICLECONTAINERHIGHFREQUENCY_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure BasicVehicleContainerHighFrequency defined by the user in the IDL file. - * @ingroup BASICVEHICLECONTAINERHIGHFREQUENCY - */ - class BasicVehicleContainerHighFrequency - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicVehicleContainerHighFrequency(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicVehicleContainerHighFrequency(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. - */ - eProsima_user_DllExport BasicVehicleContainerHighFrequency( - const BasicVehicleContainerHighFrequency& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. - */ - eProsima_user_DllExport BasicVehicleContainerHighFrequency( - BasicVehicleContainerHighFrequency&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. - */ - eProsima_user_DllExport BasicVehicleContainerHighFrequency& operator =( - const BasicVehicleContainerHighFrequency& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. - */ - eProsima_user_DllExport BasicVehicleContainerHighFrequency& operator =( - BasicVehicleContainerHighFrequency&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicVehicleContainerHighFrequency& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicVehicleContainerHighFrequency& x) const; - - /*! - * @brief This function copies the value in member heading_ - * @param _heading New value to be copied in member heading_ - */ - eProsima_user_DllExport void heading( - const etsi_its_cam_msgs::msg::Heading& _heading); - - /*! - * @brief This function moves the value in member heading_ - * @param _heading New value to be moved in member heading_ - */ - eProsima_user_DllExport void heading( - etsi_its_cam_msgs::msg::Heading&& _heading); - - /*! - * @brief This function returns a constant reference to member heading_ - * @return Constant reference to member heading_ - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Heading& heading() const; - - /*! - * @brief This function returns a reference to member heading_ - * @return Reference to member heading_ - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Heading& heading(); - /*! - * @brief This function copies the value in member speed_ - * @param _speed New value to be copied in member speed_ - */ - eProsima_user_DllExport void speed( - const etsi_its_cam_msgs::msg::Speed& _speed); - - /*! - * @brief This function moves the value in member speed_ - * @param _speed New value to be moved in member speed_ - */ - eProsima_user_DllExport void speed( - etsi_its_cam_msgs::msg::Speed&& _speed); - - /*! - * @brief This function returns a constant reference to member speed_ - * @return Constant reference to member speed_ - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Speed& speed() const; - - /*! - * @brief This function returns a reference to member speed_ - * @return Reference to member speed_ - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Speed& speed(); - /*! - * @brief This function copies the value in member drive_direction - * @param _drive_direction New value to be copied in member drive_direction - */ - eProsima_user_DllExport void drive_direction( - const etsi_its_cam_msgs::msg::DriveDirection& _drive_direction); - - /*! - * @brief This function moves the value in member drive_direction - * @param _drive_direction New value to be moved in member drive_direction - */ - eProsima_user_DllExport void drive_direction( - etsi_its_cam_msgs::msg::DriveDirection&& _drive_direction); - - /*! - * @brief This function returns a constant reference to member drive_direction - * @return Constant reference to member drive_direction - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::DriveDirection& drive_direction() const; - - /*! - * @brief This function returns a reference to member drive_direction - * @return Reference to member drive_direction - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::DriveDirection& drive_direction(); - /*! - * @brief This function copies the value in member vehicle_length - * @param _vehicle_length New value to be copied in member vehicle_length - */ - eProsima_user_DllExport void vehicle_length( - const etsi_its_cam_msgs::msg::VehicleLength& _vehicle_length); - - /*! - * @brief This function moves the value in member vehicle_length - * @param _vehicle_length New value to be moved in member vehicle_length - */ - eProsima_user_DllExport void vehicle_length( - etsi_its_cam_msgs::msg::VehicleLength&& _vehicle_length); - - /*! - * @brief This function returns a constant reference to member vehicle_length - * @return Constant reference to member vehicle_length - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLength& vehicle_length() const; - - /*! - * @brief This function returns a reference to member vehicle_length - * @return Reference to member vehicle_length - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLength& vehicle_length(); - /*! - * @brief This function copies the value in member vehicle_width - * @param _vehicle_width New value to be copied in member vehicle_width - */ - eProsima_user_DllExport void vehicle_width( - const etsi_its_cam_msgs::msg::VehicleWidth& _vehicle_width); - - /*! - * @brief This function moves the value in member vehicle_width - * @param _vehicle_width New value to be moved in member vehicle_width - */ - eProsima_user_DllExport void vehicle_width( - etsi_its_cam_msgs::msg::VehicleWidth&& _vehicle_width); - - /*! - * @brief This function returns a constant reference to member vehicle_width - * @return Constant reference to member vehicle_width - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleWidth& vehicle_width() const; - - /*! - * @brief This function returns a reference to member vehicle_width - * @return Reference to member vehicle_width - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleWidth& vehicle_width(); - /*! - * @brief This function copies the value in member longitudinal_acceleration - * @param _longitudinal_acceleration New value to be copied in member longitudinal_acceleration - */ - eProsima_user_DllExport void longitudinal_acceleration( - const etsi_its_cam_msgs::msg::LongitudinalAcceleration& _longitudinal_acceleration); - - /*! - * @brief This function moves the value in member longitudinal_acceleration - * @param _longitudinal_acceleration New value to be moved in member longitudinal_acceleration - */ - eProsima_user_DllExport void longitudinal_acceleration( - etsi_its_cam_msgs::msg::LongitudinalAcceleration&& _longitudinal_acceleration); - - /*! - * @brief This function returns a constant reference to member longitudinal_acceleration - * @return Constant reference to member longitudinal_acceleration - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LongitudinalAcceleration& longitudinal_acceleration() const; - - /*! - * @brief This function returns a reference to member longitudinal_acceleration - * @return Reference to member longitudinal_acceleration - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LongitudinalAcceleration& longitudinal_acceleration(); - /*! - * @brief This function copies the value in member curvature_ - * @param _curvature New value to be copied in member curvature_ - */ - eProsima_user_DllExport void curvature( - const etsi_its_cam_msgs::msg::Curvature& _curvature); - - /*! - * @brief This function moves the value in member curvature_ - * @param _curvature New value to be moved in member curvature_ - */ - eProsima_user_DllExport void curvature( - etsi_its_cam_msgs::msg::Curvature&& _curvature); - - /*! - * @brief This function returns a constant reference to member curvature_ - * @return Constant reference to member curvature_ - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Curvature& curvature() const; - - /*! - * @brief This function returns a reference to member curvature_ - * @return Reference to member curvature_ - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Curvature& curvature(); - /*! - * @brief This function copies the value in member curvature_calculation_mode - * @param _curvature_calculation_mode New value to be copied in member curvature_calculation_mode - */ - eProsima_user_DllExport void curvature_calculation_mode( - const etsi_its_cam_msgs::msg::CurvatureCalculationMode& _curvature_calculation_mode); - - /*! - * @brief This function moves the value in member curvature_calculation_mode - * @param _curvature_calculation_mode New value to be moved in member curvature_calculation_mode - */ - eProsima_user_DllExport void curvature_calculation_mode( - etsi_its_cam_msgs::msg::CurvatureCalculationMode&& _curvature_calculation_mode); - - /*! - * @brief This function returns a constant reference to member curvature_calculation_mode - * @return Constant reference to member curvature_calculation_mode - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureCalculationMode& curvature_calculation_mode() const; - - /*! - * @brief This function returns a reference to member curvature_calculation_mode - * @return Reference to member curvature_calculation_mode - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureCalculationMode& curvature_calculation_mode(); - /*! - * @brief This function copies the value in member yaw_rate - * @param _yaw_rate New value to be copied in member yaw_rate - */ - eProsima_user_DllExport void yaw_rate( - const etsi_its_cam_msgs::msg::YawRate& _yaw_rate); - - /*! - * @brief This function moves the value in member yaw_rate - * @param _yaw_rate New value to be moved in member yaw_rate - */ - eProsima_user_DllExport void yaw_rate( - etsi_its_cam_msgs::msg::YawRate&& _yaw_rate); - - /*! - * @brief This function returns a constant reference to member yaw_rate - * @return Constant reference to member yaw_rate - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRate& yaw_rate() const; - - /*! - * @brief This function returns a reference to member yaw_rate - * @return Reference to member yaw_rate - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRate& yaw_rate(); - /*! - * @brief This function copies the value in member acceleration_control - * @param _acceleration_control New value to be copied in member acceleration_control - */ - eProsima_user_DllExport void acceleration_control( - const etsi_its_cam_msgs::msg::AccelerationControl& _acceleration_control); - - /*! - * @brief This function moves the value in member acceleration_control - * @param _acceleration_control New value to be moved in member acceleration_control - */ - eProsima_user_DllExport void acceleration_control( - etsi_its_cam_msgs::msg::AccelerationControl&& _acceleration_control); - - /*! - * @brief This function returns a constant reference to member acceleration_control - * @return Constant reference to member acceleration_control - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationControl& acceleration_control() const; - - /*! - * @brief This function returns a reference to member acceleration_control - * @return Reference to member acceleration_control - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationControl& acceleration_control(); - /*! - * @brief This function sets a value in member acceleration_control_is_present - * @param _acceleration_control_is_present New value for member acceleration_control_is_present - */ - eProsima_user_DllExport void acceleration_control_is_present( - bool _acceleration_control_is_present); - - /*! - * @brief This function returns the value of member acceleration_control_is_present - * @return Value of member acceleration_control_is_present - */ - eProsima_user_DllExport bool acceleration_control_is_present() const; - - /*! - * @brief This function returns a reference to member acceleration_control_is_present - * @return Reference to member acceleration_control_is_present - */ - eProsima_user_DllExport bool& acceleration_control_is_present(); - - /*! - * @brief This function copies the value in member lane_position - * @param _lane_position New value to be copied in member lane_position - */ - eProsima_user_DllExport void lane_position( - const etsi_its_cam_msgs::msg::LanePosition& _lane_position); - - /*! - * @brief This function moves the value in member lane_position - * @param _lane_position New value to be moved in member lane_position - */ - eProsima_user_DllExport void lane_position( - etsi_its_cam_msgs::msg::LanePosition&& _lane_position); - - /*! - * @brief This function returns a constant reference to member lane_position - * @return Constant reference to member lane_position - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LanePosition& lane_position() const; - - /*! - * @brief This function returns a reference to member lane_position - * @return Reference to member lane_position - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LanePosition& lane_position(); - /*! - * @brief This function sets a value in member lane_position_is_present - * @param _lane_position_is_present New value for member lane_position_is_present - */ - eProsima_user_DllExport void lane_position_is_present( - bool _lane_position_is_present); - - /*! - * @brief This function returns the value of member lane_position_is_present - * @return Value of member lane_position_is_present - */ - eProsima_user_DllExport bool lane_position_is_present() const; - - /*! - * @brief This function returns a reference to member lane_position_is_present - * @return Reference to member lane_position_is_present - */ - eProsima_user_DllExport bool& lane_position_is_present(); - - /*! - * @brief This function copies the value in member steering_wheel_angle - * @param _steering_wheel_angle New value to be copied in member steering_wheel_angle - */ - eProsima_user_DllExport void steering_wheel_angle( - const etsi_its_cam_msgs::msg::SteeringWheelAngle& _steering_wheel_angle); - - /*! - * @brief This function moves the value in member steering_wheel_angle - * @param _steering_wheel_angle New value to be moved in member steering_wheel_angle - */ - eProsima_user_DllExport void steering_wheel_angle( - etsi_its_cam_msgs::msg::SteeringWheelAngle&& _steering_wheel_angle); - - /*! - * @brief This function returns a constant reference to member steering_wheel_angle - * @return Constant reference to member steering_wheel_angle - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngle& steering_wheel_angle() const; - - /*! - * @brief This function returns a reference to member steering_wheel_angle - * @return Reference to member steering_wheel_angle - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngle& steering_wheel_angle(); - /*! - * @brief This function sets a value in member steering_wheel_angle_is_present - * @param _steering_wheel_angle_is_present New value for member steering_wheel_angle_is_present - */ - eProsima_user_DllExport void steering_wheel_angle_is_present( - bool _steering_wheel_angle_is_present); - - /*! - * @brief This function returns the value of member steering_wheel_angle_is_present - * @return Value of member steering_wheel_angle_is_present - */ - eProsima_user_DllExport bool steering_wheel_angle_is_present() const; - - /*! - * @brief This function returns a reference to member steering_wheel_angle_is_present - * @return Reference to member steering_wheel_angle_is_present - */ - eProsima_user_DllExport bool& steering_wheel_angle_is_present(); - - /*! - * @brief This function copies the value in member lateral_acceleration - * @param _lateral_acceleration New value to be copied in member lateral_acceleration - */ - eProsima_user_DllExport void lateral_acceleration( - const etsi_its_cam_msgs::msg::LateralAcceleration& _lateral_acceleration); - - /*! - * @brief This function moves the value in member lateral_acceleration - * @param _lateral_acceleration New value to be moved in member lateral_acceleration - */ - eProsima_user_DllExport void lateral_acceleration( - etsi_its_cam_msgs::msg::LateralAcceleration&& _lateral_acceleration); - - /*! - * @brief This function returns a constant reference to member lateral_acceleration - * @return Constant reference to member lateral_acceleration - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LateralAcceleration& lateral_acceleration() const; - - /*! - * @brief This function returns a reference to member lateral_acceleration - * @return Reference to member lateral_acceleration - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LateralAcceleration& lateral_acceleration(); - /*! - * @brief This function sets a value in member lateral_acceleration_is_present - * @param _lateral_acceleration_is_present New value for member lateral_acceleration_is_present - */ - eProsima_user_DllExport void lateral_acceleration_is_present( - bool _lateral_acceleration_is_present); - - /*! - * @brief This function returns the value of member lateral_acceleration_is_present - * @return Value of member lateral_acceleration_is_present - */ - eProsima_user_DllExport bool lateral_acceleration_is_present() const; - - /*! - * @brief This function returns a reference to member lateral_acceleration_is_present - * @return Reference to member lateral_acceleration_is_present - */ - eProsima_user_DllExport bool& lateral_acceleration_is_present(); - - /*! - * @brief This function copies the value in member vertical_acceleration - * @param _vertical_acceleration New value to be copied in member vertical_acceleration - */ - eProsima_user_DllExport void vertical_acceleration( - const etsi_its_cam_msgs::msg::VerticalAcceleration& _vertical_acceleration); - - /*! - * @brief This function moves the value in member vertical_acceleration - * @param _vertical_acceleration New value to be moved in member vertical_acceleration - */ - eProsima_user_DllExport void vertical_acceleration( - etsi_its_cam_msgs::msg::VerticalAcceleration&& _vertical_acceleration); - - /*! - * @brief This function returns a constant reference to member vertical_acceleration - * @return Constant reference to member vertical_acceleration - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::VerticalAcceleration& vertical_acceleration() const; - - /*! - * @brief This function returns a reference to member vertical_acceleration - * @return Reference to member vertical_acceleration - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::VerticalAcceleration& vertical_acceleration(); - /*! - * @brief This function sets a value in member vertical_acceleration_is_present - * @param _vertical_acceleration_is_present New value for member vertical_acceleration_is_present - */ - eProsima_user_DllExport void vertical_acceleration_is_present( - bool _vertical_acceleration_is_present); - - /*! - * @brief This function returns the value of member vertical_acceleration_is_present - * @return Value of member vertical_acceleration_is_present - */ - eProsima_user_DllExport bool vertical_acceleration_is_present() const; - - /*! - * @brief This function returns a reference to member vertical_acceleration_is_present - * @return Reference to member vertical_acceleration_is_present - */ - eProsima_user_DllExport bool& vertical_acceleration_is_present(); - - /*! - * @brief This function copies the value in member performance_class - * @param _performance_class New value to be copied in member performance_class - */ - eProsima_user_DllExport void performance_class( - const etsi_its_cam_msgs::msg::PerformanceClass& _performance_class); - - /*! - * @brief This function moves the value in member performance_class - * @param _performance_class New value to be moved in member performance_class - */ - eProsima_user_DllExport void performance_class( - etsi_its_cam_msgs::msg::PerformanceClass&& _performance_class); - - /*! - * @brief This function returns a constant reference to member performance_class - * @return Constant reference to member performance_class - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::PerformanceClass& performance_class() const; - - /*! - * @brief This function returns a reference to member performance_class - * @return Reference to member performance_class - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::PerformanceClass& performance_class(); - /*! - * @brief This function sets a value in member performance_class_is_present - * @param _performance_class_is_present New value for member performance_class_is_present - */ - eProsima_user_DllExport void performance_class_is_present( - bool _performance_class_is_present); - - /*! - * @brief This function returns the value of member performance_class_is_present - * @return Value of member performance_class_is_present - */ - eProsima_user_DllExport bool performance_class_is_present() const; - - /*! - * @brief This function returns a reference to member performance_class_is_present - * @return Reference to member performance_class_is_present - */ - eProsima_user_DllExport bool& performance_class_is_present(); - - /*! - * @brief This function copies the value in member cen_dsrc_tolling_zone - * @param _cen_dsrc_tolling_zone New value to be copied in member cen_dsrc_tolling_zone - */ - eProsima_user_DllExport void cen_dsrc_tolling_zone( - const etsi_its_cam_msgs::msg::CenDsrcTollingZone& _cen_dsrc_tolling_zone); - - /*! - * @brief This function moves the value in member cen_dsrc_tolling_zone - * @param _cen_dsrc_tolling_zone New value to be moved in member cen_dsrc_tolling_zone - */ - eProsima_user_DllExport void cen_dsrc_tolling_zone( - etsi_its_cam_msgs::msg::CenDsrcTollingZone&& _cen_dsrc_tolling_zone); - - /*! - * @brief This function returns a constant reference to member cen_dsrc_tolling_zone - * @return Constant reference to member cen_dsrc_tolling_zone - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CenDsrcTollingZone& cen_dsrc_tolling_zone() const; - - /*! - * @brief This function returns a reference to member cen_dsrc_tolling_zone - * @return Reference to member cen_dsrc_tolling_zone - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CenDsrcTollingZone& cen_dsrc_tolling_zone(); - /*! - * @brief This function sets a value in member cen_dsrc_tolling_zone_is_present - * @param _cen_dsrc_tolling_zone_is_present New value for member cen_dsrc_tolling_zone_is_present - */ - eProsima_user_DllExport void cen_dsrc_tolling_zone_is_present( - bool _cen_dsrc_tolling_zone_is_present); - - /*! - * @brief This function returns the value of member cen_dsrc_tolling_zone_is_present - * @return Value of member cen_dsrc_tolling_zone_is_present - */ - eProsima_user_DllExport bool cen_dsrc_tolling_zone_is_present() const; - - /*! - * @brief This function returns a reference to member cen_dsrc_tolling_zone_is_present - * @return Reference to member cen_dsrc_tolling_zone_is_present - */ - eProsima_user_DllExport bool& cen_dsrc_tolling_zone_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::Heading m_heading; - etsi_its_cam_msgs::msg::Speed m_speed; - etsi_its_cam_msgs::msg::DriveDirection m_drive_direction; - etsi_its_cam_msgs::msg::VehicleLength m_vehicle_length; - etsi_its_cam_msgs::msg::VehicleWidth m_vehicle_width; - etsi_its_cam_msgs::msg::LongitudinalAcceleration m_longitudinal_acceleration; - etsi_its_cam_msgs::msg::Curvature m_curvature; - etsi_its_cam_msgs::msg::CurvatureCalculationMode m_curvature_calculation_mode; - etsi_its_cam_msgs::msg::YawRate m_yaw_rate; - etsi_its_cam_msgs::msg::AccelerationControl m_acceleration_control; - bool m_acceleration_control_is_present; - etsi_its_cam_msgs::msg::LanePosition m_lane_position; - bool m_lane_position_is_present; - etsi_its_cam_msgs::msg::SteeringWheelAngle m_steering_wheel_angle; - bool m_steering_wheel_angle_is_present; - etsi_its_cam_msgs::msg::LateralAcceleration m_lateral_acceleration; - bool m_lateral_acceleration_is_present; - etsi_its_cam_msgs::msg::VerticalAcceleration m_vertical_acceleration; - bool m_vertical_acceleration_is_present; - etsi_its_cam_msgs::msg::PerformanceClass m_performance_class; - bool m_performance_class_is_present; - etsi_its_cam_msgs::msg::CenDsrcTollingZone m_cen_dsrc_tolling_zone; - bool m_cen_dsrc_tolling_zone_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure BasicVehicleContainerHighFrequency defined by the user in the IDL file. + * @ingroup BasicVehicleContainerHighFrequency + */ +class BasicVehicleContainerHighFrequency +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicVehicleContainerHighFrequency(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency( + const BasicVehicleContainerHighFrequency& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency( + BasicVehicleContainerHighFrequency&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency& operator =( + const BasicVehicleContainerHighFrequency& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerHighFrequency& operator =( + BasicVehicleContainerHighFrequency&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicVehicleContainerHighFrequency& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicVehicleContainerHighFrequency& x) const; + + /*! + * @brief This function copies the value in member heading + * @param _heading New value to be copied in member heading + */ + eProsima_user_DllExport void heading( + const etsi_its_cam_msgs::msg::Heading& _heading); + + /*! + * @brief This function moves the value in member heading + * @param _heading New value to be moved in member heading + */ + eProsima_user_DllExport void heading( + etsi_its_cam_msgs::msg::Heading&& _heading); + + /*! + * @brief This function returns a constant reference to member heading + * @return Constant reference to member heading + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Heading& heading() const; + + /*! + * @brief This function returns a reference to member heading + * @return Reference to member heading + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Heading& heading(); + + + /*! + * @brief This function copies the value in member speed + * @param _speed New value to be copied in member speed + */ + eProsima_user_DllExport void speed( + const etsi_its_cam_msgs::msg::Speed& _speed); + + /*! + * @brief This function moves the value in member speed + * @param _speed New value to be moved in member speed + */ + eProsima_user_DllExport void speed( + etsi_its_cam_msgs::msg::Speed&& _speed); + + /*! + * @brief This function returns a constant reference to member speed + * @return Constant reference to member speed + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Speed& speed() const; + + /*! + * @brief This function returns a reference to member speed + * @return Reference to member speed + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Speed& speed(); + + + /*! + * @brief This function copies the value in member drive_direction + * @param _drive_direction New value to be copied in member drive_direction + */ + eProsima_user_DllExport void drive_direction( + const etsi_its_cam_msgs::msg::DriveDirection& _drive_direction); + + /*! + * @brief This function moves the value in member drive_direction + * @param _drive_direction New value to be moved in member drive_direction + */ + eProsima_user_DllExport void drive_direction( + etsi_its_cam_msgs::msg::DriveDirection&& _drive_direction); + + /*! + * @brief This function returns a constant reference to member drive_direction + * @return Constant reference to member drive_direction + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DriveDirection& drive_direction() const; + + /*! + * @brief This function returns a reference to member drive_direction + * @return Reference to member drive_direction + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DriveDirection& drive_direction(); + + + /*! + * @brief This function copies the value in member vehicle_length + * @param _vehicle_length New value to be copied in member vehicle_length + */ + eProsima_user_DllExport void vehicle_length( + const etsi_its_cam_msgs::msg::VehicleLength& _vehicle_length); + + /*! + * @brief This function moves the value in member vehicle_length + * @param _vehicle_length New value to be moved in member vehicle_length + */ + eProsima_user_DllExport void vehicle_length( + etsi_its_cam_msgs::msg::VehicleLength&& _vehicle_length); + + /*! + * @brief This function returns a constant reference to member vehicle_length + * @return Constant reference to member vehicle_length + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLength& vehicle_length() const; + + /*! + * @brief This function returns a reference to member vehicle_length + * @return Reference to member vehicle_length + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLength& vehicle_length(); + + + /*! + * @brief This function copies the value in member vehicle_width + * @param _vehicle_width New value to be copied in member vehicle_width + */ + eProsima_user_DllExport void vehicle_width( + const etsi_its_cam_msgs::msg::VehicleWidth& _vehicle_width); + + /*! + * @brief This function moves the value in member vehicle_width + * @param _vehicle_width New value to be moved in member vehicle_width + */ + eProsima_user_DllExport void vehicle_width( + etsi_its_cam_msgs::msg::VehicleWidth&& _vehicle_width); + + /*! + * @brief This function returns a constant reference to member vehicle_width + * @return Constant reference to member vehicle_width + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleWidth& vehicle_width() const; + + /*! + * @brief This function returns a reference to member vehicle_width + * @return Reference to member vehicle_width + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleWidth& vehicle_width(); + + + /*! + * @brief This function copies the value in member longitudinal_acceleration + * @param _longitudinal_acceleration New value to be copied in member longitudinal_acceleration + */ + eProsima_user_DllExport void longitudinal_acceleration( + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& _longitudinal_acceleration); + + /*! + * @brief This function moves the value in member longitudinal_acceleration + * @param _longitudinal_acceleration New value to be moved in member longitudinal_acceleration + */ + eProsima_user_DllExport void longitudinal_acceleration( + etsi_its_cam_msgs::msg::LongitudinalAcceleration&& _longitudinal_acceleration); + + /*! + * @brief This function returns a constant reference to member longitudinal_acceleration + * @return Constant reference to member longitudinal_acceleration + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LongitudinalAcceleration& longitudinal_acceleration() const; + + /*! + * @brief This function returns a reference to member longitudinal_acceleration + * @return Reference to member longitudinal_acceleration + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LongitudinalAcceleration& longitudinal_acceleration(); + + + /*! + * @brief This function copies the value in member curvature + * @param _curvature New value to be copied in member curvature + */ + eProsima_user_DllExport void curvature( + const etsi_its_cam_msgs::msg::Curvature& _curvature); + + /*! + * @brief This function moves the value in member curvature + * @param _curvature New value to be moved in member curvature + */ + eProsima_user_DllExport void curvature( + etsi_its_cam_msgs::msg::Curvature&& _curvature); + + /*! + * @brief This function returns a constant reference to member curvature + * @return Constant reference to member curvature + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Curvature& curvature() const; + + /*! + * @brief This function returns a reference to member curvature + * @return Reference to member curvature + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Curvature& curvature(); + + + /*! + * @brief This function copies the value in member curvature_calculation_mode + * @param _curvature_calculation_mode New value to be copied in member curvature_calculation_mode + */ + eProsima_user_DllExport void curvature_calculation_mode( + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& _curvature_calculation_mode); + + /*! + * @brief This function moves the value in member curvature_calculation_mode + * @param _curvature_calculation_mode New value to be moved in member curvature_calculation_mode + */ + eProsima_user_DllExport void curvature_calculation_mode( + etsi_its_cam_msgs::msg::CurvatureCalculationMode&& _curvature_calculation_mode); + + /*! + * @brief This function returns a constant reference to member curvature_calculation_mode + * @return Constant reference to member curvature_calculation_mode + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureCalculationMode& curvature_calculation_mode() const; + + /*! + * @brief This function returns a reference to member curvature_calculation_mode + * @return Reference to member curvature_calculation_mode + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureCalculationMode& curvature_calculation_mode(); + + + /*! + * @brief This function copies the value in member yaw_rate + * @param _yaw_rate New value to be copied in member yaw_rate + */ + eProsima_user_DllExport void yaw_rate( + const etsi_its_cam_msgs::msg::YawRate& _yaw_rate); + + /*! + * @brief This function moves the value in member yaw_rate + * @param _yaw_rate New value to be moved in member yaw_rate + */ + eProsima_user_DllExport void yaw_rate( + etsi_its_cam_msgs::msg::YawRate&& _yaw_rate); + + /*! + * @brief This function returns a constant reference to member yaw_rate + * @return Constant reference to member yaw_rate + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRate& yaw_rate() const; + + /*! + * @brief This function returns a reference to member yaw_rate + * @return Reference to member yaw_rate + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRate& yaw_rate(); + + + /*! + * @brief This function copies the value in member acceleration_control + * @param _acceleration_control New value to be copied in member acceleration_control + */ + eProsima_user_DllExport void acceleration_control( + const etsi_its_cam_msgs::msg::AccelerationControl& _acceleration_control); + + /*! + * @brief This function moves the value in member acceleration_control + * @param _acceleration_control New value to be moved in member acceleration_control + */ + eProsima_user_DllExport void acceleration_control( + etsi_its_cam_msgs::msg::AccelerationControl&& _acceleration_control); + + /*! + * @brief This function returns a constant reference to member acceleration_control + * @return Constant reference to member acceleration_control + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationControl& acceleration_control() const; + + /*! + * @brief This function returns a reference to member acceleration_control + * @return Reference to member acceleration_control + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationControl& acceleration_control(); + + + /*! + * @brief This function sets a value in member acceleration_control_is_present + * @param _acceleration_control_is_present New value for member acceleration_control_is_present + */ + eProsima_user_DllExport void acceleration_control_is_present( + bool _acceleration_control_is_present); + + /*! + * @brief This function returns the value of member acceleration_control_is_present + * @return Value of member acceleration_control_is_present + */ + eProsima_user_DllExport bool acceleration_control_is_present() const; + + /*! + * @brief This function returns a reference to member acceleration_control_is_present + * @return Reference to member acceleration_control_is_present + */ + eProsima_user_DllExport bool& acceleration_control_is_present(); + + + /*! + * @brief This function copies the value in member lane_position + * @param _lane_position New value to be copied in member lane_position + */ + eProsima_user_DllExport void lane_position( + const etsi_its_cam_msgs::msg::LanePosition& _lane_position); + + /*! + * @brief This function moves the value in member lane_position + * @param _lane_position New value to be moved in member lane_position + */ + eProsima_user_DllExport void lane_position( + etsi_its_cam_msgs::msg::LanePosition&& _lane_position); + + /*! + * @brief This function returns a constant reference to member lane_position + * @return Constant reference to member lane_position + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LanePosition& lane_position() const; + + /*! + * @brief This function returns a reference to member lane_position + * @return Reference to member lane_position + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LanePosition& lane_position(); + + + /*! + * @brief This function sets a value in member lane_position_is_present + * @param _lane_position_is_present New value for member lane_position_is_present + */ + eProsima_user_DllExport void lane_position_is_present( + bool _lane_position_is_present); + + /*! + * @brief This function returns the value of member lane_position_is_present + * @return Value of member lane_position_is_present + */ + eProsima_user_DllExport bool lane_position_is_present() const; + + /*! + * @brief This function returns a reference to member lane_position_is_present + * @return Reference to member lane_position_is_present + */ + eProsima_user_DllExport bool& lane_position_is_present(); + + + /*! + * @brief This function copies the value in member steering_wheel_angle + * @param _steering_wheel_angle New value to be copied in member steering_wheel_angle + */ + eProsima_user_DllExport void steering_wheel_angle( + const etsi_its_cam_msgs::msg::SteeringWheelAngle& _steering_wheel_angle); + + /*! + * @brief This function moves the value in member steering_wheel_angle + * @param _steering_wheel_angle New value to be moved in member steering_wheel_angle + */ + eProsima_user_DllExport void steering_wheel_angle( + etsi_its_cam_msgs::msg::SteeringWheelAngle&& _steering_wheel_angle); + + /*! + * @brief This function returns a constant reference to member steering_wheel_angle + * @return Constant reference to member steering_wheel_angle + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngle& steering_wheel_angle() const; + + /*! + * @brief This function returns a reference to member steering_wheel_angle + * @return Reference to member steering_wheel_angle + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngle& steering_wheel_angle(); + + + /*! + * @brief This function sets a value in member steering_wheel_angle_is_present + * @param _steering_wheel_angle_is_present New value for member steering_wheel_angle_is_present + */ + eProsima_user_DllExport void steering_wheel_angle_is_present( + bool _steering_wheel_angle_is_present); + + /*! + * @brief This function returns the value of member steering_wheel_angle_is_present + * @return Value of member steering_wheel_angle_is_present + */ + eProsima_user_DllExport bool steering_wheel_angle_is_present() const; + + /*! + * @brief This function returns a reference to member steering_wheel_angle_is_present + * @return Reference to member steering_wheel_angle_is_present + */ + eProsima_user_DllExport bool& steering_wheel_angle_is_present(); + + + /*! + * @brief This function copies the value in member lateral_acceleration + * @param _lateral_acceleration New value to be copied in member lateral_acceleration + */ + eProsima_user_DllExport void lateral_acceleration( + const etsi_its_cam_msgs::msg::LateralAcceleration& _lateral_acceleration); + + /*! + * @brief This function moves the value in member lateral_acceleration + * @param _lateral_acceleration New value to be moved in member lateral_acceleration + */ + eProsima_user_DllExport void lateral_acceleration( + etsi_its_cam_msgs::msg::LateralAcceleration&& _lateral_acceleration); + + /*! + * @brief This function returns a constant reference to member lateral_acceleration + * @return Constant reference to member lateral_acceleration + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LateralAcceleration& lateral_acceleration() const; + + /*! + * @brief This function returns a reference to member lateral_acceleration + * @return Reference to member lateral_acceleration + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LateralAcceleration& lateral_acceleration(); + + + /*! + * @brief This function sets a value in member lateral_acceleration_is_present + * @param _lateral_acceleration_is_present New value for member lateral_acceleration_is_present + */ + eProsima_user_DllExport void lateral_acceleration_is_present( + bool _lateral_acceleration_is_present); + + /*! + * @brief This function returns the value of member lateral_acceleration_is_present + * @return Value of member lateral_acceleration_is_present + */ + eProsima_user_DllExport bool lateral_acceleration_is_present() const; + + /*! + * @brief This function returns a reference to member lateral_acceleration_is_present + * @return Reference to member lateral_acceleration_is_present + */ + eProsima_user_DllExport bool& lateral_acceleration_is_present(); + + + /*! + * @brief This function copies the value in member vertical_acceleration + * @param _vertical_acceleration New value to be copied in member vertical_acceleration + */ + eProsima_user_DllExport void vertical_acceleration( + const etsi_its_cam_msgs::msg::VerticalAcceleration& _vertical_acceleration); + + /*! + * @brief This function moves the value in member vertical_acceleration + * @param _vertical_acceleration New value to be moved in member vertical_acceleration + */ + eProsima_user_DllExport void vertical_acceleration( + etsi_its_cam_msgs::msg::VerticalAcceleration&& _vertical_acceleration); + + /*! + * @brief This function returns a constant reference to member vertical_acceleration + * @return Constant reference to member vertical_acceleration + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VerticalAcceleration& vertical_acceleration() const; + + /*! + * @brief This function returns a reference to member vertical_acceleration + * @return Reference to member vertical_acceleration + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VerticalAcceleration& vertical_acceleration(); + + + /*! + * @brief This function sets a value in member vertical_acceleration_is_present + * @param _vertical_acceleration_is_present New value for member vertical_acceleration_is_present + */ + eProsima_user_DllExport void vertical_acceleration_is_present( + bool _vertical_acceleration_is_present); + + /*! + * @brief This function returns the value of member vertical_acceleration_is_present + * @return Value of member vertical_acceleration_is_present + */ + eProsima_user_DllExport bool vertical_acceleration_is_present() const; + + /*! + * @brief This function returns a reference to member vertical_acceleration_is_present + * @return Reference to member vertical_acceleration_is_present + */ + eProsima_user_DllExport bool& vertical_acceleration_is_present(); + + + /*! + * @brief This function copies the value in member performance_class + * @param _performance_class New value to be copied in member performance_class + */ + eProsima_user_DllExport void performance_class( + const etsi_its_cam_msgs::msg::PerformanceClass& _performance_class); + + /*! + * @brief This function moves the value in member performance_class + * @param _performance_class New value to be moved in member performance_class + */ + eProsima_user_DllExport void performance_class( + etsi_its_cam_msgs::msg::PerformanceClass&& _performance_class); + + /*! + * @brief This function returns a constant reference to member performance_class + * @return Constant reference to member performance_class + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PerformanceClass& performance_class() const; + + /*! + * @brief This function returns a reference to member performance_class + * @return Reference to member performance_class + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PerformanceClass& performance_class(); + + + /*! + * @brief This function sets a value in member performance_class_is_present + * @param _performance_class_is_present New value for member performance_class_is_present + */ + eProsima_user_DllExport void performance_class_is_present( + bool _performance_class_is_present); + + /*! + * @brief This function returns the value of member performance_class_is_present + * @return Value of member performance_class_is_present + */ + eProsima_user_DllExport bool performance_class_is_present() const; + + /*! + * @brief This function returns a reference to member performance_class_is_present + * @return Reference to member performance_class_is_present + */ + eProsima_user_DllExport bool& performance_class_is_present(); + + + /*! + * @brief This function copies the value in member cen_dsrc_tolling_zone + * @param _cen_dsrc_tolling_zone New value to be copied in member cen_dsrc_tolling_zone + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone( + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& _cen_dsrc_tolling_zone); + + /*! + * @brief This function moves the value in member cen_dsrc_tolling_zone + * @param _cen_dsrc_tolling_zone New value to be moved in member cen_dsrc_tolling_zone + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone( + etsi_its_cam_msgs::msg::CenDsrcTollingZone&& _cen_dsrc_tolling_zone); + + /*! + * @brief This function returns a constant reference to member cen_dsrc_tolling_zone + * @return Constant reference to member cen_dsrc_tolling_zone + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CenDsrcTollingZone& cen_dsrc_tolling_zone() const; + + /*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone + * @return Reference to member cen_dsrc_tolling_zone + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CenDsrcTollingZone& cen_dsrc_tolling_zone(); + + + /*! + * @brief This function sets a value in member cen_dsrc_tolling_zone_is_present + * @param _cen_dsrc_tolling_zone_is_present New value for member cen_dsrc_tolling_zone_is_present + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone_is_present( + bool _cen_dsrc_tolling_zone_is_present); + + /*! + * @brief This function returns the value of member cen_dsrc_tolling_zone_is_present + * @return Value of member cen_dsrc_tolling_zone_is_present + */ + eProsima_user_DllExport bool cen_dsrc_tolling_zone_is_present() const; + + /*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_is_present + * @return Reference to member cen_dsrc_tolling_zone_is_present + */ + eProsima_user_DllExport bool& cen_dsrc_tolling_zone_is_present(); + +private: + + etsi_its_cam_msgs::msg::Heading m_heading; + etsi_its_cam_msgs::msg::Speed m_speed; + etsi_its_cam_msgs::msg::DriveDirection m_drive_direction; + etsi_its_cam_msgs::msg::VehicleLength m_vehicle_length; + etsi_its_cam_msgs::msg::VehicleWidth m_vehicle_width; + etsi_its_cam_msgs::msg::LongitudinalAcceleration m_longitudinal_acceleration; + etsi_its_cam_msgs::msg::Curvature m_curvature; + etsi_its_cam_msgs::msg::CurvatureCalculationMode m_curvature_calculation_mode; + etsi_its_cam_msgs::msg::YawRate m_yaw_rate; + etsi_its_cam_msgs::msg::AccelerationControl m_acceleration_control; + bool m_acceleration_control_is_present{false}; + etsi_its_cam_msgs::msg::LanePosition m_lane_position; + bool m_lane_position_is_present{false}; + etsi_its_cam_msgs::msg::SteeringWheelAngle m_steering_wheel_angle; + bool m_steering_wheel_angle_is_present{false}; + etsi_its_cam_msgs::msg::LateralAcceleration m_lateral_acceleration; + bool m_lateral_acceleration_is_present{false}; + etsi_its_cam_msgs::msg::VerticalAcceleration m_vertical_acceleration; + bool m_vertical_acceleration_is_present{false}; + etsi_its_cam_msgs::msg::PerformanceClass m_performance_class; + bool m_performance_class_is_present{false}; + etsi_its_cam_msgs::msg::CenDsrcTollingZone m_cen_dsrc_tolling_zone; + bool m_cen_dsrc_tolling_zone_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyCdrAux.hpp new file mode 100644 index 00000000000..7fdc325980f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyCdrAux.hpp @@ -0,0 +1,58 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerHighFrequencyCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCYCDRAUX_HPP_ + +#include "BasicVehicleContainerHighFrequency.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_BasicVehicleContainerHighFrequency_max_cdr_typesize {370UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_BasicVehicleContainerHighFrequency_max_key_cdr_typesize {0UL}; + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyCdrAux.ipp new file mode 100644 index 00000000000..c8d783db9a0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyCdrAux.ipp @@ -0,0 +1,306 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerHighFrequencyCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCYCDRAUX_IPP_ + +#include "BasicVehicleContainerHighFrequencyCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.heading(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.speed(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.drive_direction(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.vehicle_length(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.vehicle_width(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.longitudinal_acceleration(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.curvature(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.curvature_calculation_mode(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.yaw_rate(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.acceleration_control(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.acceleration_control_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.lane_position(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), + data.lane_position_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), + data.steering_wheel_angle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14), + data.steering_wheel_angle_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15), + data.lateral_acceleration(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16), + data.lateral_acceleration_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17), + data.vertical_acceleration(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18), + data.vertical_acceleration_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19), + data.performance_class(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(20), + data.performance_class_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(21), + data.cen_dsrc_tolling_zone(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(22), + data.cen_dsrc_tolling_zone_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.heading() + << eprosima::fastcdr::MemberId(1) << data.speed() + << eprosima::fastcdr::MemberId(2) << data.drive_direction() + << eprosima::fastcdr::MemberId(3) << data.vehicle_length() + << eprosima::fastcdr::MemberId(4) << data.vehicle_width() + << eprosima::fastcdr::MemberId(5) << data.longitudinal_acceleration() + << eprosima::fastcdr::MemberId(6) << data.curvature() + << eprosima::fastcdr::MemberId(7) << data.curvature_calculation_mode() + << eprosima::fastcdr::MemberId(8) << data.yaw_rate() + << eprosima::fastcdr::MemberId(9) << data.acceleration_control() + << eprosima::fastcdr::MemberId(10) << data.acceleration_control_is_present() + << eprosima::fastcdr::MemberId(11) << data.lane_position() + << eprosima::fastcdr::MemberId(12) << data.lane_position_is_present() + << eprosima::fastcdr::MemberId(13) << data.steering_wheel_angle() + << eprosima::fastcdr::MemberId(14) << data.steering_wheel_angle_is_present() + << eprosima::fastcdr::MemberId(15) << data.lateral_acceleration() + << eprosima::fastcdr::MemberId(16) << data.lateral_acceleration_is_present() + << eprosima::fastcdr::MemberId(17) << data.vertical_acceleration() + << eprosima::fastcdr::MemberId(18) << data.vertical_acceleration_is_present() + << eprosima::fastcdr::MemberId(19) << data.performance_class() + << eprosima::fastcdr::MemberId(20) << data.performance_class_is_present() + << eprosima::fastcdr::MemberId(21) << data.cen_dsrc_tolling_zone() + << eprosima::fastcdr::MemberId(22) << data.cen_dsrc_tolling_zone_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.heading(); + break; + + case 1: + dcdr >> data.speed(); + break; + + case 2: + dcdr >> data.drive_direction(); + break; + + case 3: + dcdr >> data.vehicle_length(); + break; + + case 4: + dcdr >> data.vehicle_width(); + break; + + case 5: + dcdr >> data.longitudinal_acceleration(); + break; + + case 6: + dcdr >> data.curvature(); + break; + + case 7: + dcdr >> data.curvature_calculation_mode(); + break; + + case 8: + dcdr >> data.yaw_rate(); + break; + + case 9: + dcdr >> data.acceleration_control(); + break; + + case 10: + dcdr >> data.acceleration_control_is_present(); + break; + + case 11: + dcdr >> data.lane_position(); + break; + + case 12: + dcdr >> data.lane_position_is_present(); + break; + + case 13: + dcdr >> data.steering_wheel_angle(); + break; + + case 14: + dcdr >> data.steering_wheel_angle_is_present(); + break; + + case 15: + dcdr >> data.lateral_acceleration(); + break; + + case 16: + dcdr >> data.lateral_acceleration_is_present(); + break; + + case 17: + dcdr >> data.vertical_acceleration(); + break; + + case 18: + dcdr >> data.vertical_acceleration_is_present(); + break; + + case 19: + dcdr >> data.performance_class(); + break; + + case 20: + dcdr >> data.performance_class_is_present(); + break; + + case 21: + dcdr >> data.cen_dsrc_tolling_zone(); + break; + + case 22: + dcdr >> data.cen_dsrc_tolling_zone_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.cxx index 9a127480329..94704f8949d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file BasicVehicleContainerHighFrequencyPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "BasicVehicleContainerHighFrequencyPubSubTypes.h" +#include "BasicVehicleContainerHighFrequencyCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - BasicVehicleContainerHighFrequencyPubSubType::BasicVehicleContainerHighFrequencyPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::BasicVehicleContainerHighFrequency_"); - auto type_size = BasicVehicleContainerHighFrequency::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = BasicVehicleContainerHighFrequency::isKeyDefined(); - size_t keyLength = BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize() > 16 ? - BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BasicVehicleContainerHighFrequencyPubSubType::~BasicVehicleContainerHighFrequencyPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BasicVehicleContainerHighFrequencyPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - BasicVehicleContainerHighFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool BasicVehicleContainerHighFrequencyPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - BasicVehicleContainerHighFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function BasicVehicleContainerHighFrequencyPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* BasicVehicleContainerHighFrequencyPubSubType::createData() - { - return reinterpret_cast(new BasicVehicleContainerHighFrequency()); - } - - void BasicVehicleContainerHighFrequencyPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BasicVehicleContainerHighFrequencyPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - BasicVehicleContainerHighFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || BasicVehicleContainerHighFrequency::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +BasicVehicleContainerHighFrequencyPubSubType::BasicVehicleContainerHighFrequencyPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::BasicVehicleContainerHighFrequency_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicVehicleContainerHighFrequency::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_BasicVehicleContainerHighFrequency_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +BasicVehicleContainerHighFrequencyPubSubType::~BasicVehicleContainerHighFrequencyPubSubType() +{ +} + +bool BasicVehicleContainerHighFrequencyPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + BasicVehicleContainerHighFrequency* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool BasicVehicleContainerHighFrequencyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + BasicVehicleContainerHighFrequency* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function BasicVehicleContainerHighFrequencyPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* BasicVehicleContainerHighFrequencyPubSubType::createData() +{ + return reinterpret_cast(new BasicVehicleContainerHighFrequency()); +} + +void BasicVehicleContainerHighFrequencyPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool BasicVehicleContainerHighFrequencyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.h index 963ba23024e..3d81ae1fe11 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerHighFrequencyPubSubTypes.h @@ -16,92 +16,136 @@ * @file BasicVehicleContainerHighFrequencyPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "BasicVehicleContainerHighFrequency.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "DriveDirectionPubSubTypes.h" +#include "SpeedPubSubTypes.h" +#include "HeadingPubSubTypes.h" +#include "VehicleWidthPubSubTypes.h" +#include "CenDsrcTollingZonePubSubTypes.h" +#include "YawRatePubSubTypes.h" +#include "VehicleLengthPubSubTypes.h" +#include "CurvatureCalculationModePubSubTypes.h" +#include "LanePositionPubSubTypes.h" +#include "LateralAccelerationPubSubTypes.h" +#include "VerticalAccelerationPubSubTypes.h" +#include "SteeringWheelAnglePubSubTypes.h" +#include "LongitudinalAccelerationPubSubTypes.h" +#include "CurvaturePubSubTypes.h" +#include "PerformanceClassPubSubTypes.h" +#include "AccelerationControlPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated BasicVehicleContainerHighFrequency is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type BasicVehicleContainerHighFrequency defined by the user in the IDL file. + * @ingroup BasicVehicleContainerHighFrequency + */ +class BasicVehicleContainerHighFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type BasicVehicleContainerHighFrequency defined by the user in the IDL file. - * @ingroup BASICVEHICLECONTAINERHIGHFREQUENCY - */ - class BasicVehicleContainerHighFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef BasicVehicleContainerHighFrequency type; + typedef BasicVehicleContainerHighFrequency type; - eProsima_user_DllExport BasicVehicleContainerHighFrequencyPubSubType(); + eProsima_user_DllExport BasicVehicleContainerHighFrequencyPubSubType(); - eProsima_user_DllExport virtual ~BasicVehicleContainerHighFrequencyPubSubType(); + eProsima_user_DllExport ~BasicVehicleContainerHighFrequencyPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.cxx index 6123b6a7f4e..d9fd66f1dcf 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.cxx @@ -14,9 +14,9 @@ /*! * @file BasicVehicleContainerLowFrequency.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "BasicVehicleContainerLowFrequency.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency() -{ - // m_vehicle_role com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@210386e0 - // m_exterior_lights com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3d4d3fe7 +namespace etsi_its_cam_msgs { - // m_path_history com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@65f87a2c +namespace msg { -} -etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::~BasicVehicleContainerLowFrequency() +BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency() { +} - +BasicVehicleContainerLowFrequency::~BasicVehicleContainerLowFrequency() +{ } -etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency( +BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency( const BasicVehicleContainerLowFrequency& x) { m_vehicle_role = x.m_vehicle_role; @@ -59,101 +59,53 @@ etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::BasicVehicleContainer m_path_history = x.m_path_history; } -etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency( - BasicVehicleContainerLowFrequency&& x) +BasicVehicleContainerLowFrequency::BasicVehicleContainerLowFrequency( + BasicVehicleContainerLowFrequency&& x) noexcept { m_vehicle_role = std::move(x.m_vehicle_role); m_exterior_lights = std::move(x.m_exterior_lights); m_path_history = std::move(x.m_path_history); } -etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::operator =( +BasicVehicleContainerLowFrequency& BasicVehicleContainerLowFrequency::operator =( const BasicVehicleContainerLowFrequency& x) { m_vehicle_role = x.m_vehicle_role; m_exterior_lights = x.m_exterior_lights; m_path_history = x.m_path_history; - return *this; } -etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::operator =( - BasicVehicleContainerLowFrequency&& x) +BasicVehicleContainerLowFrequency& BasicVehicleContainerLowFrequency::operator =( + BasicVehicleContainerLowFrequency&& x) noexcept { m_vehicle_role = std::move(x.m_vehicle_role); m_exterior_lights = std::move(x.m_exterior_lights); m_path_history = std::move(x.m_path_history); - return *this; } -bool etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::operator ==( +bool BasicVehicleContainerLowFrequency::operator ==( const BasicVehicleContainerLowFrequency& x) const { - - return (m_vehicle_role == x.m_vehicle_role && m_exterior_lights == x.m_exterior_lights && m_path_history == x.m_path_history); + return (m_vehicle_role == x.m_vehicle_role && + m_exterior_lights == x.m_exterior_lights && + m_path_history == x.m_path_history); } -bool etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::operator !=( +bool BasicVehicleContainerLowFrequency::operator !=( const BasicVehicleContainerLowFrequency& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::VehicleRole::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::ExteriorLights::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PathHistory::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::VehicleRole::getCdrSerializedSize(data.vehicle_role(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::ExteriorLights::getCdrSerializedSize(data.exterior_lights(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PathHistory::getCdrSerializedSize(data.path_history(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_vehicle_role; - scdr << m_exterior_lights; - scdr << m_path_history; - -} - -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_vehicle_role; - dcdr >> m_exterior_lights; - dcdr >> m_path_history; -} - /*! * @brief This function copies the value in member vehicle_role * @param _vehicle_role New value to be copied in member vehicle_role */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role( +void BasicVehicleContainerLowFrequency::vehicle_role( const etsi_its_cam_msgs::msg::VehicleRole& _vehicle_role) { m_vehicle_role = _vehicle_role; @@ -163,7 +115,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role( * @brief This function moves the value in member vehicle_role * @param _vehicle_role New value to be moved in member vehicle_role */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role( +void BasicVehicleContainerLowFrequency::vehicle_role( etsi_its_cam_msgs::msg::VehicleRole&& _vehicle_role) { m_vehicle_role = std::move(_vehicle_role); @@ -173,7 +125,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role( * @brief This function returns a constant reference to member vehicle_role * @return Constant reference to member vehicle_role */ -const etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role() const +const etsi_its_cam_msgs::msg::VehicleRole& BasicVehicleContainerLowFrequency::vehicle_role() const { return m_vehicle_role; } @@ -182,15 +134,17 @@ const etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::BasicVehicleC * @brief This function returns a reference to member vehicle_role * @return Reference to member vehicle_role */ -etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::vehicle_role() +etsi_its_cam_msgs::msg::VehicleRole& BasicVehicleContainerLowFrequency::vehicle_role() { return m_vehicle_role; } + + /*! * @brief This function copies the value in member exterior_lights * @param _exterior_lights New value to be copied in member exterior_lights */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights( +void BasicVehicleContainerLowFrequency::exterior_lights( const etsi_its_cam_msgs::msg::ExteriorLights& _exterior_lights) { m_exterior_lights = _exterior_lights; @@ -200,7 +154,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights( * @brief This function moves the value in member exterior_lights * @param _exterior_lights New value to be moved in member exterior_lights */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights( +void BasicVehicleContainerLowFrequency::exterior_lights( etsi_its_cam_msgs::msg::ExteriorLights&& _exterior_lights) { m_exterior_lights = std::move(_exterior_lights); @@ -210,7 +164,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights( * @brief This function returns a constant reference to member exterior_lights * @return Constant reference to member exterior_lights */ -const etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights() const +const etsi_its_cam_msgs::msg::ExteriorLights& BasicVehicleContainerLowFrequency::exterior_lights() const { return m_exterior_lights; } @@ -219,15 +173,17 @@ const etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::BasicVehic * @brief This function returns a reference to member exterior_lights * @return Reference to member exterior_lights */ -etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::exterior_lights() +etsi_its_cam_msgs::msg::ExteriorLights& BasicVehicleContainerLowFrequency::exterior_lights() { return m_exterior_lights; } + + /*! * @brief This function copies the value in member path_history * @param _path_history New value to be copied in member path_history */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history( +void BasicVehicleContainerLowFrequency::path_history( const etsi_its_cam_msgs::msg::PathHistory& _path_history) { m_path_history = _path_history; @@ -237,7 +193,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history( * @brief This function moves the value in member path_history * @param _path_history New value to be moved in member path_history */ -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history( +void BasicVehicleContainerLowFrequency::path_history( etsi_its_cam_msgs::msg::PathHistory&& _path_history) { m_path_history = std::move(_path_history); @@ -247,7 +203,7 @@ void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history( * @brief This function returns a constant reference to member path_history * @return Constant reference to member path_history */ -const etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history() const +const etsi_its_cam_msgs::msg::PathHistory& BasicVehicleContainerLowFrequency::path_history() const { return m_path_history; } @@ -256,31 +212,18 @@ const etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::BasicVehicleC * @brief This function returns a reference to member path_history * @return Reference to member path_history */ -etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::path_history() +etsi_its_cam_msgs::msg::PathHistory& BasicVehicleContainerLowFrequency::path_history() { return m_path_history; } -size_t etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "BasicVehicleContainerLowFrequencyCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.h index 549dac222f6..194c838ebe7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequency.h @@ -16,22 +16,27 @@ * @file BasicVehicleContainerLowFrequency.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "VehicleRole.h" #include "ExteriorLights.h" #include "PathHistory.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -45,227 +50,186 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(BasicVehicleContainerLowFrequency_SOURCE) -#define BasicVehicleContainerLowFrequency_DllAPI __declspec( dllexport ) +#if defined(BASICVEHICLECONTAINERLOWFREQUENCY_SOURCE) +#define BASICVEHICLECONTAINERLOWFREQUENCY_DllAPI __declspec( dllexport ) #else -#define BasicVehicleContainerLowFrequency_DllAPI __declspec( dllimport ) -#endif // BasicVehicleContainerLowFrequency_SOURCE +#define BASICVEHICLECONTAINERLOWFREQUENCY_DllAPI __declspec( dllimport ) +#endif // BASICVEHICLECONTAINERLOWFREQUENCY_SOURCE #else -#define BasicVehicleContainerLowFrequency_DllAPI +#define BASICVEHICLECONTAINERLOWFREQUENCY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define BasicVehicleContainerLowFrequency_DllAPI +#define BASICVEHICLECONTAINERLOWFREQUENCY_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure BasicVehicleContainerLowFrequency defined by the user in the IDL file. - * @ingroup BASICVEHICLECONTAINERLOWFREQUENCY - */ - class BasicVehicleContainerLowFrequency - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicVehicleContainerLowFrequency(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicVehicleContainerLowFrequency(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. - */ - eProsima_user_DllExport BasicVehicleContainerLowFrequency( - const BasicVehicleContainerLowFrequency& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. - */ - eProsima_user_DllExport BasicVehicleContainerLowFrequency( - BasicVehicleContainerLowFrequency&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. - */ - eProsima_user_DllExport BasicVehicleContainerLowFrequency& operator =( - const BasicVehicleContainerLowFrequency& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. - */ - eProsima_user_DllExport BasicVehicleContainerLowFrequency& operator =( - BasicVehicleContainerLowFrequency&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicVehicleContainerLowFrequency& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicVehicleContainerLowFrequency& x) const; - - /*! - * @brief This function copies the value in member vehicle_role - * @param _vehicle_role New value to be copied in member vehicle_role - */ - eProsima_user_DllExport void vehicle_role( - const etsi_its_cam_msgs::msg::VehicleRole& _vehicle_role); - - /*! - * @brief This function moves the value in member vehicle_role - * @param _vehicle_role New value to be moved in member vehicle_role - */ - eProsima_user_DllExport void vehicle_role( - etsi_its_cam_msgs::msg::VehicleRole&& _vehicle_role); - - /*! - * @brief This function returns a constant reference to member vehicle_role - * @return Constant reference to member vehicle_role - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleRole& vehicle_role() const; - - /*! - * @brief This function returns a reference to member vehicle_role - * @return Reference to member vehicle_role - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleRole& vehicle_role(); - /*! - * @brief This function copies the value in member exterior_lights - * @param _exterior_lights New value to be copied in member exterior_lights - */ - eProsima_user_DllExport void exterior_lights( - const etsi_its_cam_msgs::msg::ExteriorLights& _exterior_lights); - - /*! - * @brief This function moves the value in member exterior_lights - * @param _exterior_lights New value to be moved in member exterior_lights - */ - eProsima_user_DllExport void exterior_lights( - etsi_its_cam_msgs::msg::ExteriorLights&& _exterior_lights); - - /*! - * @brief This function returns a constant reference to member exterior_lights - * @return Constant reference to member exterior_lights - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ExteriorLights& exterior_lights() const; - - /*! - * @brief This function returns a reference to member exterior_lights - * @return Reference to member exterior_lights - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ExteriorLights& exterior_lights(); - /*! - * @brief This function copies the value in member path_history - * @param _path_history New value to be copied in member path_history - */ - eProsima_user_DllExport void path_history( - const etsi_its_cam_msgs::msg::PathHistory& _path_history); - - /*! - * @brief This function moves the value in member path_history - * @param _path_history New value to be moved in member path_history - */ - eProsima_user_DllExport void path_history( - etsi_its_cam_msgs::msg::PathHistory&& _path_history); - - /*! - * @brief This function returns a constant reference to member path_history - * @return Constant reference to member path_history - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::PathHistory& path_history() const; - - /*! - * @brief This function returns a reference to member path_history - * @return Reference to member path_history - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::PathHistory& path_history(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::VehicleRole m_vehicle_role; - etsi_its_cam_msgs::msg::ExteriorLights m_exterior_lights; - etsi_its_cam_msgs::msg::PathHistory m_path_history; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure BasicVehicleContainerLowFrequency defined by the user in the IDL file. + * @ingroup BasicVehicleContainerLowFrequency + */ +class BasicVehicleContainerLowFrequency +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicVehicleContainerLowFrequency(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency( + const BasicVehicleContainerLowFrequency& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency( + BasicVehicleContainerLowFrequency&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency& operator =( + const BasicVehicleContainerLowFrequency& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency that will be copied. + */ + eProsima_user_DllExport BasicVehicleContainerLowFrequency& operator =( + BasicVehicleContainerLowFrequency&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicVehicleContainerLowFrequency& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicVehicleContainerLowFrequency& x) const; + + /*! + * @brief This function copies the value in member vehicle_role + * @param _vehicle_role New value to be copied in member vehicle_role + */ + eProsima_user_DllExport void vehicle_role( + const etsi_its_cam_msgs::msg::VehicleRole& _vehicle_role); + + /*! + * @brief This function moves the value in member vehicle_role + * @param _vehicle_role New value to be moved in member vehicle_role + */ + eProsima_user_DllExport void vehicle_role( + etsi_its_cam_msgs::msg::VehicleRole&& _vehicle_role); + + /*! + * @brief This function returns a constant reference to member vehicle_role + * @return Constant reference to member vehicle_role + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleRole& vehicle_role() const; + + /*! + * @brief This function returns a reference to member vehicle_role + * @return Reference to member vehicle_role + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleRole& vehicle_role(); + + + /*! + * @brief This function copies the value in member exterior_lights + * @param _exterior_lights New value to be copied in member exterior_lights + */ + eProsima_user_DllExport void exterior_lights( + const etsi_its_cam_msgs::msg::ExteriorLights& _exterior_lights); + + /*! + * @brief This function moves the value in member exterior_lights + * @param _exterior_lights New value to be moved in member exterior_lights + */ + eProsima_user_DllExport void exterior_lights( + etsi_its_cam_msgs::msg::ExteriorLights&& _exterior_lights); + + /*! + * @brief This function returns a constant reference to member exterior_lights + * @return Constant reference to member exterior_lights + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ExteriorLights& exterior_lights() const; + + /*! + * @brief This function returns a reference to member exterior_lights + * @return Reference to member exterior_lights + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ExteriorLights& exterior_lights(); + + + /*! + * @brief This function copies the value in member path_history + * @param _path_history New value to be copied in member path_history + */ + eProsima_user_DllExport void path_history( + const etsi_its_cam_msgs::msg::PathHistory& _path_history); + + /*! + * @brief This function moves the value in member path_history + * @param _path_history New value to be moved in member path_history + */ + eProsima_user_DllExport void path_history( + etsi_its_cam_msgs::msg::PathHistory&& _path_history); + + /*! + * @brief This function returns a constant reference to member path_history + * @return Constant reference to member path_history + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PathHistory& path_history() const; + + /*! + * @brief This function returns a reference to member path_history + * @return Reference to member path_history + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PathHistory& path_history(); + +private: + + etsi_its_cam_msgs::msg::VehicleRole m_vehicle_role; + etsi_its_cam_msgs::msg::ExteriorLights m_exterior_lights; + etsi_its_cam_msgs::msg::PathHistory m_path_history; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyCdrAux.hpp new file mode 100644 index 00000000000..642da0f6ff2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerLowFrequencyCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCYCDRAUX_HPP_ + +#include "BasicVehicleContainerLowFrequency.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_BasicVehicleContainerLowFrequency_max_cdr_typesize {4135UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_BasicVehicleContainerLowFrequency_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyCdrAux.ipp new file mode 100644 index 00000000000..498fa1e942b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file BasicVehicleContainerLowFrequencyCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCYCDRAUX_IPP_ + +#include "BasicVehicleContainerLowFrequencyCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.vehicle_role(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.exterior_lights(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.path_history(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.vehicle_role() + << eprosima::fastcdr::MemberId(1) << data.exterior_lights() + << eprosima::fastcdr::MemberId(2) << data.path_history() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.vehicle_role(); + break; + + case 1: + dcdr >> data.exterior_lights(); + break; + + case 2: + dcdr >> data.path_history(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.cxx index 36cb0110bc0..1a3862b36b3 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file BasicVehicleContainerLowFrequencyPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "BasicVehicleContainerLowFrequencyPubSubTypes.h" +#include "BasicVehicleContainerLowFrequencyCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - BasicVehicleContainerLowFrequencyPubSubType::BasicVehicleContainerLowFrequencyPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::BasicVehicleContainerLowFrequency_"); - auto type_size = BasicVehicleContainerLowFrequency::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = BasicVehicleContainerLowFrequency::isKeyDefined(); - size_t keyLength = BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize() > 16 ? - BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BasicVehicleContainerLowFrequencyPubSubType::~BasicVehicleContainerLowFrequencyPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BasicVehicleContainerLowFrequencyPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - BasicVehicleContainerLowFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool BasicVehicleContainerLowFrequencyPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - BasicVehicleContainerLowFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function BasicVehicleContainerLowFrequencyPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* BasicVehicleContainerLowFrequencyPubSubType::createData() - { - return reinterpret_cast(new BasicVehicleContainerLowFrequency()); - } - - void BasicVehicleContainerLowFrequencyPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BasicVehicleContainerLowFrequencyPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - BasicVehicleContainerLowFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || BasicVehicleContainerLowFrequency::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +BasicVehicleContainerLowFrequencyPubSubType::BasicVehicleContainerLowFrequencyPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::BasicVehicleContainerLowFrequency_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicVehicleContainerLowFrequency::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_BasicVehicleContainerLowFrequency_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +BasicVehicleContainerLowFrequencyPubSubType::~BasicVehicleContainerLowFrequencyPubSubType() +{ +} + +bool BasicVehicleContainerLowFrequencyPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + BasicVehicleContainerLowFrequency* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool BasicVehicleContainerLowFrequencyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + BasicVehicleContainerLowFrequency* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function BasicVehicleContainerLowFrequencyPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* BasicVehicleContainerLowFrequencyPubSubType::createData() +{ + return reinterpret_cast(new BasicVehicleContainerLowFrequency()); +} + +void BasicVehicleContainerLowFrequencyPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool BasicVehicleContainerLowFrequencyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.h index fb7ccfbdf91..4a8b23018f0 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/BasicVehicleContainerLowFrequencyPubSubTypes.h @@ -16,92 +16,123 @@ * @file BasicVehicleContainerLowFrequencyPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "BasicVehicleContainerLowFrequency.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "VehicleRolePubSubTypes.h" +#include "ExteriorLightsPubSubTypes.h" +#include "PathHistoryPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated BasicVehicleContainerLowFrequency is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type BasicVehicleContainerLowFrequency defined by the user in the IDL file. + * @ingroup BasicVehicleContainerLowFrequency + */ +class BasicVehicleContainerLowFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type BasicVehicleContainerLowFrequency defined by the user in the IDL file. - * @ingroup BASICVEHICLECONTAINERLOWFREQUENCY - */ - class BasicVehicleContainerLowFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef BasicVehicleContainerLowFrequency type; + typedef BasicVehicleContainerLowFrequency type; - eProsima_user_DllExport BasicVehicleContainerLowFrequencyPubSubType(); + eProsima_user_DllExport BasicVehicleContainerLowFrequencyPubSubType(); - eProsima_user_DllExport virtual ~BasicVehicleContainerLowFrequencyPubSubType(); + eProsima_user_DllExport ~BasicVehicleContainerLowFrequencyPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_BASICVEHICLECONTAINERLOWFREQUENCY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.cxx index 7cd382b8490..75b5d56c8e8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.cxx @@ -14,9 +14,9 @@ /*! * @file CAM.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "CAM.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::CAM::CAM() -{ - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@618c5d94 - // m_cam com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5b40ceb +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::CAM::~CAM() +CAM::CAM() { +} +CAM::~CAM() +{ } -etsi_its_cam_msgs::msg::CAM::CAM( +CAM::CAM( const CAM& x) { m_header = x.m_header; m_cam = x.m_cam; } -etsi_its_cam_msgs::msg::CAM::CAM( - CAM&& x) +CAM::CAM( + CAM&& x) noexcept { m_header = std::move(x.m_header); m_cam = std::move(x.m_cam); } -etsi_its_cam_msgs::msg::CAM& etsi_its_cam_msgs::msg::CAM::operator =( +CAM& CAM::operator =( const CAM& x) { m_header = x.m_header; m_cam = x.m_cam; - return *this; } -etsi_its_cam_msgs::msg::CAM& etsi_its_cam_msgs::msg::CAM::operator =( - CAM&& x) +CAM& CAM::operator =( + CAM&& x) noexcept { m_header = std::move(x.m_header); m_cam = std::move(x.m_cam); - return *this; } -bool etsi_its_cam_msgs::msg::CAM::operator ==( +bool CAM::operator ==( const CAM& x) const { - - return (m_header == x.m_header && m_cam == x.m_cam); + return (m_header == x.m_header && + m_cam == x.m_cam); } -bool etsi_its_cam_msgs::msg::CAM::operator !=( +bool CAM::operator !=( const CAM& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CAM::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CoopAwareness::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CAM::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CAM& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ItsPduHeader::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CoopAwareness::getCdrSerializedSize(data.cam(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CAM::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_header; - scdr << m_cam; - -} - -void etsi_its_cam_msgs::msg::CAM::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_header; - dcdr >> m_cam; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void etsi_its_cam_msgs::msg::CAM::header( +void CAM::header( const etsi_its_cam_msgs::msg::ItsPduHeader& _header) { m_header = _header; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::CAM::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void etsi_its_cam_msgs::msg::CAM::header( +void CAM::header( etsi_its_cam_msgs::msg::ItsPduHeader&& _header) { m_header = std::move(_header); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::CAM::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::CAM::header() const +const etsi_its_cam_msgs::msg::ItsPduHeader& CAM::header() const { return m_header; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::CAM::header( * @brief This function returns a reference to member header * @return Reference to member header */ -etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::CAM::header() +etsi_its_cam_msgs::msg::ItsPduHeader& CAM::header() { return m_header; } + + /*! * @brief This function copies the value in member cam * @param _cam New value to be copied in member cam */ -void etsi_its_cam_msgs::msg::CAM::cam( +void CAM::cam( const etsi_its_cam_msgs::msg::CoopAwareness& _cam) { m_cam = _cam; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::CAM::cam( * @brief This function moves the value in member cam * @param _cam New value to be moved in member cam */ -void etsi_its_cam_msgs::msg::CAM::cam( +void CAM::cam( etsi_its_cam_msgs::msg::CoopAwareness&& _cam) { m_cam = std::move(_cam); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::CAM::cam( * @brief This function returns a constant reference to member cam * @return Constant reference to member cam */ -const etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CAM::cam() const +const etsi_its_cam_msgs::msg::CoopAwareness& CAM::cam() const { return m_cam; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CAM::cam() * @brief This function returns a reference to member cam * @return Reference to member cam */ -etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CAM::cam() +etsi_its_cam_msgs::msg::CoopAwareness& CAM::cam() { return m_cam; } -size_t etsi_its_cam_msgs::msg::CAM::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::CAM::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::CAM::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CAMCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h index 3d3156113cc..c17c95f37e5 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAM.h @@ -16,21 +16,26 @@ * @file CAM.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_H_ -#include "ItsPduHeader.h" -#include "CoopAwareness.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "ItsPduHeader.h" +#include "CoopAwareness.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -59,186 +64,143 @@ namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure CAM defined by the user in the IDL file. - * @ingroup CAM - */ - class CAM - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CAM(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CAM(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. - */ - eProsima_user_DllExport CAM( - const CAM& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. - */ - eProsima_user_DllExport CAM( - CAM&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. - */ - eProsima_user_DllExport CAM& operator =( - const CAM& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. - */ - eProsima_user_DllExport CAM& operator =( - CAM&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CAM object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CAM& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CAM object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CAM& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header( - const etsi_its_cam_msgs::msg::ItsPduHeader& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header( - etsi_its_cam_msgs::msg::ItsPduHeader&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ItsPduHeader& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ItsPduHeader& header(); - /*! - * @brief This function copies the value in member cam - * @param _cam New value to be copied in member cam - */ - eProsima_user_DllExport void cam( - const etsi_its_cam_msgs::msg::CoopAwareness& _cam); - - /*! - * @brief This function moves the value in member cam - * @param _cam New value to be moved in member cam - */ - eProsima_user_DllExport void cam( - etsi_its_cam_msgs::msg::CoopAwareness&& _cam); - - /*! - * @brief This function returns a constant reference to member cam - * @return Constant reference to member cam - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CoopAwareness& cam() const; - - /*! - * @brief This function returns a reference to member cam - * @return Reference to member cam - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CoopAwareness& cam(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CAM& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::ItsPduHeader m_header; - etsi_its_cam_msgs::msg::CoopAwareness m_cam; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CAM defined by the user in the IDL file. + * @ingroup CAM + */ +class CAM +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CAM(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CAM(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. + */ + eProsima_user_DllExport CAM( + const CAM& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. + */ + eProsima_user_DllExport CAM( + CAM&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. + */ + eProsima_user_DllExport CAM& operator =( + const CAM& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CAM that will be copied. + */ + eProsima_user_DllExport CAM& operator =( + CAM&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CAM object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CAM& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CAM object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CAM& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const etsi_its_cam_msgs::msg::ItsPduHeader& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + etsi_its_cam_msgs::msg::ItsPduHeader&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ItsPduHeader& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ItsPduHeader& header(); + + + /*! + * @brief This function copies the value in member cam + * @param _cam New value to be copied in member cam + */ + eProsima_user_DllExport void cam( + const etsi_its_cam_msgs::msg::CoopAwareness& _cam); + + /*! + * @brief This function moves the value in member cam + * @param _cam New value to be moved in member cam + */ + eProsima_user_DllExport void cam( + etsi_its_cam_msgs::msg::CoopAwareness&& _cam); + + /*! + * @brief This function returns a constant reference to member cam + * @return Constant reference to member cam + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CoopAwareness& cam() const; + + /*! + * @brief This function returns a reference to member cam + * @return Reference to member cam + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CoopAwareness& cam(); + +private: + + etsi_its_cam_msgs::msg::ItsPduHeader m_header; + etsi_its_cam_msgs::msg::CoopAwareness m_cam; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMCdrAux.hpp new file mode 100644 index 00000000000..a6fa50d753e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMCdrAux.hpp @@ -0,0 +1,120 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CAMCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMCDRAUX_HPP_ + +#include "CAM.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CAM_max_cdr_typesize {12211UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CAM_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CAM& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMCdrAux.ipp new file mode 100644 index 00000000000..476b3298359 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CAMCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMCDRAUX_IPP_ + +#include "CAMCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CAM& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.cam(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CAM& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.cam() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CAM& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.cam(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CAM& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx index 47720dfbe46..1c4b7ebc843 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CAMPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CAMPubSubTypes.h" +#include "CAMCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - CAMPubSubType::CAMPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CAM_"); - auto type_size = CAM::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CAM::isKeyDefined(); - size_t keyLength = CAM::getKeyMaxCdrSerializedSize() > 16 ? - CAM::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CAMPubSubType::~CAMPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CAMPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CAM* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CAMPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CAM* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CAMPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CAMPubSubType::createData() - { - return reinterpret_cast(new CAM()); - } - - void CAMPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CAMPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CAM* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CAM::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CAM::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CAMPubSubType::CAMPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CAM_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CAM::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CAM_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CAMPubSubType::~CAMPubSubType() +{ +} + +bool CAMPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CAM* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CAMPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CAM* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CAMPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CAMPubSubType::createData() +{ + return reinterpret_cast(new CAM()); +} + +void CAMPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CAMPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.h index f202cc39de2..65445205b31 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CAMPubSubTypes.h @@ -16,92 +16,122 @@ * @file CAMPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CAM.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "ItsPduHeaderPubSubTypes.h" +#include "CoopAwarenessPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CAM is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CAM defined by the user in the IDL file. + * @ingroup CAM + */ +class CAMPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CAM defined by the user in the IDL file. - * @ingroup CAM - */ - class CAMPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CAM type; + typedef CAM type; - eProsima_user_DllExport CAMPubSubType(); + eProsima_user_DllExport CAMPubSubType(); - eProsima_user_DllExport virtual ~CAMPubSubType(); + eProsima_user_DllExport ~CAMPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAM_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.cxx index 7323b0c6814..b894150fe08 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.cxx @@ -14,9 +14,9 @@ /*! * @file CamParameters.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,40 +27,31 @@ char dummy; #endif // _WIN32 #include "CamParameters.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::CamParameters::CamParameters() -{ - // m_basic_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@773cbf4f - // m_high_frequency_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6b54655f +namespace etsi_its_cam_msgs { - // m_low_frequency_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@665e9289 +namespace msg { - // m_low_frequency_container_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7d3430a7 - m_low_frequency_container_is_present = false; - // m_special_vehicle_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6f603e89 - // m_special_vehicle_container_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2756c0a7 - m_special_vehicle_container_is_present = false; +CamParameters::CamParameters() +{ } -etsi_its_cam_msgs::msg::CamParameters::~CamParameters() +CamParameters::~CamParameters() { - - - - - } -etsi_its_cam_msgs::msg::CamParameters::CamParameters( +CamParameters::CamParameters( const CamParameters& x) { m_basic_container = x.m_basic_container; @@ -71,8 +62,8 @@ etsi_its_cam_msgs::msg::CamParameters::CamParameters( m_special_vehicle_container_is_present = x.m_special_vehicle_container_is_present; } -etsi_its_cam_msgs::msg::CamParameters::CamParameters( - CamParameters&& x) +CamParameters::CamParameters( + CamParameters&& x) noexcept { m_basic_container = std::move(x.m_basic_container); m_high_frequency_container = std::move(x.m_high_frequency_container); @@ -82,7 +73,7 @@ etsi_its_cam_msgs::msg::CamParameters::CamParameters( m_special_vehicle_container_is_present = x.m_special_vehicle_container_is_present; } -etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CamParameters::operator =( +CamParameters& CamParameters::operator =( const CamParameters& x) { @@ -92,12 +83,11 @@ etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CamParameters::op m_low_frequency_container_is_present = x.m_low_frequency_container_is_present; m_special_vehicle_container = x.m_special_vehicle_container; m_special_vehicle_container_is_present = x.m_special_vehicle_container_is_present; - return *this; } -etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CamParameters::operator =( - CamParameters&& x) +CamParameters& CamParameters::operator =( + CamParameters&& x) noexcept { m_basic_container = std::move(x.m_basic_container); @@ -106,95 +96,31 @@ etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CamParameters::op m_low_frequency_container_is_present = x.m_low_frequency_container_is_present; m_special_vehicle_container = std::move(x.m_special_vehicle_container); m_special_vehicle_container_is_present = x.m_special_vehicle_container_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::CamParameters::operator ==( +bool CamParameters::operator ==( const CamParameters& x) const { - - return (m_basic_container == x.m_basic_container && m_high_frequency_container == x.m_high_frequency_container && m_low_frequency_container == x.m_low_frequency_container && m_low_frequency_container_is_present == x.m_low_frequency_container_is_present && m_special_vehicle_container == x.m_special_vehicle_container && m_special_vehicle_container_is_present == x.m_special_vehicle_container_is_present); + return (m_basic_container == x.m_basic_container && + m_high_frequency_container == x.m_high_frequency_container && + m_low_frequency_container == x.m_low_frequency_container && + m_low_frequency_container_is_present == x.m_low_frequency_container_is_present && + m_special_vehicle_container == x.m_special_vehicle_container && + m_special_vehicle_container_is_present == x.m_special_vehicle_container_is_present); } -bool etsi_its_cam_msgs::msg::CamParameters::operator !=( +bool CamParameters::operator !=( const CamParameters& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CamParameters::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::BasicContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::HighFrequencyContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::LowFrequencyContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::SpecialVehicleContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CamParameters::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CamParameters& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::BasicContainer::getCdrSerializedSize(data.basic_container(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::HighFrequencyContainer::getCdrSerializedSize(data.high_frequency_container(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::LowFrequencyContainer::getCdrSerializedSize(data.low_frequency_container(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::SpecialVehicleContainer::getCdrSerializedSize(data.special_vehicle_container(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CamParameters::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_basic_container; - scdr << m_high_frequency_container; - scdr << m_low_frequency_container; - scdr << m_low_frequency_container_is_present; - scdr << m_special_vehicle_container; - scdr << m_special_vehicle_container_is_present; - -} - -void etsi_its_cam_msgs::msg::CamParameters::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_basic_container; - dcdr >> m_high_frequency_container; - dcdr >> m_low_frequency_container; - dcdr >> m_low_frequency_container_is_present; - dcdr >> m_special_vehicle_container; - dcdr >> m_special_vehicle_container_is_present; -} - /*! * @brief This function copies the value in member basic_container * @param _basic_container New value to be copied in member basic_container */ -void etsi_its_cam_msgs::msg::CamParameters::basic_container( +void CamParameters::basic_container( const etsi_its_cam_msgs::msg::BasicContainer& _basic_container) { m_basic_container = _basic_container; @@ -204,7 +130,7 @@ void etsi_its_cam_msgs::msg::CamParameters::basic_container( * @brief This function moves the value in member basic_container * @param _basic_container New value to be moved in member basic_container */ -void etsi_its_cam_msgs::msg::CamParameters::basic_container( +void CamParameters::basic_container( etsi_its_cam_msgs::msg::BasicContainer&& _basic_container) { m_basic_container = std::move(_basic_container); @@ -214,7 +140,7 @@ void etsi_its_cam_msgs::msg::CamParameters::basic_container( * @brief This function returns a constant reference to member basic_container * @return Constant reference to member basic_container */ -const etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::CamParameters::basic_container() const +const etsi_its_cam_msgs::msg::BasicContainer& CamParameters::basic_container() const { return m_basic_container; } @@ -223,15 +149,17 @@ const etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::CamParamet * @brief This function returns a reference to member basic_container * @return Reference to member basic_container */ -etsi_its_cam_msgs::msg::BasicContainer& etsi_its_cam_msgs::msg::CamParameters::basic_container() +etsi_its_cam_msgs::msg::BasicContainer& CamParameters::basic_container() { return m_basic_container; } + + /*! * @brief This function copies the value in member high_frequency_container * @param _high_frequency_container New value to be copied in member high_frequency_container */ -void etsi_its_cam_msgs::msg::CamParameters::high_frequency_container( +void CamParameters::high_frequency_container( const etsi_its_cam_msgs::msg::HighFrequencyContainer& _high_frequency_container) { m_high_frequency_container = _high_frequency_container; @@ -241,7 +169,7 @@ void etsi_its_cam_msgs::msg::CamParameters::high_frequency_container( * @brief This function moves the value in member high_frequency_container * @param _high_frequency_container New value to be moved in member high_frequency_container */ -void etsi_its_cam_msgs::msg::CamParameters::high_frequency_container( +void CamParameters::high_frequency_container( etsi_its_cam_msgs::msg::HighFrequencyContainer&& _high_frequency_container) { m_high_frequency_container = std::move(_high_frequency_container); @@ -251,7 +179,7 @@ void etsi_its_cam_msgs::msg::CamParameters::high_frequency_container( * @brief This function returns a constant reference to member high_frequency_container * @return Constant reference to member high_frequency_container */ -const etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::CamParameters::high_frequency_container() const +const etsi_its_cam_msgs::msg::HighFrequencyContainer& CamParameters::high_frequency_container() const { return m_high_frequency_container; } @@ -260,15 +188,17 @@ const etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::Ca * @brief This function returns a reference to member high_frequency_container * @return Reference to member high_frequency_container */ -etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::CamParameters::high_frequency_container() +etsi_its_cam_msgs::msg::HighFrequencyContainer& CamParameters::high_frequency_container() { return m_high_frequency_container; } + + /*! * @brief This function copies the value in member low_frequency_container * @param _low_frequency_container New value to be copied in member low_frequency_container */ -void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container( +void CamParameters::low_frequency_container( const etsi_its_cam_msgs::msg::LowFrequencyContainer& _low_frequency_container) { m_low_frequency_container = _low_frequency_container; @@ -278,7 +208,7 @@ void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container( * @brief This function moves the value in member low_frequency_container * @param _low_frequency_container New value to be moved in member low_frequency_container */ -void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container( +void CamParameters::low_frequency_container( etsi_its_cam_msgs::msg::LowFrequencyContainer&& _low_frequency_container) { m_low_frequency_container = std::move(_low_frequency_container); @@ -288,7 +218,7 @@ void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container( * @brief This function returns a constant reference to member low_frequency_container * @return Constant reference to member low_frequency_container */ -const etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::CamParameters::low_frequency_container() const +const etsi_its_cam_msgs::msg::LowFrequencyContainer& CamParameters::low_frequency_container() const { return m_low_frequency_container; } @@ -297,15 +227,17 @@ const etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::Cam * @brief This function returns a reference to member low_frequency_container * @return Reference to member low_frequency_container */ -etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::CamParameters::low_frequency_container() +etsi_its_cam_msgs::msg::LowFrequencyContainer& CamParameters::low_frequency_container() { return m_low_frequency_container; } + + /*! * @brief This function sets a value in member low_frequency_container_is_present * @param _low_frequency_container_is_present New value for member low_frequency_container_is_present */ -void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container_is_present( +void CamParameters::low_frequency_container_is_present( bool _low_frequency_container_is_present) { m_low_frequency_container_is_present = _low_frequency_container_is_present; @@ -315,7 +247,7 @@ void etsi_its_cam_msgs::msg::CamParameters::low_frequency_container_is_present( * @brief This function returns the value of member low_frequency_container_is_present * @return Value of member low_frequency_container_is_present */ -bool etsi_its_cam_msgs::msg::CamParameters::low_frequency_container_is_present() const +bool CamParameters::low_frequency_container_is_present() const { return m_low_frequency_container_is_present; } @@ -324,16 +256,17 @@ bool etsi_its_cam_msgs::msg::CamParameters::low_frequency_container_is_present() * @brief This function returns a reference to member low_frequency_container_is_present * @return Reference to member low_frequency_container_is_present */ -bool& etsi_its_cam_msgs::msg::CamParameters::low_frequency_container_is_present() +bool& CamParameters::low_frequency_container_is_present() { return m_low_frequency_container_is_present; } + /*! * @brief This function copies the value in member special_vehicle_container * @param _special_vehicle_container New value to be copied in member special_vehicle_container */ -void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container( +void CamParameters::special_vehicle_container( const etsi_its_cam_msgs::msg::SpecialVehicleContainer& _special_vehicle_container) { m_special_vehicle_container = _special_vehicle_container; @@ -343,7 +276,7 @@ void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container( * @brief This function moves the value in member special_vehicle_container * @param _special_vehicle_container New value to be moved in member special_vehicle_container */ -void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container( +void CamParameters::special_vehicle_container( etsi_its_cam_msgs::msg::SpecialVehicleContainer&& _special_vehicle_container) { m_special_vehicle_container = std::move(_special_vehicle_container); @@ -353,7 +286,7 @@ void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container( * @brief This function returns a constant reference to member special_vehicle_container * @return Constant reference to member special_vehicle_container */ -const etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container() const +const etsi_its_cam_msgs::msg::SpecialVehicleContainer& CamParameters::special_vehicle_container() const { return m_special_vehicle_container; } @@ -362,15 +295,17 @@ const etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::C * @brief This function returns a reference to member special_vehicle_container * @return Reference to member special_vehicle_container */ -etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container() +etsi_its_cam_msgs::msg::SpecialVehicleContainer& CamParameters::special_vehicle_container() { return m_special_vehicle_container; } + + /*! * @brief This function sets a value in member special_vehicle_container_is_present * @param _special_vehicle_container_is_present New value for member special_vehicle_container_is_present */ -void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container_is_present( +void CamParameters::special_vehicle_container_is_present( bool _special_vehicle_container_is_present) { m_special_vehicle_container_is_present = _special_vehicle_container_is_present; @@ -380,7 +315,7 @@ void etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container_is_present * @brief This function returns the value of member special_vehicle_container_is_present * @return Value of member special_vehicle_container_is_present */ -bool etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container_is_present() const +bool CamParameters::special_vehicle_container_is_present() const { return m_special_vehicle_container_is_present; } @@ -389,32 +324,18 @@ bool etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container_is_present * @brief This function returns a reference to member special_vehicle_container_is_present * @return Reference to member special_vehicle_container_is_present */ -bool& etsi_its_cam_msgs::msg::CamParameters::special_vehicle_container_is_present() +bool& CamParameters::special_vehicle_container_is_present() { return m_special_vehicle_container_is_present; } -size_t etsi_its_cam_msgs::msg::CamParameters::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::CamParameters::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::CamParameters::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CamParametersCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.h index b30a7e5a331..edd3675cbde 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParameters.h @@ -16,23 +16,28 @@ * @file CamParameters.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "SpecialVehicleContainer.h" #include "BasicContainer.h" #include "HighFrequencyContainer.h" #include "LowFrequencyContainer.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -46,293 +51,256 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CamParameters_SOURCE) -#define CamParameters_DllAPI __declspec( dllexport ) +#if defined(CAMPARAMETERS_SOURCE) +#define CAMPARAMETERS_DllAPI __declspec( dllexport ) #else -#define CamParameters_DllAPI __declspec( dllimport ) -#endif // CamParameters_SOURCE +#define CAMPARAMETERS_DllAPI __declspec( dllimport ) +#endif // CAMPARAMETERS_SOURCE #else -#define CamParameters_DllAPI +#define CAMPARAMETERS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CamParameters_DllAPI +#define CAMPARAMETERS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure CamParameters defined by the user in the IDL file. - * @ingroup CAMPARAMETERS - */ - class CamParameters - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CamParameters(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CamParameters(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. - */ - eProsima_user_DllExport CamParameters( - const CamParameters& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. - */ - eProsima_user_DllExport CamParameters( - CamParameters&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. - */ - eProsima_user_DllExport CamParameters& operator =( - const CamParameters& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. - */ - eProsima_user_DllExport CamParameters& operator =( - CamParameters&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CamParameters object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CamParameters& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CamParameters object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CamParameters& x) const; - - /*! - * @brief This function copies the value in member basic_container - * @param _basic_container New value to be copied in member basic_container - */ - eProsima_user_DllExport void basic_container( - const etsi_its_cam_msgs::msg::BasicContainer& _basic_container); - - /*! - * @brief This function moves the value in member basic_container - * @param _basic_container New value to be moved in member basic_container - */ - eProsima_user_DllExport void basic_container( - etsi_its_cam_msgs::msg::BasicContainer&& _basic_container); - - /*! - * @brief This function returns a constant reference to member basic_container - * @return Constant reference to member basic_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicContainer& basic_container() const; - - /*! - * @brief This function returns a reference to member basic_container - * @return Reference to member basic_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicContainer& basic_container(); - /*! - * @brief This function copies the value in member high_frequency_container - * @param _high_frequency_container New value to be copied in member high_frequency_container - */ - eProsima_user_DllExport void high_frequency_container( - const etsi_its_cam_msgs::msg::HighFrequencyContainer& _high_frequency_container); - - /*! - * @brief This function moves the value in member high_frequency_container - * @param _high_frequency_container New value to be moved in member high_frequency_container - */ - eProsima_user_DllExport void high_frequency_container( - etsi_its_cam_msgs::msg::HighFrequencyContainer&& _high_frequency_container); - - /*! - * @brief This function returns a constant reference to member high_frequency_container - * @return Constant reference to member high_frequency_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::HighFrequencyContainer& high_frequency_container() const; - - /*! - * @brief This function returns a reference to member high_frequency_container - * @return Reference to member high_frequency_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::HighFrequencyContainer& high_frequency_container(); - /*! - * @brief This function copies the value in member low_frequency_container - * @param _low_frequency_container New value to be copied in member low_frequency_container - */ - eProsima_user_DllExport void low_frequency_container( - const etsi_its_cam_msgs::msg::LowFrequencyContainer& _low_frequency_container); - - /*! - * @brief This function moves the value in member low_frequency_container - * @param _low_frequency_container New value to be moved in member low_frequency_container - */ - eProsima_user_DllExport void low_frequency_container( - etsi_its_cam_msgs::msg::LowFrequencyContainer&& _low_frequency_container); - - /*! - * @brief This function returns a constant reference to member low_frequency_container - * @return Constant reference to member low_frequency_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LowFrequencyContainer& low_frequency_container() const; - - /*! - * @brief This function returns a reference to member low_frequency_container - * @return Reference to member low_frequency_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LowFrequencyContainer& low_frequency_container(); - /*! - * @brief This function sets a value in member low_frequency_container_is_present - * @param _low_frequency_container_is_present New value for member low_frequency_container_is_present - */ - eProsima_user_DllExport void low_frequency_container_is_present( - bool _low_frequency_container_is_present); - - /*! - * @brief This function returns the value of member low_frequency_container_is_present - * @return Value of member low_frequency_container_is_present - */ - eProsima_user_DllExport bool low_frequency_container_is_present() const; - - /*! - * @brief This function returns a reference to member low_frequency_container_is_present - * @return Reference to member low_frequency_container_is_present - */ - eProsima_user_DllExport bool& low_frequency_container_is_present(); - - /*! - * @brief This function copies the value in member special_vehicle_container - * @param _special_vehicle_container New value to be copied in member special_vehicle_container - */ - eProsima_user_DllExport void special_vehicle_container( - const etsi_its_cam_msgs::msg::SpecialVehicleContainer& _special_vehicle_container); - - /*! - * @brief This function moves the value in member special_vehicle_container - * @param _special_vehicle_container New value to be moved in member special_vehicle_container - */ - eProsima_user_DllExport void special_vehicle_container( - etsi_its_cam_msgs::msg::SpecialVehicleContainer&& _special_vehicle_container); - - /*! - * @brief This function returns a constant reference to member special_vehicle_container - * @return Constant reference to member special_vehicle_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialVehicleContainer& special_vehicle_container() const; - - /*! - * @brief This function returns a reference to member special_vehicle_container - * @return Reference to member special_vehicle_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialVehicleContainer& special_vehicle_container(); - /*! - * @brief This function sets a value in member special_vehicle_container_is_present - * @param _special_vehicle_container_is_present New value for member special_vehicle_container_is_present - */ - eProsima_user_DllExport void special_vehicle_container_is_present( - bool _special_vehicle_container_is_present); - - /*! - * @brief This function returns the value of member special_vehicle_container_is_present - * @return Value of member special_vehicle_container_is_present - */ - eProsima_user_DllExport bool special_vehicle_container_is_present() const; - - /*! - * @brief This function returns a reference to member special_vehicle_container_is_present - * @return Reference to member special_vehicle_container_is_present - */ - eProsima_user_DllExport bool& special_vehicle_container_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CamParameters& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::BasicContainer m_basic_container; - etsi_its_cam_msgs::msg::HighFrequencyContainer m_high_frequency_container; - etsi_its_cam_msgs::msg::LowFrequencyContainer m_low_frequency_container; - bool m_low_frequency_container_is_present; - etsi_its_cam_msgs::msg::SpecialVehicleContainer m_special_vehicle_container; - bool m_special_vehicle_container_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CamParameters defined by the user in the IDL file. + * @ingroup CamParameters + */ +class CamParameters +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CamParameters(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CamParameters(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. + */ + eProsima_user_DllExport CamParameters( + const CamParameters& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. + */ + eProsima_user_DllExport CamParameters( + CamParameters&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. + */ + eProsima_user_DllExport CamParameters& operator =( + const CamParameters& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CamParameters that will be copied. + */ + eProsima_user_DllExport CamParameters& operator =( + CamParameters&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CamParameters object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CamParameters& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CamParameters object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CamParameters& x) const; + + /*! + * @brief This function copies the value in member basic_container + * @param _basic_container New value to be copied in member basic_container + */ + eProsima_user_DllExport void basic_container( + const etsi_its_cam_msgs::msg::BasicContainer& _basic_container); + + /*! + * @brief This function moves the value in member basic_container + * @param _basic_container New value to be moved in member basic_container + */ + eProsima_user_DllExport void basic_container( + etsi_its_cam_msgs::msg::BasicContainer&& _basic_container); + + /*! + * @brief This function returns a constant reference to member basic_container + * @return Constant reference to member basic_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicContainer& basic_container() const; + + /*! + * @brief This function returns a reference to member basic_container + * @return Reference to member basic_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicContainer& basic_container(); + + + /*! + * @brief This function copies the value in member high_frequency_container + * @param _high_frequency_container New value to be copied in member high_frequency_container + */ + eProsima_user_DllExport void high_frequency_container( + const etsi_its_cam_msgs::msg::HighFrequencyContainer& _high_frequency_container); + + /*! + * @brief This function moves the value in member high_frequency_container + * @param _high_frequency_container New value to be moved in member high_frequency_container + */ + eProsima_user_DllExport void high_frequency_container( + etsi_its_cam_msgs::msg::HighFrequencyContainer&& _high_frequency_container); + + /*! + * @brief This function returns a constant reference to member high_frequency_container + * @return Constant reference to member high_frequency_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HighFrequencyContainer& high_frequency_container() const; + + /*! + * @brief This function returns a reference to member high_frequency_container + * @return Reference to member high_frequency_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HighFrequencyContainer& high_frequency_container(); + + + /*! + * @brief This function copies the value in member low_frequency_container + * @param _low_frequency_container New value to be copied in member low_frequency_container + */ + eProsima_user_DllExport void low_frequency_container( + const etsi_its_cam_msgs::msg::LowFrequencyContainer& _low_frequency_container); + + /*! + * @brief This function moves the value in member low_frequency_container + * @param _low_frequency_container New value to be moved in member low_frequency_container + */ + eProsima_user_DllExport void low_frequency_container( + etsi_its_cam_msgs::msg::LowFrequencyContainer&& _low_frequency_container); + + /*! + * @brief This function returns a constant reference to member low_frequency_container + * @return Constant reference to member low_frequency_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LowFrequencyContainer& low_frequency_container() const; + + /*! + * @brief This function returns a reference to member low_frequency_container + * @return Reference to member low_frequency_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LowFrequencyContainer& low_frequency_container(); + + + /*! + * @brief This function sets a value in member low_frequency_container_is_present + * @param _low_frequency_container_is_present New value for member low_frequency_container_is_present + */ + eProsima_user_DllExport void low_frequency_container_is_present( + bool _low_frequency_container_is_present); + + /*! + * @brief This function returns the value of member low_frequency_container_is_present + * @return Value of member low_frequency_container_is_present + */ + eProsima_user_DllExport bool low_frequency_container_is_present() const; + + /*! + * @brief This function returns a reference to member low_frequency_container_is_present + * @return Reference to member low_frequency_container_is_present + */ + eProsima_user_DllExport bool& low_frequency_container_is_present(); + + + /*! + * @brief This function copies the value in member special_vehicle_container + * @param _special_vehicle_container New value to be copied in member special_vehicle_container + */ + eProsima_user_DllExport void special_vehicle_container( + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& _special_vehicle_container); + + /*! + * @brief This function moves the value in member special_vehicle_container + * @param _special_vehicle_container New value to be moved in member special_vehicle_container + */ + eProsima_user_DllExport void special_vehicle_container( + etsi_its_cam_msgs::msg::SpecialVehicleContainer&& _special_vehicle_container); + + /*! + * @brief This function returns a constant reference to member special_vehicle_container + * @return Constant reference to member special_vehicle_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialVehicleContainer& special_vehicle_container() const; + + /*! + * @brief This function returns a reference to member special_vehicle_container + * @return Reference to member special_vehicle_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialVehicleContainer& special_vehicle_container(); + + + /*! + * @brief This function sets a value in member special_vehicle_container_is_present + * @param _special_vehicle_container_is_present New value for member special_vehicle_container_is_present + */ + eProsima_user_DllExport void special_vehicle_container_is_present( + bool _special_vehicle_container_is_present); + + /*! + * @brief This function returns the value of member special_vehicle_container_is_present + * @return Value of member special_vehicle_container_is_present + */ + eProsima_user_DllExport bool special_vehicle_container_is_present() const; + + /*! + * @brief This function returns a reference to member special_vehicle_container_is_present + * @return Reference to member special_vehicle_container_is_present + */ + eProsima_user_DllExport bool& special_vehicle_container_is_present(); + +private: + + etsi_its_cam_msgs::msg::BasicContainer m_basic_container; + etsi_its_cam_msgs::msg::HighFrequencyContainer m_high_frequency_container; + etsi_its_cam_msgs::msg::LowFrequencyContainer m_low_frequency_container; + bool m_low_frequency_container_is_present{false}; + etsi_its_cam_msgs::msg::SpecialVehicleContainer m_special_vehicle_container; + bool m_special_vehicle_container_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersCdrAux.hpp new file mode 100644 index 00000000000..30c52d14911 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CamParametersCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERSCDRAUX_HPP_ + +#include "CamParameters.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CamParameters_max_cdr_typesize {12179UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CamParameters_max_key_cdr_typesize {0UL}; + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CamParameters& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersCdrAux.ipp new file mode 100644 index 00000000000..313e2d68978 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersCdrAux.ipp @@ -0,0 +1,170 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CamParametersCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERSCDRAUX_IPP_ + +#include "CamParametersCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CamParameters& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.basic_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.high_frequency_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.low_frequency_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.low_frequency_container_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.special_vehicle_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.special_vehicle_container_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CamParameters& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.basic_container() + << eprosima::fastcdr::MemberId(1) << data.high_frequency_container() + << eprosima::fastcdr::MemberId(2) << data.low_frequency_container() + << eprosima::fastcdr::MemberId(3) << data.low_frequency_container_is_present() + << eprosima::fastcdr::MemberId(4) << data.special_vehicle_container() + << eprosima::fastcdr::MemberId(5) << data.special_vehicle_container_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CamParameters& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.basic_container(); + break; + + case 1: + dcdr >> data.high_frequency_container(); + break; + + case 2: + dcdr >> data.low_frequency_container(); + break; + + case 3: + dcdr >> data.low_frequency_container_is_present(); + break; + + case 4: + dcdr >> data.special_vehicle_container(); + break; + + case 5: + dcdr >> data.special_vehicle_container_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CamParameters& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.cxx index abfad39c34c..6f2d24a7f06 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CamParametersPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CamParametersPubSubTypes.h" +#include "CamParametersCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - CamParametersPubSubType::CamParametersPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CamParameters_"); - auto type_size = CamParameters::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CamParameters::isKeyDefined(); - size_t keyLength = CamParameters::getKeyMaxCdrSerializedSize() > 16 ? - CamParameters::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CamParametersPubSubType::~CamParametersPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CamParametersPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CamParameters* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CamParametersPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CamParameters* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CamParametersPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CamParametersPubSubType::createData() - { - return reinterpret_cast(new CamParameters()); - } - - void CamParametersPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CamParametersPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CamParameters* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CamParameters::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CamParameters::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CamParametersPubSubType::CamParametersPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CamParameters_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CamParameters::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CamParameters_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CamParametersPubSubType::~CamParametersPubSubType() +{ +} + +bool CamParametersPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CamParameters* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CamParametersPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CamParameters* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CamParametersPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CamParametersPubSubType::createData() +{ + return reinterpret_cast(new CamParameters()); +} + +void CamParametersPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CamParametersPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.h index ea7f45e0f65..918dadfcc80 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CamParametersPubSubTypes.h @@ -16,92 +16,124 @@ * @file CamParametersPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CamParameters.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "SpecialVehicleContainerPubSubTypes.h" +#include "BasicContainerPubSubTypes.h" +#include "HighFrequencyContainerPubSubTypes.h" +#include "LowFrequencyContainerPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CamParameters is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CamParameters defined by the user in the IDL file. + * @ingroup CamParameters + */ +class CamParametersPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CamParameters defined by the user in the IDL file. - * @ingroup CAMPARAMETERS - */ - class CamParametersPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CamParameters type; + typedef CamParameters type; - eProsima_user_DllExport CamParametersPubSubType(); + eProsima_user_DllExport CamParametersPubSubType(); - eProsima_user_DllExport virtual ~CamParametersPubSubType(); + eProsima_user_DllExport ~CamParametersPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAMPARAMETERS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.cxx index 4e23fcb059d..62f6d47272b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.cxx @@ -14,9 +14,9 @@ /*! * @file CauseCode.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "CauseCode.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::CauseCode::CauseCode() -{ - // m_cause_code com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@bc57b40 - // m_sub_cause_code com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1b5bc39d +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::CauseCode::~CauseCode() +CauseCode::CauseCode() { +} +CauseCode::~CauseCode() +{ } -etsi_its_cam_msgs::msg::CauseCode::CauseCode( +CauseCode::CauseCode( const CauseCode& x) { m_cause_code = x.m_cause_code; m_sub_cause_code = x.m_sub_cause_code; } -etsi_its_cam_msgs::msg::CauseCode::CauseCode( - CauseCode&& x) +CauseCode::CauseCode( + CauseCode&& x) noexcept { m_cause_code = std::move(x.m_cause_code); m_sub_cause_code = std::move(x.m_sub_cause_code); } -etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::CauseCode::operator =( +CauseCode& CauseCode::operator =( const CauseCode& x) { m_cause_code = x.m_cause_code; m_sub_cause_code = x.m_sub_cause_code; - return *this; } -etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::CauseCode::operator =( - CauseCode&& x) +CauseCode& CauseCode::operator =( + CauseCode&& x) noexcept { m_cause_code = std::move(x.m_cause_code); m_sub_cause_code = std::move(x.m_sub_cause_code); - return *this; } -bool etsi_its_cam_msgs::msg::CauseCode::operator ==( +bool CauseCode::operator ==( const CauseCode& x) const { - - return (m_cause_code == x.m_cause_code && m_sub_cause_code == x.m_sub_cause_code); + return (m_cause_code == x.m_cause_code && + m_sub_cause_code == x.m_sub_cause_code); } -bool etsi_its_cam_msgs::msg::CauseCode::operator !=( +bool CauseCode::operator !=( const CauseCode& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CauseCode::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::CauseCodeType::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SubCauseCodeType::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CauseCode::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CauseCode& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::CauseCodeType::getCdrSerializedSize(data.cause_code(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SubCauseCodeType::getCdrSerializedSize(data.sub_cause_code(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CauseCode::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_cause_code; - scdr << m_sub_cause_code; - -} - -void etsi_its_cam_msgs::msg::CauseCode::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_cause_code; - dcdr >> m_sub_cause_code; -} - /*! * @brief This function copies the value in member cause_code * @param _cause_code New value to be copied in member cause_code */ -void etsi_its_cam_msgs::msg::CauseCode::cause_code( +void CauseCode::cause_code( const etsi_its_cam_msgs::msg::CauseCodeType& _cause_code) { m_cause_code = _cause_code; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::CauseCode::cause_code( * @brief This function moves the value in member cause_code * @param _cause_code New value to be moved in member cause_code */ -void etsi_its_cam_msgs::msg::CauseCode::cause_code( +void CauseCode::cause_code( etsi_its_cam_msgs::msg::CauseCodeType&& _cause_code) { m_cause_code = std::move(_cause_code); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::CauseCode::cause_code( * @brief This function returns a constant reference to member cause_code * @return Constant reference to member cause_code */ -const etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCode::cause_code() const +const etsi_its_cam_msgs::msg::CauseCodeType& CauseCode::cause_code() const { return m_cause_code; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCode:: * @brief This function returns a reference to member cause_code * @return Reference to member cause_code */ -etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCode::cause_code() +etsi_its_cam_msgs::msg::CauseCodeType& CauseCode::cause_code() { return m_cause_code; } + + /*! * @brief This function copies the value in member sub_cause_code * @param _sub_cause_code New value to be copied in member sub_cause_code */ -void etsi_its_cam_msgs::msg::CauseCode::sub_cause_code( +void CauseCode::sub_cause_code( const etsi_its_cam_msgs::msg::SubCauseCodeType& _sub_cause_code) { m_sub_cause_code = _sub_cause_code; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::CauseCode::sub_cause_code( * @brief This function moves the value in member sub_cause_code * @param _sub_cause_code New value to be moved in member sub_cause_code */ -void etsi_its_cam_msgs::msg::CauseCode::sub_cause_code( +void CauseCode::sub_cause_code( etsi_its_cam_msgs::msg::SubCauseCodeType&& _sub_cause_code) { m_sub_cause_code = std::move(_sub_cause_code); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::CauseCode::sub_cause_code( * @brief This function returns a constant reference to member sub_cause_code * @return Constant reference to member sub_cause_code */ -const etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::CauseCode::sub_cause_code() const +const etsi_its_cam_msgs::msg::SubCauseCodeType& CauseCode::sub_cause_code() const { return m_sub_cause_code; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::CauseCod * @brief This function returns a reference to member sub_cause_code * @return Reference to member sub_cause_code */ -etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::CauseCode::sub_cause_code() +etsi_its_cam_msgs::msg::SubCauseCodeType& CauseCode::sub_cause_code() { return m_sub_cause_code; } -size_t etsi_its_cam_msgs::msg::CauseCode::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::CauseCode::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::CauseCode::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CauseCodeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.h index 4533dc8dbc3..0ddae061ddd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCode.h @@ -16,21 +16,26 @@ * @file CauseCode.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_H_ -#include "SubCauseCodeType.h" -#include "CauseCodeType.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "SubCauseCodeType.h" +#include "CauseCodeType.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CauseCode_SOURCE) -#define CauseCode_DllAPI __declspec( dllexport ) +#if defined(CAUSECODE_SOURCE) +#define CAUSECODE_DllAPI __declspec( dllexport ) #else -#define CauseCode_DllAPI __declspec( dllimport ) -#endif // CauseCode_SOURCE +#define CAUSECODE_DllAPI __declspec( dllimport ) +#endif // CAUSECODE_SOURCE #else -#define CauseCode_DllAPI +#define CAUSECODE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CauseCode_DllAPI +#define CAUSECODE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure CauseCode defined by the user in the IDL file. - * @ingroup CAUSECODE - */ - class CauseCode - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CauseCode(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CauseCode(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. - */ - eProsima_user_DllExport CauseCode( - const CauseCode& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. - */ - eProsima_user_DllExport CauseCode( - CauseCode&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. - */ - eProsima_user_DllExport CauseCode& operator =( - const CauseCode& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. - */ - eProsima_user_DllExport CauseCode& operator =( - CauseCode&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CauseCode object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CauseCode& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CauseCode object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CauseCode& x) const; - - /*! - * @brief This function copies the value in member cause_code - * @param _cause_code New value to be copied in member cause_code - */ - eProsima_user_DllExport void cause_code( - const etsi_its_cam_msgs::msg::CauseCodeType& _cause_code); - - /*! - * @brief This function moves the value in member cause_code - * @param _cause_code New value to be moved in member cause_code - */ - eProsima_user_DllExport void cause_code( - etsi_its_cam_msgs::msg::CauseCodeType&& _cause_code); - - /*! - * @brief This function returns a constant reference to member cause_code - * @return Constant reference to member cause_code - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCodeType& cause_code() const; - - /*! - * @brief This function returns a reference to member cause_code - * @return Reference to member cause_code - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCodeType& cause_code(); - /*! - * @brief This function copies the value in member sub_cause_code - * @param _sub_cause_code New value to be copied in member sub_cause_code - */ - eProsima_user_DllExport void sub_cause_code( - const etsi_its_cam_msgs::msg::SubCauseCodeType& _sub_cause_code); - - /*! - * @brief This function moves the value in member sub_cause_code - * @param _sub_cause_code New value to be moved in member sub_cause_code - */ - eProsima_user_DllExport void sub_cause_code( - etsi_its_cam_msgs::msg::SubCauseCodeType&& _sub_cause_code); - - /*! - * @brief This function returns a constant reference to member sub_cause_code - * @return Constant reference to member sub_cause_code - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SubCauseCodeType& sub_cause_code() const; - - /*! - * @brief This function returns a reference to member sub_cause_code - * @return Reference to member sub_cause_code - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SubCauseCodeType& sub_cause_code(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CauseCode& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::CauseCodeType m_cause_code; - etsi_its_cam_msgs::msg::SubCauseCodeType m_sub_cause_code; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CauseCode defined by the user in the IDL file. + * @ingroup CauseCode + */ +class CauseCode +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CauseCode(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CauseCode(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. + */ + eProsima_user_DllExport CauseCode( + const CauseCode& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. + */ + eProsima_user_DllExport CauseCode( + CauseCode&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. + */ + eProsima_user_DllExport CauseCode& operator =( + const CauseCode& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCode that will be copied. + */ + eProsima_user_DllExport CauseCode& operator =( + CauseCode&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CauseCode object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CauseCode& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CauseCode object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CauseCode& x) const; + + /*! + * @brief This function copies the value in member cause_code + * @param _cause_code New value to be copied in member cause_code + */ + eProsima_user_DllExport void cause_code( + const etsi_its_cam_msgs::msg::CauseCodeType& _cause_code); + + /*! + * @brief This function moves the value in member cause_code + * @param _cause_code New value to be moved in member cause_code + */ + eProsima_user_DllExport void cause_code( + etsi_its_cam_msgs::msg::CauseCodeType&& _cause_code); + + /*! + * @brief This function returns a constant reference to member cause_code + * @return Constant reference to member cause_code + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCodeType& cause_code() const; + + /*! + * @brief This function returns a reference to member cause_code + * @return Reference to member cause_code + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCodeType& cause_code(); + + + /*! + * @brief This function copies the value in member sub_cause_code + * @param _sub_cause_code New value to be copied in member sub_cause_code + */ + eProsima_user_DllExport void sub_cause_code( + const etsi_its_cam_msgs::msg::SubCauseCodeType& _sub_cause_code); + + /*! + * @brief This function moves the value in member sub_cause_code + * @param _sub_cause_code New value to be moved in member sub_cause_code + */ + eProsima_user_DllExport void sub_cause_code( + etsi_its_cam_msgs::msg::SubCauseCodeType&& _sub_cause_code); + + /*! + * @brief This function returns a constant reference to member sub_cause_code + * @return Constant reference to member sub_cause_code + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SubCauseCodeType& sub_cause_code() const; + + /*! + * @brief This function returns a reference to member sub_cause_code + * @return Reference to member sub_cause_code + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SubCauseCodeType& sub_cause_code(); + +private: + + etsi_its_cam_msgs::msg::CauseCodeType m_cause_code; + etsi_its_cam_msgs::msg::SubCauseCodeType m_sub_cause_code; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeCdrAux.hpp new file mode 100644 index 00000000000..a94940d7b2e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODECDRAUX_HPP_ + +#include "CauseCode.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CauseCode_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CauseCode_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CauseCode& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeCdrAux.ipp new file mode 100644 index 00000000000..4f3652bccf4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODECDRAUX_IPP_ + +#include "CauseCodeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CauseCode& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.cause_code(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.sub_cause_code(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CauseCode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.cause_code() + << eprosima::fastcdr::MemberId(1) << data.sub_cause_code() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CauseCode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.cause_code(); + break; + + case 1: + dcdr >> data.sub_cause_code(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CauseCode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.cxx index cc0a7168c68..8307597a139 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CauseCodePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CauseCodePubSubTypes.h" +#include "CauseCodeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - CauseCodePubSubType::CauseCodePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CauseCode_"); - auto type_size = CauseCode::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CauseCode::isKeyDefined(); - size_t keyLength = CauseCode::getKeyMaxCdrSerializedSize() > 16 ? - CauseCode::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CauseCodePubSubType::~CauseCodePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CauseCodePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CauseCode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CauseCodePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CauseCode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CauseCodePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CauseCodePubSubType::createData() - { - return reinterpret_cast(new CauseCode()); - } - - void CauseCodePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CauseCodePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CauseCode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CauseCode::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CauseCode::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CauseCodePubSubType::CauseCodePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CauseCode_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CauseCode::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CauseCode_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CauseCodePubSubType::~CauseCodePubSubType() +{ +} + +bool CauseCodePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CauseCode* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CauseCodePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CauseCode* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CauseCodePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CauseCodePubSubType::createData() +{ + return reinterpret_cast(new CauseCode()); +} + +void CauseCodePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CauseCodePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.h index 995db83ecf8..3e47af41d22 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodePubSubTypes.h @@ -16,92 +16,122 @@ * @file CauseCodePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CauseCode.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "SubCauseCodeTypePubSubTypes.h" +#include "CauseCodeTypePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CauseCode is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CauseCode defined by the user in the IDL file. + * @ingroup CauseCode + */ +class CauseCodePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CauseCode defined by the user in the IDL file. - * @ingroup CAUSECODE - */ - class CauseCodePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CauseCode type; + typedef CauseCode type; - eProsima_user_DllExport CauseCodePubSubType(); + eProsima_user_DllExport CauseCodePubSubType(); - eProsima_user_DllExport virtual ~CauseCodePubSubType(); + eProsima_user_DllExport ~CauseCodePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CauseCode(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.cxx index 4c64c12d3bc..2caebcbe85f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.cxx @@ -14,9 +14,9 @@ /*! * @file CauseCodeType.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,143 +27,79 @@ char dummy; #endif // _WIN32 #include "CauseCodeType.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace CauseCodeType_Constants { +} // namespace CauseCodeType_Constants - - - - - - - - - - - - - - - - - - - - - - - -etsi_its_cam_msgs::msg::CauseCodeType::CauseCodeType() +CauseCodeType::CauseCodeType() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2ca47471 - m_value = 0; - } -etsi_its_cam_msgs::msg::CauseCodeType::~CauseCodeType() +CauseCodeType::~CauseCodeType() { } -etsi_its_cam_msgs::msg::CauseCodeType::CauseCodeType( +CauseCodeType::CauseCodeType( const CauseCodeType& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CauseCodeType::CauseCodeType( - CauseCodeType&& x) +CauseCodeType::CauseCodeType( + CauseCodeType&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCodeType::operator =( +CauseCodeType& CauseCodeType::operator =( const CauseCodeType& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::CauseCodeType& etsi_its_cam_msgs::msg::CauseCodeType::operator =( - CauseCodeType&& x) +CauseCodeType& CauseCodeType::operator =( + CauseCodeType&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::CauseCodeType::operator ==( +bool CauseCodeType::operator ==( const CauseCodeType& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::CauseCodeType::operator !=( +bool CauseCodeType::operator !=( const CauseCodeType& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CauseCodeType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CauseCodeType::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CauseCodeType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CauseCodeType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::CauseCodeType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::CauseCodeType::value( +void CauseCodeType::value( uint8_t _value) { m_value = _value; @@ -173,7 +109,7 @@ void etsi_its_cam_msgs::msg::CauseCodeType::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::CauseCodeType::value() const +uint8_t CauseCodeType::value() const { return m_value; } @@ -182,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::CauseCodeType::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::CauseCodeType::value() +uint8_t& CauseCodeType::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::CauseCodeType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::CauseCodeType::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::CauseCodeType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CauseCodeTypeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.h index b1bb4a7e467..687946855a5 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeType.h @@ -16,19 +16,24 @@ * @file CauseCodeType.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,200 +47,156 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CauseCodeType_SOURCE) -#define CauseCodeType_DllAPI __declspec( dllexport ) +#if defined(CAUSECODETYPE_SOURCE) +#define CAUSECODETYPE_DllAPI __declspec( dllexport ) #else -#define CauseCodeType_DllAPI __declspec( dllimport ) -#endif // CauseCodeType_SOURCE +#define CAUSECODETYPE_DllAPI __declspec( dllimport ) +#endif // CAUSECODETYPE_SOURCE #else -#define CauseCodeType_DllAPI +#define CAUSECODETYPE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CauseCodeType_DllAPI +#define CAUSECODETYPE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace CauseCodeType_Constants { - const uint8_t MIN = 0; - const uint8_t MAX = 255; - const uint8_t RESERVED = 0; - const uint8_t TRAFFIC_CONDITION = 1; - const uint8_t ACCIDENT = 2; - const uint8_t ROADWORKS = 3; - const uint8_t IMPASSABILITY = 5; - const uint8_t ADVERSE_WEATHER_CONDITION_ADHESION = 6; - const uint8_t AQUAPLANNNING = 7; - const uint8_t HAZARDOUS_LOCATION_SURFACE_CONDITION = 9; - const uint8_t HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD = 10; - const uint8_t HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD = 11; - const uint8_t HUMAN_PRESENCE_ON_THE_ROAD = 12; - const uint8_t WRONG_WAY_DRIVING = 14; - const uint8_t RESCUE_AND_RECOVERY_WORK_IN_PROGRESS = 15; - const uint8_t ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION = 17; - const uint8_t ADVERSE_WEATHER_CONDITION_VISIBILITY = 18; - const uint8_t ADVERSE_WEATHER_CONDITION_PRECIPITATION = 19; - const uint8_t SLOW_VEHICLE = 26; - const uint8_t DANGEROUS_END_OF_QUEUE = 27; - const uint8_t VEHICLE_BREAKDOWN = 91; - const uint8_t POST_CRASH = 92; - const uint8_t HUMAN_PROBLEM = 93; - const uint8_t STATIONARY_VEHICLE = 94; - const uint8_t EMERGENCY_VEHICLE_APPROACHING = 95; - const uint8_t HAZARDOUS_LOCATION_DANGEROUS_CURVE = 96; - const uint8_t COLLISION_RISK = 97; - const uint8_t SIGNAL_VIOLATION = 98; - const uint8_t DANGEROUS_SITUATION = 99; - } // namespace CauseCodeType_Constants - /*! - * @brief This class represents the structure CauseCodeType defined by the user in the IDL file. - * @ingroup CAUSECODETYPE - */ - class CauseCodeType - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CauseCodeType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CauseCodeType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. - */ - eProsima_user_DllExport CauseCodeType( - const CauseCodeType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. - */ - eProsima_user_DllExport CauseCodeType( - CauseCodeType&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. - */ - eProsima_user_DllExport CauseCodeType& operator =( - const CauseCodeType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. - */ - eProsima_user_DllExport CauseCodeType& operator =( - CauseCodeType&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CauseCodeType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CauseCodeType& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CauseCodeType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CauseCodeType& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CauseCodeType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace CauseCodeType_Constants { + +const uint8_t MIN = 0; +const uint8_t MAX = 255; +const uint8_t RESERVED = 0; +const uint8_t TRAFFIC_CONDITION = 1; +const uint8_t ACCIDENT = 2; +const uint8_t ROADWORKS = 3; +const uint8_t IMPASSABILITY = 5; +const uint8_t ADVERSE_WEATHER_CONDITION_ADHESION = 6; +const uint8_t AQUAPLANNNING = 7; +const uint8_t HAZARDOUS_LOCATION_SURFACE_CONDITION = 9; +const uint8_t HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD = 10; +const uint8_t HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD = 11; +const uint8_t HUMAN_PRESENCE_ON_THE_ROAD = 12; +const uint8_t WRONG_WAY_DRIVING = 14; +const uint8_t RESCUE_AND_RECOVERY_WORK_IN_PROGRESS = 15; +const uint8_t ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION = 17; +const uint8_t ADVERSE_WEATHER_CONDITION_VISIBILITY = 18; +const uint8_t ADVERSE_WEATHER_CONDITION_PRECIPITATION = 19; +const uint8_t SLOW_VEHICLE = 26; +const uint8_t DANGEROUS_END_OF_QUEUE = 27; +const uint8_t VEHICLE_BREAKDOWN = 91; +const uint8_t POST_CRASH = 92; +const uint8_t HUMAN_PROBLEM = 93; +const uint8_t STATIONARY_VEHICLE = 94; +const uint8_t EMERGENCY_VEHICLE_APPROACHING = 95; +const uint8_t HAZARDOUS_LOCATION_DANGEROUS_CURVE = 96; +const uint8_t COLLISION_RISK = 97; +const uint8_t SIGNAL_VIOLATION = 98; +const uint8_t DANGEROUS_SITUATION = 99; + +} // namespace CauseCodeType_Constants + + +/*! + * @brief This class represents the structure CauseCodeType defined by the user in the IDL file. + * @ingroup CauseCodeType + */ +class CauseCodeType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CauseCodeType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CauseCodeType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. + */ + eProsima_user_DllExport CauseCodeType( + const CauseCodeType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. + */ + eProsima_user_DllExport CauseCodeType( + CauseCodeType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. + */ + eProsima_user_DllExport CauseCodeType& operator =( + const CauseCodeType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CauseCodeType that will be copied. + */ + eProsima_user_DllExport CauseCodeType& operator =( + CauseCodeType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CauseCodeType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CauseCodeType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CauseCodeType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CauseCodeType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypeCdrAux.hpp new file mode 100644 index 00000000000..5993fb57d6c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypeCdrAux.hpp @@ -0,0 +1,109 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodeTypeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPECDRAUX_HPP_ + +#include "CauseCodeType.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CauseCodeType_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CauseCodeType_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CauseCodeType& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypeCdrAux.ipp new file mode 100644 index 00000000000..4f93299f109 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypeCdrAux.ipp @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CauseCodeTypeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPECDRAUX_IPP_ + +#include "CauseCodeTypeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CauseCodeType& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CauseCodeType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CauseCodeType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CauseCodeType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.cxx index fb783704eb1..b39ec50290d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.cxx @@ -16,21 +16,39 @@ * @file CauseCodeTypePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CauseCodeTypePubSubTypes.h" +#include "CauseCodeTypeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace CauseCodeType_Constants { +namespace msg { +namespace CauseCodeType_Constants { + + + + + + + + + + + + + + @@ -61,148 +79,182 @@ namespace etsi_its_cam_msgs { - } //End of namespace CauseCodeType_Constants - CauseCodeTypePubSubType::CauseCodeTypePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CauseCodeType_"); - auto type_size = CauseCodeType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CauseCodeType::isKeyDefined(); - size_t keyLength = CauseCodeType::getKeyMaxCdrSerializedSize() > 16 ? - CauseCodeType::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - CauseCodeTypePubSubType::~CauseCodeTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - bool CauseCodeTypePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CauseCodeType* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - bool CauseCodeTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CauseCodeType* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - return true; - } - std::function CauseCodeTypePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CauseCodeTypePubSubType::createData() - { - return reinterpret_cast(new CauseCodeType()); - } - - void CauseCodeTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CauseCodeTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CauseCodeType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CauseCodeType::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CauseCodeType::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + + + +} //End of namespace CauseCodeType_Constants + + + +CauseCodeTypePubSubType::CauseCodeTypePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CauseCodeType_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CauseCodeType::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CauseCodeType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CauseCodeTypePubSubType::~CauseCodeTypePubSubType() +{ +} + +bool CauseCodeTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CauseCodeType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CauseCodeTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CauseCodeType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CauseCodeTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CauseCodeTypePubSubType::createData() +{ + return reinterpret_cast(new CauseCodeType()); +} + +void CauseCodeTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CauseCodeTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.h index d4850117008..8578de6fd24 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CauseCodeTypePubSubTypes.h @@ -16,29 +16,55 @@ * @file CauseCodeTypePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CauseCodeType.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CauseCodeType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace CauseCodeType_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace CauseCodeType_Constants { + + + + + + + + + + + + + + + + + + + + + + + @@ -68,72 +94,102 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type CauseCodeType defined by the user in the IDL file. - * @ingroup CAUSECODETYPE - */ - class CauseCodeTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef CauseCodeType type; - eProsima_user_DllExport CauseCodeTypePubSubType(); - eProsima_user_DllExport virtual ~CauseCodeTypePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +} // namespace CauseCodeType_Constants - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type CauseCodeType defined by the user in the IDL file. + * @ingroup CauseCodeType + */ +class CauseCodeTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CauseCodeType type; + + eProsima_user_DllExport CauseCodeTypePubSubType(); + + eProsima_user_DllExport ~CauseCodeTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CauseCodeType(); - return true; - } + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport void* createData() override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CAUSECODETYPE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.cxx index 4e4ec3a12c9..fa355fdfa30 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.cxx @@ -14,9 +14,9 @@ /*! * @file CenDsrcTollingZone.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,34 +27,31 @@ char dummy; #endif // _WIN32 #include "CenDsrcTollingZone.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::CenDsrcTollingZone::CenDsrcTollingZone() -{ - // m_protected_zone_latitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3a627c80 - // m_protected_zone_longitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@49aa766b +namespace etsi_its_cam_msgs { - // m_cen_dsrc_tolling_zone_id com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@963176 +namespace msg { - // m_cen_dsrc_tolling_zone_id_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@65004ff6 - m_cen_dsrc_tolling_zone_id_is_present = false; -} -etsi_its_cam_msgs::msg::CenDsrcTollingZone::~CenDsrcTollingZone() +CenDsrcTollingZone::CenDsrcTollingZone() { +} - - +CenDsrcTollingZone::~CenDsrcTollingZone() +{ } -etsi_its_cam_msgs::msg::CenDsrcTollingZone::CenDsrcTollingZone( +CenDsrcTollingZone::CenDsrcTollingZone( const CenDsrcTollingZone& x) { m_protected_zone_latitude = x.m_protected_zone_latitude; @@ -63,8 +60,8 @@ etsi_its_cam_msgs::msg::CenDsrcTollingZone::CenDsrcTollingZone( m_cen_dsrc_tolling_zone_id_is_present = x.m_cen_dsrc_tolling_zone_id_is_present; } -etsi_its_cam_msgs::msg::CenDsrcTollingZone::CenDsrcTollingZone( - CenDsrcTollingZone&& x) +CenDsrcTollingZone::CenDsrcTollingZone( + CenDsrcTollingZone&& x) noexcept { m_protected_zone_latitude = std::move(x.m_protected_zone_latitude); m_protected_zone_longitude = std::move(x.m_protected_zone_longitude); @@ -72,7 +69,7 @@ etsi_its_cam_msgs::msg::CenDsrcTollingZone::CenDsrcTollingZone( m_cen_dsrc_tolling_zone_id_is_present = x.m_cen_dsrc_tolling_zone_id_is_present; } -etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::CenDsrcTollingZone::operator =( +CenDsrcTollingZone& CenDsrcTollingZone::operator =( const CenDsrcTollingZone& x) { @@ -80,95 +77,40 @@ etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::CenDsrcTolli m_protected_zone_longitude = x.m_protected_zone_longitude; m_cen_dsrc_tolling_zone_id = x.m_cen_dsrc_tolling_zone_id; m_cen_dsrc_tolling_zone_id_is_present = x.m_cen_dsrc_tolling_zone_id_is_present; - return *this; } -etsi_its_cam_msgs::msg::CenDsrcTollingZone& etsi_its_cam_msgs::msg::CenDsrcTollingZone::operator =( - CenDsrcTollingZone&& x) +CenDsrcTollingZone& CenDsrcTollingZone::operator =( + CenDsrcTollingZone&& x) noexcept { m_protected_zone_latitude = std::move(x.m_protected_zone_latitude); m_protected_zone_longitude = std::move(x.m_protected_zone_longitude); m_cen_dsrc_tolling_zone_id = std::move(x.m_cen_dsrc_tolling_zone_id); m_cen_dsrc_tolling_zone_id_is_present = x.m_cen_dsrc_tolling_zone_id_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::operator ==( +bool CenDsrcTollingZone::operator ==( const CenDsrcTollingZone& x) const { - - return (m_protected_zone_latitude == x.m_protected_zone_latitude && m_protected_zone_longitude == x.m_protected_zone_longitude && m_cen_dsrc_tolling_zone_id == x.m_cen_dsrc_tolling_zone_id && m_cen_dsrc_tolling_zone_id_is_present == x.m_cen_dsrc_tolling_zone_id_is_present); + return (m_protected_zone_latitude == x.m_protected_zone_latitude && + m_protected_zone_longitude == x.m_protected_zone_longitude && + m_cen_dsrc_tolling_zone_id == x.m_cen_dsrc_tolling_zone_id && + m_cen_dsrc_tolling_zone_id_is_present == x.m_cen_dsrc_tolling_zone_id_is_present); } -bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::operator !=( +bool CenDsrcTollingZone::operator !=( const CenDsrcTollingZone& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CenDsrcTollingZone::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::Latitude::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Longitude::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CenDsrcTollingZone::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CenDsrcTollingZone& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::Latitude::getCdrSerializedSize(data.protected_zone_latitude(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Longitude::getCdrSerializedSize(data.protected_zone_longitude(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getCdrSerializedSize(data.cen_dsrc_tolling_zone_id(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_protected_zone_latitude; - scdr << m_protected_zone_longitude; - scdr << m_cen_dsrc_tolling_zone_id; - scdr << m_cen_dsrc_tolling_zone_id_is_present; - -} - -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_protected_zone_latitude; - dcdr >> m_protected_zone_longitude; - dcdr >> m_cen_dsrc_tolling_zone_id; - dcdr >> m_cen_dsrc_tolling_zone_id_is_present; -} - /*! * @brief This function copies the value in member protected_zone_latitude * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude( +void CenDsrcTollingZone::protected_zone_latitude( const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude) { m_protected_zone_latitude = _protected_zone_latitude; @@ -178,7 +120,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude( * @brief This function moves the value in member protected_zone_latitude * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude( +void CenDsrcTollingZone::protected_zone_latitude( etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude) { m_protected_zone_latitude = std::move(_protected_zone_latitude); @@ -188,7 +130,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude( * @brief This function returns a constant reference to member protected_zone_latitude * @return Constant reference to member protected_zone_latitude */ -const etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude() const +const etsi_its_cam_msgs::msg::Latitude& CenDsrcTollingZone::protected_zone_latitude() const { return m_protected_zone_latitude; } @@ -197,15 +139,17 @@ const etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::CenDsrcTollingZo * @brief This function returns a reference to member protected_zone_latitude * @return Reference to member protected_zone_latitude */ -etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_latitude() +etsi_its_cam_msgs::msg::Latitude& CenDsrcTollingZone::protected_zone_latitude() { return m_protected_zone_latitude; } + + /*! * @brief This function copies the value in member protected_zone_longitude * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude( +void CenDsrcTollingZone::protected_zone_longitude( const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude) { m_protected_zone_longitude = _protected_zone_longitude; @@ -215,7 +159,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude( * @brief This function moves the value in member protected_zone_longitude * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude( +void CenDsrcTollingZone::protected_zone_longitude( etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude) { m_protected_zone_longitude = std::move(_protected_zone_longitude); @@ -225,7 +169,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude( * @brief This function returns a constant reference to member protected_zone_longitude * @return Constant reference to member protected_zone_longitude */ -const etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude() const +const etsi_its_cam_msgs::msg::Longitude& CenDsrcTollingZone::protected_zone_longitude() const { return m_protected_zone_longitude; } @@ -234,15 +178,17 @@ const etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::CenDsrcTollingZ * @brief This function returns a reference to member protected_zone_longitude * @return Reference to member protected_zone_longitude */ -etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::CenDsrcTollingZone::protected_zone_longitude() +etsi_its_cam_msgs::msg::Longitude& CenDsrcTollingZone::protected_zone_longitude() { return m_protected_zone_longitude; } + + /*! * @brief This function copies the value in member cen_dsrc_tolling_zone_id * @param _cen_dsrc_tolling_zone_id New value to be copied in member cen_dsrc_tolling_zone_id */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id( +void CenDsrcTollingZone::cen_dsrc_tolling_zone_id( const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& _cen_dsrc_tolling_zone_id) { m_cen_dsrc_tolling_zone_id = _cen_dsrc_tolling_zone_id; @@ -252,7 +198,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id( * @brief This function moves the value in member cen_dsrc_tolling_zone_id * @param _cen_dsrc_tolling_zone_id New value to be moved in member cen_dsrc_tolling_zone_id */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id( +void CenDsrcTollingZone::cen_dsrc_tolling_zone_id( etsi_its_cam_msgs::msg::CenDsrcTollingZoneID&& _cen_dsrc_tolling_zone_id) { m_cen_dsrc_tolling_zone_id = std::move(_cen_dsrc_tolling_zone_id); @@ -262,7 +208,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id( * @brief This function returns a constant reference to member cen_dsrc_tolling_zone_id * @return Constant reference to member cen_dsrc_tolling_zone_id */ -const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id() const +const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& CenDsrcTollingZone::cen_dsrc_tolling_zone_id() const { return m_cen_dsrc_tolling_zone_id; } @@ -271,15 +217,17 @@ const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenD * @brief This function returns a reference to member cen_dsrc_tolling_zone_id * @return Reference to member cen_dsrc_tolling_zone_id */ -etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id() +etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& CenDsrcTollingZone::cen_dsrc_tolling_zone_id() { return m_cen_dsrc_tolling_zone_id; } + + /*! * @brief This function sets a value in member cen_dsrc_tolling_zone_id_is_present * @param _cen_dsrc_tolling_zone_id_is_present New value for member cen_dsrc_tolling_zone_id_is_present */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present( +void CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present( bool _cen_dsrc_tolling_zone_id_is_present) { m_cen_dsrc_tolling_zone_id_is_present = _cen_dsrc_tolling_zone_id_is_present; @@ -289,7 +237,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_pre * @brief This function returns the value of member cen_dsrc_tolling_zone_id_is_present * @return Value of member cen_dsrc_tolling_zone_id_is_present */ -bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present() const +bool CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present() const { return m_cen_dsrc_tolling_zone_id_is_present; } @@ -298,32 +246,18 @@ bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_pre * @brief This function returns a reference to member cen_dsrc_tolling_zone_id_is_present * @return Reference to member cen_dsrc_tolling_zone_id_is_present */ -bool& etsi_its_cam_msgs::msg::CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present() +bool& CenDsrcTollingZone::cen_dsrc_tolling_zone_id_is_present() { return m_cen_dsrc_tolling_zone_id_is_present; } -size_t etsi_its_cam_msgs::msg::CenDsrcTollingZone::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::CenDsrcTollingZone::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::CenDsrcTollingZone::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CenDsrcTollingZoneCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.h index 8ebadc85c1a..8522b109bab 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZone.h @@ -16,22 +16,27 @@ * @file CenDsrcTollingZone.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "CenDsrcTollingZoneID.h" #include "Latitude.h" #include "Longitude.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -45,247 +50,207 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CenDsrcTollingZone_SOURCE) -#define CenDsrcTollingZone_DllAPI __declspec( dllexport ) +#if defined(CENDSRCTOLLINGZONE_SOURCE) +#define CENDSRCTOLLINGZONE_DllAPI __declspec( dllexport ) #else -#define CenDsrcTollingZone_DllAPI __declspec( dllimport ) -#endif // CenDsrcTollingZone_SOURCE +#define CENDSRCTOLLINGZONE_DllAPI __declspec( dllimport ) +#endif // CENDSRCTOLLINGZONE_SOURCE #else -#define CenDsrcTollingZone_DllAPI +#define CENDSRCTOLLINGZONE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CenDsrcTollingZone_DllAPI +#define CENDSRCTOLLINGZONE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure CenDsrcTollingZone defined by the user in the IDL file. - * @ingroup CENDSRCTOLLINGZONE - */ - class CenDsrcTollingZone - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CenDsrcTollingZone(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CenDsrcTollingZone(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. - */ - eProsima_user_DllExport CenDsrcTollingZone( - const CenDsrcTollingZone& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. - */ - eProsima_user_DllExport CenDsrcTollingZone( - CenDsrcTollingZone&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. - */ - eProsima_user_DllExport CenDsrcTollingZone& operator =( - const CenDsrcTollingZone& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. - */ - eProsima_user_DllExport CenDsrcTollingZone& operator =( - CenDsrcTollingZone&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZone object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CenDsrcTollingZone& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZone object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CenDsrcTollingZone& x) const; - - /*! - * @brief This function copies the value in member protected_zone_latitude - * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude - */ - eProsima_user_DllExport void protected_zone_latitude( - const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude); - - /*! - * @brief This function moves the value in member protected_zone_latitude - * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude - */ - eProsima_user_DllExport void protected_zone_latitude( - etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude); - - /*! - * @brief This function returns a constant reference to member protected_zone_latitude - * @return Constant reference to member protected_zone_latitude - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude() const; - - /*! - * @brief This function returns a reference to member protected_zone_latitude - * @return Reference to member protected_zone_latitude - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude(); - /*! - * @brief This function copies the value in member protected_zone_longitude - * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude - */ - eProsima_user_DllExport void protected_zone_longitude( - const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude); - - /*! - * @brief This function moves the value in member protected_zone_longitude - * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude - */ - eProsima_user_DllExport void protected_zone_longitude( - etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude); - - /*! - * @brief This function returns a constant reference to member protected_zone_longitude - * @return Constant reference to member protected_zone_longitude - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude() const; - - /*! - * @brief This function returns a reference to member protected_zone_longitude - * @return Reference to member protected_zone_longitude - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude(); - /*! - * @brief This function copies the value in member cen_dsrc_tolling_zone_id - * @param _cen_dsrc_tolling_zone_id New value to be copied in member cen_dsrc_tolling_zone_id - */ - eProsima_user_DllExport void cen_dsrc_tolling_zone_id( - const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& _cen_dsrc_tolling_zone_id); - - /*! - * @brief This function moves the value in member cen_dsrc_tolling_zone_id - * @param _cen_dsrc_tolling_zone_id New value to be moved in member cen_dsrc_tolling_zone_id - */ - eProsima_user_DllExport void cen_dsrc_tolling_zone_id( - etsi_its_cam_msgs::msg::CenDsrcTollingZoneID&& _cen_dsrc_tolling_zone_id); - - /*! - * @brief This function returns a constant reference to member cen_dsrc_tolling_zone_id - * @return Constant reference to member cen_dsrc_tolling_zone_id - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& cen_dsrc_tolling_zone_id() const; - - /*! - * @brief This function returns a reference to member cen_dsrc_tolling_zone_id - * @return Reference to member cen_dsrc_tolling_zone_id - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& cen_dsrc_tolling_zone_id(); - /*! - * @brief This function sets a value in member cen_dsrc_tolling_zone_id_is_present - * @param _cen_dsrc_tolling_zone_id_is_present New value for member cen_dsrc_tolling_zone_id_is_present - */ - eProsima_user_DllExport void cen_dsrc_tolling_zone_id_is_present( - bool _cen_dsrc_tolling_zone_id_is_present); - - /*! - * @brief This function returns the value of member cen_dsrc_tolling_zone_id_is_present - * @return Value of member cen_dsrc_tolling_zone_id_is_present - */ - eProsima_user_DllExport bool cen_dsrc_tolling_zone_id_is_present() const; - - /*! - * @brief This function returns a reference to member cen_dsrc_tolling_zone_id_is_present - * @return Reference to member cen_dsrc_tolling_zone_id_is_present - */ - eProsima_user_DllExport bool& cen_dsrc_tolling_zone_id_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CenDsrcTollingZone& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::Latitude m_protected_zone_latitude; - etsi_its_cam_msgs::msg::Longitude m_protected_zone_longitude; - etsi_its_cam_msgs::msg::CenDsrcTollingZoneID m_cen_dsrc_tolling_zone_id; - bool m_cen_dsrc_tolling_zone_id_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CenDsrcTollingZone defined by the user in the IDL file. + * @ingroup CenDsrcTollingZone + */ +class CenDsrcTollingZone +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CenDsrcTollingZone(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CenDsrcTollingZone(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZone( + const CenDsrcTollingZone& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZone( + CenDsrcTollingZone&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZone& operator =( + const CenDsrcTollingZone& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZone that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZone& operator =( + CenDsrcTollingZone&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZone object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CenDsrcTollingZone& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZone object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CenDsrcTollingZone& x) const; + + /*! + * @brief This function copies the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude + */ + eProsima_user_DllExport void protected_zone_latitude( + const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude); + + /*! + * @brief This function moves the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude + */ + eProsima_user_DllExport void protected_zone_latitude( + etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude); + + /*! + * @brief This function returns a constant reference to member protected_zone_latitude + * @return Constant reference to member protected_zone_latitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude() const; + + /*! + * @brief This function returns a reference to member protected_zone_latitude + * @return Reference to member protected_zone_latitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude(); + + + /*! + * @brief This function copies the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude + */ + eProsima_user_DllExport void protected_zone_longitude( + const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude); + + /*! + * @brief This function moves the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude + */ + eProsima_user_DllExport void protected_zone_longitude( + etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude); + + /*! + * @brief This function returns a constant reference to member protected_zone_longitude + * @return Constant reference to member protected_zone_longitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude() const; + + /*! + * @brief This function returns a reference to member protected_zone_longitude + * @return Reference to member protected_zone_longitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude(); + + + /*! + * @brief This function copies the value in member cen_dsrc_tolling_zone_id + * @param _cen_dsrc_tolling_zone_id New value to be copied in member cen_dsrc_tolling_zone_id + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone_id( + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& _cen_dsrc_tolling_zone_id); + + /*! + * @brief This function moves the value in member cen_dsrc_tolling_zone_id + * @param _cen_dsrc_tolling_zone_id New value to be moved in member cen_dsrc_tolling_zone_id + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone_id( + etsi_its_cam_msgs::msg::CenDsrcTollingZoneID&& _cen_dsrc_tolling_zone_id); + + /*! + * @brief This function returns a constant reference to member cen_dsrc_tolling_zone_id + * @return Constant reference to member cen_dsrc_tolling_zone_id + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& cen_dsrc_tolling_zone_id() const; + + /*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_id + * @return Reference to member cen_dsrc_tolling_zone_id + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& cen_dsrc_tolling_zone_id(); + + + /*! + * @brief This function sets a value in member cen_dsrc_tolling_zone_id_is_present + * @param _cen_dsrc_tolling_zone_id_is_present New value for member cen_dsrc_tolling_zone_id_is_present + */ + eProsima_user_DllExport void cen_dsrc_tolling_zone_id_is_present( + bool _cen_dsrc_tolling_zone_id_is_present); + + /*! + * @brief This function returns the value of member cen_dsrc_tolling_zone_id_is_present + * @return Value of member cen_dsrc_tolling_zone_id_is_present + */ + eProsima_user_DllExport bool cen_dsrc_tolling_zone_id_is_present() const; + + /*! + * @brief This function returns a reference to member cen_dsrc_tolling_zone_id_is_present + * @return Reference to member cen_dsrc_tolling_zone_id_is_present + */ + eProsima_user_DllExport bool& cen_dsrc_tolling_zone_id_is_present(); + +private: + + etsi_its_cam_msgs::msg::Latitude m_protected_zone_latitude; + etsi_its_cam_msgs::msg::Longitude m_protected_zone_longitude; + etsi_its_cam_msgs::msg::CenDsrcTollingZoneID m_cen_dsrc_tolling_zone_id; + bool m_cen_dsrc_tolling_zone_id_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneCdrAux.hpp new file mode 100644 index 00000000000..ea8d870734c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZoneCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONECDRAUX_HPP_ + +#include "CenDsrcTollingZone.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CenDsrcTollingZone_max_cdr_typesize {33UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CenDsrcTollingZone_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneCdrAux.ipp new file mode 100644 index 00000000000..5fe39652033 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneCdrAux.ipp @@ -0,0 +1,154 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZoneCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONECDRAUX_IPP_ + +#include "CenDsrcTollingZoneCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.protected_zone_latitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.protected_zone_longitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.cen_dsrc_tolling_zone_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.cen_dsrc_tolling_zone_id_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.protected_zone_latitude() + << eprosima::fastcdr::MemberId(1) << data.protected_zone_longitude() + << eprosima::fastcdr::MemberId(2) << data.cen_dsrc_tolling_zone_id() + << eprosima::fastcdr::MemberId(3) << data.cen_dsrc_tolling_zone_id_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CenDsrcTollingZone& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.protected_zone_latitude(); + break; + + case 1: + dcdr >> data.protected_zone_longitude(); + break; + + case 2: + dcdr >> data.cen_dsrc_tolling_zone_id(); + break; + + case 3: + dcdr >> data.cen_dsrc_tolling_zone_id_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CenDsrcTollingZone& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.cxx index ccaaca96dbd..9ab5a24b0af 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.cxx @@ -14,9 +14,9 @@ /*! * @file CenDsrcTollingZoneID.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,111 +27,75 @@ char dummy; #endif // _WIN32 #include "CenDsrcTollingZoneID.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::CenDsrcTollingZoneID() -{ - // m_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@415156bf + +namespace etsi_its_cam_msgs { + +namespace msg { + +CenDsrcTollingZoneID::CenDsrcTollingZoneID() +{ } -etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::~CenDsrcTollingZoneID() +CenDsrcTollingZoneID::~CenDsrcTollingZoneID() { } -etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::CenDsrcTollingZoneID( +CenDsrcTollingZoneID::CenDsrcTollingZoneID( const CenDsrcTollingZoneID& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::CenDsrcTollingZoneID( - CenDsrcTollingZoneID&& x) +CenDsrcTollingZoneID::CenDsrcTollingZoneID( + CenDsrcTollingZoneID&& x) noexcept { m_value = std::move(x.m_value); } -etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::operator =( +CenDsrcTollingZoneID& CenDsrcTollingZoneID::operator =( const CenDsrcTollingZoneID& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::operator =( - CenDsrcTollingZoneID&& x) +CenDsrcTollingZoneID& CenDsrcTollingZoneID::operator =( + CenDsrcTollingZoneID&& x) noexcept { m_value = std::move(x.m_value); - return *this; } -bool etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::operator ==( +bool CenDsrcTollingZoneID::operator ==( const CenDsrcTollingZoneID& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::operator !=( +bool CenDsrcTollingZoneID::operator !=( const CenDsrcTollingZoneID& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneID::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneID::getCdrSerializedSize(data.value(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value( +void CenDsrcTollingZoneID::value( const etsi_its_cam_msgs::msg::ProtectedZoneID& _value) { m_value = _value; @@ -141,7 +105,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value( +void CenDsrcTollingZoneID::value( etsi_its_cam_msgs::msg::ProtectedZoneID&& _value) { m_value = std::move(_value); @@ -151,7 +115,7 @@ void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value() const +const etsi_its_cam_msgs::msg::ProtectedZoneID& CenDsrcTollingZoneID::value() const { return m_value; } @@ -160,31 +124,18 @@ const etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::CenDsrcTo * @brief This function returns a reference to member value * @return Reference to member value */ -etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::value() +etsi_its_cam_msgs::msg::ProtectedZoneID& CenDsrcTollingZoneID::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::CenDsrcTollingZoneID::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CenDsrcTollingZoneIDCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.h index e12abfd73e2..6d5a4628fcd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneID.h @@ -16,20 +16,25 @@ * @file CenDsrcTollingZoneID.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_H_ -#include "ProtectedZoneID.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "ProtectedZoneID.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CenDsrcTollingZoneID_SOURCE) -#define CenDsrcTollingZoneID_DllAPI __declspec( dllexport ) +#if defined(CENDSRCTOLLINGZONEID_SOURCE) +#define CENDSRCTOLLINGZONEID_DllAPI __declspec( dllexport ) #else -#define CenDsrcTollingZoneID_DllAPI __declspec( dllimport ) -#endif // CenDsrcTollingZoneID_SOURCE +#define CENDSRCTOLLINGZONEID_DllAPI __declspec( dllimport ) +#endif // CENDSRCTOLLINGZONEID_SOURCE #else -#define CenDsrcTollingZoneID_DllAPI +#define CENDSRCTOLLINGZONEID_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CenDsrcTollingZoneID_DllAPI +#define CENDSRCTOLLINGZONEID_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure CenDsrcTollingZoneID defined by the user in the IDL file. - * @ingroup CENDSRCTOLLINGZONEID - */ - class CenDsrcTollingZoneID - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CenDsrcTollingZoneID(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CenDsrcTollingZoneID(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. - */ - eProsima_user_DllExport CenDsrcTollingZoneID( - const CenDsrcTollingZoneID& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. - */ - eProsima_user_DllExport CenDsrcTollingZoneID( - CenDsrcTollingZoneID&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. - */ - eProsima_user_DllExport CenDsrcTollingZoneID& operator =( - const CenDsrcTollingZoneID& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. - */ - eProsima_user_DllExport CenDsrcTollingZoneID& operator =( - CenDsrcTollingZoneID&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZoneID object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CenDsrcTollingZoneID& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZoneID object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CenDsrcTollingZoneID& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const etsi_its_cam_msgs::msg::ProtectedZoneID& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - etsi_its_cam_msgs::msg::ProtectedZoneID&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneID& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneID& value(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::ProtectedZoneID m_value; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CenDsrcTollingZoneID defined by the user in the IDL file. + * @ingroup CenDsrcTollingZoneID + */ +class CenDsrcTollingZoneID +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CenDsrcTollingZoneID(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CenDsrcTollingZoneID(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZoneID( + const CenDsrcTollingZoneID& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZoneID( + CenDsrcTollingZoneID&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZoneID& operator =( + const CenDsrcTollingZoneID& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CenDsrcTollingZoneID that will be copied. + */ + eProsima_user_DllExport CenDsrcTollingZoneID& operator =( + CenDsrcTollingZoneID&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZoneID object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CenDsrcTollingZoneID& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CenDsrcTollingZoneID object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CenDsrcTollingZoneID& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const etsi_its_cam_msgs::msg::ProtectedZoneID& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + etsi_its_cam_msgs::msg::ProtectedZoneID&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneID& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneID& value(); + +private: + + etsi_its_cam_msgs::msg::ProtectedZoneID m_value; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDCdrAux.hpp new file mode 100644 index 00000000000..30c70d33804 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZoneIDCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEIDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEIDCDRAUX_HPP_ + +#include "CenDsrcTollingZoneID.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CenDsrcTollingZoneID_max_cdr_typesize {12UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CenDsrcTollingZoneID_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEIDCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDCdrAux.ipp new file mode 100644 index 00000000000..bde7caca3d1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDCdrAux.ipp @@ -0,0 +1,130 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CenDsrcTollingZoneIDCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEIDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEIDCDRAUX_IPP_ + +#include "CenDsrcTollingZoneIDCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CenDsrcTollingZoneID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEIDCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.cxx index e8ee768751f..f3b3413f3f4 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CenDsrcTollingZoneIDPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CenDsrcTollingZoneIDPubSubTypes.h" +#include "CenDsrcTollingZoneIDCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - CenDsrcTollingZoneIDPubSubType::CenDsrcTollingZoneIDPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CenDsrcTollingZoneID_"); - auto type_size = CenDsrcTollingZoneID::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CenDsrcTollingZoneID::isKeyDefined(); - size_t keyLength = CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize() > 16 ? - CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CenDsrcTollingZoneIDPubSubType::~CenDsrcTollingZoneIDPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CenDsrcTollingZoneIDPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CenDsrcTollingZoneID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CenDsrcTollingZoneIDPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CenDsrcTollingZoneID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CenDsrcTollingZoneIDPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CenDsrcTollingZoneIDPubSubType::createData() - { - return reinterpret_cast(new CenDsrcTollingZoneID()); - } - - void CenDsrcTollingZoneIDPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CenDsrcTollingZoneIDPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CenDsrcTollingZoneID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CenDsrcTollingZoneID::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CenDsrcTollingZoneIDPubSubType::CenDsrcTollingZoneIDPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CenDsrcTollingZoneID_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CenDsrcTollingZoneID::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CenDsrcTollingZoneID_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CenDsrcTollingZoneIDPubSubType::~CenDsrcTollingZoneIDPubSubType() +{ +} + +bool CenDsrcTollingZoneIDPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CenDsrcTollingZoneID* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CenDsrcTollingZoneIDPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CenDsrcTollingZoneID* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CenDsrcTollingZoneIDPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CenDsrcTollingZoneIDPubSubType::createData() +{ + return reinterpret_cast(new CenDsrcTollingZoneID()); +} + +void CenDsrcTollingZoneIDPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CenDsrcTollingZoneIDPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.h index 0344ef1440d..af2032422ad 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZoneIDPubSubTypes.h @@ -16,92 +16,121 @@ * @file CenDsrcTollingZoneIDPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CenDsrcTollingZoneID.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "ProtectedZoneIDPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CenDsrcTollingZoneID is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CenDsrcTollingZoneID defined by the user in the IDL file. + * @ingroup CenDsrcTollingZoneID + */ +class CenDsrcTollingZoneIDPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CenDsrcTollingZoneID defined by the user in the IDL file. - * @ingroup CENDSRCTOLLINGZONEID - */ - class CenDsrcTollingZoneIDPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CenDsrcTollingZoneID type; + typedef CenDsrcTollingZoneID type; - eProsima_user_DllExport CenDsrcTollingZoneIDPubSubType(); + eProsima_user_DllExport CenDsrcTollingZoneIDPubSubType(); - eProsima_user_DllExport virtual ~CenDsrcTollingZoneIDPubSubType(); + eProsima_user_DllExport ~CenDsrcTollingZoneIDPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CenDsrcTollingZoneID(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONEID_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.cxx index bd71435e5d0..bb47de18d6e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CenDsrcTollingZonePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CenDsrcTollingZonePubSubTypes.h" +#include "CenDsrcTollingZoneCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - CenDsrcTollingZonePubSubType::CenDsrcTollingZonePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CenDsrcTollingZone_"); - auto type_size = CenDsrcTollingZone::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CenDsrcTollingZone::isKeyDefined(); - size_t keyLength = CenDsrcTollingZone::getKeyMaxCdrSerializedSize() > 16 ? - CenDsrcTollingZone::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CenDsrcTollingZonePubSubType::~CenDsrcTollingZonePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CenDsrcTollingZonePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CenDsrcTollingZone* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CenDsrcTollingZonePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CenDsrcTollingZone* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CenDsrcTollingZonePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CenDsrcTollingZonePubSubType::createData() - { - return reinterpret_cast(new CenDsrcTollingZone()); - } - - void CenDsrcTollingZonePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CenDsrcTollingZonePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CenDsrcTollingZone* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CenDsrcTollingZone::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CenDsrcTollingZone::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CenDsrcTollingZonePubSubType::CenDsrcTollingZonePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CenDsrcTollingZone_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CenDsrcTollingZone::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CenDsrcTollingZone_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CenDsrcTollingZonePubSubType::~CenDsrcTollingZonePubSubType() +{ +} + +bool CenDsrcTollingZonePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CenDsrcTollingZone* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CenDsrcTollingZonePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CenDsrcTollingZone* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CenDsrcTollingZonePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CenDsrcTollingZonePubSubType::createData() +{ + return reinterpret_cast(new CenDsrcTollingZone()); +} + +void CenDsrcTollingZonePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CenDsrcTollingZonePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.h index 30e07101f51..3a4d49e2b3f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CenDsrcTollingZonePubSubTypes.h @@ -16,92 +16,123 @@ * @file CenDsrcTollingZonePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CenDsrcTollingZone.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CenDsrcTollingZoneIDPubSubTypes.h" +#include "LatitudePubSubTypes.h" +#include "LongitudePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CenDsrcTollingZone is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CenDsrcTollingZone defined by the user in the IDL file. + * @ingroup CenDsrcTollingZone + */ +class CenDsrcTollingZonePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CenDsrcTollingZone defined by the user in the IDL file. - * @ingroup CENDSRCTOLLINGZONE - */ - class CenDsrcTollingZonePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CenDsrcTollingZone type; + typedef CenDsrcTollingZone type; - eProsima_user_DllExport CenDsrcTollingZonePubSubType(); + eProsima_user_DllExport CenDsrcTollingZonePubSubType(); - eProsima_user_DllExport virtual ~CenDsrcTollingZonePubSubType(); + eProsima_user_DllExport ~CenDsrcTollingZonePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CenDsrcTollingZone(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CENDSRCTOLLINGZONE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.cxx index 25702357b44..d6d8bcd174d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.cxx @@ -14,9 +14,9 @@ /*! * @file ClosedLanes.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,40 +27,31 @@ char dummy; #endif // _WIN32 #include "ClosedLanes.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::ClosedLanes::ClosedLanes() -{ - // m_innerhard_shoulder_status com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@841e575 - // m_innerhard_shoulder_status_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27a5328c - m_innerhard_shoulder_status_is_present = false; - // m_outerhard_shoulder_status com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@841e575 +namespace etsi_its_cam_msgs { - // m_outerhard_shoulder_status_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e5f4170 - m_outerhard_shoulder_status_is_present = false; - // m_driving_lane_status com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6c345c5f +namespace msg { - // m_driving_lane_status_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6b5966e1 - m_driving_lane_status_is_present = false; -} -etsi_its_cam_msgs::msg::ClosedLanes::~ClosedLanes() +ClosedLanes::ClosedLanes() { +} - - - - +ClosedLanes::~ClosedLanes() +{ } -etsi_its_cam_msgs::msg::ClosedLanes::ClosedLanes( +ClosedLanes::ClosedLanes( const ClosedLanes& x) { m_innerhard_shoulder_status = x.m_innerhard_shoulder_status; @@ -71,8 +62,8 @@ etsi_its_cam_msgs::msg::ClosedLanes::ClosedLanes( m_driving_lane_status_is_present = x.m_driving_lane_status_is_present; } -etsi_its_cam_msgs::msg::ClosedLanes::ClosedLanes( - ClosedLanes&& x) +ClosedLanes::ClosedLanes( + ClosedLanes&& x) noexcept { m_innerhard_shoulder_status = std::move(x.m_innerhard_shoulder_status); m_innerhard_shoulder_status_is_present = x.m_innerhard_shoulder_status_is_present; @@ -82,7 +73,7 @@ etsi_its_cam_msgs::msg::ClosedLanes::ClosedLanes( m_driving_lane_status_is_present = x.m_driving_lane_status_is_present; } -etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::ClosedLanes::operator =( +ClosedLanes& ClosedLanes::operator =( const ClosedLanes& x) { @@ -92,12 +83,11 @@ etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::ClosedLanes::operat m_outerhard_shoulder_status_is_present = x.m_outerhard_shoulder_status_is_present; m_driving_lane_status = x.m_driving_lane_status; m_driving_lane_status_is_present = x.m_driving_lane_status_is_present; - return *this; } -etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::ClosedLanes::operator =( - ClosedLanes&& x) +ClosedLanes& ClosedLanes::operator =( + ClosedLanes&& x) noexcept { m_innerhard_shoulder_status = std::move(x.m_innerhard_shoulder_status); @@ -106,99 +96,31 @@ etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::ClosedLanes::operat m_outerhard_shoulder_status_is_present = x.m_outerhard_shoulder_status_is_present; m_driving_lane_status = std::move(x.m_driving_lane_status); m_driving_lane_status_is_present = x.m_driving_lane_status_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::ClosedLanes::operator ==( +bool ClosedLanes::operator ==( const ClosedLanes& x) const { - - return (m_innerhard_shoulder_status == x.m_innerhard_shoulder_status && m_innerhard_shoulder_status_is_present == x.m_innerhard_shoulder_status_is_present && m_outerhard_shoulder_status == x.m_outerhard_shoulder_status && m_outerhard_shoulder_status_is_present == x.m_outerhard_shoulder_status_is_present && m_driving_lane_status == x.m_driving_lane_status && m_driving_lane_status_is_present == x.m_driving_lane_status_is_present); + return (m_innerhard_shoulder_status == x.m_innerhard_shoulder_status && + m_innerhard_shoulder_status_is_present == x.m_innerhard_shoulder_status_is_present && + m_outerhard_shoulder_status == x.m_outerhard_shoulder_status && + m_outerhard_shoulder_status_is_present == x.m_outerhard_shoulder_status_is_present && + m_driving_lane_status == x.m_driving_lane_status && + m_driving_lane_status_is_present == x.m_driving_lane_status_is_present); } -bool etsi_its_cam_msgs::msg::ClosedLanes::operator !=( +bool ClosedLanes::operator !=( const ClosedLanes& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ClosedLanes::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::HardShoulderStatus::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::HardShoulderStatus::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::DrivingLaneStatus::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ClosedLanes::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ClosedLanes& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::HardShoulderStatus::getCdrSerializedSize(data.innerhard_shoulder_status(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::HardShoulderStatus::getCdrSerializedSize(data.outerhard_shoulder_status(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::DrivingLaneStatus::getCdrSerializedSize(data.driving_lane_status(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ClosedLanes::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_innerhard_shoulder_status; - scdr << m_innerhard_shoulder_status_is_present; - scdr << m_outerhard_shoulder_status; - scdr << m_outerhard_shoulder_status_is_present; - scdr << m_driving_lane_status; - scdr << m_driving_lane_status_is_present; - -} - -void etsi_its_cam_msgs::msg::ClosedLanes::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_innerhard_shoulder_status; - dcdr >> m_innerhard_shoulder_status_is_present; - dcdr >> m_outerhard_shoulder_status; - dcdr >> m_outerhard_shoulder_status_is_present; - dcdr >> m_driving_lane_status; - dcdr >> m_driving_lane_status_is_present; -} - /*! * @brief This function copies the value in member innerhard_shoulder_status * @param _innerhard_shoulder_status New value to be copied in member innerhard_shoulder_status */ -void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status( +void ClosedLanes::innerhard_shoulder_status( const etsi_its_cam_msgs::msg::HardShoulderStatus& _innerhard_shoulder_status) { m_innerhard_shoulder_status = _innerhard_shoulder_status; @@ -208,7 +130,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status( * @brief This function moves the value in member innerhard_shoulder_status * @param _innerhard_shoulder_status New value to be moved in member innerhard_shoulder_status */ -void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status( +void ClosedLanes::innerhard_shoulder_status( etsi_its_cam_msgs::msg::HardShoulderStatus&& _innerhard_shoulder_status) { m_innerhard_shoulder_status = std::move(_innerhard_shoulder_status); @@ -218,7 +140,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status( * @brief This function returns a constant reference to member innerhard_shoulder_status * @return Constant reference to member innerhard_shoulder_status */ -const etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status() const +const etsi_its_cam_msgs::msg::HardShoulderStatus& ClosedLanes::innerhard_shoulder_status() const { return m_innerhard_shoulder_status; } @@ -227,15 +149,17 @@ const etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::Closed * @brief This function returns a reference to member innerhard_shoulder_status * @return Reference to member innerhard_shoulder_status */ -etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status() +etsi_its_cam_msgs::msg::HardShoulderStatus& ClosedLanes::innerhard_shoulder_status() { return m_innerhard_shoulder_status; } + + /*! * @brief This function sets a value in member innerhard_shoulder_status_is_present * @param _innerhard_shoulder_status_is_present New value for member innerhard_shoulder_status_is_present */ -void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status_is_present( +void ClosedLanes::innerhard_shoulder_status_is_present( bool _innerhard_shoulder_status_is_present) { m_innerhard_shoulder_status_is_present = _innerhard_shoulder_status_is_present; @@ -245,7 +169,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status_is_present( * @brief This function returns the value of member innerhard_shoulder_status_is_present * @return Value of member innerhard_shoulder_status_is_present */ -bool etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status_is_present() const +bool ClosedLanes::innerhard_shoulder_status_is_present() const { return m_innerhard_shoulder_status_is_present; } @@ -254,16 +178,17 @@ bool etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status_is_present() * @brief This function returns a reference to member innerhard_shoulder_status_is_present * @return Reference to member innerhard_shoulder_status_is_present */ -bool& etsi_its_cam_msgs::msg::ClosedLanes::innerhard_shoulder_status_is_present() +bool& ClosedLanes::innerhard_shoulder_status_is_present() { return m_innerhard_shoulder_status_is_present; } + /*! * @brief This function copies the value in member outerhard_shoulder_status * @param _outerhard_shoulder_status New value to be copied in member outerhard_shoulder_status */ -void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status( +void ClosedLanes::outerhard_shoulder_status( const etsi_its_cam_msgs::msg::HardShoulderStatus& _outerhard_shoulder_status) { m_outerhard_shoulder_status = _outerhard_shoulder_status; @@ -273,7 +198,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status( * @brief This function moves the value in member outerhard_shoulder_status * @param _outerhard_shoulder_status New value to be moved in member outerhard_shoulder_status */ -void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status( +void ClosedLanes::outerhard_shoulder_status( etsi_its_cam_msgs::msg::HardShoulderStatus&& _outerhard_shoulder_status) { m_outerhard_shoulder_status = std::move(_outerhard_shoulder_status); @@ -283,7 +208,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status( * @brief This function returns a constant reference to member outerhard_shoulder_status * @return Constant reference to member outerhard_shoulder_status */ -const etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status() const +const etsi_its_cam_msgs::msg::HardShoulderStatus& ClosedLanes::outerhard_shoulder_status() const { return m_outerhard_shoulder_status; } @@ -292,15 +217,17 @@ const etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::Closed * @brief This function returns a reference to member outerhard_shoulder_status * @return Reference to member outerhard_shoulder_status */ -etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status() +etsi_its_cam_msgs::msg::HardShoulderStatus& ClosedLanes::outerhard_shoulder_status() { return m_outerhard_shoulder_status; } + + /*! * @brief This function sets a value in member outerhard_shoulder_status_is_present * @param _outerhard_shoulder_status_is_present New value for member outerhard_shoulder_status_is_present */ -void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status_is_present( +void ClosedLanes::outerhard_shoulder_status_is_present( bool _outerhard_shoulder_status_is_present) { m_outerhard_shoulder_status_is_present = _outerhard_shoulder_status_is_present; @@ -310,7 +237,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status_is_present( * @brief This function returns the value of member outerhard_shoulder_status_is_present * @return Value of member outerhard_shoulder_status_is_present */ -bool etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status_is_present() const +bool ClosedLanes::outerhard_shoulder_status_is_present() const { return m_outerhard_shoulder_status_is_present; } @@ -319,16 +246,17 @@ bool etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status_is_present() * @brief This function returns a reference to member outerhard_shoulder_status_is_present * @return Reference to member outerhard_shoulder_status_is_present */ -bool& etsi_its_cam_msgs::msg::ClosedLanes::outerhard_shoulder_status_is_present() +bool& ClosedLanes::outerhard_shoulder_status_is_present() { return m_outerhard_shoulder_status_is_present; } + /*! * @brief This function copies the value in member driving_lane_status * @param _driving_lane_status New value to be copied in member driving_lane_status */ -void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status( +void ClosedLanes::driving_lane_status( const etsi_its_cam_msgs::msg::DrivingLaneStatus& _driving_lane_status) { m_driving_lane_status = _driving_lane_status; @@ -338,7 +266,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status( * @brief This function moves the value in member driving_lane_status * @param _driving_lane_status New value to be moved in member driving_lane_status */ -void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status( +void ClosedLanes::driving_lane_status( etsi_its_cam_msgs::msg::DrivingLaneStatus&& _driving_lane_status) { m_driving_lane_status = std::move(_driving_lane_status); @@ -348,7 +276,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status( * @brief This function returns a constant reference to member driving_lane_status * @return Constant reference to member driving_lane_status */ -const etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status() const +const etsi_its_cam_msgs::msg::DrivingLaneStatus& ClosedLanes::driving_lane_status() const { return m_driving_lane_status; } @@ -357,15 +285,17 @@ const etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::ClosedL * @brief This function returns a reference to member driving_lane_status * @return Reference to member driving_lane_status */ -etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status() +etsi_its_cam_msgs::msg::DrivingLaneStatus& ClosedLanes::driving_lane_status() { return m_driving_lane_status; } + + /*! * @brief This function sets a value in member driving_lane_status_is_present * @param _driving_lane_status_is_present New value for member driving_lane_status_is_present */ -void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status_is_present( +void ClosedLanes::driving_lane_status_is_present( bool _driving_lane_status_is_present) { m_driving_lane_status_is_present = _driving_lane_status_is_present; @@ -375,7 +305,7 @@ void etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status_is_present( * @brief This function returns the value of member driving_lane_status_is_present * @return Value of member driving_lane_status_is_present */ -bool etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status_is_present() const +bool ClosedLanes::driving_lane_status_is_present() const { return m_driving_lane_status_is_present; } @@ -384,32 +314,18 @@ bool etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status_is_present() const * @brief This function returns a reference to member driving_lane_status_is_present * @return Reference to member driving_lane_status_is_present */ -bool& etsi_its_cam_msgs::msg::ClosedLanes::driving_lane_status_is_present() +bool& ClosedLanes::driving_lane_status_is_present() { return m_driving_lane_status_is_present; } -size_t etsi_its_cam_msgs::msg::ClosedLanes::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::ClosedLanes::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::ClosedLanes::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ClosedLanesCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.h index 5695fa93c41..a7055d970a7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanes.h @@ -16,21 +16,26 @@ * @file ClosedLanes.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_H_ -#include "HardShoulderStatus.h" -#include "DrivingLaneStatus.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "HardShoulderStatus.h" +#include "DrivingLaneStatus.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,287 +49,249 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ClosedLanes_SOURCE) -#define ClosedLanes_DllAPI __declspec( dllexport ) +#if defined(CLOSEDLANES_SOURCE) +#define CLOSEDLANES_DllAPI __declspec( dllexport ) #else -#define ClosedLanes_DllAPI __declspec( dllimport ) -#endif // ClosedLanes_SOURCE +#define CLOSEDLANES_DllAPI __declspec( dllimport ) +#endif // CLOSEDLANES_SOURCE #else -#define ClosedLanes_DllAPI +#define CLOSEDLANES_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ClosedLanes_DllAPI +#define CLOSEDLANES_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure ClosedLanes defined by the user in the IDL file. - * @ingroup CLOSEDLANES - */ - class ClosedLanes - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ClosedLanes(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ClosedLanes(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. - */ - eProsima_user_DllExport ClosedLanes( - const ClosedLanes& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. - */ - eProsima_user_DllExport ClosedLanes( - ClosedLanes&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. - */ - eProsima_user_DllExport ClosedLanes& operator =( - const ClosedLanes& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. - */ - eProsima_user_DllExport ClosedLanes& operator =( - ClosedLanes&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ClosedLanes object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ClosedLanes& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ClosedLanes object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ClosedLanes& x) const; - - /*! - * @brief This function copies the value in member innerhard_shoulder_status - * @param _innerhard_shoulder_status New value to be copied in member innerhard_shoulder_status - */ - eProsima_user_DllExport void innerhard_shoulder_status( - const etsi_its_cam_msgs::msg::HardShoulderStatus& _innerhard_shoulder_status); - - /*! - * @brief This function moves the value in member innerhard_shoulder_status - * @param _innerhard_shoulder_status New value to be moved in member innerhard_shoulder_status - */ - eProsima_user_DllExport void innerhard_shoulder_status( - etsi_its_cam_msgs::msg::HardShoulderStatus&& _innerhard_shoulder_status); - - /*! - * @brief This function returns a constant reference to member innerhard_shoulder_status - * @return Constant reference to member innerhard_shoulder_status - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::HardShoulderStatus& innerhard_shoulder_status() const; - - /*! - * @brief This function returns a reference to member innerhard_shoulder_status - * @return Reference to member innerhard_shoulder_status - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::HardShoulderStatus& innerhard_shoulder_status(); - /*! - * @brief This function sets a value in member innerhard_shoulder_status_is_present - * @param _innerhard_shoulder_status_is_present New value for member innerhard_shoulder_status_is_present - */ - eProsima_user_DllExport void innerhard_shoulder_status_is_present( - bool _innerhard_shoulder_status_is_present); - - /*! - * @brief This function returns the value of member innerhard_shoulder_status_is_present - * @return Value of member innerhard_shoulder_status_is_present - */ - eProsima_user_DllExport bool innerhard_shoulder_status_is_present() const; - - /*! - * @brief This function returns a reference to member innerhard_shoulder_status_is_present - * @return Reference to member innerhard_shoulder_status_is_present - */ - eProsima_user_DllExport bool& innerhard_shoulder_status_is_present(); - - /*! - * @brief This function copies the value in member outerhard_shoulder_status - * @param _outerhard_shoulder_status New value to be copied in member outerhard_shoulder_status - */ - eProsima_user_DllExport void outerhard_shoulder_status( - const etsi_its_cam_msgs::msg::HardShoulderStatus& _outerhard_shoulder_status); - - /*! - * @brief This function moves the value in member outerhard_shoulder_status - * @param _outerhard_shoulder_status New value to be moved in member outerhard_shoulder_status - */ - eProsima_user_DllExport void outerhard_shoulder_status( - etsi_its_cam_msgs::msg::HardShoulderStatus&& _outerhard_shoulder_status); - - /*! - * @brief This function returns a constant reference to member outerhard_shoulder_status - * @return Constant reference to member outerhard_shoulder_status - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::HardShoulderStatus& outerhard_shoulder_status() const; - - /*! - * @brief This function returns a reference to member outerhard_shoulder_status - * @return Reference to member outerhard_shoulder_status - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::HardShoulderStatus& outerhard_shoulder_status(); - /*! - * @brief This function sets a value in member outerhard_shoulder_status_is_present - * @param _outerhard_shoulder_status_is_present New value for member outerhard_shoulder_status_is_present - */ - eProsima_user_DllExport void outerhard_shoulder_status_is_present( - bool _outerhard_shoulder_status_is_present); - - /*! - * @brief This function returns the value of member outerhard_shoulder_status_is_present - * @return Value of member outerhard_shoulder_status_is_present - */ - eProsima_user_DllExport bool outerhard_shoulder_status_is_present() const; - - /*! - * @brief This function returns a reference to member outerhard_shoulder_status_is_present - * @return Reference to member outerhard_shoulder_status_is_present - */ - eProsima_user_DllExport bool& outerhard_shoulder_status_is_present(); - - /*! - * @brief This function copies the value in member driving_lane_status - * @param _driving_lane_status New value to be copied in member driving_lane_status - */ - eProsima_user_DllExport void driving_lane_status( - const etsi_its_cam_msgs::msg::DrivingLaneStatus& _driving_lane_status); - - /*! - * @brief This function moves the value in member driving_lane_status - * @param _driving_lane_status New value to be moved in member driving_lane_status - */ - eProsima_user_DllExport void driving_lane_status( - etsi_its_cam_msgs::msg::DrivingLaneStatus&& _driving_lane_status); - - /*! - * @brief This function returns a constant reference to member driving_lane_status - * @return Constant reference to member driving_lane_status - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::DrivingLaneStatus& driving_lane_status() const; - - /*! - * @brief This function returns a reference to member driving_lane_status - * @return Reference to member driving_lane_status - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::DrivingLaneStatus& driving_lane_status(); - /*! - * @brief This function sets a value in member driving_lane_status_is_present - * @param _driving_lane_status_is_present New value for member driving_lane_status_is_present - */ - eProsima_user_DllExport void driving_lane_status_is_present( - bool _driving_lane_status_is_present); - - /*! - * @brief This function returns the value of member driving_lane_status_is_present - * @return Value of member driving_lane_status_is_present - */ - eProsima_user_DllExport bool driving_lane_status_is_present() const; - - /*! - * @brief This function returns a reference to member driving_lane_status_is_present - * @return Reference to member driving_lane_status_is_present - */ - eProsima_user_DllExport bool& driving_lane_status_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ClosedLanes& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::HardShoulderStatus m_innerhard_shoulder_status; - bool m_innerhard_shoulder_status_is_present; - etsi_its_cam_msgs::msg::HardShoulderStatus m_outerhard_shoulder_status; - bool m_outerhard_shoulder_status_is_present; - etsi_its_cam_msgs::msg::DrivingLaneStatus m_driving_lane_status; - bool m_driving_lane_status_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure ClosedLanes defined by the user in the IDL file. + * @ingroup ClosedLanes + */ +class ClosedLanes +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ClosedLanes(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ClosedLanes(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. + */ + eProsima_user_DllExport ClosedLanes( + const ClosedLanes& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. + */ + eProsima_user_DllExport ClosedLanes( + ClosedLanes&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. + */ + eProsima_user_DllExport ClosedLanes& operator =( + const ClosedLanes& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ClosedLanes that will be copied. + */ + eProsima_user_DllExport ClosedLanes& operator =( + ClosedLanes&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ClosedLanes object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ClosedLanes& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ClosedLanes object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ClosedLanes& x) const; + + /*! + * @brief This function copies the value in member innerhard_shoulder_status + * @param _innerhard_shoulder_status New value to be copied in member innerhard_shoulder_status + */ + eProsima_user_DllExport void innerhard_shoulder_status( + const etsi_its_cam_msgs::msg::HardShoulderStatus& _innerhard_shoulder_status); + + /*! + * @brief This function moves the value in member innerhard_shoulder_status + * @param _innerhard_shoulder_status New value to be moved in member innerhard_shoulder_status + */ + eProsima_user_DllExport void innerhard_shoulder_status( + etsi_its_cam_msgs::msg::HardShoulderStatus&& _innerhard_shoulder_status); + + /*! + * @brief This function returns a constant reference to member innerhard_shoulder_status + * @return Constant reference to member innerhard_shoulder_status + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HardShoulderStatus& innerhard_shoulder_status() const; + + /*! + * @brief This function returns a reference to member innerhard_shoulder_status + * @return Reference to member innerhard_shoulder_status + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HardShoulderStatus& innerhard_shoulder_status(); + + + /*! + * @brief This function sets a value in member innerhard_shoulder_status_is_present + * @param _innerhard_shoulder_status_is_present New value for member innerhard_shoulder_status_is_present + */ + eProsima_user_DllExport void innerhard_shoulder_status_is_present( + bool _innerhard_shoulder_status_is_present); + + /*! + * @brief This function returns the value of member innerhard_shoulder_status_is_present + * @return Value of member innerhard_shoulder_status_is_present + */ + eProsima_user_DllExport bool innerhard_shoulder_status_is_present() const; + + /*! + * @brief This function returns a reference to member innerhard_shoulder_status_is_present + * @return Reference to member innerhard_shoulder_status_is_present + */ + eProsima_user_DllExport bool& innerhard_shoulder_status_is_present(); + + + /*! + * @brief This function copies the value in member outerhard_shoulder_status + * @param _outerhard_shoulder_status New value to be copied in member outerhard_shoulder_status + */ + eProsima_user_DllExport void outerhard_shoulder_status( + const etsi_its_cam_msgs::msg::HardShoulderStatus& _outerhard_shoulder_status); + + /*! + * @brief This function moves the value in member outerhard_shoulder_status + * @param _outerhard_shoulder_status New value to be moved in member outerhard_shoulder_status + */ + eProsima_user_DllExport void outerhard_shoulder_status( + etsi_its_cam_msgs::msg::HardShoulderStatus&& _outerhard_shoulder_status); + + /*! + * @brief This function returns a constant reference to member outerhard_shoulder_status + * @return Constant reference to member outerhard_shoulder_status + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HardShoulderStatus& outerhard_shoulder_status() const; + + /*! + * @brief This function returns a reference to member outerhard_shoulder_status + * @return Reference to member outerhard_shoulder_status + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HardShoulderStatus& outerhard_shoulder_status(); + + + /*! + * @brief This function sets a value in member outerhard_shoulder_status_is_present + * @param _outerhard_shoulder_status_is_present New value for member outerhard_shoulder_status_is_present + */ + eProsima_user_DllExport void outerhard_shoulder_status_is_present( + bool _outerhard_shoulder_status_is_present); + + /*! + * @brief This function returns the value of member outerhard_shoulder_status_is_present + * @return Value of member outerhard_shoulder_status_is_present + */ + eProsima_user_DllExport bool outerhard_shoulder_status_is_present() const; + + /*! + * @brief This function returns a reference to member outerhard_shoulder_status_is_present + * @return Reference to member outerhard_shoulder_status_is_present + */ + eProsima_user_DllExport bool& outerhard_shoulder_status_is_present(); + + + /*! + * @brief This function copies the value in member driving_lane_status + * @param _driving_lane_status New value to be copied in member driving_lane_status + */ + eProsima_user_DllExport void driving_lane_status( + const etsi_its_cam_msgs::msg::DrivingLaneStatus& _driving_lane_status); + + /*! + * @brief This function moves the value in member driving_lane_status + * @param _driving_lane_status New value to be moved in member driving_lane_status + */ + eProsima_user_DllExport void driving_lane_status( + etsi_its_cam_msgs::msg::DrivingLaneStatus&& _driving_lane_status); + + /*! + * @brief This function returns a constant reference to member driving_lane_status + * @return Constant reference to member driving_lane_status + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DrivingLaneStatus& driving_lane_status() const; + + /*! + * @brief This function returns a reference to member driving_lane_status + * @return Reference to member driving_lane_status + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DrivingLaneStatus& driving_lane_status(); + + + /*! + * @brief This function sets a value in member driving_lane_status_is_present + * @param _driving_lane_status_is_present New value for member driving_lane_status_is_present + */ + eProsima_user_DllExport void driving_lane_status_is_present( + bool _driving_lane_status_is_present); + + /*! + * @brief This function returns the value of member driving_lane_status_is_present + * @return Value of member driving_lane_status_is_present + */ + eProsima_user_DllExport bool driving_lane_status_is_present() const; + + /*! + * @brief This function returns a reference to member driving_lane_status_is_present + * @return Reference to member driving_lane_status_is_present + */ + eProsima_user_DllExport bool& driving_lane_status_is_present(); + +private: + + etsi_its_cam_msgs::msg::HardShoulderStatus m_innerhard_shoulder_status; + bool m_innerhard_shoulder_status_is_present{false}; + etsi_its_cam_msgs::msg::HardShoulderStatus m_outerhard_shoulder_status; + bool m_outerhard_shoulder_status_is_present{false}; + etsi_its_cam_msgs::msg::DrivingLaneStatus m_driving_lane_status; + bool m_driving_lane_status_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesCdrAux.hpp new file mode 100644 index 00000000000..96c8ad85cdf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ClosedLanesCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANESCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANESCDRAUX_HPP_ + +#include "ClosedLanes.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ClosedLanes_max_cdr_typesize {130UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ClosedLanes_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ClosedLanes& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANESCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesCdrAux.ipp new file mode 100644 index 00000000000..9aae0557c7c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesCdrAux.ipp @@ -0,0 +1,170 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ClosedLanesCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANESCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANESCDRAUX_IPP_ + +#include "ClosedLanesCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ClosedLanes& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.innerhard_shoulder_status(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.innerhard_shoulder_status_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.outerhard_shoulder_status(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.outerhard_shoulder_status_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.driving_lane_status(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.driving_lane_status_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ClosedLanes& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.innerhard_shoulder_status() + << eprosima::fastcdr::MemberId(1) << data.innerhard_shoulder_status_is_present() + << eprosima::fastcdr::MemberId(2) << data.outerhard_shoulder_status() + << eprosima::fastcdr::MemberId(3) << data.outerhard_shoulder_status_is_present() + << eprosima::fastcdr::MemberId(4) << data.driving_lane_status() + << eprosima::fastcdr::MemberId(5) << data.driving_lane_status_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ClosedLanes& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.innerhard_shoulder_status(); + break; + + case 1: + dcdr >> data.innerhard_shoulder_status_is_present(); + break; + + case 2: + dcdr >> data.outerhard_shoulder_status(); + break; + + case 3: + dcdr >> data.outerhard_shoulder_status_is_present(); + break; + + case 4: + dcdr >> data.driving_lane_status(); + break; + + case 5: + dcdr >> data.driving_lane_status_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ClosedLanes& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANESCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.cxx index e9942e6527e..b73f5399f40 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file ClosedLanesPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ClosedLanesPubSubTypes.h" +#include "ClosedLanesCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - ClosedLanesPubSubType::ClosedLanesPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ClosedLanes_"); - auto type_size = ClosedLanes::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ClosedLanes::isKeyDefined(); - size_t keyLength = ClosedLanes::getKeyMaxCdrSerializedSize() > 16 ? - ClosedLanes::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ClosedLanesPubSubType::~ClosedLanesPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ClosedLanesPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ClosedLanes* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ClosedLanesPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ClosedLanes* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ClosedLanesPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ClosedLanesPubSubType::createData() - { - return reinterpret_cast(new ClosedLanes()); - } - - void ClosedLanesPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ClosedLanesPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ClosedLanes* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ClosedLanes::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ClosedLanes::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +ClosedLanesPubSubType::ClosedLanesPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ClosedLanes_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ClosedLanes::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ClosedLanes_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ClosedLanesPubSubType::~ClosedLanesPubSubType() +{ +} + +bool ClosedLanesPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ClosedLanes* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ClosedLanesPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ClosedLanes* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ClosedLanesPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ClosedLanesPubSubType::createData() +{ + return reinterpret_cast(new ClosedLanes()); +} + +void ClosedLanesPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ClosedLanesPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.h index 688689788fe..12787989a4b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ClosedLanesPubSubTypes.h @@ -16,92 +16,122 @@ * @file ClosedLanesPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ClosedLanes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "HardShoulderStatusPubSubTypes.h" +#include "DrivingLaneStatusPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ClosedLanes is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type ClosedLanes defined by the user in the IDL file. + * @ingroup ClosedLanes + */ +class ClosedLanesPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type ClosedLanes defined by the user in the IDL file. - * @ingroup CLOSEDLANES - */ - class ClosedLanesPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef ClosedLanes type; + typedef ClosedLanes type; - eProsima_user_DllExport ClosedLanesPubSubType(); + eProsima_user_DllExport ClosedLanesPubSubType(); - eProsima_user_DllExport virtual ~ClosedLanesPubSubType(); + eProsima_user_DllExport ~ClosedLanesPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CLOSEDLANES_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.cxx index 27559cd96df..f42a1661488 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.cxx @@ -14,9 +14,9 @@ /*! * @file CoopAwareness.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "CoopAwareness.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::CoopAwareness::CoopAwareness() -{ - // m_generation_delta_time com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@29e6eb25 - // m_cam_parameters com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@62435e70 +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::CoopAwareness::~CoopAwareness() +CoopAwareness::CoopAwareness() { +} +CoopAwareness::~CoopAwareness() +{ } -etsi_its_cam_msgs::msg::CoopAwareness::CoopAwareness( +CoopAwareness::CoopAwareness( const CoopAwareness& x) { m_generation_delta_time = x.m_generation_delta_time; m_cam_parameters = x.m_cam_parameters; } -etsi_its_cam_msgs::msg::CoopAwareness::CoopAwareness( - CoopAwareness&& x) +CoopAwareness::CoopAwareness( + CoopAwareness&& x) noexcept { m_generation_delta_time = std::move(x.m_generation_delta_time); m_cam_parameters = std::move(x.m_cam_parameters); } -etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CoopAwareness::operator =( +CoopAwareness& CoopAwareness::operator =( const CoopAwareness& x) { m_generation_delta_time = x.m_generation_delta_time; m_cam_parameters = x.m_cam_parameters; - return *this; } -etsi_its_cam_msgs::msg::CoopAwareness& etsi_its_cam_msgs::msg::CoopAwareness::operator =( - CoopAwareness&& x) +CoopAwareness& CoopAwareness::operator =( + CoopAwareness&& x) noexcept { m_generation_delta_time = std::move(x.m_generation_delta_time); m_cam_parameters = std::move(x.m_cam_parameters); - return *this; } -bool etsi_its_cam_msgs::msg::CoopAwareness::operator ==( +bool CoopAwareness::operator ==( const CoopAwareness& x) const { - - return (m_generation_delta_time == x.m_generation_delta_time && m_cam_parameters == x.m_cam_parameters); + return (m_generation_delta_time == x.m_generation_delta_time && + m_cam_parameters == x.m_cam_parameters); } -bool etsi_its_cam_msgs::msg::CoopAwareness::operator !=( +bool CoopAwareness::operator !=( const CoopAwareness& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CoopAwareness::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::GenerationDeltaTime::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CamParameters::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CoopAwareness::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CoopAwareness& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::GenerationDeltaTime::getCdrSerializedSize(data.generation_delta_time(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CamParameters::getCdrSerializedSize(data.cam_parameters(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CoopAwareness::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_generation_delta_time; - scdr << m_cam_parameters; - -} - -void etsi_its_cam_msgs::msg::CoopAwareness::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_generation_delta_time; - dcdr >> m_cam_parameters; -} - /*! * @brief This function copies the value in member generation_delta_time * @param _generation_delta_time New value to be copied in member generation_delta_time */ -void etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time( +void CoopAwareness::generation_delta_time( const etsi_its_cam_msgs::msg::GenerationDeltaTime& _generation_delta_time) { m_generation_delta_time = _generation_delta_time; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time( * @brief This function moves the value in member generation_delta_time * @param _generation_delta_time New value to be moved in member generation_delta_time */ -void etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time( +void CoopAwareness::generation_delta_time( etsi_its_cam_msgs::msg::GenerationDeltaTime&& _generation_delta_time) { m_generation_delta_time = std::move(_generation_delta_time); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time( * @brief This function returns a constant reference to member generation_delta_time * @return Constant reference to member generation_delta_time */ -const etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time() const +const etsi_its_cam_msgs::msg::GenerationDeltaTime& CoopAwareness::generation_delta_time() const { return m_generation_delta_time; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::CoopA * @brief This function returns a reference to member generation_delta_time * @return Reference to member generation_delta_time */ -etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::CoopAwareness::generation_delta_time() +etsi_its_cam_msgs::msg::GenerationDeltaTime& CoopAwareness::generation_delta_time() { return m_generation_delta_time; } + + /*! * @brief This function copies the value in member cam_parameters * @param _cam_parameters New value to be copied in member cam_parameters */ -void etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters( +void CoopAwareness::cam_parameters( const etsi_its_cam_msgs::msg::CamParameters& _cam_parameters) { m_cam_parameters = _cam_parameters; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters( * @brief This function moves the value in member cam_parameters * @param _cam_parameters New value to be moved in member cam_parameters */ -void etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters( +void CoopAwareness::cam_parameters( etsi_its_cam_msgs::msg::CamParameters&& _cam_parameters) { m_cam_parameters = std::move(_cam_parameters); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters( * @brief This function returns a constant reference to member cam_parameters * @return Constant reference to member cam_parameters */ -const etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters() const +const etsi_its_cam_msgs::msg::CamParameters& CoopAwareness::cam_parameters() const { return m_cam_parameters; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CoopAwarene * @brief This function returns a reference to member cam_parameters * @return Reference to member cam_parameters */ -etsi_its_cam_msgs::msg::CamParameters& etsi_its_cam_msgs::msg::CoopAwareness::cam_parameters() +etsi_its_cam_msgs::msg::CamParameters& CoopAwareness::cam_parameters() { return m_cam_parameters; } -size_t etsi_its_cam_msgs::msg::CoopAwareness::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::CoopAwareness::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::CoopAwareness::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CoopAwarenessCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.h index 4b2bd951271..64e32d593fa 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwareness.h @@ -16,21 +16,26 @@ * @file CoopAwareness.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_H_ -#include "GenerationDeltaTime.h" -#include "CamParameters.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "GenerationDeltaTime.h" +#include "CamParameters.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CoopAwareness_SOURCE) -#define CoopAwareness_DllAPI __declspec( dllexport ) +#if defined(COOPAWARENESS_SOURCE) +#define COOPAWARENESS_DllAPI __declspec( dllexport ) #else -#define CoopAwareness_DllAPI __declspec( dllimport ) -#endif // CoopAwareness_SOURCE +#define COOPAWARENESS_DllAPI __declspec( dllimport ) +#endif // COOPAWARENESS_SOURCE #else -#define CoopAwareness_DllAPI +#define COOPAWARENESS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CoopAwareness_DllAPI +#define COOPAWARENESS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure CoopAwareness defined by the user in the IDL file. - * @ingroup COOPAWARENESS - */ - class CoopAwareness - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CoopAwareness(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CoopAwareness(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. - */ - eProsima_user_DllExport CoopAwareness( - const CoopAwareness& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. - */ - eProsima_user_DllExport CoopAwareness( - CoopAwareness&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. - */ - eProsima_user_DllExport CoopAwareness& operator =( - const CoopAwareness& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. - */ - eProsima_user_DllExport CoopAwareness& operator =( - CoopAwareness&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CoopAwareness object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CoopAwareness& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CoopAwareness object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CoopAwareness& x) const; - - /*! - * @brief This function copies the value in member generation_delta_time - * @param _generation_delta_time New value to be copied in member generation_delta_time - */ - eProsima_user_DllExport void generation_delta_time( - const etsi_its_cam_msgs::msg::GenerationDeltaTime& _generation_delta_time); - - /*! - * @brief This function moves the value in member generation_delta_time - * @param _generation_delta_time New value to be moved in member generation_delta_time - */ - eProsima_user_DllExport void generation_delta_time( - etsi_its_cam_msgs::msg::GenerationDeltaTime&& _generation_delta_time); - - /*! - * @brief This function returns a constant reference to member generation_delta_time - * @return Constant reference to member generation_delta_time - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::GenerationDeltaTime& generation_delta_time() const; - - /*! - * @brief This function returns a reference to member generation_delta_time - * @return Reference to member generation_delta_time - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::GenerationDeltaTime& generation_delta_time(); - /*! - * @brief This function copies the value in member cam_parameters - * @param _cam_parameters New value to be copied in member cam_parameters - */ - eProsima_user_DllExport void cam_parameters( - const etsi_its_cam_msgs::msg::CamParameters& _cam_parameters); - - /*! - * @brief This function moves the value in member cam_parameters - * @param _cam_parameters New value to be moved in member cam_parameters - */ - eProsima_user_DllExport void cam_parameters( - etsi_its_cam_msgs::msg::CamParameters&& _cam_parameters); - - /*! - * @brief This function returns a constant reference to member cam_parameters - * @return Constant reference to member cam_parameters - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CamParameters& cam_parameters() const; - - /*! - * @brief This function returns a reference to member cam_parameters - * @return Reference to member cam_parameters - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CamParameters& cam_parameters(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CoopAwareness& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::GenerationDeltaTime m_generation_delta_time; - etsi_its_cam_msgs::msg::CamParameters m_cam_parameters; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure CoopAwareness defined by the user in the IDL file. + * @ingroup CoopAwareness + */ +class CoopAwareness +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CoopAwareness(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CoopAwareness(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. + */ + eProsima_user_DllExport CoopAwareness( + const CoopAwareness& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. + */ + eProsima_user_DllExport CoopAwareness( + CoopAwareness&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. + */ + eProsima_user_DllExport CoopAwareness& operator =( + const CoopAwareness& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CoopAwareness that will be copied. + */ + eProsima_user_DllExport CoopAwareness& operator =( + CoopAwareness&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CoopAwareness object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CoopAwareness& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CoopAwareness object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CoopAwareness& x) const; + + /*! + * @brief This function copies the value in member generation_delta_time + * @param _generation_delta_time New value to be copied in member generation_delta_time + */ + eProsima_user_DllExport void generation_delta_time( + const etsi_its_cam_msgs::msg::GenerationDeltaTime& _generation_delta_time); + + /*! + * @brief This function moves the value in member generation_delta_time + * @param _generation_delta_time New value to be moved in member generation_delta_time + */ + eProsima_user_DllExport void generation_delta_time( + etsi_its_cam_msgs::msg::GenerationDeltaTime&& _generation_delta_time); + + /*! + * @brief This function returns a constant reference to member generation_delta_time + * @return Constant reference to member generation_delta_time + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::GenerationDeltaTime& generation_delta_time() const; + + /*! + * @brief This function returns a reference to member generation_delta_time + * @return Reference to member generation_delta_time + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::GenerationDeltaTime& generation_delta_time(); + + + /*! + * @brief This function copies the value in member cam_parameters + * @param _cam_parameters New value to be copied in member cam_parameters + */ + eProsima_user_DllExport void cam_parameters( + const etsi_its_cam_msgs::msg::CamParameters& _cam_parameters); + + /*! + * @brief This function moves the value in member cam_parameters + * @param _cam_parameters New value to be moved in member cam_parameters + */ + eProsima_user_DllExport void cam_parameters( + etsi_its_cam_msgs::msg::CamParameters&& _cam_parameters); + + /*! + * @brief This function returns a constant reference to member cam_parameters + * @return Constant reference to member cam_parameters + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CamParameters& cam_parameters() const; + + /*! + * @brief This function returns a reference to member cam_parameters + * @return Reference to member cam_parameters + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CamParameters& cam_parameters(); + +private: + + etsi_its_cam_msgs::msg::GenerationDeltaTime m_generation_delta_time; + etsi_its_cam_msgs::msg::CamParameters m_cam_parameters; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessCdrAux.hpp new file mode 100644 index 00000000000..430900d927c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessCdrAux.hpp @@ -0,0 +1,78 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CoopAwarenessCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESSCDRAUX_HPP_ + +#include "CoopAwareness.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CoopAwareness_max_cdr_typesize {12195UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CoopAwareness_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CoopAwareness& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessCdrAux.ipp new file mode 100644 index 00000000000..e27ab5c4639 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CoopAwarenessCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESSCDRAUX_IPP_ + +#include "CoopAwarenessCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CoopAwareness& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.generation_delta_time(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.cam_parameters(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CoopAwareness& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.generation_delta_time() + << eprosima::fastcdr::MemberId(1) << data.cam_parameters() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CoopAwareness& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.generation_delta_time(); + break; + + case 1: + dcdr >> data.cam_parameters(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CoopAwareness& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.cxx index 8a736799ff5..93312e44b11 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CoopAwarenessPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CoopAwarenessPubSubTypes.h" +#include "CoopAwarenessCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - CoopAwarenessPubSubType::CoopAwarenessPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CoopAwareness_"); - auto type_size = CoopAwareness::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CoopAwareness::isKeyDefined(); - size_t keyLength = CoopAwareness::getKeyMaxCdrSerializedSize() > 16 ? - CoopAwareness::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CoopAwarenessPubSubType::~CoopAwarenessPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CoopAwarenessPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CoopAwareness* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CoopAwarenessPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CoopAwareness* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CoopAwarenessPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CoopAwarenessPubSubType::createData() - { - return reinterpret_cast(new CoopAwareness()); - } - - void CoopAwarenessPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CoopAwarenessPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CoopAwareness* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CoopAwareness::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CoopAwareness::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CoopAwarenessPubSubType::CoopAwarenessPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CoopAwareness_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CoopAwareness::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CoopAwareness_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CoopAwarenessPubSubType::~CoopAwarenessPubSubType() +{ +} + +bool CoopAwarenessPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CoopAwareness* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CoopAwarenessPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CoopAwareness* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CoopAwarenessPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CoopAwarenessPubSubType::createData() +{ + return reinterpret_cast(new CoopAwareness()); +} + +void CoopAwarenessPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CoopAwarenessPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.h index d7144b56675..6b8740514e7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CoopAwarenessPubSubTypes.h @@ -16,92 +16,122 @@ * @file CoopAwarenessPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CoopAwareness.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "GenerationDeltaTimePubSubTypes.h" +#include "CamParametersPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CoopAwareness is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type CoopAwareness defined by the user in the IDL file. + * @ingroup CoopAwareness + */ +class CoopAwarenessPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type CoopAwareness defined by the user in the IDL file. - * @ingroup COOPAWARENESS - */ - class CoopAwarenessPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef CoopAwareness type; + typedef CoopAwareness type; - eProsima_user_DllExport CoopAwarenessPubSubType(); + eProsima_user_DllExport CoopAwarenessPubSubType(); - eProsima_user_DllExport virtual ~CoopAwarenessPubSubType(); + eProsima_user_DllExport ~CoopAwarenessPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_COOPAWARENESS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.cxx index 292a12a8223..f0eeba37f52 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.cxx @@ -14,9 +14,9 @@ /*! * @file Curvature.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "Curvature.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::Curvature::Curvature() -{ - // m_curvature_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5aae8eb5 - // m_curvature_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@76954a33 +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::Curvature::~Curvature() +Curvature::Curvature() { +} +Curvature::~Curvature() +{ } -etsi_its_cam_msgs::msg::Curvature::Curvature( +Curvature::Curvature( const Curvature& x) { m_curvature_value = x.m_curvature_value; m_curvature_confidence = x.m_curvature_confidence; } -etsi_its_cam_msgs::msg::Curvature::Curvature( - Curvature&& x) +Curvature::Curvature( + Curvature&& x) noexcept { m_curvature_value = std::move(x.m_curvature_value); m_curvature_confidence = std::move(x.m_curvature_confidence); } -etsi_its_cam_msgs::msg::Curvature& etsi_its_cam_msgs::msg::Curvature::operator =( +Curvature& Curvature::operator =( const Curvature& x) { m_curvature_value = x.m_curvature_value; m_curvature_confidence = x.m_curvature_confidence; - return *this; } -etsi_its_cam_msgs::msg::Curvature& etsi_its_cam_msgs::msg::Curvature::operator =( - Curvature&& x) +Curvature& Curvature::operator =( + Curvature&& x) noexcept { m_curvature_value = std::move(x.m_curvature_value); m_curvature_confidence = std::move(x.m_curvature_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::Curvature::operator ==( +bool Curvature::operator ==( const Curvature& x) const { - - return (m_curvature_value == x.m_curvature_value && m_curvature_confidence == x.m_curvature_confidence); + return (m_curvature_value == x.m_curvature_value && + m_curvature_confidence == x.m_curvature_confidence); } -bool etsi_its_cam_msgs::msg::Curvature::operator !=( +bool Curvature::operator !=( const Curvature& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::Curvature::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::CurvatureValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CurvatureConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::Curvature::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Curvature& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::CurvatureValue::getCdrSerializedSize(data.curvature_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CurvatureConfidence::getCdrSerializedSize(data.curvature_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::Curvature::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_curvature_value; - scdr << m_curvature_confidence; - -} - -void etsi_its_cam_msgs::msg::Curvature::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_curvature_value; - dcdr >> m_curvature_confidence; -} - /*! * @brief This function copies the value in member curvature_value * @param _curvature_value New value to be copied in member curvature_value */ -void etsi_its_cam_msgs::msg::Curvature::curvature_value( +void Curvature::curvature_value( const etsi_its_cam_msgs::msg::CurvatureValue& _curvature_value) { m_curvature_value = _curvature_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::Curvature::curvature_value( * @brief This function moves the value in member curvature_value * @param _curvature_value New value to be moved in member curvature_value */ -void etsi_its_cam_msgs::msg::Curvature::curvature_value( +void Curvature::curvature_value( etsi_its_cam_msgs::msg::CurvatureValue&& _curvature_value) { m_curvature_value = std::move(_curvature_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::Curvature::curvature_value( * @brief This function returns a constant reference to member curvature_value * @return Constant reference to member curvature_value */ -const etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::Curvature::curvature_value() const +const etsi_its_cam_msgs::msg::CurvatureValue& Curvature::curvature_value() const { return m_curvature_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::Curvature: * @brief This function returns a reference to member curvature_value * @return Reference to member curvature_value */ -etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::Curvature::curvature_value() +etsi_its_cam_msgs::msg::CurvatureValue& Curvature::curvature_value() { return m_curvature_value; } + + /*! * @brief This function copies the value in member curvature_confidence * @param _curvature_confidence New value to be copied in member curvature_confidence */ -void etsi_its_cam_msgs::msg::Curvature::curvature_confidence( +void Curvature::curvature_confidence( const etsi_its_cam_msgs::msg::CurvatureConfidence& _curvature_confidence) { m_curvature_confidence = _curvature_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::Curvature::curvature_confidence( * @brief This function moves the value in member curvature_confidence * @param _curvature_confidence New value to be moved in member curvature_confidence */ -void etsi_its_cam_msgs::msg::Curvature::curvature_confidence( +void Curvature::curvature_confidence( etsi_its_cam_msgs::msg::CurvatureConfidence&& _curvature_confidence) { m_curvature_confidence = std::move(_curvature_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::Curvature::curvature_confidence( * @brief This function returns a constant reference to member curvature_confidence * @return Constant reference to member curvature_confidence */ -const etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::Curvature::curvature_confidence() const +const etsi_its_cam_msgs::msg::CurvatureConfidence& Curvature::curvature_confidence() const { return m_curvature_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::Curva * @brief This function returns a reference to member curvature_confidence * @return Reference to member curvature_confidence */ -etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::Curvature::curvature_confidence() +etsi_its_cam_msgs::msg::CurvatureConfidence& Curvature::curvature_confidence() { return m_curvature_confidence; } -size_t etsi_its_cam_msgs::msg::Curvature::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::Curvature::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::Curvature::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CurvatureCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.h index 619038269e0..c6f485d5db2 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Curvature.h @@ -16,21 +16,26 @@ * @file Curvature.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_H_ -#include "CurvatureConfidence.h" -#include "CurvatureValue.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "CurvatureConfidence.h" +#include "CurvatureValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Curvature_SOURCE) -#define Curvature_DllAPI __declspec( dllexport ) +#if defined(CURVATURE_SOURCE) +#define CURVATURE_DllAPI __declspec( dllexport ) #else -#define Curvature_DllAPI __declspec( dllimport ) -#endif // Curvature_SOURCE +#define CURVATURE_DllAPI __declspec( dllimport ) +#endif // CURVATURE_SOURCE #else -#define Curvature_DllAPI +#define CURVATURE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Curvature_DllAPI +#define CURVATURE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure Curvature defined by the user in the IDL file. - * @ingroup CURVATURE - */ - class Curvature - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Curvature(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Curvature(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. - */ - eProsima_user_DllExport Curvature( - const Curvature& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. - */ - eProsima_user_DllExport Curvature( - Curvature&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. - */ - eProsima_user_DllExport Curvature& operator =( - const Curvature& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. - */ - eProsima_user_DllExport Curvature& operator =( - Curvature&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Curvature object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Curvature& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Curvature object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Curvature& x) const; - - /*! - * @brief This function copies the value in member curvature_value - * @param _curvature_value New value to be copied in member curvature_value - */ - eProsima_user_DllExport void curvature_value( - const etsi_its_cam_msgs::msg::CurvatureValue& _curvature_value); - - /*! - * @brief This function moves the value in member curvature_value - * @param _curvature_value New value to be moved in member curvature_value - */ - eProsima_user_DllExport void curvature_value( - etsi_its_cam_msgs::msg::CurvatureValue&& _curvature_value); - - /*! - * @brief This function returns a constant reference to member curvature_value - * @return Constant reference to member curvature_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureValue& curvature_value() const; - - /*! - * @brief This function returns a reference to member curvature_value - * @return Reference to member curvature_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureValue& curvature_value(); - /*! - * @brief This function copies the value in member curvature_confidence - * @param _curvature_confidence New value to be copied in member curvature_confidence - */ - eProsima_user_DllExport void curvature_confidence( - const etsi_its_cam_msgs::msg::CurvatureConfidence& _curvature_confidence); - - /*! - * @brief This function moves the value in member curvature_confidence - * @param _curvature_confidence New value to be moved in member curvature_confidence - */ - eProsima_user_DllExport void curvature_confidence( - etsi_its_cam_msgs::msg::CurvatureConfidence&& _curvature_confidence); - - /*! - * @brief This function returns a constant reference to member curvature_confidence - * @return Constant reference to member curvature_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureConfidence& curvature_confidence() const; - - /*! - * @brief This function returns a reference to member curvature_confidence - * @return Reference to member curvature_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureConfidence& curvature_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Curvature& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::CurvatureValue m_curvature_value; - etsi_its_cam_msgs::msg::CurvatureConfidence m_curvature_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Curvature defined by the user in the IDL file. + * @ingroup Curvature + */ +class Curvature +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Curvature(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Curvature(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. + */ + eProsima_user_DllExport Curvature( + const Curvature& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. + */ + eProsima_user_DllExport Curvature( + Curvature&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. + */ + eProsima_user_DllExport Curvature& operator =( + const Curvature& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Curvature that will be copied. + */ + eProsima_user_DllExport Curvature& operator =( + Curvature&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Curvature object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Curvature& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Curvature object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Curvature& x) const; + + /*! + * @brief This function copies the value in member curvature_value + * @param _curvature_value New value to be copied in member curvature_value + */ + eProsima_user_DllExport void curvature_value( + const etsi_its_cam_msgs::msg::CurvatureValue& _curvature_value); + + /*! + * @brief This function moves the value in member curvature_value + * @param _curvature_value New value to be moved in member curvature_value + */ + eProsima_user_DllExport void curvature_value( + etsi_its_cam_msgs::msg::CurvatureValue&& _curvature_value); + + /*! + * @brief This function returns a constant reference to member curvature_value + * @return Constant reference to member curvature_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureValue& curvature_value() const; + + /*! + * @brief This function returns a reference to member curvature_value + * @return Reference to member curvature_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureValue& curvature_value(); + + + /*! + * @brief This function copies the value in member curvature_confidence + * @param _curvature_confidence New value to be copied in member curvature_confidence + */ + eProsima_user_DllExport void curvature_confidence( + const etsi_its_cam_msgs::msg::CurvatureConfidence& _curvature_confidence); + + /*! + * @brief This function moves the value in member curvature_confidence + * @param _curvature_confidence New value to be moved in member curvature_confidence + */ + eProsima_user_DllExport void curvature_confidence( + etsi_its_cam_msgs::msg::CurvatureConfidence&& _curvature_confidence); + + /*! + * @brief This function returns a constant reference to member curvature_confidence + * @return Constant reference to member curvature_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CurvatureConfidence& curvature_confidence() const; + + /*! + * @brief This function returns a reference to member curvature_confidence + * @return Reference to member curvature_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CurvatureConfidence& curvature_confidence(); + +private: + + etsi_its_cam_msgs::msg::CurvatureValue m_curvature_value; + etsi_its_cam_msgs::msg::CurvatureConfidence m_curvature_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.cxx index 70e39822545..beb07285d9b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.cxx @@ -14,9 +14,9 @@ /*! * @file CurvatureCalculationMode.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,117 +27,79 @@ char dummy; #endif // _WIN32 #include "CurvatureCalculationMode.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace CurvatureCalculationMode_Constants { + + +} // namespace CurvatureCalculationMode_Constants -etsi_its_cam_msgs::msg::CurvatureCalculationMode::CurvatureCalculationMode() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@c446b14 - m_value = 0; +CurvatureCalculationMode::CurvatureCalculationMode() +{ } -etsi_its_cam_msgs::msg::CurvatureCalculationMode::~CurvatureCalculationMode() +CurvatureCalculationMode::~CurvatureCalculationMode() { } -etsi_its_cam_msgs::msg::CurvatureCalculationMode::CurvatureCalculationMode( +CurvatureCalculationMode::CurvatureCalculationMode( const CurvatureCalculationMode& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CurvatureCalculationMode::CurvatureCalculationMode( - CurvatureCalculationMode&& x) +CurvatureCalculationMode::CurvatureCalculationMode( + CurvatureCalculationMode&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg::CurvatureCalculationMode::operator =( +CurvatureCalculationMode& CurvatureCalculationMode::operator =( const CurvatureCalculationMode& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::CurvatureCalculationMode& etsi_its_cam_msgs::msg::CurvatureCalculationMode::operator =( - CurvatureCalculationMode&& x) +CurvatureCalculationMode& CurvatureCalculationMode::operator =( + CurvatureCalculationMode&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::CurvatureCalculationMode::operator ==( +bool CurvatureCalculationMode::operator ==( const CurvatureCalculationMode& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::CurvatureCalculationMode::operator !=( +bool CurvatureCalculationMode::operator !=( const CurvatureCalculationMode& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CurvatureCalculationMode& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CurvatureCalculationMode::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::CurvatureCalculationMode::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::CurvatureCalculationMode::value( +void CurvatureCalculationMode::value( uint8_t _value) { m_value = _value; @@ -147,7 +109,7 @@ void etsi_its_cam_msgs::msg::CurvatureCalculationMode::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::value() const +uint8_t CurvatureCalculationMode::value() const { return m_value; } @@ -156,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::CurvatureCalculationMode::value() +uint8_t& CurvatureCalculationMode::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::CurvatureCalculationMode::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::CurvatureCalculationMode::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::CurvatureCalculationMode::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CurvatureCalculationModeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.h index 6360629c264..6c1d17931e0 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationMode.h @@ -16,19 +16,24 @@ * @file CurvatureCalculationMode.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,174 +47,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CurvatureCalculationMode_SOURCE) -#define CurvatureCalculationMode_DllAPI __declspec( dllexport ) +#if defined(CURVATURECALCULATIONMODE_SOURCE) +#define CURVATURECALCULATIONMODE_DllAPI __declspec( dllexport ) #else -#define CurvatureCalculationMode_DllAPI __declspec( dllimport ) -#endif // CurvatureCalculationMode_SOURCE +#define CURVATURECALCULATIONMODE_DllAPI __declspec( dllimport ) +#endif // CURVATURECALCULATIONMODE_SOURCE #else -#define CurvatureCalculationMode_DllAPI +#define CURVATURECALCULATIONMODE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CurvatureCalculationMode_DllAPI +#define CURVATURECALCULATIONMODE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace CurvatureCalculationMode_Constants { - const uint8_t YAW_RATE_USED = 0; - const uint8_t YAW_RATE_NOT_USED = 1; - const uint8_t UNAVAILABLE = 2; - } // namespace CurvatureCalculationMode_Constants - /*! - * @brief This class represents the structure CurvatureCalculationMode defined by the user in the IDL file. - * @ingroup CURVATURECALCULATIONMODE - */ - class CurvatureCalculationMode - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CurvatureCalculationMode(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CurvatureCalculationMode(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. - */ - eProsima_user_DllExport CurvatureCalculationMode( - const CurvatureCalculationMode& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. - */ - eProsima_user_DllExport CurvatureCalculationMode( - CurvatureCalculationMode&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. - */ - eProsima_user_DllExport CurvatureCalculationMode& operator =( - const CurvatureCalculationMode& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. - */ - eProsima_user_DllExport CurvatureCalculationMode& operator =( - CurvatureCalculationMode&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CurvatureCalculationMode object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CurvatureCalculationMode& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CurvatureCalculationMode object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CurvatureCalculationMode& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CurvatureCalculationMode& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace CurvatureCalculationMode_Constants { + +const uint8_t YAW_RATE_USED = 0; +const uint8_t YAW_RATE_NOT_USED = 1; +const uint8_t UNAVAILABLE = 2; + +} // namespace CurvatureCalculationMode_Constants + + +/*! + * @brief This class represents the structure CurvatureCalculationMode defined by the user in the IDL file. + * @ingroup CurvatureCalculationMode + */ +class CurvatureCalculationMode +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CurvatureCalculationMode(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CurvatureCalculationMode(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. + */ + eProsima_user_DllExport CurvatureCalculationMode( + const CurvatureCalculationMode& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. + */ + eProsima_user_DllExport CurvatureCalculationMode( + CurvatureCalculationMode&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. + */ + eProsima_user_DllExport CurvatureCalculationMode& operator =( + const CurvatureCalculationMode& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureCalculationMode that will be copied. + */ + eProsima_user_DllExport CurvatureCalculationMode& operator =( + CurvatureCalculationMode&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureCalculationMode object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CurvatureCalculationMode& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureCalculationMode object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CurvatureCalculationMode& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModeCdrAux.hpp new file mode 100644 index 00000000000..caee00cb519 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModeCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureCalculationModeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODECDRAUX_HPP_ + +#include "CurvatureCalculationMode.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CurvatureCalculationMode_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CurvatureCalculationMode_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModeCdrAux.ipp new file mode 100644 index 00000000000..dd604d3a4db --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModeCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureCalculationModeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODECDRAUX_IPP_ + +#include "CurvatureCalculationModeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CurvatureCalculationMode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureCalculationMode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.cxx index b3a8fcb5ae1..ded29f8ef88 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.cxx @@ -16,167 +16,193 @@ * @file CurvatureCalculationModePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CurvatureCalculationModePubSubTypes.h" +#include "CurvatureCalculationModeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace CurvatureCalculationMode_Constants { - - - - - } //End of namespace CurvatureCalculationMode_Constants - CurvatureCalculationModePubSubType::CurvatureCalculationModePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CurvatureCalculationMode_"); - auto type_size = CurvatureCalculationMode::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CurvatureCalculationMode::isKeyDefined(); - size_t keyLength = CurvatureCalculationMode::getKeyMaxCdrSerializedSize() > 16 ? - CurvatureCalculationMode::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CurvatureCalculationModePubSubType::~CurvatureCalculationModePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CurvatureCalculationModePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CurvatureCalculationMode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CurvatureCalculationModePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CurvatureCalculationMode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CurvatureCalculationModePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CurvatureCalculationModePubSubType::createData() - { - return reinterpret_cast(new CurvatureCalculationMode()); - } - - void CurvatureCalculationModePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CurvatureCalculationModePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CurvatureCalculationMode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CurvatureCalculationMode::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CurvatureCalculationMode::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace CurvatureCalculationMode_Constants { + + + + + + + +} //End of namespace CurvatureCalculationMode_Constants + + + +CurvatureCalculationModePubSubType::CurvatureCalculationModePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CurvatureCalculationMode_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CurvatureCalculationMode::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CurvatureCalculationMode_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CurvatureCalculationModePubSubType::~CurvatureCalculationModePubSubType() +{ +} + +bool CurvatureCalculationModePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CurvatureCalculationMode* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CurvatureCalculationModePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CurvatureCalculationMode* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CurvatureCalculationModePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CurvatureCalculationModePubSubType::createData() +{ + return reinterpret_cast(new CurvatureCalculationMode()); +} + +void CurvatureCalculationModePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CurvatureCalculationModePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.h index f0057bca0fe..d9c7ff6e175 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCalculationModePubSubTypes.h @@ -16,98 +16,128 @@ * @file CurvatureCalculationModePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CurvatureCalculationMode.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CurvatureCalculationMode is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace CurvatureCalculationMode_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace CurvatureCalculationMode_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type CurvatureCalculationMode defined by the user in the IDL file. - * @ingroup CURVATURECALCULATIONMODE - */ - class CurvatureCalculationModePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace CurvatureCalculationMode_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type CurvatureCalculationMode defined by the user in the IDL file. + * @ingroup CurvatureCalculationMode + */ +class CurvatureCalculationModePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CurvatureCalculationMode type; - typedef CurvatureCalculationMode type; + eProsima_user_DllExport CurvatureCalculationModePubSubType(); - eProsima_user_DllExport CurvatureCalculationModePubSubType(); + eProsima_user_DllExport ~CurvatureCalculationModePubSubType() override; - eProsima_user_DllExport virtual ~CurvatureCalculationModePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CurvatureCalculationMode(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECALCULATIONMODE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCdrAux.hpp new file mode 100644 index 00000000000..536d2e89522 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECDRAUX_HPP_ + +#include "Curvature.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_Curvature_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_Curvature_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Curvature& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCdrAux.ipp new file mode 100644 index 00000000000..e8cb5905aaa --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECDRAUX_IPP_ + +#include "CurvatureCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::Curvature& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.curvature_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.curvature_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Curvature& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.curvature_value() + << eprosima::fastcdr::MemberId(1) << data.curvature_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::Curvature& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.curvature_value(); + break; + + case 1: + dcdr >> data.curvature_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Curvature& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.cxx index 0c9a9650867..f8c67145fbb 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.cxx @@ -14,9 +14,9 @@ /*! * @file CurvatureConfidence.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,79 @@ char dummy; #endif // _WIN32 #include "CurvatureConfidence.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace CurvatureConfidence_Constants { +} // namespace CurvatureConfidence_Constants - - -etsi_its_cam_msgs::msg::CurvatureConfidence::CurvatureConfidence() +CurvatureConfidence::CurvatureConfidence() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@76075d65 - m_value = 0; - } -etsi_its_cam_msgs::msg::CurvatureConfidence::~CurvatureConfidence() +CurvatureConfidence::~CurvatureConfidence() { } -etsi_its_cam_msgs::msg::CurvatureConfidence::CurvatureConfidence( +CurvatureConfidence::CurvatureConfidence( const CurvatureConfidence& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CurvatureConfidence::CurvatureConfidence( - CurvatureConfidence&& x) +CurvatureConfidence::CurvatureConfidence( + CurvatureConfidence&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::CurvatureConfidence::operator =( +CurvatureConfidence& CurvatureConfidence::operator =( const CurvatureConfidence& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::CurvatureConfidence& etsi_its_cam_msgs::msg::CurvatureConfidence::operator =( - CurvatureConfidence&& x) +CurvatureConfidence& CurvatureConfidence::operator =( + CurvatureConfidence&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::CurvatureConfidence::operator ==( +bool CurvatureConfidence::operator ==( const CurvatureConfidence& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::CurvatureConfidence::operator !=( +bool CurvatureConfidence::operator !=( const CurvatureConfidence& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CurvatureConfidence::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CurvatureConfidence::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CurvatureConfidence& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CurvatureConfidence::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::CurvatureConfidence::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::CurvatureConfidence::value( +void CurvatureConfidence::value( uint8_t _value) { m_value = _value; @@ -152,7 +109,7 @@ void etsi_its_cam_msgs::msg::CurvatureConfidence::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::CurvatureConfidence::value() const +uint8_t CurvatureConfidence::value() const { return m_value; } @@ -161,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::CurvatureConfidence::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::CurvatureConfidence::value() +uint8_t& CurvatureConfidence::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::CurvatureConfidence::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::CurvatureConfidence::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::CurvatureConfidence::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CurvatureConfidenceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.h index 819fa5b5e23..985dc23dfb9 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidence.h @@ -16,19 +16,24 @@ * @file CurvatureConfidence.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,179 +47,135 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CurvatureConfidence_SOURCE) -#define CurvatureConfidence_DllAPI __declspec( dllexport ) +#if defined(CURVATURECONFIDENCE_SOURCE) +#define CURVATURECONFIDENCE_DllAPI __declspec( dllexport ) #else -#define CurvatureConfidence_DllAPI __declspec( dllimport ) -#endif // CurvatureConfidence_SOURCE +#define CURVATURECONFIDENCE_DllAPI __declspec( dllimport ) +#endif // CURVATURECONFIDENCE_SOURCE #else -#define CurvatureConfidence_DllAPI +#define CURVATURECONFIDENCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CurvatureConfidence_DllAPI +#define CURVATURECONFIDENCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace CurvatureConfidence_Constants { - const uint8_t ONE_PER_METER_0_00002 = 0; - const uint8_t ONE_PER_METER_0_0001 = 1; - const uint8_t ONE_PER_METER_0_0005 = 2; - const uint8_t ONE_PER_METER_0_002 = 3; - const uint8_t ONE_PER_METER_0_01 = 4; - const uint8_t ONE_PER_METER_0_1 = 5; - const uint8_t OUT_OF_RANGE = 6; - const uint8_t UNAVAILABLE = 7; - } // namespace CurvatureConfidence_Constants - /*! - * @brief This class represents the structure CurvatureConfidence defined by the user in the IDL file. - * @ingroup CURVATURECONFIDENCE - */ - class CurvatureConfidence - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CurvatureConfidence(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CurvatureConfidence(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. - */ - eProsima_user_DllExport CurvatureConfidence( - const CurvatureConfidence& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. - */ - eProsima_user_DllExport CurvatureConfidence( - CurvatureConfidence&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. - */ - eProsima_user_DllExport CurvatureConfidence& operator =( - const CurvatureConfidence& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. - */ - eProsima_user_DllExport CurvatureConfidence& operator =( - CurvatureConfidence&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CurvatureConfidence object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CurvatureConfidence& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CurvatureConfidence object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CurvatureConfidence& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CurvatureConfidence& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace CurvatureConfidence_Constants { + +const uint8_t ONE_PER_METER_0_00002 = 0; +const uint8_t ONE_PER_METER_0_0001 = 1; +const uint8_t ONE_PER_METER_0_0005 = 2; +const uint8_t ONE_PER_METER_0_002 = 3; +const uint8_t ONE_PER_METER_0_01 = 4; +const uint8_t ONE_PER_METER_0_1 = 5; +const uint8_t OUT_OF_RANGE = 6; +const uint8_t UNAVAILABLE = 7; + +} // namespace CurvatureConfidence_Constants + + +/*! + * @brief This class represents the structure CurvatureConfidence defined by the user in the IDL file. + * @ingroup CurvatureConfidence + */ +class CurvatureConfidence +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CurvatureConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CurvatureConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. + */ + eProsima_user_DllExport CurvatureConfidence( + const CurvatureConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. + */ + eProsima_user_DllExport CurvatureConfidence( + CurvatureConfidence&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. + */ + eProsima_user_DllExport CurvatureConfidence& operator =( + const CurvatureConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureConfidence that will be copied. + */ + eProsima_user_DllExport CurvatureConfidence& operator =( + CurvatureConfidence&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CurvatureConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CurvatureConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidenceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidenceCdrAux.hpp new file mode 100644 index 00000000000..157287f5f62 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidenceCdrAux.hpp @@ -0,0 +1,67 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureConfidenceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCECDRAUX_HPP_ + +#include "CurvatureConfidence.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CurvatureConfidence_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CurvatureConfidence_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureConfidence& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidenceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidenceCdrAux.ipp new file mode 100644 index 00000000000..b97c5767dd6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidenceCdrAux.ipp @@ -0,0 +1,147 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureConfidenceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCECDRAUX_IPP_ + +#include "CurvatureConfidenceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CurvatureConfidence& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CurvatureConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.cxx index 7a16975794f..efebc9290c1 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.cxx @@ -16,172 +16,203 @@ * @file CurvatureConfidencePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CurvatureConfidencePubSubTypes.h" +#include "CurvatureConfidenceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace CurvatureConfidence_Constants { - - - - - - - - - - } //End of namespace CurvatureConfidence_Constants - CurvatureConfidencePubSubType::CurvatureConfidencePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CurvatureConfidence_"); - auto type_size = CurvatureConfidence::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CurvatureConfidence::isKeyDefined(); - size_t keyLength = CurvatureConfidence::getKeyMaxCdrSerializedSize() > 16 ? - CurvatureConfidence::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CurvatureConfidencePubSubType::~CurvatureConfidencePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CurvatureConfidencePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CurvatureConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CurvatureConfidencePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CurvatureConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CurvatureConfidencePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CurvatureConfidencePubSubType::createData() - { - return reinterpret_cast(new CurvatureConfidence()); - } - - void CurvatureConfidencePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CurvatureConfidencePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CurvatureConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CurvatureConfidence::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CurvatureConfidence::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace CurvatureConfidence_Constants { + + + + + + + + + + + + + + + + + +} //End of namespace CurvatureConfidence_Constants + + + +CurvatureConfidencePubSubType::CurvatureConfidencePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CurvatureConfidence_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CurvatureConfidence::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CurvatureConfidence_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CurvatureConfidencePubSubType::~CurvatureConfidencePubSubType() +{ +} + +bool CurvatureConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CurvatureConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CurvatureConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CurvatureConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CurvatureConfidencePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CurvatureConfidencePubSubType::createData() +{ + return reinterpret_cast(new CurvatureConfidence()); +} + +void CurvatureConfidencePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CurvatureConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.h index 40a19ad810f..091e397ce16 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureConfidencePubSubTypes.h @@ -16,29 +16,32 @@ * @file CurvatureConfidencePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CurvatureConfidence.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CurvatureConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace CurvatureConfidence_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace CurvatureConfidence_Constants { @@ -47,72 +50,104 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type CurvatureConfidence defined by the user in the IDL file. - * @ingroup CURVATURECONFIDENCE - */ - class CurvatureConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef CurvatureConfidence type; - eProsima_user_DllExport CurvatureConfidencePubSubType(); - eProsima_user_DllExport virtual ~CurvatureConfidencePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; +} // namespace CurvatureConfidence_Constants - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +/*! + * @brief This class represents the TopicDataType of the type CurvatureConfidence defined by the user in the IDL file. + * @ingroup CurvatureConfidence + */ +class CurvatureConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + typedef CurvatureConfidence type; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport CurvatureConfidencePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CurvatureConfidence(); - return true; - } + eProsima_user_DllExport ~CurvatureConfidencePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURECONFIDENCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.cxx index 97ee8aab403..382a8e3ff5e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file CurvaturePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CurvaturePubSubTypes.h" +#include "CurvatureCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - CurvaturePubSubType::CurvaturePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::Curvature_"); - auto type_size = Curvature::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Curvature::isKeyDefined(); - size_t keyLength = Curvature::getKeyMaxCdrSerializedSize() > 16 ? - Curvature::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CurvaturePubSubType::~CurvaturePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CurvaturePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Curvature* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CurvaturePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Curvature* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CurvaturePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CurvaturePubSubType::createData() - { - return reinterpret_cast(new Curvature()); - } - - void CurvaturePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CurvaturePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Curvature* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Curvature::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Curvature::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +CurvaturePubSubType::CurvaturePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::Curvature_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Curvature::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_Curvature_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CurvaturePubSubType::~CurvaturePubSubType() +{ +} + +bool CurvaturePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Curvature* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CurvaturePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Curvature* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CurvaturePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CurvaturePubSubType::createData() +{ + return reinterpret_cast(new Curvature()); +} + +void CurvaturePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CurvaturePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.h index d8c5a516da9..c3ca2121087 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvaturePubSubTypes.h @@ -16,92 +16,122 @@ * @file CurvaturePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Curvature.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CurvatureConfidencePubSubTypes.h" +#include "CurvatureValuePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Curvature is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Curvature defined by the user in the IDL file. + * @ingroup Curvature + */ +class CurvaturePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Curvature defined by the user in the IDL file. - * @ingroup CURVATURE - */ - class CurvaturePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Curvature type; + typedef Curvature type; - eProsima_user_DllExport CurvaturePubSubType(); + eProsima_user_DllExport CurvaturePubSubType(); - eProsima_user_DllExport virtual ~CurvaturePubSubType(); + eProsima_user_DllExport ~CurvaturePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Curvature(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATURE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.cxx index d7890d2f515..c22add6736e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.cxx @@ -14,9 +14,9 @@ /*! * @file CurvatureValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,118 +27,79 @@ char dummy; #endif // _WIN32 #include "CurvatureValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace CurvatureValue_Constants { -etsi_its_cam_msgs::msg::CurvatureValue::CurvatureValue() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@426e505c - m_value = 0; +} // namespace CurvatureValue_Constants + +CurvatureValue::CurvatureValue() +{ } -etsi_its_cam_msgs::msg::CurvatureValue::~CurvatureValue() +CurvatureValue::~CurvatureValue() { } -etsi_its_cam_msgs::msg::CurvatureValue::CurvatureValue( +CurvatureValue::CurvatureValue( const CurvatureValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CurvatureValue::CurvatureValue( - CurvatureValue&& x) +CurvatureValue::CurvatureValue( + CurvatureValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::CurvatureValue::operator =( +CurvatureValue& CurvatureValue::operator =( const CurvatureValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::CurvatureValue& etsi_its_cam_msgs::msg::CurvatureValue::operator =( - CurvatureValue&& x) +CurvatureValue& CurvatureValue::operator =( + CurvatureValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::CurvatureValue::operator ==( +bool CurvatureValue::operator ==( const CurvatureValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::CurvatureValue::operator !=( +bool CurvatureValue::operator !=( const CurvatureValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::CurvatureValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::CurvatureValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CurvatureValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::CurvatureValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::CurvatureValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::CurvatureValue::value( +void CurvatureValue::value( int16_t _value) { m_value = _value; @@ -148,7 +109,7 @@ void etsi_its_cam_msgs::msg::CurvatureValue::value( * @brief This function returns the value of member value * @return Value of member value */ -int16_t etsi_its_cam_msgs::msg::CurvatureValue::value() const +int16_t CurvatureValue::value() const { return m_value; } @@ -157,32 +118,18 @@ int16_t etsi_its_cam_msgs::msg::CurvatureValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int16_t& etsi_its_cam_msgs::msg::CurvatureValue::value() +int16_t& CurvatureValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::CurvatureValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::CurvatureValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::CurvatureValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CurvatureValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.h index e401f66b36c..b0b87805624 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValue.h @@ -16,19 +16,24 @@ * @file CurvatureValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,175 +47,131 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CurvatureValue_SOURCE) -#define CurvatureValue_DllAPI __declspec( dllexport ) +#if defined(CURVATUREVALUE_SOURCE) +#define CURVATUREVALUE_DllAPI __declspec( dllexport ) #else -#define CurvatureValue_DllAPI __declspec( dllimport ) -#endif // CurvatureValue_SOURCE +#define CURVATUREVALUE_DllAPI __declspec( dllimport ) +#endif // CURVATUREVALUE_SOURCE #else -#define CurvatureValue_DllAPI +#define CURVATUREVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define CurvatureValue_DllAPI +#define CURVATUREVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace CurvatureValue_Constants { - const int16_t MIN = -1023; - const int16_t MAX = 1023; - const int16_t STRAIGHT = 0; - const int16_t UNAVAILABLE = 1023; - } // namespace CurvatureValue_Constants - /*! - * @brief This class represents the structure CurvatureValue defined by the user in the IDL file. - * @ingroup CURVATUREVALUE - */ - class CurvatureValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CurvatureValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CurvatureValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. - */ - eProsima_user_DllExport CurvatureValue( - const CurvatureValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. - */ - eProsima_user_DllExport CurvatureValue( - CurvatureValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. - */ - eProsima_user_DllExport CurvatureValue& operator =( - const CurvatureValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. - */ - eProsima_user_DllExport CurvatureValue& operator =( - CurvatureValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CurvatureValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CurvatureValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::CurvatureValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CurvatureValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::CurvatureValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace CurvatureValue_Constants { + +const int16_t MIN = -1023; +const int16_t MAX = 1023; +const int16_t STRAIGHT = 0; +const int16_t UNAVAILABLE = 1023; + +} // namespace CurvatureValue_Constants + + +/*! + * @brief This class represents the structure CurvatureValue defined by the user in the IDL file. + * @ingroup CurvatureValue + */ +class CurvatureValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CurvatureValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CurvatureValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. + */ + eProsima_user_DllExport CurvatureValue( + const CurvatureValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. + */ + eProsima_user_DllExport CurvatureValue( + CurvatureValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. + */ + eProsima_user_DllExport CurvatureValue& operator =( + const CurvatureValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::CurvatureValue that will be copied. + */ + eProsima_user_DllExport CurvatureValue& operator =( + CurvatureValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CurvatureValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::CurvatureValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CurvatureValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + +private: + + int16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValueCdrAux.hpp new file mode 100644 index 00000000000..2c63891ad5a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValueCdrAux.hpp @@ -0,0 +1,59 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUECDRAUX_HPP_ + +#include "CurvatureValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_CurvatureValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_CurvatureValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValueCdrAux.ipp new file mode 100644 index 00000000000..f8fa4d52ea2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValueCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CurvatureValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUECDRAUX_IPP_ + +#include "CurvatureValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::CurvatureValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::CurvatureValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::CurvatureValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.cxx index 374e9c78405..b9380197b1d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.cxx @@ -16,168 +16,195 @@ * @file CurvatureValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "CurvatureValuePubSubTypes.h" +#include "CurvatureValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace CurvatureValue_Constants { - - - - - - } //End of namespace CurvatureValue_Constants - CurvatureValuePubSubType::CurvatureValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::CurvatureValue_"); - auto type_size = CurvatureValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CurvatureValue::isKeyDefined(); - size_t keyLength = CurvatureValue::getKeyMaxCdrSerializedSize() > 16 ? - CurvatureValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CurvatureValuePubSubType::~CurvatureValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CurvatureValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CurvatureValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CurvatureValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - CurvatureValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function CurvatureValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CurvatureValuePubSubType::createData() - { - return reinterpret_cast(new CurvatureValue()); - } - - void CurvatureValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CurvatureValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CurvatureValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CurvatureValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CurvatureValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace CurvatureValue_Constants { + + + + + + + + + +} //End of namespace CurvatureValue_Constants + + + +CurvatureValuePubSubType::CurvatureValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::CurvatureValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CurvatureValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_CurvatureValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CurvatureValuePubSubType::~CurvatureValuePubSubType() +{ +} + +bool CurvatureValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CurvatureValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CurvatureValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CurvatureValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CurvatureValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CurvatureValuePubSubType::createData() +{ + return reinterpret_cast(new CurvatureValue()); +} + +void CurvatureValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CurvatureValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.h index e80800a19b5..1dac9299fad 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/CurvatureValuePubSubTypes.h @@ -16,99 +16,130 @@ * @file CurvatureValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "CurvatureValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated CurvatureValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace CurvatureValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace CurvatureValue_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type CurvatureValue defined by the user in the IDL file. - * @ingroup CURVATUREVALUE - */ - class CurvatureValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef CurvatureValue type; - eProsima_user_DllExport CurvatureValuePubSubType(); - eProsima_user_DllExport virtual ~CurvatureValuePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; +} // namespace CurvatureValue_Constants - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +/*! + * @brief This class represents the TopicDataType of the type CurvatureValue defined by the user in the IDL file. + * @ingroup CurvatureValue + */ +class CurvatureValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport virtual void* createData() override; + typedef CurvatureValue type; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport CurvatureValuePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport ~CurvatureValuePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) CurvatureValue(); - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_CURVATUREVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.cxx index 9c50fb7caf4..1e2072b24eb 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.cxx @@ -14,9 +14,9 @@ /*! * @file DangerousGoodsBasic.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,134 +27,79 @@ char dummy; #endif // _WIN32 #include "DangerousGoodsBasic.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace DangerousGoodsBasic_Constants { +} // namespace DangerousGoodsBasic_Constants - - - - - - - - - - - - - - -etsi_its_cam_msgs::msg::DangerousGoodsBasic::DangerousGoodsBasic() +DangerousGoodsBasic::DangerousGoodsBasic() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71e9a896 - m_value = 0; - } -etsi_its_cam_msgs::msg::DangerousGoodsBasic::~DangerousGoodsBasic() +DangerousGoodsBasic::~DangerousGoodsBasic() { } -etsi_its_cam_msgs::msg::DangerousGoodsBasic::DangerousGoodsBasic( +DangerousGoodsBasic::DangerousGoodsBasic( const DangerousGoodsBasic& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DangerousGoodsBasic::DangerousGoodsBasic( - DangerousGoodsBasic&& x) +DangerousGoodsBasic::DangerousGoodsBasic( + DangerousGoodsBasic&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::DangerousGoodsBasic::operator =( +DangerousGoodsBasic& DangerousGoodsBasic::operator =( const DangerousGoodsBasic& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::DangerousGoodsBasic::operator =( - DangerousGoodsBasic&& x) +DangerousGoodsBasic& DangerousGoodsBasic::operator =( + DangerousGoodsBasic&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::DangerousGoodsBasic::operator ==( +bool DangerousGoodsBasic::operator ==( const DangerousGoodsBasic& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::DangerousGoodsBasic::operator !=( +bool DangerousGoodsBasic::operator !=( const DangerousGoodsBasic& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DangerousGoodsBasic& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::DangerousGoodsBasic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::DangerousGoodsBasic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::DangerousGoodsBasic::value( +void DangerousGoodsBasic::value( uint8_t _value) { m_value = _value; @@ -164,7 +109,7 @@ void etsi_its_cam_msgs::msg::DangerousGoodsBasic::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::value() const +uint8_t DangerousGoodsBasic::value() const { return m_value; } @@ -173,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::DangerousGoodsBasic::value() +uint8_t& DangerousGoodsBasic::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::DangerousGoodsBasic::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::DangerousGoodsBasic::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::DangerousGoodsBasic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DangerousGoodsBasicCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.h index 9f551f046cd..2bab63e7e04 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasic.h @@ -16,19 +16,24 @@ * @file DangerousGoodsBasic.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,191 +47,147 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DangerousGoodsBasic_SOURCE) -#define DangerousGoodsBasic_DllAPI __declspec( dllexport ) +#if defined(DANGEROUSGOODSBASIC_SOURCE) +#define DANGEROUSGOODSBASIC_DllAPI __declspec( dllexport ) #else -#define DangerousGoodsBasic_DllAPI __declspec( dllimport ) -#endif // DangerousGoodsBasic_SOURCE +#define DANGEROUSGOODSBASIC_DllAPI __declspec( dllimport ) +#endif // DANGEROUSGOODSBASIC_SOURCE #else -#define DangerousGoodsBasic_DllAPI +#define DANGEROUSGOODSBASIC_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DangerousGoodsBasic_DllAPI +#define DANGEROUSGOODSBASIC_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace DangerousGoodsBasic_Constants { - const uint8_t EXPLOSIVES_1 = 0; - const uint8_t EXPLOSIVES_2 = 1; - const uint8_t EXPLOSIVES_3 = 2; - const uint8_t EXPLOSIVES_4 = 3; - const uint8_t EXPLOSIVES_5 = 4; - const uint8_t EXPLOSIVES_6 = 5; - const uint8_t FLAMMABLE_GASES = 6; - const uint8_t NON_FLAMMABLE_GASES = 7; - const uint8_t TOXIC_GASES = 8; - const uint8_t FLAMMABLE_LIQUIDS = 9; - const uint8_t FLAMMABLE_SOLIDS = 10; - const uint8_t SUBSTANCES_LIABLE_TO_SPONTANEOUS_COMBUSTION = 11; - const uint8_t SUBSTANCES_EMITTING_FLAMMABLE_GASES_UPON_CONTACT_WITH_WATER = 12; - const uint8_t OXIDIZING_SUBSTANCES = 13; - const uint8_t ORGANIC_PEROXIDES = 14; - const uint8_t TOXIC_SUBSTANCES = 15; - const uint8_t INFECTIOUS_SUBSTANCES = 16; - const uint8_t RADIOACTIVE_MATERIAL = 17; - const uint8_t CORROSIVE_SUBSTANCES = 18; - const uint8_t MISCELLANEOUS_DANGEROUS_SUBSTANCES = 19; - } // namespace DangerousGoodsBasic_Constants - /*! - * @brief This class represents the structure DangerousGoodsBasic defined by the user in the IDL file. - * @ingroup DANGEROUSGOODSBASIC - */ - class DangerousGoodsBasic - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DangerousGoodsBasic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DangerousGoodsBasic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. - */ - eProsima_user_DllExport DangerousGoodsBasic( - const DangerousGoodsBasic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. - */ - eProsima_user_DllExport DangerousGoodsBasic( - DangerousGoodsBasic&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. - */ - eProsima_user_DllExport DangerousGoodsBasic& operator =( - const DangerousGoodsBasic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. - */ - eProsima_user_DllExport DangerousGoodsBasic& operator =( - DangerousGoodsBasic&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DangerousGoodsBasic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DangerousGoodsBasic& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DangerousGoodsBasic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DangerousGoodsBasic& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DangerousGoodsBasic& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace DangerousGoodsBasic_Constants { + +const uint8_t EXPLOSIVES1 = 0; +const uint8_t EXPLOSIVES2 = 1; +const uint8_t EXPLOSIVES3 = 2; +const uint8_t EXPLOSIVES4 = 3; +const uint8_t EXPLOSIVES5 = 4; +const uint8_t EXPLOSIVES6 = 5; +const uint8_t FLAMMABLE_GASES = 6; +const uint8_t NON_FLAMMABLE_GASES = 7; +const uint8_t TOXIC_GASES = 8; +const uint8_t FLAMMABLE_LIQUIDS = 9; +const uint8_t FLAMMABLE_SOLIDS = 10; +const uint8_t SUBSTANCES_LIABLE_TO_SPONTANEOUS_COMBUSTION = 11; +const uint8_t SUBSTANCES_EMITTING_FLAMMABLE_GASES_UPON_CONTACT_WITH_WATER = 12; +const uint8_t OXIDIZING_SUBSTANCES = 13; +const uint8_t ORGANIC_PEROXIDES = 14; +const uint8_t TOXIC_SUBSTANCES = 15; +const uint8_t INFECTIOUS_SUBSTANCES = 16; +const uint8_t RADIOACTIVE_MATERIAL = 17; +const uint8_t CORROSIVE_SUBSTANCES = 18; +const uint8_t MISCELLANEOUS_DANGEROUS_SUBSTANCES = 19; + +} // namespace DangerousGoodsBasic_Constants + + +/*! + * @brief This class represents the structure DangerousGoodsBasic defined by the user in the IDL file. + * @ingroup DangerousGoodsBasic + */ +class DangerousGoodsBasic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DangerousGoodsBasic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DangerousGoodsBasic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. + */ + eProsima_user_DllExport DangerousGoodsBasic( + const DangerousGoodsBasic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. + */ + eProsima_user_DllExport DangerousGoodsBasic( + DangerousGoodsBasic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. + */ + eProsima_user_DllExport DangerousGoodsBasic& operator =( + const DangerousGoodsBasic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsBasic that will be copied. + */ + eProsima_user_DllExport DangerousGoodsBasic& operator =( + DangerousGoodsBasic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DangerousGoodsBasic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DangerousGoodsBasic& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DangerousGoodsBasic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DangerousGoodsBasic& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicCdrAux.hpp new file mode 100644 index 00000000000..0a34a207332 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicCdrAux.hpp @@ -0,0 +1,91 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsBasicCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASICCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASICCDRAUX_HPP_ + +#include "DangerousGoodsBasic.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_DangerousGoodsBasic_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_DangerousGoodsBasic_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASICCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicCdrAux.ipp new file mode 100644 index 00000000000..0faa4811101 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicCdrAux.ipp @@ -0,0 +1,171 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsBasicCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASICCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASICCDRAUX_IPP_ + +#include "DangerousGoodsBasicCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::DangerousGoodsBasic& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASICCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.cxx index 6c17c6ca8ce..9a3234fa092 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.cxx @@ -16,21 +16,35 @@ * @file DangerousGoodsBasicPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DangerousGoodsBasicPubSubTypes.h" +#include "DangerousGoodsBasicCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace DangerousGoodsBasic_Constants { +namespace msg { +namespace DangerousGoodsBasic_Constants { + + + + + + + + + + @@ -52,148 +66,177 @@ namespace etsi_its_cam_msgs { - } //End of namespace DangerousGoodsBasic_Constants - DangerousGoodsBasicPubSubType::DangerousGoodsBasicPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::DangerousGoodsBasic_"); - auto type_size = DangerousGoodsBasic::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DangerousGoodsBasic::isKeyDefined(); - size_t keyLength = DangerousGoodsBasic::getKeyMaxCdrSerializedSize() > 16 ? - DangerousGoodsBasic::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - DangerousGoodsBasicPubSubType::~DangerousGoodsBasicPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - bool DangerousGoodsBasicPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DangerousGoodsBasic* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - bool DangerousGoodsBasicPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DangerousGoodsBasic* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } +} //End of namespace DangerousGoodsBasic_Constants - return true; - } - std::function DangerousGoodsBasicPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DangerousGoodsBasicPubSubType::createData() - { - return reinterpret_cast(new DangerousGoodsBasic()); - } - - void DangerousGoodsBasicPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DangerousGoodsBasicPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DangerousGoodsBasic* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DangerousGoodsBasic::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DangerousGoodsBasic::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + +DangerousGoodsBasicPubSubType::DangerousGoodsBasicPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::DangerousGoodsBasic_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DangerousGoodsBasic::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_DangerousGoodsBasic_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DangerousGoodsBasicPubSubType::~DangerousGoodsBasicPubSubType() +{ +} + +bool DangerousGoodsBasicPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DangerousGoodsBasic* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DangerousGoodsBasicPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DangerousGoodsBasic* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DangerousGoodsBasicPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DangerousGoodsBasicPubSubType::createData() +{ + return reinterpret_cast(new DangerousGoodsBasic()); +} + +void DangerousGoodsBasicPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DangerousGoodsBasicPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.h index 515ef86930b..c27e5f6c7aa 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsBasicPubSubTypes.h @@ -16,29 +16,34 @@ * @file DangerousGoodsBasicPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DangerousGoodsBasic.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DangerousGoodsBasic is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace DangerousGoodsBasic_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace DangerousGoodsBasic_Constants { + + @@ -59,72 +64,114 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type DangerousGoodsBasic defined by the user in the IDL file. - * @ingroup DANGEROUSGOODSBASIC - */ - class DangerousGoodsBasicPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef DangerousGoodsBasic type; - eProsima_user_DllExport DangerousGoodsBasicPubSubType(); - eProsima_user_DllExport virtual ~DangerousGoodsBasicPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DangerousGoodsBasic(); - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + + +} // namespace DangerousGoodsBasic_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type DangerousGoodsBasic defined by the user in the IDL file. + * @ingroup DangerousGoodsBasic + */ +class DangerousGoodsBasicPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef DangerousGoodsBasic type; + + eProsima_user_DllExport DangerousGoodsBasicPubSubType(); + + eProsima_user_DllExport ~DangerousGoodsBasicPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSBASIC_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.cxx index a3fd0ae5863..a67d901602a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.cxx @@ -14,9 +14,9 @@ /*! * @file DangerousGoodsContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,111 +27,75 @@ char dummy; #endif // _WIN32 #include "DangerousGoodsContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::DangerousGoodsContainer::DangerousGoodsContainer() -{ - // m_dangerous_goods_basic com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2970a5bc + +namespace etsi_its_cam_msgs { + +namespace msg { + +DangerousGoodsContainer::DangerousGoodsContainer() +{ } -etsi_its_cam_msgs::msg::DangerousGoodsContainer::~DangerousGoodsContainer() +DangerousGoodsContainer::~DangerousGoodsContainer() { } -etsi_its_cam_msgs::msg::DangerousGoodsContainer::DangerousGoodsContainer( +DangerousGoodsContainer::DangerousGoodsContainer( const DangerousGoodsContainer& x) { m_dangerous_goods_basic = x.m_dangerous_goods_basic; } -etsi_its_cam_msgs::msg::DangerousGoodsContainer::DangerousGoodsContainer( - DangerousGoodsContainer&& x) +DangerousGoodsContainer::DangerousGoodsContainer( + DangerousGoodsContainer&& x) noexcept { m_dangerous_goods_basic = std::move(x.m_dangerous_goods_basic); } -etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::DangerousGoodsContainer::operator =( +DangerousGoodsContainer& DangerousGoodsContainer::operator =( const DangerousGoodsContainer& x) { m_dangerous_goods_basic = x.m_dangerous_goods_basic; - return *this; } -etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::DangerousGoodsContainer::operator =( - DangerousGoodsContainer&& x) +DangerousGoodsContainer& DangerousGoodsContainer::operator =( + DangerousGoodsContainer&& x) noexcept { m_dangerous_goods_basic = std::move(x.m_dangerous_goods_basic); - return *this; } -bool etsi_its_cam_msgs::msg::DangerousGoodsContainer::operator ==( +bool DangerousGoodsContainer::operator ==( const DangerousGoodsContainer& x) const { - return (m_dangerous_goods_basic == x.m_dangerous_goods_basic); } -bool etsi_its_cam_msgs::msg::DangerousGoodsContainer::operator !=( +bool DangerousGoodsContainer::operator !=( const DangerousGoodsContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::DangerousGoodsContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::DangerousGoodsBasic::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::DangerousGoodsContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DangerousGoodsContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::DangerousGoodsBasic::getCdrSerializedSize(data.dangerous_goods_basic(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::DangerousGoodsContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_dangerous_goods_basic; - -} - -void etsi_its_cam_msgs::msg::DangerousGoodsContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_dangerous_goods_basic; -} - /*! * @brief This function copies the value in member dangerous_goods_basic * @param _dangerous_goods_basic New value to be copied in member dangerous_goods_basic */ -void etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic( +void DangerousGoodsContainer::dangerous_goods_basic( const etsi_its_cam_msgs::msg::DangerousGoodsBasic& _dangerous_goods_basic) { m_dangerous_goods_basic = _dangerous_goods_basic; @@ -141,7 +105,7 @@ void etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic( * @brief This function moves the value in member dangerous_goods_basic * @param _dangerous_goods_basic New value to be moved in member dangerous_goods_basic */ -void etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic( +void DangerousGoodsContainer::dangerous_goods_basic( etsi_its_cam_msgs::msg::DangerousGoodsBasic&& _dangerous_goods_basic) { m_dangerous_goods_basic = std::move(_dangerous_goods_basic); @@ -151,7 +115,7 @@ void etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic( * @brief This function returns a constant reference to member dangerous_goods_basic * @return Constant reference to member dangerous_goods_basic */ -const etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic() const +const etsi_its_cam_msgs::msg::DangerousGoodsBasic& DangerousGoodsContainer::dangerous_goods_basic() const { return m_dangerous_goods_basic; } @@ -160,31 +124,18 @@ const etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::Dange * @brief This function returns a reference to member dangerous_goods_basic * @return Reference to member dangerous_goods_basic */ -etsi_its_cam_msgs::msg::DangerousGoodsBasic& etsi_its_cam_msgs::msg::DangerousGoodsContainer::dangerous_goods_basic() +etsi_its_cam_msgs::msg::DangerousGoodsBasic& DangerousGoodsContainer::dangerous_goods_basic() { return m_dangerous_goods_basic; } -size_t etsi_its_cam_msgs::msg::DangerousGoodsContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::DangerousGoodsContainer::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::DangerousGoodsContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DangerousGoodsContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.h index d4ba1a7263d..7fef171a26d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainer.h @@ -16,20 +16,25 @@ * @file DangerousGoodsContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_H_ -#include "DangerousGoodsBasic.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "DangerousGoodsBasic.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DangerousGoodsContainer_SOURCE) -#define DangerousGoodsContainer_DllAPI __declspec( dllexport ) +#if defined(DANGEROUSGOODSCONTAINER_SOURCE) +#define DANGEROUSGOODSCONTAINER_DllAPI __declspec( dllexport ) #else -#define DangerousGoodsContainer_DllAPI __declspec( dllimport ) -#endif // DangerousGoodsContainer_SOURCE +#define DANGEROUSGOODSCONTAINER_DllAPI __declspec( dllimport ) +#endif // DANGEROUSGOODSCONTAINER_SOURCE #else -#define DangerousGoodsContainer_DllAPI +#define DANGEROUSGOODSCONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DangerousGoodsContainer_DllAPI +#define DANGEROUSGOODSCONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure DangerousGoodsContainer defined by the user in the IDL file. - * @ingroup DANGEROUSGOODSCONTAINER - */ - class DangerousGoodsContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DangerousGoodsContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DangerousGoodsContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. - */ - eProsima_user_DllExport DangerousGoodsContainer( - const DangerousGoodsContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. - */ - eProsima_user_DllExport DangerousGoodsContainer( - DangerousGoodsContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. - */ - eProsima_user_DllExport DangerousGoodsContainer& operator =( - const DangerousGoodsContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. - */ - eProsima_user_DllExport DangerousGoodsContainer& operator =( - DangerousGoodsContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DangerousGoodsContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DangerousGoodsContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DangerousGoodsContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DangerousGoodsContainer& x) const; - - /*! - * @brief This function copies the value in member dangerous_goods_basic - * @param _dangerous_goods_basic New value to be copied in member dangerous_goods_basic - */ - eProsima_user_DllExport void dangerous_goods_basic( - const etsi_its_cam_msgs::msg::DangerousGoodsBasic& _dangerous_goods_basic); - - /*! - * @brief This function moves the value in member dangerous_goods_basic - * @param _dangerous_goods_basic New value to be moved in member dangerous_goods_basic - */ - eProsima_user_DllExport void dangerous_goods_basic( - etsi_its_cam_msgs::msg::DangerousGoodsBasic&& _dangerous_goods_basic); - - /*! - * @brief This function returns a constant reference to member dangerous_goods_basic - * @return Constant reference to member dangerous_goods_basic - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::DangerousGoodsBasic& dangerous_goods_basic() const; - - /*! - * @brief This function returns a reference to member dangerous_goods_basic - * @return Reference to member dangerous_goods_basic - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::DangerousGoodsBasic& dangerous_goods_basic(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DangerousGoodsContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::DangerousGoodsBasic m_dangerous_goods_basic; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure DangerousGoodsContainer defined by the user in the IDL file. + * @ingroup DangerousGoodsContainer + */ +class DangerousGoodsContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DangerousGoodsContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DangerousGoodsContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. + */ + eProsima_user_DllExport DangerousGoodsContainer( + const DangerousGoodsContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. + */ + eProsima_user_DllExport DangerousGoodsContainer( + DangerousGoodsContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. + */ + eProsima_user_DllExport DangerousGoodsContainer& operator =( + const DangerousGoodsContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DangerousGoodsContainer that will be copied. + */ + eProsima_user_DllExport DangerousGoodsContainer& operator =( + DangerousGoodsContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DangerousGoodsContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DangerousGoodsContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DangerousGoodsContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DangerousGoodsContainer& x) const; + + /*! + * @brief This function copies the value in member dangerous_goods_basic + * @param _dangerous_goods_basic New value to be copied in member dangerous_goods_basic + */ + eProsima_user_DllExport void dangerous_goods_basic( + const etsi_its_cam_msgs::msg::DangerousGoodsBasic& _dangerous_goods_basic); + + /*! + * @brief This function moves the value in member dangerous_goods_basic + * @param _dangerous_goods_basic New value to be moved in member dangerous_goods_basic + */ + eProsima_user_DllExport void dangerous_goods_basic( + etsi_its_cam_msgs::msg::DangerousGoodsBasic&& _dangerous_goods_basic); + + /*! + * @brief This function returns a constant reference to member dangerous_goods_basic + * @return Constant reference to member dangerous_goods_basic + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DangerousGoodsBasic& dangerous_goods_basic() const; + + /*! + * @brief This function returns a reference to member dangerous_goods_basic + * @return Reference to member dangerous_goods_basic + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DangerousGoodsBasic& dangerous_goods_basic(); + +private: + + etsi_its_cam_msgs::msg::DangerousGoodsBasic m_dangerous_goods_basic; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerCdrAux.hpp new file mode 100644 index 00000000000..24bb4ff43d5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINERCDRAUX_HPP_ + +#include "DangerousGoodsContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_DangerousGoodsContainer_max_cdr_typesize {9UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_DangerousGoodsContainer_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerCdrAux.ipp new file mode 100644 index 00000000000..94682912338 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerCdrAux.ipp @@ -0,0 +1,130 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DangerousGoodsContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINERCDRAUX_IPP_ + +#include "DangerousGoodsContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.dangerous_goods_basic(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.dangerous_goods_basic() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::DangerousGoodsContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.dangerous_goods_basic(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.cxx index d535ebf3c23..5b93d58eae8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file DangerousGoodsContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DangerousGoodsContainerPubSubTypes.h" +#include "DangerousGoodsContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - DangerousGoodsContainerPubSubType::DangerousGoodsContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::DangerousGoodsContainer_"); - auto type_size = DangerousGoodsContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DangerousGoodsContainer::isKeyDefined(); - size_t keyLength = DangerousGoodsContainer::getKeyMaxCdrSerializedSize() > 16 ? - DangerousGoodsContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DangerousGoodsContainerPubSubType::~DangerousGoodsContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DangerousGoodsContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DangerousGoodsContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DangerousGoodsContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DangerousGoodsContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DangerousGoodsContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DangerousGoodsContainerPubSubType::createData() - { - return reinterpret_cast(new DangerousGoodsContainer()); - } - - void DangerousGoodsContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DangerousGoodsContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DangerousGoodsContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DangerousGoodsContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DangerousGoodsContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +DangerousGoodsContainerPubSubType::DangerousGoodsContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::DangerousGoodsContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DangerousGoodsContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_DangerousGoodsContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DangerousGoodsContainerPubSubType::~DangerousGoodsContainerPubSubType() +{ +} + +bool DangerousGoodsContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DangerousGoodsContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DangerousGoodsContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DangerousGoodsContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DangerousGoodsContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DangerousGoodsContainerPubSubType::createData() +{ + return reinterpret_cast(new DangerousGoodsContainer()); +} + +void DangerousGoodsContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DangerousGoodsContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.h index ca101eaae8d..c0f3d8ed96d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DangerousGoodsContainerPubSubTypes.h @@ -16,92 +16,121 @@ * @file DangerousGoodsContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DangerousGoodsContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "DangerousGoodsBasicPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DangerousGoodsContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type DangerousGoodsContainer defined by the user in the IDL file. + * @ingroup DangerousGoodsContainer + */ +class DangerousGoodsContainerPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type DangerousGoodsContainer defined by the user in the IDL file. - * @ingroup DANGEROUSGOODSCONTAINER - */ - class DangerousGoodsContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef DangerousGoodsContainer type; + typedef DangerousGoodsContainer type; - eProsima_user_DllExport DangerousGoodsContainerPubSubType(); + eProsima_user_DllExport DangerousGoodsContainerPubSubType(); - eProsima_user_DllExport virtual ~DangerousGoodsContainerPubSubType(); + eProsima_user_DllExport ~DangerousGoodsContainerPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DangerousGoodsContainer(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DANGEROUSGOODSCONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.cxx index bf1d8b57db6..8f9389b72a9 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.cxx @@ -14,9 +14,9 @@ /*! * @file DeltaAltitude.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "DeltaAltitude.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace DeltaAltitude_Constants { +} // namespace DeltaAltitude_Constants -etsi_its_cam_msgs::msg::DeltaAltitude::DeltaAltitude() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@bae47a0 - m_value = 0; +DeltaAltitude::DeltaAltitude() +{ } -etsi_its_cam_msgs::msg::DeltaAltitude::~DeltaAltitude() +DeltaAltitude::~DeltaAltitude() { } -etsi_its_cam_msgs::msg::DeltaAltitude::DeltaAltitude( +DeltaAltitude::DeltaAltitude( const DeltaAltitude& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DeltaAltitude::DeltaAltitude( - DeltaAltitude&& x) +DeltaAltitude::DeltaAltitude( + DeltaAltitude&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaAltitude::operator =( +DeltaAltitude& DeltaAltitude::operator =( const DeltaAltitude& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaAltitude::operator =( - DeltaAltitude&& x) +DeltaAltitude& DeltaAltitude::operator =( + DeltaAltitude&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::DeltaAltitude::operator ==( +bool DeltaAltitude::operator ==( const DeltaAltitude& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::DeltaAltitude::operator !=( +bool DeltaAltitude::operator !=( const DeltaAltitude& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::DeltaAltitude::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::DeltaAltitude::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DeltaAltitude& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::DeltaAltitude::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::DeltaAltitude::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::DeltaAltitude::value( +void DeltaAltitude::value( int16_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::DeltaAltitude::value( * @brief This function returns the value of member value * @return Value of member value */ -int16_t etsi_its_cam_msgs::msg::DeltaAltitude::value() const +int16_t DeltaAltitude::value() const { return m_value; } @@ -158,32 +118,18 @@ int16_t etsi_its_cam_msgs::msg::DeltaAltitude::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int16_t& etsi_its_cam_msgs::msg::DeltaAltitude::value() +int16_t& DeltaAltitude::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::DeltaAltitude::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::DeltaAltitude::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::DeltaAltitude::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DeltaAltitudeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.h index a033de2a66e..84b8e14a11b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitude.h @@ -16,19 +16,24 @@ * @file DeltaAltitude.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DeltaAltitude_SOURCE) -#define DeltaAltitude_DllAPI __declspec( dllexport ) +#if defined(DELTAALTITUDE_SOURCE) +#define DELTAALTITUDE_DllAPI __declspec( dllexport ) #else -#define DeltaAltitude_DllAPI __declspec( dllimport ) -#endif // DeltaAltitude_SOURCE +#define DELTAALTITUDE_DllAPI __declspec( dllimport ) +#endif // DELTAALTITUDE_SOURCE #else -#define DeltaAltitude_DllAPI +#define DELTAALTITUDE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DeltaAltitude_DllAPI +#define DELTAALTITUDE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace DeltaAltitude_Constants { - const int16_t MIN = -12700; - const int16_t MAX = 12800; - const int16_t ONE_CENTIMETER_UP = 1; - const int16_t ONE_CENTIMETER_DOWN = -1; - const int16_t UNAVAILABLE = 12800; - } // namespace DeltaAltitude_Constants - /*! - * @brief This class represents the structure DeltaAltitude defined by the user in the IDL file. - * @ingroup DELTAALTITUDE - */ - class DeltaAltitude - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DeltaAltitude(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DeltaAltitude(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. - */ - eProsima_user_DllExport DeltaAltitude( - const DeltaAltitude& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. - */ - eProsima_user_DllExport DeltaAltitude( - DeltaAltitude&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. - */ - eProsima_user_DllExport DeltaAltitude& operator =( - const DeltaAltitude& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. - */ - eProsima_user_DllExport DeltaAltitude& operator =( - DeltaAltitude&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DeltaAltitude object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DeltaAltitude& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DeltaAltitude object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DeltaAltitude& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DeltaAltitude& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace DeltaAltitude_Constants { + +const int16_t MIN = -12700; +const int16_t MAX = 12800; +const int16_t ONE_CENTIMETER_UP = 1; +const int16_t ONE_CENTIMETER_DOWN = -1; +const int16_t UNAVAILABLE = 12800; + +} // namespace DeltaAltitude_Constants + + +/*! + * @brief This class represents the structure DeltaAltitude defined by the user in the IDL file. + * @ingroup DeltaAltitude + */ +class DeltaAltitude +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeltaAltitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeltaAltitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. + */ + eProsima_user_DllExport DeltaAltitude( + const DeltaAltitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. + */ + eProsima_user_DllExport DeltaAltitude( + DeltaAltitude&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. + */ + eProsima_user_DllExport DeltaAltitude& operator =( + const DeltaAltitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaAltitude that will be copied. + */ + eProsima_user_DllExport DeltaAltitude& operator =( + DeltaAltitude&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaAltitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeltaAltitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaAltitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeltaAltitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + +private: + + int16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudeCdrAux.hpp new file mode 100644 index 00000000000..2b2f197b7c4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudeCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaAltitudeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDECDRAUX_HPP_ + +#include "DeltaAltitude.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_DeltaAltitude_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_DeltaAltitude_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaAltitude& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudeCdrAux.ipp new file mode 100644 index 00000000000..1c2d202f9f0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudeCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaAltitudeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDECDRAUX_IPP_ + +#include "DeltaAltitudeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::DeltaAltitude& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaAltitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::DeltaAltitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaAltitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.cxx index 9ceeff8f1ee..560ee7fa9f3 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file DeltaAltitudePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DeltaAltitudePubSubTypes.h" +#include "DeltaAltitudeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace DeltaAltitude_Constants { - - - - - - - } //End of namespace DeltaAltitude_Constants - DeltaAltitudePubSubType::DeltaAltitudePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::DeltaAltitude_"); - auto type_size = DeltaAltitude::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DeltaAltitude::isKeyDefined(); - size_t keyLength = DeltaAltitude::getKeyMaxCdrSerializedSize() > 16 ? - DeltaAltitude::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DeltaAltitudePubSubType::~DeltaAltitudePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DeltaAltitudePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DeltaAltitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DeltaAltitudePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DeltaAltitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DeltaAltitudePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DeltaAltitudePubSubType::createData() - { - return reinterpret_cast(new DeltaAltitude()); - } - - void DeltaAltitudePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DeltaAltitudePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DeltaAltitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DeltaAltitude::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DeltaAltitude::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace DeltaAltitude_Constants { + + + + + + + + + + + +} //End of namespace DeltaAltitude_Constants + + + +DeltaAltitudePubSubType::DeltaAltitudePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::DeltaAltitude_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DeltaAltitude::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_DeltaAltitude_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DeltaAltitudePubSubType::~DeltaAltitudePubSubType() +{ +} + +bool DeltaAltitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DeltaAltitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DeltaAltitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DeltaAltitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DeltaAltitudePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DeltaAltitudePubSubType::createData() +{ + return reinterpret_cast(new DeltaAltitude()); +} + +void DeltaAltitudePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DeltaAltitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.h index ba08c1fc281..e4797122e10 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaAltitudePubSubTypes.h @@ -16,100 +16,132 @@ * @file DeltaAltitudePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DeltaAltitude.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DeltaAltitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace DeltaAltitude_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace DeltaAltitude_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type DeltaAltitude defined by the user in the IDL file. - * @ingroup DELTAALTITUDE - */ - class DeltaAltitudePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef DeltaAltitude type; +} // namespace DeltaAltitude_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type DeltaAltitude defined by the user in the IDL file. + * @ingroup DeltaAltitude + */ +class DeltaAltitudePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef DeltaAltitude type; + + eProsima_user_DllExport DeltaAltitudePubSubType(); - eProsima_user_DllExport DeltaAltitudePubSubType(); + eProsima_user_DllExport ~DeltaAltitudePubSubType() override; - eProsima_user_DllExport virtual ~DeltaAltitudePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DeltaAltitude(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAALTITUDE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.cxx index 2554cd0b344..dae6aee8086 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.cxx @@ -14,9 +14,9 @@ /*! * @file DeltaLatitude.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "DeltaLatitude.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace DeltaLatitude_Constants { +} // namespace DeltaLatitude_Constants -etsi_its_cam_msgs::msg::DeltaLatitude::DeltaLatitude() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3a71c100 - m_value = 0; +DeltaLatitude::DeltaLatitude() +{ } -etsi_its_cam_msgs::msg::DeltaLatitude::~DeltaLatitude() +DeltaLatitude::~DeltaLatitude() { } -etsi_its_cam_msgs::msg::DeltaLatitude::DeltaLatitude( +DeltaLatitude::DeltaLatitude( const DeltaLatitude& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DeltaLatitude::DeltaLatitude( - DeltaLatitude&& x) +DeltaLatitude::DeltaLatitude( + DeltaLatitude&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaLatitude::operator =( +DeltaLatitude& DeltaLatitude::operator =( const DeltaLatitude& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaLatitude::operator =( - DeltaLatitude&& x) +DeltaLatitude& DeltaLatitude::operator =( + DeltaLatitude&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::DeltaLatitude::operator ==( +bool DeltaLatitude::operator ==( const DeltaLatitude& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::DeltaLatitude::operator !=( +bool DeltaLatitude::operator !=( const DeltaLatitude& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::DeltaLatitude::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::DeltaLatitude::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DeltaLatitude& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::DeltaLatitude::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::DeltaLatitude::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::DeltaLatitude::value( +void DeltaLatitude::value( int32_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::DeltaLatitude::value( * @brief This function returns the value of member value * @return Value of member value */ -int32_t etsi_its_cam_msgs::msg::DeltaLatitude::value() const +int32_t DeltaLatitude::value() const { return m_value; } @@ -158,32 +118,18 @@ int32_t etsi_its_cam_msgs::msg::DeltaLatitude::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int32_t& etsi_its_cam_msgs::msg::DeltaLatitude::value() +int32_t& DeltaLatitude::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::DeltaLatitude::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::DeltaLatitude::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::DeltaLatitude::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DeltaLatitudeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.h index 1d88654a54b..eb36579c768 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitude.h @@ -16,19 +16,24 @@ * @file DeltaLatitude.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DeltaLatitude_SOURCE) -#define DeltaLatitude_DllAPI __declspec( dllexport ) +#if defined(DELTALATITUDE_SOURCE) +#define DELTALATITUDE_DllAPI __declspec( dllexport ) #else -#define DeltaLatitude_DllAPI __declspec( dllimport ) -#endif // DeltaLatitude_SOURCE +#define DELTALATITUDE_DllAPI __declspec( dllimport ) +#endif // DELTALATITUDE_SOURCE #else -#define DeltaLatitude_DllAPI +#define DELTALATITUDE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DeltaLatitude_DllAPI +#define DELTALATITUDE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace DeltaLatitude_Constants { - const int32_t MIN = -131071; - const int32_t MAX = 131072; - const int32_t ONE_MICRODEGREE_NORTH = 10; - const int32_t ONE_MICRODEGREE_SOUTH = -10; - const int32_t UNAVAILABLE = 131072; - } // namespace DeltaLatitude_Constants - /*! - * @brief This class represents the structure DeltaLatitude defined by the user in the IDL file. - * @ingroup DELTALATITUDE - */ - class DeltaLatitude - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DeltaLatitude(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DeltaLatitude(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. - */ - eProsima_user_DllExport DeltaLatitude( - const DeltaLatitude& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. - */ - eProsima_user_DllExport DeltaLatitude( - DeltaLatitude&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. - */ - eProsima_user_DllExport DeltaLatitude& operator =( - const DeltaLatitude& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. - */ - eProsima_user_DllExport DeltaLatitude& operator =( - DeltaLatitude&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DeltaLatitude object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DeltaLatitude& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DeltaLatitude object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DeltaLatitude& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int32_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int32_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int32_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DeltaLatitude& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int32_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace DeltaLatitude_Constants { + +const int32_t MIN = -131071; +const int32_t MAX = 131072; +const int32_t ONE_MICRODEGREE_NORTH = 10; +const int32_t ONE_MICRODEGREE_SOUTH = -10; +const int32_t UNAVAILABLE = 131072; + +} // namespace DeltaLatitude_Constants + + +/*! + * @brief This class represents the structure DeltaLatitude defined by the user in the IDL file. + * @ingroup DeltaLatitude + */ +class DeltaLatitude +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeltaLatitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeltaLatitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. + */ + eProsima_user_DllExport DeltaLatitude( + const DeltaLatitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. + */ + eProsima_user_DllExport DeltaLatitude( + DeltaLatitude&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. + */ + eProsima_user_DllExport DeltaLatitude& operator =( + const DeltaLatitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLatitude that will be copied. + */ + eProsima_user_DllExport DeltaLatitude& operator =( + DeltaLatitude&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaLatitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeltaLatitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaLatitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeltaLatitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + +private: + + int32_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudeCdrAux.hpp new file mode 100644 index 00000000000..630d2451811 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudeCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLatitudeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDECDRAUX_HPP_ + +#include "DeltaLatitude.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_DeltaLatitude_max_cdr_typesize {8UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_DeltaLatitude_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaLatitude& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudeCdrAux.ipp new file mode 100644 index 00000000000..d73b6189966 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudeCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLatitudeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDECDRAUX_IPP_ + +#include "DeltaLatitudeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::DeltaLatitude& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaLatitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::DeltaLatitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaLatitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.cxx index 52d49bf7fd5..0603d93f815 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file DeltaLatitudePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DeltaLatitudePubSubTypes.h" +#include "DeltaLatitudeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace DeltaLatitude_Constants { - - - - - - - } //End of namespace DeltaLatitude_Constants - DeltaLatitudePubSubType::DeltaLatitudePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::DeltaLatitude_"); - auto type_size = DeltaLatitude::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DeltaLatitude::isKeyDefined(); - size_t keyLength = DeltaLatitude::getKeyMaxCdrSerializedSize() > 16 ? - DeltaLatitude::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DeltaLatitudePubSubType::~DeltaLatitudePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DeltaLatitudePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DeltaLatitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DeltaLatitudePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DeltaLatitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DeltaLatitudePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DeltaLatitudePubSubType::createData() - { - return reinterpret_cast(new DeltaLatitude()); - } - - void DeltaLatitudePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DeltaLatitudePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DeltaLatitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DeltaLatitude::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DeltaLatitude::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace DeltaLatitude_Constants { + + + + + + + + + + + +} //End of namespace DeltaLatitude_Constants + + + +DeltaLatitudePubSubType::DeltaLatitudePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::DeltaLatitude_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DeltaLatitude::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_DeltaLatitude_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DeltaLatitudePubSubType::~DeltaLatitudePubSubType() +{ +} + +bool DeltaLatitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DeltaLatitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DeltaLatitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DeltaLatitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DeltaLatitudePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DeltaLatitudePubSubType::createData() +{ + return reinterpret_cast(new DeltaLatitude()); +} + +void DeltaLatitudePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DeltaLatitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.h index e20b6656498..a9ceb44747d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLatitudePubSubTypes.h @@ -16,100 +16,132 @@ * @file DeltaLatitudePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DeltaLatitude.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DeltaLatitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace DeltaLatitude_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace DeltaLatitude_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type DeltaLatitude defined by the user in the IDL file. - * @ingroup DELTALATITUDE - */ - class DeltaLatitudePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef DeltaLatitude type; +} // namespace DeltaLatitude_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type DeltaLatitude defined by the user in the IDL file. + * @ingroup DeltaLatitude + */ +class DeltaLatitudePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef DeltaLatitude type; + + eProsima_user_DllExport DeltaLatitudePubSubType(); - eProsima_user_DllExport DeltaLatitudePubSubType(); + eProsima_user_DllExport ~DeltaLatitudePubSubType() override; - eProsima_user_DllExport virtual ~DeltaLatitudePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DeltaLatitude(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALATITUDE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.cxx index 8c1e526a6d4..4364211d349 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.cxx @@ -14,9 +14,9 @@ /*! * @file DeltaLongitude.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "DeltaLongitude.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace DeltaLongitude_Constants { +} // namespace DeltaLongitude_Constants -etsi_its_cam_msgs::msg::DeltaLongitude::DeltaLongitude() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@26d10f2e - m_value = 0; +DeltaLongitude::DeltaLongitude() +{ } -etsi_its_cam_msgs::msg::DeltaLongitude::~DeltaLongitude() +DeltaLongitude::~DeltaLongitude() { } -etsi_its_cam_msgs::msg::DeltaLongitude::DeltaLongitude( +DeltaLongitude::DeltaLongitude( const DeltaLongitude& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DeltaLongitude::DeltaLongitude( - DeltaLongitude&& x) +DeltaLongitude::DeltaLongitude( + DeltaLongitude&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaLongitude::operator =( +DeltaLongitude& DeltaLongitude::operator =( const DeltaLongitude& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaLongitude::operator =( - DeltaLongitude&& x) +DeltaLongitude& DeltaLongitude::operator =( + DeltaLongitude&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::DeltaLongitude::operator ==( +bool DeltaLongitude::operator ==( const DeltaLongitude& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::DeltaLongitude::operator !=( +bool DeltaLongitude::operator !=( const DeltaLongitude& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::DeltaLongitude::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::DeltaLongitude::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DeltaLongitude& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::DeltaLongitude::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::DeltaLongitude::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::DeltaLongitude::value( +void DeltaLongitude::value( int32_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::DeltaLongitude::value( * @brief This function returns the value of member value * @return Value of member value */ -int32_t etsi_its_cam_msgs::msg::DeltaLongitude::value() const +int32_t DeltaLongitude::value() const { return m_value; } @@ -158,32 +118,18 @@ int32_t etsi_its_cam_msgs::msg::DeltaLongitude::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int32_t& etsi_its_cam_msgs::msg::DeltaLongitude::value() +int32_t& DeltaLongitude::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::DeltaLongitude::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::DeltaLongitude::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::DeltaLongitude::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DeltaLongitudeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.h index 26139eacc05..b20a185286b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitude.h @@ -16,19 +16,24 @@ * @file DeltaLongitude.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DeltaLongitude_SOURCE) -#define DeltaLongitude_DllAPI __declspec( dllexport ) +#if defined(DELTALONGITUDE_SOURCE) +#define DELTALONGITUDE_DllAPI __declspec( dllexport ) #else -#define DeltaLongitude_DllAPI __declspec( dllimport ) -#endif // DeltaLongitude_SOURCE +#define DELTALONGITUDE_DllAPI __declspec( dllimport ) +#endif // DELTALONGITUDE_SOURCE #else -#define DeltaLongitude_DllAPI +#define DELTALONGITUDE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DeltaLongitude_DllAPI +#define DELTALONGITUDE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace DeltaLongitude_Constants { - const int32_t MIN = -131071; - const int32_t MAX = 131072; - const int32_t ONE_MICRODEGREE_EAST = 10; - const int32_t ONE_MICRODEGREE_WEST = -10; - const int32_t UNAVAILABLE = 131072; - } // namespace DeltaLongitude_Constants - /*! - * @brief This class represents the structure DeltaLongitude defined by the user in the IDL file. - * @ingroup DELTALONGITUDE - */ - class DeltaLongitude - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DeltaLongitude(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DeltaLongitude(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. - */ - eProsima_user_DllExport DeltaLongitude( - const DeltaLongitude& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. - */ - eProsima_user_DllExport DeltaLongitude( - DeltaLongitude&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. - */ - eProsima_user_DllExport DeltaLongitude& operator =( - const DeltaLongitude& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. - */ - eProsima_user_DllExport DeltaLongitude& operator =( - DeltaLongitude&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DeltaLongitude object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DeltaLongitude& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DeltaLongitude object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DeltaLongitude& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int32_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int32_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int32_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DeltaLongitude& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int32_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace DeltaLongitude_Constants { + +const int32_t MIN = -131071; +const int32_t MAX = 131072; +const int32_t ONE_MICRODEGREE_EAST = 10; +const int32_t ONE_MICRODEGREE_WEST = -10; +const int32_t UNAVAILABLE = 131072; + +} // namespace DeltaLongitude_Constants + + +/*! + * @brief This class represents the structure DeltaLongitude defined by the user in the IDL file. + * @ingroup DeltaLongitude + */ +class DeltaLongitude +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeltaLongitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeltaLongitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. + */ + eProsima_user_DllExport DeltaLongitude( + const DeltaLongitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. + */ + eProsima_user_DllExport DeltaLongitude( + DeltaLongitude&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. + */ + eProsima_user_DllExport DeltaLongitude& operator =( + const DeltaLongitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaLongitude that will be copied. + */ + eProsima_user_DllExport DeltaLongitude& operator =( + DeltaLongitude&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaLongitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeltaLongitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaLongitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeltaLongitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + +private: + + int32_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudeCdrAux.hpp new file mode 100644 index 00000000000..7f02c930af5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudeCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLongitudeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDECDRAUX_HPP_ + +#include "DeltaLongitude.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_DeltaLongitude_max_cdr_typesize {8UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_DeltaLongitude_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaLongitude& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudeCdrAux.ipp new file mode 100644 index 00000000000..69fc42a8758 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudeCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaLongitudeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDECDRAUX_IPP_ + +#include "DeltaLongitudeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::DeltaLongitude& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaLongitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::DeltaLongitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaLongitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.cxx index bd386e71f01..4c8afc70392 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file DeltaLongitudePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DeltaLongitudePubSubTypes.h" +#include "DeltaLongitudeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace DeltaLongitude_Constants { - - - - - - - } //End of namespace DeltaLongitude_Constants - DeltaLongitudePubSubType::DeltaLongitudePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::DeltaLongitude_"); - auto type_size = DeltaLongitude::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DeltaLongitude::isKeyDefined(); - size_t keyLength = DeltaLongitude::getKeyMaxCdrSerializedSize() > 16 ? - DeltaLongitude::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DeltaLongitudePubSubType::~DeltaLongitudePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DeltaLongitudePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DeltaLongitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DeltaLongitudePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DeltaLongitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DeltaLongitudePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DeltaLongitudePubSubType::createData() - { - return reinterpret_cast(new DeltaLongitude()); - } - - void DeltaLongitudePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DeltaLongitudePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DeltaLongitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DeltaLongitude::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DeltaLongitude::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace DeltaLongitude_Constants { + + + + + + + + + + + +} //End of namespace DeltaLongitude_Constants + + + +DeltaLongitudePubSubType::DeltaLongitudePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::DeltaLongitude_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DeltaLongitude::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_DeltaLongitude_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DeltaLongitudePubSubType::~DeltaLongitudePubSubType() +{ +} + +bool DeltaLongitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DeltaLongitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DeltaLongitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DeltaLongitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DeltaLongitudePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DeltaLongitudePubSubType::createData() +{ + return reinterpret_cast(new DeltaLongitude()); +} + +void DeltaLongitudePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DeltaLongitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.h index cfe9901a5e7..b86543f6b2e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaLongitudePubSubTypes.h @@ -16,100 +16,132 @@ * @file DeltaLongitudePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DeltaLongitude.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DeltaLongitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace DeltaLongitude_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace DeltaLongitude_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type DeltaLongitude defined by the user in the IDL file. - * @ingroup DELTALONGITUDE - */ - class DeltaLongitudePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef DeltaLongitude type; +} // namespace DeltaLongitude_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type DeltaLongitude defined by the user in the IDL file. + * @ingroup DeltaLongitude + */ +class DeltaLongitudePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef DeltaLongitude type; + + eProsima_user_DllExport DeltaLongitudePubSubType(); - eProsima_user_DllExport DeltaLongitudePubSubType(); + eProsima_user_DllExport ~DeltaLongitudePubSubType() override; - eProsima_user_DllExport virtual ~DeltaLongitudePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DeltaLongitude(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTALONGITUDE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.cxx index 67bf0d0c59e..1e7359782c6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.cxx @@ -14,9 +14,9 @@ /*! * @file DeltaReferencePosition.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "DeltaReferencePosition.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::DeltaReferencePosition::DeltaReferencePosition() -{ - // m_delta_latitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@42deb43a - // m_delta_longitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1deb2c43 +namespace etsi_its_cam_msgs { - // m_delta_altitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3bb9efbc +namespace msg { -} -etsi_its_cam_msgs::msg::DeltaReferencePosition::~DeltaReferencePosition() +DeltaReferencePosition::DeltaReferencePosition() { +} - +DeltaReferencePosition::~DeltaReferencePosition() +{ } -etsi_its_cam_msgs::msg::DeltaReferencePosition::DeltaReferencePosition( +DeltaReferencePosition::DeltaReferencePosition( const DeltaReferencePosition& x) { m_delta_latitude = x.m_delta_latitude; @@ -59,101 +59,53 @@ etsi_its_cam_msgs::msg::DeltaReferencePosition::DeltaReferencePosition( m_delta_altitude = x.m_delta_altitude; } -etsi_its_cam_msgs::msg::DeltaReferencePosition::DeltaReferencePosition( - DeltaReferencePosition&& x) +DeltaReferencePosition::DeltaReferencePosition( + DeltaReferencePosition&& x) noexcept { m_delta_latitude = std::move(x.m_delta_latitude); m_delta_longitude = std::move(x.m_delta_longitude); m_delta_altitude = std::move(x.m_delta_altitude); } -etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::DeltaReferencePosition::operator =( +DeltaReferencePosition& DeltaReferencePosition::operator =( const DeltaReferencePosition& x) { m_delta_latitude = x.m_delta_latitude; m_delta_longitude = x.m_delta_longitude; m_delta_altitude = x.m_delta_altitude; - return *this; } -etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::DeltaReferencePosition::operator =( - DeltaReferencePosition&& x) +DeltaReferencePosition& DeltaReferencePosition::operator =( + DeltaReferencePosition&& x) noexcept { m_delta_latitude = std::move(x.m_delta_latitude); m_delta_longitude = std::move(x.m_delta_longitude); m_delta_altitude = std::move(x.m_delta_altitude); - return *this; } -bool etsi_its_cam_msgs::msg::DeltaReferencePosition::operator ==( +bool DeltaReferencePosition::operator ==( const DeltaReferencePosition& x) const { - - return (m_delta_latitude == x.m_delta_latitude && m_delta_longitude == x.m_delta_longitude && m_delta_altitude == x.m_delta_altitude); + return (m_delta_latitude == x.m_delta_latitude && + m_delta_longitude == x.m_delta_longitude && + m_delta_altitude == x.m_delta_altitude); } -bool etsi_its_cam_msgs::msg::DeltaReferencePosition::operator !=( +bool DeltaReferencePosition::operator !=( const DeltaReferencePosition& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::DeltaReferencePosition::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::DeltaLatitude::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::DeltaLongitude::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::DeltaAltitude::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::DeltaReferencePosition::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DeltaReferencePosition& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::DeltaLatitude::getCdrSerializedSize(data.delta_latitude(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::DeltaLongitude::getCdrSerializedSize(data.delta_longitude(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::DeltaAltitude::getCdrSerializedSize(data.delta_altitude(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::DeltaReferencePosition::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_delta_latitude; - scdr << m_delta_longitude; - scdr << m_delta_altitude; - -} - -void etsi_its_cam_msgs::msg::DeltaReferencePosition::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_delta_latitude; - dcdr >> m_delta_longitude; - dcdr >> m_delta_altitude; -} - /*! * @brief This function copies the value in member delta_latitude * @param _delta_latitude New value to be copied in member delta_latitude */ -void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude( +void DeltaReferencePosition::delta_latitude( const etsi_its_cam_msgs::msg::DeltaLatitude& _delta_latitude) { m_delta_latitude = _delta_latitude; @@ -163,7 +115,7 @@ void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude( * @brief This function moves the value in member delta_latitude * @param _delta_latitude New value to be moved in member delta_latitude */ -void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude( +void DeltaReferencePosition::delta_latitude( etsi_its_cam_msgs::msg::DeltaLatitude&& _delta_latitude) { m_delta_latitude = std::move(_delta_latitude); @@ -173,7 +125,7 @@ void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude( * @brief This function returns a constant reference to member delta_latitude * @return Constant reference to member delta_latitude */ -const etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude() const +const etsi_its_cam_msgs::msg::DeltaLatitude& DeltaReferencePosition::delta_latitude() const { return m_delta_latitude; } @@ -182,15 +134,17 @@ const etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaRefere * @brief This function returns a reference to member delta_latitude * @return Reference to member delta_latitude */ -etsi_its_cam_msgs::msg::DeltaLatitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_latitude() +etsi_its_cam_msgs::msg::DeltaLatitude& DeltaReferencePosition::delta_latitude() { return m_delta_latitude; } + + /*! * @brief This function copies the value in member delta_longitude * @param _delta_longitude New value to be copied in member delta_longitude */ -void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude( +void DeltaReferencePosition::delta_longitude( const etsi_its_cam_msgs::msg::DeltaLongitude& _delta_longitude) { m_delta_longitude = _delta_longitude; @@ -200,7 +154,7 @@ void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude( * @brief This function moves the value in member delta_longitude * @param _delta_longitude New value to be moved in member delta_longitude */ -void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude( +void DeltaReferencePosition::delta_longitude( etsi_its_cam_msgs::msg::DeltaLongitude&& _delta_longitude) { m_delta_longitude = std::move(_delta_longitude); @@ -210,7 +164,7 @@ void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude( * @brief This function returns a constant reference to member delta_longitude * @return Constant reference to member delta_longitude */ -const etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude() const +const etsi_its_cam_msgs::msg::DeltaLongitude& DeltaReferencePosition::delta_longitude() const { return m_delta_longitude; } @@ -219,15 +173,17 @@ const etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaRefer * @brief This function returns a reference to member delta_longitude * @return Reference to member delta_longitude */ -etsi_its_cam_msgs::msg::DeltaLongitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_longitude() +etsi_its_cam_msgs::msg::DeltaLongitude& DeltaReferencePosition::delta_longitude() { return m_delta_longitude; } + + /*! * @brief This function copies the value in member delta_altitude * @param _delta_altitude New value to be copied in member delta_altitude */ -void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude( +void DeltaReferencePosition::delta_altitude( const etsi_its_cam_msgs::msg::DeltaAltitude& _delta_altitude) { m_delta_altitude = _delta_altitude; @@ -237,7 +193,7 @@ void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude( * @brief This function moves the value in member delta_altitude * @param _delta_altitude New value to be moved in member delta_altitude */ -void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude( +void DeltaReferencePosition::delta_altitude( etsi_its_cam_msgs::msg::DeltaAltitude&& _delta_altitude) { m_delta_altitude = std::move(_delta_altitude); @@ -247,7 +203,7 @@ void etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude( * @brief This function returns a constant reference to member delta_altitude * @return Constant reference to member delta_altitude */ -const etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude() const +const etsi_its_cam_msgs::msg::DeltaAltitude& DeltaReferencePosition::delta_altitude() const { return m_delta_altitude; } @@ -256,31 +212,18 @@ const etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaRefere * @brief This function returns a reference to member delta_altitude * @return Reference to member delta_altitude */ -etsi_its_cam_msgs::msg::DeltaAltitude& etsi_its_cam_msgs::msg::DeltaReferencePosition::delta_altitude() +etsi_its_cam_msgs::msg::DeltaAltitude& DeltaReferencePosition::delta_altitude() { return m_delta_altitude; } -size_t etsi_its_cam_msgs::msg::DeltaReferencePosition::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::DeltaReferencePosition::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::DeltaReferencePosition::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DeltaReferencePositionCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.h index ce2a1c5045b..6e1ddd13440 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePosition.h @@ -16,22 +16,27 @@ * @file DeltaReferencePosition.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "DeltaLongitude.h" #include "DeltaAltitude.h" #include "DeltaLatitude.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -45,227 +50,186 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DeltaReferencePosition_SOURCE) -#define DeltaReferencePosition_DllAPI __declspec( dllexport ) +#if defined(DELTAREFERENCEPOSITION_SOURCE) +#define DELTAREFERENCEPOSITION_DllAPI __declspec( dllexport ) #else -#define DeltaReferencePosition_DllAPI __declspec( dllimport ) -#endif // DeltaReferencePosition_SOURCE +#define DELTAREFERENCEPOSITION_DllAPI __declspec( dllimport ) +#endif // DELTAREFERENCEPOSITION_SOURCE #else -#define DeltaReferencePosition_DllAPI +#define DELTAREFERENCEPOSITION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DeltaReferencePosition_DllAPI +#define DELTAREFERENCEPOSITION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure DeltaReferencePosition defined by the user in the IDL file. - * @ingroup DELTAREFERENCEPOSITION - */ - class DeltaReferencePosition - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DeltaReferencePosition(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DeltaReferencePosition(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. - */ - eProsima_user_DllExport DeltaReferencePosition( - const DeltaReferencePosition& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. - */ - eProsima_user_DllExport DeltaReferencePosition( - DeltaReferencePosition&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. - */ - eProsima_user_DllExport DeltaReferencePosition& operator =( - const DeltaReferencePosition& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. - */ - eProsima_user_DllExport DeltaReferencePosition& operator =( - DeltaReferencePosition&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DeltaReferencePosition object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DeltaReferencePosition& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DeltaReferencePosition object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DeltaReferencePosition& x) const; - - /*! - * @brief This function copies the value in member delta_latitude - * @param _delta_latitude New value to be copied in member delta_latitude - */ - eProsima_user_DllExport void delta_latitude( - const etsi_its_cam_msgs::msg::DeltaLatitude& _delta_latitude); - - /*! - * @brief This function moves the value in member delta_latitude - * @param _delta_latitude New value to be moved in member delta_latitude - */ - eProsima_user_DllExport void delta_latitude( - etsi_its_cam_msgs::msg::DeltaLatitude&& _delta_latitude); - - /*! - * @brief This function returns a constant reference to member delta_latitude - * @return Constant reference to member delta_latitude - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaLatitude& delta_latitude() const; - - /*! - * @brief This function returns a reference to member delta_latitude - * @return Reference to member delta_latitude - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaLatitude& delta_latitude(); - /*! - * @brief This function copies the value in member delta_longitude - * @param _delta_longitude New value to be copied in member delta_longitude - */ - eProsima_user_DllExport void delta_longitude( - const etsi_its_cam_msgs::msg::DeltaLongitude& _delta_longitude); - - /*! - * @brief This function moves the value in member delta_longitude - * @param _delta_longitude New value to be moved in member delta_longitude - */ - eProsima_user_DllExport void delta_longitude( - etsi_its_cam_msgs::msg::DeltaLongitude&& _delta_longitude); - - /*! - * @brief This function returns a constant reference to member delta_longitude - * @return Constant reference to member delta_longitude - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaLongitude& delta_longitude() const; - - /*! - * @brief This function returns a reference to member delta_longitude - * @return Reference to member delta_longitude - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaLongitude& delta_longitude(); - /*! - * @brief This function copies the value in member delta_altitude - * @param _delta_altitude New value to be copied in member delta_altitude - */ - eProsima_user_DllExport void delta_altitude( - const etsi_its_cam_msgs::msg::DeltaAltitude& _delta_altitude); - - /*! - * @brief This function moves the value in member delta_altitude - * @param _delta_altitude New value to be moved in member delta_altitude - */ - eProsima_user_DllExport void delta_altitude( - etsi_its_cam_msgs::msg::DeltaAltitude&& _delta_altitude); - - /*! - * @brief This function returns a constant reference to member delta_altitude - * @return Constant reference to member delta_altitude - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaAltitude& delta_altitude() const; - - /*! - * @brief This function returns a reference to member delta_altitude - * @return Reference to member delta_altitude - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaAltitude& delta_altitude(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DeltaReferencePosition& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::DeltaLatitude m_delta_latitude; - etsi_its_cam_msgs::msg::DeltaLongitude m_delta_longitude; - etsi_its_cam_msgs::msg::DeltaAltitude m_delta_altitude; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure DeltaReferencePosition defined by the user in the IDL file. + * @ingroup DeltaReferencePosition + */ +class DeltaReferencePosition +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeltaReferencePosition(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeltaReferencePosition(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. + */ + eProsima_user_DllExport DeltaReferencePosition( + const DeltaReferencePosition& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. + */ + eProsima_user_DllExport DeltaReferencePosition( + DeltaReferencePosition&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. + */ + eProsima_user_DllExport DeltaReferencePosition& operator =( + const DeltaReferencePosition& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DeltaReferencePosition that will be copied. + */ + eProsima_user_DllExport DeltaReferencePosition& operator =( + DeltaReferencePosition&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaReferencePosition object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeltaReferencePosition& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DeltaReferencePosition object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeltaReferencePosition& x) const; + + /*! + * @brief This function copies the value in member delta_latitude + * @param _delta_latitude New value to be copied in member delta_latitude + */ + eProsima_user_DllExport void delta_latitude( + const etsi_its_cam_msgs::msg::DeltaLatitude& _delta_latitude); + + /*! + * @brief This function moves the value in member delta_latitude + * @param _delta_latitude New value to be moved in member delta_latitude + */ + eProsima_user_DllExport void delta_latitude( + etsi_its_cam_msgs::msg::DeltaLatitude&& _delta_latitude); + + /*! + * @brief This function returns a constant reference to member delta_latitude + * @return Constant reference to member delta_latitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaLatitude& delta_latitude() const; + + /*! + * @brief This function returns a reference to member delta_latitude + * @return Reference to member delta_latitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaLatitude& delta_latitude(); + + + /*! + * @brief This function copies the value in member delta_longitude + * @param _delta_longitude New value to be copied in member delta_longitude + */ + eProsima_user_DllExport void delta_longitude( + const etsi_its_cam_msgs::msg::DeltaLongitude& _delta_longitude); + + /*! + * @brief This function moves the value in member delta_longitude + * @param _delta_longitude New value to be moved in member delta_longitude + */ + eProsima_user_DllExport void delta_longitude( + etsi_its_cam_msgs::msg::DeltaLongitude&& _delta_longitude); + + /*! + * @brief This function returns a constant reference to member delta_longitude + * @return Constant reference to member delta_longitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaLongitude& delta_longitude() const; + + /*! + * @brief This function returns a reference to member delta_longitude + * @return Reference to member delta_longitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaLongitude& delta_longitude(); + + + /*! + * @brief This function copies the value in member delta_altitude + * @param _delta_altitude New value to be copied in member delta_altitude + */ + eProsima_user_DllExport void delta_altitude( + const etsi_its_cam_msgs::msg::DeltaAltitude& _delta_altitude); + + /*! + * @brief This function moves the value in member delta_altitude + * @param _delta_altitude New value to be moved in member delta_altitude + */ + eProsima_user_DllExport void delta_altitude( + etsi_its_cam_msgs::msg::DeltaAltitude&& _delta_altitude); + + /*! + * @brief This function returns a constant reference to member delta_altitude + * @return Constant reference to member delta_altitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaAltitude& delta_altitude() const; + + /*! + * @brief This function returns a reference to member delta_altitude + * @return Reference to member delta_altitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaAltitude& delta_altitude(); + +private: + + etsi_its_cam_msgs::msg::DeltaLatitude m_delta_latitude; + etsi_its_cam_msgs::msg::DeltaLongitude m_delta_longitude; + etsi_its_cam_msgs::msg::DeltaAltitude m_delta_altitude; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionCdrAux.hpp new file mode 100644 index 00000000000..3b662b7edbc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaReferencePositionCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITIONCDRAUX_HPP_ + +#include "DeltaReferencePosition.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_DeltaReferencePosition_max_cdr_typesize {26UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_DeltaReferencePosition_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaReferencePosition& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionCdrAux.ipp new file mode 100644 index 00000000000..7b4741c623d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DeltaReferencePositionCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITIONCDRAUX_IPP_ + +#include "DeltaReferencePositionCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::DeltaReferencePosition& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.delta_latitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.delta_longitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.delta_altitude(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaReferencePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.delta_latitude() + << eprosima::fastcdr::MemberId(1) << data.delta_longitude() + << eprosima::fastcdr::MemberId(2) << data.delta_altitude() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::DeltaReferencePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.delta_latitude(); + break; + + case 1: + dcdr >> data.delta_longitude(); + break; + + case 2: + dcdr >> data.delta_altitude(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DeltaReferencePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.cxx index 474fa36d3d7..07d019f5e98 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file DeltaReferencePositionPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DeltaReferencePositionPubSubTypes.h" +#include "DeltaReferencePositionCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - DeltaReferencePositionPubSubType::DeltaReferencePositionPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::DeltaReferencePosition_"); - auto type_size = DeltaReferencePosition::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DeltaReferencePosition::isKeyDefined(); - size_t keyLength = DeltaReferencePosition::getKeyMaxCdrSerializedSize() > 16 ? - DeltaReferencePosition::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DeltaReferencePositionPubSubType::~DeltaReferencePositionPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DeltaReferencePositionPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DeltaReferencePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DeltaReferencePositionPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DeltaReferencePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DeltaReferencePositionPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DeltaReferencePositionPubSubType::createData() - { - return reinterpret_cast(new DeltaReferencePosition()); - } - - void DeltaReferencePositionPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DeltaReferencePositionPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DeltaReferencePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DeltaReferencePosition::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DeltaReferencePosition::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +DeltaReferencePositionPubSubType::DeltaReferencePositionPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::DeltaReferencePosition_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DeltaReferencePosition::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_DeltaReferencePosition_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DeltaReferencePositionPubSubType::~DeltaReferencePositionPubSubType() +{ +} + +bool DeltaReferencePositionPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DeltaReferencePosition* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DeltaReferencePositionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DeltaReferencePosition* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DeltaReferencePositionPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DeltaReferencePositionPubSubType::createData() +{ + return reinterpret_cast(new DeltaReferencePosition()); +} + +void DeltaReferencePositionPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DeltaReferencePositionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.h index 28c77e36f97..add5601c8fb 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DeltaReferencePositionPubSubTypes.h @@ -16,92 +16,123 @@ * @file DeltaReferencePositionPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DeltaReferencePosition.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "DeltaLongitudePubSubTypes.h" +#include "DeltaAltitudePubSubTypes.h" +#include "DeltaLatitudePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DeltaReferencePosition is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type DeltaReferencePosition defined by the user in the IDL file. + * @ingroup DeltaReferencePosition + */ +class DeltaReferencePositionPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type DeltaReferencePosition defined by the user in the IDL file. - * @ingroup DELTAREFERENCEPOSITION - */ - class DeltaReferencePositionPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef DeltaReferencePosition type; + typedef DeltaReferencePosition type; - eProsima_user_DllExport DeltaReferencePositionPubSubType(); + eProsima_user_DllExport DeltaReferencePositionPubSubType(); - eProsima_user_DllExport virtual ~DeltaReferencePositionPubSubType(); + eProsima_user_DllExport ~DeltaReferencePositionPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DeltaReferencePosition(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DELTAREFERENCEPOSITION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.cxx index b1b093bf57b..6e192d9680c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.cxx @@ -14,9 +14,9 @@ /*! * @file DriveDirection.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,117 +27,79 @@ char dummy; #endif // _WIN32 #include "DriveDirection.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace DriveDirection_Constants { + + +} // namespace DriveDirection_Constants -etsi_its_cam_msgs::msg::DriveDirection::DriveDirection() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6dd93a21 - m_value = 0; +DriveDirection::DriveDirection() +{ } -etsi_its_cam_msgs::msg::DriveDirection::~DriveDirection() +DriveDirection::~DriveDirection() { } -etsi_its_cam_msgs::msg::DriveDirection::DriveDirection( +DriveDirection::DriveDirection( const DriveDirection& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DriveDirection::DriveDirection( - DriveDirection&& x) +DriveDirection::DriveDirection( + DriveDirection&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::DriveDirection::operator =( +DriveDirection& DriveDirection::operator =( const DriveDirection& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::DriveDirection& etsi_its_cam_msgs::msg::DriveDirection::operator =( - DriveDirection&& x) +DriveDirection& DriveDirection::operator =( + DriveDirection&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::DriveDirection::operator ==( +bool DriveDirection::operator ==( const DriveDirection& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::DriveDirection::operator !=( +bool DriveDirection::operator !=( const DriveDirection& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::DriveDirection::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::DriveDirection::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DriveDirection& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::DriveDirection::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::DriveDirection::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::DriveDirection::value( +void DriveDirection::value( uint8_t _value) { m_value = _value; @@ -147,7 +109,7 @@ void etsi_its_cam_msgs::msg::DriveDirection::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::DriveDirection::value() const +uint8_t DriveDirection::value() const { return m_value; } @@ -156,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::DriveDirection::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::DriveDirection::value() +uint8_t& DriveDirection::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::DriveDirection::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::DriveDirection::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::DriveDirection::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DriveDirectionCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.h index f36db68b856..38d1e451e1e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirection.h @@ -16,19 +16,24 @@ * @file DriveDirection.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,174 +47,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DriveDirection_SOURCE) -#define DriveDirection_DllAPI __declspec( dllexport ) +#if defined(DRIVEDIRECTION_SOURCE) +#define DRIVEDIRECTION_DllAPI __declspec( dllexport ) #else -#define DriveDirection_DllAPI __declspec( dllimport ) -#endif // DriveDirection_SOURCE +#define DRIVEDIRECTION_DllAPI __declspec( dllimport ) +#endif // DRIVEDIRECTION_SOURCE #else -#define DriveDirection_DllAPI +#define DRIVEDIRECTION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DriveDirection_DllAPI +#define DRIVEDIRECTION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace DriveDirection_Constants { - const uint8_t FORWARD = 0; - const uint8_t BACKWARD = 1; - const uint8_t UNAVAILABLE = 2; - } // namespace DriveDirection_Constants - /*! - * @brief This class represents the structure DriveDirection defined by the user in the IDL file. - * @ingroup DRIVEDIRECTION - */ - class DriveDirection - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DriveDirection(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DriveDirection(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. - */ - eProsima_user_DllExport DriveDirection( - const DriveDirection& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. - */ - eProsima_user_DllExport DriveDirection( - DriveDirection&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. - */ - eProsima_user_DllExport DriveDirection& operator =( - const DriveDirection& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. - */ - eProsima_user_DllExport DriveDirection& operator =( - DriveDirection&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DriveDirection object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DriveDirection& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DriveDirection object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DriveDirection& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DriveDirection& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace DriveDirection_Constants { + +const uint8_t FORWARD = 0; +const uint8_t BACKWARD = 1; +const uint8_t UNAVAILABLE = 2; + +} // namespace DriveDirection_Constants + + +/*! + * @brief This class represents the structure DriveDirection defined by the user in the IDL file. + * @ingroup DriveDirection + */ +class DriveDirection +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DriveDirection(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DriveDirection(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. + */ + eProsima_user_DllExport DriveDirection( + const DriveDirection& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. + */ + eProsima_user_DllExport DriveDirection( + DriveDirection&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. + */ + eProsima_user_DllExport DriveDirection& operator =( + const DriveDirection& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DriveDirection that will be copied. + */ + eProsima_user_DllExport DriveDirection& operator =( + DriveDirection&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DriveDirection object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DriveDirection& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DriveDirection object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DriveDirection& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionCdrAux.hpp new file mode 100644 index 00000000000..6b3b35ad57b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DriveDirectionCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTIONCDRAUX_HPP_ + +#include "DriveDirection.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_DriveDirection_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_DriveDirection_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DriveDirection& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionCdrAux.ipp new file mode 100644 index 00000000000..17c9668af63 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DriveDirectionCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTIONCDRAUX_IPP_ + +#include "DriveDirectionCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::DriveDirection& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DriveDirection& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::DriveDirection& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DriveDirection& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.cxx index 7783faf2982..6e39d1b2107 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.cxx @@ -16,167 +16,193 @@ * @file DriveDirectionPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DriveDirectionPubSubTypes.h" +#include "DriveDirectionCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace DriveDirection_Constants { - - - - - } //End of namespace DriveDirection_Constants - DriveDirectionPubSubType::DriveDirectionPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::DriveDirection_"); - auto type_size = DriveDirection::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DriveDirection::isKeyDefined(); - size_t keyLength = DriveDirection::getKeyMaxCdrSerializedSize() > 16 ? - DriveDirection::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DriveDirectionPubSubType::~DriveDirectionPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DriveDirectionPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DriveDirection* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DriveDirectionPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DriveDirection* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DriveDirectionPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DriveDirectionPubSubType::createData() - { - return reinterpret_cast(new DriveDirection()); - } - - void DriveDirectionPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DriveDirectionPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DriveDirection* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DriveDirection::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DriveDirection::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace DriveDirection_Constants { + + + + + + + +} //End of namespace DriveDirection_Constants + + + +DriveDirectionPubSubType::DriveDirectionPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::DriveDirection_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DriveDirection::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_DriveDirection_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DriveDirectionPubSubType::~DriveDirectionPubSubType() +{ +} + +bool DriveDirectionPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DriveDirection* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DriveDirectionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DriveDirection* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DriveDirectionPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DriveDirectionPubSubType::createData() +{ + return reinterpret_cast(new DriveDirection()); +} + +void DriveDirectionPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DriveDirectionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.h index 2f76ff111fe..efdfe03a7ce 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DriveDirectionPubSubTypes.h @@ -16,98 +16,128 @@ * @file DriveDirectionPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DriveDirection.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DriveDirection is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace DriveDirection_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace DriveDirection_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type DriveDirection defined by the user in the IDL file. - * @ingroup DRIVEDIRECTION - */ - class DriveDirectionPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace DriveDirection_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type DriveDirection defined by the user in the IDL file. + * @ingroup DriveDirection + */ +class DriveDirectionPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef DriveDirection type; - typedef DriveDirection type; + eProsima_user_DllExport DriveDirectionPubSubType(); - eProsima_user_DllExport DriveDirectionPubSubType(); + eProsima_user_DllExport ~DriveDirectionPubSubType() override; - eProsima_user_DllExport virtual ~DriveDirectionPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) DriveDirection(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVEDIRECTION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.cxx index 0daf5932cc6..4dcfdcaa828 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.cxx @@ -14,9 +14,9 @@ /*! * @file DrivingLaneStatus.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,142 +27,84 @@ char dummy; #endif // _WIN32 #include "DrivingLaneStatus.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { -etsi_its_cam_msgs::msg::DrivingLaneStatus::DrivingLaneStatus() -{ - // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@15a902e7 +namespace DrivingLaneStatus_Constants { - // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7876d598 - m_bits_unused = 0; -} +} // namespace DrivingLaneStatus_Constants -etsi_its_cam_msgs::msg::DrivingLaneStatus::~DrivingLaneStatus() + +DrivingLaneStatus::DrivingLaneStatus() { +} +DrivingLaneStatus::~DrivingLaneStatus() +{ } -etsi_its_cam_msgs::msg::DrivingLaneStatus::DrivingLaneStatus( +DrivingLaneStatus::DrivingLaneStatus( const DrivingLaneStatus& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::DrivingLaneStatus::DrivingLaneStatus( - DrivingLaneStatus&& x) +DrivingLaneStatus::DrivingLaneStatus( + DrivingLaneStatus&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::DrivingLaneStatus::operator =( +DrivingLaneStatus& DrivingLaneStatus::operator =( const DrivingLaneStatus& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; - return *this; } -etsi_its_cam_msgs::msg::DrivingLaneStatus& etsi_its_cam_msgs::msg::DrivingLaneStatus::operator =( - DrivingLaneStatus&& x) +DrivingLaneStatus& DrivingLaneStatus::operator =( + DrivingLaneStatus&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; - return *this; } -bool etsi_its_cam_msgs::msg::DrivingLaneStatus::operator ==( +bool DrivingLaneStatus::operator ==( const DrivingLaneStatus& x) const { - - return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); + return (m_value == x.m_value && + m_bits_unused == x.m_bits_unused); } -bool etsi_its_cam_msgs::msg::DrivingLaneStatus::operator !=( +bool DrivingLaneStatus::operator !=( const DrivingLaneStatus& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::DrivingLaneStatus::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::DrivingLaneStatus::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DrivingLaneStatus& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.value().size() > 0) - { - current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::DrivingLaneStatus::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - scdr << m_bits_unused; - -} - -void etsi_its_cam_msgs::msg::DrivingLaneStatus::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; - dcdr >> m_bits_unused; -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void etsi_its_cam_msgs::msg::DrivingLaneStatus::value( +void DrivingLaneStatus::value( const std::vector& _value) { m_value = _value; @@ -172,7 +114,7 @@ void etsi_its_cam_msgs::msg::DrivingLaneStatus::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void etsi_its_cam_msgs::msg::DrivingLaneStatus::value( +void DrivingLaneStatus::value( std::vector&& _value) { m_value = std::move(_value); @@ -182,7 +124,7 @@ void etsi_its_cam_msgs::msg::DrivingLaneStatus::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::vector& etsi_its_cam_msgs::msg::DrivingLaneStatus::value() const +const std::vector& DrivingLaneStatus::value() const { return m_value; } @@ -191,15 +133,17 @@ const std::vector& etsi_its_cam_msgs::msg::DrivingLaneStatus::value() c * @brief This function returns a reference to member value * @return Reference to member value */ -std::vector& etsi_its_cam_msgs::msg::DrivingLaneStatus::value() +std::vector& DrivingLaneStatus::value() { return m_value; } + + /*! * @brief This function sets a value in member bits_unused * @param _bits_unused New value for member bits_unused */ -void etsi_its_cam_msgs::msg::DrivingLaneStatus::bits_unused( +void DrivingLaneStatus::bits_unused( uint8_t _bits_unused) { m_bits_unused = _bits_unused; @@ -209,7 +153,7 @@ void etsi_its_cam_msgs::msg::DrivingLaneStatus::bits_unused( * @brief This function returns the value of member bits_unused * @return Value of member bits_unused */ -uint8_t etsi_its_cam_msgs::msg::DrivingLaneStatus::bits_unused() const +uint8_t DrivingLaneStatus::bits_unused() const { return m_bits_unused; } @@ -218,32 +162,18 @@ uint8_t etsi_its_cam_msgs::msg::DrivingLaneStatus::bits_unused() const * @brief This function returns a reference to member bits_unused * @return Reference to member bits_unused */ -uint8_t& etsi_its_cam_msgs::msg::DrivingLaneStatus::bits_unused() +uint8_t& DrivingLaneStatus::bits_unused() { return m_bits_unused; } -size_t etsi_its_cam_msgs::msg::DrivingLaneStatus::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::DrivingLaneStatus::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::DrivingLaneStatus::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "DrivingLaneStatusCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.h index 13f818ad751..05cfd7fe633 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatus.h @@ -16,19 +16,24 @@ * @file DrivingLaneStatus.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,199 +47,157 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DrivingLaneStatus_SOURCE) -#define DrivingLaneStatus_DllAPI __declspec( dllexport ) +#if defined(DRIVINGLANESTATUS_SOURCE) +#define DRIVINGLANESTATUS_DllAPI __declspec( dllexport ) #else -#define DrivingLaneStatus_DllAPI __declspec( dllimport ) -#endif // DrivingLaneStatus_SOURCE +#define DRIVINGLANESTATUS_DllAPI __declspec( dllimport ) +#endif // DRIVINGLANESTATUS_SOURCE #else -#define DrivingLaneStatus_DllAPI +#define DRIVINGLANESTATUS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define DrivingLaneStatus_DllAPI +#define DRIVINGLANESTATUS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace DrivingLaneStatus_Constants { - const uint8_t MIN_SIZE_BITS = 1; - const uint8_t MAX_SIZE_BITS = 13; - } // namespace DrivingLaneStatus_Constants - /*! - * @brief This class represents the structure DrivingLaneStatus defined by the user in the IDL file. - * @ingroup DRIVINGLANESTATUS - */ - class DrivingLaneStatus - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DrivingLaneStatus(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DrivingLaneStatus(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. - */ - eProsima_user_DllExport DrivingLaneStatus( - const DrivingLaneStatus& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. - */ - eProsima_user_DllExport DrivingLaneStatus( - DrivingLaneStatus&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. - */ - eProsima_user_DllExport DrivingLaneStatus& operator =( - const DrivingLaneStatus& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. - */ - eProsima_user_DllExport DrivingLaneStatus& operator =( - DrivingLaneStatus&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DrivingLaneStatus object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DrivingLaneStatus& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::DrivingLaneStatus object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DrivingLaneStatus& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::vector& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::vector&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::vector& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::vector& value(); - /*! - * @brief This function sets a value in member bits_unused - * @param _bits_unused New value for member bits_unused - */ - eProsima_user_DllExport void bits_unused( - uint8_t _bits_unused); - - /*! - * @brief This function returns the value of member bits_unused - * @return Value of member bits_unused - */ - eProsima_user_DllExport uint8_t bits_unused() const; - - /*! - * @brief This function returns a reference to member bits_unused - * @return Reference to member bits_unused - */ - eProsima_user_DllExport uint8_t& bits_unused(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::DrivingLaneStatus& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_value; - uint8_t m_bits_unused; - }; - } // namespace msg + +namespace msg { + +namespace DrivingLaneStatus_Constants { + +const uint8_t MIN_SIZE_BITS = 1; +const uint8_t MAX_SIZE_BITS = 13; + +} // namespace DrivingLaneStatus_Constants + + +/*! + * @brief This class represents the structure DrivingLaneStatus defined by the user in the IDL file. + * @ingroup DrivingLaneStatus + */ +class DrivingLaneStatus +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DrivingLaneStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DrivingLaneStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. + */ + eProsima_user_DllExport DrivingLaneStatus( + const DrivingLaneStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. + */ + eProsima_user_DllExport DrivingLaneStatus( + DrivingLaneStatus&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. + */ + eProsima_user_DllExport DrivingLaneStatus& operator =( + const DrivingLaneStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::DrivingLaneStatus that will be copied. + */ + eProsima_user_DllExport DrivingLaneStatus& operator =( + DrivingLaneStatus&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DrivingLaneStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DrivingLaneStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::DrivingLaneStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DrivingLaneStatus& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + + + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + +private: + + std::vector m_value; + uint8_t m_bits_unused{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusCdrAux.hpp new file mode 100644 index 00000000000..805c078370c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusCdrAux.hpp @@ -0,0 +1,55 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DrivingLaneStatusCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUSCDRAUX_HPP_ + +#include "DrivingLaneStatus.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_DrivingLaneStatus_max_cdr_typesize {109UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_DrivingLaneStatus_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DrivingLaneStatus& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusCdrAux.ipp new file mode 100644 index 00000000000..dc8fbd342e8 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusCdrAux.ipp @@ -0,0 +1,143 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DrivingLaneStatusCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUSCDRAUX_IPP_ + +#include "DrivingLaneStatusCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::DrivingLaneStatus& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bits_unused(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DrivingLaneStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() + << eprosima::fastcdr::MemberId(1) << data.bits_unused() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::DrivingLaneStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + case 1: + dcdr >> data.bits_unused(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::DrivingLaneStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.cxx index 88981d7a021..3180536716a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.cxx @@ -16,166 +16,191 @@ * @file DrivingLaneStatusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "DrivingLaneStatusPubSubTypes.h" +#include "DrivingLaneStatusCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace DrivingLaneStatus_Constants { - - - - } //End of namespace DrivingLaneStatus_Constants - DrivingLaneStatusPubSubType::DrivingLaneStatusPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::DrivingLaneStatus_"); - auto type_size = DrivingLaneStatus::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = DrivingLaneStatus::isKeyDefined(); - size_t keyLength = DrivingLaneStatus::getKeyMaxCdrSerializedSize() > 16 ? - DrivingLaneStatus::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - DrivingLaneStatusPubSubType::~DrivingLaneStatusPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool DrivingLaneStatusPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - DrivingLaneStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool DrivingLaneStatusPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - DrivingLaneStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function DrivingLaneStatusPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* DrivingLaneStatusPubSubType::createData() - { - return reinterpret_cast(new DrivingLaneStatus()); - } - - void DrivingLaneStatusPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool DrivingLaneStatusPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - DrivingLaneStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DrivingLaneStatus::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || DrivingLaneStatus::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace DrivingLaneStatus_Constants { + + + + + +} //End of namespace DrivingLaneStatus_Constants + + + +DrivingLaneStatusPubSubType::DrivingLaneStatusPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::DrivingLaneStatus_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DrivingLaneStatus::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_DrivingLaneStatus_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +DrivingLaneStatusPubSubType::~DrivingLaneStatusPubSubType() +{ +} + +bool DrivingLaneStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + DrivingLaneStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool DrivingLaneStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + DrivingLaneStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function DrivingLaneStatusPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* DrivingLaneStatusPubSubType::createData() +{ + return reinterpret_cast(new DrivingLaneStatus()); +} + +void DrivingLaneStatusPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool DrivingLaneStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.h index 7cdb201e61a..e0eb62287e5 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/DrivingLaneStatusPubSubTypes.h @@ -16,97 +16,126 @@ * @file DrivingLaneStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "DrivingLaneStatus.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated DrivingLaneStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace DrivingLaneStatus_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace DrivingLaneStatus_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type DrivingLaneStatus defined by the user in the IDL file. - * @ingroup DRIVINGLANESTATUS - */ - class DrivingLaneStatusPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef DrivingLaneStatus type; - eProsima_user_DllExport DrivingLaneStatusPubSubType(); +} // namespace DrivingLaneStatus_Constants - eProsima_user_DllExport virtual ~DrivingLaneStatusPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type DrivingLaneStatus defined by the user in the IDL file. + * @ingroup DrivingLaneStatus + */ +class DrivingLaneStatusPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef DrivingLaneStatus type; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport DrivingLaneStatusPubSubType(); - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport ~DrivingLaneStatusPubSubType() override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport void deleteData( + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_DRIVINGLANESTATUS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.cxx index 474bdbeac78..ff3e382d189 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.cxx @@ -14,9 +14,9 @@ /*! * @file EmbarkationStatus.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,113 +27,75 @@ char dummy; #endif // _WIN32 #include "EmbarkationStatus.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::EmbarkationStatus::EmbarkationStatus() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4de025bf - m_value = false; +namespace etsi_its_cam_msgs { + +namespace msg { + + + +EmbarkationStatus::EmbarkationStatus() +{ } -etsi_its_cam_msgs::msg::EmbarkationStatus::~EmbarkationStatus() +EmbarkationStatus::~EmbarkationStatus() { } -etsi_its_cam_msgs::msg::EmbarkationStatus::EmbarkationStatus( +EmbarkationStatus::EmbarkationStatus( const EmbarkationStatus& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::EmbarkationStatus::EmbarkationStatus( - EmbarkationStatus&& x) +EmbarkationStatus::EmbarkationStatus( + EmbarkationStatus&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::EmbarkationStatus::operator =( +EmbarkationStatus& EmbarkationStatus::operator =( const EmbarkationStatus& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::EmbarkationStatus::operator =( - EmbarkationStatus&& x) +EmbarkationStatus& EmbarkationStatus::operator =( + EmbarkationStatus&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::EmbarkationStatus::operator ==( +bool EmbarkationStatus::operator ==( const EmbarkationStatus& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::EmbarkationStatus::operator !=( +bool EmbarkationStatus::operator !=( const EmbarkationStatus& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::EmbarkationStatus::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::EmbarkationStatus::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::EmbarkationStatus& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::EmbarkationStatus::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::EmbarkationStatus::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::EmbarkationStatus::value( +void EmbarkationStatus::value( bool _value) { m_value = _value; @@ -143,7 +105,7 @@ void etsi_its_cam_msgs::msg::EmbarkationStatus::value( * @brief This function returns the value of member value * @return Value of member value */ -bool etsi_its_cam_msgs::msg::EmbarkationStatus::value() const +bool EmbarkationStatus::value() const { return m_value; } @@ -152,32 +114,18 @@ bool etsi_its_cam_msgs::msg::EmbarkationStatus::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -bool& etsi_its_cam_msgs::msg::EmbarkationStatus::value() +bool& EmbarkationStatus::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::EmbarkationStatus::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::EmbarkationStatus::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::EmbarkationStatus::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "EmbarkationStatusCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.h index fefe2a1836c..53c99ed7745 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatus.h @@ -16,19 +16,24 @@ * @file EmbarkationStatus.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,169 +47,123 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(EmbarkationStatus_SOURCE) -#define EmbarkationStatus_DllAPI __declspec( dllexport ) +#if defined(EMBARKATIONSTATUS_SOURCE) +#define EMBARKATIONSTATUS_DllAPI __declspec( dllexport ) #else -#define EmbarkationStatus_DllAPI __declspec( dllimport ) -#endif // EmbarkationStatus_SOURCE +#define EMBARKATIONSTATUS_DllAPI __declspec( dllimport ) +#endif // EMBARKATIONSTATUS_SOURCE #else -#define EmbarkationStatus_DllAPI +#define EMBARKATIONSTATUS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define EmbarkationStatus_DllAPI +#define EMBARKATIONSTATUS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure EmbarkationStatus defined by the user in the IDL file. - * @ingroup EMBARKATIONSTATUS - */ - class EmbarkationStatus - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EmbarkationStatus(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EmbarkationStatus(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. - */ - eProsima_user_DllExport EmbarkationStatus( - const EmbarkationStatus& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. - */ - eProsima_user_DllExport EmbarkationStatus( - EmbarkationStatus&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. - */ - eProsima_user_DllExport EmbarkationStatus& operator =( - const EmbarkationStatus& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. - */ - eProsima_user_DllExport EmbarkationStatus& operator =( - EmbarkationStatus&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::EmbarkationStatus object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EmbarkationStatus& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::EmbarkationStatus object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EmbarkationStatus& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - bool _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport bool value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport bool& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::EmbarkationStatus& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - bool m_value; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure EmbarkationStatus defined by the user in the IDL file. + * @ingroup EmbarkationStatus + */ +class EmbarkationStatus +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EmbarkationStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EmbarkationStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. + */ + eProsima_user_DllExport EmbarkationStatus( + const EmbarkationStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. + */ + eProsima_user_DllExport EmbarkationStatus( + EmbarkationStatus&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. + */ + eProsima_user_DllExport EmbarkationStatus& operator =( + const EmbarkationStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmbarkationStatus that will be copied. + */ + eProsima_user_DllExport EmbarkationStatus& operator =( + EmbarkationStatus&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmbarkationStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EmbarkationStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmbarkationStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EmbarkationStatus& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + bool _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport bool value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport bool& value(); + +private: + + bool m_value{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusCdrAux.hpp new file mode 100644 index 00000000000..dd5e19edc45 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmbarkationStatusCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUSCDRAUX_HPP_ + +#include "EmbarkationStatus.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_EmbarkationStatus_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_EmbarkationStatus_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmbarkationStatus& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusCdrAux.ipp new file mode 100644 index 00000000000..47bcf075558 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusCdrAux.ipp @@ -0,0 +1,130 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmbarkationStatusCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUSCDRAUX_IPP_ + +#include "EmbarkationStatusCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::EmbarkationStatus& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmbarkationStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::EmbarkationStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmbarkationStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.cxx index d44e6b7a559..4285c4af794 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file EmbarkationStatusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "EmbarkationStatusPubSubTypes.h" +#include "EmbarkationStatusCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - EmbarkationStatusPubSubType::EmbarkationStatusPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::EmbarkationStatus_"); - auto type_size = EmbarkationStatus::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = EmbarkationStatus::isKeyDefined(); - size_t keyLength = EmbarkationStatus::getKeyMaxCdrSerializedSize() > 16 ? - EmbarkationStatus::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - EmbarkationStatusPubSubType::~EmbarkationStatusPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool EmbarkationStatusPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - EmbarkationStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool EmbarkationStatusPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - EmbarkationStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function EmbarkationStatusPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* EmbarkationStatusPubSubType::createData() - { - return reinterpret_cast(new EmbarkationStatus()); - } - - void EmbarkationStatusPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool EmbarkationStatusPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - EmbarkationStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - EmbarkationStatus::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || EmbarkationStatus::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +EmbarkationStatusPubSubType::EmbarkationStatusPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::EmbarkationStatus_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(EmbarkationStatus::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_EmbarkationStatus_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +EmbarkationStatusPubSubType::~EmbarkationStatusPubSubType() +{ +} + +bool EmbarkationStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + EmbarkationStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool EmbarkationStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + EmbarkationStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function EmbarkationStatusPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* EmbarkationStatusPubSubType::createData() +{ + return reinterpret_cast(new EmbarkationStatus()); +} + +void EmbarkationStatusPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool EmbarkationStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.h index c5197616663..c54b22b2543 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmbarkationStatusPubSubTypes.h @@ -16,92 +16,120 @@ * @file EmbarkationStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "EmbarkationStatus.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated EmbarkationStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type EmbarkationStatus defined by the user in the IDL file. + * @ingroup EmbarkationStatus + */ +class EmbarkationStatusPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type EmbarkationStatus defined by the user in the IDL file. - * @ingroup EMBARKATIONSTATUS - */ - class EmbarkationStatusPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef EmbarkationStatus type; + typedef EmbarkationStatus type; - eProsima_user_DllExport EmbarkationStatusPubSubType(); + eProsima_user_DllExport EmbarkationStatusPubSubType(); - eProsima_user_DllExport virtual ~EmbarkationStatusPubSubType(); + eProsima_user_DllExport ~EmbarkationStatusPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) EmbarkationStatus(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMBARKATIONSTATUS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.cxx index 10d5e7a80e7..7907f755323 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.cxx @@ -14,9 +14,9 @@ /*! * @file EmergencyContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,37 +27,31 @@ char dummy; #endif // _WIN32 #include "EmergencyContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::EmergencyContainer::EmergencyContainer() -{ - // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@182f1e9a - // m_incident_indication com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6928f576 +namespace etsi_its_cam_msgs { - // m_incident_indication_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@660e9100 - m_incident_indication_is_present = false; - // m_emergency_priority com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@69f63d95 +namespace msg { - // m_emergency_priority_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9cd25ff - m_emergency_priority_is_present = false; -} -etsi_its_cam_msgs::msg::EmergencyContainer::~EmergencyContainer() +EmergencyContainer::EmergencyContainer() { +} - - - +EmergencyContainer::~EmergencyContainer() +{ } -etsi_its_cam_msgs::msg::EmergencyContainer::EmergencyContainer( +EmergencyContainer::EmergencyContainer( const EmergencyContainer& x) { m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; @@ -67,8 +61,8 @@ etsi_its_cam_msgs::msg::EmergencyContainer::EmergencyContainer( m_emergency_priority_is_present = x.m_emergency_priority_is_present; } -etsi_its_cam_msgs::msg::EmergencyContainer::EmergencyContainer( - EmergencyContainer&& x) +EmergencyContainer::EmergencyContainer( + EmergencyContainer&& x) noexcept { m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); m_incident_indication = std::move(x.m_incident_indication); @@ -77,7 +71,7 @@ etsi_its_cam_msgs::msg::EmergencyContainer::EmergencyContainer( m_emergency_priority_is_present = x.m_emergency_priority_is_present; } -etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::EmergencyContainer::operator =( +EmergencyContainer& EmergencyContainer::operator =( const EmergencyContainer& x) { @@ -86,12 +80,11 @@ etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::EmergencyCon m_incident_indication_is_present = x.m_incident_indication_is_present; m_emergency_priority = x.m_emergency_priority; m_emergency_priority_is_present = x.m_emergency_priority_is_present; - return *this; } -etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::EmergencyContainer::operator =( - EmergencyContainer&& x) +EmergencyContainer& EmergencyContainer::operator =( + EmergencyContainer&& x) noexcept { m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); @@ -99,91 +92,30 @@ etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::EmergencyCon m_incident_indication_is_present = x.m_incident_indication_is_present; m_emergency_priority = std::move(x.m_emergency_priority); m_emergency_priority_is_present = x.m_emergency_priority_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::EmergencyContainer::operator ==( +bool EmergencyContainer::operator ==( const EmergencyContainer& x) const { - - return (m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && m_incident_indication == x.m_incident_indication && m_incident_indication_is_present == x.m_incident_indication_is_present && m_emergency_priority == x.m_emergency_priority && m_emergency_priority_is_present == x.m_emergency_priority_is_present); + return (m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && + m_incident_indication == x.m_incident_indication && + m_incident_indication_is_present == x.m_incident_indication_is_present && + m_emergency_priority == x.m_emergency_priority && + m_emergency_priority_is_present == x.m_emergency_priority_is_present); } -bool etsi_its_cam_msgs::msg::EmergencyContainer::operator !=( +bool EmergencyContainer::operator !=( const EmergencyContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::EmergencyContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CauseCode::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::EmergencyPriority::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::EmergencyContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::EmergencyContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CauseCode::getCdrSerializedSize(data.incident_indication(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::EmergencyPriority::getCdrSerializedSize(data.emergency_priority(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::EmergencyContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_light_bar_siren_in_use; - scdr << m_incident_indication; - scdr << m_incident_indication_is_present; - scdr << m_emergency_priority; - scdr << m_emergency_priority_is_present; - -} - -void etsi_its_cam_msgs::msg::EmergencyContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_light_bar_siren_in_use; - dcdr >> m_incident_indication; - dcdr >> m_incident_indication_is_present; - dcdr >> m_emergency_priority; - dcdr >> m_emergency_priority_is_present; -} - /*! * @brief This function copies the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use( +void EmergencyContainer::light_bar_siren_in_use( const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) { m_light_bar_siren_in_use = _light_bar_siren_in_use; @@ -193,7 +125,7 @@ void etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use( * @brief This function moves the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use( +void EmergencyContainer::light_bar_siren_in_use( etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) { m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); @@ -203,7 +135,7 @@ void etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use( * @brief This function returns a constant reference to member light_bar_siren_in_use * @return Constant reference to member light_bar_siren_in_use */ -const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use() const +const etsi_its_cam_msgs::msg::LightBarSirenInUse& EmergencyContainer::light_bar_siren_in_use() const { return m_light_bar_siren_in_use; } @@ -212,15 +144,17 @@ const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::Emerge * @brief This function returns a reference to member light_bar_siren_in_use * @return Reference to member light_bar_siren_in_use */ -etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::EmergencyContainer::light_bar_siren_in_use() +etsi_its_cam_msgs::msg::LightBarSirenInUse& EmergencyContainer::light_bar_siren_in_use() { return m_light_bar_siren_in_use; } + + /*! * @brief This function copies the value in member incident_indication * @param _incident_indication New value to be copied in member incident_indication */ -void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication( +void EmergencyContainer::incident_indication( const etsi_its_cam_msgs::msg::CauseCode& _incident_indication) { m_incident_indication = _incident_indication; @@ -230,7 +164,7 @@ void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication( * @brief This function moves the value in member incident_indication * @param _incident_indication New value to be moved in member incident_indication */ -void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication( +void EmergencyContainer::incident_indication( etsi_its_cam_msgs::msg::CauseCode&& _incident_indication) { m_incident_indication = std::move(_incident_indication); @@ -240,7 +174,7 @@ void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication( * @brief This function returns a constant reference to member incident_indication * @return Constant reference to member incident_indication */ -const etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication() const +const etsi_its_cam_msgs::msg::CauseCode& EmergencyContainer::incident_indication() const { return m_incident_indication; } @@ -249,15 +183,17 @@ const etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::EmergencyContai * @brief This function returns a reference to member incident_indication * @return Reference to member incident_indication */ -etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication() +etsi_its_cam_msgs::msg::CauseCode& EmergencyContainer::incident_indication() { return m_incident_indication; } + + /*! * @brief This function sets a value in member incident_indication_is_present * @param _incident_indication_is_present New value for member incident_indication_is_present */ -void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication_is_present( +void EmergencyContainer::incident_indication_is_present( bool _incident_indication_is_present) { m_incident_indication_is_present = _incident_indication_is_present; @@ -267,7 +203,7 @@ void etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication_is_present( * @brief This function returns the value of member incident_indication_is_present * @return Value of member incident_indication_is_present */ -bool etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication_is_present() const +bool EmergencyContainer::incident_indication_is_present() const { return m_incident_indication_is_present; } @@ -276,16 +212,17 @@ bool etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication_is_present( * @brief This function returns a reference to member incident_indication_is_present * @return Reference to member incident_indication_is_present */ -bool& etsi_its_cam_msgs::msg::EmergencyContainer::incident_indication_is_present() +bool& EmergencyContainer::incident_indication_is_present() { return m_incident_indication_is_present; } + /*! * @brief This function copies the value in member emergency_priority * @param _emergency_priority New value to be copied in member emergency_priority */ -void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority( +void EmergencyContainer::emergency_priority( const etsi_its_cam_msgs::msg::EmergencyPriority& _emergency_priority) { m_emergency_priority = _emergency_priority; @@ -295,7 +232,7 @@ void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority( * @brief This function moves the value in member emergency_priority * @param _emergency_priority New value to be moved in member emergency_priority */ -void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority( +void EmergencyContainer::emergency_priority( etsi_its_cam_msgs::msg::EmergencyPriority&& _emergency_priority) { m_emergency_priority = std::move(_emergency_priority); @@ -305,7 +242,7 @@ void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority( * @brief This function returns a constant reference to member emergency_priority * @return Constant reference to member emergency_priority */ -const etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority() const +const etsi_its_cam_msgs::msg::EmergencyPriority& EmergencyContainer::emergency_priority() const { return m_emergency_priority; } @@ -314,15 +251,17 @@ const etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::Emergen * @brief This function returns a reference to member emergency_priority * @return Reference to member emergency_priority */ -etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority() +etsi_its_cam_msgs::msg::EmergencyPriority& EmergencyContainer::emergency_priority() { return m_emergency_priority; } + + /*! * @brief This function sets a value in member emergency_priority_is_present * @param _emergency_priority_is_present New value for member emergency_priority_is_present */ -void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority_is_present( +void EmergencyContainer::emergency_priority_is_present( bool _emergency_priority_is_present) { m_emergency_priority_is_present = _emergency_priority_is_present; @@ -332,7 +271,7 @@ void etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority_is_present( * @brief This function returns the value of member emergency_priority_is_present * @return Value of member emergency_priority_is_present */ -bool etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority_is_present() const +bool EmergencyContainer::emergency_priority_is_present() const { return m_emergency_priority_is_present; } @@ -341,32 +280,18 @@ bool etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority_is_present() * @brief This function returns a reference to member emergency_priority_is_present * @return Reference to member emergency_priority_is_present */ -bool& etsi_its_cam_msgs::msg::EmergencyContainer::emergency_priority_is_present() +bool& EmergencyContainer::emergency_priority_is_present() { return m_emergency_priority_is_present; } -size_t etsi_its_cam_msgs::msg::EmergencyContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::EmergencyContainer::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::EmergencyContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "EmergencyContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.h index ac0796f9349..453d0b5319c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainer.h @@ -16,22 +16,27 @@ * @file EmergencyContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "CauseCode.h" #include "EmergencyPriority.h" #include "LightBarSirenInUse.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -45,267 +50,228 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(EmergencyContainer_SOURCE) -#define EmergencyContainer_DllAPI __declspec( dllexport ) +#if defined(EMERGENCYCONTAINER_SOURCE) +#define EMERGENCYCONTAINER_DllAPI __declspec( dllexport ) #else -#define EmergencyContainer_DllAPI __declspec( dllimport ) -#endif // EmergencyContainer_SOURCE +#define EMERGENCYCONTAINER_DllAPI __declspec( dllimport ) +#endif // EMERGENCYCONTAINER_SOURCE #else -#define EmergencyContainer_DllAPI +#define EMERGENCYCONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define EmergencyContainer_DllAPI +#define EMERGENCYCONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure EmergencyContainer defined by the user in the IDL file. - * @ingroup EMERGENCYCONTAINER - */ - class EmergencyContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EmergencyContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EmergencyContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. - */ - eProsima_user_DllExport EmergencyContainer( - const EmergencyContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. - */ - eProsima_user_DllExport EmergencyContainer( - EmergencyContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. - */ - eProsima_user_DllExport EmergencyContainer& operator =( - const EmergencyContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. - */ - eProsima_user_DllExport EmergencyContainer& operator =( - EmergencyContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::EmergencyContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EmergencyContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::EmergencyContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EmergencyContainer& x) const; - - /*! - * @brief This function copies the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); - - /*! - * @brief This function moves the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); - - /*! - * @brief This function returns a constant reference to member light_bar_siren_in_use - * @return Constant reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; - - /*! - * @brief This function returns a reference to member light_bar_siren_in_use - * @return Reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); - /*! - * @brief This function copies the value in member incident_indication - * @param _incident_indication New value to be copied in member incident_indication - */ - eProsima_user_DllExport void incident_indication( - const etsi_its_cam_msgs::msg::CauseCode& _incident_indication); - - /*! - * @brief This function moves the value in member incident_indication - * @param _incident_indication New value to be moved in member incident_indication - */ - eProsima_user_DllExport void incident_indication( - etsi_its_cam_msgs::msg::CauseCode&& _incident_indication); - - /*! - * @brief This function returns a constant reference to member incident_indication - * @return Constant reference to member incident_indication - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCode& incident_indication() const; - - /*! - * @brief This function returns a reference to member incident_indication - * @return Reference to member incident_indication - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCode& incident_indication(); - /*! - * @brief This function sets a value in member incident_indication_is_present - * @param _incident_indication_is_present New value for member incident_indication_is_present - */ - eProsima_user_DllExport void incident_indication_is_present( - bool _incident_indication_is_present); - - /*! - * @brief This function returns the value of member incident_indication_is_present - * @return Value of member incident_indication_is_present - */ - eProsima_user_DllExport bool incident_indication_is_present() const; - - /*! - * @brief This function returns a reference to member incident_indication_is_present - * @return Reference to member incident_indication_is_present - */ - eProsima_user_DllExport bool& incident_indication_is_present(); - - /*! - * @brief This function copies the value in member emergency_priority - * @param _emergency_priority New value to be copied in member emergency_priority - */ - eProsima_user_DllExport void emergency_priority( - const etsi_its_cam_msgs::msg::EmergencyPriority& _emergency_priority); - - /*! - * @brief This function moves the value in member emergency_priority - * @param _emergency_priority New value to be moved in member emergency_priority - */ - eProsima_user_DllExport void emergency_priority( - etsi_its_cam_msgs::msg::EmergencyPriority&& _emergency_priority); - - /*! - * @brief This function returns a constant reference to member emergency_priority - * @return Constant reference to member emergency_priority - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmergencyPriority& emergency_priority() const; - - /*! - * @brief This function returns a reference to member emergency_priority - * @return Reference to member emergency_priority - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::EmergencyPriority& emergency_priority(); - /*! - * @brief This function sets a value in member emergency_priority_is_present - * @param _emergency_priority_is_present New value for member emergency_priority_is_present - */ - eProsima_user_DllExport void emergency_priority_is_present( - bool _emergency_priority_is_present); - - /*! - * @brief This function returns the value of member emergency_priority_is_present - * @return Value of member emergency_priority_is_present - */ - eProsima_user_DllExport bool emergency_priority_is_present() const; - - /*! - * @brief This function returns a reference to member emergency_priority_is_present - * @return Reference to member emergency_priority_is_present - */ - eProsima_user_DllExport bool& emergency_priority_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::EmergencyContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; - etsi_its_cam_msgs::msg::CauseCode m_incident_indication; - bool m_incident_indication_is_present; - etsi_its_cam_msgs::msg::EmergencyPriority m_emergency_priority; - bool m_emergency_priority_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure EmergencyContainer defined by the user in the IDL file. + * @ingroup EmergencyContainer + */ +class EmergencyContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EmergencyContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EmergencyContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. + */ + eProsima_user_DllExport EmergencyContainer( + const EmergencyContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. + */ + eProsima_user_DllExport EmergencyContainer( + EmergencyContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. + */ + eProsima_user_DllExport EmergencyContainer& operator =( + const EmergencyContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyContainer that will be copied. + */ + eProsima_user_DllExport EmergencyContainer& operator =( + EmergencyContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmergencyContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EmergencyContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmergencyContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EmergencyContainer& x) const; + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + + + /*! + * @brief This function copies the value in member incident_indication + * @param _incident_indication New value to be copied in member incident_indication + */ + eProsima_user_DllExport void incident_indication( + const etsi_its_cam_msgs::msg::CauseCode& _incident_indication); + + /*! + * @brief This function moves the value in member incident_indication + * @param _incident_indication New value to be moved in member incident_indication + */ + eProsima_user_DllExport void incident_indication( + etsi_its_cam_msgs::msg::CauseCode&& _incident_indication); + + /*! + * @brief This function returns a constant reference to member incident_indication + * @return Constant reference to member incident_indication + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCode& incident_indication() const; + + /*! + * @brief This function returns a reference to member incident_indication + * @return Reference to member incident_indication + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCode& incident_indication(); + + + /*! + * @brief This function sets a value in member incident_indication_is_present + * @param _incident_indication_is_present New value for member incident_indication_is_present + */ + eProsima_user_DllExport void incident_indication_is_present( + bool _incident_indication_is_present); + + /*! + * @brief This function returns the value of member incident_indication_is_present + * @return Value of member incident_indication_is_present + */ + eProsima_user_DllExport bool incident_indication_is_present() const; + + /*! + * @brief This function returns a reference to member incident_indication_is_present + * @return Reference to member incident_indication_is_present + */ + eProsima_user_DllExport bool& incident_indication_is_present(); + + + /*! + * @brief This function copies the value in member emergency_priority + * @param _emergency_priority New value to be copied in member emergency_priority + */ + eProsima_user_DllExport void emergency_priority( + const etsi_its_cam_msgs::msg::EmergencyPriority& _emergency_priority); + + /*! + * @brief This function moves the value in member emergency_priority + * @param _emergency_priority New value to be moved in member emergency_priority + */ + eProsima_user_DllExport void emergency_priority( + etsi_its_cam_msgs::msg::EmergencyPriority&& _emergency_priority); + + /*! + * @brief This function returns a constant reference to member emergency_priority + * @return Constant reference to member emergency_priority + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmergencyPriority& emergency_priority() const; + + /*! + * @brief This function returns a reference to member emergency_priority + * @return Reference to member emergency_priority + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::EmergencyPriority& emergency_priority(); + + + /*! + * @brief This function sets a value in member emergency_priority_is_present + * @param _emergency_priority_is_present New value for member emergency_priority_is_present + */ + eProsima_user_DllExport void emergency_priority_is_present( + bool _emergency_priority_is_present); + + /*! + * @brief This function returns the value of member emergency_priority_is_present + * @return Value of member emergency_priority_is_present + */ + eProsima_user_DllExport bool emergency_priority_is_present() const; + + /*! + * @brief This function returns a reference to member emergency_priority_is_present + * @return Reference to member emergency_priority_is_present + */ + eProsima_user_DllExport bool& emergency_priority_is_present(); + +private: + + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + etsi_its_cam_msgs::msg::CauseCode m_incident_indication; + bool m_incident_indication_is_present{false}; + etsi_its_cam_msgs::msg::EmergencyPriority m_emergency_priority; + bool m_emergency_priority_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerCdrAux.hpp new file mode 100644 index 00000000000..ef4c109e1a5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINERCDRAUX_HPP_ + +#include "EmergencyContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_EmergencyContainer_max_cdr_typesize {246UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_EmergencyContainer_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmergencyContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerCdrAux.ipp new file mode 100644 index 00000000000..e45181e6495 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerCdrAux.ipp @@ -0,0 +1,162 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINERCDRAUX_IPP_ + +#include "EmergencyContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::EmergencyContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.light_bar_siren_in_use(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.incident_indication(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.incident_indication_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.emergency_priority(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.emergency_priority_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmergencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.light_bar_siren_in_use() + << eprosima::fastcdr::MemberId(1) << data.incident_indication() + << eprosima::fastcdr::MemberId(2) << data.incident_indication_is_present() + << eprosima::fastcdr::MemberId(3) << data.emergency_priority() + << eprosima::fastcdr::MemberId(4) << data.emergency_priority_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::EmergencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.light_bar_siren_in_use(); + break; + + case 1: + dcdr >> data.incident_indication(); + break; + + case 2: + dcdr >> data.incident_indication_is_present(); + break; + + case 3: + dcdr >> data.emergency_priority(); + break; + + case 4: + dcdr >> data.emergency_priority_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmergencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.cxx index e5fbe9557bc..36d8b7548e1 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file EmergencyContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "EmergencyContainerPubSubTypes.h" +#include "EmergencyContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - EmergencyContainerPubSubType::EmergencyContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::EmergencyContainer_"); - auto type_size = EmergencyContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = EmergencyContainer::isKeyDefined(); - size_t keyLength = EmergencyContainer::getKeyMaxCdrSerializedSize() > 16 ? - EmergencyContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - EmergencyContainerPubSubType::~EmergencyContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool EmergencyContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - EmergencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool EmergencyContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - EmergencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function EmergencyContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* EmergencyContainerPubSubType::createData() - { - return reinterpret_cast(new EmergencyContainer()); - } - - void EmergencyContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool EmergencyContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - EmergencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - EmergencyContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || EmergencyContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +EmergencyContainerPubSubType::EmergencyContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::EmergencyContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(EmergencyContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_EmergencyContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +EmergencyContainerPubSubType::~EmergencyContainerPubSubType() +{ +} + +bool EmergencyContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + EmergencyContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool EmergencyContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + EmergencyContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function EmergencyContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* EmergencyContainerPubSubType::createData() +{ + return reinterpret_cast(new EmergencyContainer()); +} + +void EmergencyContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool EmergencyContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.h index d2170db0c27..703d916ea38 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyContainerPubSubTypes.h @@ -16,92 +16,123 @@ * @file EmergencyContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "EmergencyContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "CauseCodePubSubTypes.h" +#include "EmergencyPriorityPubSubTypes.h" +#include "LightBarSirenInUsePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated EmergencyContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type EmergencyContainer defined by the user in the IDL file. + * @ingroup EmergencyContainer + */ +class EmergencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type EmergencyContainer defined by the user in the IDL file. - * @ingroup EMERGENCYCONTAINER - */ - class EmergencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef EmergencyContainer type; + typedef EmergencyContainer type; - eProsima_user_DllExport EmergencyContainerPubSubType(); + eProsima_user_DllExport EmergencyContainerPubSubType(); - eProsima_user_DllExport virtual ~EmergencyContainerPubSubType(); + eProsima_user_DllExport ~EmergencyContainerPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYCONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.cxx index 2a222e75520..82bfe1f1b44 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.cxx @@ -14,9 +14,9 @@ /*! * @file EmergencyPriority.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,143 +27,84 @@ char dummy; #endif // _WIN32 #include "EmergencyPriority.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace EmergencyPriority_Constants { -etsi_its_cam_msgs::msg::EmergencyPriority::EmergencyPriority() -{ - // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@579d011c - // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3670f00 - m_bits_unused = 0; +} // namespace EmergencyPriority_Constants -} -etsi_its_cam_msgs::msg::EmergencyPriority::~EmergencyPriority() +EmergencyPriority::EmergencyPriority() { +} +EmergencyPriority::~EmergencyPriority() +{ } -etsi_its_cam_msgs::msg::EmergencyPriority::EmergencyPriority( +EmergencyPriority::EmergencyPriority( const EmergencyPriority& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::EmergencyPriority::EmergencyPriority( - EmergencyPriority&& x) +EmergencyPriority::EmergencyPriority( + EmergencyPriority&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::EmergencyPriority::operator =( +EmergencyPriority& EmergencyPriority::operator =( const EmergencyPriority& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; - return *this; } -etsi_its_cam_msgs::msg::EmergencyPriority& etsi_its_cam_msgs::msg::EmergencyPriority::operator =( - EmergencyPriority&& x) +EmergencyPriority& EmergencyPriority::operator =( + EmergencyPriority&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; - return *this; } -bool etsi_its_cam_msgs::msg::EmergencyPriority::operator ==( +bool EmergencyPriority::operator ==( const EmergencyPriority& x) const { - - return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); + return (m_value == x.m_value && + m_bits_unused == x.m_bits_unused); } -bool etsi_its_cam_msgs::msg::EmergencyPriority::operator !=( +bool EmergencyPriority::operator !=( const EmergencyPriority& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::EmergencyPriority::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::EmergencyPriority::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::EmergencyPriority& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.value().size() > 0) - { - current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::EmergencyPriority::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - scdr << m_bits_unused; - -} - -void etsi_its_cam_msgs::msg::EmergencyPriority::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; - dcdr >> m_bits_unused; -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void etsi_its_cam_msgs::msg::EmergencyPriority::value( +void EmergencyPriority::value( const std::vector& _value) { m_value = _value; @@ -173,7 +114,7 @@ void etsi_its_cam_msgs::msg::EmergencyPriority::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void etsi_its_cam_msgs::msg::EmergencyPriority::value( +void EmergencyPriority::value( std::vector&& _value) { m_value = std::move(_value); @@ -183,7 +124,7 @@ void etsi_its_cam_msgs::msg::EmergencyPriority::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::vector& etsi_its_cam_msgs::msg::EmergencyPriority::value() const +const std::vector& EmergencyPriority::value() const { return m_value; } @@ -192,15 +133,17 @@ const std::vector& etsi_its_cam_msgs::msg::EmergencyPriority::value() c * @brief This function returns a reference to member value * @return Reference to member value */ -std::vector& etsi_its_cam_msgs::msg::EmergencyPriority::value() +std::vector& EmergencyPriority::value() { return m_value; } + + /*! * @brief This function sets a value in member bits_unused * @param _bits_unused New value for member bits_unused */ -void etsi_its_cam_msgs::msg::EmergencyPriority::bits_unused( +void EmergencyPriority::bits_unused( uint8_t _bits_unused) { m_bits_unused = _bits_unused; @@ -210,7 +153,7 @@ void etsi_its_cam_msgs::msg::EmergencyPriority::bits_unused( * @brief This function returns the value of member bits_unused * @return Value of member bits_unused */ -uint8_t etsi_its_cam_msgs::msg::EmergencyPriority::bits_unused() const +uint8_t EmergencyPriority::bits_unused() const { return m_bits_unused; } @@ -219,32 +162,18 @@ uint8_t etsi_its_cam_msgs::msg::EmergencyPriority::bits_unused() const * @brief This function returns a reference to member bits_unused * @return Reference to member bits_unused */ -uint8_t& etsi_its_cam_msgs::msg::EmergencyPriority::bits_unused() +uint8_t& EmergencyPriority::bits_unused() { return m_bits_unused; } -size_t etsi_its_cam_msgs::msg::EmergencyPriority::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::EmergencyPriority::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::EmergencyPriority::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "EmergencyPriorityCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.h index bd680728921..b357132b76d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriority.h @@ -16,19 +16,24 @@ * @file EmergencyPriority.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,200 +47,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(EmergencyPriority_SOURCE) -#define EmergencyPriority_DllAPI __declspec( dllexport ) +#if defined(EMERGENCYPRIORITY_SOURCE) +#define EMERGENCYPRIORITY_DllAPI __declspec( dllexport ) #else -#define EmergencyPriority_DllAPI __declspec( dllimport ) -#endif // EmergencyPriority_SOURCE +#define EMERGENCYPRIORITY_DllAPI __declspec( dllimport ) +#endif // EMERGENCYPRIORITY_SOURCE #else -#define EmergencyPriority_DllAPI +#define EMERGENCYPRIORITY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define EmergencyPriority_DllAPI +#define EMERGENCYPRIORITY_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace EmergencyPriority_Constants { - const uint8_t SIZE_BITS = 2; - const uint8_t BIT_INDEX_REQUEST_FOR_RIGHT_OF_WAY = 0; - const uint8_t BIT_INDEX_REQUEST_FOR_FREE_CROSSING_AT_A_TRAFFIC_LIGHT = 1; - } // namespace EmergencyPriority_Constants - /*! - * @brief This class represents the structure EmergencyPriority defined by the user in the IDL file. - * @ingroup EMERGENCYPRIORITY - */ - class EmergencyPriority - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EmergencyPriority(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EmergencyPriority(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. - */ - eProsima_user_DllExport EmergencyPriority( - const EmergencyPriority& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. - */ - eProsima_user_DllExport EmergencyPriority( - EmergencyPriority&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. - */ - eProsima_user_DllExport EmergencyPriority& operator =( - const EmergencyPriority& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. - */ - eProsima_user_DllExport EmergencyPriority& operator =( - EmergencyPriority&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::EmergencyPriority object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EmergencyPriority& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::EmergencyPriority object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EmergencyPriority& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::vector& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::vector&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::vector& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::vector& value(); - /*! - * @brief This function sets a value in member bits_unused - * @param _bits_unused New value for member bits_unused - */ - eProsima_user_DllExport void bits_unused( - uint8_t _bits_unused); - - /*! - * @brief This function returns the value of member bits_unused - * @return Value of member bits_unused - */ - eProsima_user_DllExport uint8_t bits_unused() const; - - /*! - * @brief This function returns a reference to member bits_unused - * @return Reference to member bits_unused - */ - eProsima_user_DllExport uint8_t& bits_unused(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::EmergencyPriority& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_value; - uint8_t m_bits_unused; - }; - } // namespace msg + +namespace msg { + +namespace EmergencyPriority_Constants { + +const uint8_t SIZE_BITS = 2; +const uint8_t BIT_INDEX_REQUEST_FOR_RIGHT_OF_WAY = 0; +const uint8_t BIT_INDEX_REQUEST_FOR_FREE_CROSSING_AT_A_TRAFFIC_LIGHT = 1; + +} // namespace EmergencyPriority_Constants + + +/*! + * @brief This class represents the structure EmergencyPriority defined by the user in the IDL file. + * @ingroup EmergencyPriority + */ +class EmergencyPriority +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EmergencyPriority(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EmergencyPriority(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. + */ + eProsima_user_DllExport EmergencyPriority( + const EmergencyPriority& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. + */ + eProsima_user_DllExport EmergencyPriority( + EmergencyPriority&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. + */ + eProsima_user_DllExport EmergencyPriority& operator =( + const EmergencyPriority& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::EmergencyPriority that will be copied. + */ + eProsima_user_DllExport EmergencyPriority& operator =( + EmergencyPriority&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmergencyPriority object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EmergencyPriority& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::EmergencyPriority object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EmergencyPriority& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + + + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + +private: + + std::vector m_value; + uint8_t m_bits_unused{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityCdrAux.hpp new file mode 100644 index 00000000000..1d0e75c16aa --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyPriorityCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITYCDRAUX_HPP_ + +#include "EmergencyPriority.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_EmergencyPriority_max_cdr_typesize {109UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_EmergencyPriority_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmergencyPriority& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityCdrAux.ipp new file mode 100644 index 00000000000..f7597ede851 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityCdrAux.ipp @@ -0,0 +1,145 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file EmergencyPriorityCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITYCDRAUX_IPP_ + +#include "EmergencyPriorityCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::EmergencyPriority& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bits_unused(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmergencyPriority& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() + << eprosima::fastcdr::MemberId(1) << data.bits_unused() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::EmergencyPriority& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + case 1: + dcdr >> data.bits_unused(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::EmergencyPriority& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.cxx index 4e446121723..1c1bdee6c29 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.cxx @@ -16,167 +16,193 @@ * @file EmergencyPriorityPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "EmergencyPriorityPubSubTypes.h" +#include "EmergencyPriorityCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace EmergencyPriority_Constants { - - - - - } //End of namespace EmergencyPriority_Constants - EmergencyPriorityPubSubType::EmergencyPriorityPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::EmergencyPriority_"); - auto type_size = EmergencyPriority::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = EmergencyPriority::isKeyDefined(); - size_t keyLength = EmergencyPriority::getKeyMaxCdrSerializedSize() > 16 ? - EmergencyPriority::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - EmergencyPriorityPubSubType::~EmergencyPriorityPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool EmergencyPriorityPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - EmergencyPriority* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool EmergencyPriorityPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - EmergencyPriority* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function EmergencyPriorityPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* EmergencyPriorityPubSubType::createData() - { - return reinterpret_cast(new EmergencyPriority()); - } - - void EmergencyPriorityPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool EmergencyPriorityPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - EmergencyPriority* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - EmergencyPriority::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || EmergencyPriority::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace EmergencyPriority_Constants { + + + + + + + +} //End of namespace EmergencyPriority_Constants + + + +EmergencyPriorityPubSubType::EmergencyPriorityPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::EmergencyPriority_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(EmergencyPriority::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_EmergencyPriority_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +EmergencyPriorityPubSubType::~EmergencyPriorityPubSubType() +{ +} + +bool EmergencyPriorityPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + EmergencyPriority* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool EmergencyPriorityPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + EmergencyPriority* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function EmergencyPriorityPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* EmergencyPriorityPubSubType::createData() +{ + return reinterpret_cast(new EmergencyPriority()); +} + +void EmergencyPriorityPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool EmergencyPriorityPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.h index 8433906892a..0e966c40324 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/EmergencyPriorityPubSubTypes.h @@ -16,98 +16,128 @@ * @file EmergencyPriorityPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "EmergencyPriority.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated EmergencyPriority is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace EmergencyPriority_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace EmergencyPriority_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type EmergencyPriority defined by the user in the IDL file. - * @ingroup EMERGENCYPRIORITY - */ - class EmergencyPriorityPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace EmergencyPriority_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type EmergencyPriority defined by the user in the IDL file. + * @ingroup EmergencyPriority + */ +class EmergencyPriorityPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef EmergencyPriority type; - typedef EmergencyPriority type; + eProsima_user_DllExport EmergencyPriorityPubSubType(); - eProsima_user_DllExport EmergencyPriorityPubSubType(); + eProsima_user_DllExport ~EmergencyPriorityPubSubType() override; - eProsima_user_DllExport virtual ~EmergencyPriorityPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EMERGENCYPRIORITY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.cxx index 528e147d29c..82ba9fe758e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.cxx @@ -14,9 +14,9 @@ /*! * @file ExteriorLights.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,149 +27,84 @@ char dummy; #endif // _WIN32 #include "ExteriorLights.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace ExteriorLights_Constants { +} // namespace ExteriorLights_Constants - - - -etsi_its_cam_msgs::msg::ExteriorLights::ExteriorLights() +ExteriorLights::ExteriorLights() { - // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@1a1d3c1a - - // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1c65121 - m_bits_unused = 0; - } -etsi_its_cam_msgs::msg::ExteriorLights::~ExteriorLights() +ExteriorLights::~ExteriorLights() { - } -etsi_its_cam_msgs::msg::ExteriorLights::ExteriorLights( +ExteriorLights::ExteriorLights( const ExteriorLights& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::ExteriorLights::ExteriorLights( - ExteriorLights&& x) +ExteriorLights::ExteriorLights( + ExteriorLights&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::ExteriorLights::operator =( +ExteriorLights& ExteriorLights::operator =( const ExteriorLights& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; - return *this; } -etsi_its_cam_msgs::msg::ExteriorLights& etsi_its_cam_msgs::msg::ExteriorLights::operator =( - ExteriorLights&& x) +ExteriorLights& ExteriorLights::operator =( + ExteriorLights&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; - return *this; } -bool etsi_its_cam_msgs::msg::ExteriorLights::operator ==( +bool ExteriorLights::operator ==( const ExteriorLights& x) const { - - return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); + return (m_value == x.m_value && + m_bits_unused == x.m_bits_unused); } -bool etsi_its_cam_msgs::msg::ExteriorLights::operator !=( +bool ExteriorLights::operator !=( const ExteriorLights& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ExteriorLights::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ExteriorLights::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ExteriorLights& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.value().size() > 0) - { - current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ExteriorLights::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - scdr << m_bits_unused; - -} - -void etsi_its_cam_msgs::msg::ExteriorLights::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; - dcdr >> m_bits_unused; -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void etsi_its_cam_msgs::msg::ExteriorLights::value( +void ExteriorLights::value( const std::vector& _value) { m_value = _value; @@ -179,7 +114,7 @@ void etsi_its_cam_msgs::msg::ExteriorLights::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void etsi_its_cam_msgs::msg::ExteriorLights::value( +void ExteriorLights::value( std::vector&& _value) { m_value = std::move(_value); @@ -189,7 +124,7 @@ void etsi_its_cam_msgs::msg::ExteriorLights::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::vector& etsi_its_cam_msgs::msg::ExteriorLights::value() const +const std::vector& ExteriorLights::value() const { return m_value; } @@ -198,15 +133,17 @@ const std::vector& etsi_its_cam_msgs::msg::ExteriorLights::value() cons * @brief This function returns a reference to member value * @return Reference to member value */ -std::vector& etsi_its_cam_msgs::msg::ExteriorLights::value() +std::vector& ExteriorLights::value() { return m_value; } + + /*! * @brief This function sets a value in member bits_unused * @param _bits_unused New value for member bits_unused */ -void etsi_its_cam_msgs::msg::ExteriorLights::bits_unused( +void ExteriorLights::bits_unused( uint8_t _bits_unused) { m_bits_unused = _bits_unused; @@ -216,7 +153,7 @@ void etsi_its_cam_msgs::msg::ExteriorLights::bits_unused( * @brief This function returns the value of member bits_unused * @return Value of member bits_unused */ -uint8_t etsi_its_cam_msgs::msg::ExteriorLights::bits_unused() const +uint8_t ExteriorLights::bits_unused() const { return m_bits_unused; } @@ -225,32 +162,18 @@ uint8_t etsi_its_cam_msgs::msg::ExteriorLights::bits_unused() const * @brief This function returns a reference to member bits_unused * @return Reference to member bits_unused */ -uint8_t& etsi_its_cam_msgs::msg::ExteriorLights::bits_unused() +uint8_t& ExteriorLights::bits_unused() { return m_bits_unused; } -size_t etsi_its_cam_msgs::msg::ExteriorLights::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::ExteriorLights::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::ExteriorLights::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ExteriorLightsCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.h index 8e7328dec49..2f631572b74 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLights.h @@ -16,19 +16,24 @@ * @file ExteriorLights.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,206 +47,164 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ExteriorLights_SOURCE) -#define ExteriorLights_DllAPI __declspec( dllexport ) +#if defined(EXTERIORLIGHTS_SOURCE) +#define EXTERIORLIGHTS_DllAPI __declspec( dllexport ) #else -#define ExteriorLights_DllAPI __declspec( dllimport ) -#endif // ExteriorLights_SOURCE +#define EXTERIORLIGHTS_DllAPI __declspec( dllimport ) +#endif // EXTERIORLIGHTS_SOURCE #else -#define ExteriorLights_DllAPI +#define EXTERIORLIGHTS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ExteriorLights_DllAPI +#define EXTERIORLIGHTS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace ExteriorLights_Constants { - const uint8_t SIZE_BITS = 8; - const uint8_t BIT_INDEX_LOW_BEAM_HEADLIGHTS_ON = 0; - const uint8_t BIT_INDEX_HIGH_BEAM_HEADLIGHTS_ON = 1; - const uint8_t BIT_INDEX_LEFT_TURN_SIGNAL_ON = 2; - const uint8_t BIT_INDEX_RIGHT_TURN_SIGNAL_ON = 3; - const uint8_t BIT_INDEX_DAYTIME_RUNNING_LIGHTS_ON = 4; - const uint8_t BIT_INDEX_REVERSE_LIGHT_ON = 5; - const uint8_t BIT_INDEX_FOG_LIGHT_ON = 6; - const uint8_t BIT_INDEX_PARKING_LIGHTS_ON = 7; - } // namespace ExteriorLights_Constants - /*! - * @brief This class represents the structure ExteriorLights defined by the user in the IDL file. - * @ingroup EXTERIORLIGHTS - */ - class ExteriorLights - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ExteriorLights(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ExteriorLights(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. - */ - eProsima_user_DllExport ExteriorLights( - const ExteriorLights& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. - */ - eProsima_user_DllExport ExteriorLights( - ExteriorLights&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. - */ - eProsima_user_DllExport ExteriorLights& operator =( - const ExteriorLights& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. - */ - eProsima_user_DllExport ExteriorLights& operator =( - ExteriorLights&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ExteriorLights object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ExteriorLights& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ExteriorLights object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ExteriorLights& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::vector& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::vector&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::vector& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::vector& value(); - /*! - * @brief This function sets a value in member bits_unused - * @param _bits_unused New value for member bits_unused - */ - eProsima_user_DllExport void bits_unused( - uint8_t _bits_unused); - - /*! - * @brief This function returns the value of member bits_unused - * @return Value of member bits_unused - */ - eProsima_user_DllExport uint8_t bits_unused() const; - - /*! - * @brief This function returns a reference to member bits_unused - * @return Reference to member bits_unused - */ - eProsima_user_DllExport uint8_t& bits_unused(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ExteriorLights& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_value; - uint8_t m_bits_unused; - }; - } // namespace msg + +namespace msg { + +namespace ExteriorLights_Constants { + +const uint8_t SIZE_BITS = 8; +const uint8_t BIT_INDEX_LOW_BEAM_HEADLIGHTS_ON = 0; +const uint8_t BIT_INDEX_HIGH_BEAM_HEADLIGHTS_ON = 1; +const uint8_t BIT_INDEX_LEFT_TURN_SIGNAL_ON = 2; +const uint8_t BIT_INDEX_RIGHT_TURN_SIGNAL_ON = 3; +const uint8_t BIT_INDEX_DAYTIME_RUNNING_LIGHTS_ON = 4; +const uint8_t BIT_INDEX_REVERSE_LIGHT_ON = 5; +const uint8_t BIT_INDEX_FOG_LIGHT_ON = 6; +const uint8_t BIT_INDEX_PARKING_LIGHTS_ON = 7; + +} // namespace ExteriorLights_Constants + + +/*! + * @brief This class represents the structure ExteriorLights defined by the user in the IDL file. + * @ingroup ExteriorLights + */ +class ExteriorLights +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ExteriorLights(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ExteriorLights(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. + */ + eProsima_user_DllExport ExteriorLights( + const ExteriorLights& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. + */ + eProsima_user_DllExport ExteriorLights( + ExteriorLights&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. + */ + eProsima_user_DllExport ExteriorLights& operator =( + const ExteriorLights& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ExteriorLights that will be copied. + */ + eProsima_user_DllExport ExteriorLights& operator =( + ExteriorLights&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ExteriorLights object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ExteriorLights& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ExteriorLights object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ExteriorLights& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + + + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + +private: + + std::vector m_value; + uint8_t m_bits_unused{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsCdrAux.hpp new file mode 100644 index 00000000000..9d7b629f34a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsCdrAux.hpp @@ -0,0 +1,69 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ExteriorLightsCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTSCDRAUX_HPP_ + +#include "ExteriorLights.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ExteriorLights_max_cdr_typesize {109UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ExteriorLights_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ExteriorLights& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsCdrAux.ipp new file mode 100644 index 00000000000..2db74b6dace --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsCdrAux.ipp @@ -0,0 +1,157 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ExteriorLightsCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTSCDRAUX_IPP_ + +#include "ExteriorLightsCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ExteriorLights& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bits_unused(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ExteriorLights& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() + << eprosima::fastcdr::MemberId(1) << data.bits_unused() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ExteriorLights& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + case 1: + dcdr >> data.bits_unused(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ExteriorLights& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.cxx index 08a0205150f..093ae1e8de1 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.cxx @@ -16,173 +16,205 @@ * @file ExteriorLightsPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ExteriorLightsPubSubTypes.h" +#include "ExteriorLightsCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace ExteriorLights_Constants { - - - - - - - - - - - } //End of namespace ExteriorLights_Constants - ExteriorLightsPubSubType::ExteriorLightsPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ExteriorLights_"); - auto type_size = ExteriorLights::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ExteriorLights::isKeyDefined(); - size_t keyLength = ExteriorLights::getKeyMaxCdrSerializedSize() > 16 ? - ExteriorLights::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ExteriorLightsPubSubType::~ExteriorLightsPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ExteriorLightsPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ExteriorLights* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ExteriorLightsPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ExteriorLights* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ExteriorLightsPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ExteriorLightsPubSubType::createData() - { - return reinterpret_cast(new ExteriorLights()); - } - - void ExteriorLightsPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ExteriorLightsPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ExteriorLights* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ExteriorLights::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ExteriorLights::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace ExteriorLights_Constants { + + + + + + + + + + + + + + + + + + + +} //End of namespace ExteriorLights_Constants + + + +ExteriorLightsPubSubType::ExteriorLightsPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ExteriorLights_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ExteriorLights::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ExteriorLights_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ExteriorLightsPubSubType::~ExteriorLightsPubSubType() +{ +} + +bool ExteriorLightsPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ExteriorLights* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ExteriorLightsPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ExteriorLights* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ExteriorLightsPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ExteriorLightsPubSubType::createData() +{ + return reinterpret_cast(new ExteriorLights()); +} + +void ExteriorLightsPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ExteriorLightsPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.h index 9f17312da29..1e154d4d3f7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ExteriorLightsPubSubTypes.h @@ -16,104 +16,140 @@ * @file ExteriorLightsPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ExteriorLights.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ExteriorLights is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace ExteriorLights_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace ExteriorLights_Constants { + + + + + + + + + + + + + +} // namespace ExteriorLights_Constants +/*! + * @brief This class represents the TopicDataType of the type ExteriorLights defined by the user in the IDL file. + * @ingroup ExteriorLights + */ +class ExteriorLightsPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - } - /*! - * @brief This class represents the TopicDataType of the type ExteriorLights defined by the user in the IDL file. - * @ingroup EXTERIORLIGHTS - */ - class ExteriorLightsPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef ExteriorLights type; - typedef ExteriorLights type; + eProsima_user_DllExport ExteriorLightsPubSubType(); - eProsima_user_DllExport ExteriorLightsPubSubType(); + eProsima_user_DllExport ~ExteriorLightsPubSubType() override; - eProsima_user_DllExport virtual ~ExteriorLightsPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_EXTERIORLIGHTS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.cxx index 5297c4ca1ed..6977ad30d92 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.cxx @@ -14,9 +14,9 @@ /*! * @file GenerationDeltaTime.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,117 +27,79 @@ char dummy; #endif // _WIN32 #include "GenerationDeltaTime.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace GenerationDeltaTime_Constants { + + +} // namespace GenerationDeltaTime_Constants -etsi_its_cam_msgs::msg::GenerationDeltaTime::GenerationDeltaTime() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1c80e49b - m_value = 0; +GenerationDeltaTime::GenerationDeltaTime() +{ } -etsi_its_cam_msgs::msg::GenerationDeltaTime::~GenerationDeltaTime() +GenerationDeltaTime::~GenerationDeltaTime() { } -etsi_its_cam_msgs::msg::GenerationDeltaTime::GenerationDeltaTime( +GenerationDeltaTime::GenerationDeltaTime( const GenerationDeltaTime& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::GenerationDeltaTime::GenerationDeltaTime( - GenerationDeltaTime&& x) +GenerationDeltaTime::GenerationDeltaTime( + GenerationDeltaTime&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::GenerationDeltaTime::operator =( +GenerationDeltaTime& GenerationDeltaTime::operator =( const GenerationDeltaTime& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::GenerationDeltaTime& etsi_its_cam_msgs::msg::GenerationDeltaTime::operator =( - GenerationDeltaTime&& x) +GenerationDeltaTime& GenerationDeltaTime::operator =( + GenerationDeltaTime&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::GenerationDeltaTime::operator ==( +bool GenerationDeltaTime::operator ==( const GenerationDeltaTime& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::GenerationDeltaTime::operator !=( +bool GenerationDeltaTime::operator !=( const GenerationDeltaTime& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::GenerationDeltaTime::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::GenerationDeltaTime::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::GenerationDeltaTime& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::GenerationDeltaTime::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::GenerationDeltaTime::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::GenerationDeltaTime::value( +void GenerationDeltaTime::value( uint16_t _value) { m_value = _value; @@ -147,7 +109,7 @@ void etsi_its_cam_msgs::msg::GenerationDeltaTime::value( * @brief This function returns the value of member value * @return Value of member value */ -uint16_t etsi_its_cam_msgs::msg::GenerationDeltaTime::value() const +uint16_t GenerationDeltaTime::value() const { return m_value; } @@ -156,32 +118,18 @@ uint16_t etsi_its_cam_msgs::msg::GenerationDeltaTime::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint16_t& etsi_its_cam_msgs::msg::GenerationDeltaTime::value() +uint16_t& GenerationDeltaTime::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::GenerationDeltaTime::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::GenerationDeltaTime::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::GenerationDeltaTime::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "GenerationDeltaTimeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.h index f60dc0d2b54..26b4d1d69d2 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTime.h @@ -16,19 +16,24 @@ * @file GenerationDeltaTime.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,174 +47,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(GenerationDeltaTime_SOURCE) -#define GenerationDeltaTime_DllAPI __declspec( dllexport ) +#if defined(GENERATIONDELTATIME_SOURCE) +#define GENERATIONDELTATIME_DllAPI __declspec( dllexport ) #else -#define GenerationDeltaTime_DllAPI __declspec( dllimport ) -#endif // GenerationDeltaTime_SOURCE +#define GENERATIONDELTATIME_DllAPI __declspec( dllimport ) +#endif // GENERATIONDELTATIME_SOURCE #else -#define GenerationDeltaTime_DllAPI +#define GENERATIONDELTATIME_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define GenerationDeltaTime_DllAPI +#define GENERATIONDELTATIME_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace GenerationDeltaTime_Constants { - const uint16_t MIN = 0; - const uint16_t MAX = 65535; - const uint16_t ONE_MILLI_SEC = 1; - } // namespace GenerationDeltaTime_Constants - /*! - * @brief This class represents the structure GenerationDeltaTime defined by the user in the IDL file. - * @ingroup GENERATIONDELTATIME - */ - class GenerationDeltaTime - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GenerationDeltaTime(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GenerationDeltaTime(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. - */ - eProsima_user_DllExport GenerationDeltaTime( - const GenerationDeltaTime& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. - */ - eProsima_user_DllExport GenerationDeltaTime( - GenerationDeltaTime&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. - */ - eProsima_user_DllExport GenerationDeltaTime& operator =( - const GenerationDeltaTime& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. - */ - eProsima_user_DllExport GenerationDeltaTime& operator =( - GenerationDeltaTime&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::GenerationDeltaTime object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GenerationDeltaTime& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::GenerationDeltaTime object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GenerationDeltaTime& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::GenerationDeltaTime& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace GenerationDeltaTime_Constants { + +const uint16_t MIN = 0; +const uint16_t MAX = 65535; +const uint16_t ONE_MILLI_SEC = 1; + +} // namespace GenerationDeltaTime_Constants + + +/*! + * @brief This class represents the structure GenerationDeltaTime defined by the user in the IDL file. + * @ingroup GenerationDeltaTime + */ +class GenerationDeltaTime +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GenerationDeltaTime(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GenerationDeltaTime(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. + */ + eProsima_user_DllExport GenerationDeltaTime( + const GenerationDeltaTime& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. + */ + eProsima_user_DllExport GenerationDeltaTime( + GenerationDeltaTime&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. + */ + eProsima_user_DllExport GenerationDeltaTime& operator =( + const GenerationDeltaTime& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::GenerationDeltaTime that will be copied. + */ + eProsima_user_DllExport GenerationDeltaTime& operator =( + GenerationDeltaTime&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::GenerationDeltaTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GenerationDeltaTime& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::GenerationDeltaTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GenerationDeltaTime& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + +private: + + uint16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimeCdrAux.hpp new file mode 100644 index 00000000000..2e2fa37bd83 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimeCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GenerationDeltaTimeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIMECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIMECDRAUX_HPP_ + +#include "GenerationDeltaTime.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_GenerationDeltaTime_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_GenerationDeltaTime_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::GenerationDeltaTime& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIMECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimeCdrAux.ipp new file mode 100644 index 00000000000..b229122dbb0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimeCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file GenerationDeltaTimeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIMECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIMECDRAUX_IPP_ + +#include "GenerationDeltaTimeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::GenerationDeltaTime& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::GenerationDeltaTime& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::GenerationDeltaTime& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::GenerationDeltaTime& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIMECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.cxx index ce2720ba3de..a294465098a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.cxx @@ -16,167 +16,193 @@ * @file GenerationDeltaTimePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "GenerationDeltaTimePubSubTypes.h" +#include "GenerationDeltaTimeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace GenerationDeltaTime_Constants { - - - - - } //End of namespace GenerationDeltaTime_Constants - GenerationDeltaTimePubSubType::GenerationDeltaTimePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::GenerationDeltaTime_"); - auto type_size = GenerationDeltaTime::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = GenerationDeltaTime::isKeyDefined(); - size_t keyLength = GenerationDeltaTime::getKeyMaxCdrSerializedSize() > 16 ? - GenerationDeltaTime::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - GenerationDeltaTimePubSubType::~GenerationDeltaTimePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool GenerationDeltaTimePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - GenerationDeltaTime* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool GenerationDeltaTimePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - GenerationDeltaTime* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function GenerationDeltaTimePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* GenerationDeltaTimePubSubType::createData() - { - return reinterpret_cast(new GenerationDeltaTime()); - } - - void GenerationDeltaTimePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool GenerationDeltaTimePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - GenerationDeltaTime* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - GenerationDeltaTime::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || GenerationDeltaTime::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace GenerationDeltaTime_Constants { + + + + + + + +} //End of namespace GenerationDeltaTime_Constants + + + +GenerationDeltaTimePubSubType::GenerationDeltaTimePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::GenerationDeltaTime_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(GenerationDeltaTime::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_GenerationDeltaTime_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +GenerationDeltaTimePubSubType::~GenerationDeltaTimePubSubType() +{ +} + +bool GenerationDeltaTimePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + GenerationDeltaTime* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool GenerationDeltaTimePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + GenerationDeltaTime* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function GenerationDeltaTimePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* GenerationDeltaTimePubSubType::createData() +{ + return reinterpret_cast(new GenerationDeltaTime()); +} + +void GenerationDeltaTimePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool GenerationDeltaTimePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.h index 3cc56e8f5da..4844dc0f3df 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/GenerationDeltaTimePubSubTypes.h @@ -16,98 +16,128 @@ * @file GenerationDeltaTimePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "GenerationDeltaTime.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated GenerationDeltaTime is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace GenerationDeltaTime_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace GenerationDeltaTime_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type GenerationDeltaTime defined by the user in the IDL file. - * @ingroup GENERATIONDELTATIME - */ - class GenerationDeltaTimePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace GenerationDeltaTime_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type GenerationDeltaTime defined by the user in the IDL file. + * @ingroup GenerationDeltaTime + */ +class GenerationDeltaTimePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef GenerationDeltaTime type; - typedef GenerationDeltaTime type; + eProsima_user_DllExport GenerationDeltaTimePubSubType(); - eProsima_user_DllExport GenerationDeltaTimePubSubType(); + eProsima_user_DllExport ~GenerationDeltaTimePubSubType() override; - eProsima_user_DllExport virtual ~GenerationDeltaTimePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) GenerationDeltaTime(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_GENERATIONDELTATIME_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.cxx index b64e21673e6..5dc56e50f0f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.cxx @@ -14,9 +14,9 @@ /*! * @file HardShoulderStatus.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,117 +27,79 @@ char dummy; #endif // _WIN32 #include "HardShoulderStatus.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace HardShoulderStatus_Constants { + + +} // namespace HardShoulderStatus_Constants -etsi_its_cam_msgs::msg::HardShoulderStatus::HardShoulderStatus() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4b6579e8 - m_value = 0; +HardShoulderStatus::HardShoulderStatus() +{ } -etsi_its_cam_msgs::msg::HardShoulderStatus::~HardShoulderStatus() +HardShoulderStatus::~HardShoulderStatus() { } -etsi_its_cam_msgs::msg::HardShoulderStatus::HardShoulderStatus( +HardShoulderStatus::HardShoulderStatus( const HardShoulderStatus& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::HardShoulderStatus::HardShoulderStatus( - HardShoulderStatus&& x) +HardShoulderStatus::HardShoulderStatus( + HardShoulderStatus&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::HardShoulderStatus::operator =( +HardShoulderStatus& HardShoulderStatus::operator =( const HardShoulderStatus& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::HardShoulderStatus& etsi_its_cam_msgs::msg::HardShoulderStatus::operator =( - HardShoulderStatus&& x) +HardShoulderStatus& HardShoulderStatus::operator =( + HardShoulderStatus&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::HardShoulderStatus::operator ==( +bool HardShoulderStatus::operator ==( const HardShoulderStatus& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::HardShoulderStatus::operator !=( +bool HardShoulderStatus::operator !=( const HardShoulderStatus& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::HardShoulderStatus::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::HardShoulderStatus::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::HardShoulderStatus& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::HardShoulderStatus::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::HardShoulderStatus::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::HardShoulderStatus::value( +void HardShoulderStatus::value( uint8_t _value) { m_value = _value; @@ -147,7 +109,7 @@ void etsi_its_cam_msgs::msg::HardShoulderStatus::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::HardShoulderStatus::value() const +uint8_t HardShoulderStatus::value() const { return m_value; } @@ -156,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::HardShoulderStatus::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::HardShoulderStatus::value() +uint8_t& HardShoulderStatus::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::HardShoulderStatus::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::HardShoulderStatus::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::HardShoulderStatus::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "HardShoulderStatusCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.h index 074a54f459b..42619c8fc9c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatus.h @@ -16,19 +16,24 @@ * @file HardShoulderStatus.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,174 +47,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HardShoulderStatus_SOURCE) -#define HardShoulderStatus_DllAPI __declspec( dllexport ) +#if defined(HARDSHOULDERSTATUS_SOURCE) +#define HARDSHOULDERSTATUS_DllAPI __declspec( dllexport ) #else -#define HardShoulderStatus_DllAPI __declspec( dllimport ) -#endif // HardShoulderStatus_SOURCE +#define HARDSHOULDERSTATUS_DllAPI __declspec( dllimport ) +#endif // HARDSHOULDERSTATUS_SOURCE #else -#define HardShoulderStatus_DllAPI +#define HARDSHOULDERSTATUS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define HardShoulderStatus_DllAPI +#define HARDSHOULDERSTATUS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace HardShoulderStatus_Constants { - const uint8_t AVAILABLE_FOR_STOPPING = 0; - const uint8_t CLOSED = 1; - const uint8_t AVAILABLE_FOR_DRIVING = 2; - } // namespace HardShoulderStatus_Constants - /*! - * @brief This class represents the structure HardShoulderStatus defined by the user in the IDL file. - * @ingroup HARDSHOULDERSTATUS - */ - class HardShoulderStatus - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HardShoulderStatus(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HardShoulderStatus(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. - */ - eProsima_user_DllExport HardShoulderStatus( - const HardShoulderStatus& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. - */ - eProsima_user_DllExport HardShoulderStatus( - HardShoulderStatus&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. - */ - eProsima_user_DllExport HardShoulderStatus& operator =( - const HardShoulderStatus& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. - */ - eProsima_user_DllExport HardShoulderStatus& operator =( - HardShoulderStatus&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::HardShoulderStatus object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HardShoulderStatus& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::HardShoulderStatus object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HardShoulderStatus& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::HardShoulderStatus& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace HardShoulderStatus_Constants { + +const uint8_t AVAILABLE_FOR_STOPPING = 0; +const uint8_t CLOSED = 1; +const uint8_t AVAILABLE_FOR_DRIVING = 2; + +} // namespace HardShoulderStatus_Constants + + +/*! + * @brief This class represents the structure HardShoulderStatus defined by the user in the IDL file. + * @ingroup HardShoulderStatus + */ +class HardShoulderStatus +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HardShoulderStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HardShoulderStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. + */ + eProsima_user_DllExport HardShoulderStatus( + const HardShoulderStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. + */ + eProsima_user_DllExport HardShoulderStatus( + HardShoulderStatus&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. + */ + eProsima_user_DllExport HardShoulderStatus& operator =( + const HardShoulderStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HardShoulderStatus that will be copied. + */ + eProsima_user_DllExport HardShoulderStatus& operator =( + HardShoulderStatus&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HardShoulderStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HardShoulderStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HardShoulderStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HardShoulderStatus& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusCdrAux.hpp new file mode 100644 index 00000000000..3ef7f64a7e6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HardShoulderStatusCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUSCDRAUX_HPP_ + +#include "HardShoulderStatus.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_HardShoulderStatus_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_HardShoulderStatus_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HardShoulderStatus& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusCdrAux.ipp new file mode 100644 index 00000000000..009ead23d8a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HardShoulderStatusCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUSCDRAUX_IPP_ + +#include "HardShoulderStatusCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::HardShoulderStatus& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HardShoulderStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::HardShoulderStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HardShoulderStatus& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.cxx index 3dbbade709c..e30653c4183 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.cxx @@ -16,167 +16,193 @@ * @file HardShoulderStatusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "HardShoulderStatusPubSubTypes.h" +#include "HardShoulderStatusCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace HardShoulderStatus_Constants { - - - - - } //End of namespace HardShoulderStatus_Constants - HardShoulderStatusPubSubType::HardShoulderStatusPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::HardShoulderStatus_"); - auto type_size = HardShoulderStatus::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = HardShoulderStatus::isKeyDefined(); - size_t keyLength = HardShoulderStatus::getKeyMaxCdrSerializedSize() > 16 ? - HardShoulderStatus::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - HardShoulderStatusPubSubType::~HardShoulderStatusPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool HardShoulderStatusPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - HardShoulderStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool HardShoulderStatusPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - HardShoulderStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function HardShoulderStatusPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* HardShoulderStatusPubSubType::createData() - { - return reinterpret_cast(new HardShoulderStatus()); - } - - void HardShoulderStatusPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool HardShoulderStatusPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - HardShoulderStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - HardShoulderStatus::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || HardShoulderStatus::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace HardShoulderStatus_Constants { + + + + + + + +} //End of namespace HardShoulderStatus_Constants + + + +HardShoulderStatusPubSubType::HardShoulderStatusPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::HardShoulderStatus_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HardShoulderStatus::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_HardShoulderStatus_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +HardShoulderStatusPubSubType::~HardShoulderStatusPubSubType() +{ +} + +bool HardShoulderStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + HardShoulderStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool HardShoulderStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + HardShoulderStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function HardShoulderStatusPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* HardShoulderStatusPubSubType::createData() +{ + return reinterpret_cast(new HardShoulderStatus()); +} + +void HardShoulderStatusPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HardShoulderStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.h index e638ab6b0ba..b6a92e010b9 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HardShoulderStatusPubSubTypes.h @@ -16,98 +16,128 @@ * @file HardShoulderStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "HardShoulderStatus.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated HardShoulderStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace HardShoulderStatus_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace HardShoulderStatus_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type HardShoulderStatus defined by the user in the IDL file. - * @ingroup HARDSHOULDERSTATUS - */ - class HardShoulderStatusPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace HardShoulderStatus_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type HardShoulderStatus defined by the user in the IDL file. + * @ingroup HardShoulderStatus + */ +class HardShoulderStatusPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef HardShoulderStatus type; - typedef HardShoulderStatus type; + eProsima_user_DllExport HardShoulderStatusPubSubType(); - eProsima_user_DllExport HardShoulderStatusPubSubType(); + eProsima_user_DllExport ~HardShoulderStatusPubSubType() override; - eProsima_user_DllExport virtual ~HardShoulderStatusPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) HardShoulderStatus(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HARDSHOULDERSTATUS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.cxx index 752564e14a1..83296bf9255 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.cxx @@ -14,9 +14,9 @@ /*! * @file Heading.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "Heading.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::Heading::Heading() -{ - // m_heading_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4650a407 - // m_heading_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@30135202 +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::Heading::~Heading() +Heading::Heading() { +} +Heading::~Heading() +{ } -etsi_its_cam_msgs::msg::Heading::Heading( +Heading::Heading( const Heading& x) { m_heading_value = x.m_heading_value; m_heading_confidence = x.m_heading_confidence; } -etsi_its_cam_msgs::msg::Heading::Heading( - Heading&& x) +Heading::Heading( + Heading&& x) noexcept { m_heading_value = std::move(x.m_heading_value); m_heading_confidence = std::move(x.m_heading_confidence); } -etsi_its_cam_msgs::msg::Heading& etsi_its_cam_msgs::msg::Heading::operator =( +Heading& Heading::operator =( const Heading& x) { m_heading_value = x.m_heading_value; m_heading_confidence = x.m_heading_confidence; - return *this; } -etsi_its_cam_msgs::msg::Heading& etsi_its_cam_msgs::msg::Heading::operator =( - Heading&& x) +Heading& Heading::operator =( + Heading&& x) noexcept { m_heading_value = std::move(x.m_heading_value); m_heading_confidence = std::move(x.m_heading_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::Heading::operator ==( +bool Heading::operator ==( const Heading& x) const { - - return (m_heading_value == x.m_heading_value && m_heading_confidence == x.m_heading_confidence); + return (m_heading_value == x.m_heading_value && + m_heading_confidence == x.m_heading_confidence); } -bool etsi_its_cam_msgs::msg::Heading::operator !=( +bool Heading::operator !=( const Heading& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::Heading::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::HeadingValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::HeadingConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::Heading::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Heading& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::HeadingValue::getCdrSerializedSize(data.heading_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::HeadingConfidence::getCdrSerializedSize(data.heading_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::Heading::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_heading_value; - scdr << m_heading_confidence; - -} - -void etsi_its_cam_msgs::msg::Heading::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_heading_value; - dcdr >> m_heading_confidence; -} - /*! * @brief This function copies the value in member heading_value * @param _heading_value New value to be copied in member heading_value */ -void etsi_its_cam_msgs::msg::Heading::heading_value( +void Heading::heading_value( const etsi_its_cam_msgs::msg::HeadingValue& _heading_value) { m_heading_value = _heading_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::Heading::heading_value( * @brief This function moves the value in member heading_value * @param _heading_value New value to be moved in member heading_value */ -void etsi_its_cam_msgs::msg::Heading::heading_value( +void Heading::heading_value( etsi_its_cam_msgs::msg::HeadingValue&& _heading_value) { m_heading_value = std::move(_heading_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::Heading::heading_value( * @brief This function returns a constant reference to member heading_value * @return Constant reference to member heading_value */ -const etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::Heading::heading_value() const +const etsi_its_cam_msgs::msg::HeadingValue& Heading::heading_value() const { return m_heading_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::Heading::hea * @brief This function returns a reference to member heading_value * @return Reference to member heading_value */ -etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::Heading::heading_value() +etsi_its_cam_msgs::msg::HeadingValue& Heading::heading_value() { return m_heading_value; } + + /*! * @brief This function copies the value in member heading_confidence * @param _heading_confidence New value to be copied in member heading_confidence */ -void etsi_its_cam_msgs::msg::Heading::heading_confidence( +void Heading::heading_confidence( const etsi_its_cam_msgs::msg::HeadingConfidence& _heading_confidence) { m_heading_confidence = _heading_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::Heading::heading_confidence( * @brief This function moves the value in member heading_confidence * @param _heading_confidence New value to be moved in member heading_confidence */ -void etsi_its_cam_msgs::msg::Heading::heading_confidence( +void Heading::heading_confidence( etsi_its_cam_msgs::msg::HeadingConfidence&& _heading_confidence) { m_heading_confidence = std::move(_heading_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::Heading::heading_confidence( * @brief This function returns a constant reference to member heading_confidence * @return Constant reference to member heading_confidence */ -const etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::Heading::heading_confidence() const +const etsi_its_cam_msgs::msg::HeadingConfidence& Heading::heading_confidence() const { return m_heading_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::Heading * @brief This function returns a reference to member heading_confidence * @return Reference to member heading_confidence */ -etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::Heading::heading_confidence() +etsi_its_cam_msgs::msg::HeadingConfidence& Heading::heading_confidence() { return m_heading_confidence; } -size_t etsi_its_cam_msgs::msg::Heading::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::Heading::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::Heading::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "HeadingCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.h index 6af346dd677..1aa86a0329d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Heading.h @@ -16,21 +16,26 @@ * @file Heading.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_H_ -#include "HeadingConfidence.h" -#include "HeadingValue.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "HeadingConfidence.h" +#include "HeadingValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Heading_SOURCE) -#define Heading_DllAPI __declspec( dllexport ) +#if defined(HEADING_SOURCE) +#define HEADING_DllAPI __declspec( dllexport ) #else -#define Heading_DllAPI __declspec( dllimport ) -#endif // Heading_SOURCE +#define HEADING_DllAPI __declspec( dllimport ) +#endif // HEADING_SOURCE #else -#define Heading_DllAPI +#define HEADING_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Heading_DllAPI +#define HEADING_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure Heading defined by the user in the IDL file. - * @ingroup HEADING - */ - class Heading - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Heading(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Heading(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. - */ - eProsima_user_DllExport Heading( - const Heading& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. - */ - eProsima_user_DllExport Heading( - Heading&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. - */ - eProsima_user_DllExport Heading& operator =( - const Heading& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. - */ - eProsima_user_DllExport Heading& operator =( - Heading&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Heading object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Heading& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Heading object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Heading& x) const; - - /*! - * @brief This function copies the value in member heading_value - * @param _heading_value New value to be copied in member heading_value - */ - eProsima_user_DllExport void heading_value( - const etsi_its_cam_msgs::msg::HeadingValue& _heading_value); - - /*! - * @brief This function moves the value in member heading_value - * @param _heading_value New value to be moved in member heading_value - */ - eProsima_user_DllExport void heading_value( - etsi_its_cam_msgs::msg::HeadingValue&& _heading_value); - - /*! - * @brief This function returns a constant reference to member heading_value - * @return Constant reference to member heading_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingValue& heading_value() const; - - /*! - * @brief This function returns a reference to member heading_value - * @return Reference to member heading_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingValue& heading_value(); - /*! - * @brief This function copies the value in member heading_confidence - * @param _heading_confidence New value to be copied in member heading_confidence - */ - eProsima_user_DllExport void heading_confidence( - const etsi_its_cam_msgs::msg::HeadingConfidence& _heading_confidence); - - /*! - * @brief This function moves the value in member heading_confidence - * @param _heading_confidence New value to be moved in member heading_confidence - */ - eProsima_user_DllExport void heading_confidence( - etsi_its_cam_msgs::msg::HeadingConfidence&& _heading_confidence); - - /*! - * @brief This function returns a constant reference to member heading_confidence - * @return Constant reference to member heading_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingConfidence& heading_confidence() const; - - /*! - * @brief This function returns a reference to member heading_confidence - * @return Reference to member heading_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingConfidence& heading_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Heading& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::HeadingValue m_heading_value; - etsi_its_cam_msgs::msg::HeadingConfidence m_heading_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Heading defined by the user in the IDL file. + * @ingroup Heading + */ +class Heading +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Heading(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Heading(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. + */ + eProsima_user_DllExport Heading( + const Heading& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. + */ + eProsima_user_DllExport Heading( + Heading&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. + */ + eProsima_user_DllExport Heading& operator =( + const Heading& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Heading that will be copied. + */ + eProsima_user_DllExport Heading& operator =( + Heading&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Heading object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Heading& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Heading object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Heading& x) const; + + /*! + * @brief This function copies the value in member heading_value + * @param _heading_value New value to be copied in member heading_value + */ + eProsima_user_DllExport void heading_value( + const etsi_its_cam_msgs::msg::HeadingValue& _heading_value); + + /*! + * @brief This function moves the value in member heading_value + * @param _heading_value New value to be moved in member heading_value + */ + eProsima_user_DllExport void heading_value( + etsi_its_cam_msgs::msg::HeadingValue&& _heading_value); + + /*! + * @brief This function returns a constant reference to member heading_value + * @return Constant reference to member heading_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingValue& heading_value() const; + + /*! + * @brief This function returns a reference to member heading_value + * @return Reference to member heading_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingValue& heading_value(); + + + /*! + * @brief This function copies the value in member heading_confidence + * @param _heading_confidence New value to be copied in member heading_confidence + */ + eProsima_user_DllExport void heading_confidence( + const etsi_its_cam_msgs::msg::HeadingConfidence& _heading_confidence); + + /*! + * @brief This function moves the value in member heading_confidence + * @param _heading_confidence New value to be moved in member heading_confidence + */ + eProsima_user_DllExport void heading_confidence( + etsi_its_cam_msgs::msg::HeadingConfidence&& _heading_confidence); + + /*! + * @brief This function returns a constant reference to member heading_confidence + * @return Constant reference to member heading_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingConfidence& heading_confidence() const; + + /*! + * @brief This function returns a reference to member heading_confidence + * @return Reference to member heading_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingConfidence& heading_confidence(); + +private: + + etsi_its_cam_msgs::msg::HeadingValue m_heading_value; + etsi_its_cam_msgs::msg::HeadingConfidence m_heading_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingCdrAux.hpp new file mode 100644 index 00000000000..9c964569323 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCDRAUX_HPP_ + +#include "Heading.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_Heading_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_Heading_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Heading& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingCdrAux.ipp new file mode 100644 index 00000000000..4f575a69372 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCDRAUX_IPP_ + +#include "HeadingCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::Heading& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.heading_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.heading_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Heading& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.heading_value() + << eprosima::fastcdr::MemberId(1) << data.heading_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::Heading& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.heading_value(); + break; + + case 1: + dcdr >> data.heading_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Heading& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.cxx index a1a724e300b..35bfad72b4b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.cxx @@ -14,9 +14,9 @@ /*! * @file HeadingConfidence.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,120 +27,79 @@ char dummy; #endif // _WIN32 #include "HeadingConfidence.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace HeadingConfidence_Constants { +} // namespace HeadingConfidence_Constants -etsi_its_cam_msgs::msg::HeadingConfidence::HeadingConfidence() +HeadingConfidence::HeadingConfidence() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@551de37d - m_value = 0; - } -etsi_its_cam_msgs::msg::HeadingConfidence::~HeadingConfidence() +HeadingConfidence::~HeadingConfidence() { } -etsi_its_cam_msgs::msg::HeadingConfidence::HeadingConfidence( +HeadingConfidence::HeadingConfidence( const HeadingConfidence& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::HeadingConfidence::HeadingConfidence( - HeadingConfidence&& x) +HeadingConfidence::HeadingConfidence( + HeadingConfidence&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::HeadingConfidence::operator =( +HeadingConfidence& HeadingConfidence::operator =( const HeadingConfidence& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::HeadingConfidence& etsi_its_cam_msgs::msg::HeadingConfidence::operator =( - HeadingConfidence&& x) +HeadingConfidence& HeadingConfidence::operator =( + HeadingConfidence&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::HeadingConfidence::operator ==( +bool HeadingConfidence::operator ==( const HeadingConfidence& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::HeadingConfidence::operator !=( +bool HeadingConfidence::operator !=( const HeadingConfidence& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::HeadingConfidence::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::HeadingConfidence::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::HeadingConfidence& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::HeadingConfidence::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::HeadingConfidence::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::HeadingConfidence::value( +void HeadingConfidence::value( uint8_t _value) { m_value = _value; @@ -150,7 +109,7 @@ void etsi_its_cam_msgs::msg::HeadingConfidence::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::HeadingConfidence::value() const +uint8_t HeadingConfidence::value() const { return m_value; } @@ -159,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::HeadingConfidence::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::HeadingConfidence::value() +uint8_t& HeadingConfidence::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::HeadingConfidence::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::HeadingConfidence::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::HeadingConfidence::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "HeadingConfidenceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.h index 624e986be8d..dbe824c5972 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidence.h @@ -16,19 +16,24 @@ * @file HeadingConfidence.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,177 +47,133 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HeadingConfidence_SOURCE) -#define HeadingConfidence_DllAPI __declspec( dllexport ) +#if defined(HEADINGCONFIDENCE_SOURCE) +#define HEADINGCONFIDENCE_DllAPI __declspec( dllexport ) #else -#define HeadingConfidence_DllAPI __declspec( dllimport ) -#endif // HeadingConfidence_SOURCE +#define HEADINGCONFIDENCE_DllAPI __declspec( dllimport ) +#endif // HEADINGCONFIDENCE_SOURCE #else -#define HeadingConfidence_DllAPI +#define HEADINGCONFIDENCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define HeadingConfidence_DllAPI +#define HEADINGCONFIDENCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace HeadingConfidence_Constants { - const uint8_t MIN = 1; - const uint8_t MAX = 127; - const uint8_t EQUAL_OR_WITHIN_ZERO_POINT_ONE_DEGREE = 1; - const uint8_t EQUAL_OR_WITHIN_ONE_DEGREE = 10; - const uint8_t OUT_OF_RANGE = 126; - const uint8_t UNAVAILABLE = 127; - } // namespace HeadingConfidence_Constants - /*! - * @brief This class represents the structure HeadingConfidence defined by the user in the IDL file. - * @ingroup HEADINGCONFIDENCE - */ - class HeadingConfidence - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HeadingConfidence(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HeadingConfidence(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. - */ - eProsima_user_DllExport HeadingConfidence( - const HeadingConfidence& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. - */ - eProsima_user_DllExport HeadingConfidence( - HeadingConfidence&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. - */ - eProsima_user_DllExport HeadingConfidence& operator =( - const HeadingConfidence& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. - */ - eProsima_user_DllExport HeadingConfidence& operator =( - HeadingConfidence&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::HeadingConfidence object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HeadingConfidence& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::HeadingConfidence object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HeadingConfidence& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::HeadingConfidence& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace HeadingConfidence_Constants { + +const uint8_t MIN = 1; +const uint8_t MAX = 127; +const uint8_t EQUAL_OR_WITHIN_ZERO_POINT_ONE_DEGREE = 1; +const uint8_t EQUAL_OR_WITHIN_ONE_DEGREE = 10; +const uint8_t OUT_OF_RANGE = 126; +const uint8_t UNAVAILABLE = 127; + +} // namespace HeadingConfidence_Constants + + +/*! + * @brief This class represents the structure HeadingConfidence defined by the user in the IDL file. + * @ingroup HeadingConfidence + */ +class HeadingConfidence +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HeadingConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HeadingConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. + */ + eProsima_user_DllExport HeadingConfidence( + const HeadingConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. + */ + eProsima_user_DllExport HeadingConfidence( + HeadingConfidence&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. + */ + eProsima_user_DllExport HeadingConfidence& operator =( + const HeadingConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingConfidence that will be copied. + */ + eProsima_user_DllExport HeadingConfidence& operator =( + HeadingConfidence&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HeadingConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HeadingConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HeadingConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HeadingConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidenceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidenceCdrAux.hpp new file mode 100644 index 00000000000..3c96dfecbb9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidenceCdrAux.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingConfidenceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCECDRAUX_HPP_ + +#include "HeadingConfidence.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_HeadingConfidence_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_HeadingConfidence_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HeadingConfidence& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidenceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidenceCdrAux.ipp new file mode 100644 index 00000000000..f9b6024d3b1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidenceCdrAux.ipp @@ -0,0 +1,143 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingConfidenceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCECDRAUX_IPP_ + +#include "HeadingConfidenceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::HeadingConfidence& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HeadingConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::HeadingConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HeadingConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.cxx index 0e4159f952f..7e621329e29 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.cxx @@ -16,170 +16,199 @@ * @file HeadingConfidencePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "HeadingConfidencePubSubTypes.h" +#include "HeadingConfidenceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace HeadingConfidence_Constants { - - - - - - - - } //End of namespace HeadingConfidence_Constants - HeadingConfidencePubSubType::HeadingConfidencePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::HeadingConfidence_"); - auto type_size = HeadingConfidence::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = HeadingConfidence::isKeyDefined(); - size_t keyLength = HeadingConfidence::getKeyMaxCdrSerializedSize() > 16 ? - HeadingConfidence::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - HeadingConfidencePubSubType::~HeadingConfidencePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool HeadingConfidencePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - HeadingConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool HeadingConfidencePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - HeadingConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function HeadingConfidencePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* HeadingConfidencePubSubType::createData() - { - return reinterpret_cast(new HeadingConfidence()); - } - - void HeadingConfidencePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool HeadingConfidencePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - HeadingConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - HeadingConfidence::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || HeadingConfidence::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace HeadingConfidence_Constants { + + + + + + + + + + + + + +} //End of namespace HeadingConfidence_Constants + + + +HeadingConfidencePubSubType::HeadingConfidencePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::HeadingConfidence_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HeadingConfidence::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_HeadingConfidence_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +HeadingConfidencePubSubType::~HeadingConfidencePubSubType() +{ +} + +bool HeadingConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + HeadingConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool HeadingConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + HeadingConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function HeadingConfidencePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* HeadingConfidencePubSubType::createData() +{ + return reinterpret_cast(new HeadingConfidence()); +} + +void HeadingConfidencePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HeadingConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.h index 5e3cd54f2db..5ff4381d450 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingConfidencePubSubTypes.h @@ -16,101 +16,134 @@ * @file HeadingConfidencePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "HeadingConfidence.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated HeadingConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace HeadingConfidence_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace HeadingConfidence_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type HeadingConfidence defined by the user in the IDL file. - * @ingroup HEADINGCONFIDENCE - */ - class HeadingConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef HeadingConfidence type; - eProsima_user_DllExport HeadingConfidencePubSubType(); - eProsima_user_DllExport virtual ~HeadingConfidencePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +} // namespace HeadingConfidence_Constants - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type HeadingConfidence defined by the user in the IDL file. + * @ingroup HeadingConfidence + */ +class HeadingConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + typedef HeadingConfidence type; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport HeadingConfidencePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport ~HeadingConfidencePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) HeadingConfidence(); - return true; - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGCONFIDENCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.cxx index d5e1f68613f..d7e7330a482 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file HeadingPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "HeadingPubSubTypes.h" +#include "HeadingCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - HeadingPubSubType::HeadingPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::Heading_"); - auto type_size = Heading::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Heading::isKeyDefined(); - size_t keyLength = Heading::getKeyMaxCdrSerializedSize() > 16 ? - Heading::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - HeadingPubSubType::~HeadingPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool HeadingPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Heading* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool HeadingPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Heading* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function HeadingPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* HeadingPubSubType::createData() - { - return reinterpret_cast(new Heading()); - } - - void HeadingPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool HeadingPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Heading* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Heading::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Heading::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +HeadingPubSubType::HeadingPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::Heading_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Heading::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_Heading_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +HeadingPubSubType::~HeadingPubSubType() +{ +} + +bool HeadingPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Heading* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool HeadingPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Heading* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function HeadingPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* HeadingPubSubType::createData() +{ + return reinterpret_cast(new Heading()); +} + +void HeadingPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HeadingPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.h index 515f0cfb0a5..456546810e7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingPubSubTypes.h @@ -16,92 +16,122 @@ * @file HeadingPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Heading.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "HeadingConfidencePubSubTypes.h" +#include "HeadingValuePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Heading is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Heading defined by the user in the IDL file. + * @ingroup Heading + */ +class HeadingPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Heading defined by the user in the IDL file. - * @ingroup HEADING - */ - class HeadingPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Heading type; + typedef Heading type; - eProsima_user_DllExport HeadingPubSubType(); + eProsima_user_DllExport HeadingPubSubType(); - eProsima_user_DllExport virtual ~HeadingPubSubType(); + eProsima_user_DllExport ~HeadingPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Heading(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADING_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.cxx index 253bf878a58..c9cab6ca5a1 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.cxx @@ -14,9 +14,9 @@ /*! * @file HeadingValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,121 +27,79 @@ char dummy; #endif // _WIN32 #include "HeadingValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace HeadingValue_Constants { +} // namespace HeadingValue_Constants - -etsi_its_cam_msgs::msg::HeadingValue::HeadingValue() +HeadingValue::HeadingValue() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7f9ab969 - m_value = 0; - } -etsi_its_cam_msgs::msg::HeadingValue::~HeadingValue() +HeadingValue::~HeadingValue() { } -etsi_its_cam_msgs::msg::HeadingValue::HeadingValue( +HeadingValue::HeadingValue( const HeadingValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::HeadingValue::HeadingValue( - HeadingValue&& x) +HeadingValue::HeadingValue( + HeadingValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::HeadingValue::operator =( +HeadingValue& HeadingValue::operator =( const HeadingValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::HeadingValue::operator =( - HeadingValue&& x) +HeadingValue& HeadingValue::operator =( + HeadingValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::HeadingValue::operator ==( +bool HeadingValue::operator ==( const HeadingValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::HeadingValue::operator !=( +bool HeadingValue::operator !=( const HeadingValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::HeadingValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::HeadingValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::HeadingValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::HeadingValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::HeadingValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::HeadingValue::value( +void HeadingValue::value( uint16_t _value) { m_value = _value; @@ -151,7 +109,7 @@ void etsi_its_cam_msgs::msg::HeadingValue::value( * @brief This function returns the value of member value * @return Value of member value */ -uint16_t etsi_its_cam_msgs::msg::HeadingValue::value() const +uint16_t HeadingValue::value() const { return m_value; } @@ -160,32 +118,18 @@ uint16_t etsi_its_cam_msgs::msg::HeadingValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint16_t& etsi_its_cam_msgs::msg::HeadingValue::value() +uint16_t& HeadingValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::HeadingValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::HeadingValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::HeadingValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "HeadingValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.h index 62e93e34c6b..07908da9035 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValue.h @@ -16,19 +16,24 @@ * @file HeadingValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,178 +47,134 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HeadingValue_SOURCE) -#define HeadingValue_DllAPI __declspec( dllexport ) +#if defined(HEADINGVALUE_SOURCE) +#define HEADINGVALUE_DllAPI __declspec( dllexport ) #else -#define HeadingValue_DllAPI __declspec( dllimport ) -#endif // HeadingValue_SOURCE +#define HEADINGVALUE_DllAPI __declspec( dllimport ) +#endif // HEADINGVALUE_SOURCE #else -#define HeadingValue_DllAPI +#define HEADINGVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define HeadingValue_DllAPI +#define HEADINGVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace HeadingValue_Constants { - const uint16_t MIN = 0; - const uint16_t MAX = 3601; - const uint16_t WGS_84_NORTH = 0; - const uint16_t WGS_84_EAST = 900; - const uint16_t WGS_84_SOUTH = 1800; - const uint16_t WGS_84_WEST = 2700; - const uint16_t UNAVAILABLE = 3601; - } // namespace HeadingValue_Constants - /*! - * @brief This class represents the structure HeadingValue defined by the user in the IDL file. - * @ingroup HEADINGVALUE - */ - class HeadingValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HeadingValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HeadingValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. - */ - eProsima_user_DllExport HeadingValue( - const HeadingValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. - */ - eProsima_user_DllExport HeadingValue( - HeadingValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. - */ - eProsima_user_DllExport HeadingValue& operator =( - const HeadingValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. - */ - eProsima_user_DllExport HeadingValue& operator =( - HeadingValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::HeadingValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HeadingValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::HeadingValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HeadingValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::HeadingValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace HeadingValue_Constants { + +const uint16_t MIN = 0; +const uint16_t MAX = 3601; +const uint16_t WGS84_NORTH = 0; +const uint16_t WGS84_EAST = 900; +const uint16_t WGS84_SOUTH = 1800; +const uint16_t WGS84_WEST = 2700; +const uint16_t UNAVAILABLE = 3601; + +} // namespace HeadingValue_Constants + + +/*! + * @brief This class represents the structure HeadingValue defined by the user in the IDL file. + * @ingroup HeadingValue + */ +class HeadingValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HeadingValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HeadingValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. + */ + eProsima_user_DllExport HeadingValue( + const HeadingValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. + */ + eProsima_user_DllExport HeadingValue( + HeadingValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. + */ + eProsima_user_DllExport HeadingValue& operator =( + const HeadingValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HeadingValue that will be copied. + */ + eProsima_user_DllExport HeadingValue& operator =( + HeadingValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HeadingValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HeadingValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HeadingValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HeadingValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + +private: + + uint16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValueCdrAux.hpp new file mode 100644 index 00000000000..444265b2e3d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValueCdrAux.hpp @@ -0,0 +1,65 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUECDRAUX_HPP_ + +#include "HeadingValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_HeadingValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_HeadingValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HeadingValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValueCdrAux.ipp new file mode 100644 index 00000000000..a3ff8b4113a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValueCdrAux.ipp @@ -0,0 +1,145 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeadingValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUECDRAUX_IPP_ + +#include "HeadingValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::HeadingValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HeadingValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::HeadingValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HeadingValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.cxx index 0c04139e390..06a9540fa1f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.cxx @@ -16,171 +16,201 @@ * @file HeadingValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "HeadingValuePubSubTypes.h" +#include "HeadingValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace HeadingValue_Constants { - - - - - - - - - } //End of namespace HeadingValue_Constants - HeadingValuePubSubType::HeadingValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::HeadingValue_"); - auto type_size = HeadingValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = HeadingValue::isKeyDefined(); - size_t keyLength = HeadingValue::getKeyMaxCdrSerializedSize() > 16 ? - HeadingValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - HeadingValuePubSubType::~HeadingValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool HeadingValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - HeadingValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool HeadingValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - HeadingValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function HeadingValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* HeadingValuePubSubType::createData() - { - return reinterpret_cast(new HeadingValue()); - } - - void HeadingValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool HeadingValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - HeadingValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - HeadingValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || HeadingValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace HeadingValue_Constants { + + + + + + + + + + + + + + + +} //End of namespace HeadingValue_Constants + + + +HeadingValuePubSubType::HeadingValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::HeadingValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HeadingValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_HeadingValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +HeadingValuePubSubType::~HeadingValuePubSubType() +{ +} + +bool HeadingValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + HeadingValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool HeadingValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + HeadingValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function HeadingValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* HeadingValuePubSubType::createData() +{ + return reinterpret_cast(new HeadingValue()); +} + +void HeadingValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HeadingValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.h index 4e494522cdb..219b9b972f0 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HeadingValuePubSubTypes.h @@ -16,29 +16,36 @@ * @file HeadingValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "HeadingValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated HeadingValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace HeadingValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace HeadingValue_Constants { + + + + @@ -46,72 +53,99 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type HeadingValue defined by the user in the IDL file. - * @ingroup HEADINGVALUE - */ - class HeadingValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef HeadingValue type; - eProsima_user_DllExport HeadingValuePubSubType(); - eProsima_user_DllExport virtual ~HeadingValuePubSubType(); +} // namespace HeadingValue_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type HeadingValue defined by the user in the IDL file. + * @ingroup HeadingValue + */ +class HeadingValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef HeadingValue type; + + eProsima_user_DllExport HeadingValuePubSubType(); + + eProsima_user_DllExport ~HeadingValuePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) HeadingValue(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HEADINGVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.cxx index 7b5800c4c25..a72247d0c1d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.cxx @@ -14,9 +14,9 @@ /*! * @file HighFrequencyContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,34 +27,35 @@ char dummy; #endif // _WIN32 #include "HighFrequencyContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { -etsi_its_cam_msgs::msg::HighFrequencyContainer::HighFrequencyContainer() -{ - // m_choice com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9257031 - m_choice = 0; - // m_basic_vehicle_container_high_frequency com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@75201592 +namespace HighFrequencyContainer_Constants { - // m_rsu_container_high_frequency com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7726e185 +} // namespace HighFrequencyContainer_Constants -} -etsi_its_cam_msgs::msg::HighFrequencyContainer::~HighFrequencyContainer() +HighFrequencyContainer::HighFrequencyContainer() { +} - +HighFrequencyContainer::~HighFrequencyContainer() +{ } -etsi_its_cam_msgs::msg::HighFrequencyContainer::HighFrequencyContainer( +HighFrequencyContainer::HighFrequencyContainer( const HighFrequencyContainer& x) { m_choice = x.m_choice; @@ -62,105 +63,53 @@ etsi_its_cam_msgs::msg::HighFrequencyContainer::HighFrequencyContainer( m_rsu_container_high_frequency = x.m_rsu_container_high_frequency; } -etsi_its_cam_msgs::msg::HighFrequencyContainer::HighFrequencyContainer( - HighFrequencyContainer&& x) +HighFrequencyContainer::HighFrequencyContainer( + HighFrequencyContainer&& x) noexcept { m_choice = x.m_choice; m_basic_vehicle_container_high_frequency = std::move(x.m_basic_vehicle_container_high_frequency); m_rsu_container_high_frequency = std::move(x.m_rsu_container_high_frequency); } -etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::HighFrequencyContainer::operator =( +HighFrequencyContainer& HighFrequencyContainer::operator =( const HighFrequencyContainer& x) { m_choice = x.m_choice; m_basic_vehicle_container_high_frequency = x.m_basic_vehicle_container_high_frequency; m_rsu_container_high_frequency = x.m_rsu_container_high_frequency; - return *this; } -etsi_its_cam_msgs::msg::HighFrequencyContainer& etsi_its_cam_msgs::msg::HighFrequencyContainer::operator =( - HighFrequencyContainer&& x) +HighFrequencyContainer& HighFrequencyContainer::operator =( + HighFrequencyContainer&& x) noexcept { m_choice = x.m_choice; m_basic_vehicle_container_high_frequency = std::move(x.m_basic_vehicle_container_high_frequency); m_rsu_container_high_frequency = std::move(x.m_rsu_container_high_frequency); - return *this; } -bool etsi_its_cam_msgs::msg::HighFrequencyContainer::operator ==( +bool HighFrequencyContainer::operator ==( const HighFrequencyContainer& x) const { - - return (m_choice == x.m_choice && m_basic_vehicle_container_high_frequency == x.m_basic_vehicle_container_high_frequency && m_rsu_container_high_frequency == x.m_rsu_container_high_frequency); + return (m_choice == x.m_choice && + m_basic_vehicle_container_high_frequency == x.m_basic_vehicle_container_high_frequency && + m_rsu_container_high_frequency == x.m_rsu_container_high_frequency); } -bool etsi_its_cam_msgs::msg::HighFrequencyContainer::operator !=( +bool HighFrequencyContainer::operator !=( const HighFrequencyContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::HighFrequencyContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::HighFrequencyContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::HighFrequencyContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency::getCdrSerializedSize(data.basic_vehicle_container_high_frequency(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getCdrSerializedSize(data.rsu_container_high_frequency(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::HighFrequencyContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_choice; - scdr << m_basic_vehicle_container_high_frequency; - scdr << m_rsu_container_high_frequency; - -} - -void etsi_its_cam_msgs::msg::HighFrequencyContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_choice; - dcdr >> m_basic_vehicle_container_high_frequency; - dcdr >> m_rsu_container_high_frequency; -} - /*! * @brief This function sets a value in member choice * @param _choice New value for member choice */ -void etsi_its_cam_msgs::msg::HighFrequencyContainer::choice( +void HighFrequencyContainer::choice( uint8_t _choice) { m_choice = _choice; @@ -170,7 +119,7 @@ void etsi_its_cam_msgs::msg::HighFrequencyContainer::choice( * @brief This function returns the value of member choice * @return Value of member choice */ -uint8_t etsi_its_cam_msgs::msg::HighFrequencyContainer::choice() const +uint8_t HighFrequencyContainer::choice() const { return m_choice; } @@ -179,16 +128,17 @@ uint8_t etsi_its_cam_msgs::msg::HighFrequencyContainer::choice() const * @brief This function returns a reference to member choice * @return Reference to member choice */ -uint8_t& etsi_its_cam_msgs::msg::HighFrequencyContainer::choice() +uint8_t& HighFrequencyContainer::choice() { return m_choice; } + /*! * @brief This function copies the value in member basic_vehicle_container_high_frequency * @param _basic_vehicle_container_high_frequency New value to be copied in member basic_vehicle_container_high_frequency */ -void etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_high_frequency( +void HighFrequencyContainer::basic_vehicle_container_high_frequency( const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& _basic_vehicle_container_high_frequency) { m_basic_vehicle_container_high_frequency = _basic_vehicle_container_high_frequency; @@ -198,7 +148,7 @@ void etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_hig * @brief This function moves the value in member basic_vehicle_container_high_frequency * @param _basic_vehicle_container_high_frequency New value to be moved in member basic_vehicle_container_high_frequency */ -void etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_high_frequency( +void HighFrequencyContainer::basic_vehicle_container_high_frequency( etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency&& _basic_vehicle_container_high_frequency) { m_basic_vehicle_container_high_frequency = std::move(_basic_vehicle_container_high_frequency); @@ -208,7 +158,7 @@ void etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_hig * @brief This function returns a constant reference to member basic_vehicle_container_high_frequency * @return Constant reference to member basic_vehicle_container_high_frequency */ -const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_high_frequency() const +const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& HighFrequencyContainer::basic_vehicle_container_high_frequency() const { return m_basic_vehicle_container_high_frequency; } @@ -217,15 +167,17 @@ const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_m * @brief This function returns a reference to member basic_vehicle_container_high_frequency * @return Reference to member basic_vehicle_container_high_frequency */ -etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& etsi_its_cam_msgs::msg::HighFrequencyContainer::basic_vehicle_container_high_frequency() +etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& HighFrequencyContainer::basic_vehicle_container_high_frequency() { return m_basic_vehicle_container_high_frequency; } + + /*! * @brief This function copies the value in member rsu_container_high_frequency * @param _rsu_container_high_frequency New value to be copied in member rsu_container_high_frequency */ -void etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequency( +void HighFrequencyContainer::rsu_container_high_frequency( const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& _rsu_container_high_frequency) { m_rsu_container_high_frequency = _rsu_container_high_frequency; @@ -235,7 +187,7 @@ void etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequenc * @brief This function moves the value in member rsu_container_high_frequency * @param _rsu_container_high_frequency New value to be moved in member rsu_container_high_frequency */ -void etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequency( +void HighFrequencyContainer::rsu_container_high_frequency( etsi_its_cam_msgs::msg::RSUContainerHighFrequency&& _rsu_container_high_frequency) { m_rsu_container_high_frequency = std::move(_rsu_container_high_frequency); @@ -245,7 +197,7 @@ void etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequenc * @brief This function returns a constant reference to member rsu_container_high_frequency * @return Constant reference to member rsu_container_high_frequency */ -const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequency() const +const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& HighFrequencyContainer::rsu_container_high_frequency() const { return m_rsu_container_high_frequency; } @@ -254,31 +206,18 @@ const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg: * @brief This function returns a reference to member rsu_container_high_frequency * @return Reference to member rsu_container_high_frequency */ -etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg::HighFrequencyContainer::rsu_container_high_frequency() +etsi_its_cam_msgs::msg::RSUContainerHighFrequency& HighFrequencyContainer::rsu_container_high_frequency() { return m_rsu_container_high_frequency; } -size_t etsi_its_cam_msgs::msg::HighFrequencyContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::HighFrequencyContainer::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::HighFrequencyContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "HighFrequencyContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.h index 34cb0e20473..d5ffff825a5 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainer.h @@ -16,21 +16,26 @@ * @file HighFrequencyContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_H_ -#include "RSUContainerHighFrequency.h" -#include "BasicVehicleContainerHighFrequency.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "RSUContainerHighFrequency.h" +#include "BasicVehicleContainerHighFrequency.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,225 +49,185 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HighFrequencyContainer_SOURCE) -#define HighFrequencyContainer_DllAPI __declspec( dllexport ) +#if defined(HIGHFREQUENCYCONTAINER_SOURCE) +#define HIGHFREQUENCYCONTAINER_DllAPI __declspec( dllexport ) #else -#define HighFrequencyContainer_DllAPI __declspec( dllimport ) -#endif // HighFrequencyContainer_SOURCE +#define HIGHFREQUENCYCONTAINER_DllAPI __declspec( dllimport ) +#endif // HIGHFREQUENCYCONTAINER_SOURCE #else -#define HighFrequencyContainer_DllAPI +#define HIGHFREQUENCYCONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define HighFrequencyContainer_DllAPI +#define HIGHFREQUENCYCONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace HighFrequencyContainer_Constants { - const uint8_t CHOICE_BASIC_VEHICLE_CONTAINER_HIGH_FREQUENCY = 0; - const uint8_t CHOICE_RSU_CONTAINER_HIGH_FREQUENCY = 1; - } // namespace HighFrequencyContainer_Constants - /*! - * @brief This class represents the structure HighFrequencyContainer defined by the user in the IDL file. - * @ingroup HIGHFREQUENCYCONTAINER - */ - class HighFrequencyContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HighFrequencyContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HighFrequencyContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. - */ - eProsima_user_DllExport HighFrequencyContainer( - const HighFrequencyContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. - */ - eProsima_user_DllExport HighFrequencyContainer( - HighFrequencyContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. - */ - eProsima_user_DllExport HighFrequencyContainer& operator =( - const HighFrequencyContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. - */ - eProsima_user_DllExport HighFrequencyContainer& operator =( - HighFrequencyContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::HighFrequencyContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HighFrequencyContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::HighFrequencyContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HighFrequencyContainer& x) const; - - /*! - * @brief This function sets a value in member choice - * @param _choice New value for member choice - */ - eProsima_user_DllExport void choice( - uint8_t _choice); - - /*! - * @brief This function returns the value of member choice - * @return Value of member choice - */ - eProsima_user_DllExport uint8_t choice() const; - - /*! - * @brief This function returns a reference to member choice - * @return Reference to member choice - */ - eProsima_user_DllExport uint8_t& choice(); - - /*! - * @brief This function copies the value in member basic_vehicle_container_high_frequency - * @param _basic_vehicle_container_high_frequency New value to be copied in member basic_vehicle_container_high_frequency - */ - eProsima_user_DllExport void basic_vehicle_container_high_frequency( - const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& _basic_vehicle_container_high_frequency); - - /*! - * @brief This function moves the value in member basic_vehicle_container_high_frequency - * @param _basic_vehicle_container_high_frequency New value to be moved in member basic_vehicle_container_high_frequency - */ - eProsima_user_DllExport void basic_vehicle_container_high_frequency( - etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency&& _basic_vehicle_container_high_frequency); - - /*! - * @brief This function returns a constant reference to member basic_vehicle_container_high_frequency - * @return Constant reference to member basic_vehicle_container_high_frequency - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& basic_vehicle_container_high_frequency() const; - - /*! - * @brief This function returns a reference to member basic_vehicle_container_high_frequency - * @return Reference to member basic_vehicle_container_high_frequency - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& basic_vehicle_container_high_frequency(); - /*! - * @brief This function copies the value in member rsu_container_high_frequency - * @param _rsu_container_high_frequency New value to be copied in member rsu_container_high_frequency - */ - eProsima_user_DllExport void rsu_container_high_frequency( - const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& _rsu_container_high_frequency); - - /*! - * @brief This function moves the value in member rsu_container_high_frequency - * @param _rsu_container_high_frequency New value to be moved in member rsu_container_high_frequency - */ - eProsima_user_DllExport void rsu_container_high_frequency( - etsi_its_cam_msgs::msg::RSUContainerHighFrequency&& _rsu_container_high_frequency); - - /*! - * @brief This function returns a constant reference to member rsu_container_high_frequency - * @return Constant reference to member rsu_container_high_frequency - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& rsu_container_high_frequency() const; - - /*! - * @brief This function returns a reference to member rsu_container_high_frequency - * @return Reference to member rsu_container_high_frequency - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::RSUContainerHighFrequency& rsu_container_high_frequency(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::HighFrequencyContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_choice; - etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency m_basic_vehicle_container_high_frequency; - etsi_its_cam_msgs::msg::RSUContainerHighFrequency m_rsu_container_high_frequency; - }; - } // namespace msg + +namespace msg { + +namespace HighFrequencyContainer_Constants { + +const uint8_t CHOICE_BASIC_VEHICLE_CONTAINER_HIGH_FREQUENCY = 0; +const uint8_t CHOICE_RSU_CONTAINER_HIGH_FREQUENCY = 1; + +} // namespace HighFrequencyContainer_Constants + + +/*! + * @brief This class represents the structure HighFrequencyContainer defined by the user in the IDL file. + * @ingroup HighFrequencyContainer + */ +class HighFrequencyContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HighFrequencyContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HighFrequencyContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. + */ + eProsima_user_DllExport HighFrequencyContainer( + const HighFrequencyContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. + */ + eProsima_user_DllExport HighFrequencyContainer( + HighFrequencyContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. + */ + eProsima_user_DllExport HighFrequencyContainer& operator =( + const HighFrequencyContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::HighFrequencyContainer that will be copied. + */ + eProsima_user_DllExport HighFrequencyContainer& operator =( + HighFrequencyContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HighFrequencyContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HighFrequencyContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::HighFrequencyContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HighFrequencyContainer& x) const; + + /*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ + eProsima_user_DllExport void choice( + uint8_t _choice); + + /*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ + eProsima_user_DllExport uint8_t choice() const; + + /*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ + eProsima_user_DllExport uint8_t& choice(); + + + /*! + * @brief This function copies the value in member basic_vehicle_container_high_frequency + * @param _basic_vehicle_container_high_frequency New value to be copied in member basic_vehicle_container_high_frequency + */ + eProsima_user_DllExport void basic_vehicle_container_high_frequency( + const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& _basic_vehicle_container_high_frequency); + + /*! + * @brief This function moves the value in member basic_vehicle_container_high_frequency + * @param _basic_vehicle_container_high_frequency New value to be moved in member basic_vehicle_container_high_frequency + */ + eProsima_user_DllExport void basic_vehicle_container_high_frequency( + etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency&& _basic_vehicle_container_high_frequency); + + /*! + * @brief This function returns a constant reference to member basic_vehicle_container_high_frequency + * @return Constant reference to member basic_vehicle_container_high_frequency + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& basic_vehicle_container_high_frequency() const; + + /*! + * @brief This function returns a reference to member basic_vehicle_container_high_frequency + * @return Reference to member basic_vehicle_container_high_frequency + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency& basic_vehicle_container_high_frequency(); + + + /*! + * @brief This function copies the value in member rsu_container_high_frequency + * @param _rsu_container_high_frequency New value to be copied in member rsu_container_high_frequency + */ + eProsima_user_DllExport void rsu_container_high_frequency( + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& _rsu_container_high_frequency); + + /*! + * @brief This function moves the value in member rsu_container_high_frequency + * @param _rsu_container_high_frequency New value to be moved in member rsu_container_high_frequency + */ + eProsima_user_DllExport void rsu_container_high_frequency( + etsi_its_cam_msgs::msg::RSUContainerHighFrequency&& _rsu_container_high_frequency); + + /*! + * @brief This function returns a constant reference to member rsu_container_high_frequency + * @return Constant reference to member rsu_container_high_frequency + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& rsu_container_high_frequency() const; + + /*! + * @brief This function returns a reference to member rsu_container_high_frequency + * @return Reference to member rsu_container_high_frequency + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::RSUContainerHighFrequency& rsu_container_high_frequency(); + +private: + + uint8_t m_choice{0}; + etsi_its_cam_msgs::msg::BasicVehicleContainerHighFrequency m_basic_vehicle_container_high_frequency; + etsi_its_cam_msgs::msg::RSUContainerHighFrequency m_rsu_container_high_frequency; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerCdrAux.hpp new file mode 100644 index 00000000000..51ea3db1235 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerCdrAux.hpp @@ -0,0 +1,64 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HighFrequencyContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINERCDRAUX_HPP_ + +#include "HighFrequencyContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_HighFrequencyContainer_max_cdr_typesize {6798UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_HighFrequencyContainer_max_key_cdr_typesize {0UL}; + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HighFrequencyContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerCdrAux.ipp new file mode 100644 index 00000000000..dce98ca104c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerCdrAux.ipp @@ -0,0 +1,151 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HighFrequencyContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINERCDRAUX_IPP_ + +#include "HighFrequencyContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::HighFrequencyContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.choice(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.basic_vehicle_container_high_frequency(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.rsu_container_high_frequency(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HighFrequencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.choice() + << eprosima::fastcdr::MemberId(1) << data.basic_vehicle_container_high_frequency() + << eprosima::fastcdr::MemberId(2) << data.rsu_container_high_frequency() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::HighFrequencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.choice(); + break; + + case 1: + dcdr >> data.basic_vehicle_container_high_frequency(); + break; + + case 2: + dcdr >> data.rsu_container_high_frequency(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::HighFrequencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.cxx index f65737b3134..c0f2bc58e5a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.cxx @@ -16,166 +16,191 @@ * @file HighFrequencyContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "HighFrequencyContainerPubSubTypes.h" +#include "HighFrequencyContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace HighFrequencyContainer_Constants { - - - - } //End of namespace HighFrequencyContainer_Constants - HighFrequencyContainerPubSubType::HighFrequencyContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::HighFrequencyContainer_"); - auto type_size = HighFrequencyContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = HighFrequencyContainer::isKeyDefined(); - size_t keyLength = HighFrequencyContainer::getKeyMaxCdrSerializedSize() > 16 ? - HighFrequencyContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - HighFrequencyContainerPubSubType::~HighFrequencyContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool HighFrequencyContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - HighFrequencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool HighFrequencyContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - HighFrequencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function HighFrequencyContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* HighFrequencyContainerPubSubType::createData() - { - return reinterpret_cast(new HighFrequencyContainer()); - } - - void HighFrequencyContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool HighFrequencyContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - HighFrequencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - HighFrequencyContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || HighFrequencyContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace HighFrequencyContainer_Constants { + + + + + +} //End of namespace HighFrequencyContainer_Constants + + + +HighFrequencyContainerPubSubType::HighFrequencyContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::HighFrequencyContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HighFrequencyContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_HighFrequencyContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +HighFrequencyContainerPubSubType::~HighFrequencyContainerPubSubType() +{ +} + +bool HighFrequencyContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + HighFrequencyContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool HighFrequencyContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + HighFrequencyContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function HighFrequencyContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* HighFrequencyContainerPubSubType::createData() +{ + return reinterpret_cast(new HighFrequencyContainer()); +} + +void HighFrequencyContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HighFrequencyContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.h index 14ffe108b2e..807e84a1ba6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/HighFrequencyContainerPubSubTypes.h @@ -16,97 +16,128 @@ * @file HighFrequencyContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "HighFrequencyContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "RSUContainerHighFrequencyPubSubTypes.h" +#include "BasicVehicleContainerHighFrequencyPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated HighFrequencyContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace HighFrequencyContainer_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace HighFrequencyContainer_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type HighFrequencyContainer defined by the user in the IDL file. - * @ingroup HIGHFREQUENCYCONTAINER - */ - class HighFrequencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef HighFrequencyContainer type; - eProsima_user_DllExport HighFrequencyContainerPubSubType(); +} // namespace HighFrequencyContainer_Constants - eProsima_user_DllExport virtual ~HighFrequencyContainerPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type HighFrequencyContainer defined by the user in the IDL file. + * @ingroup HighFrequencyContainer + */ +class HighFrequencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef HighFrequencyContainer type; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport HighFrequencyContainerPubSubType(); - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport ~HighFrequencyContainerPubSubType() override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport void deleteData( + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_HIGHFREQUENCYCONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.cxx index 4bac3bd3096..2f2a5012686 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.cxx @@ -14,9 +14,9 @@ /*! * @file ItsPduHeader.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,49 +27,35 @@ char dummy; #endif // _WIN32 #include "ItsPduHeader.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace ItsPduHeader_Constants { +} // namespace ItsPduHeader_Constants - - - - - - - - - - - -etsi_its_cam_msgs::msg::ItsPduHeader::ItsPduHeader() +ItsPduHeader::ItsPduHeader() { - // m_protocol_version com.eprosima.idl.parser.typecode.PrimitiveTypeCode@640f11a1 - m_protocol_version = 0; - // m_message_id com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5c10f1c3 - m_message_id = 0; - // m_station_id com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7ac2e39b - - } -etsi_its_cam_msgs::msg::ItsPduHeader::~ItsPduHeader() +ItsPduHeader::~ItsPduHeader() { - - } -etsi_its_cam_msgs::msg::ItsPduHeader::ItsPduHeader( +ItsPduHeader::ItsPduHeader( const ItsPduHeader& x) { m_protocol_version = x.m_protocol_version; @@ -77,109 +63,53 @@ etsi_its_cam_msgs::msg::ItsPduHeader::ItsPduHeader( m_station_id = x.m_station_id; } -etsi_its_cam_msgs::msg::ItsPduHeader::ItsPduHeader( - ItsPduHeader&& x) +ItsPduHeader::ItsPduHeader( + ItsPduHeader&& x) noexcept { m_protocol_version = x.m_protocol_version; m_message_id = x.m_message_id; m_station_id = std::move(x.m_station_id); } -etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::ItsPduHeader::operator =( +ItsPduHeader& ItsPduHeader::operator =( const ItsPduHeader& x) { m_protocol_version = x.m_protocol_version; m_message_id = x.m_message_id; m_station_id = x.m_station_id; - return *this; } -etsi_its_cam_msgs::msg::ItsPduHeader& etsi_its_cam_msgs::msg::ItsPduHeader::operator =( - ItsPduHeader&& x) +ItsPduHeader& ItsPduHeader::operator =( + ItsPduHeader&& x) noexcept { m_protocol_version = x.m_protocol_version; m_message_id = x.m_message_id; m_station_id = std::move(x.m_station_id); - return *this; } -bool etsi_its_cam_msgs::msg::ItsPduHeader::operator ==( +bool ItsPduHeader::operator ==( const ItsPduHeader& x) const { - - return (m_protocol_version == x.m_protocol_version && m_message_id == x.m_message_id && m_station_id == x.m_station_id); + return (m_protocol_version == x.m_protocol_version && + m_message_id == x.m_message_id && + m_station_id == x.m_station_id); } -bool etsi_its_cam_msgs::msg::ItsPduHeader::operator !=( +bool ItsPduHeader::operator !=( const ItsPduHeader& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ItsPduHeader::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::StationID::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ItsPduHeader::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ItsPduHeader& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::StationID::getCdrSerializedSize(data.station_id(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ItsPduHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_protocol_version; - scdr << m_message_id; - scdr << m_station_id; - -} - -void etsi_its_cam_msgs::msg::ItsPduHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_protocol_version; - dcdr >> m_message_id; - dcdr >> m_station_id; -} - /*! * @brief This function sets a value in member protocol_version * @param _protocol_version New value for member protocol_version */ -void etsi_its_cam_msgs::msg::ItsPduHeader::protocol_version( +void ItsPduHeader::protocol_version( uint8_t _protocol_version) { m_protocol_version = _protocol_version; @@ -189,7 +119,7 @@ void etsi_its_cam_msgs::msg::ItsPduHeader::protocol_version( * @brief This function returns the value of member protocol_version * @return Value of member protocol_version */ -uint8_t etsi_its_cam_msgs::msg::ItsPduHeader::protocol_version() const +uint8_t ItsPduHeader::protocol_version() const { return m_protocol_version; } @@ -198,16 +128,17 @@ uint8_t etsi_its_cam_msgs::msg::ItsPduHeader::protocol_version() const * @brief This function returns a reference to member protocol_version * @return Reference to member protocol_version */ -uint8_t& etsi_its_cam_msgs::msg::ItsPduHeader::protocol_version() +uint8_t& ItsPduHeader::protocol_version() { return m_protocol_version; } + /*! * @brief This function sets a value in member message_id * @param _message_id New value for member message_id */ -void etsi_its_cam_msgs::msg::ItsPduHeader::message_id( +void ItsPduHeader::message_id( uint8_t _message_id) { m_message_id = _message_id; @@ -217,7 +148,7 @@ void etsi_its_cam_msgs::msg::ItsPduHeader::message_id( * @brief This function returns the value of member message_id * @return Value of member message_id */ -uint8_t etsi_its_cam_msgs::msg::ItsPduHeader::message_id() const +uint8_t ItsPduHeader::message_id() const { return m_message_id; } @@ -226,16 +157,17 @@ uint8_t etsi_its_cam_msgs::msg::ItsPduHeader::message_id() const * @brief This function returns a reference to member message_id * @return Reference to member message_id */ -uint8_t& etsi_its_cam_msgs::msg::ItsPduHeader::message_id() +uint8_t& ItsPduHeader::message_id() { return m_message_id; } + /*! * @brief This function copies the value in member station_id * @param _station_id New value to be copied in member station_id */ -void etsi_its_cam_msgs::msg::ItsPduHeader::station_id( +void ItsPduHeader::station_id( const etsi_its_cam_msgs::msg::StationID& _station_id) { m_station_id = _station_id; @@ -245,7 +177,7 @@ void etsi_its_cam_msgs::msg::ItsPduHeader::station_id( * @brief This function moves the value in member station_id * @param _station_id New value to be moved in member station_id */ -void etsi_its_cam_msgs::msg::ItsPduHeader::station_id( +void ItsPduHeader::station_id( etsi_its_cam_msgs::msg::StationID&& _station_id) { m_station_id = std::move(_station_id); @@ -255,7 +187,7 @@ void etsi_its_cam_msgs::msg::ItsPduHeader::station_id( * @brief This function returns a constant reference to member station_id * @return Constant reference to member station_id */ -const etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::ItsPduHeader::station_id() const +const etsi_its_cam_msgs::msg::StationID& ItsPduHeader::station_id() const { return m_station_id; } @@ -264,31 +196,18 @@ const etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::ItsPduHeader::s * @brief This function returns a reference to member station_id * @return Reference to member station_id */ -etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::ItsPduHeader::station_id() +etsi_its_cam_msgs::msg::StationID& ItsPduHeader::station_id() { return m_station_id; } -size_t etsi_its_cam_msgs::msg::ItsPduHeader::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::ItsPduHeader::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::ItsPduHeader::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ItsPduHeaderCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.h index 916953056a0..ddd6bbc3a5a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeader.h @@ -16,20 +16,25 @@ * @file ItsPduHeader.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_H_ -#include "StationID.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "StationID.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,234 +48,193 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ItsPduHeader_SOURCE) -#define ItsPduHeader_DllAPI __declspec( dllexport ) +#if defined(ITSPDUHEADER_SOURCE) +#define ITSPDUHEADER_DllAPI __declspec( dllexport ) #else -#define ItsPduHeader_DllAPI __declspec( dllimport ) -#endif // ItsPduHeader_SOURCE +#define ITSPDUHEADER_DllAPI __declspec( dllimport ) +#endif // ITSPDUHEADER_SOURCE #else -#define ItsPduHeader_DllAPI +#define ITSPDUHEADER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ItsPduHeader_DllAPI +#define ITSPDUHEADER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace ItsPduHeader_Constants { - const uint8_t PROTOCOL_VERSION_MIN = 0; - const uint8_t PROTOCOL_VERSION_MAX = 255; - const uint8_t MESSAGE_ID_MIN = 0; - const uint8_t MESSAGE_ID_MAX = 255; - const uint8_t MESSAGE_ID_DENM = 1; - const uint8_t MESSAGE_ID_CAM = 2; - const uint8_t MESSAGE_ID_POI = 3; - const uint8_t MESSAGE_ID_SPATEM = 4; - const uint8_t MESSAGE_ID_MAPEM = 5; - const uint8_t MESSAGE_ID_IVIM = 6; - const uint8_t MESSAGE_ID_EV_RSR = 7; - const uint8_t MESSAGE_ID_TISTPGTRANSACTION = 8; - const uint8_t MESSAGE_ID_SREM = 9; - const uint8_t MESSAGE_ID_SSEM = 10; - const uint8_t MESSAGE_ID_EVCSN = 11; - const uint8_t MESSAGE_ID_SAEM = 12; - const uint8_t MESSAGE_ID_RTCMEM = 13; - } // namespace ItsPduHeader_Constants - /*! - * @brief This class represents the structure ItsPduHeader defined by the user in the IDL file. - * @ingroup ITSPDUHEADER - */ - class ItsPduHeader - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ItsPduHeader(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ItsPduHeader(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. - */ - eProsima_user_DllExport ItsPduHeader( - const ItsPduHeader& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. - */ - eProsima_user_DllExport ItsPduHeader( - ItsPduHeader&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. - */ - eProsima_user_DllExport ItsPduHeader& operator =( - const ItsPduHeader& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. - */ - eProsima_user_DllExport ItsPduHeader& operator =( - ItsPduHeader&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ItsPduHeader object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ItsPduHeader& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ItsPduHeader object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ItsPduHeader& x) const; - - /*! - * @brief This function sets a value in member protocol_version - * @param _protocol_version New value for member protocol_version - */ - eProsima_user_DllExport void protocol_version( - uint8_t _protocol_version); - - /*! - * @brief This function returns the value of member protocol_version - * @return Value of member protocol_version - */ - eProsima_user_DllExport uint8_t protocol_version() const; - - /*! - * @brief This function returns a reference to member protocol_version - * @return Reference to member protocol_version - */ - eProsima_user_DllExport uint8_t& protocol_version(); - - /*! - * @brief This function sets a value in member message_id - * @param _message_id New value for member message_id - */ - eProsima_user_DllExport void message_id( - uint8_t _message_id); - - /*! - * @brief This function returns the value of member message_id - * @return Value of member message_id - */ - eProsima_user_DllExport uint8_t message_id() const; - - /*! - * @brief This function returns a reference to member message_id - * @return Reference to member message_id - */ - eProsima_user_DllExport uint8_t& message_id(); - - /*! - * @brief This function copies the value in member station_id - * @param _station_id New value to be copied in member station_id - */ - eProsima_user_DllExport void station_id( - const etsi_its_cam_msgs::msg::StationID& _station_id); - - /*! - * @brief This function moves the value in member station_id - * @param _station_id New value to be moved in member station_id - */ - eProsima_user_DllExport void station_id( - etsi_its_cam_msgs::msg::StationID&& _station_id); - - /*! - * @brief This function returns a constant reference to member station_id - * @return Constant reference to member station_id - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::StationID& station_id() const; - - /*! - * @brief This function returns a reference to member station_id - * @return Reference to member station_id - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::StationID& station_id(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ItsPduHeader& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_protocol_version; - uint8_t m_message_id; - etsi_its_cam_msgs::msg::StationID m_station_id; - }; - } // namespace msg + +namespace msg { + +namespace ItsPduHeader_Constants { + +const uint8_t PROTOCOL_VERSION_MIN = 0; +const uint8_t PROTOCOL_VERSION_MAX = 255; +const uint8_t MESSAGE_ID_MIN = 0; +const uint8_t MESSAGE_ID_MAX = 255; +const uint8_t MESSAGE_ID_DENM = 1; +const uint8_t MESSAGE_ID_CAM = 2; +const uint8_t MESSAGE_ID_POI = 3; +const uint8_t MESSAGE_ID_SPATEM = 4; +const uint8_t MESSAGE_ID_MAPEM = 5; +const uint8_t MESSAGE_ID_IVIM = 6; +const uint8_t MESSAGE_ID_EV_RSR = 7; +const uint8_t MESSAGE_ID_TISTPGTRANSACTION = 8; +const uint8_t MESSAGE_ID_SREM = 9; +const uint8_t MESSAGE_ID_SSEM = 10; +const uint8_t MESSAGE_ID_EVCSN = 11; +const uint8_t MESSAGE_ID_SAEM = 12; +const uint8_t MESSAGE_ID_RTCMEM = 13; + +} // namespace ItsPduHeader_Constants + + +/*! + * @brief This class represents the structure ItsPduHeader defined by the user in the IDL file. + * @ingroup ItsPduHeader + */ +class ItsPduHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ItsPduHeader(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ItsPduHeader(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. + */ + eProsima_user_DllExport ItsPduHeader( + const ItsPduHeader& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. + */ + eProsima_user_DllExport ItsPduHeader( + ItsPduHeader&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. + */ + eProsima_user_DllExport ItsPduHeader& operator =( + const ItsPduHeader& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ItsPduHeader that will be copied. + */ + eProsima_user_DllExport ItsPduHeader& operator =( + ItsPduHeader&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ItsPduHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ItsPduHeader& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ItsPduHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ItsPduHeader& x) const; + + /*! + * @brief This function sets a value in member protocol_version + * @param _protocol_version New value for member protocol_version + */ + eProsima_user_DllExport void protocol_version( + uint8_t _protocol_version); + + /*! + * @brief This function returns the value of member protocol_version + * @return Value of member protocol_version + */ + eProsima_user_DllExport uint8_t protocol_version() const; + + /*! + * @brief This function returns a reference to member protocol_version + * @return Reference to member protocol_version + */ + eProsima_user_DllExport uint8_t& protocol_version(); + + + /*! + * @brief This function sets a value in member message_id + * @param _message_id New value for member message_id + */ + eProsima_user_DllExport void message_id( + uint8_t _message_id); + + /*! + * @brief This function returns the value of member message_id + * @return Value of member message_id + */ + eProsima_user_DllExport uint8_t message_id() const; + + /*! + * @brief This function returns a reference to member message_id + * @return Reference to member message_id + */ + eProsima_user_DllExport uint8_t& message_id(); + + + /*! + * @brief This function copies the value in member station_id + * @param _station_id New value to be copied in member station_id + */ + eProsima_user_DllExport void station_id( + const etsi_its_cam_msgs::msg::StationID& _station_id); + + /*! + * @brief This function moves the value in member station_id + * @param _station_id New value to be moved in member station_id + */ + eProsima_user_DllExport void station_id( + etsi_its_cam_msgs::msg::StationID&& _station_id); + + /*! + * @brief This function returns a constant reference to member station_id + * @return Constant reference to member station_id + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::StationID& station_id() const; + + /*! + * @brief This function returns a reference to member station_id + * @return Reference to member station_id + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::StationID& station_id(); + +private: + + uint8_t m_protocol_version{0}; + uint8_t m_message_id{0}; + etsi_its_cam_msgs::msg::StationID m_station_id; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderCdrAux.hpp new file mode 100644 index 00000000000..4028be0b464 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderCdrAux.hpp @@ -0,0 +1,85 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ItsPduHeaderCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADERCDRAUX_HPP_ + +#include "ItsPduHeader.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ItsPduHeader_max_cdr_typesize {16UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ItsPduHeader_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ItsPduHeader& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderCdrAux.ipp new file mode 100644 index 00000000000..1830046bdd6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderCdrAux.ipp @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ItsPduHeaderCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADERCDRAUX_IPP_ + +#include "ItsPduHeaderCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ItsPduHeader& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.protocol_version(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.message_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.station_id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ItsPduHeader& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.protocol_version() + << eprosima::fastcdr::MemberId(1) << data.message_id() + << eprosima::fastcdr::MemberId(2) << data.station_id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ItsPduHeader& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.protocol_version(); + break; + + case 1: + dcdr >> data.message_id(); + break; + + case 2: + dcdr >> data.station_id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ItsPduHeader& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.cxx index 2bf6b9d99e2..4f5955ce2ab 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.cxx @@ -16,21 +16,38 @@ * @file ItsPduHeaderPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ItsPduHeaderPubSubTypes.h" +#include "ItsPduHeaderCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace ItsPduHeader_Constants { +namespace msg { +namespace ItsPduHeader_Constants { + + + + + + + + + + + + + @@ -49,148 +66,171 @@ namespace etsi_its_cam_msgs { - } //End of namespace ItsPduHeader_Constants - ItsPduHeaderPubSubType::ItsPduHeaderPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ItsPduHeader_"); - auto type_size = ItsPduHeader::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ItsPduHeader::isKeyDefined(); - size_t keyLength = ItsPduHeader::getKeyMaxCdrSerializedSize() > 16 ? - ItsPduHeader::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - ItsPduHeaderPubSubType::~ItsPduHeaderPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - bool ItsPduHeaderPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ItsPduHeader* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ItsPduHeaderPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ItsPduHeader* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ItsPduHeaderPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ItsPduHeaderPubSubType::createData() - { - return reinterpret_cast(new ItsPduHeader()); - } - - void ItsPduHeaderPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ItsPduHeaderPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ItsPduHeader* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ItsPduHeader::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ItsPduHeader::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + + +} //End of namespace ItsPduHeader_Constants + + + +ItsPduHeaderPubSubType::ItsPduHeaderPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ItsPduHeader_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ItsPduHeader::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ItsPduHeader_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ItsPduHeaderPubSubType::~ItsPduHeaderPubSubType() +{ +} + +bool ItsPduHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ItsPduHeader* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ItsPduHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ItsPduHeader* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ItsPduHeaderPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ItsPduHeaderPubSubType::createData() +{ + return reinterpret_cast(new ItsPduHeader()); +} + +void ItsPduHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ItsPduHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h index 1abb674c166..e7f5cacc41f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ItsPduHeaderPubSubTypes.h @@ -16,29 +16,50 @@ * @file ItsPduHeaderPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ItsPduHeader.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "StationIDPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ItsPduHeader is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace ItsPduHeader_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace ItsPduHeader_Constants { + + + + + + + + + + + + + + + + + @@ -56,72 +77,96 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type ItsPduHeader defined by the user in the IDL file. - * @ingroup ITSPDUHEADER - */ - class ItsPduHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace ItsPduHeader_Constants - typedef ItsPduHeader type; - eProsima_user_DllExport ItsPduHeaderPubSubType(); - eProsima_user_DllExport virtual ~ItsPduHeaderPubSubType(); +/*! + * @brief This class represents the TopicDataType of the type ItsPduHeader defined by the user in the IDL file. + * @ingroup ItsPduHeader + */ +class ItsPduHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + typedef ItsPduHeader type; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport ItsPduHeaderPubSubType(); - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport ~ItsPduHeaderPubSubType() override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) ItsPduHeader(); - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ITSPDUHEADER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.cxx index 058af42fbea..be0c8b88a52 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.cxx @@ -14,9 +14,9 @@ /*! * @file LanePosition.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,120 +27,79 @@ char dummy; #endif // _WIN32 #include "LanePosition.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace LanePosition_Constants { +} // namespace LanePosition_Constants -etsi_its_cam_msgs::msg::LanePosition::LanePosition() +LanePosition::LanePosition() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1440c311 - m_value = 0; - } -etsi_its_cam_msgs::msg::LanePosition::~LanePosition() +LanePosition::~LanePosition() { } -etsi_its_cam_msgs::msg::LanePosition::LanePosition( +LanePosition::LanePosition( const LanePosition& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::LanePosition::LanePosition( - LanePosition&& x) +LanePosition::LanePosition( + LanePosition&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::LanePosition::operator =( +LanePosition& LanePosition::operator =( const LanePosition& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::LanePosition& etsi_its_cam_msgs::msg::LanePosition::operator =( - LanePosition&& x) +LanePosition& LanePosition::operator =( + LanePosition&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::LanePosition::operator ==( +bool LanePosition::operator ==( const LanePosition& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::LanePosition::operator !=( +bool LanePosition::operator !=( const LanePosition& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::LanePosition::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::LanePosition::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LanePosition& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::LanePosition::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::LanePosition::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::LanePosition::value( +void LanePosition::value( int8_t _value) { m_value = _value; @@ -150,7 +109,7 @@ void etsi_its_cam_msgs::msg::LanePosition::value( * @brief This function returns the value of member value * @return Value of member value */ -int8_t etsi_its_cam_msgs::msg::LanePosition::value() const +int8_t LanePosition::value() const { return m_value; } @@ -159,32 +118,18 @@ int8_t etsi_its_cam_msgs::msg::LanePosition::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int8_t& etsi_its_cam_msgs::msg::LanePosition::value() +int8_t& LanePosition::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::LanePosition::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::LanePosition::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::LanePosition::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LanePositionCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.h index 63f760c4b9c..2aaa79054ba 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePosition.h @@ -16,19 +16,24 @@ * @file LanePosition.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,177 +47,133 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LanePosition_SOURCE) -#define LanePosition_DllAPI __declspec( dllexport ) +#if defined(LANEPOSITION_SOURCE) +#define LANEPOSITION_DllAPI __declspec( dllexport ) #else -#define LanePosition_DllAPI __declspec( dllimport ) -#endif // LanePosition_SOURCE +#define LANEPOSITION_DllAPI __declspec( dllimport ) +#endif // LANEPOSITION_SOURCE #else -#define LanePosition_DllAPI +#define LANEPOSITION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define LanePosition_DllAPI +#define LANEPOSITION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace LanePosition_Constants { - const int8_t MIN = -1; - const int8_t MAX = 14; - const int8_t OFF_THE_ROAD = -1; - const int8_t HARD_SHOULDER = 0; - const int8_t OUTERMOST_DRIVING_LANE = 1; - const int8_t SECOND_LANE_FROM_OUTSIDE = 2; - } // namespace LanePosition_Constants - /*! - * @brief This class represents the structure LanePosition defined by the user in the IDL file. - * @ingroup LANEPOSITION - */ - class LanePosition - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LanePosition(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LanePosition(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. - */ - eProsima_user_DllExport LanePosition( - const LanePosition& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. - */ - eProsima_user_DllExport LanePosition( - LanePosition&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. - */ - eProsima_user_DllExport LanePosition& operator =( - const LanePosition& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. - */ - eProsima_user_DllExport LanePosition& operator =( - LanePosition&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LanePosition object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LanePosition& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LanePosition object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LanePosition& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LanePosition& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace LanePosition_Constants { + +const int8_t MIN = -1; +const int8_t MAX = 14; +const int8_t OFF_THE_ROAD = -1; +const int8_t HARD_SHOULDER = 0; +const int8_t OUTERMOST_DRIVING_LANE = 1; +const int8_t SECOND_LANE_FROM_OUTSIDE = 2; + +} // namespace LanePosition_Constants + + +/*! + * @brief This class represents the structure LanePosition defined by the user in the IDL file. + * @ingroup LanePosition + */ +class LanePosition +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LanePosition(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LanePosition(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. + */ + eProsima_user_DllExport LanePosition( + const LanePosition& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. + */ + eProsima_user_DllExport LanePosition( + LanePosition&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. + */ + eProsima_user_DllExport LanePosition& operator =( + const LanePosition& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LanePosition that will be copied. + */ + eProsima_user_DllExport LanePosition& operator =( + LanePosition&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LanePosition object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LanePosition& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LanePosition object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LanePosition& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int8_t& value(); + +private: + + int8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionCdrAux.hpp new file mode 100644 index 00000000000..b58a319e69b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionCdrAux.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LanePositionCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITIONCDRAUX_HPP_ + +#include "LanePosition.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_LanePosition_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_LanePosition_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LanePosition& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionCdrAux.ipp new file mode 100644 index 00000000000..ba920b13f4f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionCdrAux.ipp @@ -0,0 +1,143 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LanePositionCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITIONCDRAUX_IPP_ + +#include "LanePositionCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::LanePosition& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LanePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::LanePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LanePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.cxx index 8035b88c692..8c7f1710f70 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.cxx @@ -16,170 +16,199 @@ * @file LanePositionPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LanePositionPubSubTypes.h" +#include "LanePositionCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace LanePosition_Constants { - - - - - - - - } //End of namespace LanePosition_Constants - LanePositionPubSubType::LanePositionPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::LanePosition_"); - auto type_size = LanePosition::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LanePosition::isKeyDefined(); - size_t keyLength = LanePosition::getKeyMaxCdrSerializedSize() > 16 ? - LanePosition::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LanePositionPubSubType::~LanePositionPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LanePositionPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LanePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LanePositionPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LanePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LanePositionPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LanePositionPubSubType::createData() - { - return reinterpret_cast(new LanePosition()); - } - - void LanePositionPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LanePositionPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LanePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LanePosition::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LanePosition::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace LanePosition_Constants { + + + + + + + + + + + + + +} //End of namespace LanePosition_Constants + + + +LanePositionPubSubType::LanePositionPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::LanePosition_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LanePosition::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_LanePosition_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LanePositionPubSubType::~LanePositionPubSubType() +{ +} + +bool LanePositionPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LanePosition* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LanePositionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LanePosition* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LanePositionPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LanePositionPubSubType::createData() +{ + return reinterpret_cast(new LanePosition()); +} + +void LanePositionPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LanePositionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.h index f08a575bb81..f3f48190f88 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LanePositionPubSubTypes.h @@ -16,101 +16,134 @@ * @file LanePositionPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "LanePosition.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated LanePosition is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace LanePosition_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace LanePosition_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type LanePosition defined by the user in the IDL file. - * @ingroup LANEPOSITION - */ - class LanePositionPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef LanePosition type; - eProsima_user_DllExport LanePositionPubSubType(); - eProsima_user_DllExport virtual ~LanePositionPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +} // namespace LanePosition_Constants - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type LanePosition defined by the user in the IDL file. + * @ingroup LanePosition + */ +class LanePositionPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + typedef LanePosition type; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport LanePositionPubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport ~LanePositionPubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) LanePosition(); - return true; - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LANEPOSITION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.cxx index 62cec7706db..2611790c80a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.cxx @@ -14,9 +14,9 @@ /*! * @file LateralAcceleration.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "LateralAcceleration.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::LateralAcceleration::LateralAcceleration() -{ - // m_lateral_acceleration_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4b1c0397 - // m_lateral_acceleration_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@72805168 +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::LateralAcceleration::~LateralAcceleration() +LateralAcceleration::LateralAcceleration() { +} +LateralAcceleration::~LateralAcceleration() +{ } -etsi_its_cam_msgs::msg::LateralAcceleration::LateralAcceleration( +LateralAcceleration::LateralAcceleration( const LateralAcceleration& x) { m_lateral_acceleration_value = x.m_lateral_acceleration_value; m_lateral_acceleration_confidence = x.m_lateral_acceleration_confidence; } -etsi_its_cam_msgs::msg::LateralAcceleration::LateralAcceleration( - LateralAcceleration&& x) +LateralAcceleration::LateralAcceleration( + LateralAcceleration&& x) noexcept { m_lateral_acceleration_value = std::move(x.m_lateral_acceleration_value); m_lateral_acceleration_confidence = std::move(x.m_lateral_acceleration_confidence); } -etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::LateralAcceleration::operator =( +LateralAcceleration& LateralAcceleration::operator =( const LateralAcceleration& x) { m_lateral_acceleration_value = x.m_lateral_acceleration_value; m_lateral_acceleration_confidence = x.m_lateral_acceleration_confidence; - return *this; } -etsi_its_cam_msgs::msg::LateralAcceleration& etsi_its_cam_msgs::msg::LateralAcceleration::operator =( - LateralAcceleration&& x) +LateralAcceleration& LateralAcceleration::operator =( + LateralAcceleration&& x) noexcept { m_lateral_acceleration_value = std::move(x.m_lateral_acceleration_value); m_lateral_acceleration_confidence = std::move(x.m_lateral_acceleration_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::LateralAcceleration::operator ==( +bool LateralAcceleration::operator ==( const LateralAcceleration& x) const { - - return (m_lateral_acceleration_value == x.m_lateral_acceleration_value && m_lateral_acceleration_confidence == x.m_lateral_acceleration_confidence); + return (m_lateral_acceleration_value == x.m_lateral_acceleration_value && + m_lateral_acceleration_confidence == x.m_lateral_acceleration_confidence); } -bool etsi_its_cam_msgs::msg::LateralAcceleration::operator !=( +bool LateralAcceleration::operator !=( const LateralAcceleration& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::LateralAcceleration::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LateralAccelerationValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::LateralAcceleration::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LateralAcceleration& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LateralAccelerationValue::getCdrSerializedSize(data.lateral_acceleration_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getCdrSerializedSize(data.lateral_acceleration_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::LateralAcceleration::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_lateral_acceleration_value; - scdr << m_lateral_acceleration_confidence; - -} - -void etsi_its_cam_msgs::msg::LateralAcceleration::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_lateral_acceleration_value; - dcdr >> m_lateral_acceleration_confidence; -} - /*! * @brief This function copies the value in member lateral_acceleration_value * @param _lateral_acceleration_value New value to be copied in member lateral_acceleration_value */ -void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value( +void LateralAcceleration::lateral_acceleration_value( const etsi_its_cam_msgs::msg::LateralAccelerationValue& _lateral_acceleration_value) { m_lateral_acceleration_value = _lateral_acceleration_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value( * @brief This function moves the value in member lateral_acceleration_value * @param _lateral_acceleration_value New value to be moved in member lateral_acceleration_value */ -void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value( +void LateralAcceleration::lateral_acceleration_value( etsi_its_cam_msgs::msg::LateralAccelerationValue&& _lateral_acceleration_value) { m_lateral_acceleration_value = std::move(_lateral_acceleration_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value( * @brief This function returns a constant reference to member lateral_acceleration_value * @return Constant reference to member lateral_acceleration_value */ -const etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value() const +const etsi_its_cam_msgs::msg::LateralAccelerationValue& LateralAcceleration::lateral_acceleration_value() const { return m_lateral_acceleration_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg:: * @brief This function returns a reference to member lateral_acceleration_value * @return Reference to member lateral_acceleration_value */ -etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_value() +etsi_its_cam_msgs::msg::LateralAccelerationValue& LateralAcceleration::lateral_acceleration_value() { return m_lateral_acceleration_value; } + + /*! * @brief This function copies the value in member lateral_acceleration_confidence * @param _lateral_acceleration_confidence New value to be copied in member lateral_acceleration_confidence */ -void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidence( +void LateralAcceleration::lateral_acceleration_confidence( const etsi_its_cam_msgs::msg::AccelerationConfidence& _lateral_acceleration_confidence) { m_lateral_acceleration_confidence = _lateral_acceleration_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidenc * @brief This function moves the value in member lateral_acceleration_confidence * @param _lateral_acceleration_confidence New value to be moved in member lateral_acceleration_confidence */ -void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidence( +void LateralAcceleration::lateral_acceleration_confidence( etsi_its_cam_msgs::msg::AccelerationConfidence&& _lateral_acceleration_confidence) { m_lateral_acceleration_confidence = std::move(_lateral_acceleration_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidenc * @brief This function returns a constant reference to member lateral_acceleration_confidence * @return Constant reference to member lateral_acceleration_confidence */ -const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidence() const +const etsi_its_cam_msgs::msg::AccelerationConfidence& LateralAcceleration::lateral_acceleration_confidence() const { return m_lateral_acceleration_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::La * @brief This function returns a reference to member lateral_acceleration_confidence * @return Reference to member lateral_acceleration_confidence */ -etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::LateralAcceleration::lateral_acceleration_confidence() +etsi_its_cam_msgs::msg::AccelerationConfidence& LateralAcceleration::lateral_acceleration_confidence() { return m_lateral_acceleration_confidence; } -size_t etsi_its_cam_msgs::msg::LateralAcceleration::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::LateralAcceleration::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::LateralAcceleration::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LateralAccelerationCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.h index aec47b7dca9..7346e378d4b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAcceleration.h @@ -16,21 +16,26 @@ * @file LateralAcceleration.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_H_ -#include "AccelerationConfidence.h" -#include "LateralAccelerationValue.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "AccelerationConfidence.h" +#include "LateralAccelerationValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LateralAcceleration_SOURCE) -#define LateralAcceleration_DllAPI __declspec( dllexport ) +#if defined(LATERALACCELERATION_SOURCE) +#define LATERALACCELERATION_DllAPI __declspec( dllexport ) #else -#define LateralAcceleration_DllAPI __declspec( dllimport ) -#endif // LateralAcceleration_SOURCE +#define LATERALACCELERATION_DllAPI __declspec( dllimport ) +#endif // LATERALACCELERATION_SOURCE #else -#define LateralAcceleration_DllAPI +#define LATERALACCELERATION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define LateralAcceleration_DllAPI +#define LATERALACCELERATION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure LateralAcceleration defined by the user in the IDL file. - * @ingroup LATERALACCELERATION - */ - class LateralAcceleration - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LateralAcceleration(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LateralAcceleration(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. - */ - eProsima_user_DllExport LateralAcceleration( - const LateralAcceleration& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. - */ - eProsima_user_DllExport LateralAcceleration( - LateralAcceleration&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. - */ - eProsima_user_DllExport LateralAcceleration& operator =( - const LateralAcceleration& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. - */ - eProsima_user_DllExport LateralAcceleration& operator =( - LateralAcceleration&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LateralAcceleration object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LateralAcceleration& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LateralAcceleration object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LateralAcceleration& x) const; - - /*! - * @brief This function copies the value in member lateral_acceleration_value - * @param _lateral_acceleration_value New value to be copied in member lateral_acceleration_value - */ - eProsima_user_DllExport void lateral_acceleration_value( - const etsi_its_cam_msgs::msg::LateralAccelerationValue& _lateral_acceleration_value); - - /*! - * @brief This function moves the value in member lateral_acceleration_value - * @param _lateral_acceleration_value New value to be moved in member lateral_acceleration_value - */ - eProsima_user_DllExport void lateral_acceleration_value( - etsi_its_cam_msgs::msg::LateralAccelerationValue&& _lateral_acceleration_value); - - /*! - * @brief This function returns a constant reference to member lateral_acceleration_value - * @return Constant reference to member lateral_acceleration_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LateralAccelerationValue& lateral_acceleration_value() const; - - /*! - * @brief This function returns a reference to member lateral_acceleration_value - * @return Reference to member lateral_acceleration_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LateralAccelerationValue& lateral_acceleration_value(); - /*! - * @brief This function copies the value in member lateral_acceleration_confidence - * @param _lateral_acceleration_confidence New value to be copied in member lateral_acceleration_confidence - */ - eProsima_user_DllExport void lateral_acceleration_confidence( - const etsi_its_cam_msgs::msg::AccelerationConfidence& _lateral_acceleration_confidence); - - /*! - * @brief This function moves the value in member lateral_acceleration_confidence - * @param _lateral_acceleration_confidence New value to be moved in member lateral_acceleration_confidence - */ - eProsima_user_DllExport void lateral_acceleration_confidence( - etsi_its_cam_msgs::msg::AccelerationConfidence&& _lateral_acceleration_confidence); - - /*! - * @brief This function returns a constant reference to member lateral_acceleration_confidence - * @return Constant reference to member lateral_acceleration_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& lateral_acceleration_confidence() const; - - /*! - * @brief This function returns a reference to member lateral_acceleration_confidence - * @return Reference to member lateral_acceleration_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& lateral_acceleration_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LateralAcceleration& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::LateralAccelerationValue m_lateral_acceleration_value; - etsi_its_cam_msgs::msg::AccelerationConfidence m_lateral_acceleration_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure LateralAcceleration defined by the user in the IDL file. + * @ingroup LateralAcceleration + */ +class LateralAcceleration +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LateralAcceleration(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LateralAcceleration(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. + */ + eProsima_user_DllExport LateralAcceleration( + const LateralAcceleration& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. + */ + eProsima_user_DllExport LateralAcceleration( + LateralAcceleration&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. + */ + eProsima_user_DllExport LateralAcceleration& operator =( + const LateralAcceleration& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAcceleration that will be copied. + */ + eProsima_user_DllExport LateralAcceleration& operator =( + LateralAcceleration&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LateralAcceleration object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LateralAcceleration& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LateralAcceleration object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LateralAcceleration& x) const; + + /*! + * @brief This function copies the value in member lateral_acceleration_value + * @param _lateral_acceleration_value New value to be copied in member lateral_acceleration_value + */ + eProsima_user_DllExport void lateral_acceleration_value( + const etsi_its_cam_msgs::msg::LateralAccelerationValue& _lateral_acceleration_value); + + /*! + * @brief This function moves the value in member lateral_acceleration_value + * @param _lateral_acceleration_value New value to be moved in member lateral_acceleration_value + */ + eProsima_user_DllExport void lateral_acceleration_value( + etsi_its_cam_msgs::msg::LateralAccelerationValue&& _lateral_acceleration_value); + + /*! + * @brief This function returns a constant reference to member lateral_acceleration_value + * @return Constant reference to member lateral_acceleration_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LateralAccelerationValue& lateral_acceleration_value() const; + + /*! + * @brief This function returns a reference to member lateral_acceleration_value + * @return Reference to member lateral_acceleration_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LateralAccelerationValue& lateral_acceleration_value(); + + + /*! + * @brief This function copies the value in member lateral_acceleration_confidence + * @param _lateral_acceleration_confidence New value to be copied in member lateral_acceleration_confidence + */ + eProsima_user_DllExport void lateral_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _lateral_acceleration_confidence); + + /*! + * @brief This function moves the value in member lateral_acceleration_confidence + * @param _lateral_acceleration_confidence New value to be moved in member lateral_acceleration_confidence + */ + eProsima_user_DllExport void lateral_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _lateral_acceleration_confidence); + + /*! + * @brief This function returns a constant reference to member lateral_acceleration_confidence + * @return Constant reference to member lateral_acceleration_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& lateral_acceleration_confidence() const; + + /*! + * @brief This function returns a reference to member lateral_acceleration_confidence + * @return Reference to member lateral_acceleration_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& lateral_acceleration_confidence(); + +private: + + etsi_its_cam_msgs::msg::LateralAccelerationValue m_lateral_acceleration_value; + etsi_its_cam_msgs::msg::AccelerationConfidence m_lateral_acceleration_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationCdrAux.hpp new file mode 100644 index 00000000000..50bf827db92 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONCDRAUX_HPP_ + +#include "LateralAcceleration.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_LateralAcceleration_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_LateralAcceleration_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LateralAcceleration& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationCdrAux.ipp new file mode 100644 index 00000000000..4edc114fda6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONCDRAUX_IPP_ + +#include "LateralAccelerationCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::LateralAcceleration& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.lateral_acceleration_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.lateral_acceleration_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LateralAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.lateral_acceleration_value() + << eprosima::fastcdr::MemberId(1) << data.lateral_acceleration_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::LateralAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.lateral_acceleration_value(); + break; + + case 1: + dcdr >> data.lateral_acceleration_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LateralAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.cxx index 0ac8f730b32..c491f0cf725 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file LateralAccelerationPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LateralAccelerationPubSubTypes.h" +#include "LateralAccelerationCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - LateralAccelerationPubSubType::LateralAccelerationPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::LateralAcceleration_"); - auto type_size = LateralAcceleration::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LateralAcceleration::isKeyDefined(); - size_t keyLength = LateralAcceleration::getKeyMaxCdrSerializedSize() > 16 ? - LateralAcceleration::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LateralAccelerationPubSubType::~LateralAccelerationPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LateralAccelerationPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LateralAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LateralAccelerationPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LateralAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LateralAccelerationPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LateralAccelerationPubSubType::createData() - { - return reinterpret_cast(new LateralAcceleration()); - } - - void LateralAccelerationPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LateralAccelerationPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LateralAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LateralAcceleration::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LateralAcceleration::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +LateralAccelerationPubSubType::LateralAccelerationPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::LateralAcceleration_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LateralAcceleration::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_LateralAcceleration_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LateralAccelerationPubSubType::~LateralAccelerationPubSubType() +{ +} + +bool LateralAccelerationPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LateralAcceleration* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LateralAccelerationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LateralAcceleration* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LateralAccelerationPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LateralAccelerationPubSubType::createData() +{ + return reinterpret_cast(new LateralAcceleration()); +} + +void LateralAccelerationPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LateralAccelerationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.h index 4a1deffbe69..b8e57bc4228 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationPubSubTypes.h @@ -16,92 +16,122 @@ * @file LateralAccelerationPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "LateralAcceleration.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "AccelerationConfidencePubSubTypes.h" +#include "LateralAccelerationValuePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated LateralAcceleration is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type LateralAcceleration defined by the user in the IDL file. + * @ingroup LateralAcceleration + */ +class LateralAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type LateralAcceleration defined by the user in the IDL file. - * @ingroup LATERALACCELERATION - */ - class LateralAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef LateralAcceleration type; + typedef LateralAcceleration type; - eProsima_user_DllExport LateralAccelerationPubSubType(); + eProsima_user_DllExport LateralAccelerationPubSubType(); - eProsima_user_DllExport virtual ~LateralAccelerationPubSubType(); + eProsima_user_DllExport ~LateralAccelerationPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) LateralAcceleration(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.cxx index 7ef9d155c81..a9bdff9ccb7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.cxx @@ -14,9 +14,9 @@ /*! * @file LateralAccelerationValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "LateralAccelerationValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace LateralAccelerationValue_Constants { +} // namespace LateralAccelerationValue_Constants -etsi_its_cam_msgs::msg::LateralAccelerationValue::LateralAccelerationValue() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@69cac930 - m_value = 0; +LateralAccelerationValue::LateralAccelerationValue() +{ } -etsi_its_cam_msgs::msg::LateralAccelerationValue::~LateralAccelerationValue() +LateralAccelerationValue::~LateralAccelerationValue() { } -etsi_its_cam_msgs::msg::LateralAccelerationValue::LateralAccelerationValue( +LateralAccelerationValue::LateralAccelerationValue( const LateralAccelerationValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::LateralAccelerationValue::LateralAccelerationValue( - LateralAccelerationValue&& x) +LateralAccelerationValue::LateralAccelerationValue( + LateralAccelerationValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg::LateralAccelerationValue::operator =( +LateralAccelerationValue& LateralAccelerationValue::operator =( const LateralAccelerationValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::LateralAccelerationValue& etsi_its_cam_msgs::msg::LateralAccelerationValue::operator =( - LateralAccelerationValue&& x) +LateralAccelerationValue& LateralAccelerationValue::operator =( + LateralAccelerationValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::LateralAccelerationValue::operator ==( +bool LateralAccelerationValue::operator ==( const LateralAccelerationValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::LateralAccelerationValue::operator !=( +bool LateralAccelerationValue::operator !=( const LateralAccelerationValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::LateralAccelerationValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::LateralAccelerationValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LateralAccelerationValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::LateralAccelerationValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::LateralAccelerationValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::LateralAccelerationValue::value( +void LateralAccelerationValue::value( int16_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::LateralAccelerationValue::value( * @brief This function returns the value of member value * @return Value of member value */ -int16_t etsi_its_cam_msgs::msg::LateralAccelerationValue::value() const +int16_t LateralAccelerationValue::value() const { return m_value; } @@ -158,32 +118,18 @@ int16_t etsi_its_cam_msgs::msg::LateralAccelerationValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int16_t& etsi_its_cam_msgs::msg::LateralAccelerationValue::value() +int16_t& LateralAccelerationValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::LateralAccelerationValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::LateralAccelerationValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::LateralAccelerationValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LateralAccelerationValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.h index c4e80103315..36e352bfc0c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValue.h @@ -16,19 +16,24 @@ * @file LateralAccelerationValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LateralAccelerationValue_SOURCE) -#define LateralAccelerationValue_DllAPI __declspec( dllexport ) +#if defined(LATERALACCELERATIONVALUE_SOURCE) +#define LATERALACCELERATIONVALUE_DllAPI __declspec( dllexport ) #else -#define LateralAccelerationValue_DllAPI __declspec( dllimport ) -#endif // LateralAccelerationValue_SOURCE +#define LATERALACCELERATIONVALUE_DllAPI __declspec( dllimport ) +#endif // LATERALACCELERATIONVALUE_SOURCE #else -#define LateralAccelerationValue_DllAPI +#define LATERALACCELERATIONVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define LateralAccelerationValue_DllAPI +#define LATERALACCELERATIONVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace LateralAccelerationValue_Constants { - const int16_t MIN = -160; - const int16_t MAX = 161; - const int16_t POINT_ONE_METER_PER_SEC_SQUARED_TO_RIGHT = -1; - const int16_t POINT_ONE_METER_PER_SEC_SQUARED_TO_LEFT = 1; - const int16_t UNAVAILABLE = 161; - } // namespace LateralAccelerationValue_Constants - /*! - * @brief This class represents the structure LateralAccelerationValue defined by the user in the IDL file. - * @ingroup LATERALACCELERATIONVALUE - */ - class LateralAccelerationValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LateralAccelerationValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LateralAccelerationValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. - */ - eProsima_user_DllExport LateralAccelerationValue( - const LateralAccelerationValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. - */ - eProsima_user_DllExport LateralAccelerationValue( - LateralAccelerationValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. - */ - eProsima_user_DllExport LateralAccelerationValue& operator =( - const LateralAccelerationValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. - */ - eProsima_user_DllExport LateralAccelerationValue& operator =( - LateralAccelerationValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LateralAccelerationValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LateralAccelerationValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LateralAccelerationValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LateralAccelerationValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LateralAccelerationValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace LateralAccelerationValue_Constants { + +const int16_t MIN = -160; +const int16_t MAX = 161; +const int16_t POINT_ONE_METER_PER_SEC_SQUARED_TO_RIGHT = -1; +const int16_t POINT_ONE_METER_PER_SEC_SQUARED_TO_LEFT = 1; +const int16_t UNAVAILABLE = 161; + +} // namespace LateralAccelerationValue_Constants + + +/*! + * @brief This class represents the structure LateralAccelerationValue defined by the user in the IDL file. + * @ingroup LateralAccelerationValue + */ +class LateralAccelerationValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LateralAccelerationValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LateralAccelerationValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. + */ + eProsima_user_DllExport LateralAccelerationValue( + const LateralAccelerationValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. + */ + eProsima_user_DllExport LateralAccelerationValue( + LateralAccelerationValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. + */ + eProsima_user_DllExport LateralAccelerationValue& operator =( + const LateralAccelerationValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LateralAccelerationValue that will be copied. + */ + eProsima_user_DllExport LateralAccelerationValue& operator =( + LateralAccelerationValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LateralAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LateralAccelerationValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LateralAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LateralAccelerationValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + +private: + + int16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValueCdrAux.hpp new file mode 100644 index 00000000000..9a1878a3c09 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValueCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUECDRAUX_HPP_ + +#include "LateralAccelerationValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_LateralAccelerationValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_LateralAccelerationValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LateralAccelerationValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValueCdrAux.ipp new file mode 100644 index 00000000000..5dadf606d99 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValueCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LateralAccelerationValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUECDRAUX_IPP_ + +#include "LateralAccelerationValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::LateralAccelerationValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LateralAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::LateralAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LateralAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.cxx index 27ab18e9283..47d425684d2 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file LateralAccelerationValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LateralAccelerationValuePubSubTypes.h" +#include "LateralAccelerationValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace LateralAccelerationValue_Constants { - - - - - - - } //End of namespace LateralAccelerationValue_Constants - LateralAccelerationValuePubSubType::LateralAccelerationValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::LateralAccelerationValue_"); - auto type_size = LateralAccelerationValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LateralAccelerationValue::isKeyDefined(); - size_t keyLength = LateralAccelerationValue::getKeyMaxCdrSerializedSize() > 16 ? - LateralAccelerationValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LateralAccelerationValuePubSubType::~LateralAccelerationValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LateralAccelerationValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LateralAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LateralAccelerationValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LateralAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LateralAccelerationValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LateralAccelerationValuePubSubType::createData() - { - return reinterpret_cast(new LateralAccelerationValue()); - } - - void LateralAccelerationValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LateralAccelerationValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LateralAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LateralAccelerationValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LateralAccelerationValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace LateralAccelerationValue_Constants { + + + + + + + + + + + +} //End of namespace LateralAccelerationValue_Constants + + + +LateralAccelerationValuePubSubType::LateralAccelerationValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::LateralAccelerationValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LateralAccelerationValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_LateralAccelerationValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LateralAccelerationValuePubSubType::~LateralAccelerationValuePubSubType() +{ +} + +bool LateralAccelerationValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LateralAccelerationValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LateralAccelerationValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LateralAccelerationValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LateralAccelerationValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LateralAccelerationValuePubSubType::createData() +{ + return reinterpret_cast(new LateralAccelerationValue()); +} + +void LateralAccelerationValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LateralAccelerationValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.h index 45bcf48ad15..ea199a2dbf6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LateralAccelerationValuePubSubTypes.h @@ -16,100 +16,132 @@ * @file LateralAccelerationValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "LateralAccelerationValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated LateralAccelerationValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace LateralAccelerationValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace LateralAccelerationValue_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type LateralAccelerationValue defined by the user in the IDL file. - * @ingroup LATERALACCELERATIONVALUE - */ - class LateralAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef LateralAccelerationValue type; +} // namespace LateralAccelerationValue_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type LateralAccelerationValue defined by the user in the IDL file. + * @ingroup LateralAccelerationValue + */ +class LateralAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef LateralAccelerationValue type; + + eProsima_user_DllExport LateralAccelerationValuePubSubType(); - eProsima_user_DllExport LateralAccelerationValuePubSubType(); + eProsima_user_DllExport ~LateralAccelerationValuePubSubType() override; - eProsima_user_DllExport virtual ~LateralAccelerationValuePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) LateralAccelerationValue(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATERALACCELERATIONVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.cxx index e9c27fb6580..830820947be 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.cxx @@ -14,9 +14,9 @@ /*! * @file Latitude.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "Latitude.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace Latitude_Constants { +} // namespace Latitude_Constants -etsi_its_cam_msgs::msg::Latitude::Latitude() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@62e7dffa - m_value = 0; +Latitude::Latitude() +{ } -etsi_its_cam_msgs::msg::Latitude::~Latitude() +Latitude::~Latitude() { } -etsi_its_cam_msgs::msg::Latitude::Latitude( +Latitude::Latitude( const Latitude& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::Latitude::Latitude( - Latitude&& x) +Latitude::Latitude( + Latitude&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::Latitude::operator =( +Latitude& Latitude::operator =( const Latitude& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::Latitude::operator =( - Latitude&& x) +Latitude& Latitude::operator =( + Latitude&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::Latitude::operator ==( +bool Latitude::operator ==( const Latitude& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::Latitude::operator !=( +bool Latitude::operator !=( const Latitude& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::Latitude::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::Latitude::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Latitude& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::Latitude::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::Latitude::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::Latitude::value( +void Latitude::value( int32_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::Latitude::value( * @brief This function returns the value of member value * @return Value of member value */ -int32_t etsi_its_cam_msgs::msg::Latitude::value() const +int32_t Latitude::value() const { return m_value; } @@ -158,32 +118,18 @@ int32_t etsi_its_cam_msgs::msg::Latitude::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int32_t& etsi_its_cam_msgs::msg::Latitude::value() +int32_t& Latitude::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::Latitude::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::Latitude::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::Latitude::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LatitudeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.h index 1fe8307c384..4af31471fbc 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Latitude.h @@ -16,19 +16,24 @@ * @file Latitude.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Latitude_SOURCE) -#define Latitude_DllAPI __declspec( dllexport ) +#if defined(LATITUDE_SOURCE) +#define LATITUDE_DllAPI __declspec( dllexport ) #else -#define Latitude_DllAPI __declspec( dllimport ) -#endif // Latitude_SOURCE +#define LATITUDE_DllAPI __declspec( dllimport ) +#endif // LATITUDE_SOURCE #else -#define Latitude_DllAPI +#define LATITUDE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Latitude_DllAPI +#define LATITUDE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace Latitude_Constants { - const int32_t MIN = -900000000; - const int32_t MAX = 900000001; - const int32_t ONE_MICRODEGREE_NORTH = 10; - const int32_t ONE_MICRODEGREE_SOUTH = -10; - const int32_t UNAVAILABLE = 900000001; - } // namespace Latitude_Constants - /*! - * @brief This class represents the structure Latitude defined by the user in the IDL file. - * @ingroup LATITUDE - */ - class Latitude - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Latitude(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Latitude(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. - */ - eProsima_user_DllExport Latitude( - const Latitude& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. - */ - eProsima_user_DllExport Latitude( - Latitude&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. - */ - eProsima_user_DllExport Latitude& operator =( - const Latitude& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. - */ - eProsima_user_DllExport Latitude& operator =( - Latitude&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Latitude object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Latitude& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Latitude object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Latitude& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int32_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int32_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int32_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Latitude& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int32_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace Latitude_Constants { + +const int32_t MIN = -900000000; +const int32_t MAX = 900000001; +const int32_t ONE_MICRODEGREE_NORTH = 10; +const int32_t ONE_MICRODEGREE_SOUTH = -10; +const int32_t UNAVAILABLE = 900000001; + +} // namespace Latitude_Constants + + +/*! + * @brief This class represents the structure Latitude defined by the user in the IDL file. + * @ingroup Latitude + */ +class Latitude +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Latitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Latitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. + */ + eProsima_user_DllExport Latitude( + const Latitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. + */ + eProsima_user_DllExport Latitude( + Latitude&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. + */ + eProsima_user_DllExport Latitude& operator =( + const Latitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Latitude that will be copied. + */ + eProsima_user_DllExport Latitude& operator =( + Latitude&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Latitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Latitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Latitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Latitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + +private: + + int32_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudeCdrAux.hpp new file mode 100644 index 00000000000..17e763e9033 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudeCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LatitudeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDECDRAUX_HPP_ + +#include "Latitude.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_Latitude_max_cdr_typesize {8UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_Latitude_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Latitude& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudeCdrAux.ipp new file mode 100644 index 00000000000..a8414d73a40 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudeCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LatitudeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDECDRAUX_IPP_ + +#include "LatitudeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::Latitude& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Latitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::Latitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Latitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.cxx index 383f895acc6..1e0350caeed 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file LatitudePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LatitudePubSubTypes.h" +#include "LatitudeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace Latitude_Constants { - - - - - - - } //End of namespace Latitude_Constants - LatitudePubSubType::LatitudePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::Latitude_"); - auto type_size = Latitude::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Latitude::isKeyDefined(); - size_t keyLength = Latitude::getKeyMaxCdrSerializedSize() > 16 ? - Latitude::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LatitudePubSubType::~LatitudePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LatitudePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Latitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LatitudePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Latitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LatitudePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LatitudePubSubType::createData() - { - return reinterpret_cast(new Latitude()); - } - - void LatitudePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LatitudePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Latitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Latitude::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Latitude::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace Latitude_Constants { + + + + + + + + + + + +} //End of namespace Latitude_Constants + + + +LatitudePubSubType::LatitudePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::Latitude_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Latitude::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_Latitude_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LatitudePubSubType::~LatitudePubSubType() +{ +} + +bool LatitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Latitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LatitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Latitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LatitudePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LatitudePubSubType::createData() +{ + return reinterpret_cast(new Latitude()); +} + +void LatitudePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LatitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.h index 84953f7f9e1..28c2b3260d1 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LatitudePubSubTypes.h @@ -16,100 +16,132 @@ * @file LatitudePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Latitude.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Latitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace Latitude_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace Latitude_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type Latitude defined by the user in the IDL file. - * @ingroup LATITUDE - */ - class LatitudePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef Latitude type; +} // namespace Latitude_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type Latitude defined by the user in the IDL file. + * @ingroup Latitude + */ +class LatitudePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef Latitude type; + + eProsima_user_DllExport LatitudePubSubType(); - eProsima_user_DllExport LatitudePubSubType(); + eProsima_user_DllExport ~LatitudePubSubType() override; - eProsima_user_DllExport virtual ~LatitudePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Latitude(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LATITUDE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.cxx index 21b5b41362f..1e48faf37e5 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.cxx @@ -14,9 +14,9 @@ /*! * @file LightBarSirenInUse.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,143 +27,84 @@ char dummy; #endif // _WIN32 #include "LightBarSirenInUse.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace LightBarSirenInUse_Constants { -etsi_its_cam_msgs::msg::LightBarSirenInUse::LightBarSirenInUse() -{ - // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@58c540cf - // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3d6300e8 - m_bits_unused = 0; +} // namespace LightBarSirenInUse_Constants -} -etsi_its_cam_msgs::msg::LightBarSirenInUse::~LightBarSirenInUse() +LightBarSirenInUse::LightBarSirenInUse() { +} +LightBarSirenInUse::~LightBarSirenInUse() +{ } -etsi_its_cam_msgs::msg::LightBarSirenInUse::LightBarSirenInUse( +LightBarSirenInUse::LightBarSirenInUse( const LightBarSirenInUse& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::LightBarSirenInUse::LightBarSirenInUse( - LightBarSirenInUse&& x) +LightBarSirenInUse::LightBarSirenInUse( + LightBarSirenInUse&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::LightBarSirenInUse::operator =( +LightBarSirenInUse& LightBarSirenInUse::operator =( const LightBarSirenInUse& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; - return *this; } -etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::LightBarSirenInUse::operator =( - LightBarSirenInUse&& x) +LightBarSirenInUse& LightBarSirenInUse::operator =( + LightBarSirenInUse&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; - return *this; } -bool etsi_its_cam_msgs::msg::LightBarSirenInUse::operator ==( +bool LightBarSirenInUse::operator ==( const LightBarSirenInUse& x) const { - - return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); + return (m_value == x.m_value && + m_bits_unused == x.m_bits_unused); } -bool etsi_its_cam_msgs::msg::LightBarSirenInUse::operator !=( +bool LightBarSirenInUse::operator !=( const LightBarSirenInUse& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LightBarSirenInUse& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.value().size() > 0) - { - current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::LightBarSirenInUse::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - scdr << m_bits_unused; - -} - -void etsi_its_cam_msgs::msg::LightBarSirenInUse::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; - dcdr >> m_bits_unused; -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void etsi_its_cam_msgs::msg::LightBarSirenInUse::value( +void LightBarSirenInUse::value( const std::vector& _value) { m_value = _value; @@ -173,7 +114,7 @@ void etsi_its_cam_msgs::msg::LightBarSirenInUse::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void etsi_its_cam_msgs::msg::LightBarSirenInUse::value( +void LightBarSirenInUse::value( std::vector&& _value) { m_value = std::move(_value); @@ -183,7 +124,7 @@ void etsi_its_cam_msgs::msg::LightBarSirenInUse::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::vector& etsi_its_cam_msgs::msg::LightBarSirenInUse::value() const +const std::vector& LightBarSirenInUse::value() const { return m_value; } @@ -192,15 +133,17 @@ const std::vector& etsi_its_cam_msgs::msg::LightBarSirenInUse::value() * @brief This function returns a reference to member value * @return Reference to member value */ -std::vector& etsi_its_cam_msgs::msg::LightBarSirenInUse::value() +std::vector& LightBarSirenInUse::value() { return m_value; } + + /*! * @brief This function sets a value in member bits_unused * @param _bits_unused New value for member bits_unused */ -void etsi_its_cam_msgs::msg::LightBarSirenInUse::bits_unused( +void LightBarSirenInUse::bits_unused( uint8_t _bits_unused) { m_bits_unused = _bits_unused; @@ -210,7 +153,7 @@ void etsi_its_cam_msgs::msg::LightBarSirenInUse::bits_unused( * @brief This function returns the value of member bits_unused * @return Value of member bits_unused */ -uint8_t etsi_its_cam_msgs::msg::LightBarSirenInUse::bits_unused() const +uint8_t LightBarSirenInUse::bits_unused() const { return m_bits_unused; } @@ -219,32 +162,18 @@ uint8_t etsi_its_cam_msgs::msg::LightBarSirenInUse::bits_unused() const * @brief This function returns a reference to member bits_unused * @return Reference to member bits_unused */ -uint8_t& etsi_its_cam_msgs::msg::LightBarSirenInUse::bits_unused() +uint8_t& LightBarSirenInUse::bits_unused() { return m_bits_unused; } -size_t etsi_its_cam_msgs::msg::LightBarSirenInUse::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::LightBarSirenInUse::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::LightBarSirenInUse::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LightBarSirenInUseCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.h index fe86dd27329..6ae6fc1869a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUse.h @@ -16,19 +16,24 @@ * @file LightBarSirenInUse.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,200 +47,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LightBarSirenInUse_SOURCE) -#define LightBarSirenInUse_DllAPI __declspec( dllexport ) +#if defined(LIGHTBARSIRENINUSE_SOURCE) +#define LIGHTBARSIRENINUSE_DllAPI __declspec( dllexport ) #else -#define LightBarSirenInUse_DllAPI __declspec( dllimport ) -#endif // LightBarSirenInUse_SOURCE +#define LIGHTBARSIRENINUSE_DllAPI __declspec( dllimport ) +#endif // LIGHTBARSIRENINUSE_SOURCE #else -#define LightBarSirenInUse_DllAPI +#define LIGHTBARSIRENINUSE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define LightBarSirenInUse_DllAPI +#define LIGHTBARSIRENINUSE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace LightBarSirenInUse_Constants { - const uint8_t SIZE_BITS = 2; - const uint8_t BIT_INDEX_LIGHT_BAR_ACTIVATED = 0; - const uint8_t BIT_INDEX_SIREN_ACTIVATED = 1; - } // namespace LightBarSirenInUse_Constants - /*! - * @brief This class represents the structure LightBarSirenInUse defined by the user in the IDL file. - * @ingroup LIGHTBARSIRENINUSE - */ - class LightBarSirenInUse - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LightBarSirenInUse(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LightBarSirenInUse(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. - */ - eProsima_user_DllExport LightBarSirenInUse( - const LightBarSirenInUse& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. - */ - eProsima_user_DllExport LightBarSirenInUse( - LightBarSirenInUse&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. - */ - eProsima_user_DllExport LightBarSirenInUse& operator =( - const LightBarSirenInUse& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. - */ - eProsima_user_DllExport LightBarSirenInUse& operator =( - LightBarSirenInUse&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LightBarSirenInUse object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LightBarSirenInUse& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LightBarSirenInUse object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LightBarSirenInUse& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::vector& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::vector&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::vector& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::vector& value(); - /*! - * @brief This function sets a value in member bits_unused - * @param _bits_unused New value for member bits_unused - */ - eProsima_user_DllExport void bits_unused( - uint8_t _bits_unused); - - /*! - * @brief This function returns the value of member bits_unused - * @return Value of member bits_unused - */ - eProsima_user_DllExport uint8_t bits_unused() const; - - /*! - * @brief This function returns a reference to member bits_unused - * @return Reference to member bits_unused - */ - eProsima_user_DllExport uint8_t& bits_unused(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LightBarSirenInUse& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_value; - uint8_t m_bits_unused; - }; - } // namespace msg + +namespace msg { + +namespace LightBarSirenInUse_Constants { + +const uint8_t SIZE_BITS = 2; +const uint8_t BIT_INDEX_LIGHT_BAR_ACTIVATED = 0; +const uint8_t BIT_INDEX_SIREN_ACTIVATED = 1; + +} // namespace LightBarSirenInUse_Constants + + +/*! + * @brief This class represents the structure LightBarSirenInUse defined by the user in the IDL file. + * @ingroup LightBarSirenInUse + */ +class LightBarSirenInUse +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LightBarSirenInUse(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LightBarSirenInUse(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. + */ + eProsima_user_DllExport LightBarSirenInUse( + const LightBarSirenInUse& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. + */ + eProsima_user_DllExport LightBarSirenInUse( + LightBarSirenInUse&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. + */ + eProsima_user_DllExport LightBarSirenInUse& operator =( + const LightBarSirenInUse& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LightBarSirenInUse that will be copied. + */ + eProsima_user_DllExport LightBarSirenInUse& operator =( + LightBarSirenInUse&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LightBarSirenInUse object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LightBarSirenInUse& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LightBarSirenInUse object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LightBarSirenInUse& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + + + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + +private: + + std::vector m_value; + uint8_t m_bits_unused{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUseCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUseCdrAux.hpp new file mode 100644 index 00000000000..024ff6fd5b5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUseCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LightBarSirenInUseCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSECDRAUX_HPP_ + +#include "LightBarSirenInUse.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_LightBarSirenInUse_max_cdr_typesize {109UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_LightBarSirenInUse_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LightBarSirenInUse& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUseCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUseCdrAux.ipp new file mode 100644 index 00000000000..494fd57c8cf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUseCdrAux.ipp @@ -0,0 +1,145 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LightBarSirenInUseCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSECDRAUX_IPP_ + +#include "LightBarSirenInUseCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::LightBarSirenInUse& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bits_unused(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LightBarSirenInUse& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() + << eprosima::fastcdr::MemberId(1) << data.bits_unused() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::LightBarSirenInUse& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + case 1: + dcdr >> data.bits_unused(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LightBarSirenInUse& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.cxx index a634d0d7409..b2abe1aa010 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.cxx @@ -16,167 +16,193 @@ * @file LightBarSirenInUsePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LightBarSirenInUsePubSubTypes.h" +#include "LightBarSirenInUseCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace LightBarSirenInUse_Constants { - - - - - } //End of namespace LightBarSirenInUse_Constants - LightBarSirenInUsePubSubType::LightBarSirenInUsePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::LightBarSirenInUse_"); - auto type_size = LightBarSirenInUse::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LightBarSirenInUse::isKeyDefined(); - size_t keyLength = LightBarSirenInUse::getKeyMaxCdrSerializedSize() > 16 ? - LightBarSirenInUse::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LightBarSirenInUsePubSubType::~LightBarSirenInUsePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LightBarSirenInUsePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LightBarSirenInUse* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LightBarSirenInUsePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LightBarSirenInUse* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LightBarSirenInUsePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LightBarSirenInUsePubSubType::createData() - { - return reinterpret_cast(new LightBarSirenInUse()); - } - - void LightBarSirenInUsePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LightBarSirenInUsePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LightBarSirenInUse* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LightBarSirenInUse::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LightBarSirenInUse::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace LightBarSirenInUse_Constants { + + + + + + + +} //End of namespace LightBarSirenInUse_Constants + + + +LightBarSirenInUsePubSubType::LightBarSirenInUsePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::LightBarSirenInUse_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LightBarSirenInUse::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_LightBarSirenInUse_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LightBarSirenInUsePubSubType::~LightBarSirenInUsePubSubType() +{ +} + +bool LightBarSirenInUsePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LightBarSirenInUse* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LightBarSirenInUsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LightBarSirenInUse* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LightBarSirenInUsePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LightBarSirenInUsePubSubType::createData() +{ + return reinterpret_cast(new LightBarSirenInUse()); +} + +void LightBarSirenInUsePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LightBarSirenInUsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.h index 534b5f3043a..b5b75fedb7b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LightBarSirenInUsePubSubTypes.h @@ -16,98 +16,128 @@ * @file LightBarSirenInUsePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "LightBarSirenInUse.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated LightBarSirenInUse is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace LightBarSirenInUse_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace LightBarSirenInUse_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type LightBarSirenInUse defined by the user in the IDL file. - * @ingroup LIGHTBARSIRENINUSE - */ - class LightBarSirenInUsePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace LightBarSirenInUse_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type LightBarSirenInUse defined by the user in the IDL file. + * @ingroup LightBarSirenInUse + */ +class LightBarSirenInUsePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef LightBarSirenInUse type; - typedef LightBarSirenInUse type; + eProsima_user_DllExport LightBarSirenInUsePubSubType(); - eProsima_user_DllExport LightBarSirenInUsePubSubType(); + eProsima_user_DllExport ~LightBarSirenInUsePubSubType() override; - eProsima_user_DllExport virtual ~LightBarSirenInUsePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LIGHTBARSIRENINUSE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.cxx index 88d133a50ce..40d04b7dde3 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.cxx @@ -14,9 +14,9 @@ /*! * @file Longitude.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "Longitude.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace Longitude_Constants { +} // namespace Longitude_Constants -etsi_its_cam_msgs::msg::Longitude::Longitude() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4567e53d - m_value = 0; +Longitude::Longitude() +{ } -etsi_its_cam_msgs::msg::Longitude::~Longitude() +Longitude::~Longitude() { } -etsi_its_cam_msgs::msg::Longitude::Longitude( +Longitude::Longitude( const Longitude& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::Longitude::Longitude( - Longitude&& x) +Longitude::Longitude( + Longitude&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::Longitude::operator =( +Longitude& Longitude::operator =( const Longitude& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::Longitude::operator =( - Longitude&& x) +Longitude& Longitude::operator =( + Longitude&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::Longitude::operator ==( +bool Longitude::operator ==( const Longitude& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::Longitude::operator !=( +bool Longitude::operator !=( const Longitude& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::Longitude::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::Longitude::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Longitude& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::Longitude::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::Longitude::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::Longitude::value( +void Longitude::value( int32_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::Longitude::value( * @brief This function returns the value of member value * @return Value of member value */ -int32_t etsi_its_cam_msgs::msg::Longitude::value() const +int32_t Longitude::value() const { return m_value; } @@ -158,32 +118,18 @@ int32_t etsi_its_cam_msgs::msg::Longitude::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int32_t& etsi_its_cam_msgs::msg::Longitude::value() +int32_t& Longitude::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::Longitude::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::Longitude::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::Longitude::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LongitudeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.h index b80e52005aa..2dbc6432de8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Longitude.h @@ -16,19 +16,24 @@ * @file Longitude.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Longitude_SOURCE) -#define Longitude_DllAPI __declspec( dllexport ) +#if defined(LONGITUDE_SOURCE) +#define LONGITUDE_DllAPI __declspec( dllexport ) #else -#define Longitude_DllAPI __declspec( dllimport ) -#endif // Longitude_SOURCE +#define LONGITUDE_DllAPI __declspec( dllimport ) +#endif // LONGITUDE_SOURCE #else -#define Longitude_DllAPI +#define LONGITUDE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Longitude_DllAPI +#define LONGITUDE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace Longitude_Constants { - const int32_t MIN = -1800000000; - const int32_t MAX = 1800000001; - const int32_t ONE_MICRODEGREE_EAST = 10; - const int32_t ONE_MICRODEGREE_WEST = -10; - const int32_t UNAVAILABLE = 1800000001; - } // namespace Longitude_Constants - /*! - * @brief This class represents the structure Longitude defined by the user in the IDL file. - * @ingroup LONGITUDE - */ - class Longitude - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Longitude(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Longitude(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. - */ - eProsima_user_DllExport Longitude( - const Longitude& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. - */ - eProsima_user_DllExport Longitude( - Longitude&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. - */ - eProsima_user_DllExport Longitude& operator =( - const Longitude& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. - */ - eProsima_user_DllExport Longitude& operator =( - Longitude&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Longitude object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Longitude& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Longitude object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Longitude& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int32_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int32_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int32_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Longitude& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int32_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace Longitude_Constants { + +const int32_t MIN = -1800000000; +const int32_t MAX = 1800000001; +const int32_t ONE_MICRODEGREE_EAST = 10; +const int32_t ONE_MICRODEGREE_WEST = -10; +const int32_t UNAVAILABLE = 1800000001; + +} // namespace Longitude_Constants + + +/*! + * @brief This class represents the structure Longitude defined by the user in the IDL file. + * @ingroup Longitude + */ +class Longitude +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Longitude(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Longitude(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. + */ + eProsima_user_DllExport Longitude( + const Longitude& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. + */ + eProsima_user_DllExport Longitude( + Longitude&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. + */ + eProsima_user_DllExport Longitude& operator =( + const Longitude& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Longitude that will be copied. + */ + eProsima_user_DllExport Longitude& operator =( + Longitude&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Longitude object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Longitude& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Longitude object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Longitude& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value(); + +private: + + int32_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudeCdrAux.hpp new file mode 100644 index 00000000000..60f7c9d565a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudeCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDECDRAUX_HPP_ + +#include "Longitude.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_Longitude_max_cdr_typesize {8UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_Longitude_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Longitude& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudeCdrAux.ipp new file mode 100644 index 00000000000..d56017c8634 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudeCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDECDRAUX_IPP_ + +#include "LongitudeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::Longitude& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Longitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::Longitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Longitude& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.cxx index 6105d93aa80..5b32639878d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file LongitudePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LongitudePubSubTypes.h" +#include "LongitudeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace Longitude_Constants { - - - - - - - } //End of namespace Longitude_Constants - LongitudePubSubType::LongitudePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::Longitude_"); - auto type_size = Longitude::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Longitude::isKeyDefined(); - size_t keyLength = Longitude::getKeyMaxCdrSerializedSize() > 16 ? - Longitude::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LongitudePubSubType::~LongitudePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LongitudePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Longitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LongitudePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Longitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LongitudePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LongitudePubSubType::createData() - { - return reinterpret_cast(new Longitude()); - } - - void LongitudePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LongitudePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Longitude* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Longitude::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Longitude::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace Longitude_Constants { + + + + + + + + + + + +} //End of namespace Longitude_Constants + + + +LongitudePubSubType::LongitudePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::Longitude_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Longitude::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_Longitude_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LongitudePubSubType::~LongitudePubSubType() +{ +} + +bool LongitudePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Longitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LongitudePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Longitude* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LongitudePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LongitudePubSubType::createData() +{ + return reinterpret_cast(new Longitude()); +} + +void LongitudePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LongitudePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.h index 70344c0d10a..273e7e8d317 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudePubSubTypes.h @@ -16,100 +16,132 @@ * @file LongitudePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Longitude.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Longitude is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace Longitude_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace Longitude_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type Longitude defined by the user in the IDL file. - * @ingroup LONGITUDE - */ - class LongitudePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef Longitude type; +} // namespace Longitude_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type Longitude defined by the user in the IDL file. + * @ingroup Longitude + */ +class LongitudePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef Longitude type; + + eProsima_user_DllExport LongitudePubSubType(); - eProsima_user_DllExport LongitudePubSubType(); + eProsima_user_DllExport ~LongitudePubSubType() override; - eProsima_user_DllExport virtual ~LongitudePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Longitude(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.cxx index 9c5163824c3..e12f7b0f32d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.cxx @@ -14,9 +14,9 @@ /*! * @file LongitudinalAcceleration.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "LongitudinalAcceleration.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::LongitudinalAcceleration::LongitudinalAcceleration() -{ - // m_longitudinal_acceleration_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@301d8120 - // m_longitudinal_acceleration_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6d367020 +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::LongitudinalAcceleration::~LongitudinalAcceleration() +LongitudinalAcceleration::LongitudinalAcceleration() { +} +LongitudinalAcceleration::~LongitudinalAcceleration() +{ } -etsi_its_cam_msgs::msg::LongitudinalAcceleration::LongitudinalAcceleration( +LongitudinalAcceleration::LongitudinalAcceleration( const LongitudinalAcceleration& x) { m_longitudinal_acceleration_value = x.m_longitudinal_acceleration_value; m_longitudinal_acceleration_confidence = x.m_longitudinal_acceleration_confidence; } -etsi_its_cam_msgs::msg::LongitudinalAcceleration::LongitudinalAcceleration( - LongitudinalAcceleration&& x) +LongitudinalAcceleration::LongitudinalAcceleration( + LongitudinalAcceleration&& x) noexcept { m_longitudinal_acceleration_value = std::move(x.m_longitudinal_acceleration_value); m_longitudinal_acceleration_confidence = std::move(x.m_longitudinal_acceleration_confidence); } -etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg::LongitudinalAcceleration::operator =( +LongitudinalAcceleration& LongitudinalAcceleration::operator =( const LongitudinalAcceleration& x) { m_longitudinal_acceleration_value = x.m_longitudinal_acceleration_value; m_longitudinal_acceleration_confidence = x.m_longitudinal_acceleration_confidence; - return *this; } -etsi_its_cam_msgs::msg::LongitudinalAcceleration& etsi_its_cam_msgs::msg::LongitudinalAcceleration::operator =( - LongitudinalAcceleration&& x) +LongitudinalAcceleration& LongitudinalAcceleration::operator =( + LongitudinalAcceleration&& x) noexcept { m_longitudinal_acceleration_value = std::move(x.m_longitudinal_acceleration_value); m_longitudinal_acceleration_confidence = std::move(x.m_longitudinal_acceleration_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::LongitudinalAcceleration::operator ==( +bool LongitudinalAcceleration::operator ==( const LongitudinalAcceleration& x) const { - - return (m_longitudinal_acceleration_value == x.m_longitudinal_acceleration_value && m_longitudinal_acceleration_confidence == x.m_longitudinal_acceleration_confidence); + return (m_longitudinal_acceleration_value == x.m_longitudinal_acceleration_value && + m_longitudinal_acceleration_confidence == x.m_longitudinal_acceleration_confidence); } -bool etsi_its_cam_msgs::msg::LongitudinalAcceleration::operator !=( +bool LongitudinalAcceleration::operator !=( const LongitudinalAcceleration& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::LongitudinalAcceleration::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::LongitudinalAcceleration::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LongitudinalAcceleration& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getCdrSerializedSize(data.longitudinal_acceleration_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getCdrSerializedSize(data.longitudinal_acceleration_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::LongitudinalAcceleration::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_longitudinal_acceleration_value; - scdr << m_longitudinal_acceleration_confidence; - -} - -void etsi_its_cam_msgs::msg::LongitudinalAcceleration::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_longitudinal_acceleration_value; - dcdr >> m_longitudinal_acceleration_confidence; -} - /*! * @brief This function copies the value in member longitudinal_acceleration_value * @param _longitudinal_acceleration_value New value to be copied in member longitudinal_acceleration_value */ -void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_value( +void LongitudinalAcceleration::longitudinal_acceleration_value( const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& _longitudinal_acceleration_value) { m_longitudinal_acceleration_value = _longitudinal_acceleration_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration * @brief This function moves the value in member longitudinal_acceleration_value * @param _longitudinal_acceleration_value New value to be moved in member longitudinal_acceleration_value */ -void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_value( +void LongitudinalAcceleration::longitudinal_acceleration_value( etsi_its_cam_msgs::msg::LongitudinalAccelerationValue&& _longitudinal_acceleration_value) { m_longitudinal_acceleration_value = std::move(_longitudinal_acceleration_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration * @brief This function returns a constant reference to member longitudinal_acceleration_value * @return Constant reference to member longitudinal_acceleration_value */ -const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_value() const +const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& LongitudinalAcceleration::longitudinal_acceleration_value() const { return m_longitudinal_acceleration_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs:: * @brief This function returns a reference to member longitudinal_acceleration_value * @return Reference to member longitudinal_acceleration_value */ -etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_value() +etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& LongitudinalAcceleration::longitudinal_acceleration_value() { return m_longitudinal_acceleration_value; } + + /*! * @brief This function copies the value in member longitudinal_acceleration_confidence * @param _longitudinal_acceleration_confidence New value to be copied in member longitudinal_acceleration_confidence */ -void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_confidence( +void LongitudinalAcceleration::longitudinal_acceleration_confidence( const etsi_its_cam_msgs::msg::AccelerationConfidence& _longitudinal_acceleration_confidence) { m_longitudinal_acceleration_confidence = _longitudinal_acceleration_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration * @brief This function moves the value in member longitudinal_acceleration_confidence * @param _longitudinal_acceleration_confidence New value to be moved in member longitudinal_acceleration_confidence */ -void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_confidence( +void LongitudinalAcceleration::longitudinal_acceleration_confidence( etsi_its_cam_msgs::msg::AccelerationConfidence&& _longitudinal_acceleration_confidence) { m_longitudinal_acceleration_confidence = std::move(_longitudinal_acceleration_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration * @brief This function returns a constant reference to member longitudinal_acceleration_confidence * @return Constant reference to member longitudinal_acceleration_confidence */ -const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_confidence() const +const etsi_its_cam_msgs::msg::AccelerationConfidence& LongitudinalAcceleration::longitudinal_acceleration_confidence() const { return m_longitudinal_acceleration_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::Lo * @brief This function returns a reference to member longitudinal_acceleration_confidence * @return Reference to member longitudinal_acceleration_confidence */ -etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::LongitudinalAcceleration::longitudinal_acceleration_confidence() +etsi_its_cam_msgs::msg::AccelerationConfidence& LongitudinalAcceleration::longitudinal_acceleration_confidence() { return m_longitudinal_acceleration_confidence; } -size_t etsi_its_cam_msgs::msg::LongitudinalAcceleration::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::LongitudinalAcceleration::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::LongitudinalAcceleration::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LongitudinalAccelerationCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.h index 589ba9b5039..d2cef677593 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAcceleration.h @@ -16,21 +16,26 @@ * @file LongitudinalAcceleration.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_H_ -#include "LongitudinalAccelerationValue.h" -#include "AccelerationConfidence.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "LongitudinalAccelerationValue.h" +#include "AccelerationConfidence.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LongitudinalAcceleration_SOURCE) -#define LongitudinalAcceleration_DllAPI __declspec( dllexport ) +#if defined(LONGITUDINALACCELERATION_SOURCE) +#define LONGITUDINALACCELERATION_DllAPI __declspec( dllexport ) #else -#define LongitudinalAcceleration_DllAPI __declspec( dllimport ) -#endif // LongitudinalAcceleration_SOURCE +#define LONGITUDINALACCELERATION_DllAPI __declspec( dllimport ) +#endif // LONGITUDINALACCELERATION_SOURCE #else -#define LongitudinalAcceleration_DllAPI +#define LONGITUDINALACCELERATION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define LongitudinalAcceleration_DllAPI +#define LONGITUDINALACCELERATION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure LongitudinalAcceleration defined by the user in the IDL file. - * @ingroup LONGITUDINALACCELERATION - */ - class LongitudinalAcceleration - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongitudinalAcceleration(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongitudinalAcceleration(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. - */ - eProsima_user_DllExport LongitudinalAcceleration( - const LongitudinalAcceleration& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. - */ - eProsima_user_DllExport LongitudinalAcceleration( - LongitudinalAcceleration&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. - */ - eProsima_user_DllExport LongitudinalAcceleration& operator =( - const LongitudinalAcceleration& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. - */ - eProsima_user_DllExport LongitudinalAcceleration& operator =( - LongitudinalAcceleration&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LongitudinalAcceleration object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongitudinalAcceleration& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LongitudinalAcceleration object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongitudinalAcceleration& x) const; - - /*! - * @brief This function copies the value in member longitudinal_acceleration_value - * @param _longitudinal_acceleration_value New value to be copied in member longitudinal_acceleration_value - */ - eProsima_user_DllExport void longitudinal_acceleration_value( - const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& _longitudinal_acceleration_value); - - /*! - * @brief This function moves the value in member longitudinal_acceleration_value - * @param _longitudinal_acceleration_value New value to be moved in member longitudinal_acceleration_value - */ - eProsima_user_DllExport void longitudinal_acceleration_value( - etsi_its_cam_msgs::msg::LongitudinalAccelerationValue&& _longitudinal_acceleration_value); - - /*! - * @brief This function returns a constant reference to member longitudinal_acceleration_value - * @return Constant reference to member longitudinal_acceleration_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& longitudinal_acceleration_value() const; - - /*! - * @brief This function returns a reference to member longitudinal_acceleration_value - * @return Reference to member longitudinal_acceleration_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& longitudinal_acceleration_value(); - /*! - * @brief This function copies the value in member longitudinal_acceleration_confidence - * @param _longitudinal_acceleration_confidence New value to be copied in member longitudinal_acceleration_confidence - */ - eProsima_user_DllExport void longitudinal_acceleration_confidence( - const etsi_its_cam_msgs::msg::AccelerationConfidence& _longitudinal_acceleration_confidence); - - /*! - * @brief This function moves the value in member longitudinal_acceleration_confidence - * @param _longitudinal_acceleration_confidence New value to be moved in member longitudinal_acceleration_confidence - */ - eProsima_user_DllExport void longitudinal_acceleration_confidence( - etsi_its_cam_msgs::msg::AccelerationConfidence&& _longitudinal_acceleration_confidence); - - /*! - * @brief This function returns a constant reference to member longitudinal_acceleration_confidence - * @return Constant reference to member longitudinal_acceleration_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& longitudinal_acceleration_confidence() const; - - /*! - * @brief This function returns a reference to member longitudinal_acceleration_confidence - * @return Reference to member longitudinal_acceleration_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& longitudinal_acceleration_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LongitudinalAcceleration& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::LongitudinalAccelerationValue m_longitudinal_acceleration_value; - etsi_its_cam_msgs::msg::AccelerationConfidence m_longitudinal_acceleration_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure LongitudinalAcceleration defined by the user in the IDL file. + * @ingroup LongitudinalAcceleration + */ +class LongitudinalAcceleration +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LongitudinalAcceleration(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LongitudinalAcceleration(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. + */ + eProsima_user_DllExport LongitudinalAcceleration( + const LongitudinalAcceleration& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. + */ + eProsima_user_DllExport LongitudinalAcceleration( + LongitudinalAcceleration&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. + */ + eProsima_user_DllExport LongitudinalAcceleration& operator =( + const LongitudinalAcceleration& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAcceleration that will be copied. + */ + eProsima_user_DllExport LongitudinalAcceleration& operator =( + LongitudinalAcceleration&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LongitudinalAcceleration object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LongitudinalAcceleration& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LongitudinalAcceleration object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LongitudinalAcceleration& x) const; + + /*! + * @brief This function copies the value in member longitudinal_acceleration_value + * @param _longitudinal_acceleration_value New value to be copied in member longitudinal_acceleration_value + */ + eProsima_user_DllExport void longitudinal_acceleration_value( + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& _longitudinal_acceleration_value); + + /*! + * @brief This function moves the value in member longitudinal_acceleration_value + * @param _longitudinal_acceleration_value New value to be moved in member longitudinal_acceleration_value + */ + eProsima_user_DllExport void longitudinal_acceleration_value( + etsi_its_cam_msgs::msg::LongitudinalAccelerationValue&& _longitudinal_acceleration_value); + + /*! + * @brief This function returns a constant reference to member longitudinal_acceleration_value + * @return Constant reference to member longitudinal_acceleration_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& longitudinal_acceleration_value() const; + + /*! + * @brief This function returns a reference to member longitudinal_acceleration_value + * @return Reference to member longitudinal_acceleration_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& longitudinal_acceleration_value(); + + + /*! + * @brief This function copies the value in member longitudinal_acceleration_confidence + * @param _longitudinal_acceleration_confidence New value to be copied in member longitudinal_acceleration_confidence + */ + eProsima_user_DllExport void longitudinal_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _longitudinal_acceleration_confidence); + + /*! + * @brief This function moves the value in member longitudinal_acceleration_confidence + * @param _longitudinal_acceleration_confidence New value to be moved in member longitudinal_acceleration_confidence + */ + eProsima_user_DllExport void longitudinal_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _longitudinal_acceleration_confidence); + + /*! + * @brief This function returns a constant reference to member longitudinal_acceleration_confidence + * @return Constant reference to member longitudinal_acceleration_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& longitudinal_acceleration_confidence() const; + + /*! + * @brief This function returns a reference to member longitudinal_acceleration_confidence + * @return Reference to member longitudinal_acceleration_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& longitudinal_acceleration_confidence(); + +private: + + etsi_its_cam_msgs::msg::LongitudinalAccelerationValue m_longitudinal_acceleration_value; + etsi_its_cam_msgs::msg::AccelerationConfidence m_longitudinal_acceleration_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationCdrAux.hpp new file mode 100644 index 00000000000..eb41d127a28 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONCDRAUX_HPP_ + +#include "LongitudinalAcceleration.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_LongitudinalAcceleration_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_LongitudinalAcceleration_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationCdrAux.ipp new file mode 100644 index 00000000000..d790d4e2e68 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONCDRAUX_IPP_ + +#include "LongitudinalAccelerationCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.longitudinal_acceleration_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.longitudinal_acceleration_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.longitudinal_acceleration_value() + << eprosima::fastcdr::MemberId(1) << data.longitudinal_acceleration_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::LongitudinalAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.longitudinal_acceleration_value(); + break; + + case 1: + dcdr >> data.longitudinal_acceleration_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LongitudinalAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.cxx index 1ab3dc03357..d3545613e6e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file LongitudinalAccelerationPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LongitudinalAccelerationPubSubTypes.h" +#include "LongitudinalAccelerationCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - LongitudinalAccelerationPubSubType::LongitudinalAccelerationPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::LongitudinalAcceleration_"); - auto type_size = LongitudinalAcceleration::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LongitudinalAcceleration::isKeyDefined(); - size_t keyLength = LongitudinalAcceleration::getKeyMaxCdrSerializedSize() > 16 ? - LongitudinalAcceleration::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LongitudinalAccelerationPubSubType::~LongitudinalAccelerationPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LongitudinalAccelerationPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LongitudinalAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LongitudinalAccelerationPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LongitudinalAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LongitudinalAccelerationPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LongitudinalAccelerationPubSubType::createData() - { - return reinterpret_cast(new LongitudinalAcceleration()); - } - - void LongitudinalAccelerationPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LongitudinalAccelerationPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LongitudinalAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LongitudinalAcceleration::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LongitudinalAcceleration::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +LongitudinalAccelerationPubSubType::LongitudinalAccelerationPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::LongitudinalAcceleration_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LongitudinalAcceleration::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_LongitudinalAcceleration_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LongitudinalAccelerationPubSubType::~LongitudinalAccelerationPubSubType() +{ +} + +bool LongitudinalAccelerationPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LongitudinalAcceleration* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LongitudinalAccelerationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LongitudinalAcceleration* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LongitudinalAccelerationPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LongitudinalAccelerationPubSubType::createData() +{ + return reinterpret_cast(new LongitudinalAcceleration()); +} + +void LongitudinalAccelerationPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LongitudinalAccelerationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.h index 78167e51a6b..9f556f6cb37 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationPubSubTypes.h @@ -16,92 +16,122 @@ * @file LongitudinalAccelerationPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "LongitudinalAcceleration.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "LongitudinalAccelerationValuePubSubTypes.h" +#include "AccelerationConfidencePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated LongitudinalAcceleration is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type LongitudinalAcceleration defined by the user in the IDL file. + * @ingroup LongitudinalAcceleration + */ +class LongitudinalAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type LongitudinalAcceleration defined by the user in the IDL file. - * @ingroup LONGITUDINALACCELERATION - */ - class LongitudinalAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef LongitudinalAcceleration type; + typedef LongitudinalAcceleration type; - eProsima_user_DllExport LongitudinalAccelerationPubSubType(); + eProsima_user_DllExport LongitudinalAccelerationPubSubType(); - eProsima_user_DllExport virtual ~LongitudinalAccelerationPubSubType(); + eProsima_user_DllExport ~LongitudinalAccelerationPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) LongitudinalAcceleration(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.cxx index 5225678785d..31301393849 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.cxx @@ -14,9 +14,9 @@ /*! * @file LongitudinalAccelerationValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "LongitudinalAccelerationValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace LongitudinalAccelerationValue_Constants { +} // namespace LongitudinalAccelerationValue_Constants -etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::LongitudinalAccelerationValue() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5cbb84b1 - m_value = 0; +LongitudinalAccelerationValue::LongitudinalAccelerationValue() +{ } -etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::~LongitudinalAccelerationValue() +LongitudinalAccelerationValue::~LongitudinalAccelerationValue() { } -etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::LongitudinalAccelerationValue( +LongitudinalAccelerationValue::LongitudinalAccelerationValue( const LongitudinalAccelerationValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::LongitudinalAccelerationValue( - LongitudinalAccelerationValue&& x) +LongitudinalAccelerationValue::LongitudinalAccelerationValue( + LongitudinalAccelerationValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::operator =( +LongitudinalAccelerationValue& LongitudinalAccelerationValue::operator =( const LongitudinalAccelerationValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::operator =( - LongitudinalAccelerationValue&& x) +LongitudinalAccelerationValue& LongitudinalAccelerationValue::operator =( + LongitudinalAccelerationValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::operator ==( +bool LongitudinalAccelerationValue::operator ==( const LongitudinalAccelerationValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::operator !=( +bool LongitudinalAccelerationValue::operator !=( const LongitudinalAccelerationValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::value( +void LongitudinalAccelerationValue::value( int16_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::value( * @brief This function returns the value of member value * @return Value of member value */ -int16_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::value() const +int16_t LongitudinalAccelerationValue::value() const { return m_value; } @@ -158,32 +118,18 @@ int16_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int16_t& etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::value() +int16_t& LongitudinalAccelerationValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::LongitudinalAccelerationValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LongitudinalAccelerationValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.h index 4cd69e3e7fe..be615524c9f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValue.h @@ -16,19 +16,24 @@ * @file LongitudinalAccelerationValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LongitudinalAccelerationValue_SOURCE) -#define LongitudinalAccelerationValue_DllAPI __declspec( dllexport ) +#if defined(LONGITUDINALACCELERATIONVALUE_SOURCE) +#define LONGITUDINALACCELERATIONVALUE_DllAPI __declspec( dllexport ) #else -#define LongitudinalAccelerationValue_DllAPI __declspec( dllimport ) -#endif // LongitudinalAccelerationValue_SOURCE +#define LONGITUDINALACCELERATIONVALUE_DllAPI __declspec( dllimport ) +#endif // LONGITUDINALACCELERATIONVALUE_SOURCE #else -#define LongitudinalAccelerationValue_DllAPI +#define LONGITUDINALACCELERATIONVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define LongitudinalAccelerationValue_DllAPI +#define LONGITUDINALACCELERATIONVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace LongitudinalAccelerationValue_Constants { - const int16_t MIN = -160; - const int16_t MAX = 161; - const int16_t POINT_ONE_METER_PER_SEC_SQUARED_FORWARD = 1; - const int16_t POINT_ONE_METER_PER_SEC_SQUARED_BACKWARD = -1; - const int16_t UNAVAILABLE = 161; - } // namespace LongitudinalAccelerationValue_Constants - /*! - * @brief This class represents the structure LongitudinalAccelerationValue defined by the user in the IDL file. - * @ingroup LONGITUDINALACCELERATIONVALUE - */ - class LongitudinalAccelerationValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongitudinalAccelerationValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongitudinalAccelerationValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. - */ - eProsima_user_DllExport LongitudinalAccelerationValue( - const LongitudinalAccelerationValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. - */ - eProsima_user_DllExport LongitudinalAccelerationValue( - LongitudinalAccelerationValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. - */ - eProsima_user_DllExport LongitudinalAccelerationValue& operator =( - const LongitudinalAccelerationValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. - */ - eProsima_user_DllExport LongitudinalAccelerationValue& operator =( - LongitudinalAccelerationValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LongitudinalAccelerationValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongitudinalAccelerationValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LongitudinalAccelerationValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongitudinalAccelerationValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace LongitudinalAccelerationValue_Constants { + +const int16_t MIN = -160; +const int16_t MAX = 161; +const int16_t POINT_ONE_METER_PER_SEC_SQUARED_FORWARD = 1; +const int16_t POINT_ONE_METER_PER_SEC_SQUARED_BACKWARD = -1; +const int16_t UNAVAILABLE = 161; + +} // namespace LongitudinalAccelerationValue_Constants + + +/*! + * @brief This class represents the structure LongitudinalAccelerationValue defined by the user in the IDL file. + * @ingroup LongitudinalAccelerationValue + */ +class LongitudinalAccelerationValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LongitudinalAccelerationValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LongitudinalAccelerationValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. + */ + eProsima_user_DllExport LongitudinalAccelerationValue( + const LongitudinalAccelerationValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. + */ + eProsima_user_DllExport LongitudinalAccelerationValue( + LongitudinalAccelerationValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. + */ + eProsima_user_DllExport LongitudinalAccelerationValue& operator =( + const LongitudinalAccelerationValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LongitudinalAccelerationValue that will be copied. + */ + eProsima_user_DllExport LongitudinalAccelerationValue& operator =( + LongitudinalAccelerationValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LongitudinalAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LongitudinalAccelerationValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LongitudinalAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LongitudinalAccelerationValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + +private: + + int16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValueCdrAux.hpp new file mode 100644 index 00000000000..54261bcf0e1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValueCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUECDRAUX_HPP_ + +#include "LongitudinalAccelerationValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_LongitudinalAccelerationValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_LongitudinalAccelerationValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValueCdrAux.ipp new file mode 100644 index 00000000000..3fd3db4b8dd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValueCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LongitudinalAccelerationValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUECDRAUX_IPP_ + +#include "LongitudinalAccelerationValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LongitudinalAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.cxx index cc3643f6b50..6d8cb06a870 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file LongitudinalAccelerationValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LongitudinalAccelerationValuePubSubTypes.h" +#include "LongitudinalAccelerationValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace LongitudinalAccelerationValue_Constants { - - - - - - - } //End of namespace LongitudinalAccelerationValue_Constants - LongitudinalAccelerationValuePubSubType::LongitudinalAccelerationValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::LongitudinalAccelerationValue_"); - auto type_size = LongitudinalAccelerationValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LongitudinalAccelerationValue::isKeyDefined(); - size_t keyLength = LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize() > 16 ? - LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LongitudinalAccelerationValuePubSubType::~LongitudinalAccelerationValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LongitudinalAccelerationValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LongitudinalAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LongitudinalAccelerationValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LongitudinalAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LongitudinalAccelerationValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LongitudinalAccelerationValuePubSubType::createData() - { - return reinterpret_cast(new LongitudinalAccelerationValue()); - } - - void LongitudinalAccelerationValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LongitudinalAccelerationValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LongitudinalAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LongitudinalAccelerationValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace LongitudinalAccelerationValue_Constants { + + + + + + + + + + + +} //End of namespace LongitudinalAccelerationValue_Constants + + + +LongitudinalAccelerationValuePubSubType::LongitudinalAccelerationValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::LongitudinalAccelerationValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LongitudinalAccelerationValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_LongitudinalAccelerationValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LongitudinalAccelerationValuePubSubType::~LongitudinalAccelerationValuePubSubType() +{ +} + +bool LongitudinalAccelerationValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LongitudinalAccelerationValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LongitudinalAccelerationValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LongitudinalAccelerationValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LongitudinalAccelerationValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LongitudinalAccelerationValuePubSubType::createData() +{ + return reinterpret_cast(new LongitudinalAccelerationValue()); +} + +void LongitudinalAccelerationValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LongitudinalAccelerationValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.h index 2edc3e7443d..782b4f5e252 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LongitudinalAccelerationValuePubSubTypes.h @@ -16,100 +16,132 @@ * @file LongitudinalAccelerationValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "LongitudinalAccelerationValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated LongitudinalAccelerationValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace LongitudinalAccelerationValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace LongitudinalAccelerationValue_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type LongitudinalAccelerationValue defined by the user in the IDL file. - * @ingroup LONGITUDINALACCELERATIONVALUE - */ - class LongitudinalAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef LongitudinalAccelerationValue type; +} // namespace LongitudinalAccelerationValue_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type LongitudinalAccelerationValue defined by the user in the IDL file. + * @ingroup LongitudinalAccelerationValue + */ +class LongitudinalAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef LongitudinalAccelerationValue type; + + eProsima_user_DllExport LongitudinalAccelerationValuePubSubType(); - eProsima_user_DllExport LongitudinalAccelerationValuePubSubType(); + eProsima_user_DllExport ~LongitudinalAccelerationValuePubSubType() override; - eProsima_user_DllExport virtual ~LongitudinalAccelerationValuePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) LongitudinalAccelerationValue(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LONGITUDINALACCELERATIONVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.cxx index 877548ce460..86268900144 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.cxx @@ -14,9 +14,9 @@ /*! * @file LowFrequencyContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,127 +27,84 @@ char dummy; #endif // _WIN32 #include "LowFrequencyContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::LowFrequencyContainer::LowFrequencyContainer() -{ - // m_choice com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4362d7df - m_choice = 0; - // m_basic_vehicle_container_low_frequency com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@66238be2 +namespace etsi_its_cam_msgs { +namespace msg { -} +namespace LowFrequencyContainer_Constants { + + +} // namespace LowFrequencyContainer_Constants -etsi_its_cam_msgs::msg::LowFrequencyContainer::~LowFrequencyContainer() + +LowFrequencyContainer::LowFrequencyContainer() { +} +LowFrequencyContainer::~LowFrequencyContainer() +{ } -etsi_its_cam_msgs::msg::LowFrequencyContainer::LowFrequencyContainer( +LowFrequencyContainer::LowFrequencyContainer( const LowFrequencyContainer& x) { m_choice = x.m_choice; m_basic_vehicle_container_low_frequency = x.m_basic_vehicle_container_low_frequency; } -etsi_its_cam_msgs::msg::LowFrequencyContainer::LowFrequencyContainer( - LowFrequencyContainer&& x) +LowFrequencyContainer::LowFrequencyContainer( + LowFrequencyContainer&& x) noexcept { m_choice = x.m_choice; m_basic_vehicle_container_low_frequency = std::move(x.m_basic_vehicle_container_low_frequency); } -etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::LowFrequencyContainer::operator =( +LowFrequencyContainer& LowFrequencyContainer::operator =( const LowFrequencyContainer& x) { m_choice = x.m_choice; m_basic_vehicle_container_low_frequency = x.m_basic_vehicle_container_low_frequency; - return *this; } -etsi_its_cam_msgs::msg::LowFrequencyContainer& etsi_its_cam_msgs::msg::LowFrequencyContainer::operator =( - LowFrequencyContainer&& x) +LowFrequencyContainer& LowFrequencyContainer::operator =( + LowFrequencyContainer&& x) noexcept { m_choice = x.m_choice; m_basic_vehicle_container_low_frequency = std::move(x.m_basic_vehicle_container_low_frequency); - return *this; } -bool etsi_its_cam_msgs::msg::LowFrequencyContainer::operator ==( +bool LowFrequencyContainer::operator ==( const LowFrequencyContainer& x) const { - - return (m_choice == x.m_choice && m_basic_vehicle_container_low_frequency == x.m_basic_vehicle_container_low_frequency); + return (m_choice == x.m_choice && + m_basic_vehicle_container_low_frequency == x.m_basic_vehicle_container_low_frequency); } -bool etsi_its_cam_msgs::msg::LowFrequencyContainer::operator !=( +bool LowFrequencyContainer::operator !=( const LowFrequencyContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::LowFrequencyContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::LowFrequencyContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LowFrequencyContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency::getCdrSerializedSize(data.basic_vehicle_container_low_frequency(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::LowFrequencyContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_choice; - scdr << m_basic_vehicle_container_low_frequency; - -} - -void etsi_its_cam_msgs::msg::LowFrequencyContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_choice; - dcdr >> m_basic_vehicle_container_low_frequency; -} - /*! * @brief This function sets a value in member choice * @param _choice New value for member choice */ -void etsi_its_cam_msgs::msg::LowFrequencyContainer::choice( +void LowFrequencyContainer::choice( uint8_t _choice) { m_choice = _choice; @@ -157,7 +114,7 @@ void etsi_its_cam_msgs::msg::LowFrequencyContainer::choice( * @brief This function returns the value of member choice * @return Value of member choice */ -uint8_t etsi_its_cam_msgs::msg::LowFrequencyContainer::choice() const +uint8_t LowFrequencyContainer::choice() const { return m_choice; } @@ -166,16 +123,17 @@ uint8_t etsi_its_cam_msgs::msg::LowFrequencyContainer::choice() const * @brief This function returns a reference to member choice * @return Reference to member choice */ -uint8_t& etsi_its_cam_msgs::msg::LowFrequencyContainer::choice() +uint8_t& LowFrequencyContainer::choice() { return m_choice; } + /*! * @brief This function copies the value in member basic_vehicle_container_low_frequency * @param _basic_vehicle_container_low_frequency New value to be copied in member basic_vehicle_container_low_frequency */ -void etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_frequency( +void LowFrequencyContainer::basic_vehicle_container_low_frequency( const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& _basic_vehicle_container_low_frequency) { m_basic_vehicle_container_low_frequency = _basic_vehicle_container_low_frequency; @@ -185,7 +143,7 @@ void etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_ * @brief This function moves the value in member basic_vehicle_container_low_frequency * @param _basic_vehicle_container_low_frequency New value to be moved in member basic_vehicle_container_low_frequency */ -void etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_frequency( +void LowFrequencyContainer::basic_vehicle_container_low_frequency( etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency&& _basic_vehicle_container_low_frequency) { m_basic_vehicle_container_low_frequency = std::move(_basic_vehicle_container_low_frequency); @@ -195,7 +153,7 @@ void etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_ * @brief This function returns a constant reference to member basic_vehicle_container_low_frequency * @return Constant reference to member basic_vehicle_container_low_frequency */ -const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_frequency() const +const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& LowFrequencyContainer::basic_vehicle_container_low_frequency() const { return m_basic_vehicle_container_low_frequency; } @@ -204,31 +162,18 @@ const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_ms * @brief This function returns a reference to member basic_vehicle_container_low_frequency * @return Reference to member basic_vehicle_container_low_frequency */ -etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& etsi_its_cam_msgs::msg::LowFrequencyContainer::basic_vehicle_container_low_frequency() +etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& LowFrequencyContainer::basic_vehicle_container_low_frequency() { return m_basic_vehicle_container_low_frequency; } -size_t etsi_its_cam_msgs::msg::LowFrequencyContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::LowFrequencyContainer::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::LowFrequencyContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "LowFrequencyContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.h index 999a96a40a8..e5f202a4a57 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainer.h @@ -16,20 +16,25 @@ * @file LowFrequencyContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_H_ -#include "BasicVehicleContainerLowFrequency.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "BasicVehicleContainerLowFrequency.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,198 +48,156 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LowFrequencyContainer_SOURCE) -#define LowFrequencyContainer_DllAPI __declspec( dllexport ) +#if defined(LOWFREQUENCYCONTAINER_SOURCE) +#define LOWFREQUENCYCONTAINER_DllAPI __declspec( dllexport ) #else -#define LowFrequencyContainer_DllAPI __declspec( dllimport ) -#endif // LowFrequencyContainer_SOURCE +#define LOWFREQUENCYCONTAINER_DllAPI __declspec( dllimport ) +#endif // LOWFREQUENCYCONTAINER_SOURCE #else -#define LowFrequencyContainer_DllAPI +#define LOWFREQUENCYCONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define LowFrequencyContainer_DllAPI +#define LOWFREQUENCYCONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace LowFrequencyContainer_Constants { - const uint8_t CHOICE_BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY = 0; - } // namespace LowFrequencyContainer_Constants - /*! - * @brief This class represents the structure LowFrequencyContainer defined by the user in the IDL file. - * @ingroup LOWFREQUENCYCONTAINER - */ - class LowFrequencyContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LowFrequencyContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LowFrequencyContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. - */ - eProsima_user_DllExport LowFrequencyContainer( - const LowFrequencyContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. - */ - eProsima_user_DllExport LowFrequencyContainer( - LowFrequencyContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. - */ - eProsima_user_DllExport LowFrequencyContainer& operator =( - const LowFrequencyContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. - */ - eProsima_user_DllExport LowFrequencyContainer& operator =( - LowFrequencyContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LowFrequencyContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LowFrequencyContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::LowFrequencyContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LowFrequencyContainer& x) const; - - /*! - * @brief This function sets a value in member choice - * @param _choice New value for member choice - */ - eProsima_user_DllExport void choice( - uint8_t _choice); - - /*! - * @brief This function returns the value of member choice - * @return Value of member choice - */ - eProsima_user_DllExport uint8_t choice() const; - - /*! - * @brief This function returns a reference to member choice - * @return Reference to member choice - */ - eProsima_user_DllExport uint8_t& choice(); - - /*! - * @brief This function copies the value in member basic_vehicle_container_low_frequency - * @param _basic_vehicle_container_low_frequency New value to be copied in member basic_vehicle_container_low_frequency - */ - eProsima_user_DllExport void basic_vehicle_container_low_frequency( - const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& _basic_vehicle_container_low_frequency); - - /*! - * @brief This function moves the value in member basic_vehicle_container_low_frequency - * @param _basic_vehicle_container_low_frequency New value to be moved in member basic_vehicle_container_low_frequency - */ - eProsima_user_DllExport void basic_vehicle_container_low_frequency( - etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency&& _basic_vehicle_container_low_frequency); - - /*! - * @brief This function returns a constant reference to member basic_vehicle_container_low_frequency - * @return Constant reference to member basic_vehicle_container_low_frequency - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& basic_vehicle_container_low_frequency() const; - - /*! - * @brief This function returns a reference to member basic_vehicle_container_low_frequency - * @return Reference to member basic_vehicle_container_low_frequency - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& basic_vehicle_container_low_frequency(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::LowFrequencyContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_choice; - etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency m_basic_vehicle_container_low_frequency; - }; - } // namespace msg + +namespace msg { + +namespace LowFrequencyContainer_Constants { + +const uint8_t CHOICE_BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY = 0; + +} // namespace LowFrequencyContainer_Constants + + +/*! + * @brief This class represents the structure LowFrequencyContainer defined by the user in the IDL file. + * @ingroup LowFrequencyContainer + */ +class LowFrequencyContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LowFrequencyContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LowFrequencyContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. + */ + eProsima_user_DllExport LowFrequencyContainer( + const LowFrequencyContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. + */ + eProsima_user_DllExport LowFrequencyContainer( + LowFrequencyContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. + */ + eProsima_user_DllExport LowFrequencyContainer& operator =( + const LowFrequencyContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::LowFrequencyContainer that will be copied. + */ + eProsima_user_DllExport LowFrequencyContainer& operator =( + LowFrequencyContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LowFrequencyContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LowFrequencyContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::LowFrequencyContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LowFrequencyContainer& x) const; + + /*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ + eProsima_user_DllExport void choice( + uint8_t _choice); + + /*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ + eProsima_user_DllExport uint8_t choice() const; + + /*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ + eProsima_user_DllExport uint8_t& choice(); + + + /*! + * @brief This function copies the value in member basic_vehicle_container_low_frequency + * @param _basic_vehicle_container_low_frequency New value to be copied in member basic_vehicle_container_low_frequency + */ + eProsima_user_DllExport void basic_vehicle_container_low_frequency( + const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& _basic_vehicle_container_low_frequency); + + /*! + * @brief This function moves the value in member basic_vehicle_container_low_frequency + * @param _basic_vehicle_container_low_frequency New value to be moved in member basic_vehicle_container_low_frequency + */ + eProsima_user_DllExport void basic_vehicle_container_low_frequency( + etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency&& _basic_vehicle_container_low_frequency); + + /*! + * @brief This function returns a constant reference to member basic_vehicle_container_low_frequency + * @return Constant reference to member basic_vehicle_container_low_frequency + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& basic_vehicle_container_low_frequency() const; + + /*! + * @brief This function returns a reference to member basic_vehicle_container_low_frequency + * @return Reference to member basic_vehicle_container_low_frequency + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency& basic_vehicle_container_low_frequency(); + +private: + + uint8_t m_choice{0}; + etsi_its_cam_msgs::msg::BasicVehicleContainerLowFrequency m_basic_vehicle_container_low_frequency; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerCdrAux.hpp new file mode 100644 index 00000000000..1431b5c2d44 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerCdrAux.hpp @@ -0,0 +1,53 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LowFrequencyContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINERCDRAUX_HPP_ + +#include "LowFrequencyContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_LowFrequencyContainer_max_cdr_typesize {4143UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_LowFrequencyContainer_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LowFrequencyContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerCdrAux.ipp new file mode 100644 index 00000000000..e31052b2a1f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LowFrequencyContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINERCDRAUX_IPP_ + +#include "LowFrequencyContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::LowFrequencyContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.choice(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.basic_vehicle_container_low_frequency(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LowFrequencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.choice() + << eprosima::fastcdr::MemberId(1) << data.basic_vehicle_container_low_frequency() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::LowFrequencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.choice(); + break; + + case 1: + dcdr >> data.basic_vehicle_container_low_frequency(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::LowFrequencyContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.cxx index 7a9ec3027c1..4abec5bad70 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.cxx @@ -16,163 +16,189 @@ * @file LowFrequencyContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "LowFrequencyContainerPubSubTypes.h" +#include "LowFrequencyContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace LowFrequencyContainer_Constants { - } //End of namespace LowFrequencyContainer_Constants - LowFrequencyContainerPubSubType::LowFrequencyContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::LowFrequencyContainer_"); - auto type_size = LowFrequencyContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = LowFrequencyContainer::isKeyDefined(); - size_t keyLength = LowFrequencyContainer::getKeyMaxCdrSerializedSize() > 16 ? - LowFrequencyContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - LowFrequencyContainerPubSubType::~LowFrequencyContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool LowFrequencyContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - LowFrequencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool LowFrequencyContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - LowFrequencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function LowFrequencyContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* LowFrequencyContainerPubSubType::createData() - { - return reinterpret_cast(new LowFrequencyContainer()); - } - - void LowFrequencyContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool LowFrequencyContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - LowFrequencyContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LowFrequencyContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || LowFrequencyContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace LowFrequencyContainer_Constants { + + + +} //End of namespace LowFrequencyContainer_Constants + + + +LowFrequencyContainerPubSubType::LowFrequencyContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::LowFrequencyContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LowFrequencyContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_LowFrequencyContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +LowFrequencyContainerPubSubType::~LowFrequencyContainerPubSubType() +{ +} + +bool LowFrequencyContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + LowFrequencyContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool LowFrequencyContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + LowFrequencyContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function LowFrequencyContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* LowFrequencyContainerPubSubType::createData() +{ + return reinterpret_cast(new LowFrequencyContainer()); +} + +void LowFrequencyContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool LowFrequencyContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.h index 1f7ba2ac1a0..7c11f043160 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/LowFrequencyContainerPubSubTypes.h @@ -16,95 +16,125 @@ * @file LowFrequencyContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "LowFrequencyContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "BasicVehicleContainerLowFrequencyPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated LowFrequencyContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { +namespace LowFrequencyContainer_Constants { + + +} // namespace LowFrequencyContainer_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type LowFrequencyContainer defined by the user in the IDL file. + * @ingroup LowFrequencyContainer + */ +class LowFrequencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - namespace LowFrequencyContainer_Constants - { - } - /*! - * @brief This class represents the TopicDataType of the type LowFrequencyContainer defined by the user in the IDL file. - * @ingroup LOWFREQUENCYCONTAINER - */ - class LowFrequencyContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef LowFrequencyContainer type; + typedef LowFrequencyContainer type; - eProsima_user_DllExport LowFrequencyContainerPubSubType(); + eProsima_user_DllExport LowFrequencyContainerPubSubType(); - eProsima_user_DllExport virtual ~LowFrequencyContainerPubSubType(); + eProsima_user_DllExport ~LowFrequencyContainerPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_LOWFREQUENCYCONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.cxx index 7dd529e1aaa..95c7643511a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.cxx @@ -14,9 +14,9 @@ /*! * @file PathDeltaTime.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,117 +27,79 @@ char dummy; #endif // _WIN32 #include "PathDeltaTime.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace PathDeltaTime_Constants { + + +} // namespace PathDeltaTime_Constants -etsi_its_cam_msgs::msg::PathDeltaTime::PathDeltaTime() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@60afd40d - m_value = 0; +PathDeltaTime::PathDeltaTime() +{ } -etsi_its_cam_msgs::msg::PathDeltaTime::~PathDeltaTime() +PathDeltaTime::~PathDeltaTime() { } -etsi_its_cam_msgs::msg::PathDeltaTime::PathDeltaTime( +PathDeltaTime::PathDeltaTime( const PathDeltaTime& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::PathDeltaTime::PathDeltaTime( - PathDeltaTime&& x) +PathDeltaTime::PathDeltaTime( + PathDeltaTime&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathDeltaTime::operator =( +PathDeltaTime& PathDeltaTime::operator =( const PathDeltaTime& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathDeltaTime::operator =( - PathDeltaTime&& x) +PathDeltaTime& PathDeltaTime::operator =( + PathDeltaTime&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::PathDeltaTime::operator ==( +bool PathDeltaTime::operator ==( const PathDeltaTime& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::PathDeltaTime::operator !=( +bool PathDeltaTime::operator !=( const PathDeltaTime& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PathDeltaTime::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PathDeltaTime::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PathDeltaTime& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PathDeltaTime::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::PathDeltaTime::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::PathDeltaTime::value( +void PathDeltaTime::value( uint16_t _value) { m_value = _value; @@ -147,7 +109,7 @@ void etsi_its_cam_msgs::msg::PathDeltaTime::value( * @brief This function returns the value of member value * @return Value of member value */ -uint16_t etsi_its_cam_msgs::msg::PathDeltaTime::value() const +uint16_t PathDeltaTime::value() const { return m_value; } @@ -156,32 +118,18 @@ uint16_t etsi_its_cam_msgs::msg::PathDeltaTime::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint16_t& etsi_its_cam_msgs::msg::PathDeltaTime::value() +uint16_t& PathDeltaTime::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::PathDeltaTime::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::PathDeltaTime::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::PathDeltaTime::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PathDeltaTimeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.h index c851458eb1b..a2fe594c1a5 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTime.h @@ -16,19 +16,24 @@ * @file PathDeltaTime.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,174 +47,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PathDeltaTime_SOURCE) -#define PathDeltaTime_DllAPI __declspec( dllexport ) +#if defined(PATHDELTATIME_SOURCE) +#define PATHDELTATIME_DllAPI __declspec( dllexport ) #else -#define PathDeltaTime_DllAPI __declspec( dllimport ) -#endif // PathDeltaTime_SOURCE +#define PATHDELTATIME_DllAPI __declspec( dllimport ) +#endif // PATHDELTATIME_SOURCE #else -#define PathDeltaTime_DllAPI +#define PATHDELTATIME_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PathDeltaTime_DllAPI +#define PATHDELTATIME_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace PathDeltaTime_Constants { - const uint16_t MIN = 1; - const uint16_t MAX = 65535; - const uint16_t TEN_MILLI_SECONDS_IN_PAST = 1; - } // namespace PathDeltaTime_Constants - /*! - * @brief This class represents the structure PathDeltaTime defined by the user in the IDL file. - * @ingroup PATHDELTATIME - */ - class PathDeltaTime - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PathDeltaTime(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PathDeltaTime(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. - */ - eProsima_user_DllExport PathDeltaTime( - const PathDeltaTime& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. - */ - eProsima_user_DllExport PathDeltaTime( - PathDeltaTime&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. - */ - eProsima_user_DllExport PathDeltaTime& operator =( - const PathDeltaTime& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. - */ - eProsima_user_DllExport PathDeltaTime& operator =( - PathDeltaTime&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PathDeltaTime object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PathDeltaTime& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PathDeltaTime object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PathDeltaTime& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PathDeltaTime& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace PathDeltaTime_Constants { + +const uint16_t MIN = 1; +const uint16_t MAX = 65535; +const uint16_t TEN_MILLI_SECONDS_IN_PAST = 1; + +} // namespace PathDeltaTime_Constants + + +/*! + * @brief This class represents the structure PathDeltaTime defined by the user in the IDL file. + * @ingroup PathDeltaTime + */ +class PathDeltaTime +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PathDeltaTime(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PathDeltaTime(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. + */ + eProsima_user_DllExport PathDeltaTime( + const PathDeltaTime& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. + */ + eProsima_user_DllExport PathDeltaTime( + PathDeltaTime&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. + */ + eProsima_user_DllExport PathDeltaTime& operator =( + const PathDeltaTime& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathDeltaTime that will be copied. + */ + eProsima_user_DllExport PathDeltaTime& operator =( + PathDeltaTime&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathDeltaTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PathDeltaTime& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathDeltaTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PathDeltaTime& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + +private: + + uint16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimeCdrAux.hpp new file mode 100644 index 00000000000..7116cd48782 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimeCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathDeltaTimeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIMECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIMECDRAUX_HPP_ + +#include "PathDeltaTime.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PathDeltaTime_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PathDeltaTime_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathDeltaTime& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIMECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimeCdrAux.ipp new file mode 100644 index 00000000000..6f5431f3c22 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimeCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathDeltaTimeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIMECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIMECDRAUX_IPP_ + +#include "PathDeltaTimeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PathDeltaTime& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathDeltaTime& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PathDeltaTime& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathDeltaTime& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIMECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.cxx index 446b7c19fce..5c03d0b0116 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.cxx @@ -16,167 +16,193 @@ * @file PathDeltaTimePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PathDeltaTimePubSubTypes.h" +#include "PathDeltaTimeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace PathDeltaTime_Constants { - - - - - } //End of namespace PathDeltaTime_Constants - PathDeltaTimePubSubType::PathDeltaTimePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PathDeltaTime_"); - auto type_size = PathDeltaTime::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PathDeltaTime::isKeyDefined(); - size_t keyLength = PathDeltaTime::getKeyMaxCdrSerializedSize() > 16 ? - PathDeltaTime::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PathDeltaTimePubSubType::~PathDeltaTimePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PathDeltaTimePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PathDeltaTime* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PathDeltaTimePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PathDeltaTime* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PathDeltaTimePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PathDeltaTimePubSubType::createData() - { - return reinterpret_cast(new PathDeltaTime()); - } - - void PathDeltaTimePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PathDeltaTimePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PathDeltaTime* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PathDeltaTime::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PathDeltaTime::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace PathDeltaTime_Constants { + + + + + + + +} //End of namespace PathDeltaTime_Constants + + + +PathDeltaTimePubSubType::PathDeltaTimePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PathDeltaTime_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PathDeltaTime::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PathDeltaTime_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PathDeltaTimePubSubType::~PathDeltaTimePubSubType() +{ +} + +bool PathDeltaTimePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PathDeltaTime* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PathDeltaTimePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PathDeltaTime* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PathDeltaTimePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PathDeltaTimePubSubType::createData() +{ + return reinterpret_cast(new PathDeltaTime()); +} + +void PathDeltaTimePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PathDeltaTimePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.h index 4db08bacead..20cc38564a4 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathDeltaTimePubSubTypes.h @@ -16,98 +16,128 @@ * @file PathDeltaTimePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PathDeltaTime.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PathDeltaTime is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace PathDeltaTime_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace PathDeltaTime_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type PathDeltaTime defined by the user in the IDL file. - * @ingroup PATHDELTATIME - */ - class PathDeltaTimePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace PathDeltaTime_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type PathDeltaTime defined by the user in the IDL file. + * @ingroup PathDeltaTime + */ +class PathDeltaTimePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PathDeltaTime type; - typedef PathDeltaTime type; + eProsima_user_DllExport PathDeltaTimePubSubType(); - eProsima_user_DllExport PathDeltaTimePubSubType(); + eProsima_user_DllExport ~PathDeltaTimePubSubType() override; - eProsima_user_DllExport virtual ~PathDeltaTimePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PathDeltaTime(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHDELTATIME_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.cxx index 01b50a9a696..995701c2df2 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.cxx @@ -14,9 +14,9 @@ /*! * @file PathHistory.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,81 @@ char dummy; #endif // _WIN32 #include "PathHistory.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { + +namespace PathHistory_Constants { + + +} // namespace PathHistory_Constants -etsi_its_cam_msgs::msg::PathHistory::PathHistory() -{ - // m_array com.eprosima.idl.parser.typecode.SequenceTypeCode@1d572e62 + +PathHistory::PathHistory() +{ } -etsi_its_cam_msgs::msg::PathHistory::~PathHistory() +PathHistory::~PathHistory() { } -etsi_its_cam_msgs::msg::PathHistory::PathHistory( +PathHistory::PathHistory( const PathHistory& x) { m_array = x.m_array; } -etsi_its_cam_msgs::msg::PathHistory::PathHistory( - PathHistory&& x) +PathHistory::PathHistory( + PathHistory&& x) noexcept { m_array = std::move(x.m_array); } -etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::PathHistory::operator =( +PathHistory& PathHistory::operator =( const PathHistory& x) { m_array = x.m_array; - return *this; } -etsi_its_cam_msgs::msg::PathHistory& etsi_its_cam_msgs::msg::PathHistory::operator =( - PathHistory&& x) +PathHistory& PathHistory::operator =( + PathHistory&& x) noexcept { m_array = std::move(x.m_array); - return *this; } -bool etsi_its_cam_msgs::msg::PathHistory::operator ==( +bool PathHistory::operator ==( const PathHistory& x) const { - return (m_array == x.m_array); } -bool etsi_its_cam_msgs::msg::PathHistory::operator !=( +bool PathHistory::operator !=( const PathHistory& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PathHistory::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += etsi_its_cam_msgs::msg::PathPoint::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PathHistory::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PathHistory& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.array().size(); ++a) - { - current_alignment += etsi_its_cam_msgs::msg::PathPoint::getCdrSerializedSize(data.array().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PathHistory::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_array; -} - -void etsi_its_cam_msgs::msg::PathHistory::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_array;} - /*! * @brief This function copies the value in member array * @param _array New value to be copied in member array */ -void etsi_its_cam_msgs::msg::PathHistory::array( +void PathHistory::array( const std::vector& _array) { m_array = _array; @@ -152,7 +111,7 @@ void etsi_its_cam_msgs::msg::PathHistory::array( * @brief This function moves the value in member array * @param _array New value to be moved in member array */ -void etsi_its_cam_msgs::msg::PathHistory::array( +void PathHistory::array( std::vector&& _array) { m_array = std::move(_array); @@ -162,7 +121,7 @@ void etsi_its_cam_msgs::msg::PathHistory::array( * @brief This function returns a constant reference to member array * @return Constant reference to member array */ -const std::vector& etsi_its_cam_msgs::msg::PathHistory::array() const +const std::vector& PathHistory::array() const { return m_array; } @@ -171,31 +130,18 @@ const std::vector& etsi_its_cam_msgs::msg::Pa * @brief This function returns a reference to member array * @return Reference to member array */ -std::vector& etsi_its_cam_msgs::msg::PathHistory::array() +std::vector& PathHistory::array() { return m_array; } -size_t etsi_its_cam_msgs::msg::PathHistory::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::PathHistory::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::PathHistory::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PathHistoryCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.h index d15c6e2f7f8..ce7b7434f52 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistory.h @@ -16,20 +16,25 @@ * @file PathHistory.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_H_ -#include "PathPoint.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "PathPoint.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,179 +48,138 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PathHistory_SOURCE) -#define PathHistory_DllAPI __declspec( dllexport ) +#if defined(PATHHISTORY_SOURCE) +#define PATHHISTORY_DllAPI __declspec( dllexport ) #else -#define PathHistory_DllAPI __declspec( dllimport ) -#endif // PathHistory_SOURCE +#define PATHHISTORY_DllAPI __declspec( dllimport ) +#endif // PATHHISTORY_SOURCE #else -#define PathHistory_DllAPI +#define PATHHISTORY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PathHistory_DllAPI +#define PATHHISTORY_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace PathHistory_Constants { - const uint8_t MIN_SIZE = 0; - const uint8_t MAX_SIZE = 40; - } // namespace PathHistory_Constants - /*! - * @brief This class represents the structure PathHistory defined by the user in the IDL file. - * @ingroup PATHHISTORY - */ - class PathHistory - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PathHistory(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PathHistory(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. - */ - eProsima_user_DllExport PathHistory( - const PathHistory& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. - */ - eProsima_user_DllExport PathHistory( - PathHistory&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. - */ - eProsima_user_DllExport PathHistory& operator =( - const PathHistory& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. - */ - eProsima_user_DllExport PathHistory& operator =( - PathHistory&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PathHistory object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PathHistory& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PathHistory object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PathHistory& x) const; - - /*! - * @brief This function copies the value in member array - * @param _array New value to be copied in member array - */ - eProsima_user_DllExport void array( - const std::vector& _array); - - /*! - * @brief This function moves the value in member array - * @param _array New value to be moved in member array - */ - eProsima_user_DllExport void array( - std::vector&& _array); - - /*! - * @brief This function returns a constant reference to member array - * @return Constant reference to member array - */ - eProsima_user_DllExport const std::vector& array() const; - - /*! - * @brief This function returns a reference to member array - * @return Reference to member array - */ - eProsima_user_DllExport std::vector& array(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PathHistory& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_array; - }; - } // namespace msg + +namespace msg { + +namespace PathHistory_Constants { + +const uint8_t MIN_SIZE = 0; +const uint8_t MAX_SIZE = 40; + +} // namespace PathHistory_Constants + + + + +/*! + * @brief This class represents the structure PathHistory defined by the user in the IDL file. + * @ingroup PathHistory + */ +class PathHistory +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PathHistory(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PathHistory(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. + */ + eProsima_user_DllExport PathHistory( + const PathHistory& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. + */ + eProsima_user_DllExport PathHistory( + PathHistory&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. + */ + eProsima_user_DllExport PathHistory& operator =( + const PathHistory& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathHistory that will be copied. + */ + eProsima_user_DllExport PathHistory& operator =( + PathHistory&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathHistory object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PathHistory& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathHistory object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PathHistory& x) const; + + /*! + * @brief This function copies the value in member array + * @param _array New value to be copied in member array + */ + eProsima_user_DllExport void array( + const std::vector& _array); + + /*! + * @brief This function moves the value in member array + * @param _array New value to be moved in member array + */ + eProsima_user_DllExport void array( + std::vector&& _array); + + /*! + * @brief This function returns a constant reference to member array + * @return Constant reference to member array + */ + eProsima_user_DllExport const std::vector& array() const; + + /*! + * @brief This function returns a reference to member array + * @return Reference to member array + */ + eProsima_user_DllExport std::vector& array(); + +private: + + std::vector m_array; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryCdrAux.hpp new file mode 100644 index 00000000000..a3ea86c8161 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryCdrAux.hpp @@ -0,0 +1,59 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathHistoryCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORYCDRAUX_HPP_ + +#include "PathHistory.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PathHistory_max_cdr_typesize {4011UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PathHistory_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathHistory& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryCdrAux.ipp new file mode 100644 index 00000000000..e43ba93deb6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathHistoryCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORYCDRAUX_IPP_ + +#include "PathHistoryCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PathHistory& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.array(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathHistory& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.array() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PathHistory& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.array(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathHistory& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.cxx index ee1bafed3ef..de25e8139ba 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.cxx @@ -16,166 +16,193 @@ * @file PathHistoryPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PathHistoryPubSubTypes.h" +#include "PathHistoryCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace PathHistory_Constants { - - - - } //End of namespace PathHistory_Constants - PathHistoryPubSubType::PathHistoryPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PathHistory_"); - auto type_size = PathHistory::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PathHistory::isKeyDefined(); - size_t keyLength = PathHistory::getKeyMaxCdrSerializedSize() > 16 ? - PathHistory::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PathHistoryPubSubType::~PathHistoryPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PathHistoryPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PathHistory* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PathHistoryPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PathHistory* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PathHistoryPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PathHistoryPubSubType::createData() - { - return reinterpret_cast(new PathHistory()); - } - - void PathHistoryPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PathHistoryPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PathHistory* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PathHistory::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PathHistory::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace PathHistory_Constants { + + + + + +} //End of namespace PathHistory_Constants + + + + + +PathHistoryPubSubType::PathHistoryPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PathHistory_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PathHistory::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PathHistory_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PathHistoryPubSubType::~PathHistoryPubSubType() +{ +} + +bool PathHistoryPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PathHistory* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PathHistoryPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PathHistory* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PathHistoryPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PathHistoryPubSubType::createData() +{ + return reinterpret_cast(new PathHistory()); +} + +void PathHistoryPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PathHistoryPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.h index e86969c298b..58f527bce29 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathHistoryPubSubTypes.h @@ -16,97 +16,129 @@ * @file PathHistoryPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PathHistory.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "PathPointPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PathHistory is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace PathHistory_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace PathHistory_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type PathHistory defined by the user in the IDL file. - * @ingroup PATHHISTORY - */ - class PathHistoryPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef PathHistory type; - eProsima_user_DllExport PathHistoryPubSubType(); +} // namespace PathHistory_Constants - eProsima_user_DllExport virtual ~PathHistoryPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +/*! + * @brief This class represents the TopicDataType of the type PathHistory defined by the user in the IDL file. + * @ingroup PathHistory + */ +class PathHistoryPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport virtual void* createData() override; + typedef PathHistory type; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport PathHistoryPubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport ~PathHistoryPubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHHISTORY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.cxx index d8ed47d4519..eec07083bc7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.cxx @@ -14,9 +14,9 @@ /*! * @file PathPoint.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "PathPoint.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::PathPoint::PathPoint() -{ - // m_path_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5167268 - // m_path_delta_time com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1cfd1875 +namespace etsi_its_cam_msgs { - // m_path_delta_time_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@28c0b664 - m_path_delta_time_is_present = false; +namespace msg { -} -etsi_its_cam_msgs::msg::PathPoint::~PathPoint() -{ +PathPoint::PathPoint() +{ +} +PathPoint::~PathPoint() +{ } -etsi_its_cam_msgs::msg::PathPoint::PathPoint( +PathPoint::PathPoint( const PathPoint& x) { m_path_position = x.m_path_position; @@ -59,105 +59,53 @@ etsi_its_cam_msgs::msg::PathPoint::PathPoint( m_path_delta_time_is_present = x.m_path_delta_time_is_present; } -etsi_its_cam_msgs::msg::PathPoint::PathPoint( - PathPoint&& x) +PathPoint::PathPoint( + PathPoint&& x) noexcept { m_path_position = std::move(x.m_path_position); m_path_delta_time = std::move(x.m_path_delta_time); m_path_delta_time_is_present = x.m_path_delta_time_is_present; } -etsi_its_cam_msgs::msg::PathPoint& etsi_its_cam_msgs::msg::PathPoint::operator =( +PathPoint& PathPoint::operator =( const PathPoint& x) { m_path_position = x.m_path_position; m_path_delta_time = x.m_path_delta_time; m_path_delta_time_is_present = x.m_path_delta_time_is_present; - return *this; } -etsi_its_cam_msgs::msg::PathPoint& etsi_its_cam_msgs::msg::PathPoint::operator =( - PathPoint&& x) +PathPoint& PathPoint::operator =( + PathPoint&& x) noexcept { m_path_position = std::move(x.m_path_position); m_path_delta_time = std::move(x.m_path_delta_time); m_path_delta_time_is_present = x.m_path_delta_time_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::PathPoint::operator ==( +bool PathPoint::operator ==( const PathPoint& x) const { - - return (m_path_position == x.m_path_position && m_path_delta_time == x.m_path_delta_time && m_path_delta_time_is_present == x.m_path_delta_time_is_present); + return (m_path_position == x.m_path_position && + m_path_delta_time == x.m_path_delta_time && + m_path_delta_time_is_present == x.m_path_delta_time_is_present); } -bool etsi_its_cam_msgs::msg::PathPoint::operator !=( +bool PathPoint::operator !=( const PathPoint& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PathPoint::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::DeltaReferencePosition::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PathDeltaTime::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PathPoint::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PathPoint& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::DeltaReferencePosition::getCdrSerializedSize(data.path_position(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PathDeltaTime::getCdrSerializedSize(data.path_delta_time(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PathPoint::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_path_position; - scdr << m_path_delta_time; - scdr << m_path_delta_time_is_present; - -} - -void etsi_its_cam_msgs::msg::PathPoint::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_path_position; - dcdr >> m_path_delta_time; - dcdr >> m_path_delta_time_is_present; -} - /*! * @brief This function copies the value in member path_position * @param _path_position New value to be copied in member path_position */ -void etsi_its_cam_msgs::msg::PathPoint::path_position( +void PathPoint::path_position( const etsi_its_cam_msgs::msg::DeltaReferencePosition& _path_position) { m_path_position = _path_position; @@ -167,7 +115,7 @@ void etsi_its_cam_msgs::msg::PathPoint::path_position( * @brief This function moves the value in member path_position * @param _path_position New value to be moved in member path_position */ -void etsi_its_cam_msgs::msg::PathPoint::path_position( +void PathPoint::path_position( etsi_its_cam_msgs::msg::DeltaReferencePosition&& _path_position) { m_path_position = std::move(_path_position); @@ -177,7 +125,7 @@ void etsi_its_cam_msgs::msg::PathPoint::path_position( * @brief This function returns a constant reference to member path_position * @return Constant reference to member path_position */ -const etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::PathPoint::path_position() const +const etsi_its_cam_msgs::msg::DeltaReferencePosition& PathPoint::path_position() const { return m_path_position; } @@ -186,15 +134,17 @@ const etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::Pa * @brief This function returns a reference to member path_position * @return Reference to member path_position */ -etsi_its_cam_msgs::msg::DeltaReferencePosition& etsi_its_cam_msgs::msg::PathPoint::path_position() +etsi_its_cam_msgs::msg::DeltaReferencePosition& PathPoint::path_position() { return m_path_position; } + + /*! * @brief This function copies the value in member path_delta_time * @param _path_delta_time New value to be copied in member path_delta_time */ -void etsi_its_cam_msgs::msg::PathPoint::path_delta_time( +void PathPoint::path_delta_time( const etsi_its_cam_msgs::msg::PathDeltaTime& _path_delta_time) { m_path_delta_time = _path_delta_time; @@ -204,7 +154,7 @@ void etsi_its_cam_msgs::msg::PathPoint::path_delta_time( * @brief This function moves the value in member path_delta_time * @param _path_delta_time New value to be moved in member path_delta_time */ -void etsi_its_cam_msgs::msg::PathPoint::path_delta_time( +void PathPoint::path_delta_time( etsi_its_cam_msgs::msg::PathDeltaTime&& _path_delta_time) { m_path_delta_time = std::move(_path_delta_time); @@ -214,7 +164,7 @@ void etsi_its_cam_msgs::msg::PathPoint::path_delta_time( * @brief This function returns a constant reference to member path_delta_time * @return Constant reference to member path_delta_time */ -const etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathPoint::path_delta_time() const +const etsi_its_cam_msgs::msg::PathDeltaTime& PathPoint::path_delta_time() const { return m_path_delta_time; } @@ -223,15 +173,17 @@ const etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathPoint:: * @brief This function returns a reference to member path_delta_time * @return Reference to member path_delta_time */ -etsi_its_cam_msgs::msg::PathDeltaTime& etsi_its_cam_msgs::msg::PathPoint::path_delta_time() +etsi_its_cam_msgs::msg::PathDeltaTime& PathPoint::path_delta_time() { return m_path_delta_time; } + + /*! * @brief This function sets a value in member path_delta_time_is_present * @param _path_delta_time_is_present New value for member path_delta_time_is_present */ -void etsi_its_cam_msgs::msg::PathPoint::path_delta_time_is_present( +void PathPoint::path_delta_time_is_present( bool _path_delta_time_is_present) { m_path_delta_time_is_present = _path_delta_time_is_present; @@ -241,7 +193,7 @@ void etsi_its_cam_msgs::msg::PathPoint::path_delta_time_is_present( * @brief This function returns the value of member path_delta_time_is_present * @return Value of member path_delta_time_is_present */ -bool etsi_its_cam_msgs::msg::PathPoint::path_delta_time_is_present() const +bool PathPoint::path_delta_time_is_present() const { return m_path_delta_time_is_present; } @@ -250,32 +202,18 @@ bool etsi_its_cam_msgs::msg::PathPoint::path_delta_time_is_present() const * @brief This function returns a reference to member path_delta_time_is_present * @return Reference to member path_delta_time_is_present */ -bool& etsi_its_cam_msgs::msg::PathPoint::path_delta_time_is_present() +bool& PathPoint::path_delta_time_is_present() { return m_path_delta_time_is_present; } -size_t etsi_its_cam_msgs::msg::PathPoint::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::PathPoint::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::PathPoint::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PathPointCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.h index 439be91762b..592aca5bf11 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPoint.h @@ -16,21 +16,26 @@ * @file PathPoint.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_H_ -#include "DeltaReferencePosition.h" -#include "PathDeltaTime.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "DeltaReferencePosition.h" +#include "PathDeltaTime.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,221 +49,179 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PathPoint_SOURCE) -#define PathPoint_DllAPI __declspec( dllexport ) +#if defined(PATHPOINT_SOURCE) +#define PATHPOINT_DllAPI __declspec( dllexport ) #else -#define PathPoint_DllAPI __declspec( dllimport ) -#endif // PathPoint_SOURCE +#define PATHPOINT_DllAPI __declspec( dllimport ) +#endif // PATHPOINT_SOURCE #else -#define PathPoint_DllAPI +#define PATHPOINT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PathPoint_DllAPI +#define PATHPOINT_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure PathPoint defined by the user in the IDL file. - * @ingroup PATHPOINT - */ - class PathPoint - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PathPoint(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PathPoint(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. - */ - eProsima_user_DllExport PathPoint( - const PathPoint& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. - */ - eProsima_user_DllExport PathPoint( - PathPoint&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. - */ - eProsima_user_DllExport PathPoint& operator =( - const PathPoint& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. - */ - eProsima_user_DllExport PathPoint& operator =( - PathPoint&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PathPoint object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PathPoint& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PathPoint object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PathPoint& x) const; - - /*! - * @brief This function copies the value in member path_position - * @param _path_position New value to be copied in member path_position - */ - eProsima_user_DllExport void path_position( - const etsi_its_cam_msgs::msg::DeltaReferencePosition& _path_position); - - /*! - * @brief This function moves the value in member path_position - * @param _path_position New value to be moved in member path_position - */ - eProsima_user_DllExport void path_position( - etsi_its_cam_msgs::msg::DeltaReferencePosition&& _path_position); - - /*! - * @brief This function returns a constant reference to member path_position - * @return Constant reference to member path_position - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaReferencePosition& path_position() const; - - /*! - * @brief This function returns a reference to member path_position - * @return Reference to member path_position - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaReferencePosition& path_position(); - /*! - * @brief This function copies the value in member path_delta_time - * @param _path_delta_time New value to be copied in member path_delta_time - */ - eProsima_user_DllExport void path_delta_time( - const etsi_its_cam_msgs::msg::PathDeltaTime& _path_delta_time); - - /*! - * @brief This function moves the value in member path_delta_time - * @param _path_delta_time New value to be moved in member path_delta_time - */ - eProsima_user_DllExport void path_delta_time( - etsi_its_cam_msgs::msg::PathDeltaTime&& _path_delta_time); - - /*! - * @brief This function returns a constant reference to member path_delta_time - * @return Constant reference to member path_delta_time - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::PathDeltaTime& path_delta_time() const; - - /*! - * @brief This function returns a reference to member path_delta_time - * @return Reference to member path_delta_time - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::PathDeltaTime& path_delta_time(); - /*! - * @brief This function sets a value in member path_delta_time_is_present - * @param _path_delta_time_is_present New value for member path_delta_time_is_present - */ - eProsima_user_DllExport void path_delta_time_is_present( - bool _path_delta_time_is_present); - - /*! - * @brief This function returns the value of member path_delta_time_is_present - * @return Value of member path_delta_time_is_present - */ - eProsima_user_DllExport bool path_delta_time_is_present() const; - - /*! - * @brief This function returns a reference to member path_delta_time_is_present - * @return Reference to member path_delta_time_is_present - */ - eProsima_user_DllExport bool& path_delta_time_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PathPoint& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::DeltaReferencePosition m_path_position; - etsi_its_cam_msgs::msg::PathDeltaTime m_path_delta_time; - bool m_path_delta_time_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure PathPoint defined by the user in the IDL file. + * @ingroup PathPoint + */ +class PathPoint +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PathPoint(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PathPoint(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. + */ + eProsima_user_DllExport PathPoint( + const PathPoint& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. + */ + eProsima_user_DllExport PathPoint( + PathPoint&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. + */ + eProsima_user_DllExport PathPoint& operator =( + const PathPoint& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PathPoint that will be copied. + */ + eProsima_user_DllExport PathPoint& operator =( + PathPoint&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathPoint object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PathPoint& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PathPoint object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PathPoint& x) const; + + /*! + * @brief This function copies the value in member path_position + * @param _path_position New value to be copied in member path_position + */ + eProsima_user_DllExport void path_position( + const etsi_its_cam_msgs::msg::DeltaReferencePosition& _path_position); + + /*! + * @brief This function moves the value in member path_position + * @param _path_position New value to be moved in member path_position + */ + eProsima_user_DllExport void path_position( + etsi_its_cam_msgs::msg::DeltaReferencePosition&& _path_position); + + /*! + * @brief This function returns a constant reference to member path_position + * @return Constant reference to member path_position + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DeltaReferencePosition& path_position() const; + + /*! + * @brief This function returns a reference to member path_position + * @return Reference to member path_position + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DeltaReferencePosition& path_position(); + + + /*! + * @brief This function copies the value in member path_delta_time + * @param _path_delta_time New value to be copied in member path_delta_time + */ + eProsima_user_DllExport void path_delta_time( + const etsi_its_cam_msgs::msg::PathDeltaTime& _path_delta_time); + + /*! + * @brief This function moves the value in member path_delta_time + * @param _path_delta_time New value to be moved in member path_delta_time + */ + eProsima_user_DllExport void path_delta_time( + etsi_its_cam_msgs::msg::PathDeltaTime&& _path_delta_time); + + /*! + * @brief This function returns a constant reference to member path_delta_time + * @return Constant reference to member path_delta_time + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PathDeltaTime& path_delta_time() const; + + /*! + * @brief This function returns a reference to member path_delta_time + * @return Reference to member path_delta_time + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PathDeltaTime& path_delta_time(); + + + /*! + * @brief This function sets a value in member path_delta_time_is_present + * @param _path_delta_time_is_present New value for member path_delta_time_is_present + */ + eProsima_user_DllExport void path_delta_time_is_present( + bool _path_delta_time_is_present); + + /*! + * @brief This function returns the value of member path_delta_time_is_present + * @return Value of member path_delta_time_is_present + */ + eProsima_user_DllExport bool path_delta_time_is_present() const; + + /*! + * @brief This function returns a reference to member path_delta_time_is_present + * @return Reference to member path_delta_time_is_present + */ + eProsima_user_DllExport bool& path_delta_time_is_present(); + +private: + + etsi_its_cam_msgs::msg::DeltaReferencePosition m_path_position; + etsi_its_cam_msgs::msg::PathDeltaTime m_path_delta_time; + bool m_path_delta_time_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointCdrAux.hpp new file mode 100644 index 00000000000..d652bc23f6b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathPointCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINTCDRAUX_HPP_ + +#include "PathPoint.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PathPoint_max_cdr_typesize {39UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PathPoint_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathPoint& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointCdrAux.ipp new file mode 100644 index 00000000000..40611f7861d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PathPointCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINTCDRAUX_IPP_ + +#include "PathPointCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PathPoint& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.path_position(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.path_delta_time(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.path_delta_time_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathPoint& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.path_position() + << eprosima::fastcdr::MemberId(1) << data.path_delta_time() + << eprosima::fastcdr::MemberId(2) << data.path_delta_time_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PathPoint& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.path_position(); + break; + + case 1: + dcdr >> data.path_delta_time(); + break; + + case 2: + dcdr >> data.path_delta_time_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PathPoint& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.cxx index 956d7d1f9b2..f33ec2cf85d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file PathPointPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PathPointPubSubTypes.h" +#include "PathPointCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - PathPointPubSubType::PathPointPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PathPoint_"); - auto type_size = PathPoint::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PathPoint::isKeyDefined(); - size_t keyLength = PathPoint::getKeyMaxCdrSerializedSize() > 16 ? - PathPoint::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PathPointPubSubType::~PathPointPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PathPointPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PathPoint* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PathPointPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PathPoint* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PathPointPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PathPointPubSubType::createData() - { - return reinterpret_cast(new PathPoint()); - } - - void PathPointPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PathPointPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PathPoint* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PathPoint::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PathPoint::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +PathPointPubSubType::PathPointPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PathPoint_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PathPoint::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PathPoint_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PathPointPubSubType::~PathPointPubSubType() +{ +} + +bool PathPointPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PathPoint* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PathPointPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PathPoint* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PathPointPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PathPointPubSubType::createData() +{ + return reinterpret_cast(new PathPoint()); +} + +void PathPointPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PathPointPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.h index f7d91879e92..c6e6ae83b8e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PathPointPubSubTypes.h @@ -16,92 +16,122 @@ * @file PathPointPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PathPoint.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "DeltaReferencePositionPubSubTypes.h" +#include "PathDeltaTimePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PathPoint is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type PathPoint defined by the user in the IDL file. + * @ingroup PathPoint + */ +class PathPointPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type PathPoint defined by the user in the IDL file. - * @ingroup PATHPOINT - */ - class PathPointPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef PathPoint type; + typedef PathPoint type; - eProsima_user_DllExport PathPointPubSubType(); + eProsima_user_DllExport PathPointPubSubType(); - eProsima_user_DllExport virtual ~PathPointPubSubType(); + eProsima_user_DllExport ~PathPointPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PathPoint(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PATHPOINT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.cxx index 931268e7ed3..9c81cc629bf 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.cxx @@ -14,9 +14,9 @@ /*! * @file PerformanceClass.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "PerformanceClass.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace PerformanceClass_Constants { +} // namespace PerformanceClass_Constants -etsi_its_cam_msgs::msg::PerformanceClass::PerformanceClass() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77128dab - m_value = 0; +PerformanceClass::PerformanceClass() +{ } -etsi_its_cam_msgs::msg::PerformanceClass::~PerformanceClass() +PerformanceClass::~PerformanceClass() { } -etsi_its_cam_msgs::msg::PerformanceClass::PerformanceClass( +PerformanceClass::PerformanceClass( const PerformanceClass& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::PerformanceClass::PerformanceClass( - PerformanceClass&& x) +PerformanceClass::PerformanceClass( + PerformanceClass&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::PerformanceClass::operator =( +PerformanceClass& PerformanceClass::operator =( const PerformanceClass& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::PerformanceClass& etsi_its_cam_msgs::msg::PerformanceClass::operator =( - PerformanceClass&& x) +PerformanceClass& PerformanceClass::operator =( + PerformanceClass&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::PerformanceClass::operator ==( +bool PerformanceClass::operator ==( const PerformanceClass& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::PerformanceClass::operator !=( +bool PerformanceClass::operator !=( const PerformanceClass& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PerformanceClass::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PerformanceClass::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PerformanceClass& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PerformanceClass::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::PerformanceClass::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::PerformanceClass::value( +void PerformanceClass::value( uint8_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::PerformanceClass::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::PerformanceClass::value() const +uint8_t PerformanceClass::value() const { return m_value; } @@ -158,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::PerformanceClass::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::PerformanceClass::value() +uint8_t& PerformanceClass::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::PerformanceClass::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::PerformanceClass::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::PerformanceClass::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PerformanceClassCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.h index ca6a0f130ea..f331e367b5f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClass.h @@ -16,19 +16,24 @@ * @file PerformanceClass.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PerformanceClass_SOURCE) -#define PerformanceClass_DllAPI __declspec( dllexport ) +#if defined(PERFORMANCECLASS_SOURCE) +#define PERFORMANCECLASS_DllAPI __declspec( dllexport ) #else -#define PerformanceClass_DllAPI __declspec( dllimport ) -#endif // PerformanceClass_SOURCE +#define PERFORMANCECLASS_DllAPI __declspec( dllimport ) +#endif // PERFORMANCECLASS_SOURCE #else -#define PerformanceClass_DllAPI +#define PERFORMANCECLASS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PerformanceClass_DllAPI +#define PERFORMANCECLASS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace PerformanceClass_Constants { - const uint8_t MIN = 0; - const uint8_t MAX = 7; - const uint8_t UNAVAILABLE = 0; - const uint8_t PERFORMANCE_CLASS_A = 1; - const uint8_t PERFORMANCE_CLASS_B = 2; - } // namespace PerformanceClass_Constants - /*! - * @brief This class represents the structure PerformanceClass defined by the user in the IDL file. - * @ingroup PERFORMANCECLASS - */ - class PerformanceClass - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PerformanceClass(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PerformanceClass(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. - */ - eProsima_user_DllExport PerformanceClass( - const PerformanceClass& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. - */ - eProsima_user_DllExport PerformanceClass( - PerformanceClass&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. - */ - eProsima_user_DllExport PerformanceClass& operator =( - const PerformanceClass& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. - */ - eProsima_user_DllExport PerformanceClass& operator =( - PerformanceClass&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PerformanceClass object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PerformanceClass& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PerformanceClass object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PerformanceClass& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PerformanceClass& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace PerformanceClass_Constants { + +const uint8_t MIN = 0; +const uint8_t MAX = 7; +const uint8_t UNAVAILABLE = 0; +const uint8_t PERFORMANCE_CLASS_A = 1; +const uint8_t PERFORMANCE_CLASS_B = 2; + +} // namespace PerformanceClass_Constants + + +/*! + * @brief This class represents the structure PerformanceClass defined by the user in the IDL file. + * @ingroup PerformanceClass + */ +class PerformanceClass +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PerformanceClass(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PerformanceClass(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. + */ + eProsima_user_DllExport PerformanceClass( + const PerformanceClass& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. + */ + eProsima_user_DllExport PerformanceClass( + PerformanceClass&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. + */ + eProsima_user_DllExport PerformanceClass& operator =( + const PerformanceClass& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PerformanceClass that will be copied. + */ + eProsima_user_DllExport PerformanceClass& operator =( + PerformanceClass&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PerformanceClass object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PerformanceClass& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PerformanceClass object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PerformanceClass& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassCdrAux.hpp new file mode 100644 index 00000000000..0e279bdd3c1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PerformanceClassCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASSCDRAUX_HPP_ + +#include "PerformanceClass.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PerformanceClass_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PerformanceClass_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PerformanceClass& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassCdrAux.ipp new file mode 100644 index 00000000000..7f1c3dee42e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PerformanceClassCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASSCDRAUX_IPP_ + +#include "PerformanceClassCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PerformanceClass& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PerformanceClass& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PerformanceClass& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PerformanceClass& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.cxx index 73bfb60a691..d209f413ac6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.cxx @@ -16,169 +16,197 @@ * @file PerformanceClassPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PerformanceClassPubSubTypes.h" +#include "PerformanceClassCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace PerformanceClass_Constants { - - - - - - - } //End of namespace PerformanceClass_Constants - PerformanceClassPubSubType::PerformanceClassPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PerformanceClass_"); - auto type_size = PerformanceClass::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PerformanceClass::isKeyDefined(); - size_t keyLength = PerformanceClass::getKeyMaxCdrSerializedSize() > 16 ? - PerformanceClass::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PerformanceClassPubSubType::~PerformanceClassPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PerformanceClassPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PerformanceClass* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PerformanceClassPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PerformanceClass* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PerformanceClassPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PerformanceClassPubSubType::createData() - { - return reinterpret_cast(new PerformanceClass()); - } - - void PerformanceClassPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PerformanceClassPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PerformanceClass* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PerformanceClass::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PerformanceClass::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace PerformanceClass_Constants { + + + + + + + + + + + +} //End of namespace PerformanceClass_Constants + + + +PerformanceClassPubSubType::PerformanceClassPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PerformanceClass_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PerformanceClass::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PerformanceClass_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PerformanceClassPubSubType::~PerformanceClassPubSubType() +{ +} + +bool PerformanceClassPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PerformanceClass* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PerformanceClassPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PerformanceClass* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PerformanceClassPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PerformanceClassPubSubType::createData() +{ + return reinterpret_cast(new PerformanceClass()); +} + +void PerformanceClassPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PerformanceClassPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.h index 4e8945ba55a..0a82acd4fc6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PerformanceClassPubSubTypes.h @@ -16,100 +16,132 @@ * @file PerformanceClassPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PerformanceClass.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PerformanceClass is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace PerformanceClass_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace PerformanceClass_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type PerformanceClass defined by the user in the IDL file. - * @ingroup PERFORMANCECLASS - */ - class PerformanceClassPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef PerformanceClass type; +} // namespace PerformanceClass_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type PerformanceClass defined by the user in the IDL file. + * @ingroup PerformanceClass + */ +class PerformanceClassPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PerformanceClass type; + + eProsima_user_DllExport PerformanceClassPubSubType(); - eProsima_user_DllExport PerformanceClassPubSubType(); + eProsima_user_DllExport ~PerformanceClassPubSubType() override; - eProsima_user_DllExport virtual ~PerformanceClassPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PerformanceClass(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PERFORMANCECLASS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.cxx index f8b73c2531d..09e6169dfa7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.cxx @@ -14,9 +14,9 @@ /*! * @file PosConfidenceEllipse.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "PosConfidenceEllipse.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::PosConfidenceEllipse::PosConfidenceEllipse() -{ - // m_semi_major_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4c03a37 - // m_semi_minor_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4c03a37 +namespace etsi_its_cam_msgs { - // m_semi_major_orientation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2e140e59 +namespace msg { -} -etsi_its_cam_msgs::msg::PosConfidenceEllipse::~PosConfidenceEllipse() +PosConfidenceEllipse::PosConfidenceEllipse() { +} - +PosConfidenceEllipse::~PosConfidenceEllipse() +{ } -etsi_its_cam_msgs::msg::PosConfidenceEllipse::PosConfidenceEllipse( +PosConfidenceEllipse::PosConfidenceEllipse( const PosConfidenceEllipse& x) { m_semi_major_confidence = x.m_semi_major_confidence; @@ -59,101 +59,53 @@ etsi_its_cam_msgs::msg::PosConfidenceEllipse::PosConfidenceEllipse( m_semi_major_orientation = x.m_semi_major_orientation; } -etsi_its_cam_msgs::msg::PosConfidenceEllipse::PosConfidenceEllipse( - PosConfidenceEllipse&& x) +PosConfidenceEllipse::PosConfidenceEllipse( + PosConfidenceEllipse&& x) noexcept { m_semi_major_confidence = std::move(x.m_semi_major_confidence); m_semi_minor_confidence = std::move(x.m_semi_minor_confidence); m_semi_major_orientation = std::move(x.m_semi_major_orientation); } -etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::PosConfidenceEllipse::operator =( +PosConfidenceEllipse& PosConfidenceEllipse::operator =( const PosConfidenceEllipse& x) { m_semi_major_confidence = x.m_semi_major_confidence; m_semi_minor_confidence = x.m_semi_minor_confidence; m_semi_major_orientation = x.m_semi_major_orientation; - return *this; } -etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::PosConfidenceEllipse::operator =( - PosConfidenceEllipse&& x) +PosConfidenceEllipse& PosConfidenceEllipse::operator =( + PosConfidenceEllipse&& x) noexcept { m_semi_major_confidence = std::move(x.m_semi_major_confidence); m_semi_minor_confidence = std::move(x.m_semi_minor_confidence); m_semi_major_orientation = std::move(x.m_semi_major_orientation); - return *this; } -bool etsi_its_cam_msgs::msg::PosConfidenceEllipse::operator ==( +bool PosConfidenceEllipse::operator ==( const PosConfidenceEllipse& x) const { - - return (m_semi_major_confidence == x.m_semi_major_confidence && m_semi_minor_confidence == x.m_semi_minor_confidence && m_semi_major_orientation == x.m_semi_major_orientation); + return (m_semi_major_confidence == x.m_semi_major_confidence && + m_semi_minor_confidence == x.m_semi_minor_confidence && + m_semi_major_orientation == x.m_semi_major_orientation); } -bool etsi_its_cam_msgs::msg::PosConfidenceEllipse::operator !=( +bool PosConfidenceEllipse::operator !=( const PosConfidenceEllipse& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PosConfidenceEllipse::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::SemiAxisLength::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SemiAxisLength::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::HeadingValue::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PosConfidenceEllipse::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PosConfidenceEllipse& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::SemiAxisLength::getCdrSerializedSize(data.semi_major_confidence(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SemiAxisLength::getCdrSerializedSize(data.semi_minor_confidence(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::HeadingValue::getCdrSerializedSize(data.semi_major_orientation(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_semi_major_confidence; - scdr << m_semi_minor_confidence; - scdr << m_semi_major_orientation; - -} - -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_semi_major_confidence; - dcdr >> m_semi_minor_confidence; - dcdr >> m_semi_major_orientation; -} - /*! * @brief This function copies the value in member semi_major_confidence * @param _semi_major_confidence New value to be copied in member semi_major_confidence */ -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence( +void PosConfidenceEllipse::semi_major_confidence( const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_major_confidence) { m_semi_major_confidence = _semi_major_confidence; @@ -163,7 +115,7 @@ void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence( * @brief This function moves the value in member semi_major_confidence * @param _semi_major_confidence New value to be moved in member semi_major_confidence */ -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence( +void PosConfidenceEllipse::semi_major_confidence( etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_major_confidence) { m_semi_major_confidence = std::move(_semi_major_confidence); @@ -173,7 +125,7 @@ void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence( * @brief This function returns a constant reference to member semi_major_confidence * @return Constant reference to member semi_major_confidence */ -const etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence() const +const etsi_its_cam_msgs::msg::SemiAxisLength& PosConfidenceEllipse::semi_major_confidence() const { return m_semi_major_confidence; } @@ -182,15 +134,17 @@ const etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfide * @brief This function returns a reference to member semi_major_confidence * @return Reference to member semi_major_confidence */ -etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_confidence() +etsi_its_cam_msgs::msg::SemiAxisLength& PosConfidenceEllipse::semi_major_confidence() { return m_semi_major_confidence; } + + /*! * @brief This function copies the value in member semi_minor_confidence * @param _semi_minor_confidence New value to be copied in member semi_minor_confidence */ -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence( +void PosConfidenceEllipse::semi_minor_confidence( const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_minor_confidence) { m_semi_minor_confidence = _semi_minor_confidence; @@ -200,7 +154,7 @@ void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence( * @brief This function moves the value in member semi_minor_confidence * @param _semi_minor_confidence New value to be moved in member semi_minor_confidence */ -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence( +void PosConfidenceEllipse::semi_minor_confidence( etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_minor_confidence) { m_semi_minor_confidence = std::move(_semi_minor_confidence); @@ -210,7 +164,7 @@ void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence( * @brief This function returns a constant reference to member semi_minor_confidence * @return Constant reference to member semi_minor_confidence */ -const etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence() const +const etsi_its_cam_msgs::msg::SemiAxisLength& PosConfidenceEllipse::semi_minor_confidence() const { return m_semi_minor_confidence; } @@ -219,15 +173,17 @@ const etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfide * @brief This function returns a reference to member semi_minor_confidence * @return Reference to member semi_minor_confidence */ -etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_minor_confidence() +etsi_its_cam_msgs::msg::SemiAxisLength& PosConfidenceEllipse::semi_minor_confidence() { return m_semi_minor_confidence; } + + /*! * @brief This function copies the value in member semi_major_orientation * @param _semi_major_orientation New value to be copied in member semi_major_orientation */ -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation( +void PosConfidenceEllipse::semi_major_orientation( const etsi_its_cam_msgs::msg::HeadingValue& _semi_major_orientation) { m_semi_major_orientation = _semi_major_orientation; @@ -237,7 +193,7 @@ void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation( * @brief This function moves the value in member semi_major_orientation * @param _semi_major_orientation New value to be moved in member semi_major_orientation */ -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation( +void PosConfidenceEllipse::semi_major_orientation( etsi_its_cam_msgs::msg::HeadingValue&& _semi_major_orientation) { m_semi_major_orientation = std::move(_semi_major_orientation); @@ -247,7 +203,7 @@ void etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation( * @brief This function returns a constant reference to member semi_major_orientation * @return Constant reference to member semi_major_orientation */ -const etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation() const +const etsi_its_cam_msgs::msg::HeadingValue& PosConfidenceEllipse::semi_major_orientation() const { return m_semi_major_orientation; } @@ -256,31 +212,18 @@ const etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::PosConfidenc * @brief This function returns a reference to member semi_major_orientation * @return Reference to member semi_major_orientation */ -etsi_its_cam_msgs::msg::HeadingValue& etsi_its_cam_msgs::msg::PosConfidenceEllipse::semi_major_orientation() +etsi_its_cam_msgs::msg::HeadingValue& PosConfidenceEllipse::semi_major_orientation() { return m_semi_major_orientation; } -size_t etsi_its_cam_msgs::msg::PosConfidenceEllipse::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::PosConfidenceEllipse::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::PosConfidenceEllipse::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PosConfidenceEllipseCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.h index 95472b3428e..78f89d06246 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipse.h @@ -16,21 +16,26 @@ * @file PosConfidenceEllipse.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_H_ -#include "HeadingValue.h" -#include "SemiAxisLength.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "HeadingValue.h" +#include "SemiAxisLength.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,227 +49,186 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PosConfidenceEllipse_SOURCE) -#define PosConfidenceEllipse_DllAPI __declspec( dllexport ) +#if defined(POSCONFIDENCEELLIPSE_SOURCE) +#define POSCONFIDENCEELLIPSE_DllAPI __declspec( dllexport ) #else -#define PosConfidenceEllipse_DllAPI __declspec( dllimport ) -#endif // PosConfidenceEllipse_SOURCE +#define POSCONFIDENCEELLIPSE_DllAPI __declspec( dllimport ) +#endif // POSCONFIDENCEELLIPSE_SOURCE #else -#define PosConfidenceEllipse_DllAPI +#define POSCONFIDENCEELLIPSE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PosConfidenceEllipse_DllAPI +#define POSCONFIDENCEELLIPSE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure PosConfidenceEllipse defined by the user in the IDL file. - * @ingroup POSCONFIDENCEELLIPSE - */ - class PosConfidenceEllipse - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PosConfidenceEllipse(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PosConfidenceEllipse(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. - */ - eProsima_user_DllExport PosConfidenceEllipse( - const PosConfidenceEllipse& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. - */ - eProsima_user_DllExport PosConfidenceEllipse( - PosConfidenceEllipse&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. - */ - eProsima_user_DllExport PosConfidenceEllipse& operator =( - const PosConfidenceEllipse& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. - */ - eProsima_user_DllExport PosConfidenceEllipse& operator =( - PosConfidenceEllipse&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PosConfidenceEllipse object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PosConfidenceEllipse& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PosConfidenceEllipse object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PosConfidenceEllipse& x) const; - - /*! - * @brief This function copies the value in member semi_major_confidence - * @param _semi_major_confidence New value to be copied in member semi_major_confidence - */ - eProsima_user_DllExport void semi_major_confidence( - const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_major_confidence); - - /*! - * @brief This function moves the value in member semi_major_confidence - * @param _semi_major_confidence New value to be moved in member semi_major_confidence - */ - eProsima_user_DllExport void semi_major_confidence( - etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_major_confidence); - - /*! - * @brief This function returns a constant reference to member semi_major_confidence - * @return Constant reference to member semi_major_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SemiAxisLength& semi_major_confidence() const; - - /*! - * @brief This function returns a reference to member semi_major_confidence - * @return Reference to member semi_major_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SemiAxisLength& semi_major_confidence(); - /*! - * @brief This function copies the value in member semi_minor_confidence - * @param _semi_minor_confidence New value to be copied in member semi_minor_confidence - */ - eProsima_user_DllExport void semi_minor_confidence( - const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_minor_confidence); - - /*! - * @brief This function moves the value in member semi_minor_confidence - * @param _semi_minor_confidence New value to be moved in member semi_minor_confidence - */ - eProsima_user_DllExport void semi_minor_confidence( - etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_minor_confidence); - - /*! - * @brief This function returns a constant reference to member semi_minor_confidence - * @return Constant reference to member semi_minor_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SemiAxisLength& semi_minor_confidence() const; - - /*! - * @brief This function returns a reference to member semi_minor_confidence - * @return Reference to member semi_minor_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SemiAxisLength& semi_minor_confidence(); - /*! - * @brief This function copies the value in member semi_major_orientation - * @param _semi_major_orientation New value to be copied in member semi_major_orientation - */ - eProsima_user_DllExport void semi_major_orientation( - const etsi_its_cam_msgs::msg::HeadingValue& _semi_major_orientation); - - /*! - * @brief This function moves the value in member semi_major_orientation - * @param _semi_major_orientation New value to be moved in member semi_major_orientation - */ - eProsima_user_DllExport void semi_major_orientation( - etsi_its_cam_msgs::msg::HeadingValue&& _semi_major_orientation); - - /*! - * @brief This function returns a constant reference to member semi_major_orientation - * @return Constant reference to member semi_major_orientation - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingValue& semi_major_orientation() const; - - /*! - * @brief This function returns a reference to member semi_major_orientation - * @return Reference to member semi_major_orientation - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingValue& semi_major_orientation(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PosConfidenceEllipse& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::SemiAxisLength m_semi_major_confidence; - etsi_its_cam_msgs::msg::SemiAxisLength m_semi_minor_confidence; - etsi_its_cam_msgs::msg::HeadingValue m_semi_major_orientation; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure PosConfidenceEllipse defined by the user in the IDL file. + * @ingroup PosConfidenceEllipse + */ +class PosConfidenceEllipse +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PosConfidenceEllipse(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PosConfidenceEllipse(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. + */ + eProsima_user_DllExport PosConfidenceEllipse( + const PosConfidenceEllipse& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. + */ + eProsima_user_DllExport PosConfidenceEllipse( + PosConfidenceEllipse&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. + */ + eProsima_user_DllExport PosConfidenceEllipse& operator =( + const PosConfidenceEllipse& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PosConfidenceEllipse that will be copied. + */ + eProsima_user_DllExport PosConfidenceEllipse& operator =( + PosConfidenceEllipse&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PosConfidenceEllipse object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PosConfidenceEllipse& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PosConfidenceEllipse object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PosConfidenceEllipse& x) const; + + /*! + * @brief This function copies the value in member semi_major_confidence + * @param _semi_major_confidence New value to be copied in member semi_major_confidence + */ + eProsima_user_DllExport void semi_major_confidence( + const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_major_confidence); + + /*! + * @brief This function moves the value in member semi_major_confidence + * @param _semi_major_confidence New value to be moved in member semi_major_confidence + */ + eProsima_user_DllExport void semi_major_confidence( + etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_major_confidence); + + /*! + * @brief This function returns a constant reference to member semi_major_confidence + * @return Constant reference to member semi_major_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SemiAxisLength& semi_major_confidence() const; + + /*! + * @brief This function returns a reference to member semi_major_confidence + * @return Reference to member semi_major_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SemiAxisLength& semi_major_confidence(); + + + /*! + * @brief This function copies the value in member semi_minor_confidence + * @param _semi_minor_confidence New value to be copied in member semi_minor_confidence + */ + eProsima_user_DllExport void semi_minor_confidence( + const etsi_its_cam_msgs::msg::SemiAxisLength& _semi_minor_confidence); + + /*! + * @brief This function moves the value in member semi_minor_confidence + * @param _semi_minor_confidence New value to be moved in member semi_minor_confidence + */ + eProsima_user_DllExport void semi_minor_confidence( + etsi_its_cam_msgs::msg::SemiAxisLength&& _semi_minor_confidence); + + /*! + * @brief This function returns a constant reference to member semi_minor_confidence + * @return Constant reference to member semi_minor_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SemiAxisLength& semi_minor_confidence() const; + + /*! + * @brief This function returns a reference to member semi_minor_confidence + * @return Reference to member semi_minor_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SemiAxisLength& semi_minor_confidence(); + + + /*! + * @brief This function copies the value in member semi_major_orientation + * @param _semi_major_orientation New value to be copied in member semi_major_orientation + */ + eProsima_user_DllExport void semi_major_orientation( + const etsi_its_cam_msgs::msg::HeadingValue& _semi_major_orientation); + + /*! + * @brief This function moves the value in member semi_major_orientation + * @param _semi_major_orientation New value to be moved in member semi_major_orientation + */ + eProsima_user_DllExport void semi_major_orientation( + etsi_its_cam_msgs::msg::HeadingValue&& _semi_major_orientation); + + /*! + * @brief This function returns a constant reference to member semi_major_orientation + * @return Constant reference to member semi_major_orientation + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::HeadingValue& semi_major_orientation() const; + + /*! + * @brief This function returns a reference to member semi_major_orientation + * @return Reference to member semi_major_orientation + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::HeadingValue& semi_major_orientation(); + +private: + + etsi_its_cam_msgs::msg::SemiAxisLength m_semi_major_confidence; + etsi_its_cam_msgs::msg::SemiAxisLength m_semi_minor_confidence; + etsi_its_cam_msgs::msg::HeadingValue m_semi_major_orientation; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipseCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipseCdrAux.hpp new file mode 100644 index 00000000000..b7969c3facd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipseCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosConfidenceEllipseCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSECDRAUX_HPP_ + +#include "PosConfidenceEllipse.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PosConfidenceEllipse_max_cdr_typesize {26UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PosConfidenceEllipse_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipseCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipseCdrAux.ipp new file mode 100644 index 00000000000..a6b958092fe --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipseCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PosConfidenceEllipseCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSECDRAUX_IPP_ + +#include "PosConfidenceEllipseCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.semi_major_confidence(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.semi_minor_confidence(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.semi_major_orientation(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.semi_major_confidence() + << eprosima::fastcdr::MemberId(1) << data.semi_minor_confidence() + << eprosima::fastcdr::MemberId(2) << data.semi_major_orientation() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PosConfidenceEllipse& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.semi_major_confidence(); + break; + + case 1: + dcdr >> data.semi_minor_confidence(); + break; + + case 2: + dcdr >> data.semi_major_orientation(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.cxx index b27946f719d..d41fcde2786 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file PosConfidenceEllipsePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PosConfidenceEllipsePubSubTypes.h" +#include "PosConfidenceEllipseCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - PosConfidenceEllipsePubSubType::PosConfidenceEllipsePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PosConfidenceEllipse_"); - auto type_size = PosConfidenceEllipse::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PosConfidenceEllipse::isKeyDefined(); - size_t keyLength = PosConfidenceEllipse::getKeyMaxCdrSerializedSize() > 16 ? - PosConfidenceEllipse::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PosConfidenceEllipsePubSubType::~PosConfidenceEllipsePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PosConfidenceEllipsePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PosConfidenceEllipse* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PosConfidenceEllipsePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PosConfidenceEllipse* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PosConfidenceEllipsePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PosConfidenceEllipsePubSubType::createData() - { - return reinterpret_cast(new PosConfidenceEllipse()); - } - - void PosConfidenceEllipsePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PosConfidenceEllipsePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PosConfidenceEllipse* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PosConfidenceEllipse::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PosConfidenceEllipse::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +PosConfidenceEllipsePubSubType::PosConfidenceEllipsePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PosConfidenceEllipse_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PosConfidenceEllipse::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PosConfidenceEllipse_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PosConfidenceEllipsePubSubType::~PosConfidenceEllipsePubSubType() +{ +} + +bool PosConfidenceEllipsePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PosConfidenceEllipse* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PosConfidenceEllipsePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PosConfidenceEllipse* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PosConfidenceEllipsePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PosConfidenceEllipsePubSubType::createData() +{ + return reinterpret_cast(new PosConfidenceEllipse()); +} + +void PosConfidenceEllipsePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PosConfidenceEllipsePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.h index 9535c127377..22a3446a774 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PosConfidenceEllipsePubSubTypes.h @@ -16,92 +16,122 @@ * @file PosConfidenceEllipsePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PosConfidenceEllipse.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "HeadingValuePubSubTypes.h" +#include "SemiAxisLengthPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PosConfidenceEllipse is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type PosConfidenceEllipse defined by the user in the IDL file. + * @ingroup PosConfidenceEllipse + */ +class PosConfidenceEllipsePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type PosConfidenceEllipse defined by the user in the IDL file. - * @ingroup POSCONFIDENCEELLIPSE - */ - class PosConfidenceEllipsePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef PosConfidenceEllipse type; + typedef PosConfidenceEllipse type; - eProsima_user_DllExport PosConfidenceEllipsePubSubType(); + eProsima_user_DllExport PosConfidenceEllipsePubSubType(); - eProsima_user_DllExport virtual ~PosConfidenceEllipsePubSubType(); + eProsima_user_DllExport ~PosConfidenceEllipsePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PosConfidenceEllipse(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_POSCONFIDENCEELLIPSE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.cxx index 77723869509..c2b6bcfbeb9 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.cxx @@ -14,9 +14,9 @@ /*! * @file ProtectedCommunicationZone.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,49 +27,31 @@ char dummy; #endif // _WIN32 #include "ProtectedCommunicationZone.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::ProtectedCommunicationZone::ProtectedCommunicationZone() -{ - // m_protected_zone_type com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@545f80bf - - // m_expiry_time com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@66f66866 - - // m_expiry_time_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@22fa55b2 - m_expiry_time_is_present = false; - // m_protected_zone_latitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4d666b41 - // m_protected_zone_longitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6594402a +namespace etsi_its_cam_msgs { - // m_protected_zone_radius com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@30f4b1a6 +namespace msg { - // m_protected_zone_radius_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@405325cf - m_protected_zone_radius_is_present = false; - // m_protected_zone_id com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3e1162e7 - // m_protected_zone_id_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@79c3f01f - m_protected_zone_id_is_present = false; +ProtectedCommunicationZone::ProtectedCommunicationZone() +{ } -etsi_its_cam_msgs::msg::ProtectedCommunicationZone::~ProtectedCommunicationZone() +ProtectedCommunicationZone::~ProtectedCommunicationZone() { - - - - - - - - } -etsi_its_cam_msgs::msg::ProtectedCommunicationZone::ProtectedCommunicationZone( +ProtectedCommunicationZone::ProtectedCommunicationZone( const ProtectedCommunicationZone& x) { m_protected_zone_type = x.m_protected_zone_type; @@ -83,8 +65,8 @@ etsi_its_cam_msgs::msg::ProtectedCommunicationZone::ProtectedCommunicationZone( m_protected_zone_id_is_present = x.m_protected_zone_id_is_present; } -etsi_its_cam_msgs::msg::ProtectedCommunicationZone::ProtectedCommunicationZone( - ProtectedCommunicationZone&& x) +ProtectedCommunicationZone::ProtectedCommunicationZone( + ProtectedCommunicationZone&& x) noexcept { m_protected_zone_type = std::move(x.m_protected_zone_type); m_expiry_time = std::move(x.m_expiry_time); @@ -97,7 +79,7 @@ etsi_its_cam_msgs::msg::ProtectedCommunicationZone::ProtectedCommunicationZone( m_protected_zone_id_is_present = x.m_protected_zone_id_is_present; } -etsi_its_cam_msgs::msg::ProtectedCommunicationZone& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::operator =( +ProtectedCommunicationZone& ProtectedCommunicationZone::operator =( const ProtectedCommunicationZone& x) { @@ -110,12 +92,11 @@ etsi_its_cam_msgs::msg::ProtectedCommunicationZone& etsi_its_cam_msgs::msg::Prot m_protected_zone_radius_is_present = x.m_protected_zone_radius_is_present; m_protected_zone_id = x.m_protected_zone_id; m_protected_zone_id_is_present = x.m_protected_zone_id_is_present; - return *this; } -etsi_its_cam_msgs::msg::ProtectedCommunicationZone& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::operator =( - ProtectedCommunicationZone&& x) +ProtectedCommunicationZone& ProtectedCommunicationZone::operator =( + ProtectedCommunicationZone&& x) noexcept { m_protected_zone_type = std::move(x.m_protected_zone_type); @@ -127,111 +108,34 @@ etsi_its_cam_msgs::msg::ProtectedCommunicationZone& etsi_its_cam_msgs::msg::Prot m_protected_zone_radius_is_present = x.m_protected_zone_radius_is_present; m_protected_zone_id = std::move(x.m_protected_zone_id); m_protected_zone_id_is_present = x.m_protected_zone_id_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::operator ==( +bool ProtectedCommunicationZone::operator ==( const ProtectedCommunicationZone& x) const { - - return (m_protected_zone_type == x.m_protected_zone_type && m_expiry_time == x.m_expiry_time && m_expiry_time_is_present == x.m_expiry_time_is_present && m_protected_zone_latitude == x.m_protected_zone_latitude && m_protected_zone_longitude == x.m_protected_zone_longitude && m_protected_zone_radius == x.m_protected_zone_radius && m_protected_zone_radius_is_present == x.m_protected_zone_radius_is_present && m_protected_zone_id == x.m_protected_zone_id && m_protected_zone_id_is_present == x.m_protected_zone_id_is_present); + return (m_protected_zone_type == x.m_protected_zone_type && + m_expiry_time == x.m_expiry_time && + m_expiry_time_is_present == x.m_expiry_time_is_present && + m_protected_zone_latitude == x.m_protected_zone_latitude && + m_protected_zone_longitude == x.m_protected_zone_longitude && + m_protected_zone_radius == x.m_protected_zone_radius && + m_protected_zone_radius_is_present == x.m_protected_zone_radius_is_present && + m_protected_zone_id == x.m_protected_zone_id && + m_protected_zone_id_is_present == x.m_protected_zone_id_is_present); } -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::operator !=( +bool ProtectedCommunicationZone::operator !=( const ProtectedCommunicationZone& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneType::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::TimestampIts::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::Latitude::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Longitude::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneRadius::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneID::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneType::getCdrSerializedSize(data.protected_zone_type(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::TimestampIts::getCdrSerializedSize(data.expiry_time(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::Latitude::getCdrSerializedSize(data.protected_zone_latitude(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Longitude::getCdrSerializedSize(data.protected_zone_longitude(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneRadius::getCdrSerializedSize(data.protected_zone_radius(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::ProtectedZoneID::getCdrSerializedSize(data.protected_zone_id(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_protected_zone_type; - scdr << m_expiry_time; - scdr << m_expiry_time_is_present; - scdr << m_protected_zone_latitude; - scdr << m_protected_zone_longitude; - scdr << m_protected_zone_radius; - scdr << m_protected_zone_radius_is_present; - scdr << m_protected_zone_id; - scdr << m_protected_zone_id_is_present; - -} - -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_protected_zone_type; - dcdr >> m_expiry_time; - dcdr >> m_expiry_time_is_present; - dcdr >> m_protected_zone_latitude; - dcdr >> m_protected_zone_longitude; - dcdr >> m_protected_zone_radius; - dcdr >> m_protected_zone_radius_is_present; - dcdr >> m_protected_zone_id; - dcdr >> m_protected_zone_id_is_present; -} - /*! * @brief This function copies the value in member protected_zone_type * @param _protected_zone_type New value to be copied in member protected_zone_type */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type( +void ProtectedCommunicationZone::protected_zone_type( const etsi_its_cam_msgs::msg::ProtectedZoneType& _protected_zone_type) { m_protected_zone_type = _protected_zone_type; @@ -241,7 +145,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type( * @brief This function moves the value in member protected_zone_type * @param _protected_zone_type New value to be moved in member protected_zone_type */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type( +void ProtectedCommunicationZone::protected_zone_type( etsi_its_cam_msgs::msg::ProtectedZoneType&& _protected_zone_type) { m_protected_zone_type = std::move(_protected_zone_type); @@ -251,7 +155,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type( * @brief This function returns a constant reference to member protected_zone_type * @return Constant reference to member protected_zone_type */ -const etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type() const +const etsi_its_cam_msgs::msg::ProtectedZoneType& ProtectedCommunicationZone::protected_zone_type() const { return m_protected_zone_type; } @@ -260,15 +164,17 @@ const etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::Protect * @brief This function returns a reference to member protected_zone_type * @return Reference to member protected_zone_type */ -etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_type() +etsi_its_cam_msgs::msg::ProtectedZoneType& ProtectedCommunicationZone::protected_zone_type() { return m_protected_zone_type; } + + /*! * @brief This function copies the value in member expiry_time * @param _expiry_time New value to be copied in member expiry_time */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time( +void ProtectedCommunicationZone::expiry_time( const etsi_its_cam_msgs::msg::TimestampIts& _expiry_time) { m_expiry_time = _expiry_time; @@ -278,7 +184,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time( * @brief This function moves the value in member expiry_time * @param _expiry_time New value to be moved in member expiry_time */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time( +void ProtectedCommunicationZone::expiry_time( etsi_its_cam_msgs::msg::TimestampIts&& _expiry_time) { m_expiry_time = std::move(_expiry_time); @@ -288,7 +194,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time( * @brief This function returns a constant reference to member expiry_time * @return Constant reference to member expiry_time */ -const etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time() const +const etsi_its_cam_msgs::msg::TimestampIts& ProtectedCommunicationZone::expiry_time() const { return m_expiry_time; } @@ -297,15 +203,17 @@ const etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::ProtectedCom * @brief This function returns a reference to member expiry_time * @return Reference to member expiry_time */ -etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time() +etsi_its_cam_msgs::msg::TimestampIts& ProtectedCommunicationZone::expiry_time() { return m_expiry_time; } + + /*! * @brief This function sets a value in member expiry_time_is_present * @param _expiry_time_is_present New value for member expiry_time_is_present */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time_is_present( +void ProtectedCommunicationZone::expiry_time_is_present( bool _expiry_time_is_present) { m_expiry_time_is_present = _expiry_time_is_present; @@ -315,7 +223,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time_is_present( * @brief This function returns the value of member expiry_time_is_present * @return Value of member expiry_time_is_present */ -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time_is_present() const +bool ProtectedCommunicationZone::expiry_time_is_present() const { return m_expiry_time_is_present; } @@ -324,16 +232,17 @@ bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time_is_present( * @brief This function returns a reference to member expiry_time_is_present * @return Reference to member expiry_time_is_present */ -bool& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::expiry_time_is_present() +bool& ProtectedCommunicationZone::expiry_time_is_present() { return m_expiry_time_is_present; } + /*! * @brief This function copies the value in member protected_zone_latitude * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude( +void ProtectedCommunicationZone::protected_zone_latitude( const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude) { m_protected_zone_latitude = _protected_zone_latitude; @@ -343,7 +252,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude * @brief This function moves the value in member protected_zone_latitude * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude( +void ProtectedCommunicationZone::protected_zone_latitude( etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude) { m_protected_zone_latitude = std::move(_protected_zone_latitude); @@ -353,7 +262,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude * @brief This function returns a constant reference to member protected_zone_latitude * @return Constant reference to member protected_zone_latitude */ -const etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude() const +const etsi_its_cam_msgs::msg::Latitude& ProtectedCommunicationZone::protected_zone_latitude() const { return m_protected_zone_latitude; } @@ -362,15 +271,17 @@ const etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ProtectedCommuni * @brief This function returns a reference to member protected_zone_latitude * @return Reference to member protected_zone_latitude */ -etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_latitude() +etsi_its_cam_msgs::msg::Latitude& ProtectedCommunicationZone::protected_zone_latitude() { return m_protected_zone_latitude; } + + /*! * @brief This function copies the value in member protected_zone_longitude * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitude( +void ProtectedCommunicationZone::protected_zone_longitude( const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude) { m_protected_zone_longitude = _protected_zone_longitude; @@ -380,7 +291,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitud * @brief This function moves the value in member protected_zone_longitude * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitude( +void ProtectedCommunicationZone::protected_zone_longitude( etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude) { m_protected_zone_longitude = std::move(_protected_zone_longitude); @@ -390,7 +301,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitud * @brief This function returns a constant reference to member protected_zone_longitude * @return Constant reference to member protected_zone_longitude */ -const etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitude() const +const etsi_its_cam_msgs::msg::Longitude& ProtectedCommunicationZone::protected_zone_longitude() const { return m_protected_zone_longitude; } @@ -399,15 +310,17 @@ const etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ProtectedCommun * @brief This function returns a reference to member protected_zone_longitude * @return Reference to member protected_zone_longitude */ -etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_longitude() +etsi_its_cam_msgs::msg::Longitude& ProtectedCommunicationZone::protected_zone_longitude() { return m_protected_zone_longitude; } + + /*! * @brief This function copies the value in member protected_zone_radius * @param _protected_zone_radius New value to be copied in member protected_zone_radius */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius( +void ProtectedCommunicationZone::protected_zone_radius( const etsi_its_cam_msgs::msg::ProtectedZoneRadius& _protected_zone_radius) { m_protected_zone_radius = _protected_zone_radius; @@ -417,7 +330,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius( * @brief This function moves the value in member protected_zone_radius * @param _protected_zone_radius New value to be moved in member protected_zone_radius */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius( +void ProtectedCommunicationZone::protected_zone_radius( etsi_its_cam_msgs::msg::ProtectedZoneRadius&& _protected_zone_radius) { m_protected_zone_radius = std::move(_protected_zone_radius); @@ -427,7 +340,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius( * @brief This function returns a constant reference to member protected_zone_radius * @return Constant reference to member protected_zone_radius */ -const etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius() const +const etsi_its_cam_msgs::msg::ProtectedZoneRadius& ProtectedCommunicationZone::protected_zone_radius() const { return m_protected_zone_radius; } @@ -436,15 +349,17 @@ const etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::Prote * @brief This function returns a reference to member protected_zone_radius * @return Reference to member protected_zone_radius */ -etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius() +etsi_its_cam_msgs::msg::ProtectedZoneRadius& ProtectedCommunicationZone::protected_zone_radius() { return m_protected_zone_radius; } + + /*! * @brief This function sets a value in member protected_zone_radius_is_present * @param _protected_zone_radius_is_present New value for member protected_zone_radius_is_present */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius_is_present( +void ProtectedCommunicationZone::protected_zone_radius_is_present( bool _protected_zone_radius_is_present) { m_protected_zone_radius_is_present = _protected_zone_radius_is_present; @@ -454,7 +369,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius_i * @brief This function returns the value of member protected_zone_radius_is_present * @return Value of member protected_zone_radius_is_present */ -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius_is_present() const +bool ProtectedCommunicationZone::protected_zone_radius_is_present() const { return m_protected_zone_radius_is_present; } @@ -463,16 +378,17 @@ bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius_i * @brief This function returns a reference to member protected_zone_radius_is_present * @return Reference to member protected_zone_radius_is_present */ -bool& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_radius_is_present() +bool& ProtectedCommunicationZone::protected_zone_radius_is_present() { return m_protected_zone_radius_is_present; } + /*! * @brief This function copies the value in member protected_zone_id * @param _protected_zone_id New value to be copied in member protected_zone_id */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id( +void ProtectedCommunicationZone::protected_zone_id( const etsi_its_cam_msgs::msg::ProtectedZoneID& _protected_zone_id) { m_protected_zone_id = _protected_zone_id; @@ -482,7 +398,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id( * @brief This function moves the value in member protected_zone_id * @param _protected_zone_id New value to be moved in member protected_zone_id */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id( +void ProtectedCommunicationZone::protected_zone_id( etsi_its_cam_msgs::msg::ProtectedZoneID&& _protected_zone_id) { m_protected_zone_id = std::move(_protected_zone_id); @@ -492,7 +408,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id( * @brief This function returns a constant reference to member protected_zone_id * @return Constant reference to member protected_zone_id */ -const etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id() const +const etsi_its_cam_msgs::msg::ProtectedZoneID& ProtectedCommunicationZone::protected_zone_id() const { return m_protected_zone_id; } @@ -501,15 +417,17 @@ const etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::Protected * @brief This function returns a reference to member protected_zone_id * @return Reference to member protected_zone_id */ -etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id() +etsi_its_cam_msgs::msg::ProtectedZoneID& ProtectedCommunicationZone::protected_zone_id() { return m_protected_zone_id; } + + /*! * @brief This function sets a value in member protected_zone_id_is_present * @param _protected_zone_id_is_present New value for member protected_zone_id_is_present */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id_is_present( +void ProtectedCommunicationZone::protected_zone_id_is_present( bool _protected_zone_id_is_present) { m_protected_zone_id_is_present = _protected_zone_id_is_present; @@ -519,7 +437,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id_is_pr * @brief This function returns the value of member protected_zone_id_is_present * @return Value of member protected_zone_id_is_present */ -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id_is_present() const +bool ProtectedCommunicationZone::protected_zone_id_is_present() const { return m_protected_zone_id_is_present; } @@ -528,32 +446,18 @@ bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id_is_pr * @brief This function returns a reference to member protected_zone_id_is_present * @return Reference to member protected_zone_id_is_present */ -bool& etsi_its_cam_msgs::msg::ProtectedCommunicationZone::protected_zone_id_is_present() +bool& ProtectedCommunicationZone::protected_zone_id_is_present() { return m_protected_zone_id_is_present; } -size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZone::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::ProtectedCommunicationZone::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ProtectedCommunicationZoneCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.h index c754f63c34c..8bacee45c22 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZone.h @@ -16,12 +16,23 @@ * @file ProtectedCommunicationZone.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "ProtectedZoneRadius.h" #include "TimestampIts.h" #include "ProtectedZoneID.h" @@ -29,12 +40,6 @@ #include "Latitude.h" #include "Longitude.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -48,365 +53,333 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ProtectedCommunicationZone_SOURCE) -#define ProtectedCommunicationZone_DllAPI __declspec( dllexport ) +#if defined(PROTECTEDCOMMUNICATIONZONE_SOURCE) +#define PROTECTEDCOMMUNICATIONZONE_DllAPI __declspec( dllexport ) #else -#define ProtectedCommunicationZone_DllAPI __declspec( dllimport ) -#endif // ProtectedCommunicationZone_SOURCE +#define PROTECTEDCOMMUNICATIONZONE_DllAPI __declspec( dllimport ) +#endif // PROTECTEDCOMMUNICATIONZONE_SOURCE #else -#define ProtectedCommunicationZone_DllAPI +#define PROTECTEDCOMMUNICATIONZONE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ProtectedCommunicationZone_DllAPI +#define PROTECTEDCOMMUNICATIONZONE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure ProtectedCommunicationZone defined by the user in the IDL file. - * @ingroup PROTECTEDCOMMUNICATIONZONE - */ - class ProtectedCommunicationZone - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ProtectedCommunicationZone(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ProtectedCommunicationZone(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. - */ - eProsima_user_DllExport ProtectedCommunicationZone( - const ProtectedCommunicationZone& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. - */ - eProsima_user_DllExport ProtectedCommunicationZone( - ProtectedCommunicationZone&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. - */ - eProsima_user_DllExport ProtectedCommunicationZone& operator =( - const ProtectedCommunicationZone& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. - */ - eProsima_user_DllExport ProtectedCommunicationZone& operator =( - ProtectedCommunicationZone&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZone object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ProtectedCommunicationZone& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZone object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ProtectedCommunicationZone& x) const; - - /*! - * @brief This function copies the value in member protected_zone_type - * @param _protected_zone_type New value to be copied in member protected_zone_type - */ - eProsima_user_DllExport void protected_zone_type( - const etsi_its_cam_msgs::msg::ProtectedZoneType& _protected_zone_type); - - /*! - * @brief This function moves the value in member protected_zone_type - * @param _protected_zone_type New value to be moved in member protected_zone_type - */ - eProsima_user_DllExport void protected_zone_type( - etsi_its_cam_msgs::msg::ProtectedZoneType&& _protected_zone_type); - - /*! - * @brief This function returns a constant reference to member protected_zone_type - * @return Constant reference to member protected_zone_type - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneType& protected_zone_type() const; - - /*! - * @brief This function returns a reference to member protected_zone_type - * @return Reference to member protected_zone_type - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneType& protected_zone_type(); - /*! - * @brief This function copies the value in member expiry_time - * @param _expiry_time New value to be copied in member expiry_time - */ - eProsima_user_DllExport void expiry_time( - const etsi_its_cam_msgs::msg::TimestampIts& _expiry_time); - - /*! - * @brief This function moves the value in member expiry_time - * @param _expiry_time New value to be moved in member expiry_time - */ - eProsima_user_DllExport void expiry_time( - etsi_its_cam_msgs::msg::TimestampIts&& _expiry_time); - - /*! - * @brief This function returns a constant reference to member expiry_time - * @return Constant reference to member expiry_time - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::TimestampIts& expiry_time() const; - - /*! - * @brief This function returns a reference to member expiry_time - * @return Reference to member expiry_time - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::TimestampIts& expiry_time(); - /*! - * @brief This function sets a value in member expiry_time_is_present - * @param _expiry_time_is_present New value for member expiry_time_is_present - */ - eProsima_user_DllExport void expiry_time_is_present( - bool _expiry_time_is_present); - - /*! - * @brief This function returns the value of member expiry_time_is_present - * @return Value of member expiry_time_is_present - */ - eProsima_user_DllExport bool expiry_time_is_present() const; - - /*! - * @brief This function returns a reference to member expiry_time_is_present - * @return Reference to member expiry_time_is_present - */ - eProsima_user_DllExport bool& expiry_time_is_present(); - - /*! - * @brief This function copies the value in member protected_zone_latitude - * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude - */ - eProsima_user_DllExport void protected_zone_latitude( - const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude); - - /*! - * @brief This function moves the value in member protected_zone_latitude - * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude - */ - eProsima_user_DllExport void protected_zone_latitude( - etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude); - - /*! - * @brief This function returns a constant reference to member protected_zone_latitude - * @return Constant reference to member protected_zone_latitude - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude() const; - - /*! - * @brief This function returns a reference to member protected_zone_latitude - * @return Reference to member protected_zone_latitude - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude(); - /*! - * @brief This function copies the value in member protected_zone_longitude - * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude - */ - eProsima_user_DllExport void protected_zone_longitude( - const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude); - - /*! - * @brief This function moves the value in member protected_zone_longitude - * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude - */ - eProsima_user_DllExport void protected_zone_longitude( - etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude); - - /*! - * @brief This function returns a constant reference to member protected_zone_longitude - * @return Constant reference to member protected_zone_longitude - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude() const; - - /*! - * @brief This function returns a reference to member protected_zone_longitude - * @return Reference to member protected_zone_longitude - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude(); - /*! - * @brief This function copies the value in member protected_zone_radius - * @param _protected_zone_radius New value to be copied in member protected_zone_radius - */ - eProsima_user_DllExport void protected_zone_radius( - const etsi_its_cam_msgs::msg::ProtectedZoneRadius& _protected_zone_radius); - - /*! - * @brief This function moves the value in member protected_zone_radius - * @param _protected_zone_radius New value to be moved in member protected_zone_radius - */ - eProsima_user_DllExport void protected_zone_radius( - etsi_its_cam_msgs::msg::ProtectedZoneRadius&& _protected_zone_radius); - - /*! - * @brief This function returns a constant reference to member protected_zone_radius - * @return Constant reference to member protected_zone_radius - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneRadius& protected_zone_radius() const; - - /*! - * @brief This function returns a reference to member protected_zone_radius - * @return Reference to member protected_zone_radius - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneRadius& protected_zone_radius(); - /*! - * @brief This function sets a value in member protected_zone_radius_is_present - * @param _protected_zone_radius_is_present New value for member protected_zone_radius_is_present - */ - eProsima_user_DllExport void protected_zone_radius_is_present( - bool _protected_zone_radius_is_present); - - /*! - * @brief This function returns the value of member protected_zone_radius_is_present - * @return Value of member protected_zone_radius_is_present - */ - eProsima_user_DllExport bool protected_zone_radius_is_present() const; - - /*! - * @brief This function returns a reference to member protected_zone_radius_is_present - * @return Reference to member protected_zone_radius_is_present - */ - eProsima_user_DllExport bool& protected_zone_radius_is_present(); - - /*! - * @brief This function copies the value in member protected_zone_id - * @param _protected_zone_id New value to be copied in member protected_zone_id - */ - eProsima_user_DllExport void protected_zone_id( - const etsi_its_cam_msgs::msg::ProtectedZoneID& _protected_zone_id); - - /*! - * @brief This function moves the value in member protected_zone_id - * @param _protected_zone_id New value to be moved in member protected_zone_id - */ - eProsima_user_DllExport void protected_zone_id( - etsi_its_cam_msgs::msg::ProtectedZoneID&& _protected_zone_id); - - /*! - * @brief This function returns a constant reference to member protected_zone_id - * @return Constant reference to member protected_zone_id - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneID& protected_zone_id() const; - - /*! - * @brief This function returns a reference to member protected_zone_id - * @return Reference to member protected_zone_id - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneID& protected_zone_id(); - /*! - * @brief This function sets a value in member protected_zone_id_is_present - * @param _protected_zone_id_is_present New value for member protected_zone_id_is_present - */ - eProsima_user_DllExport void protected_zone_id_is_present( - bool _protected_zone_id_is_present); - - /*! - * @brief This function returns the value of member protected_zone_id_is_present - * @return Value of member protected_zone_id_is_present - */ - eProsima_user_DllExport bool protected_zone_id_is_present() const; - - /*! - * @brief This function returns a reference to member protected_zone_id_is_present - * @return Reference to member protected_zone_id_is_present - */ - eProsima_user_DllExport bool& protected_zone_id_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::ProtectedZoneType m_protected_zone_type; - etsi_its_cam_msgs::msg::TimestampIts m_expiry_time; - bool m_expiry_time_is_present; - etsi_its_cam_msgs::msg::Latitude m_protected_zone_latitude; - etsi_its_cam_msgs::msg::Longitude m_protected_zone_longitude; - etsi_its_cam_msgs::msg::ProtectedZoneRadius m_protected_zone_radius; - bool m_protected_zone_radius_is_present; - etsi_its_cam_msgs::msg::ProtectedZoneID m_protected_zone_id; - bool m_protected_zone_id_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure ProtectedCommunicationZone defined by the user in the IDL file. + * @ingroup ProtectedCommunicationZone + */ +class ProtectedCommunicationZone +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedCommunicationZone(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedCommunicationZone(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZone( + const ProtectedCommunicationZone& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZone( + ProtectedCommunicationZone&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZone& operator =( + const ProtectedCommunicationZone& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZone that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZone& operator =( + ProtectedCommunicationZone&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZone object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedCommunicationZone& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZone object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedCommunicationZone& x) const; + + /*! + * @brief This function copies the value in member protected_zone_type + * @param _protected_zone_type New value to be copied in member protected_zone_type + */ + eProsima_user_DllExport void protected_zone_type( + const etsi_its_cam_msgs::msg::ProtectedZoneType& _protected_zone_type); + + /*! + * @brief This function moves the value in member protected_zone_type + * @param _protected_zone_type New value to be moved in member protected_zone_type + */ + eProsima_user_DllExport void protected_zone_type( + etsi_its_cam_msgs::msg::ProtectedZoneType&& _protected_zone_type); + + /*! + * @brief This function returns a constant reference to member protected_zone_type + * @return Constant reference to member protected_zone_type + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneType& protected_zone_type() const; + + /*! + * @brief This function returns a reference to member protected_zone_type + * @return Reference to member protected_zone_type + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneType& protected_zone_type(); + + + /*! + * @brief This function copies the value in member expiry_time + * @param _expiry_time New value to be copied in member expiry_time + */ + eProsima_user_DllExport void expiry_time( + const etsi_its_cam_msgs::msg::TimestampIts& _expiry_time); + + /*! + * @brief This function moves the value in member expiry_time + * @param _expiry_time New value to be moved in member expiry_time + */ + eProsima_user_DllExport void expiry_time( + etsi_its_cam_msgs::msg::TimestampIts&& _expiry_time); + + /*! + * @brief This function returns a constant reference to member expiry_time + * @return Constant reference to member expiry_time + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::TimestampIts& expiry_time() const; + + /*! + * @brief This function returns a reference to member expiry_time + * @return Reference to member expiry_time + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::TimestampIts& expiry_time(); + + + /*! + * @brief This function sets a value in member expiry_time_is_present + * @param _expiry_time_is_present New value for member expiry_time_is_present + */ + eProsima_user_DllExport void expiry_time_is_present( + bool _expiry_time_is_present); + + /*! + * @brief This function returns the value of member expiry_time_is_present + * @return Value of member expiry_time_is_present + */ + eProsima_user_DllExport bool expiry_time_is_present() const; + + /*! + * @brief This function returns a reference to member expiry_time_is_present + * @return Reference to member expiry_time_is_present + */ + eProsima_user_DllExport bool& expiry_time_is_present(); + + + /*! + * @brief This function copies the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be copied in member protected_zone_latitude + */ + eProsima_user_DllExport void protected_zone_latitude( + const etsi_its_cam_msgs::msg::Latitude& _protected_zone_latitude); + + /*! + * @brief This function moves the value in member protected_zone_latitude + * @param _protected_zone_latitude New value to be moved in member protected_zone_latitude + */ + eProsima_user_DllExport void protected_zone_latitude( + etsi_its_cam_msgs::msg::Latitude&& _protected_zone_latitude); + + /*! + * @brief This function returns a constant reference to member protected_zone_latitude + * @return Constant reference to member protected_zone_latitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude() const; + + /*! + * @brief This function returns a reference to member protected_zone_latitude + * @return Reference to member protected_zone_latitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& protected_zone_latitude(); + + + /*! + * @brief This function copies the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be copied in member protected_zone_longitude + */ + eProsima_user_DllExport void protected_zone_longitude( + const etsi_its_cam_msgs::msg::Longitude& _protected_zone_longitude); + + /*! + * @brief This function moves the value in member protected_zone_longitude + * @param _protected_zone_longitude New value to be moved in member protected_zone_longitude + */ + eProsima_user_DllExport void protected_zone_longitude( + etsi_its_cam_msgs::msg::Longitude&& _protected_zone_longitude); + + /*! + * @brief This function returns a constant reference to member protected_zone_longitude + * @return Constant reference to member protected_zone_longitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude() const; + + /*! + * @brief This function returns a reference to member protected_zone_longitude + * @return Reference to member protected_zone_longitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& protected_zone_longitude(); + + + /*! + * @brief This function copies the value in member protected_zone_radius + * @param _protected_zone_radius New value to be copied in member protected_zone_radius + */ + eProsima_user_DllExport void protected_zone_radius( + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& _protected_zone_radius); + + /*! + * @brief This function moves the value in member protected_zone_radius + * @param _protected_zone_radius New value to be moved in member protected_zone_radius + */ + eProsima_user_DllExport void protected_zone_radius( + etsi_its_cam_msgs::msg::ProtectedZoneRadius&& _protected_zone_radius); + + /*! + * @brief This function returns a constant reference to member protected_zone_radius + * @return Constant reference to member protected_zone_radius + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneRadius& protected_zone_radius() const; + + /*! + * @brief This function returns a reference to member protected_zone_radius + * @return Reference to member protected_zone_radius + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneRadius& protected_zone_radius(); + + + /*! + * @brief This function sets a value in member protected_zone_radius_is_present + * @param _protected_zone_radius_is_present New value for member protected_zone_radius_is_present + */ + eProsima_user_DllExport void protected_zone_radius_is_present( + bool _protected_zone_radius_is_present); + + /*! + * @brief This function returns the value of member protected_zone_radius_is_present + * @return Value of member protected_zone_radius_is_present + */ + eProsima_user_DllExport bool protected_zone_radius_is_present() const; + + /*! + * @brief This function returns a reference to member protected_zone_radius_is_present + * @return Reference to member protected_zone_radius_is_present + */ + eProsima_user_DllExport bool& protected_zone_radius_is_present(); + + + /*! + * @brief This function copies the value in member protected_zone_id + * @param _protected_zone_id New value to be copied in member protected_zone_id + */ + eProsima_user_DllExport void protected_zone_id( + const etsi_its_cam_msgs::msg::ProtectedZoneID& _protected_zone_id); + + /*! + * @brief This function moves the value in member protected_zone_id + * @param _protected_zone_id New value to be moved in member protected_zone_id + */ + eProsima_user_DllExport void protected_zone_id( + etsi_its_cam_msgs::msg::ProtectedZoneID&& _protected_zone_id); + + /*! + * @brief This function returns a constant reference to member protected_zone_id + * @return Constant reference to member protected_zone_id + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedZoneID& protected_zone_id() const; + + /*! + * @brief This function returns a reference to member protected_zone_id + * @return Reference to member protected_zone_id + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedZoneID& protected_zone_id(); + + + /*! + * @brief This function sets a value in member protected_zone_id_is_present + * @param _protected_zone_id_is_present New value for member protected_zone_id_is_present + */ + eProsima_user_DllExport void protected_zone_id_is_present( + bool _protected_zone_id_is_present); + + /*! + * @brief This function returns the value of member protected_zone_id_is_present + * @return Value of member protected_zone_id_is_present + */ + eProsima_user_DllExport bool protected_zone_id_is_present() const; + + /*! + * @brief This function returns a reference to member protected_zone_id_is_present + * @return Reference to member protected_zone_id_is_present + */ + eProsima_user_DllExport bool& protected_zone_id_is_present(); + +private: + + etsi_its_cam_msgs::msg::ProtectedZoneType m_protected_zone_type; + etsi_its_cam_msgs::msg::TimestampIts m_expiry_time; + bool m_expiry_time_is_present{false}; + etsi_its_cam_msgs::msg::Latitude m_protected_zone_latitude; + etsi_its_cam_msgs::msg::Longitude m_protected_zone_longitude; + etsi_its_cam_msgs::msg::ProtectedZoneRadius m_protected_zone_radius; + bool m_protected_zone_radius_is_present{false}; + etsi_its_cam_msgs::msg::ProtectedZoneID m_protected_zone_id; + bool m_protected_zone_id_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZoneCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZoneCdrAux.hpp new file mode 100644 index 00000000000..946e04d797c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZoneCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZoneCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONECDRAUX_HPP_ + +#include "ProtectedCommunicationZone.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedCommunicationZone_max_cdr_typesize {61UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedCommunicationZone_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZoneCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZoneCdrAux.ipp new file mode 100644 index 00000000000..d21956ffa58 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZoneCdrAux.ipp @@ -0,0 +1,194 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZoneCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONECDRAUX_IPP_ + +#include "ProtectedCommunicationZoneCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.protected_zone_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.expiry_time(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.expiry_time_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.protected_zone_latitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.protected_zone_longitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.protected_zone_radius(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.protected_zone_radius_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.protected_zone_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.protected_zone_id_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.protected_zone_type() + << eprosima::fastcdr::MemberId(1) << data.expiry_time() + << eprosima::fastcdr::MemberId(2) << data.expiry_time_is_present() + << eprosima::fastcdr::MemberId(3) << data.protected_zone_latitude() + << eprosima::fastcdr::MemberId(4) << data.protected_zone_longitude() + << eprosima::fastcdr::MemberId(5) << data.protected_zone_radius() + << eprosima::fastcdr::MemberId(6) << data.protected_zone_radius_is_present() + << eprosima::fastcdr::MemberId(7) << data.protected_zone_id() + << eprosima::fastcdr::MemberId(8) << data.protected_zone_id_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.protected_zone_type(); + break; + + case 1: + dcdr >> data.expiry_time(); + break; + + case 2: + dcdr >> data.expiry_time_is_present(); + break; + + case 3: + dcdr >> data.protected_zone_latitude(); + break; + + case 4: + dcdr >> data.protected_zone_longitude(); + break; + + case 5: + dcdr >> data.protected_zone_radius(); + break; + + case 6: + dcdr >> data.protected_zone_radius_is_present(); + break; + + case 7: + dcdr >> data.protected_zone_id(); + break; + + case 8: + dcdr >> data.protected_zone_id_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedCommunicationZone& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.cxx index 0d433e12249..7445a4bd4de 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file ProtectedCommunicationZonePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ProtectedCommunicationZonePubSubTypes.h" +#include "ProtectedCommunicationZoneCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - ProtectedCommunicationZonePubSubType::ProtectedCommunicationZonePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ProtectedCommunicationZone_"); - auto type_size = ProtectedCommunicationZone::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ProtectedCommunicationZone::isKeyDefined(); - size_t keyLength = ProtectedCommunicationZone::getKeyMaxCdrSerializedSize() > 16 ? - ProtectedCommunicationZone::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ProtectedCommunicationZonePubSubType::~ProtectedCommunicationZonePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ProtectedCommunicationZonePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ProtectedCommunicationZone* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ProtectedCommunicationZonePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ProtectedCommunicationZone* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ProtectedCommunicationZonePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ProtectedCommunicationZonePubSubType::createData() - { - return reinterpret_cast(new ProtectedCommunicationZone()); - } - - void ProtectedCommunicationZonePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ProtectedCommunicationZonePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ProtectedCommunicationZone* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ProtectedCommunicationZone::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ProtectedCommunicationZone::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +ProtectedCommunicationZonePubSubType::ProtectedCommunicationZonePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ProtectedCommunicationZone_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ProtectedCommunicationZone::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ProtectedCommunicationZone_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ProtectedCommunicationZonePubSubType::~ProtectedCommunicationZonePubSubType() +{ +} + +bool ProtectedCommunicationZonePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ProtectedCommunicationZone* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ProtectedCommunicationZonePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ProtectedCommunicationZone* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ProtectedCommunicationZonePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ProtectedCommunicationZonePubSubType::createData() +{ + return reinterpret_cast(new ProtectedCommunicationZone()); +} + +void ProtectedCommunicationZonePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ProtectedCommunicationZonePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.h index a4ec6e75efe..460eee57468 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonePubSubTypes.h @@ -16,92 +16,126 @@ * @file ProtectedCommunicationZonePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ProtectedCommunicationZone.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "ProtectedZoneRadiusPubSubTypes.h" +#include "TimestampItsPubSubTypes.h" +#include "ProtectedZoneIDPubSubTypes.h" +#include "ProtectedZoneTypePubSubTypes.h" +#include "LatitudePubSubTypes.h" +#include "LongitudePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ProtectedCommunicationZone is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type ProtectedCommunicationZone defined by the user in the IDL file. + * @ingroup ProtectedCommunicationZone + */ +class ProtectedCommunicationZonePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type ProtectedCommunicationZone defined by the user in the IDL file. - * @ingroup PROTECTEDCOMMUNICATIONZONE - */ - class ProtectedCommunicationZonePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef ProtectedCommunicationZone type; + typedef ProtectedCommunicationZone type; - eProsima_user_DllExport ProtectedCommunicationZonePubSubType(); + eProsima_user_DllExport ProtectedCommunicationZonePubSubType(); - eProsima_user_DllExport virtual ~ProtectedCommunicationZonePubSubType(); + eProsima_user_DllExport ~ProtectedCommunicationZonePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) ProtectedCommunicationZone(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.cxx index acb8c9fbd09..abe1878ba89 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.cxx @@ -14,9 +14,9 @@ /*! * @file ProtectedCommunicationZonesRSU.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,81 @@ char dummy; #endif // _WIN32 #include "ProtectedCommunicationZonesRSU.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { + +namespace ProtectedCommunicationZonesRSU_Constants { + + +} // namespace ProtectedCommunicationZonesRSU_Constants -etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU() -{ - // m_array com.eprosima.idl.parser.typecode.SequenceTypeCode@515f4131 + +ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU() +{ } -etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::~ProtectedCommunicationZonesRSU() +ProtectedCommunicationZonesRSU::~ProtectedCommunicationZonesRSU() { } -etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU( +ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU( const ProtectedCommunicationZonesRSU& x) { m_array = x.m_array; } -etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU( - ProtectedCommunicationZonesRSU&& x) +ProtectedCommunicationZonesRSU::ProtectedCommunicationZonesRSU( + ProtectedCommunicationZonesRSU&& x) noexcept { m_array = std::move(x.m_array); } -etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::operator =( +ProtectedCommunicationZonesRSU& ProtectedCommunicationZonesRSU::operator =( const ProtectedCommunicationZonesRSU& x) { m_array = x.m_array; - return *this; } -etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::operator =( - ProtectedCommunicationZonesRSU&& x) +ProtectedCommunicationZonesRSU& ProtectedCommunicationZonesRSU::operator =( + ProtectedCommunicationZonesRSU&& x) noexcept { m_array = std::move(x.m_array); - return *this; } -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::operator ==( +bool ProtectedCommunicationZonesRSU::operator ==( const ProtectedCommunicationZonesRSU& x) const { - return (m_array == x.m_array); } -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::operator !=( +bool ProtectedCommunicationZonesRSU::operator !=( const ProtectedCommunicationZonesRSU& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.array().size(); ++a) - { - current_alignment += etsi_its_cam_msgs::msg::ProtectedCommunicationZone::getCdrSerializedSize(data.array().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_array; -} - -void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_array;} - /*! * @brief This function copies the value in member array * @param _array New value to be copied in member array */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array( +void ProtectedCommunicationZonesRSU::array( const std::vector& _array) { m_array = _array; @@ -152,7 +111,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array( * @brief This function moves the value in member array * @param _array New value to be moved in member array */ -void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array( +void ProtectedCommunicationZonesRSU::array( std::vector&& _array) { m_array = std::move(_array); @@ -162,7 +121,7 @@ void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array( * @brief This function returns a constant reference to member array * @return Constant reference to member array */ -const std::vector& etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array() const +const std::vector& ProtectedCommunicationZonesRSU::array() const { return m_array; } @@ -171,31 +130,18 @@ const std::vector& etsi_its_ * @brief This function returns a reference to member array * @return Reference to member array */ -std::vector& etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::array() +std::vector& ProtectedCommunicationZonesRSU::array() { return m_array; } -size_t etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ProtectedCommunicationZonesRSUCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.h index b9fff22407d..97aa40a091f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSU.h @@ -16,20 +16,25 @@ * @file ProtectedCommunicationZonesRSU.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_H_ -#include "ProtectedCommunicationZone.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "ProtectedCommunicationZone.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,179 +48,138 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ProtectedCommunicationZonesRSU_SOURCE) -#define ProtectedCommunicationZonesRSU_DllAPI __declspec( dllexport ) +#if defined(PROTECTEDCOMMUNICATIONZONESRSU_SOURCE) +#define PROTECTEDCOMMUNICATIONZONESRSU_DllAPI __declspec( dllexport ) #else -#define ProtectedCommunicationZonesRSU_DllAPI __declspec( dllimport ) -#endif // ProtectedCommunicationZonesRSU_SOURCE +#define PROTECTEDCOMMUNICATIONZONESRSU_DllAPI __declspec( dllimport ) +#endif // PROTECTEDCOMMUNICATIONZONESRSU_SOURCE #else -#define ProtectedCommunicationZonesRSU_DllAPI +#define PROTECTEDCOMMUNICATIONZONESRSU_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ProtectedCommunicationZonesRSU_DllAPI +#define PROTECTEDCOMMUNICATIONZONESRSU_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace ProtectedCommunicationZonesRSU_Constants { - const uint8_t MIN_SIZE = 1; - const uint8_t MAX_SIZE = 16; - } // namespace ProtectedCommunicationZonesRSU_Constants - /*! - * @brief This class represents the structure ProtectedCommunicationZonesRSU defined by the user in the IDL file. - * @ingroup PROTECTEDCOMMUNICATIONZONESRSU - */ - class ProtectedCommunicationZonesRSU - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ProtectedCommunicationZonesRSU(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ProtectedCommunicationZonesRSU(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. - */ - eProsima_user_DllExport ProtectedCommunicationZonesRSU( - const ProtectedCommunicationZonesRSU& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. - */ - eProsima_user_DllExport ProtectedCommunicationZonesRSU( - ProtectedCommunicationZonesRSU&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. - */ - eProsima_user_DllExport ProtectedCommunicationZonesRSU& operator =( - const ProtectedCommunicationZonesRSU& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. - */ - eProsima_user_DllExport ProtectedCommunicationZonesRSU& operator =( - ProtectedCommunicationZonesRSU&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ProtectedCommunicationZonesRSU& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ProtectedCommunicationZonesRSU& x) const; - - /*! - * @brief This function copies the value in member array - * @param _array New value to be copied in member array - */ - eProsima_user_DllExport void array( - const std::vector& _array); - - /*! - * @brief This function moves the value in member array - * @param _array New value to be moved in member array - */ - eProsima_user_DllExport void array( - std::vector&& _array); - - /*! - * @brief This function returns a constant reference to member array - * @return Constant reference to member array - */ - eProsima_user_DllExport const std::vector& array() const; - - /*! - * @brief This function returns a reference to member array - * @return Reference to member array - */ - eProsima_user_DllExport std::vector& array(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_array; - }; - } // namespace msg + +namespace msg { + +namespace ProtectedCommunicationZonesRSU_Constants { + +const uint8_t MIN_SIZE = 1; +const uint8_t MAX_SIZE = 16; + +} // namespace ProtectedCommunicationZonesRSU_Constants + + + + +/*! + * @brief This class represents the structure ProtectedCommunicationZonesRSU defined by the user in the IDL file. + * @ingroup ProtectedCommunicationZonesRSU + */ +class ProtectedCommunicationZonesRSU +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedCommunicationZonesRSU(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU( + const ProtectedCommunicationZonesRSU& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU( + ProtectedCommunicationZonesRSU&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU& operator =( + const ProtectedCommunicationZonesRSU& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU that will be copied. + */ + eProsima_user_DllExport ProtectedCommunicationZonesRSU& operator =( + ProtectedCommunicationZonesRSU&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedCommunicationZonesRSU& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedCommunicationZonesRSU& x) const; + + /*! + * @brief This function copies the value in member array + * @param _array New value to be copied in member array + */ + eProsima_user_DllExport void array( + const std::vector& _array); + + /*! + * @brief This function moves the value in member array + * @param _array New value to be moved in member array + */ + eProsima_user_DllExport void array( + std::vector&& _array); + + /*! + * @brief This function returns a constant reference to member array + * @return Constant reference to member array + */ + eProsima_user_DllExport const std::vector& array() const; + + /*! + * @brief This function returns a reference to member array + * @return Reference to member array + */ + eProsima_user_DllExport std::vector& array(); + +private: + + std::vector m_array; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUCdrAux.hpp new file mode 100644 index 00000000000..af8e37adeb4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUCdrAux.hpp @@ -0,0 +1,59 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZonesRSUCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSUCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSUCDRAUX_HPP_ + +#include "ProtectedCommunicationZonesRSU.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedCommunicationZonesRSU_max_cdr_typesize {6413UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedCommunicationZonesRSU_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSUCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUCdrAux.ipp new file mode 100644 index 00000000000..718071b423e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedCommunicationZonesRSUCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSUCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSUCDRAUX_IPP_ + +#include "ProtectedCommunicationZonesRSUCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.array(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.array() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.array(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSUCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.cxx index 8c8bf7587b2..9eec8ec1229 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.cxx @@ -16,166 +16,193 @@ * @file ProtectedCommunicationZonesRSUPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ProtectedCommunicationZonesRSUPubSubTypes.h" +#include "ProtectedCommunicationZonesRSUCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace ProtectedCommunicationZonesRSU_Constants { - - - - } //End of namespace ProtectedCommunicationZonesRSU_Constants - ProtectedCommunicationZonesRSUPubSubType::ProtectedCommunicationZonesRSUPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ProtectedCommunicationZonesRSU_"); - auto type_size = ProtectedCommunicationZonesRSU::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ProtectedCommunicationZonesRSU::isKeyDefined(); - size_t keyLength = ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize() > 16 ? - ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ProtectedCommunicationZonesRSUPubSubType::~ProtectedCommunicationZonesRSUPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ProtectedCommunicationZonesRSUPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ProtectedCommunicationZonesRSU* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ProtectedCommunicationZonesRSUPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ProtectedCommunicationZonesRSU* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ProtectedCommunicationZonesRSUPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ProtectedCommunicationZonesRSUPubSubType::createData() - { - return reinterpret_cast(new ProtectedCommunicationZonesRSU()); - } - - void ProtectedCommunicationZonesRSUPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ProtectedCommunicationZonesRSUPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ProtectedCommunicationZonesRSU* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ProtectedCommunicationZonesRSU::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace ProtectedCommunicationZonesRSU_Constants { + + + + + +} //End of namespace ProtectedCommunicationZonesRSU_Constants + + + + + +ProtectedCommunicationZonesRSUPubSubType::ProtectedCommunicationZonesRSUPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ProtectedCommunicationZonesRSU_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ProtectedCommunicationZonesRSU::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ProtectedCommunicationZonesRSU_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ProtectedCommunicationZonesRSUPubSubType::~ProtectedCommunicationZonesRSUPubSubType() +{ +} + +bool ProtectedCommunicationZonesRSUPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ProtectedCommunicationZonesRSU* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ProtectedCommunicationZonesRSUPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ProtectedCommunicationZonesRSU* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ProtectedCommunicationZonesRSUPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ProtectedCommunicationZonesRSUPubSubType::createData() +{ + return reinterpret_cast(new ProtectedCommunicationZonesRSU()); +} + +void ProtectedCommunicationZonesRSUPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ProtectedCommunicationZonesRSUPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.h index bb68647494c..85804e019f8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedCommunicationZonesRSUPubSubTypes.h @@ -16,97 +16,129 @@ * @file ProtectedCommunicationZonesRSUPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ProtectedCommunicationZonesRSU.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "ProtectedCommunicationZonePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ProtectedCommunicationZonesRSU is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace ProtectedCommunicationZonesRSU_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace ProtectedCommunicationZonesRSU_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type ProtectedCommunicationZonesRSU defined by the user in the IDL file. - * @ingroup PROTECTEDCOMMUNICATIONZONESRSU - */ - class ProtectedCommunicationZonesRSUPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef ProtectedCommunicationZonesRSU type; - eProsima_user_DllExport ProtectedCommunicationZonesRSUPubSubType(); +} // namespace ProtectedCommunicationZonesRSU_Constants - eProsima_user_DllExport virtual ~ProtectedCommunicationZonesRSUPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +/*! + * @brief This class represents the TopicDataType of the type ProtectedCommunicationZonesRSU defined by the user in the IDL file. + * @ingroup ProtectedCommunicationZonesRSU + */ +class ProtectedCommunicationZonesRSUPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport virtual void* createData() override; + typedef ProtectedCommunicationZonesRSU type; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport ProtectedCommunicationZonesRSUPubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport ~ProtectedCommunicationZonesRSUPubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDCOMMUNICATIONZONESRSU_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.cxx index 6c4ab3e2dd9..8eef65357dd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.cxx @@ -14,9 +14,9 @@ /*! * @file ProtectedZoneID.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,116 +27,79 @@ char dummy; #endif // _WIN32 #include "ProtectedZoneID.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { + +namespace ProtectedZoneID_Constants { + + +} // namespace ProtectedZoneID_Constants -etsi_its_cam_msgs::msg::ProtectedZoneID::ProtectedZoneID() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@27fde870 - m_value = 0; +ProtectedZoneID::ProtectedZoneID() +{ } -etsi_its_cam_msgs::msg::ProtectedZoneID::~ProtectedZoneID() +ProtectedZoneID::~ProtectedZoneID() { } -etsi_its_cam_msgs::msg::ProtectedZoneID::ProtectedZoneID( +ProtectedZoneID::ProtectedZoneID( const ProtectedZoneID& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::ProtectedZoneID::ProtectedZoneID( - ProtectedZoneID&& x) +ProtectedZoneID::ProtectedZoneID( + ProtectedZoneID&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::ProtectedZoneID::operator =( +ProtectedZoneID& ProtectedZoneID::operator =( const ProtectedZoneID& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::ProtectedZoneID& etsi_its_cam_msgs::msg::ProtectedZoneID::operator =( - ProtectedZoneID&& x) +ProtectedZoneID& ProtectedZoneID::operator =( + ProtectedZoneID&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::ProtectedZoneID::operator ==( +bool ProtectedZoneID::operator ==( const ProtectedZoneID& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::ProtectedZoneID::operator !=( +bool ProtectedZoneID::operator !=( const ProtectedZoneID& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ProtectedZoneID::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ProtectedZoneID::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedZoneID& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ProtectedZoneID::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::ProtectedZoneID::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::ProtectedZoneID::value( +void ProtectedZoneID::value( uint32_t _value) { m_value = _value; @@ -146,7 +109,7 @@ void etsi_its_cam_msgs::msg::ProtectedZoneID::value( * @brief This function returns the value of member value * @return Value of member value */ -uint32_t etsi_its_cam_msgs::msg::ProtectedZoneID::value() const +uint32_t ProtectedZoneID::value() const { return m_value; } @@ -155,32 +118,18 @@ uint32_t etsi_its_cam_msgs::msg::ProtectedZoneID::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint32_t& etsi_its_cam_msgs::msg::ProtectedZoneID::value() +uint32_t& ProtectedZoneID::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::ProtectedZoneID::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::ProtectedZoneID::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::ProtectedZoneID::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ProtectedZoneIDCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.h index bd96dee41a8..3f765414fda 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneID.h @@ -16,19 +16,24 @@ * @file ProtectedZoneID.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,173 +47,129 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ProtectedZoneID_SOURCE) -#define ProtectedZoneID_DllAPI __declspec( dllexport ) +#if defined(PROTECTEDZONEID_SOURCE) +#define PROTECTEDZONEID_DllAPI __declspec( dllexport ) #else -#define ProtectedZoneID_DllAPI __declspec( dllimport ) -#endif // ProtectedZoneID_SOURCE +#define PROTECTEDZONEID_DllAPI __declspec( dllimport ) +#endif // PROTECTEDZONEID_SOURCE #else -#define ProtectedZoneID_DllAPI +#define PROTECTEDZONEID_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ProtectedZoneID_DllAPI +#define PROTECTEDZONEID_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace ProtectedZoneID_Constants { - const uint32_t MIN = 0; - const uint32_t MAX = 134217727; - } // namespace ProtectedZoneID_Constants - /*! - * @brief This class represents the structure ProtectedZoneID defined by the user in the IDL file. - * @ingroup PROTECTEDZONEID - */ - class ProtectedZoneID - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ProtectedZoneID(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ProtectedZoneID(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. - */ - eProsima_user_DllExport ProtectedZoneID( - const ProtectedZoneID& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. - */ - eProsima_user_DllExport ProtectedZoneID( - ProtectedZoneID&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. - */ - eProsima_user_DllExport ProtectedZoneID& operator =( - const ProtectedZoneID& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. - */ - eProsima_user_DllExport ProtectedZoneID& operator =( - ProtectedZoneID&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedZoneID object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ProtectedZoneID& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedZoneID object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ProtectedZoneID& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint32_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint32_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint32_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedZoneID& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint32_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace ProtectedZoneID_Constants { + +const uint32_t MIN = 0; +const uint32_t MAX = 134217727; + +} // namespace ProtectedZoneID_Constants + + +/*! + * @brief This class represents the structure ProtectedZoneID defined by the user in the IDL file. + * @ingroup ProtectedZoneID + */ +class ProtectedZoneID +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedZoneID(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedZoneID(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. + */ + eProsima_user_DllExport ProtectedZoneID( + const ProtectedZoneID& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. + */ + eProsima_user_DllExport ProtectedZoneID( + ProtectedZoneID&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. + */ + eProsima_user_DllExport ProtectedZoneID& operator =( + const ProtectedZoneID& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneID that will be copied. + */ + eProsima_user_DllExport ProtectedZoneID& operator =( + ProtectedZoneID&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneID object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedZoneID& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneID object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedZoneID& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint32_t& value(); + +private: + + uint32_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDCdrAux.hpp new file mode 100644 index 00000000000..fa93c6e65b1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDCdrAux.hpp @@ -0,0 +1,55 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneIDCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEIDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEIDCDRAUX_HPP_ + +#include "ProtectedZoneID.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedZoneID_max_cdr_typesize {8UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedZoneID_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneID& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEIDCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDCdrAux.ipp new file mode 100644 index 00000000000..de8bb1a2884 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDCdrAux.ipp @@ -0,0 +1,135 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneIDCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEIDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEIDCDRAUX_IPP_ + +#include "ProtectedZoneIDCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ProtectedZoneID& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ProtectedZoneID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEIDCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.cxx index 34adbbefba3..1ce01804b15 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.cxx @@ -16,166 +16,191 @@ * @file ProtectedZoneIDPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ProtectedZoneIDPubSubTypes.h" +#include "ProtectedZoneIDCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace ProtectedZoneID_Constants { - - - - } //End of namespace ProtectedZoneID_Constants - ProtectedZoneIDPubSubType::ProtectedZoneIDPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneID_"); - auto type_size = ProtectedZoneID::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ProtectedZoneID::isKeyDefined(); - size_t keyLength = ProtectedZoneID::getKeyMaxCdrSerializedSize() > 16 ? - ProtectedZoneID::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ProtectedZoneIDPubSubType::~ProtectedZoneIDPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ProtectedZoneIDPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ProtectedZoneID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ProtectedZoneIDPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ProtectedZoneID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ProtectedZoneIDPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ProtectedZoneIDPubSubType::createData() - { - return reinterpret_cast(new ProtectedZoneID()); - } - - void ProtectedZoneIDPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ProtectedZoneIDPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ProtectedZoneID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ProtectedZoneID::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ProtectedZoneID::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace ProtectedZoneID_Constants { + + + + + +} //End of namespace ProtectedZoneID_Constants + + + +ProtectedZoneIDPubSubType::ProtectedZoneIDPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneID_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ProtectedZoneID::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ProtectedZoneID_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ProtectedZoneIDPubSubType::~ProtectedZoneIDPubSubType() +{ +} + +bool ProtectedZoneIDPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ProtectedZoneID* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ProtectedZoneIDPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ProtectedZoneID* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ProtectedZoneIDPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ProtectedZoneIDPubSubType::createData() +{ + return reinterpret_cast(new ProtectedZoneID()); +} + +void ProtectedZoneIDPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ProtectedZoneIDPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.h index 90766eb715b..bc4deec643c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneIDPubSubTypes.h @@ -16,97 +16,126 @@ * @file ProtectedZoneIDPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ProtectedZoneID.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ProtectedZoneID is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace ProtectedZoneID_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace ProtectedZoneID_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type ProtectedZoneID defined by the user in the IDL file. - * @ingroup PROTECTEDZONEID - */ - class ProtectedZoneIDPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef ProtectedZoneID type; - eProsima_user_DllExport ProtectedZoneIDPubSubType(); +} // namespace ProtectedZoneID_Constants - eProsima_user_DllExport virtual ~ProtectedZoneIDPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type ProtectedZoneID defined by the user in the IDL file. + * @ingroup ProtectedZoneID + */ +class ProtectedZoneIDPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef ProtectedZoneID type; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport ProtectedZoneIDPubSubType(); - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport ~ProtectedZoneIDPubSubType() override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) ProtectedZoneID(); - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport void deleteData( + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONEID_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.cxx index 9323631b461..4d1e0b4c463 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.cxx @@ -14,9 +14,9 @@ /*! * @file ProtectedZoneRadius.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,117 +27,79 @@ char dummy; #endif // _WIN32 #include "ProtectedZoneRadius.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace ProtectedZoneRadius_Constants { + + +} // namespace ProtectedZoneRadius_Constants -etsi_its_cam_msgs::msg::ProtectedZoneRadius::ProtectedZoneRadius() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5d10455d - m_value = 0; +ProtectedZoneRadius::ProtectedZoneRadius() +{ } -etsi_its_cam_msgs::msg::ProtectedZoneRadius::~ProtectedZoneRadius() +ProtectedZoneRadius::~ProtectedZoneRadius() { } -etsi_its_cam_msgs::msg::ProtectedZoneRadius::ProtectedZoneRadius( +ProtectedZoneRadius::ProtectedZoneRadius( const ProtectedZoneRadius& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::ProtectedZoneRadius::ProtectedZoneRadius( - ProtectedZoneRadius&& x) +ProtectedZoneRadius::ProtectedZoneRadius( + ProtectedZoneRadius&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::ProtectedZoneRadius::operator =( +ProtectedZoneRadius& ProtectedZoneRadius::operator =( const ProtectedZoneRadius& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::ProtectedZoneRadius& etsi_its_cam_msgs::msg::ProtectedZoneRadius::operator =( - ProtectedZoneRadius&& x) +ProtectedZoneRadius& ProtectedZoneRadius::operator =( + ProtectedZoneRadius&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::ProtectedZoneRadius::operator ==( +bool ProtectedZoneRadius::operator ==( const ProtectedZoneRadius& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::ProtectedZoneRadius::operator !=( +bool ProtectedZoneRadius::operator !=( const ProtectedZoneRadius& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedZoneRadius& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ProtectedZoneRadius::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::ProtectedZoneRadius::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::ProtectedZoneRadius::value( +void ProtectedZoneRadius::value( uint8_t _value) { m_value = _value; @@ -147,7 +109,7 @@ void etsi_its_cam_msgs::msg::ProtectedZoneRadius::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::value() const +uint8_t ProtectedZoneRadius::value() const { return m_value; } @@ -156,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::ProtectedZoneRadius::value() +uint8_t& ProtectedZoneRadius::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::ProtectedZoneRadius::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::ProtectedZoneRadius::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::ProtectedZoneRadius::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ProtectedZoneRadiusCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.h index d0a2628481b..f46d6d91307 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadius.h @@ -16,19 +16,24 @@ * @file ProtectedZoneRadius.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,174 +47,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ProtectedZoneRadius_SOURCE) -#define ProtectedZoneRadius_DllAPI __declspec( dllexport ) +#if defined(PROTECTEDZONERADIUS_SOURCE) +#define PROTECTEDZONERADIUS_DllAPI __declspec( dllexport ) #else -#define ProtectedZoneRadius_DllAPI __declspec( dllimport ) -#endif // ProtectedZoneRadius_SOURCE +#define PROTECTEDZONERADIUS_DllAPI __declspec( dllimport ) +#endif // PROTECTEDZONERADIUS_SOURCE #else -#define ProtectedZoneRadius_DllAPI +#define PROTECTEDZONERADIUS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ProtectedZoneRadius_DllAPI +#define PROTECTEDZONERADIUS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace ProtectedZoneRadius_Constants { - const uint8_t MIN = 1; - const uint8_t MAX = 255; - const uint8_t ONE_METER = 1; - } // namespace ProtectedZoneRadius_Constants - /*! - * @brief This class represents the structure ProtectedZoneRadius defined by the user in the IDL file. - * @ingroup PROTECTEDZONERADIUS - */ - class ProtectedZoneRadius - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ProtectedZoneRadius(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ProtectedZoneRadius(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. - */ - eProsima_user_DllExport ProtectedZoneRadius( - const ProtectedZoneRadius& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. - */ - eProsima_user_DllExport ProtectedZoneRadius( - ProtectedZoneRadius&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. - */ - eProsima_user_DllExport ProtectedZoneRadius& operator =( - const ProtectedZoneRadius& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. - */ - eProsima_user_DllExport ProtectedZoneRadius& operator =( - ProtectedZoneRadius&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedZoneRadius object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ProtectedZoneRadius& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedZoneRadius object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ProtectedZoneRadius& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedZoneRadius& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace ProtectedZoneRadius_Constants { + +const uint8_t MIN = 1; +const uint8_t MAX = 255; +const uint8_t ONE_METER = 1; + +} // namespace ProtectedZoneRadius_Constants + + +/*! + * @brief This class represents the structure ProtectedZoneRadius defined by the user in the IDL file. + * @ingroup ProtectedZoneRadius + */ +class ProtectedZoneRadius +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedZoneRadius(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedZoneRadius(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. + */ + eProsima_user_DllExport ProtectedZoneRadius( + const ProtectedZoneRadius& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. + */ + eProsima_user_DllExport ProtectedZoneRadius( + ProtectedZoneRadius&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. + */ + eProsima_user_DllExport ProtectedZoneRadius& operator =( + const ProtectedZoneRadius& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneRadius that will be copied. + */ + eProsima_user_DllExport ProtectedZoneRadius& operator =( + ProtectedZoneRadius&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneRadius object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedZoneRadius& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneRadius object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedZoneRadius& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusCdrAux.hpp new file mode 100644 index 00000000000..af5102aad35 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneRadiusCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUSCDRAUX_HPP_ + +#include "ProtectedZoneRadius.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedZoneRadius_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedZoneRadius_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusCdrAux.ipp new file mode 100644 index 00000000000..c14aad6359e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneRadiusCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUSCDRAUX_IPP_ + +#include "ProtectedZoneRadiusCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ProtectedZoneRadius& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneRadius& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.cxx index 47a1fd3168d..24a24094455 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.cxx @@ -16,167 +16,193 @@ * @file ProtectedZoneRadiusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ProtectedZoneRadiusPubSubTypes.h" +#include "ProtectedZoneRadiusCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace ProtectedZoneRadius_Constants { - - - - - } //End of namespace ProtectedZoneRadius_Constants - ProtectedZoneRadiusPubSubType::ProtectedZoneRadiusPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneRadius_"); - auto type_size = ProtectedZoneRadius::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ProtectedZoneRadius::isKeyDefined(); - size_t keyLength = ProtectedZoneRadius::getKeyMaxCdrSerializedSize() > 16 ? - ProtectedZoneRadius::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ProtectedZoneRadiusPubSubType::~ProtectedZoneRadiusPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ProtectedZoneRadiusPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ProtectedZoneRadius* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ProtectedZoneRadiusPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ProtectedZoneRadius* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ProtectedZoneRadiusPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ProtectedZoneRadiusPubSubType::createData() - { - return reinterpret_cast(new ProtectedZoneRadius()); - } - - void ProtectedZoneRadiusPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ProtectedZoneRadiusPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ProtectedZoneRadius* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ProtectedZoneRadius::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ProtectedZoneRadius::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace ProtectedZoneRadius_Constants { + + + + + + + +} //End of namespace ProtectedZoneRadius_Constants + + + +ProtectedZoneRadiusPubSubType::ProtectedZoneRadiusPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneRadius_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ProtectedZoneRadius::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ProtectedZoneRadius_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ProtectedZoneRadiusPubSubType::~ProtectedZoneRadiusPubSubType() +{ +} + +bool ProtectedZoneRadiusPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ProtectedZoneRadius* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ProtectedZoneRadiusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ProtectedZoneRadius* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ProtectedZoneRadiusPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ProtectedZoneRadiusPubSubType::createData() +{ + return reinterpret_cast(new ProtectedZoneRadius()); +} + +void ProtectedZoneRadiusPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ProtectedZoneRadiusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.h index 4fac8e2db05..0d3e9ca57e3 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneRadiusPubSubTypes.h @@ -16,98 +16,128 @@ * @file ProtectedZoneRadiusPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ProtectedZoneRadius.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ProtectedZoneRadius is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace ProtectedZoneRadius_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace ProtectedZoneRadius_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type ProtectedZoneRadius defined by the user in the IDL file. - * @ingroup PROTECTEDZONERADIUS - */ - class ProtectedZoneRadiusPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace ProtectedZoneRadius_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type ProtectedZoneRadius defined by the user in the IDL file. + * @ingroup ProtectedZoneRadius + */ +class ProtectedZoneRadiusPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef ProtectedZoneRadius type; - typedef ProtectedZoneRadius type; + eProsima_user_DllExport ProtectedZoneRadiusPubSubType(); - eProsima_user_DllExport ProtectedZoneRadiusPubSubType(); + eProsima_user_DllExport ~ProtectedZoneRadiusPubSubType() override; - eProsima_user_DllExport virtual ~ProtectedZoneRadiusPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) ProtectedZoneRadius(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONERADIUS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.cxx index 4781e2f54b9..1a3c1ec4fe6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.cxx @@ -14,9 +14,9 @@ /*! * @file ProtectedZoneType.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,116 +27,79 @@ char dummy; #endif // _WIN32 #include "ProtectedZoneType.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { + +namespace ProtectedZoneType_Constants { + + +} // namespace ProtectedZoneType_Constants -etsi_its_cam_msgs::msg::ProtectedZoneType::ProtectedZoneType() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@737edcfa - m_value = 0; +ProtectedZoneType::ProtectedZoneType() +{ } -etsi_its_cam_msgs::msg::ProtectedZoneType::~ProtectedZoneType() +ProtectedZoneType::~ProtectedZoneType() { } -etsi_its_cam_msgs::msg::ProtectedZoneType::ProtectedZoneType( +ProtectedZoneType::ProtectedZoneType( const ProtectedZoneType& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::ProtectedZoneType::ProtectedZoneType( - ProtectedZoneType&& x) +ProtectedZoneType::ProtectedZoneType( + ProtectedZoneType&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::ProtectedZoneType::operator =( +ProtectedZoneType& ProtectedZoneType::operator =( const ProtectedZoneType& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::ProtectedZoneType& etsi_its_cam_msgs::msg::ProtectedZoneType::operator =( - ProtectedZoneType&& x) +ProtectedZoneType& ProtectedZoneType::operator =( + ProtectedZoneType&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::ProtectedZoneType::operator ==( +bool ProtectedZoneType::operator ==( const ProtectedZoneType& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::ProtectedZoneType::operator !=( +bool ProtectedZoneType::operator !=( const ProtectedZoneType& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ProtectedZoneType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ProtectedZoneType::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedZoneType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ProtectedZoneType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::ProtectedZoneType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::ProtectedZoneType::value( +void ProtectedZoneType::value( uint8_t _value) { m_value = _value; @@ -146,7 +109,7 @@ void etsi_its_cam_msgs::msg::ProtectedZoneType::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::ProtectedZoneType::value() const +uint8_t ProtectedZoneType::value() const { return m_value; } @@ -155,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::ProtectedZoneType::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::ProtectedZoneType::value() +uint8_t& ProtectedZoneType::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::ProtectedZoneType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::ProtectedZoneType::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::ProtectedZoneType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ProtectedZoneTypeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.h index dd9651a4c8c..da8f20741e0 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneType.h @@ -16,19 +16,24 @@ * @file ProtectedZoneType.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,173 +47,129 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ProtectedZoneType_SOURCE) -#define ProtectedZoneType_DllAPI __declspec( dllexport ) +#if defined(PROTECTEDZONETYPE_SOURCE) +#define PROTECTEDZONETYPE_DllAPI __declspec( dllexport ) #else -#define ProtectedZoneType_DllAPI __declspec( dllimport ) -#endif // ProtectedZoneType_SOURCE +#define PROTECTEDZONETYPE_DllAPI __declspec( dllimport ) +#endif // PROTECTEDZONETYPE_SOURCE #else -#define ProtectedZoneType_DllAPI +#define PROTECTEDZONETYPE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ProtectedZoneType_DllAPI +#define PROTECTEDZONETYPE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace ProtectedZoneType_Constants { - const uint8_t PERMANENT_CEN_DSRC_TOLLING = 0; - const uint8_t TEMPORARY_CEN_DSRC_TOLLING = 1; - } // namespace ProtectedZoneType_Constants - /*! - * @brief This class represents the structure ProtectedZoneType defined by the user in the IDL file. - * @ingroup PROTECTEDZONETYPE - */ - class ProtectedZoneType - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ProtectedZoneType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ProtectedZoneType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. - */ - eProsima_user_DllExport ProtectedZoneType( - const ProtectedZoneType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. - */ - eProsima_user_DllExport ProtectedZoneType( - ProtectedZoneType&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. - */ - eProsima_user_DllExport ProtectedZoneType& operator =( - const ProtectedZoneType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. - */ - eProsima_user_DllExport ProtectedZoneType& operator =( - ProtectedZoneType&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedZoneType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ProtectedZoneType& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ProtectedZoneType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ProtectedZoneType& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ProtectedZoneType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace ProtectedZoneType_Constants { + +const uint8_t PERMANENT_CEN_DSRC_TOLLING = 0; +const uint8_t TEMPORARY_CEN_DSRC_TOLLING = 1; + +} // namespace ProtectedZoneType_Constants + + +/*! + * @brief This class represents the structure ProtectedZoneType defined by the user in the IDL file. + * @ingroup ProtectedZoneType + */ +class ProtectedZoneType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ProtectedZoneType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ProtectedZoneType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. + */ + eProsima_user_DllExport ProtectedZoneType( + const ProtectedZoneType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. + */ + eProsima_user_DllExport ProtectedZoneType( + ProtectedZoneType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. + */ + eProsima_user_DllExport ProtectedZoneType& operator =( + const ProtectedZoneType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ProtectedZoneType that will be copied. + */ + eProsima_user_DllExport ProtectedZoneType& operator =( + ProtectedZoneType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ProtectedZoneType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ProtectedZoneType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ProtectedZoneType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypeCdrAux.hpp new file mode 100644 index 00000000000..b81272d8efe --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypeCdrAux.hpp @@ -0,0 +1,55 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneTypeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPECDRAUX_HPP_ + +#include "ProtectedZoneType.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedZoneType_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ProtectedZoneType_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneType& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypeCdrAux.ipp new file mode 100644 index 00000000000..65a10f17490 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypeCdrAux.ipp @@ -0,0 +1,135 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ProtectedZoneTypeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPECDRAUX_IPP_ + +#include "ProtectedZoneTypeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ProtectedZoneType& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ProtectedZoneType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ProtectedZoneType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.cxx index 4d699d8e58c..9b3bcacd37d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.cxx @@ -16,166 +16,191 @@ * @file ProtectedZoneTypePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ProtectedZoneTypePubSubTypes.h" +#include "ProtectedZoneTypeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace ProtectedZoneType_Constants { - - - - } //End of namespace ProtectedZoneType_Constants - ProtectedZoneTypePubSubType::ProtectedZoneTypePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneType_"); - auto type_size = ProtectedZoneType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ProtectedZoneType::isKeyDefined(); - size_t keyLength = ProtectedZoneType::getKeyMaxCdrSerializedSize() > 16 ? - ProtectedZoneType::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ProtectedZoneTypePubSubType::~ProtectedZoneTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ProtectedZoneTypePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ProtectedZoneType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ProtectedZoneTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ProtectedZoneType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ProtectedZoneTypePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ProtectedZoneTypePubSubType::createData() - { - return reinterpret_cast(new ProtectedZoneType()); - } - - void ProtectedZoneTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ProtectedZoneTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ProtectedZoneType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ProtectedZoneType::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ProtectedZoneType::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace ProtectedZoneType_Constants { + + + + + +} //End of namespace ProtectedZoneType_Constants + + + +ProtectedZoneTypePubSubType::ProtectedZoneTypePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ProtectedZoneType_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ProtectedZoneType::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ProtectedZoneType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ProtectedZoneTypePubSubType::~ProtectedZoneTypePubSubType() +{ +} + +bool ProtectedZoneTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ProtectedZoneType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ProtectedZoneTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ProtectedZoneType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ProtectedZoneTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ProtectedZoneTypePubSubType::createData() +{ + return reinterpret_cast(new ProtectedZoneType()); +} + +void ProtectedZoneTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ProtectedZoneTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.h index 51a1dfa6fc9..05406f3877d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ProtectedZoneTypePubSubTypes.h @@ -16,97 +16,126 @@ * @file ProtectedZoneTypePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ProtectedZoneType.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ProtectedZoneType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace ProtectedZoneType_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace ProtectedZoneType_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type ProtectedZoneType defined by the user in the IDL file. - * @ingroup PROTECTEDZONETYPE - */ - class ProtectedZoneTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef ProtectedZoneType type; - eProsima_user_DllExport ProtectedZoneTypePubSubType(); +} // namespace ProtectedZoneType_Constants - eProsima_user_DllExport virtual ~ProtectedZoneTypePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type ProtectedZoneType defined by the user in the IDL file. + * @ingroup ProtectedZoneType + */ +class ProtectedZoneTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef ProtectedZoneType type; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport ProtectedZoneTypePubSubType(); - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport ~ProtectedZoneTypePubSubType() override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) ProtectedZoneType(); - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport void deleteData( + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PROTECTEDZONETYPE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.cxx index bc7179b20a9..13f6f208291 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.cxx @@ -14,9 +14,9 @@ /*! * @file PtActivation.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "PtActivation.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::PtActivation::PtActivation() -{ - // m_pt_activation_type com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4a9cc6cb - // m_pt_activation_data com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5990e6c5 +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::PtActivation::~PtActivation() +PtActivation::PtActivation() { +} +PtActivation::~PtActivation() +{ } -etsi_its_cam_msgs::msg::PtActivation::PtActivation( +PtActivation::PtActivation( const PtActivation& x) { m_pt_activation_type = x.m_pt_activation_type; m_pt_activation_data = x.m_pt_activation_data; } -etsi_its_cam_msgs::msg::PtActivation::PtActivation( - PtActivation&& x) +PtActivation::PtActivation( + PtActivation&& x) noexcept { m_pt_activation_type = std::move(x.m_pt_activation_type); m_pt_activation_data = std::move(x.m_pt_activation_data); } -etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PtActivation::operator =( +PtActivation& PtActivation::operator =( const PtActivation& x) { m_pt_activation_type = x.m_pt_activation_type; m_pt_activation_data = x.m_pt_activation_data; - return *this; } -etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PtActivation::operator =( - PtActivation&& x) +PtActivation& PtActivation::operator =( + PtActivation&& x) noexcept { m_pt_activation_type = std::move(x.m_pt_activation_type); m_pt_activation_data = std::move(x.m_pt_activation_data); - return *this; } -bool etsi_its_cam_msgs::msg::PtActivation::operator ==( +bool PtActivation::operator ==( const PtActivation& x) const { - - return (m_pt_activation_type == x.m_pt_activation_type && m_pt_activation_data == x.m_pt_activation_data); + return (m_pt_activation_type == x.m_pt_activation_type && + m_pt_activation_data == x.m_pt_activation_data); } -bool etsi_its_cam_msgs::msg::PtActivation::operator !=( +bool PtActivation::operator !=( const PtActivation& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PtActivation::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::PtActivationType::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PtActivationData::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PtActivation::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PtActivation& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::PtActivationType::getCdrSerializedSize(data.pt_activation_type(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PtActivationData::getCdrSerializedSize(data.pt_activation_data(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PtActivation::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_pt_activation_type; - scdr << m_pt_activation_data; - -} - -void etsi_its_cam_msgs::msg::PtActivation::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_pt_activation_type; - dcdr >> m_pt_activation_data; -} - /*! * @brief This function copies the value in member pt_activation_type * @param _pt_activation_type New value to be copied in member pt_activation_type */ -void etsi_its_cam_msgs::msg::PtActivation::pt_activation_type( +void PtActivation::pt_activation_type( const etsi_its_cam_msgs::msg::PtActivationType& _pt_activation_type) { m_pt_activation_type = _pt_activation_type; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::PtActivation::pt_activation_type( * @brief This function moves the value in member pt_activation_type * @param _pt_activation_type New value to be moved in member pt_activation_type */ -void etsi_its_cam_msgs::msg::PtActivation::pt_activation_type( +void PtActivation::pt_activation_type( etsi_its_cam_msgs::msg::PtActivationType&& _pt_activation_type) { m_pt_activation_type = std::move(_pt_activation_type); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::PtActivation::pt_activation_type( * @brief This function returns a constant reference to member pt_activation_type * @return Constant reference to member pt_activation_type */ -const etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActivation::pt_activation_type() const +const etsi_its_cam_msgs::msg::PtActivationType& PtActivation::pt_activation_type() const { return m_pt_activation_type; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActiva * @brief This function returns a reference to member pt_activation_type * @return Reference to member pt_activation_type */ -etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActivation::pt_activation_type() +etsi_its_cam_msgs::msg::PtActivationType& PtActivation::pt_activation_type() { return m_pt_activation_type; } + + /*! * @brief This function copies the value in member pt_activation_data * @param _pt_activation_data New value to be copied in member pt_activation_data */ -void etsi_its_cam_msgs::msg::PtActivation::pt_activation_data( +void PtActivation::pt_activation_data( const etsi_its_cam_msgs::msg::PtActivationData& _pt_activation_data) { m_pt_activation_data = _pt_activation_data; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::PtActivation::pt_activation_data( * @brief This function moves the value in member pt_activation_data * @param _pt_activation_data New value to be moved in member pt_activation_data */ -void etsi_its_cam_msgs::msg::PtActivation::pt_activation_data( +void PtActivation::pt_activation_data( etsi_its_cam_msgs::msg::PtActivationData&& _pt_activation_data) { m_pt_activation_data = std::move(_pt_activation_data); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::PtActivation::pt_activation_data( * @brief This function returns a constant reference to member pt_activation_data * @return Constant reference to member pt_activation_data */ -const etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActivation::pt_activation_data() const +const etsi_its_cam_msgs::msg::PtActivationData& PtActivation::pt_activation_data() const { return m_pt_activation_data; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActiva * @brief This function returns a reference to member pt_activation_data * @return Reference to member pt_activation_data */ -etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActivation::pt_activation_data() +etsi_its_cam_msgs::msg::PtActivationData& PtActivation::pt_activation_data() { return m_pt_activation_data; } -size_t etsi_its_cam_msgs::msg::PtActivation::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::PtActivation::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::PtActivation::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PtActivationCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.h index fc2c86d68bd..3682890dc18 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivation.h @@ -16,21 +16,26 @@ * @file PtActivation.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_H_ -#include "PtActivationData.h" -#include "PtActivationType.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "PtActivationData.h" +#include "PtActivationType.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PtActivation_SOURCE) -#define PtActivation_DllAPI __declspec( dllexport ) +#if defined(PTACTIVATION_SOURCE) +#define PTACTIVATION_DllAPI __declspec( dllexport ) #else -#define PtActivation_DllAPI __declspec( dllimport ) -#endif // PtActivation_SOURCE +#define PTACTIVATION_DllAPI __declspec( dllimport ) +#endif // PTACTIVATION_SOURCE #else -#define PtActivation_DllAPI +#define PTACTIVATION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PtActivation_DllAPI +#define PTACTIVATION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure PtActivation defined by the user in the IDL file. - * @ingroup PTACTIVATION - */ - class PtActivation - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PtActivation(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PtActivation(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. - */ - eProsima_user_DllExport PtActivation( - const PtActivation& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. - */ - eProsima_user_DllExport PtActivation( - PtActivation&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. - */ - eProsima_user_DllExport PtActivation& operator =( - const PtActivation& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. - */ - eProsima_user_DllExport PtActivation& operator =( - PtActivation&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PtActivation object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PtActivation& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PtActivation object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PtActivation& x) const; - - /*! - * @brief This function copies the value in member pt_activation_type - * @param _pt_activation_type New value to be copied in member pt_activation_type - */ - eProsima_user_DllExport void pt_activation_type( - const etsi_its_cam_msgs::msg::PtActivationType& _pt_activation_type); - - /*! - * @brief This function moves the value in member pt_activation_type - * @param _pt_activation_type New value to be moved in member pt_activation_type - */ - eProsima_user_DllExport void pt_activation_type( - etsi_its_cam_msgs::msg::PtActivationType&& _pt_activation_type); - - /*! - * @brief This function returns a constant reference to member pt_activation_type - * @return Constant reference to member pt_activation_type - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivationType& pt_activation_type() const; - - /*! - * @brief This function returns a reference to member pt_activation_type - * @return Reference to member pt_activation_type - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivationType& pt_activation_type(); - /*! - * @brief This function copies the value in member pt_activation_data - * @param _pt_activation_data New value to be copied in member pt_activation_data - */ - eProsima_user_DllExport void pt_activation_data( - const etsi_its_cam_msgs::msg::PtActivationData& _pt_activation_data); - - /*! - * @brief This function moves the value in member pt_activation_data - * @param _pt_activation_data New value to be moved in member pt_activation_data - */ - eProsima_user_DllExport void pt_activation_data( - etsi_its_cam_msgs::msg::PtActivationData&& _pt_activation_data); - - /*! - * @brief This function returns a constant reference to member pt_activation_data - * @return Constant reference to member pt_activation_data - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivationData& pt_activation_data() const; - - /*! - * @brief This function returns a reference to member pt_activation_data - * @return Reference to member pt_activation_data - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivationData& pt_activation_data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PtActivation& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::PtActivationType m_pt_activation_type; - etsi_its_cam_msgs::msg::PtActivationData m_pt_activation_data; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure PtActivation defined by the user in the IDL file. + * @ingroup PtActivation + */ +class PtActivation +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PtActivation(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PtActivation(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. + */ + eProsima_user_DllExport PtActivation( + const PtActivation& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. + */ + eProsima_user_DllExport PtActivation( + PtActivation&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. + */ + eProsima_user_DllExport PtActivation& operator =( + const PtActivation& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivation that will be copied. + */ + eProsima_user_DllExport PtActivation& operator =( + PtActivation&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivation object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PtActivation& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivation object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PtActivation& x) const; + + /*! + * @brief This function copies the value in member pt_activation_type + * @param _pt_activation_type New value to be copied in member pt_activation_type + */ + eProsima_user_DllExport void pt_activation_type( + const etsi_its_cam_msgs::msg::PtActivationType& _pt_activation_type); + + /*! + * @brief This function moves the value in member pt_activation_type + * @param _pt_activation_type New value to be moved in member pt_activation_type + */ + eProsima_user_DllExport void pt_activation_type( + etsi_its_cam_msgs::msg::PtActivationType&& _pt_activation_type); + + /*! + * @brief This function returns a constant reference to member pt_activation_type + * @return Constant reference to member pt_activation_type + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivationType& pt_activation_type() const; + + /*! + * @brief This function returns a reference to member pt_activation_type + * @return Reference to member pt_activation_type + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivationType& pt_activation_type(); + + + /*! + * @brief This function copies the value in member pt_activation_data + * @param _pt_activation_data New value to be copied in member pt_activation_data + */ + eProsima_user_DllExport void pt_activation_data( + const etsi_its_cam_msgs::msg::PtActivationData& _pt_activation_data); + + /*! + * @brief This function moves the value in member pt_activation_data + * @param _pt_activation_data New value to be moved in member pt_activation_data + */ + eProsima_user_DllExport void pt_activation_data( + etsi_its_cam_msgs::msg::PtActivationData&& _pt_activation_data); + + /*! + * @brief This function returns a constant reference to member pt_activation_data + * @return Constant reference to member pt_activation_data + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivationData& pt_activation_data() const; + + /*! + * @brief This function returns a reference to member pt_activation_data + * @return Reference to member pt_activation_data + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivationData& pt_activation_data(); + +private: + + etsi_its_cam_msgs::msg::PtActivationType m_pt_activation_type; + etsi_its_cam_msgs::msg::PtActivationData m_pt_activation_data; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationCdrAux.hpp new file mode 100644 index 00000000000..47cbee0bbae --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONCDRAUX_HPP_ + +#include "PtActivation.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PtActivation_max_cdr_typesize {120UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PtActivation_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivation& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationCdrAux.ipp new file mode 100644 index 00000000000..69887d0f509 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONCDRAUX_IPP_ + +#include "PtActivationCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PtActivation& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.pt_activation_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.pt_activation_data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivation& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.pt_activation_type() + << eprosima::fastcdr::MemberId(1) << data.pt_activation_data() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PtActivation& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.pt_activation_type(); + break; + + case 1: + dcdr >> data.pt_activation_data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivation& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.cxx index aec6eb962a6..7e4530b7531 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.cxx @@ -14,9 +14,9 @@ /*! * @file PtActivationData.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,123 +27,81 @@ char dummy; #endif // _WIN32 #include "PtActivationData.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { + +namespace PtActivationData_Constants { + + +} // namespace PtActivationData_Constants -etsi_its_cam_msgs::msg::PtActivationData::PtActivationData() -{ - // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@19b30c92 + +PtActivationData::PtActivationData() +{ } -etsi_its_cam_msgs::msg::PtActivationData::~PtActivationData() +PtActivationData::~PtActivationData() { } -etsi_its_cam_msgs::msg::PtActivationData::PtActivationData( +PtActivationData::PtActivationData( const PtActivationData& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::PtActivationData::PtActivationData( - PtActivationData&& x) +PtActivationData::PtActivationData( + PtActivationData&& x) noexcept { m_value = std::move(x.m_value); } -etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActivationData::operator =( +PtActivationData& PtActivationData::operator =( const PtActivationData& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::PtActivationData& etsi_its_cam_msgs::msg::PtActivationData::operator =( - PtActivationData&& x) +PtActivationData& PtActivationData::operator =( + PtActivationData&& x) noexcept { m_value = std::move(x.m_value); - return *this; } -bool etsi_its_cam_msgs::msg::PtActivationData::operator ==( +bool PtActivationData::operator ==( const PtActivationData& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::PtActivationData::operator !=( +bool PtActivationData::operator !=( const PtActivationData& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PtActivationData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PtActivationData::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PtActivationData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.value().size() > 0) - { - current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PtActivationData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; -} - -void etsi_its_cam_msgs::msg::PtActivationData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value;} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void etsi_its_cam_msgs::msg::PtActivationData::value( +void PtActivationData::value( const std::vector& _value) { m_value = _value; @@ -153,7 +111,7 @@ void etsi_its_cam_msgs::msg::PtActivationData::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void etsi_its_cam_msgs::msg::PtActivationData::value( +void PtActivationData::value( std::vector&& _value) { m_value = std::move(_value); @@ -163,7 +121,7 @@ void etsi_its_cam_msgs::msg::PtActivationData::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::vector& etsi_its_cam_msgs::msg::PtActivationData::value() const +const std::vector& PtActivationData::value() const { return m_value; } @@ -172,31 +130,18 @@ const std::vector& etsi_its_cam_msgs::msg::PtActivationData::value() co * @brief This function returns a reference to member value * @return Reference to member value */ -std::vector& etsi_its_cam_msgs::msg::PtActivationData::value() +std::vector& PtActivationData::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::PtActivationData::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::PtActivationData::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::PtActivationData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PtActivationDataCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.h index a5937220f4f..902c7e6b961 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationData.h @@ -16,19 +16,24 @@ * @file PtActivationData.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,179 +47,138 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PtActivationData_SOURCE) -#define PtActivationData_DllAPI __declspec( dllexport ) +#if defined(PTACTIVATIONDATA_SOURCE) +#define PTACTIVATIONDATA_DllAPI __declspec( dllexport ) #else -#define PtActivationData_DllAPI __declspec( dllimport ) -#endif // PtActivationData_SOURCE +#define PTACTIVATIONDATA_DllAPI __declspec( dllimport ) +#endif // PTACTIVATIONDATA_SOURCE #else -#define PtActivationData_DllAPI +#define PTACTIVATIONDATA_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PtActivationData_DllAPI +#define PTACTIVATIONDATA_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace PtActivationData_Constants { - const uint8_t MIN_SIZE = 1; - const uint8_t MAX_SIZE = 20; - } // namespace PtActivationData_Constants - /*! - * @brief This class represents the structure PtActivationData defined by the user in the IDL file. - * @ingroup PTACTIVATIONDATA - */ - class PtActivationData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PtActivationData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PtActivationData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. - */ - eProsima_user_DllExport PtActivationData( - const PtActivationData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. - */ - eProsima_user_DllExport PtActivationData( - PtActivationData&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. - */ - eProsima_user_DllExport PtActivationData& operator =( - const PtActivationData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. - */ - eProsima_user_DllExport PtActivationData& operator =( - PtActivationData&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PtActivationData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PtActivationData& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PtActivationData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PtActivationData& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::vector& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::vector&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::vector& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::vector& value(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PtActivationData& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_value; - }; - } // namespace msg + +namespace msg { + +namespace PtActivationData_Constants { + +const uint8_t MIN_SIZE = 1; +const uint8_t MAX_SIZE = 20; + +} // namespace PtActivationData_Constants + + + + +/*! + * @brief This class represents the structure PtActivationData defined by the user in the IDL file. + * @ingroup PtActivationData + */ +class PtActivationData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PtActivationData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PtActivationData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. + */ + eProsima_user_DllExport PtActivationData( + const PtActivationData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. + */ + eProsima_user_DllExport PtActivationData( + PtActivationData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. + */ + eProsima_user_DllExport PtActivationData& operator =( + const PtActivationData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationData that will be copied. + */ + eProsima_user_DllExport PtActivationData& operator =( + PtActivationData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivationData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PtActivationData& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivationData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PtActivationData& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + +private: + + std::vector m_value; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataCdrAux.hpp new file mode 100644 index 00000000000..44fbe91c61e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationDataCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATACDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATACDRAUX_HPP_ + +#include "PtActivationData.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PtActivationData_max_cdr_typesize {108UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PtActivationData_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivationData& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATACDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataCdrAux.ipp new file mode 100644 index 00000000000..c3470fbf078 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationDataCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATACDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATACDRAUX_IPP_ + +#include "PtActivationDataCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PtActivationData& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivationData& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PtActivationData& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivationData& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATACDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.cxx index 3c4e779ca23..4fe14a6bb1e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.cxx @@ -16,166 +16,193 @@ * @file PtActivationDataPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PtActivationDataPubSubTypes.h" +#include "PtActivationDataCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace PtActivationData_Constants { - - - - } //End of namespace PtActivationData_Constants - PtActivationDataPubSubType::PtActivationDataPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PtActivationData_"); - auto type_size = PtActivationData::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PtActivationData::isKeyDefined(); - size_t keyLength = PtActivationData::getKeyMaxCdrSerializedSize() > 16 ? - PtActivationData::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PtActivationDataPubSubType::~PtActivationDataPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PtActivationDataPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PtActivationData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PtActivationDataPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PtActivationData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PtActivationDataPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PtActivationDataPubSubType::createData() - { - return reinterpret_cast(new PtActivationData()); - } - - void PtActivationDataPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PtActivationDataPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PtActivationData* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PtActivationData::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PtActivationData::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace PtActivationData_Constants { + + + + + +} //End of namespace PtActivationData_Constants + + + + + +PtActivationDataPubSubType::PtActivationDataPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PtActivationData_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PtActivationData::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PtActivationData_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PtActivationDataPubSubType::~PtActivationDataPubSubType() +{ +} + +bool PtActivationDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PtActivationData* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PtActivationDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PtActivationData* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PtActivationDataPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PtActivationDataPubSubType::createData() +{ + return reinterpret_cast(new PtActivationData()); +} + +void PtActivationDataPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PtActivationDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.h index d45d9f58488..51f15c6b67f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationDataPubSubTypes.h @@ -16,97 +16,128 @@ * @file PtActivationDataPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PtActivationData.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PtActivationData is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace PtActivationData_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace PtActivationData_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type PtActivationData defined by the user in the IDL file. - * @ingroup PTACTIVATIONDATA - */ - class PtActivationDataPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef PtActivationData type; - eProsima_user_DllExport PtActivationDataPubSubType(); +} // namespace PtActivationData_Constants - eProsima_user_DllExport virtual ~PtActivationDataPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +/*! + * @brief This class represents the TopicDataType of the type PtActivationData defined by the user in the IDL file. + * @ingroup PtActivationData + */ +class PtActivationDataPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport virtual void* createData() override; + typedef PtActivationData type; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport PtActivationDataPubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport ~PtActivationDataPubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONDATA_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.cxx index f06978dd58a..6dfa7bc49fd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file PtActivationPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PtActivationPubSubTypes.h" +#include "PtActivationCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - PtActivationPubSubType::PtActivationPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PtActivation_"); - auto type_size = PtActivation::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PtActivation::isKeyDefined(); - size_t keyLength = PtActivation::getKeyMaxCdrSerializedSize() > 16 ? - PtActivation::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PtActivationPubSubType::~PtActivationPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PtActivationPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PtActivation* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PtActivationPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PtActivation* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PtActivationPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PtActivationPubSubType::createData() - { - return reinterpret_cast(new PtActivation()); - } - - void PtActivationPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PtActivationPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PtActivation* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PtActivation::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PtActivation::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +PtActivationPubSubType::PtActivationPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PtActivation_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PtActivation::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PtActivation_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PtActivationPubSubType::~PtActivationPubSubType() +{ +} + +bool PtActivationPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PtActivation* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PtActivationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PtActivation* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PtActivationPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PtActivationPubSubType::createData() +{ + return reinterpret_cast(new PtActivation()); +} + +void PtActivationPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PtActivationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.h index fd5b438c09c..873a6da4568 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationPubSubTypes.h @@ -16,92 +16,122 @@ * @file PtActivationPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PtActivation.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "PtActivationDataPubSubTypes.h" +#include "PtActivationTypePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PtActivation is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type PtActivation defined by the user in the IDL file. + * @ingroup PtActivation + */ +class PtActivationPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type PtActivation defined by the user in the IDL file. - * @ingroup PTACTIVATION - */ - class PtActivationPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef PtActivation type; + typedef PtActivation type; - eProsima_user_DllExport PtActivationPubSubType(); + eProsima_user_DllExport PtActivationPubSubType(); - eProsima_user_DllExport virtual ~PtActivationPubSubType(); + eProsima_user_DllExport ~PtActivationPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.cxx index cc5fbc605a2..d7c92466c73 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.cxx @@ -14,9 +14,9 @@ /*! * @file PtActivationType.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "PtActivationType.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace PtActivationType_Constants { +} // namespace PtActivationType_Constants -etsi_its_cam_msgs::msg::PtActivationType::PtActivationType() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@782a4fff - m_value = 0; +PtActivationType::PtActivationType() +{ } -etsi_its_cam_msgs::msg::PtActivationType::~PtActivationType() +PtActivationType::~PtActivationType() { } -etsi_its_cam_msgs::msg::PtActivationType::PtActivationType( +PtActivationType::PtActivationType( const PtActivationType& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::PtActivationType::PtActivationType( - PtActivationType&& x) +PtActivationType::PtActivationType( + PtActivationType&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActivationType::operator =( +PtActivationType& PtActivationType::operator =( const PtActivationType& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::PtActivationType& etsi_its_cam_msgs::msg::PtActivationType::operator =( - PtActivationType&& x) +PtActivationType& PtActivationType::operator =( + PtActivationType&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::PtActivationType::operator ==( +bool PtActivationType::operator ==( const PtActivationType& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::PtActivationType::operator !=( +bool PtActivationType::operator !=( const PtActivationType& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PtActivationType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PtActivationType::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PtActivationType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PtActivationType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::PtActivationType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::PtActivationType::value( +void PtActivationType::value( uint8_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::PtActivationType::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::PtActivationType::value() const +uint8_t PtActivationType::value() const { return m_value; } @@ -158,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::PtActivationType::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::PtActivationType::value() +uint8_t& PtActivationType::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::PtActivationType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::PtActivationType::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::PtActivationType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PtActivationTypeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.h index 12a1b678381..f5af3a7cdd6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationType.h @@ -16,19 +16,24 @@ * @file PtActivationType.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PtActivationType_SOURCE) -#define PtActivationType_DllAPI __declspec( dllexport ) +#if defined(PTACTIVATIONTYPE_SOURCE) +#define PTACTIVATIONTYPE_DllAPI __declspec( dllexport ) #else -#define PtActivationType_DllAPI __declspec( dllimport ) -#endif // PtActivationType_SOURCE +#define PTACTIVATIONTYPE_DllAPI __declspec( dllimport ) +#endif // PTACTIVATIONTYPE_SOURCE #else -#define PtActivationType_DllAPI +#define PTACTIVATIONTYPE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PtActivationType_DllAPI +#define PTACTIVATIONTYPE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace PtActivationType_Constants { - const uint8_t MIN = 0; - const uint8_t MAX = 255; - const uint8_t UNDEFINED_CODING_TYPE = 0; - const uint8_t R_09_16_CODING_TYPE = 1; - const uint8_t VDV_50149_CODING_TYPE = 2; - } // namespace PtActivationType_Constants - /*! - * @brief This class represents the structure PtActivationType defined by the user in the IDL file. - * @ingroup PTACTIVATIONTYPE - */ - class PtActivationType - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PtActivationType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PtActivationType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. - */ - eProsima_user_DllExport PtActivationType( - const PtActivationType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. - */ - eProsima_user_DllExport PtActivationType( - PtActivationType&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. - */ - eProsima_user_DllExport PtActivationType& operator =( - const PtActivationType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. - */ - eProsima_user_DllExport PtActivationType& operator =( - PtActivationType&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PtActivationType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PtActivationType& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PtActivationType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PtActivationType& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PtActivationType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace PtActivationType_Constants { + +const uint8_t MIN = 0; +const uint8_t MAX = 255; +const uint8_t UNDEFINED_CODING_TYPE = 0; +const uint8_t R09_16_CODING_TYPE = 1; +const uint8_t VDV_50149_CODING_TYPE = 2; + +} // namespace PtActivationType_Constants + + +/*! + * @brief This class represents the structure PtActivationType defined by the user in the IDL file. + * @ingroup PtActivationType + */ +class PtActivationType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PtActivationType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PtActivationType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. + */ + eProsima_user_DllExport PtActivationType( + const PtActivationType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. + */ + eProsima_user_DllExport PtActivationType( + PtActivationType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. + */ + eProsima_user_DllExport PtActivationType& operator =( + const PtActivationType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PtActivationType that will be copied. + */ + eProsima_user_DllExport PtActivationType& operator =( + PtActivationType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivationType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PtActivationType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PtActivationType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PtActivationType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypeCdrAux.hpp new file mode 100644 index 00000000000..574a08b7c81 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypeCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationTypeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPECDRAUX_HPP_ + +#include "PtActivationType.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PtActivationType_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PtActivationType_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivationType& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypeCdrAux.ipp new file mode 100644 index 00000000000..a04973f1659 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypeCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PtActivationTypeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPECDRAUX_IPP_ + +#include "PtActivationTypeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PtActivationType& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivationType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PtActivationType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PtActivationType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.cxx index 305a799c602..c5d05257033 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file PtActivationTypePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PtActivationTypePubSubTypes.h" +#include "PtActivationTypeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace PtActivationType_Constants { - - - - - - - } //End of namespace PtActivationType_Constants - PtActivationTypePubSubType::PtActivationTypePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PtActivationType_"); - auto type_size = PtActivationType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PtActivationType::isKeyDefined(); - size_t keyLength = PtActivationType::getKeyMaxCdrSerializedSize() > 16 ? - PtActivationType::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PtActivationTypePubSubType::~PtActivationTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PtActivationTypePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PtActivationType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PtActivationTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PtActivationType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PtActivationTypePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PtActivationTypePubSubType::createData() - { - return reinterpret_cast(new PtActivationType()); - } - - void PtActivationTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PtActivationTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PtActivationType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PtActivationType::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PtActivationType::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace PtActivationType_Constants { + + + + + + + + + + + +} //End of namespace PtActivationType_Constants + + + +PtActivationTypePubSubType::PtActivationTypePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PtActivationType_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PtActivationType::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PtActivationType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PtActivationTypePubSubType::~PtActivationTypePubSubType() +{ +} + +bool PtActivationTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PtActivationType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PtActivationTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PtActivationType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PtActivationTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PtActivationTypePubSubType::createData() +{ + return reinterpret_cast(new PtActivationType()); +} + +void PtActivationTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PtActivationTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.h index 595fd47df88..21136ec00fb 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PtActivationTypePubSubTypes.h @@ -16,100 +16,132 @@ * @file PtActivationTypePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PtActivationType.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PtActivationType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace PtActivationType_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace PtActivationType_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type PtActivationType defined by the user in the IDL file. - * @ingroup PTACTIVATIONTYPE - */ - class PtActivationTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef PtActivationType type; +} // namespace PtActivationType_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type PtActivationType defined by the user in the IDL file. + * @ingroup PtActivationType + */ +class PtActivationTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PtActivationType type; + + eProsima_user_DllExport PtActivationTypePubSubType(); - eProsima_user_DllExport PtActivationTypePubSubType(); + eProsima_user_DllExport ~PtActivationTypePubSubType() override; - eProsima_user_DllExport virtual ~PtActivationTypePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PtActivationType(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PTACTIVATIONTYPE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.cxx index 8c39b46f55d..a970a4d70d2 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.cxx @@ -14,9 +14,9 @@ /*! * @file PublicTransportContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "PublicTransportContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::PublicTransportContainer::PublicTransportContainer() -{ - // m_embarkation_status com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@b91d8c4 - // m_pt_activation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4b6166aa +namespace etsi_its_cam_msgs { - // m_pt_activation_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@a77614d - m_pt_activation_is_present = false; +namespace msg { -} -etsi_its_cam_msgs::msg::PublicTransportContainer::~PublicTransportContainer() -{ +PublicTransportContainer::PublicTransportContainer() +{ +} +PublicTransportContainer::~PublicTransportContainer() +{ } -etsi_its_cam_msgs::msg::PublicTransportContainer::PublicTransportContainer( +PublicTransportContainer::PublicTransportContainer( const PublicTransportContainer& x) { m_embarkation_status = x.m_embarkation_status; @@ -59,105 +59,53 @@ etsi_its_cam_msgs::msg::PublicTransportContainer::PublicTransportContainer( m_pt_activation_is_present = x.m_pt_activation_is_present; } -etsi_its_cam_msgs::msg::PublicTransportContainer::PublicTransportContainer( - PublicTransportContainer&& x) +PublicTransportContainer::PublicTransportContainer( + PublicTransportContainer&& x) noexcept { m_embarkation_status = std::move(x.m_embarkation_status); m_pt_activation = std::move(x.m_pt_activation); m_pt_activation_is_present = x.m_pt_activation_is_present; } -etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg::PublicTransportContainer::operator =( +PublicTransportContainer& PublicTransportContainer::operator =( const PublicTransportContainer& x) { m_embarkation_status = x.m_embarkation_status; m_pt_activation = x.m_pt_activation; m_pt_activation_is_present = x.m_pt_activation_is_present; - return *this; } -etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg::PublicTransportContainer::operator =( - PublicTransportContainer&& x) +PublicTransportContainer& PublicTransportContainer::operator =( + PublicTransportContainer&& x) noexcept { m_embarkation_status = std::move(x.m_embarkation_status); m_pt_activation = std::move(x.m_pt_activation); m_pt_activation_is_present = x.m_pt_activation_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::PublicTransportContainer::operator ==( +bool PublicTransportContainer::operator ==( const PublicTransportContainer& x) const { - - return (m_embarkation_status == x.m_embarkation_status && m_pt_activation == x.m_pt_activation && m_pt_activation_is_present == x.m_pt_activation_is_present); + return (m_embarkation_status == x.m_embarkation_status && + m_pt_activation == x.m_pt_activation && + m_pt_activation_is_present == x.m_pt_activation_is_present); } -bool etsi_its_cam_msgs::msg::PublicTransportContainer::operator !=( +bool PublicTransportContainer::operator !=( const PublicTransportContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::PublicTransportContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::EmbarkationStatus::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PtActivation::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::PublicTransportContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PublicTransportContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::EmbarkationStatus::getCdrSerializedSize(data.embarkation_status(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PtActivation::getCdrSerializedSize(data.pt_activation(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::PublicTransportContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_embarkation_status; - scdr << m_pt_activation; - scdr << m_pt_activation_is_present; - -} - -void etsi_its_cam_msgs::msg::PublicTransportContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_embarkation_status; - dcdr >> m_pt_activation; - dcdr >> m_pt_activation_is_present; -} - /*! * @brief This function copies the value in member embarkation_status * @param _embarkation_status New value to be copied in member embarkation_status */ -void etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status( +void PublicTransportContainer::embarkation_status( const etsi_its_cam_msgs::msg::EmbarkationStatus& _embarkation_status) { m_embarkation_status = _embarkation_status; @@ -167,7 +115,7 @@ void etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status( * @brief This function moves the value in member embarkation_status * @param _embarkation_status New value to be moved in member embarkation_status */ -void etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status( +void PublicTransportContainer::embarkation_status( etsi_its_cam_msgs::msg::EmbarkationStatus&& _embarkation_status) { m_embarkation_status = std::move(_embarkation_status); @@ -177,7 +125,7 @@ void etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status( * @brief This function returns a constant reference to member embarkation_status * @return Constant reference to member embarkation_status */ -const etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status() const +const etsi_its_cam_msgs::msg::EmbarkationStatus& PublicTransportContainer::embarkation_status() const { return m_embarkation_status; } @@ -186,15 +134,17 @@ const etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::PublicT * @brief This function returns a reference to member embarkation_status * @return Reference to member embarkation_status */ -etsi_its_cam_msgs::msg::EmbarkationStatus& etsi_its_cam_msgs::msg::PublicTransportContainer::embarkation_status() +etsi_its_cam_msgs::msg::EmbarkationStatus& PublicTransportContainer::embarkation_status() { return m_embarkation_status; } + + /*! * @brief This function copies the value in member pt_activation * @param _pt_activation New value to be copied in member pt_activation */ -void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation( +void PublicTransportContainer::pt_activation( const etsi_its_cam_msgs::msg::PtActivation& _pt_activation) { m_pt_activation = _pt_activation; @@ -204,7 +154,7 @@ void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation( * @brief This function moves the value in member pt_activation * @param _pt_activation New value to be moved in member pt_activation */ -void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation( +void PublicTransportContainer::pt_activation( etsi_its_cam_msgs::msg::PtActivation&& _pt_activation) { m_pt_activation = std::move(_pt_activation); @@ -214,7 +164,7 @@ void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation( * @brief This function returns a constant reference to member pt_activation * @return Constant reference to member pt_activation */ -const etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation() const +const etsi_its_cam_msgs::msg::PtActivation& PublicTransportContainer::pt_activation() const { return m_pt_activation; } @@ -223,15 +173,17 @@ const etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PublicTransp * @brief This function returns a reference to member pt_activation * @return Reference to member pt_activation */ -etsi_its_cam_msgs::msg::PtActivation& etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation() +etsi_its_cam_msgs::msg::PtActivation& PublicTransportContainer::pt_activation() { return m_pt_activation; } + + /*! * @brief This function sets a value in member pt_activation_is_present * @param _pt_activation_is_present New value for member pt_activation_is_present */ -void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation_is_present( +void PublicTransportContainer::pt_activation_is_present( bool _pt_activation_is_present) { m_pt_activation_is_present = _pt_activation_is_present; @@ -241,7 +193,7 @@ void etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation_is_present( * @brief This function returns the value of member pt_activation_is_present * @return Value of member pt_activation_is_present */ -bool etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation_is_present() const +bool PublicTransportContainer::pt_activation_is_present() const { return m_pt_activation_is_present; } @@ -250,32 +202,18 @@ bool etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation_is_present( * @brief This function returns a reference to member pt_activation_is_present * @return Reference to member pt_activation_is_present */ -bool& etsi_its_cam_msgs::msg::PublicTransportContainer::pt_activation_is_present() +bool& PublicTransportContainer::pt_activation_is_present() { return m_pt_activation_is_present; } -size_t etsi_its_cam_msgs::msg::PublicTransportContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::PublicTransportContainer::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::PublicTransportContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PublicTransportContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.h index 225aea3b44d..c48ee0679b6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainer.h @@ -16,21 +16,26 @@ * @file PublicTransportContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_H_ -#include "PtActivation.h" -#include "EmbarkationStatus.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "PtActivation.h" +#include "EmbarkationStatus.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,221 +49,179 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PublicTransportContainer_SOURCE) -#define PublicTransportContainer_DllAPI __declspec( dllexport ) +#if defined(PUBLICTRANSPORTCONTAINER_SOURCE) +#define PUBLICTRANSPORTCONTAINER_DllAPI __declspec( dllexport ) #else -#define PublicTransportContainer_DllAPI __declspec( dllimport ) -#endif // PublicTransportContainer_SOURCE +#define PUBLICTRANSPORTCONTAINER_DllAPI __declspec( dllimport ) +#endif // PUBLICTRANSPORTCONTAINER_SOURCE #else -#define PublicTransportContainer_DllAPI +#define PUBLICTRANSPORTCONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PublicTransportContainer_DllAPI +#define PUBLICTRANSPORTCONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure PublicTransportContainer defined by the user in the IDL file. - * @ingroup PUBLICTRANSPORTCONTAINER - */ - class PublicTransportContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PublicTransportContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PublicTransportContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. - */ - eProsima_user_DllExport PublicTransportContainer( - const PublicTransportContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. - */ - eProsima_user_DllExport PublicTransportContainer( - PublicTransportContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. - */ - eProsima_user_DllExport PublicTransportContainer& operator =( - const PublicTransportContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. - */ - eProsima_user_DllExport PublicTransportContainer& operator =( - PublicTransportContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PublicTransportContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PublicTransportContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::PublicTransportContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PublicTransportContainer& x) const; - - /*! - * @brief This function copies the value in member embarkation_status - * @param _embarkation_status New value to be copied in member embarkation_status - */ - eProsima_user_DllExport void embarkation_status( - const etsi_its_cam_msgs::msg::EmbarkationStatus& _embarkation_status); - - /*! - * @brief This function moves the value in member embarkation_status - * @param _embarkation_status New value to be moved in member embarkation_status - */ - eProsima_user_DllExport void embarkation_status( - etsi_its_cam_msgs::msg::EmbarkationStatus&& _embarkation_status); - - /*! - * @brief This function returns a constant reference to member embarkation_status - * @return Constant reference to member embarkation_status - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmbarkationStatus& embarkation_status() const; - - /*! - * @brief This function returns a reference to member embarkation_status - * @return Reference to member embarkation_status - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::EmbarkationStatus& embarkation_status(); - /*! - * @brief This function copies the value in member pt_activation - * @param _pt_activation New value to be copied in member pt_activation - */ - eProsima_user_DllExport void pt_activation( - const etsi_its_cam_msgs::msg::PtActivation& _pt_activation); - - /*! - * @brief This function moves the value in member pt_activation - * @param _pt_activation New value to be moved in member pt_activation - */ - eProsima_user_DllExport void pt_activation( - etsi_its_cam_msgs::msg::PtActivation&& _pt_activation); - - /*! - * @brief This function returns a constant reference to member pt_activation - * @return Constant reference to member pt_activation - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivation& pt_activation() const; - - /*! - * @brief This function returns a reference to member pt_activation - * @return Reference to member pt_activation - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivation& pt_activation(); - /*! - * @brief This function sets a value in member pt_activation_is_present - * @param _pt_activation_is_present New value for member pt_activation_is_present - */ - eProsima_user_DllExport void pt_activation_is_present( - bool _pt_activation_is_present); - - /*! - * @brief This function returns the value of member pt_activation_is_present - * @return Value of member pt_activation_is_present - */ - eProsima_user_DllExport bool pt_activation_is_present() const; - - /*! - * @brief This function returns a reference to member pt_activation_is_present - * @return Reference to member pt_activation_is_present - */ - eProsima_user_DllExport bool& pt_activation_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::PublicTransportContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::EmbarkationStatus m_embarkation_status; - etsi_its_cam_msgs::msg::PtActivation m_pt_activation; - bool m_pt_activation_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure PublicTransportContainer defined by the user in the IDL file. + * @ingroup PublicTransportContainer + */ +class PublicTransportContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PublicTransportContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PublicTransportContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. + */ + eProsima_user_DllExport PublicTransportContainer( + const PublicTransportContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. + */ + eProsima_user_DllExport PublicTransportContainer( + PublicTransportContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. + */ + eProsima_user_DllExport PublicTransportContainer& operator =( + const PublicTransportContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::PublicTransportContainer that will be copied. + */ + eProsima_user_DllExport PublicTransportContainer& operator =( + PublicTransportContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PublicTransportContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PublicTransportContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::PublicTransportContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PublicTransportContainer& x) const; + + /*! + * @brief This function copies the value in member embarkation_status + * @param _embarkation_status New value to be copied in member embarkation_status + */ + eProsima_user_DllExport void embarkation_status( + const etsi_its_cam_msgs::msg::EmbarkationStatus& _embarkation_status); + + /*! + * @brief This function moves the value in member embarkation_status + * @param _embarkation_status New value to be moved in member embarkation_status + */ + eProsima_user_DllExport void embarkation_status( + etsi_its_cam_msgs::msg::EmbarkationStatus&& _embarkation_status); + + /*! + * @brief This function returns a constant reference to member embarkation_status + * @return Constant reference to member embarkation_status + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmbarkationStatus& embarkation_status() const; + + /*! + * @brief This function returns a reference to member embarkation_status + * @return Reference to member embarkation_status + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::EmbarkationStatus& embarkation_status(); + + + /*! + * @brief This function copies the value in member pt_activation + * @param _pt_activation New value to be copied in member pt_activation + */ + eProsima_user_DllExport void pt_activation( + const etsi_its_cam_msgs::msg::PtActivation& _pt_activation); + + /*! + * @brief This function moves the value in member pt_activation + * @param _pt_activation New value to be moved in member pt_activation + */ + eProsima_user_DllExport void pt_activation( + etsi_its_cam_msgs::msg::PtActivation&& _pt_activation); + + /*! + * @brief This function returns a constant reference to member pt_activation + * @return Constant reference to member pt_activation + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PtActivation& pt_activation() const; + + /*! + * @brief This function returns a reference to member pt_activation + * @return Reference to member pt_activation + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PtActivation& pt_activation(); + + + /*! + * @brief This function sets a value in member pt_activation_is_present + * @param _pt_activation_is_present New value for member pt_activation_is_present + */ + eProsima_user_DllExport void pt_activation_is_present( + bool _pt_activation_is_present); + + /*! + * @brief This function returns the value of member pt_activation_is_present + * @return Value of member pt_activation_is_present + */ + eProsima_user_DllExport bool pt_activation_is_present() const; + + /*! + * @brief This function returns a reference to member pt_activation_is_present + * @return Reference to member pt_activation_is_present + */ + eProsima_user_DllExport bool& pt_activation_is_present(); + +private: + + etsi_its_cam_msgs::msg::EmbarkationStatus m_embarkation_status; + etsi_its_cam_msgs::msg::PtActivation m_pt_activation; + bool m_pt_activation_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerCdrAux.hpp new file mode 100644 index 00000000000..e803445cdd4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PublicTransportContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINERCDRAUX_HPP_ + +#include "PublicTransportContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_PublicTransportContainer_max_cdr_typesize {133UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_PublicTransportContainer_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PublicTransportContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerCdrAux.ipp new file mode 100644 index 00000000000..d420704fc0a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PublicTransportContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINERCDRAUX_IPP_ + +#include "PublicTransportContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::PublicTransportContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.embarkation_status(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.pt_activation(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.pt_activation_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PublicTransportContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.embarkation_status() + << eprosima::fastcdr::MemberId(1) << data.pt_activation() + << eprosima::fastcdr::MemberId(2) << data.pt_activation_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::PublicTransportContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.embarkation_status(); + break; + + case 1: + dcdr >> data.pt_activation(); + break; + + case 2: + dcdr >> data.pt_activation_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::PublicTransportContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.cxx index ad910cfd9dd..089775a7589 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file PublicTransportContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PublicTransportContainerPubSubTypes.h" +#include "PublicTransportContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - PublicTransportContainerPubSubType::PublicTransportContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::PublicTransportContainer_"); - auto type_size = PublicTransportContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PublicTransportContainer::isKeyDefined(); - size_t keyLength = PublicTransportContainer::getKeyMaxCdrSerializedSize() > 16 ? - PublicTransportContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PublicTransportContainerPubSubType::~PublicTransportContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PublicTransportContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PublicTransportContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PublicTransportContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PublicTransportContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PublicTransportContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PublicTransportContainerPubSubType::createData() - { - return reinterpret_cast(new PublicTransportContainer()); - } - - void PublicTransportContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PublicTransportContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PublicTransportContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PublicTransportContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PublicTransportContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +PublicTransportContainerPubSubType::PublicTransportContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::PublicTransportContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PublicTransportContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_PublicTransportContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PublicTransportContainerPubSubType::~PublicTransportContainerPubSubType() +{ +} + +bool PublicTransportContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PublicTransportContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PublicTransportContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PublicTransportContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PublicTransportContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PublicTransportContainerPubSubType::createData() +{ + return reinterpret_cast(new PublicTransportContainer()); +} + +void PublicTransportContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PublicTransportContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.h index 433d4a470bc..5718dececb8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/PublicTransportContainerPubSubTypes.h @@ -16,92 +16,122 @@ * @file PublicTransportContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PublicTransportContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "PtActivationPubSubTypes.h" +#include "EmbarkationStatusPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PublicTransportContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type PublicTransportContainer defined by the user in the IDL file. + * @ingroup PublicTransportContainer + */ +class PublicTransportContainerPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type PublicTransportContainer defined by the user in the IDL file. - * @ingroup PUBLICTRANSPORTCONTAINER - */ - class PublicTransportContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef PublicTransportContainer type; + typedef PublicTransportContainer type; - eProsima_user_DllExport PublicTransportContainerPubSubType(); + eProsima_user_DllExport PublicTransportContainerPubSubType(); - eProsima_user_DllExport virtual ~PublicTransportContainerPubSubType(); + eProsima_user_DllExport ~PublicTransportContainerPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_PUBLICTRANSPORTCONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.cxx index 31ad3448e61..1a5d12bca42 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.cxx @@ -14,9 +14,9 @@ /*! * @file RSUContainerHighFrequency.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,126 +27,80 @@ char dummy; #endif // _WIN32 #include "RSUContainerHighFrequency.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::RSUContainerHighFrequency::RSUContainerHighFrequency() -{ - // m_protected_communication_zones_rsu com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@20765ed5 - // m_protected_communication_zones_rsu_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3b582111 - m_protected_communication_zones_rsu_is_present = false; +namespace etsi_its_cam_msgs { + +namespace msg { + -} -etsi_its_cam_msgs::msg::RSUContainerHighFrequency::~RSUContainerHighFrequency() +RSUContainerHighFrequency::RSUContainerHighFrequency() { +} +RSUContainerHighFrequency::~RSUContainerHighFrequency() +{ } -etsi_its_cam_msgs::msg::RSUContainerHighFrequency::RSUContainerHighFrequency( +RSUContainerHighFrequency::RSUContainerHighFrequency( const RSUContainerHighFrequency& x) { m_protected_communication_zones_rsu = x.m_protected_communication_zones_rsu; m_protected_communication_zones_rsu_is_present = x.m_protected_communication_zones_rsu_is_present; } -etsi_its_cam_msgs::msg::RSUContainerHighFrequency::RSUContainerHighFrequency( - RSUContainerHighFrequency&& x) +RSUContainerHighFrequency::RSUContainerHighFrequency( + RSUContainerHighFrequency&& x) noexcept { m_protected_communication_zones_rsu = std::move(x.m_protected_communication_zones_rsu); m_protected_communication_zones_rsu_is_present = x.m_protected_communication_zones_rsu_is_present; } -etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::operator =( +RSUContainerHighFrequency& RSUContainerHighFrequency::operator =( const RSUContainerHighFrequency& x) { m_protected_communication_zones_rsu = x.m_protected_communication_zones_rsu; m_protected_communication_zones_rsu_is_present = x.m_protected_communication_zones_rsu_is_present; - return *this; } -etsi_its_cam_msgs::msg::RSUContainerHighFrequency& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::operator =( - RSUContainerHighFrequency&& x) +RSUContainerHighFrequency& RSUContainerHighFrequency::operator =( + RSUContainerHighFrequency&& x) noexcept { m_protected_communication_zones_rsu = std::move(x.m_protected_communication_zones_rsu); m_protected_communication_zones_rsu_is_present = x.m_protected_communication_zones_rsu_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::operator ==( +bool RSUContainerHighFrequency::operator ==( const RSUContainerHighFrequency& x) const { - - return (m_protected_communication_zones_rsu == x.m_protected_communication_zones_rsu && m_protected_communication_zones_rsu_is_present == x.m_protected_communication_zones_rsu_is_present); + return (m_protected_communication_zones_rsu == x.m_protected_communication_zones_rsu && + m_protected_communication_zones_rsu_is_present == x.m_protected_communication_zones_rsu_is_present); } -bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::operator !=( +bool RSUContainerHighFrequency::operator !=( const RSUContainerHighFrequency& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU::getCdrSerializedSize(data.protected_communication_zones_rsu(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_protected_communication_zones_rsu; - scdr << m_protected_communication_zones_rsu_is_present; - -} - -void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_protected_communication_zones_rsu; - dcdr >> m_protected_communication_zones_rsu_is_present; -} - /*! * @brief This function copies the value in member protected_communication_zones_rsu * @param _protected_communication_zones_rsu New value to be copied in member protected_communication_zones_rsu */ -void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu( +void RSUContainerHighFrequency::protected_communication_zones_rsu( const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& _protected_communication_zones_rsu) { m_protected_communication_zones_rsu = _protected_communication_zones_rsu; @@ -156,7 +110,7 @@ void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_ * @brief This function moves the value in member protected_communication_zones_rsu * @param _protected_communication_zones_rsu New value to be moved in member protected_communication_zones_rsu */ -void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu( +void RSUContainerHighFrequency::protected_communication_zones_rsu( etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU&& _protected_communication_zones_rsu) { m_protected_communication_zones_rsu = std::move(_protected_communication_zones_rsu); @@ -166,7 +120,7 @@ void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_ * @brief This function returns a constant reference to member protected_communication_zones_rsu * @return Constant reference to member protected_communication_zones_rsu */ -const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu() const +const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& RSUContainerHighFrequency::protected_communication_zones_rsu() const { return m_protected_communication_zones_rsu; } @@ -175,15 +129,17 @@ const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs: * @brief This function returns a reference to member protected_communication_zones_rsu * @return Reference to member protected_communication_zones_rsu */ -etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu() +etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& RSUContainerHighFrequency::protected_communication_zones_rsu() { return m_protected_communication_zones_rsu; } + + /*! * @brief This function sets a value in member protected_communication_zones_rsu_is_present * @param _protected_communication_zones_rsu_is_present New value for member protected_communication_zones_rsu_is_present */ -void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu_is_present( +void RSUContainerHighFrequency::protected_communication_zones_rsu_is_present( bool _protected_communication_zones_rsu_is_present) { m_protected_communication_zones_rsu_is_present = _protected_communication_zones_rsu_is_present; @@ -193,7 +149,7 @@ void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_ * @brief This function returns the value of member protected_communication_zones_rsu_is_present * @return Value of member protected_communication_zones_rsu_is_present */ -bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu_is_present() const +bool RSUContainerHighFrequency::protected_communication_zones_rsu_is_present() const { return m_protected_communication_zones_rsu_is_present; } @@ -202,32 +158,18 @@ bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_ * @brief This function returns a reference to member protected_communication_zones_rsu_is_present * @return Reference to member protected_communication_zones_rsu_is_present */ -bool& etsi_its_cam_msgs::msg::RSUContainerHighFrequency::protected_communication_zones_rsu_is_present() +bool& RSUContainerHighFrequency::protected_communication_zones_rsu_is_present() { return m_protected_communication_zones_rsu_is_present; } -size_t etsi_its_cam_msgs::msg::RSUContainerHighFrequency::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::RSUContainerHighFrequency::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::RSUContainerHighFrequency::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "RSUContainerHighFrequencyCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.h index 2e0adb94d29..f51dcaeb5c8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequency.h @@ -16,20 +16,25 @@ * @file RSUContainerHighFrequency.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_H_ -#include "ProtectedCommunicationZonesRSU.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "ProtectedCommunicationZonesRSU.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,195 +48,151 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(RSUContainerHighFrequency_SOURCE) -#define RSUContainerHighFrequency_DllAPI __declspec( dllexport ) +#if defined(RSUCONTAINERHIGHFREQUENCY_SOURCE) +#define RSUCONTAINERHIGHFREQUENCY_DllAPI __declspec( dllexport ) #else -#define RSUContainerHighFrequency_DllAPI __declspec( dllimport ) -#endif // RSUContainerHighFrequency_SOURCE +#define RSUCONTAINERHIGHFREQUENCY_DllAPI __declspec( dllimport ) +#endif // RSUCONTAINERHIGHFREQUENCY_SOURCE #else -#define RSUContainerHighFrequency_DllAPI +#define RSUCONTAINERHIGHFREQUENCY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define RSUContainerHighFrequency_DllAPI +#define RSUCONTAINERHIGHFREQUENCY_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure RSUContainerHighFrequency defined by the user in the IDL file. - * @ingroup RSUCONTAINERHIGHFREQUENCY - */ - class RSUContainerHighFrequency - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RSUContainerHighFrequency(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RSUContainerHighFrequency(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. - */ - eProsima_user_DllExport RSUContainerHighFrequency( - const RSUContainerHighFrequency& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. - */ - eProsima_user_DllExport RSUContainerHighFrequency( - RSUContainerHighFrequency&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. - */ - eProsima_user_DllExport RSUContainerHighFrequency& operator =( - const RSUContainerHighFrequency& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. - */ - eProsima_user_DllExport RSUContainerHighFrequency& operator =( - RSUContainerHighFrequency&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::RSUContainerHighFrequency object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RSUContainerHighFrequency& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::RSUContainerHighFrequency object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RSUContainerHighFrequency& x) const; - - /*! - * @brief This function copies the value in member protected_communication_zones_rsu - * @param _protected_communication_zones_rsu New value to be copied in member protected_communication_zones_rsu - */ - eProsima_user_DllExport void protected_communication_zones_rsu( - const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& _protected_communication_zones_rsu); - - /*! - * @brief This function moves the value in member protected_communication_zones_rsu - * @param _protected_communication_zones_rsu New value to be moved in member protected_communication_zones_rsu - */ - eProsima_user_DllExport void protected_communication_zones_rsu( - etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU&& _protected_communication_zones_rsu); - - /*! - * @brief This function returns a constant reference to member protected_communication_zones_rsu - * @return Constant reference to member protected_communication_zones_rsu - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& protected_communication_zones_rsu() const; - - /*! - * @brief This function returns a reference to member protected_communication_zones_rsu - * @return Reference to member protected_communication_zones_rsu - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& protected_communication_zones_rsu(); - /*! - * @brief This function sets a value in member protected_communication_zones_rsu_is_present - * @param _protected_communication_zones_rsu_is_present New value for member protected_communication_zones_rsu_is_present - */ - eProsima_user_DllExport void protected_communication_zones_rsu_is_present( - bool _protected_communication_zones_rsu_is_present); - - /*! - * @brief This function returns the value of member protected_communication_zones_rsu_is_present - * @return Value of member protected_communication_zones_rsu_is_present - */ - eProsima_user_DllExport bool protected_communication_zones_rsu_is_present() const; - - /*! - * @brief This function returns a reference to member protected_communication_zones_rsu_is_present - * @return Reference to member protected_communication_zones_rsu_is_present - */ - eProsima_user_DllExport bool& protected_communication_zones_rsu_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU m_protected_communication_zones_rsu; - bool m_protected_communication_zones_rsu_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure RSUContainerHighFrequency defined by the user in the IDL file. + * @ingroup RSUContainerHighFrequency + */ +class RSUContainerHighFrequency +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RSUContainerHighFrequency(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RSUContainerHighFrequency(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport RSUContainerHighFrequency( + const RSUContainerHighFrequency& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport RSUContainerHighFrequency( + RSUContainerHighFrequency&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport RSUContainerHighFrequency& operator =( + const RSUContainerHighFrequency& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RSUContainerHighFrequency that will be copied. + */ + eProsima_user_DllExport RSUContainerHighFrequency& operator =( + RSUContainerHighFrequency&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RSUContainerHighFrequency object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RSUContainerHighFrequency& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RSUContainerHighFrequency object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RSUContainerHighFrequency& x) const; + + /*! + * @brief This function copies the value in member protected_communication_zones_rsu + * @param _protected_communication_zones_rsu New value to be copied in member protected_communication_zones_rsu + */ + eProsima_user_DllExport void protected_communication_zones_rsu( + const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& _protected_communication_zones_rsu); + + /*! + * @brief This function moves the value in member protected_communication_zones_rsu + * @param _protected_communication_zones_rsu New value to be moved in member protected_communication_zones_rsu + */ + eProsima_user_DllExport void protected_communication_zones_rsu( + etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU&& _protected_communication_zones_rsu); + + /*! + * @brief This function returns a constant reference to member protected_communication_zones_rsu + * @return Constant reference to member protected_communication_zones_rsu + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& protected_communication_zones_rsu() const; + + /*! + * @brief This function returns a reference to member protected_communication_zones_rsu + * @return Reference to member protected_communication_zones_rsu + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU& protected_communication_zones_rsu(); + + + /*! + * @brief This function sets a value in member protected_communication_zones_rsu_is_present + * @param _protected_communication_zones_rsu_is_present New value for member protected_communication_zones_rsu_is_present + */ + eProsima_user_DllExport void protected_communication_zones_rsu_is_present( + bool _protected_communication_zones_rsu_is_present); + + /*! + * @brief This function returns the value of member protected_communication_zones_rsu_is_present + * @return Value of member protected_communication_zones_rsu_is_present + */ + eProsima_user_DllExport bool protected_communication_zones_rsu_is_present() const; + + /*! + * @brief This function returns a reference to member protected_communication_zones_rsu_is_present + * @return Reference to member protected_communication_zones_rsu_is_present + */ + eProsima_user_DllExport bool& protected_communication_zones_rsu_is_present(); + +private: + + etsi_its_cam_msgs::msg::ProtectedCommunicationZonesRSU m_protected_communication_zones_rsu; + bool m_protected_communication_zones_rsu_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyCdrAux.hpp new file mode 100644 index 00000000000..1777c41a050 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyCdrAux.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RSUContainerHighFrequencyCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCYCDRAUX_HPP_ + +#include "RSUContainerHighFrequency.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_RSUContainerHighFrequency_max_cdr_typesize {6414UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_RSUContainerHighFrequency_max_key_cdr_typesize {0UL}; + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyCdrAux.ipp new file mode 100644 index 00000000000..7bcf1b47bdb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RSUContainerHighFrequencyCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCYCDRAUX_IPP_ + +#include "RSUContainerHighFrequencyCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.protected_communication_zones_rsu(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.protected_communication_zones_rsu_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.protected_communication_zones_rsu() + << eprosima::fastcdr::MemberId(1) << data.protected_communication_zones_rsu_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.protected_communication_zones_rsu(); + break; + + case 1: + dcdr >> data.protected_communication_zones_rsu_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RSUContainerHighFrequency& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.cxx index 5afca4c53d8..bf49f0e881c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file RSUContainerHighFrequencyPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "RSUContainerHighFrequencyPubSubTypes.h" +#include "RSUContainerHighFrequencyCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - RSUContainerHighFrequencyPubSubType::RSUContainerHighFrequencyPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::RSUContainerHighFrequency_"); - auto type_size = RSUContainerHighFrequency::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = RSUContainerHighFrequency::isKeyDefined(); - size_t keyLength = RSUContainerHighFrequency::getKeyMaxCdrSerializedSize() > 16 ? - RSUContainerHighFrequency::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - RSUContainerHighFrequencyPubSubType::~RSUContainerHighFrequencyPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool RSUContainerHighFrequencyPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - RSUContainerHighFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool RSUContainerHighFrequencyPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - RSUContainerHighFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function RSUContainerHighFrequencyPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* RSUContainerHighFrequencyPubSubType::createData() - { - return reinterpret_cast(new RSUContainerHighFrequency()); - } - - void RSUContainerHighFrequencyPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool RSUContainerHighFrequencyPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - RSUContainerHighFrequency* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - RSUContainerHighFrequency::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || RSUContainerHighFrequency::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +RSUContainerHighFrequencyPubSubType::RSUContainerHighFrequencyPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::RSUContainerHighFrequency_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(RSUContainerHighFrequency::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_RSUContainerHighFrequency_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +RSUContainerHighFrequencyPubSubType::~RSUContainerHighFrequencyPubSubType() +{ +} + +bool RSUContainerHighFrequencyPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + RSUContainerHighFrequency* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool RSUContainerHighFrequencyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + RSUContainerHighFrequency* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function RSUContainerHighFrequencyPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* RSUContainerHighFrequencyPubSubType::createData() +{ + return reinterpret_cast(new RSUContainerHighFrequency()); +} + +void RSUContainerHighFrequencyPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool RSUContainerHighFrequencyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.h index 14b111fc515..0c3d8b1fb19 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RSUContainerHighFrequencyPubSubTypes.h @@ -16,92 +16,121 @@ * @file RSUContainerHighFrequencyPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "RSUContainerHighFrequency.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "ProtectedCommunicationZonesRSUPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated RSUContainerHighFrequency is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type RSUContainerHighFrequency defined by the user in the IDL file. + * @ingroup RSUContainerHighFrequency + */ +class RSUContainerHighFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type RSUContainerHighFrequency defined by the user in the IDL file. - * @ingroup RSUCONTAINERHIGHFREQUENCY - */ - class RSUContainerHighFrequencyPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef RSUContainerHighFrequency type; + typedef RSUContainerHighFrequency type; - eProsima_user_DllExport RSUContainerHighFrequencyPubSubType(); + eProsima_user_DllExport RSUContainerHighFrequencyPubSubType(); - eProsima_user_DllExport virtual ~RSUContainerHighFrequencyPubSubType(); + eProsima_user_DllExport ~RSUContainerHighFrequencyPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RSUCONTAINERHIGHFREQUENCY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.cxx index 1529379e6ea..4a2ec66f310 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.cxx @@ -14,9 +14,9 @@ /*! * @file ReferencePosition.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,34 +27,31 @@ char dummy; #endif // _WIN32 #include "ReferencePosition.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::ReferencePosition::ReferencePosition() -{ - // m_latitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@58399d82 - // m_longitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@26f96b85 +namespace etsi_its_cam_msgs { - // m_position_confidence_ellipse com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@46d8f407 +namespace msg { - // m_altitude com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3c0036b +ReferencePosition::ReferencePosition() +{ } -etsi_its_cam_msgs::msg::ReferencePosition::~ReferencePosition() +ReferencePosition::~ReferencePosition() { - - - } -etsi_its_cam_msgs::msg::ReferencePosition::ReferencePosition( +ReferencePosition::ReferencePosition( const ReferencePosition& x) { m_latitude = x.m_latitude; @@ -63,8 +60,8 @@ etsi_its_cam_msgs::msg::ReferencePosition::ReferencePosition( m_altitude = x.m_altitude; } -etsi_its_cam_msgs::msg::ReferencePosition::ReferencePosition( - ReferencePosition&& x) +ReferencePosition::ReferencePosition( + ReferencePosition&& x) noexcept { m_latitude = std::move(x.m_latitude); m_longitude = std::move(x.m_longitude); @@ -72,7 +69,7 @@ etsi_its_cam_msgs::msg::ReferencePosition::ReferencePosition( m_altitude = std::move(x.m_altitude); } -etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::ReferencePosition::operator =( +ReferencePosition& ReferencePosition::operator =( const ReferencePosition& x) { @@ -80,165 +77,118 @@ etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::ReferencePosi m_longitude = x.m_longitude; m_position_confidence_ellipse = x.m_position_confidence_ellipse; m_altitude = x.m_altitude; - return *this; } -etsi_its_cam_msgs::msg::ReferencePosition& etsi_its_cam_msgs::msg::ReferencePosition::operator =( - ReferencePosition&& x) +ReferencePosition& ReferencePosition::operator =( + ReferencePosition&& x) noexcept { m_latitude = std::move(x.m_latitude); m_longitude = std::move(x.m_longitude); m_position_confidence_ellipse = std::move(x.m_position_confidence_ellipse); m_altitude = std::move(x.m_altitude); - return *this; } -bool etsi_its_cam_msgs::msg::ReferencePosition::operator ==( +bool ReferencePosition::operator ==( const ReferencePosition& x) const { - - return (m_latitude == x.m_latitude && m_longitude == x.m_longitude && m_position_confidence_ellipse == x.m_position_confidence_ellipse && m_altitude == x.m_altitude); + return (m_latitude == x.m_latitude && + m_longitude == x.m_longitude && + m_position_confidence_ellipse == x.m_position_confidence_ellipse && + m_altitude == x.m_altitude); } -bool etsi_its_cam_msgs::msg::ReferencePosition::operator !=( +bool ReferencePosition::operator !=( const ReferencePosition& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::ReferencePosition::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::Latitude::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Longitude::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PosConfidenceEllipse::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Altitude::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::ReferencePosition::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ReferencePosition& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::Latitude::getCdrSerializedSize(data.latitude(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Longitude::getCdrSerializedSize(data.longitude(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::PosConfidenceEllipse::getCdrSerializedSize(data.position_confidence_ellipse(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::Altitude::getCdrSerializedSize(data.altitude(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::ReferencePosition::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_latitude; - scdr << m_longitude; - scdr << m_position_confidence_ellipse; - scdr << m_altitude; - -} - -void etsi_its_cam_msgs::msg::ReferencePosition::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_latitude; - dcdr >> m_longitude; - dcdr >> m_position_confidence_ellipse; - dcdr >> m_altitude; -} - /*! - * @brief This function copies the value in member latitude_ - * @param _latitude New value to be copied in member latitude_ + * @brief This function copies the value in member latitude + * @param _latitude New value to be copied in member latitude */ -void etsi_its_cam_msgs::msg::ReferencePosition::latitude( +void ReferencePosition::latitude( const etsi_its_cam_msgs::msg::Latitude& _latitude) { m_latitude = _latitude; } /*! - * @brief This function moves the value in member latitude_ - * @param _latitude New value to be moved in member latitude_ + * @brief This function moves the value in member latitude + * @param _latitude New value to be moved in member latitude */ -void etsi_its_cam_msgs::msg::ReferencePosition::latitude( +void ReferencePosition::latitude( etsi_its_cam_msgs::msg::Latitude&& _latitude) { m_latitude = std::move(_latitude); } /*! - * @brief This function returns a constant reference to member latitude_ - * @return Constant reference to member latitude_ + * @brief This function returns a constant reference to member latitude + * @return Constant reference to member latitude */ -const etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ReferencePosition::latitude() const +const etsi_its_cam_msgs::msg::Latitude& ReferencePosition::latitude() const { return m_latitude; } /*! - * @brief This function returns a reference to member latitude_ - * @return Reference to member latitude_ + * @brief This function returns a reference to member latitude + * @return Reference to member latitude */ -etsi_its_cam_msgs::msg::Latitude& etsi_its_cam_msgs::msg::ReferencePosition::latitude() +etsi_its_cam_msgs::msg::Latitude& ReferencePosition::latitude() { return m_latitude; } + + /*! - * @brief This function copies the value in member longitude_ - * @param _longitude New value to be copied in member longitude_ + * @brief This function copies the value in member longitude + * @param _longitude New value to be copied in member longitude */ -void etsi_its_cam_msgs::msg::ReferencePosition::longitude( +void ReferencePosition::longitude( const etsi_its_cam_msgs::msg::Longitude& _longitude) { m_longitude = _longitude; } /*! - * @brief This function moves the value in member longitude_ - * @param _longitude New value to be moved in member longitude_ + * @brief This function moves the value in member longitude + * @param _longitude New value to be moved in member longitude */ -void etsi_its_cam_msgs::msg::ReferencePosition::longitude( +void ReferencePosition::longitude( etsi_its_cam_msgs::msg::Longitude&& _longitude) { m_longitude = std::move(_longitude); } /*! - * @brief This function returns a constant reference to member longitude_ - * @return Constant reference to member longitude_ + * @brief This function returns a constant reference to member longitude + * @return Constant reference to member longitude */ -const etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ReferencePosition::longitude() const +const etsi_its_cam_msgs::msg::Longitude& ReferencePosition::longitude() const { return m_longitude; } /*! - * @brief This function returns a reference to member longitude_ - * @return Reference to member longitude_ + * @brief This function returns a reference to member longitude + * @return Reference to member longitude */ -etsi_its_cam_msgs::msg::Longitude& etsi_its_cam_msgs::msg::ReferencePosition::longitude() +etsi_its_cam_msgs::msg::Longitude& ReferencePosition::longitude() { return m_longitude; } + + /*! * @brief This function copies the value in member position_confidence_ellipse * @param _position_confidence_ellipse New value to be copied in member position_confidence_ellipse */ -void etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse( +void ReferencePosition::position_confidence_ellipse( const etsi_its_cam_msgs::msg::PosConfidenceEllipse& _position_confidence_ellipse) { m_position_confidence_ellipse = _position_confidence_ellipse; @@ -248,7 +198,7 @@ void etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse( * @brief This function moves the value in member position_confidence_ellipse * @param _position_confidence_ellipse New value to be moved in member position_confidence_ellipse */ -void etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse( +void ReferencePosition::position_confidence_ellipse( etsi_its_cam_msgs::msg::PosConfidenceEllipse&& _position_confidence_ellipse) { m_position_confidence_ellipse = std::move(_position_confidence_ellipse); @@ -258,7 +208,7 @@ void etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse( * @brief This function returns a constant reference to member position_confidence_ellipse * @return Constant reference to member position_confidence_ellipse */ -const etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse() const +const etsi_its_cam_msgs::msg::PosConfidenceEllipse& ReferencePosition::position_confidence_ellipse() const { return m_position_confidence_ellipse; } @@ -267,68 +217,57 @@ const etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::Refe * @brief This function returns a reference to member position_confidence_ellipse * @return Reference to member position_confidence_ellipse */ -etsi_its_cam_msgs::msg::PosConfidenceEllipse& etsi_its_cam_msgs::msg::ReferencePosition::position_confidence_ellipse() +etsi_its_cam_msgs::msg::PosConfidenceEllipse& ReferencePosition::position_confidence_ellipse() { return m_position_confidence_ellipse; } + + /*! - * @brief This function copies the value in member altitude_ - * @param _altitude New value to be copied in member altitude_ + * @brief This function copies the value in member altitude + * @param _altitude New value to be copied in member altitude */ -void etsi_its_cam_msgs::msg::ReferencePosition::altitude( +void ReferencePosition::altitude( const etsi_its_cam_msgs::msg::Altitude& _altitude) { m_altitude = _altitude; } /*! - * @brief This function moves the value in member altitude_ - * @param _altitude New value to be moved in member altitude_ + * @brief This function moves the value in member altitude + * @param _altitude New value to be moved in member altitude */ -void etsi_its_cam_msgs::msg::ReferencePosition::altitude( +void ReferencePosition::altitude( etsi_its_cam_msgs::msg::Altitude&& _altitude) { m_altitude = std::move(_altitude); } /*! - * @brief This function returns a constant reference to member altitude_ - * @return Constant reference to member altitude_ + * @brief This function returns a constant reference to member altitude + * @return Constant reference to member altitude */ -const etsi_its_cam_msgs::msg::Altitude& etsi_its_cam_msgs::msg::ReferencePosition::altitude() const +const etsi_its_cam_msgs::msg::Altitude& ReferencePosition::altitude() const { return m_altitude; } /*! - * @brief This function returns a reference to member altitude_ - * @return Reference to member altitude_ + * @brief This function returns a reference to member altitude + * @return Reference to member altitude */ -etsi_its_cam_msgs::msg::Altitude& etsi_its_cam_msgs::msg::ReferencePosition::altitude() +etsi_its_cam_msgs::msg::Altitude& ReferencePosition::altitude() { return m_altitude; } -size_t etsi_its_cam_msgs::msg::ReferencePosition::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::ReferencePosition::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::ReferencePosition::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ReferencePositionCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.h index 1f450e3ffad..d349d914ec8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePosition.h @@ -16,23 +16,28 @@ * @file ReferencePosition.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "Latitude.h" #include "PosConfidenceEllipse.h" #include "Longitude.h" #include "Altitude.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -46,253 +51,214 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ReferencePosition_SOURCE) -#define ReferencePosition_DllAPI __declspec( dllexport ) +#if defined(REFERENCEPOSITION_SOURCE) +#define REFERENCEPOSITION_DllAPI __declspec( dllexport ) #else -#define ReferencePosition_DllAPI __declspec( dllimport ) -#endif // ReferencePosition_SOURCE +#define REFERENCEPOSITION_DllAPI __declspec( dllimport ) +#endif // REFERENCEPOSITION_SOURCE #else -#define ReferencePosition_DllAPI +#define REFERENCEPOSITION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ReferencePosition_DllAPI +#define REFERENCEPOSITION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure ReferencePosition defined by the user in the IDL file. - * @ingroup REFERENCEPOSITION - */ - class ReferencePosition - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ReferencePosition(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ReferencePosition(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. - */ - eProsima_user_DllExport ReferencePosition( - const ReferencePosition& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. - */ - eProsima_user_DllExport ReferencePosition( - ReferencePosition&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. - */ - eProsima_user_DllExport ReferencePosition& operator =( - const ReferencePosition& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. - */ - eProsima_user_DllExport ReferencePosition& operator =( - ReferencePosition&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ReferencePosition object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ReferencePosition& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::ReferencePosition object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ReferencePosition& x) const; - - /*! - * @brief This function copies the value in member latitude_ - * @param _latitude New value to be copied in member latitude_ - */ - eProsima_user_DllExport void latitude( - const etsi_its_cam_msgs::msg::Latitude& _latitude); - - /*! - * @brief This function moves the value in member latitude_ - * @param _latitude New value to be moved in member latitude_ - */ - eProsima_user_DllExport void latitude( - etsi_its_cam_msgs::msg::Latitude&& _latitude); - - /*! - * @brief This function returns a constant reference to member latitude_ - * @return Constant reference to member latitude_ - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& latitude() const; - - /*! - * @brief This function returns a reference to member latitude_ - * @return Reference to member latitude_ - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& latitude(); - /*! - * @brief This function copies the value in member longitude_ - * @param _longitude New value to be copied in member longitude_ - */ - eProsima_user_DllExport void longitude( - const etsi_its_cam_msgs::msg::Longitude& _longitude); - - /*! - * @brief This function moves the value in member longitude_ - * @param _longitude New value to be moved in member longitude_ - */ - eProsima_user_DllExport void longitude( - etsi_its_cam_msgs::msg::Longitude&& _longitude); - - /*! - * @brief This function returns a constant reference to member longitude_ - * @return Constant reference to member longitude_ - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& longitude() const; - - /*! - * @brief This function returns a reference to member longitude_ - * @return Reference to member longitude_ - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& longitude(); - /*! - * @brief This function copies the value in member position_confidence_ellipse - * @param _position_confidence_ellipse New value to be copied in member position_confidence_ellipse - */ - eProsima_user_DllExport void position_confidence_ellipse( - const etsi_its_cam_msgs::msg::PosConfidenceEllipse& _position_confidence_ellipse); - - /*! - * @brief This function moves the value in member position_confidence_ellipse - * @param _position_confidence_ellipse New value to be moved in member position_confidence_ellipse - */ - eProsima_user_DllExport void position_confidence_ellipse( - etsi_its_cam_msgs::msg::PosConfidenceEllipse&& _position_confidence_ellipse); - - /*! - * @brief This function returns a constant reference to member position_confidence_ellipse - * @return Constant reference to member position_confidence_ellipse - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::PosConfidenceEllipse& position_confidence_ellipse() const; - - /*! - * @brief This function returns a reference to member position_confidence_ellipse - * @return Reference to member position_confidence_ellipse - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::PosConfidenceEllipse& position_confidence_ellipse(); - /*! - * @brief This function copies the value in member altitude_ - * @param _altitude New value to be copied in member altitude_ - */ - eProsima_user_DllExport void altitude( - const etsi_its_cam_msgs::msg::Altitude& _altitude); - - /*! - * @brief This function moves the value in member altitude_ - * @param _altitude New value to be moved in member altitude_ - */ - eProsima_user_DllExport void altitude( - etsi_its_cam_msgs::msg::Altitude&& _altitude); - - /*! - * @brief This function returns a constant reference to member altitude_ - * @return Constant reference to member altitude_ - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::Altitude& altitude() const; - - /*! - * @brief This function returns a reference to member altitude_ - * @return Reference to member altitude_ - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::Altitude& altitude(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::ReferencePosition& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::Latitude m_latitude; - etsi_its_cam_msgs::msg::Longitude m_longitude; - etsi_its_cam_msgs::msg::PosConfidenceEllipse m_position_confidence_ellipse; - etsi_its_cam_msgs::msg::Altitude m_altitude; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure ReferencePosition defined by the user in the IDL file. + * @ingroup ReferencePosition + */ +class ReferencePosition +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ReferencePosition(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ReferencePosition(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. + */ + eProsima_user_DllExport ReferencePosition( + const ReferencePosition& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. + */ + eProsima_user_DllExport ReferencePosition( + ReferencePosition&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. + */ + eProsima_user_DllExport ReferencePosition& operator =( + const ReferencePosition& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::ReferencePosition that will be copied. + */ + eProsima_user_DllExport ReferencePosition& operator =( + ReferencePosition&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ReferencePosition object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ReferencePosition& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::ReferencePosition object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ReferencePosition& x) const; + + /*! + * @brief This function copies the value in member latitude + * @param _latitude New value to be copied in member latitude + */ + eProsima_user_DllExport void latitude( + const etsi_its_cam_msgs::msg::Latitude& _latitude); + + /*! + * @brief This function moves the value in member latitude + * @param _latitude New value to be moved in member latitude + */ + eProsima_user_DllExport void latitude( + etsi_its_cam_msgs::msg::Latitude&& _latitude); + + /*! + * @brief This function returns a constant reference to member latitude + * @return Constant reference to member latitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Latitude& latitude() const; + + /*! + * @brief This function returns a reference to member latitude + * @return Reference to member latitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Latitude& latitude(); + + + /*! + * @brief This function copies the value in member longitude + * @param _longitude New value to be copied in member longitude + */ + eProsima_user_DllExport void longitude( + const etsi_its_cam_msgs::msg::Longitude& _longitude); + + /*! + * @brief This function moves the value in member longitude + * @param _longitude New value to be moved in member longitude + */ + eProsima_user_DllExport void longitude( + etsi_its_cam_msgs::msg::Longitude&& _longitude); + + /*! + * @brief This function returns a constant reference to member longitude + * @return Constant reference to member longitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Longitude& longitude() const; + + /*! + * @brief This function returns a reference to member longitude + * @return Reference to member longitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Longitude& longitude(); + + + /*! + * @brief This function copies the value in member position_confidence_ellipse + * @param _position_confidence_ellipse New value to be copied in member position_confidence_ellipse + */ + eProsima_user_DllExport void position_confidence_ellipse( + const etsi_its_cam_msgs::msg::PosConfidenceEllipse& _position_confidence_ellipse); + + /*! + * @brief This function moves the value in member position_confidence_ellipse + * @param _position_confidence_ellipse New value to be moved in member position_confidence_ellipse + */ + eProsima_user_DllExport void position_confidence_ellipse( + etsi_its_cam_msgs::msg::PosConfidenceEllipse&& _position_confidence_ellipse); + + /*! + * @brief This function returns a constant reference to member position_confidence_ellipse + * @return Constant reference to member position_confidence_ellipse + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PosConfidenceEllipse& position_confidence_ellipse() const; + + /*! + * @brief This function returns a reference to member position_confidence_ellipse + * @return Reference to member position_confidence_ellipse + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PosConfidenceEllipse& position_confidence_ellipse(); + + + /*! + * @brief This function copies the value in member altitude + * @param _altitude New value to be copied in member altitude + */ + eProsima_user_DllExport void altitude( + const etsi_its_cam_msgs::msg::Altitude& _altitude); + + /*! + * @brief This function moves the value in member altitude + * @param _altitude New value to be moved in member altitude + */ + eProsima_user_DllExport void altitude( + etsi_its_cam_msgs::msg::Altitude&& _altitude); + + /*! + * @brief This function returns a constant reference to member altitude + * @return Constant reference to member altitude + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::Altitude& altitude() const; + + /*! + * @brief This function returns a reference to member altitude + * @return Reference to member altitude + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::Altitude& altitude(); + +private: + + etsi_its_cam_msgs::msg::Latitude m_latitude; + etsi_its_cam_msgs::msg::Longitude m_longitude; + etsi_its_cam_msgs::msg::PosConfidenceEllipse m_position_confidence_ellipse; + etsi_its_cam_msgs::msg::Altitude m_altitude; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionCdrAux.hpp new file mode 100644 index 00000000000..46b37c234a4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ReferencePositionCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITIONCDRAUX_HPP_ + +#include "ReferencePosition.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_ReferencePosition_max_cdr_typesize {65UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_ReferencePosition_max_key_cdr_typesize {0UL}; + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ReferencePosition& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionCdrAux.ipp new file mode 100644 index 00000000000..885023a3e0e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionCdrAux.ipp @@ -0,0 +1,154 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ReferencePositionCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITIONCDRAUX_IPP_ + +#include "ReferencePositionCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::ReferencePosition& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.latitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.longitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.position_confidence_ellipse(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.altitude(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ReferencePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.latitude() + << eprosima::fastcdr::MemberId(1) << data.longitude() + << eprosima::fastcdr::MemberId(2) << data.position_confidence_ellipse() + << eprosima::fastcdr::MemberId(3) << data.altitude() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::ReferencePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.latitude(); + break; + + case 1: + dcdr >> data.longitude(); + break; + + case 2: + dcdr >> data.position_confidence_ellipse(); + break; + + case 3: + dcdr >> data.altitude(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::ReferencePosition& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.cxx index 7f1c30af0d2..ced2617785c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file ReferencePositionPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "ReferencePositionPubSubTypes.h" +#include "ReferencePositionCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - ReferencePositionPubSubType::ReferencePositionPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::ReferencePosition_"); - auto type_size = ReferencePosition::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = ReferencePosition::isKeyDefined(); - size_t keyLength = ReferencePosition::getKeyMaxCdrSerializedSize() > 16 ? - ReferencePosition::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ReferencePositionPubSubType::~ReferencePositionPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ReferencePositionPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - ReferencePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ReferencePositionPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - ReferencePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ReferencePositionPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ReferencePositionPubSubType::createData() - { - return reinterpret_cast(new ReferencePosition()); - } - - void ReferencePositionPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ReferencePositionPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - ReferencePosition* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ReferencePosition::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || ReferencePosition::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +ReferencePositionPubSubType::ReferencePositionPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::ReferencePosition_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ReferencePosition::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_ReferencePosition_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ReferencePositionPubSubType::~ReferencePositionPubSubType() +{ +} + +bool ReferencePositionPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ReferencePosition* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ReferencePositionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ReferencePosition* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ReferencePositionPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ReferencePositionPubSubType::createData() +{ + return reinterpret_cast(new ReferencePosition()); +} + +void ReferencePositionPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ReferencePositionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.h index c837c3ebe9e..375f9195fd6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/ReferencePositionPubSubTypes.h @@ -16,92 +16,124 @@ * @file ReferencePositionPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "ReferencePosition.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "LatitudePubSubTypes.h" +#include "PosConfidenceEllipsePubSubTypes.h" +#include "LongitudePubSubTypes.h" +#include "AltitudePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated ReferencePosition is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type ReferencePosition defined by the user in the IDL file. + * @ingroup ReferencePosition + */ +class ReferencePositionPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type ReferencePosition defined by the user in the IDL file. - * @ingroup REFERENCEPOSITION - */ - class ReferencePositionPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef ReferencePosition type; + typedef ReferencePosition type; - eProsima_user_DllExport ReferencePositionPubSubType(); + eProsima_user_DllExport ReferencePositionPubSubType(); - eProsima_user_DllExport virtual ~ReferencePositionPubSubType(); + eProsima_user_DllExport ~ReferencePositionPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) ReferencePosition(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_REFERENCEPOSITION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.cxx index e1a6fdf3763..68e2d8d25da 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.cxx @@ -14,9 +14,9 @@ /*! * @file RescueContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,111 +27,75 @@ char dummy; #endif // _WIN32 #include "RescueContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::RescueContainer::RescueContainer() -{ - // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1bdf8190 + +namespace etsi_its_cam_msgs { + +namespace msg { + +RescueContainer::RescueContainer() +{ } -etsi_its_cam_msgs::msg::RescueContainer::~RescueContainer() +RescueContainer::~RescueContainer() { } -etsi_its_cam_msgs::msg::RescueContainer::RescueContainer( +RescueContainer::RescueContainer( const RescueContainer& x) { m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; } -etsi_its_cam_msgs::msg::RescueContainer::RescueContainer( - RescueContainer&& x) +RescueContainer::RescueContainer( + RescueContainer&& x) noexcept { m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); } -etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::RescueContainer::operator =( +RescueContainer& RescueContainer::operator =( const RescueContainer& x) { m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; - return *this; } -etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::RescueContainer::operator =( - RescueContainer&& x) +RescueContainer& RescueContainer::operator =( + RescueContainer&& x) noexcept { m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); - return *this; } -bool etsi_its_cam_msgs::msg::RescueContainer::operator ==( +bool RescueContainer::operator ==( const RescueContainer& x) const { - return (m_light_bar_siren_in_use == x.m_light_bar_siren_in_use); } -bool etsi_its_cam_msgs::msg::RescueContainer::operator !=( +bool RescueContainer::operator !=( const RescueContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::RescueContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::RescueContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::RescueContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::RescueContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_light_bar_siren_in_use; - -} - -void etsi_its_cam_msgs::msg::RescueContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_light_bar_siren_in_use; -} - /*! * @brief This function copies the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use( +void RescueContainer::light_bar_siren_in_use( const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) { m_light_bar_siren_in_use = _light_bar_siren_in_use; @@ -141,7 +105,7 @@ void etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use( * @brief This function moves the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use( +void RescueContainer::light_bar_siren_in_use( etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) { m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); @@ -151,7 +115,7 @@ void etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use( * @brief This function returns a constant reference to member light_bar_siren_in_use * @return Constant reference to member light_bar_siren_in_use */ -const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use() const +const etsi_its_cam_msgs::msg::LightBarSirenInUse& RescueContainer::light_bar_siren_in_use() const { return m_light_bar_siren_in_use; } @@ -160,31 +124,18 @@ const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::Rescue * @brief This function returns a reference to member light_bar_siren_in_use * @return Reference to member light_bar_siren_in_use */ -etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RescueContainer::light_bar_siren_in_use() +etsi_its_cam_msgs::msg::LightBarSirenInUse& RescueContainer::light_bar_siren_in_use() { return m_light_bar_siren_in_use; } -size_t etsi_its_cam_msgs::msg::RescueContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::RescueContainer::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::RescueContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "RescueContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.h index a2816e37c46..9d997624d86 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainer.h @@ -16,20 +16,25 @@ * @file RescueContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_H_ -#include "LightBarSirenInUse.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "LightBarSirenInUse.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(RescueContainer_SOURCE) -#define RescueContainer_DllAPI __declspec( dllexport ) +#if defined(RESCUECONTAINER_SOURCE) +#define RESCUECONTAINER_DllAPI __declspec( dllexport ) #else -#define RescueContainer_DllAPI __declspec( dllimport ) -#endif // RescueContainer_SOURCE +#define RESCUECONTAINER_DllAPI __declspec( dllimport ) +#endif // RESCUECONTAINER_SOURCE #else -#define RescueContainer_DllAPI +#define RESCUECONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define RescueContainer_DllAPI +#define RESCUECONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure RescueContainer defined by the user in the IDL file. - * @ingroup RESCUECONTAINER - */ - class RescueContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RescueContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RescueContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. - */ - eProsima_user_DllExport RescueContainer( - const RescueContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. - */ - eProsima_user_DllExport RescueContainer( - RescueContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. - */ - eProsima_user_DllExport RescueContainer& operator =( - const RescueContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. - */ - eProsima_user_DllExport RescueContainer& operator =( - RescueContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::RescueContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RescueContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::RescueContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RescueContainer& x) const; - - /*! - * @brief This function copies the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); - - /*! - * @brief This function moves the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); - - /*! - * @brief This function returns a constant reference to member light_bar_siren_in_use - * @return Constant reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; - - /*! - * @brief This function returns a reference to member light_bar_siren_in_use - * @return Reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::RescueContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure RescueContainer defined by the user in the IDL file. + * @ingroup RescueContainer + */ +class RescueContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RescueContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RescueContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. + */ + eProsima_user_DllExport RescueContainer( + const RescueContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. + */ + eProsima_user_DllExport RescueContainer( + RescueContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. + */ + eProsima_user_DllExport RescueContainer& operator =( + const RescueContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RescueContainer that will be copied. + */ + eProsima_user_DllExport RescueContainer& operator =( + RescueContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RescueContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RescueContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RescueContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RescueContainer& x) const; + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + +private: + + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerCdrAux.hpp new file mode 100644 index 00000000000..70b865905f2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RescueContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINERCDRAUX_HPP_ + +#include "RescueContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_RescueContainer_max_cdr_typesize {113UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_RescueContainer_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RescueContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerCdrAux.ipp new file mode 100644 index 00000000000..846e1ae2908 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerCdrAux.ipp @@ -0,0 +1,130 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RescueContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINERCDRAUX_IPP_ + +#include "RescueContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::RescueContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.light_bar_siren_in_use(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RescueContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.light_bar_siren_in_use() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::RescueContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.light_bar_siren_in_use(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RescueContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.cxx index 5b2b7e13557..a82e1284bf0 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file RescueContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "RescueContainerPubSubTypes.h" +#include "RescueContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - RescueContainerPubSubType::RescueContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::RescueContainer_"); - auto type_size = RescueContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = RescueContainer::isKeyDefined(); - size_t keyLength = RescueContainer::getKeyMaxCdrSerializedSize() > 16 ? - RescueContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - RescueContainerPubSubType::~RescueContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool RescueContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - RescueContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool RescueContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - RescueContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function RescueContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* RescueContainerPubSubType::createData() - { - return reinterpret_cast(new RescueContainer()); - } - - void RescueContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool RescueContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - RescueContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - RescueContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || RescueContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +RescueContainerPubSubType::RescueContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::RescueContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(RescueContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_RescueContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +RescueContainerPubSubType::~RescueContainerPubSubType() +{ +} + +bool RescueContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + RescueContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool RescueContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + RescueContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function RescueContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* RescueContainerPubSubType::createData() +{ + return reinterpret_cast(new RescueContainer()); +} + +void RescueContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool RescueContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.h index fbd93064c10..500027b147a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RescueContainerPubSubTypes.h @@ -16,92 +16,121 @@ * @file RescueContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "RescueContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "LightBarSirenInUsePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated RescueContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type RescueContainer defined by the user in the IDL file. + * @ingroup RescueContainer + */ +class RescueContainerPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type RescueContainer defined by the user in the IDL file. - * @ingroup RESCUECONTAINER - */ - class RescueContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef RescueContainer type; + typedef RescueContainer type; - eProsima_user_DllExport RescueContainerPubSubType(); + eProsima_user_DllExport RescueContainerPubSubType(); - eProsima_user_DllExport virtual ~RescueContainerPubSubType(); + eProsima_user_DllExport ~RescueContainerPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_RESCUECONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.cxx index 19aa9fdc442..adc977f8cc5 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.cxx @@ -14,9 +14,9 @@ /*! * @file RoadWorksContainerBasic.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,37 +27,31 @@ char dummy; #endif // _WIN32 #include "RoadWorksContainerBasic.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::RoadWorksContainerBasic::RoadWorksContainerBasic() -{ - // m_roadworks_sub_cause_code com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6ffab045 - // m_roadworks_sub_cause_code_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@26fb628 - m_roadworks_sub_cause_code_is_present = false; - // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3e2943ab +namespace etsi_its_cam_msgs { - // m_closed_lanes com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@70dd7e15 +namespace msg { - // m_closed_lanes_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4a9f80d3 - m_closed_lanes_is_present = false; -} -etsi_its_cam_msgs::msg::RoadWorksContainerBasic::~RoadWorksContainerBasic() +RoadWorksContainerBasic::RoadWorksContainerBasic() { +} - - - +RoadWorksContainerBasic::~RoadWorksContainerBasic() +{ } -etsi_its_cam_msgs::msg::RoadWorksContainerBasic::RoadWorksContainerBasic( +RoadWorksContainerBasic::RoadWorksContainerBasic( const RoadWorksContainerBasic& x) { m_roadworks_sub_cause_code = x.m_roadworks_sub_cause_code; @@ -67,8 +61,8 @@ etsi_its_cam_msgs::msg::RoadWorksContainerBasic::RoadWorksContainerBasic( m_closed_lanes_is_present = x.m_closed_lanes_is_present; } -etsi_its_cam_msgs::msg::RoadWorksContainerBasic::RoadWorksContainerBasic( - RoadWorksContainerBasic&& x) +RoadWorksContainerBasic::RoadWorksContainerBasic( + RoadWorksContainerBasic&& x) noexcept { m_roadworks_sub_cause_code = std::move(x.m_roadworks_sub_cause_code); m_roadworks_sub_cause_code_is_present = x.m_roadworks_sub_cause_code_is_present; @@ -77,7 +71,7 @@ etsi_its_cam_msgs::msg::RoadWorksContainerBasic::RoadWorksContainerBasic( m_closed_lanes_is_present = x.m_closed_lanes_is_present; } -etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::operator =( +RoadWorksContainerBasic& RoadWorksContainerBasic::operator =( const RoadWorksContainerBasic& x) { @@ -86,12 +80,11 @@ etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::RoadWor m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; m_closed_lanes = x.m_closed_lanes; m_closed_lanes_is_present = x.m_closed_lanes_is_present; - return *this; } -etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::operator =( - RoadWorksContainerBasic&& x) +RoadWorksContainerBasic& RoadWorksContainerBasic::operator =( + RoadWorksContainerBasic&& x) noexcept { m_roadworks_sub_cause_code = std::move(x.m_roadworks_sub_cause_code); @@ -99,91 +92,30 @@ etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::RoadWor m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); m_closed_lanes = std::move(x.m_closed_lanes); m_closed_lanes_is_present = x.m_closed_lanes_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::operator ==( +bool RoadWorksContainerBasic::operator ==( const RoadWorksContainerBasic& x) const { - - return (m_roadworks_sub_cause_code == x.m_roadworks_sub_cause_code && m_roadworks_sub_cause_code_is_present == x.m_roadworks_sub_cause_code_is_present && m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && m_closed_lanes == x.m_closed_lanes && m_closed_lanes_is_present == x.m_closed_lanes_is_present); + return (m_roadworks_sub_cause_code == x.m_roadworks_sub_cause_code && + m_roadworks_sub_cause_code_is_present == x.m_roadworks_sub_cause_code_is_present && + m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && + m_closed_lanes == x.m_closed_lanes && + m_closed_lanes_is_present == x.m_closed_lanes_is_present); } -bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::operator !=( +bool RoadWorksContainerBasic::operator !=( const RoadWorksContainerBasic& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::ClosedLanes::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getCdrSerializedSize(data.roadworks_sub_cause_code(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::ClosedLanes::getCdrSerializedSize(data.closed_lanes(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_roadworks_sub_cause_code; - scdr << m_roadworks_sub_cause_code_is_present; - scdr << m_light_bar_siren_in_use; - scdr << m_closed_lanes; - scdr << m_closed_lanes_is_present; - -} - -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_roadworks_sub_cause_code; - dcdr >> m_roadworks_sub_cause_code_is_present; - dcdr >> m_light_bar_siren_in_use; - dcdr >> m_closed_lanes; - dcdr >> m_closed_lanes_is_present; -} - /*! * @brief This function copies the value in member roadworks_sub_cause_code * @param _roadworks_sub_cause_code New value to be copied in member roadworks_sub_cause_code */ -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code( +void RoadWorksContainerBasic::roadworks_sub_cause_code( const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& _roadworks_sub_cause_code) { m_roadworks_sub_cause_code = _roadworks_sub_cause_code; @@ -193,7 +125,7 @@ void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code( * @brief This function moves the value in member roadworks_sub_cause_code * @param _roadworks_sub_cause_code New value to be moved in member roadworks_sub_cause_code */ -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code( +void RoadWorksContainerBasic::roadworks_sub_cause_code( etsi_its_cam_msgs::msg::RoadworksSubCauseCode&& _roadworks_sub_cause_code) { m_roadworks_sub_cause_code = std::move(_roadworks_sub_cause_code); @@ -203,7 +135,7 @@ void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code( * @brief This function returns a constant reference to member roadworks_sub_cause_code * @return Constant reference to member roadworks_sub_cause_code */ -const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code() const +const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& RoadWorksContainerBasic::roadworks_sub_cause_code() const { return m_roadworks_sub_cause_code; } @@ -212,15 +144,17 @@ const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::Roa * @brief This function returns a reference to member roadworks_sub_cause_code * @return Reference to member roadworks_sub_cause_code */ -etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code() +etsi_its_cam_msgs::msg::RoadworksSubCauseCode& RoadWorksContainerBasic::roadworks_sub_cause_code() { return m_roadworks_sub_cause_code; } + + /*! * @brief This function sets a value in member roadworks_sub_cause_code_is_present * @param _roadworks_sub_cause_code_is_present New value for member roadworks_sub_cause_code_is_present */ -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code_is_present( +void RoadWorksContainerBasic::roadworks_sub_cause_code_is_present( bool _roadworks_sub_cause_code_is_present) { m_roadworks_sub_cause_code_is_present = _roadworks_sub_cause_code_is_present; @@ -230,7 +164,7 @@ void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code_i * @brief This function returns the value of member roadworks_sub_cause_code_is_present * @return Value of member roadworks_sub_cause_code_is_present */ -bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code_is_present() const +bool RoadWorksContainerBasic::roadworks_sub_cause_code_is_present() const { return m_roadworks_sub_cause_code_is_present; } @@ -239,16 +173,17 @@ bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code_i * @brief This function returns a reference to member roadworks_sub_cause_code_is_present * @return Reference to member roadworks_sub_cause_code_is_present */ -bool& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::roadworks_sub_cause_code_is_present() +bool& RoadWorksContainerBasic::roadworks_sub_cause_code_is_present() { return m_roadworks_sub_cause_code_is_present; } + /*! * @brief This function copies the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use( +void RoadWorksContainerBasic::light_bar_siren_in_use( const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) { m_light_bar_siren_in_use = _light_bar_siren_in_use; @@ -258,7 +193,7 @@ void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use( * @brief This function moves the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use( +void RoadWorksContainerBasic::light_bar_siren_in_use( etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) { m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); @@ -268,7 +203,7 @@ void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use( * @brief This function returns a constant reference to member light_bar_siren_in_use * @return Constant reference to member light_bar_siren_in_use */ -const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use() const +const etsi_its_cam_msgs::msg::LightBarSirenInUse& RoadWorksContainerBasic::light_bar_siren_in_use() const { return m_light_bar_siren_in_use; } @@ -277,15 +212,17 @@ const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RoadWo * @brief This function returns a reference to member light_bar_siren_in_use * @return Reference to member light_bar_siren_in_use */ -etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::light_bar_siren_in_use() +etsi_its_cam_msgs::msg::LightBarSirenInUse& RoadWorksContainerBasic::light_bar_siren_in_use() { return m_light_bar_siren_in_use; } + + /*! * @brief This function copies the value in member closed_lanes * @param _closed_lanes New value to be copied in member closed_lanes */ -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes( +void RoadWorksContainerBasic::closed_lanes( const etsi_its_cam_msgs::msg::ClosedLanes& _closed_lanes) { m_closed_lanes = _closed_lanes; @@ -295,7 +232,7 @@ void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes( * @brief This function moves the value in member closed_lanes * @param _closed_lanes New value to be moved in member closed_lanes */ -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes( +void RoadWorksContainerBasic::closed_lanes( etsi_its_cam_msgs::msg::ClosedLanes&& _closed_lanes) { m_closed_lanes = std::move(_closed_lanes); @@ -305,7 +242,7 @@ void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes( * @brief This function returns a constant reference to member closed_lanes * @return Constant reference to member closed_lanes */ -const etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes() const +const etsi_its_cam_msgs::msg::ClosedLanes& RoadWorksContainerBasic::closed_lanes() const { return m_closed_lanes; } @@ -314,15 +251,17 @@ const etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::RoadWorksCont * @brief This function returns a reference to member closed_lanes * @return Reference to member closed_lanes */ -etsi_its_cam_msgs::msg::ClosedLanes& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes() +etsi_its_cam_msgs::msg::ClosedLanes& RoadWorksContainerBasic::closed_lanes() { return m_closed_lanes; } + + /*! * @brief This function sets a value in member closed_lanes_is_present * @param _closed_lanes_is_present New value for member closed_lanes_is_present */ -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes_is_present( +void RoadWorksContainerBasic::closed_lanes_is_present( bool _closed_lanes_is_present) { m_closed_lanes_is_present = _closed_lanes_is_present; @@ -332,7 +271,7 @@ void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes_is_present( * @brief This function returns the value of member closed_lanes_is_present * @return Value of member closed_lanes_is_present */ -bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes_is_present() const +bool RoadWorksContainerBasic::closed_lanes_is_present() const { return m_closed_lanes_is_present; } @@ -341,32 +280,18 @@ bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes_is_present() * @brief This function returns a reference to member closed_lanes_is_present * @return Reference to member closed_lanes_is_present */ -bool& etsi_its_cam_msgs::msg::RoadWorksContainerBasic::closed_lanes_is_present() +bool& RoadWorksContainerBasic::closed_lanes_is_present() { return m_closed_lanes_is_present; } -size_t etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::RoadWorksContainerBasic::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::RoadWorksContainerBasic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "RoadWorksContainerBasicCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.h index 146e9d7bfa6..126c9573e7b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasic.h @@ -16,22 +16,27 @@ * @file RoadWorksContainerBasic.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "RoadworksSubCauseCode.h" #include "ClosedLanes.h" #include "LightBarSirenInUse.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -45,267 +50,228 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(RoadWorksContainerBasic_SOURCE) -#define RoadWorksContainerBasic_DllAPI __declspec( dllexport ) +#if defined(ROADWORKSCONTAINERBASIC_SOURCE) +#define ROADWORKSCONTAINERBASIC_DllAPI __declspec( dllexport ) #else -#define RoadWorksContainerBasic_DllAPI __declspec( dllimport ) -#endif // RoadWorksContainerBasic_SOURCE +#define ROADWORKSCONTAINERBASIC_DllAPI __declspec( dllimport ) +#endif // ROADWORKSCONTAINERBASIC_SOURCE #else -#define RoadWorksContainerBasic_DllAPI +#define ROADWORKSCONTAINERBASIC_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define RoadWorksContainerBasic_DllAPI +#define ROADWORKSCONTAINERBASIC_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure RoadWorksContainerBasic defined by the user in the IDL file. - * @ingroup ROADWORKSCONTAINERBASIC - */ - class RoadWorksContainerBasic - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RoadWorksContainerBasic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RoadWorksContainerBasic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. - */ - eProsima_user_DllExport RoadWorksContainerBasic( - const RoadWorksContainerBasic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. - */ - eProsima_user_DllExport RoadWorksContainerBasic( - RoadWorksContainerBasic&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. - */ - eProsima_user_DllExport RoadWorksContainerBasic& operator =( - const RoadWorksContainerBasic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. - */ - eProsima_user_DllExport RoadWorksContainerBasic& operator =( - RoadWorksContainerBasic&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::RoadWorksContainerBasic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RoadWorksContainerBasic& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::RoadWorksContainerBasic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RoadWorksContainerBasic& x) const; - - /*! - * @brief This function copies the value in member roadworks_sub_cause_code - * @param _roadworks_sub_cause_code New value to be copied in member roadworks_sub_cause_code - */ - eProsima_user_DllExport void roadworks_sub_cause_code( - const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& _roadworks_sub_cause_code); - - /*! - * @brief This function moves the value in member roadworks_sub_cause_code - * @param _roadworks_sub_cause_code New value to be moved in member roadworks_sub_cause_code - */ - eProsima_user_DllExport void roadworks_sub_cause_code( - etsi_its_cam_msgs::msg::RoadworksSubCauseCode&& _roadworks_sub_cause_code); - - /*! - * @brief This function returns a constant reference to member roadworks_sub_cause_code - * @return Constant reference to member roadworks_sub_cause_code - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& roadworks_sub_cause_code() const; - - /*! - * @brief This function returns a reference to member roadworks_sub_cause_code - * @return Reference to member roadworks_sub_cause_code - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::RoadworksSubCauseCode& roadworks_sub_cause_code(); - /*! - * @brief This function sets a value in member roadworks_sub_cause_code_is_present - * @param _roadworks_sub_cause_code_is_present New value for member roadworks_sub_cause_code_is_present - */ - eProsima_user_DllExport void roadworks_sub_cause_code_is_present( - bool _roadworks_sub_cause_code_is_present); - - /*! - * @brief This function returns the value of member roadworks_sub_cause_code_is_present - * @return Value of member roadworks_sub_cause_code_is_present - */ - eProsima_user_DllExport bool roadworks_sub_cause_code_is_present() const; - - /*! - * @brief This function returns a reference to member roadworks_sub_cause_code_is_present - * @return Reference to member roadworks_sub_cause_code_is_present - */ - eProsima_user_DllExport bool& roadworks_sub_cause_code_is_present(); - - /*! - * @brief This function copies the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); - - /*! - * @brief This function moves the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); - - /*! - * @brief This function returns a constant reference to member light_bar_siren_in_use - * @return Constant reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; - - /*! - * @brief This function returns a reference to member light_bar_siren_in_use - * @return Reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); - /*! - * @brief This function copies the value in member closed_lanes - * @param _closed_lanes New value to be copied in member closed_lanes - */ - eProsima_user_DllExport void closed_lanes( - const etsi_its_cam_msgs::msg::ClosedLanes& _closed_lanes); - - /*! - * @brief This function moves the value in member closed_lanes - * @param _closed_lanes New value to be moved in member closed_lanes - */ - eProsima_user_DllExport void closed_lanes( - etsi_its_cam_msgs::msg::ClosedLanes&& _closed_lanes); - - /*! - * @brief This function returns a constant reference to member closed_lanes - * @return Constant reference to member closed_lanes - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::ClosedLanes& closed_lanes() const; - - /*! - * @brief This function returns a reference to member closed_lanes - * @return Reference to member closed_lanes - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::ClosedLanes& closed_lanes(); - /*! - * @brief This function sets a value in member closed_lanes_is_present - * @param _closed_lanes_is_present New value for member closed_lanes_is_present - */ - eProsima_user_DllExport void closed_lanes_is_present( - bool _closed_lanes_is_present); - - /*! - * @brief This function returns the value of member closed_lanes_is_present - * @return Value of member closed_lanes_is_present - */ - eProsima_user_DllExport bool closed_lanes_is_present() const; - - /*! - * @brief This function returns a reference to member closed_lanes_is_present - * @return Reference to member closed_lanes_is_present - */ - eProsima_user_DllExport bool& closed_lanes_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::RoadworksSubCauseCode m_roadworks_sub_cause_code; - bool m_roadworks_sub_cause_code_is_present; - etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; - etsi_its_cam_msgs::msg::ClosedLanes m_closed_lanes; - bool m_closed_lanes_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure RoadWorksContainerBasic defined by the user in the IDL file. + * @ingroup RoadWorksContainerBasic + */ +class RoadWorksContainerBasic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RoadWorksContainerBasic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RoadWorksContainerBasic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. + */ + eProsima_user_DllExport RoadWorksContainerBasic( + const RoadWorksContainerBasic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. + */ + eProsima_user_DllExport RoadWorksContainerBasic( + RoadWorksContainerBasic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. + */ + eProsima_user_DllExport RoadWorksContainerBasic& operator =( + const RoadWorksContainerBasic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadWorksContainerBasic that will be copied. + */ + eProsima_user_DllExport RoadWorksContainerBasic& operator =( + RoadWorksContainerBasic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RoadWorksContainerBasic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RoadWorksContainerBasic& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RoadWorksContainerBasic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RoadWorksContainerBasic& x) const; + + /*! + * @brief This function copies the value in member roadworks_sub_cause_code + * @param _roadworks_sub_cause_code New value to be copied in member roadworks_sub_cause_code + */ + eProsima_user_DllExport void roadworks_sub_cause_code( + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& _roadworks_sub_cause_code); + + /*! + * @brief This function moves the value in member roadworks_sub_cause_code + * @param _roadworks_sub_cause_code New value to be moved in member roadworks_sub_cause_code + */ + eProsima_user_DllExport void roadworks_sub_cause_code( + etsi_its_cam_msgs::msg::RoadworksSubCauseCode&& _roadworks_sub_cause_code); + + /*! + * @brief This function returns a constant reference to member roadworks_sub_cause_code + * @return Constant reference to member roadworks_sub_cause_code + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& roadworks_sub_cause_code() const; + + /*! + * @brief This function returns a reference to member roadworks_sub_cause_code + * @return Reference to member roadworks_sub_cause_code + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::RoadworksSubCauseCode& roadworks_sub_cause_code(); + + + /*! + * @brief This function sets a value in member roadworks_sub_cause_code_is_present + * @param _roadworks_sub_cause_code_is_present New value for member roadworks_sub_cause_code_is_present + */ + eProsima_user_DllExport void roadworks_sub_cause_code_is_present( + bool _roadworks_sub_cause_code_is_present); + + /*! + * @brief This function returns the value of member roadworks_sub_cause_code_is_present + * @return Value of member roadworks_sub_cause_code_is_present + */ + eProsima_user_DllExport bool roadworks_sub_cause_code_is_present() const; + + /*! + * @brief This function returns a reference to member roadworks_sub_cause_code_is_present + * @return Reference to member roadworks_sub_cause_code_is_present + */ + eProsima_user_DllExport bool& roadworks_sub_cause_code_is_present(); + + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + + + /*! + * @brief This function copies the value in member closed_lanes + * @param _closed_lanes New value to be copied in member closed_lanes + */ + eProsima_user_DllExport void closed_lanes( + const etsi_its_cam_msgs::msg::ClosedLanes& _closed_lanes); + + /*! + * @brief This function moves the value in member closed_lanes + * @param _closed_lanes New value to be moved in member closed_lanes + */ + eProsima_user_DllExport void closed_lanes( + etsi_its_cam_msgs::msg::ClosedLanes&& _closed_lanes); + + /*! + * @brief This function returns a constant reference to member closed_lanes + * @return Constant reference to member closed_lanes + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::ClosedLanes& closed_lanes() const; + + /*! + * @brief This function returns a reference to member closed_lanes + * @return Reference to member closed_lanes + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::ClosedLanes& closed_lanes(); + + + /*! + * @brief This function sets a value in member closed_lanes_is_present + * @param _closed_lanes_is_present New value for member closed_lanes_is_present + */ + eProsima_user_DllExport void closed_lanes_is_present( + bool _closed_lanes_is_present); + + /*! + * @brief This function returns the value of member closed_lanes_is_present + * @return Value of member closed_lanes_is_present + */ + eProsima_user_DllExport bool closed_lanes_is_present() const; + + /*! + * @brief This function returns a reference to member closed_lanes_is_present + * @return Reference to member closed_lanes_is_present + */ + eProsima_user_DllExport bool& closed_lanes_is_present(); + +private: + + etsi_its_cam_msgs::msg::RoadworksSubCauseCode m_roadworks_sub_cause_code; + bool m_roadworks_sub_cause_code_is_present{false}; + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + etsi_its_cam_msgs::msg::ClosedLanes m_closed_lanes; + bool m_closed_lanes_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicCdrAux.hpp new file mode 100644 index 00000000000..7638d56ae64 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadWorksContainerBasicCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASICCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASICCDRAUX_HPP_ + +#include "RoadWorksContainerBasic.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_RoadWorksContainerBasic_max_cdr_typesize {255UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_RoadWorksContainerBasic_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASICCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicCdrAux.ipp new file mode 100644 index 00000000000..ced5f3f37d3 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicCdrAux.ipp @@ -0,0 +1,162 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadWorksContainerBasicCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASICCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASICCDRAUX_IPP_ + +#include "RoadWorksContainerBasicCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.roadworks_sub_cause_code(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.roadworks_sub_cause_code_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.light_bar_siren_in_use(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.closed_lanes(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.closed_lanes_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.roadworks_sub_cause_code() + << eprosima::fastcdr::MemberId(1) << data.roadworks_sub_cause_code_is_present() + << eprosima::fastcdr::MemberId(2) << data.light_bar_siren_in_use() + << eprosima::fastcdr::MemberId(3) << data.closed_lanes() + << eprosima::fastcdr::MemberId(4) << data.closed_lanes_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.roadworks_sub_cause_code(); + break; + + case 1: + dcdr >> data.roadworks_sub_cause_code_is_present(); + break; + + case 2: + dcdr >> data.light_bar_siren_in_use(); + break; + + case 3: + dcdr >> data.closed_lanes(); + break; + + case 4: + dcdr >> data.closed_lanes_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASICCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.cxx index 7f28f1f3f06..51b934d446a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file RoadWorksContainerBasicPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "RoadWorksContainerBasicPubSubTypes.h" +#include "RoadWorksContainerBasicCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - RoadWorksContainerBasicPubSubType::RoadWorksContainerBasicPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::RoadWorksContainerBasic_"); - auto type_size = RoadWorksContainerBasic::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = RoadWorksContainerBasic::isKeyDefined(); - size_t keyLength = RoadWorksContainerBasic::getKeyMaxCdrSerializedSize() > 16 ? - RoadWorksContainerBasic::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - RoadWorksContainerBasicPubSubType::~RoadWorksContainerBasicPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool RoadWorksContainerBasicPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - RoadWorksContainerBasic* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool RoadWorksContainerBasicPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - RoadWorksContainerBasic* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function RoadWorksContainerBasicPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* RoadWorksContainerBasicPubSubType::createData() - { - return reinterpret_cast(new RoadWorksContainerBasic()); - } - - void RoadWorksContainerBasicPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool RoadWorksContainerBasicPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - RoadWorksContainerBasic* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - RoadWorksContainerBasic::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || RoadWorksContainerBasic::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +RoadWorksContainerBasicPubSubType::RoadWorksContainerBasicPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::RoadWorksContainerBasic_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(RoadWorksContainerBasic::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_RoadWorksContainerBasic_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +RoadWorksContainerBasicPubSubType::~RoadWorksContainerBasicPubSubType() +{ +} + +bool RoadWorksContainerBasicPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + RoadWorksContainerBasic* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool RoadWorksContainerBasicPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + RoadWorksContainerBasic* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function RoadWorksContainerBasicPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* RoadWorksContainerBasicPubSubType::createData() +{ + return reinterpret_cast(new RoadWorksContainerBasic()); +} + +void RoadWorksContainerBasicPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool RoadWorksContainerBasicPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.h index ba8645908e9..77ce78643c8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadWorksContainerBasicPubSubTypes.h @@ -16,92 +16,123 @@ * @file RoadWorksContainerBasicPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "RoadWorksContainerBasic.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "RoadworksSubCauseCodePubSubTypes.h" +#include "ClosedLanesPubSubTypes.h" +#include "LightBarSirenInUsePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated RoadWorksContainerBasic is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type RoadWorksContainerBasic defined by the user in the IDL file. + * @ingroup RoadWorksContainerBasic + */ +class RoadWorksContainerBasicPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type RoadWorksContainerBasic defined by the user in the IDL file. - * @ingroup ROADWORKSCONTAINERBASIC - */ - class RoadWorksContainerBasicPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef RoadWorksContainerBasic type; + typedef RoadWorksContainerBasic type; - eProsima_user_DllExport RoadWorksContainerBasicPubSubType(); + eProsima_user_DllExport RoadWorksContainerBasicPubSubType(); - eProsima_user_DllExport virtual ~RoadWorksContainerBasicPubSubType(); + eProsima_user_DllExport ~RoadWorksContainerBasicPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSCONTAINERBASIC_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.cxx index 27b98d6d0be..b4bd64536b2 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.cxx @@ -14,9 +14,9 @@ /*! * @file RoadworksSubCauseCode.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,123 +27,79 @@ char dummy; #endif // _WIN32 #include "RoadworksSubCauseCode.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace RoadworksSubCauseCode_Constants { +} // namespace RoadworksSubCauseCode_Constants - - - -etsi_its_cam_msgs::msg::RoadworksSubCauseCode::RoadworksSubCauseCode() +RoadworksSubCauseCode::RoadworksSubCauseCode() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@89ff02e - m_value = 0; - } -etsi_its_cam_msgs::msg::RoadworksSubCauseCode::~RoadworksSubCauseCode() +RoadworksSubCauseCode::~RoadworksSubCauseCode() { } -etsi_its_cam_msgs::msg::RoadworksSubCauseCode::RoadworksSubCauseCode( +RoadworksSubCauseCode::RoadworksSubCauseCode( const RoadworksSubCauseCode& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::RoadworksSubCauseCode::RoadworksSubCauseCode( - RoadworksSubCauseCode&& x) +RoadworksSubCauseCode::RoadworksSubCauseCode( + RoadworksSubCauseCode&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::RoadworksSubCauseCode::operator =( +RoadworksSubCauseCode& RoadworksSubCauseCode::operator =( const RoadworksSubCauseCode& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::RoadworksSubCauseCode& etsi_its_cam_msgs::msg::RoadworksSubCauseCode::operator =( - RoadworksSubCauseCode&& x) +RoadworksSubCauseCode& RoadworksSubCauseCode::operator =( + RoadworksSubCauseCode&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::RoadworksSubCauseCode::operator ==( +bool RoadworksSubCauseCode::operator ==( const RoadworksSubCauseCode& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::RoadworksSubCauseCode::operator !=( +bool RoadworksSubCauseCode::operator !=( const RoadworksSubCauseCode& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::value( +void RoadworksSubCauseCode::value( uint8_t _value) { m_value = _value; @@ -153,7 +109,7 @@ void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::value() const +uint8_t RoadworksSubCauseCode::value() const { return m_value; } @@ -162,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::RoadworksSubCauseCode::value() +uint8_t& RoadworksSubCauseCode::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::RoadworksSubCauseCode::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::RoadworksSubCauseCode::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::RoadworksSubCauseCode::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "RoadworksSubCauseCodeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.h index b81fec0d395..765e4ed1851 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCode.h @@ -16,19 +16,24 @@ * @file RoadworksSubCauseCode.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,180 +47,136 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(RoadworksSubCauseCode_SOURCE) -#define RoadworksSubCauseCode_DllAPI __declspec( dllexport ) +#if defined(ROADWORKSSUBCAUSECODE_SOURCE) +#define ROADWORKSSUBCAUSECODE_DllAPI __declspec( dllexport ) #else -#define RoadworksSubCauseCode_DllAPI __declspec( dllimport ) -#endif // RoadworksSubCauseCode_SOURCE +#define ROADWORKSSUBCAUSECODE_DllAPI __declspec( dllimport ) +#endif // ROADWORKSSUBCAUSECODE_SOURCE #else -#define RoadworksSubCauseCode_DllAPI +#define ROADWORKSSUBCAUSECODE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define RoadworksSubCauseCode_DllAPI +#define ROADWORKSSUBCAUSECODE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace RoadworksSubCauseCode_Constants { - const uint8_t MIN = 0; - const uint8_t MAX = 255; - const uint8_t UNAVAILABLE = 0; - const uint8_t MAJOR_ROADWORKS = 1; - const uint8_t ROAD_MARKING_WORK = 2; - const uint8_t SLOW_MOVING_ROAD_MAINTENANCE = 3; - const uint8_t SHORT_TERM_STATIONARY_ROADWORKS = 4; - const uint8_t STREET_CLEANING = 5; - const uint8_t WINTER_SERVICE = 6; - } // namespace RoadworksSubCauseCode_Constants - /*! - * @brief This class represents the structure RoadworksSubCauseCode defined by the user in the IDL file. - * @ingroup ROADWORKSSUBCAUSECODE - */ - class RoadworksSubCauseCode - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RoadworksSubCauseCode(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RoadworksSubCauseCode(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. - */ - eProsima_user_DllExport RoadworksSubCauseCode( - const RoadworksSubCauseCode& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. - */ - eProsima_user_DllExport RoadworksSubCauseCode( - RoadworksSubCauseCode&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. - */ - eProsima_user_DllExport RoadworksSubCauseCode& operator =( - const RoadworksSubCauseCode& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. - */ - eProsima_user_DllExport RoadworksSubCauseCode& operator =( - RoadworksSubCauseCode&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::RoadworksSubCauseCode object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RoadworksSubCauseCode& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::RoadworksSubCauseCode object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RoadworksSubCauseCode& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace RoadworksSubCauseCode_Constants { + +const uint8_t MIN = 0; +const uint8_t MAX = 255; +const uint8_t UNAVAILABLE = 0; +const uint8_t MAJOR_ROADWORKS = 1; +const uint8_t ROAD_MARKING_WORK = 2; +const uint8_t SLOW_MOVING_ROAD_MAINTENANCE = 3; +const uint8_t SHORT_TERM_STATIONARY_ROADWORKS = 4; +const uint8_t STREET_CLEANING = 5; +const uint8_t WINTER_SERVICE = 6; + +} // namespace RoadworksSubCauseCode_Constants + + +/*! + * @brief This class represents the structure RoadworksSubCauseCode defined by the user in the IDL file. + * @ingroup RoadworksSubCauseCode + */ +class RoadworksSubCauseCode +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RoadworksSubCauseCode(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RoadworksSubCauseCode(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. + */ + eProsima_user_DllExport RoadworksSubCauseCode( + const RoadworksSubCauseCode& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. + */ + eProsima_user_DllExport RoadworksSubCauseCode( + RoadworksSubCauseCode&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. + */ + eProsima_user_DllExport RoadworksSubCauseCode& operator =( + const RoadworksSubCauseCode& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::RoadworksSubCauseCode that will be copied. + */ + eProsima_user_DllExport RoadworksSubCauseCode& operator =( + RoadworksSubCauseCode&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RoadworksSubCauseCode object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RoadworksSubCauseCode& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::RoadworksSubCauseCode object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RoadworksSubCauseCode& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodeCdrAux.hpp new file mode 100644 index 00000000000..8526cbcc029 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodeCdrAux.hpp @@ -0,0 +1,69 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadworksSubCauseCodeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODECDRAUX_HPP_ + +#include "RoadworksSubCauseCode.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_RoadworksSubCauseCode_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_RoadworksSubCauseCode_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodeCdrAux.ipp new file mode 100644 index 00000000000..87ddbdeeaae --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodeCdrAux.ipp @@ -0,0 +1,149 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RoadworksSubCauseCodeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODECDRAUX_IPP_ + +#include "RoadworksSubCauseCodeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::RoadworksSubCauseCode& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.cxx index 58926c36eab..7ce97e795c6 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.cxx @@ -16,173 +16,205 @@ * @file RoadworksSubCauseCodePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "RoadworksSubCauseCodePubSubTypes.h" +#include "RoadworksSubCauseCodeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace RoadworksSubCauseCode_Constants { - - - - - - - - - - - } //End of namespace RoadworksSubCauseCode_Constants - RoadworksSubCauseCodePubSubType::RoadworksSubCauseCodePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::RoadworksSubCauseCode_"); - auto type_size = RoadworksSubCauseCode::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = RoadworksSubCauseCode::isKeyDefined(); - size_t keyLength = RoadworksSubCauseCode::getKeyMaxCdrSerializedSize() > 16 ? - RoadworksSubCauseCode::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - RoadworksSubCauseCodePubSubType::~RoadworksSubCauseCodePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool RoadworksSubCauseCodePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - RoadworksSubCauseCode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool RoadworksSubCauseCodePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - RoadworksSubCauseCode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function RoadworksSubCauseCodePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* RoadworksSubCauseCodePubSubType::createData() - { - return reinterpret_cast(new RoadworksSubCauseCode()); - } - - void RoadworksSubCauseCodePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool RoadworksSubCauseCodePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - RoadworksSubCauseCode* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - RoadworksSubCauseCode::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || RoadworksSubCauseCode::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace RoadworksSubCauseCode_Constants { + + + + + + + + + + + + + + + + + + + +} //End of namespace RoadworksSubCauseCode_Constants + + + +RoadworksSubCauseCodePubSubType::RoadworksSubCauseCodePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::RoadworksSubCauseCode_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(RoadworksSubCauseCode::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_RoadworksSubCauseCode_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +RoadworksSubCauseCodePubSubType::~RoadworksSubCauseCodePubSubType() +{ +} + +bool RoadworksSubCauseCodePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + RoadworksSubCauseCode* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool RoadworksSubCauseCodePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + RoadworksSubCauseCode* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function RoadworksSubCauseCodePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* RoadworksSubCauseCodePubSubType::createData() +{ + return reinterpret_cast(new RoadworksSubCauseCode()); +} + +void RoadworksSubCauseCodePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool RoadworksSubCauseCodePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.h index 6ea5a7a275c..ba1ad743091 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/RoadworksSubCauseCodePubSubTypes.h @@ -16,104 +16,140 @@ * @file RoadworksSubCauseCodePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "RoadworksSubCauseCode.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated RoadworksSubCauseCode is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace RoadworksSubCauseCode_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace RoadworksSubCauseCode_Constants { + + + + + + + + + + + + + +} // namespace RoadworksSubCauseCode_Constants +/*! + * @brief This class represents the TopicDataType of the type RoadworksSubCauseCode defined by the user in the IDL file. + * @ingroup RoadworksSubCauseCode + */ +class RoadworksSubCauseCodePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - } - /*! - * @brief This class represents the TopicDataType of the type RoadworksSubCauseCode defined by the user in the IDL file. - * @ingroup ROADWORKSSUBCAUSECODE - */ - class RoadworksSubCauseCodePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef RoadworksSubCauseCode type; - typedef RoadworksSubCauseCode type; + eProsima_user_DllExport RoadworksSubCauseCodePubSubType(); - eProsima_user_DllExport RoadworksSubCauseCodePubSubType(); + eProsima_user_DllExport ~RoadworksSubCauseCodePubSubType() override; - eProsima_user_DllExport virtual ~RoadworksSubCauseCodePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) RoadworksSubCauseCode(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_ROADWORKSSUBCAUSECODE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.cxx index ab332dfa7ba..7cf3f776566 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.cxx @@ -14,9 +14,9 @@ /*! * @file SafetyCarContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,43 +27,31 @@ char dummy; #endif // _WIN32 #include "SafetyCarContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::SafetyCarContainer::SafetyCarContainer() -{ - // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5b58ed3c - // m_incident_indication com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@24faea88 +namespace etsi_its_cam_msgs { - // m_incident_indication_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3a320ade - m_incident_indication_is_present = false; - // m_traffic_rule com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@64beebb7 +namespace msg { - // m_traffic_rule_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7813cb11 - m_traffic_rule_is_present = false; - // m_speed_limit com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@bcec031 - // m_speed_limit_is_present com.eprosima.idl.parser.typecode.PrimitiveTypeCode@21005f6c - m_speed_limit_is_present = false; +SafetyCarContainer::SafetyCarContainer() +{ } -etsi_its_cam_msgs::msg::SafetyCarContainer::~SafetyCarContainer() +SafetyCarContainer::~SafetyCarContainer() { - - - - - - } -etsi_its_cam_msgs::msg::SafetyCarContainer::SafetyCarContainer( +SafetyCarContainer::SafetyCarContainer( const SafetyCarContainer& x) { m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; @@ -75,8 +63,8 @@ etsi_its_cam_msgs::msg::SafetyCarContainer::SafetyCarContainer( m_speed_limit_is_present = x.m_speed_limit_is_present; } -etsi_its_cam_msgs::msg::SafetyCarContainer::SafetyCarContainer( - SafetyCarContainer&& x) +SafetyCarContainer::SafetyCarContainer( + SafetyCarContainer&& x) noexcept { m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); m_incident_indication = std::move(x.m_incident_indication); @@ -87,7 +75,7 @@ etsi_its_cam_msgs::msg::SafetyCarContainer::SafetyCarContainer( m_speed_limit_is_present = x.m_speed_limit_is_present; } -etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SafetyCarContainer::operator =( +SafetyCarContainer& SafetyCarContainer::operator =( const SafetyCarContainer& x) { @@ -98,12 +86,11 @@ etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SafetyCarCon m_traffic_rule_is_present = x.m_traffic_rule_is_present; m_speed_limit = x.m_speed_limit; m_speed_limit_is_present = x.m_speed_limit_is_present; - return *this; } -etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SafetyCarContainer::operator =( - SafetyCarContainer&& x) +SafetyCarContainer& SafetyCarContainer::operator =( + SafetyCarContainer&& x) noexcept { m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); @@ -113,103 +100,32 @@ etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SafetyCarCon m_traffic_rule_is_present = x.m_traffic_rule_is_present; m_speed_limit = std::move(x.m_speed_limit); m_speed_limit_is_present = x.m_speed_limit_is_present; - return *this; } -bool etsi_its_cam_msgs::msg::SafetyCarContainer::operator ==( +bool SafetyCarContainer::operator ==( const SafetyCarContainer& x) const { - - return (m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && m_incident_indication == x.m_incident_indication && m_incident_indication_is_present == x.m_incident_indication_is_present && m_traffic_rule == x.m_traffic_rule && m_traffic_rule_is_present == x.m_traffic_rule_is_present && m_speed_limit == x.m_speed_limit && m_speed_limit_is_present == x.m_speed_limit_is_present); + return (m_light_bar_siren_in_use == x.m_light_bar_siren_in_use && + m_incident_indication == x.m_incident_indication && + m_incident_indication_is_present == x.m_incident_indication_is_present && + m_traffic_rule == x.m_traffic_rule && + m_traffic_rule_is_present == x.m_traffic_rule_is_present && + m_speed_limit == x.m_speed_limit && + m_speed_limit_is_present == x.m_speed_limit_is_present); } -bool etsi_its_cam_msgs::msg::SafetyCarContainer::operator !=( +bool SafetyCarContainer::operator !=( const SafetyCarContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SafetyCarContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CauseCode::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::TrafficRule::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::SpeedLimit::getMaxCdrSerializedSize(current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SafetyCarContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SafetyCarContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::CauseCode::getCdrSerializedSize(data.incident_indication(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::TrafficRule::getCdrSerializedSize(data.traffic_rule(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::SpeedLimit::getCdrSerializedSize(data.speed_limit(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SafetyCarContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_light_bar_siren_in_use; - scdr << m_incident_indication; - scdr << m_incident_indication_is_present; - scdr << m_traffic_rule; - scdr << m_traffic_rule_is_present; - scdr << m_speed_limit; - scdr << m_speed_limit_is_present; - -} - -void etsi_its_cam_msgs::msg::SafetyCarContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_light_bar_siren_in_use; - dcdr >> m_incident_indication; - dcdr >> m_incident_indication_is_present; - dcdr >> m_traffic_rule; - dcdr >> m_traffic_rule_is_present; - dcdr >> m_speed_limit; - dcdr >> m_speed_limit_is_present; -} - /*! * @brief This function copies the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use( +void SafetyCarContainer::light_bar_siren_in_use( const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) { m_light_bar_siren_in_use = _light_bar_siren_in_use; @@ -219,7 +135,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use( * @brief This function moves the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use( +void SafetyCarContainer::light_bar_siren_in_use( etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) { m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); @@ -229,7 +145,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use( * @brief This function returns a constant reference to member light_bar_siren_in_use * @return Constant reference to member light_bar_siren_in_use */ -const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use() const +const etsi_its_cam_msgs::msg::LightBarSirenInUse& SafetyCarContainer::light_bar_siren_in_use() const { return m_light_bar_siren_in_use; } @@ -238,15 +154,17 @@ const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::Safety * @brief This function returns a reference to member light_bar_siren_in_use * @return Reference to member light_bar_siren_in_use */ -etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::SafetyCarContainer::light_bar_siren_in_use() +etsi_its_cam_msgs::msg::LightBarSirenInUse& SafetyCarContainer::light_bar_siren_in_use() { return m_light_bar_siren_in_use; } + + /*! * @brief This function copies the value in member incident_indication * @param _incident_indication New value to be copied in member incident_indication */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication( +void SafetyCarContainer::incident_indication( const etsi_its_cam_msgs::msg::CauseCode& _incident_indication) { m_incident_indication = _incident_indication; @@ -256,7 +174,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication( * @brief This function moves the value in member incident_indication * @param _incident_indication New value to be moved in member incident_indication */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication( +void SafetyCarContainer::incident_indication( etsi_its_cam_msgs::msg::CauseCode&& _incident_indication) { m_incident_indication = std::move(_incident_indication); @@ -266,7 +184,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication( * @brief This function returns a constant reference to member incident_indication * @return Constant reference to member incident_indication */ -const etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication() const +const etsi_its_cam_msgs::msg::CauseCode& SafetyCarContainer::incident_indication() const { return m_incident_indication; } @@ -275,15 +193,17 @@ const etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::SafetyCarContai * @brief This function returns a reference to member incident_indication * @return Reference to member incident_indication */ -etsi_its_cam_msgs::msg::CauseCode& etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication() +etsi_its_cam_msgs::msg::CauseCode& SafetyCarContainer::incident_indication() { return m_incident_indication; } + + /*! * @brief This function sets a value in member incident_indication_is_present * @param _incident_indication_is_present New value for member incident_indication_is_present */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication_is_present( +void SafetyCarContainer::incident_indication_is_present( bool _incident_indication_is_present) { m_incident_indication_is_present = _incident_indication_is_present; @@ -293,7 +213,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication_is_present( * @brief This function returns the value of member incident_indication_is_present * @return Value of member incident_indication_is_present */ -bool etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication_is_present() const +bool SafetyCarContainer::incident_indication_is_present() const { return m_incident_indication_is_present; } @@ -302,16 +222,17 @@ bool etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication_is_present( * @brief This function returns a reference to member incident_indication_is_present * @return Reference to member incident_indication_is_present */ -bool& etsi_its_cam_msgs::msg::SafetyCarContainer::incident_indication_is_present() +bool& SafetyCarContainer::incident_indication_is_present() { return m_incident_indication_is_present; } + /*! * @brief This function copies the value in member traffic_rule * @param _traffic_rule New value to be copied in member traffic_rule */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule( +void SafetyCarContainer::traffic_rule( const etsi_its_cam_msgs::msg::TrafficRule& _traffic_rule) { m_traffic_rule = _traffic_rule; @@ -321,7 +242,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule( * @brief This function moves the value in member traffic_rule * @param _traffic_rule New value to be moved in member traffic_rule */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule( +void SafetyCarContainer::traffic_rule( etsi_its_cam_msgs::msg::TrafficRule&& _traffic_rule) { m_traffic_rule = std::move(_traffic_rule); @@ -331,7 +252,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule( * @brief This function returns a constant reference to member traffic_rule * @return Constant reference to member traffic_rule */ -const etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule() const +const etsi_its_cam_msgs::msg::TrafficRule& SafetyCarContainer::traffic_rule() const { return m_traffic_rule; } @@ -340,15 +261,17 @@ const etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::SafetyCarCont * @brief This function returns a reference to member traffic_rule * @return Reference to member traffic_rule */ -etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule() +etsi_its_cam_msgs::msg::TrafficRule& SafetyCarContainer::traffic_rule() { return m_traffic_rule; } + + /*! * @brief This function sets a value in member traffic_rule_is_present * @param _traffic_rule_is_present New value for member traffic_rule_is_present */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule_is_present( +void SafetyCarContainer::traffic_rule_is_present( bool _traffic_rule_is_present) { m_traffic_rule_is_present = _traffic_rule_is_present; @@ -358,7 +281,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule_is_present( * @brief This function returns the value of member traffic_rule_is_present * @return Value of member traffic_rule_is_present */ -bool etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule_is_present() const +bool SafetyCarContainer::traffic_rule_is_present() const { return m_traffic_rule_is_present; } @@ -367,16 +290,17 @@ bool etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule_is_present() const * @brief This function returns a reference to member traffic_rule_is_present * @return Reference to member traffic_rule_is_present */ -bool& etsi_its_cam_msgs::msg::SafetyCarContainer::traffic_rule_is_present() +bool& SafetyCarContainer::traffic_rule_is_present() { return m_traffic_rule_is_present; } + /*! * @brief This function copies the value in member speed_limit * @param _speed_limit New value to be copied in member speed_limit */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit( +void SafetyCarContainer::speed_limit( const etsi_its_cam_msgs::msg::SpeedLimit& _speed_limit) { m_speed_limit = _speed_limit; @@ -386,7 +310,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit( * @brief This function moves the value in member speed_limit * @param _speed_limit New value to be moved in member speed_limit */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit( +void SafetyCarContainer::speed_limit( etsi_its_cam_msgs::msg::SpeedLimit&& _speed_limit) { m_speed_limit = std::move(_speed_limit); @@ -396,7 +320,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit( * @brief This function returns a constant reference to member speed_limit * @return Constant reference to member speed_limit */ -const etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit() const +const etsi_its_cam_msgs::msg::SpeedLimit& SafetyCarContainer::speed_limit() const { return m_speed_limit; } @@ -405,15 +329,17 @@ const etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SafetyCarConta * @brief This function returns a reference to member speed_limit * @return Reference to member speed_limit */ -etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit() +etsi_its_cam_msgs::msg::SpeedLimit& SafetyCarContainer::speed_limit() { return m_speed_limit; } + + /*! * @brief This function sets a value in member speed_limit_is_present * @param _speed_limit_is_present New value for member speed_limit_is_present */ -void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit_is_present( +void SafetyCarContainer::speed_limit_is_present( bool _speed_limit_is_present) { m_speed_limit_is_present = _speed_limit_is_present; @@ -423,7 +349,7 @@ void etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit_is_present( * @brief This function returns the value of member speed_limit_is_present * @return Value of member speed_limit_is_present */ -bool etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit_is_present() const +bool SafetyCarContainer::speed_limit_is_present() const { return m_speed_limit_is_present; } @@ -432,32 +358,18 @@ bool etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit_is_present() const * @brief This function returns a reference to member speed_limit_is_present * @return Reference to member speed_limit_is_present */ -bool& etsi_its_cam_msgs::msg::SafetyCarContainer::speed_limit_is_present() +bool& SafetyCarContainer::speed_limit_is_present() { return m_speed_limit_is_present; } -size_t etsi_its_cam_msgs::msg::SafetyCarContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} - -bool etsi_its_cam_msgs::msg::SafetyCarContainer::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::SafetyCarContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SafetyCarContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.h index cc1d65c03db..a829a5dc9a0 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainer.h @@ -16,23 +16,28 @@ * @file SafetyCarContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "SpeedLimit.h" #include "CauseCode.h" #include "LightBarSirenInUse.h" #include "TrafficRule.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -46,313 +51,277 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SafetyCarContainer_SOURCE) -#define SafetyCarContainer_DllAPI __declspec( dllexport ) +#if defined(SAFETYCARCONTAINER_SOURCE) +#define SAFETYCARCONTAINER_DllAPI __declspec( dllexport ) #else -#define SafetyCarContainer_DllAPI __declspec( dllimport ) -#endif // SafetyCarContainer_SOURCE +#define SAFETYCARCONTAINER_DllAPI __declspec( dllimport ) +#endif // SAFETYCARCONTAINER_SOURCE #else -#define SafetyCarContainer_DllAPI +#define SAFETYCARCONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SafetyCarContainer_DllAPI +#define SAFETYCARCONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure SafetyCarContainer defined by the user in the IDL file. - * @ingroup SAFETYCARCONTAINER - */ - class SafetyCarContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SafetyCarContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SafetyCarContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. - */ - eProsima_user_DllExport SafetyCarContainer( - const SafetyCarContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. - */ - eProsima_user_DllExport SafetyCarContainer( - SafetyCarContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. - */ - eProsima_user_DllExport SafetyCarContainer& operator =( - const SafetyCarContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. - */ - eProsima_user_DllExport SafetyCarContainer& operator =( - SafetyCarContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SafetyCarContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SafetyCarContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SafetyCarContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SafetyCarContainer& x) const; - - /*! - * @brief This function copies the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); - - /*! - * @brief This function moves the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); - - /*! - * @brief This function returns a constant reference to member light_bar_siren_in_use - * @return Constant reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; - - /*! - * @brief This function returns a reference to member light_bar_siren_in_use - * @return Reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); - /*! - * @brief This function copies the value in member incident_indication - * @param _incident_indication New value to be copied in member incident_indication - */ - eProsima_user_DllExport void incident_indication( - const etsi_its_cam_msgs::msg::CauseCode& _incident_indication); - - /*! - * @brief This function moves the value in member incident_indication - * @param _incident_indication New value to be moved in member incident_indication - */ - eProsima_user_DllExport void incident_indication( - etsi_its_cam_msgs::msg::CauseCode&& _incident_indication); - - /*! - * @brief This function returns a constant reference to member incident_indication - * @return Constant reference to member incident_indication - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCode& incident_indication() const; - - /*! - * @brief This function returns a reference to member incident_indication - * @return Reference to member incident_indication - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCode& incident_indication(); - /*! - * @brief This function sets a value in member incident_indication_is_present - * @param _incident_indication_is_present New value for member incident_indication_is_present - */ - eProsima_user_DllExport void incident_indication_is_present( - bool _incident_indication_is_present); - - /*! - * @brief This function returns the value of member incident_indication_is_present - * @return Value of member incident_indication_is_present - */ - eProsima_user_DllExport bool incident_indication_is_present() const; - - /*! - * @brief This function returns a reference to member incident_indication_is_present - * @return Reference to member incident_indication_is_present - */ - eProsima_user_DllExport bool& incident_indication_is_present(); - - /*! - * @brief This function copies the value in member traffic_rule - * @param _traffic_rule New value to be copied in member traffic_rule - */ - eProsima_user_DllExport void traffic_rule( - const etsi_its_cam_msgs::msg::TrafficRule& _traffic_rule); - - /*! - * @brief This function moves the value in member traffic_rule - * @param _traffic_rule New value to be moved in member traffic_rule - */ - eProsima_user_DllExport void traffic_rule( - etsi_its_cam_msgs::msg::TrafficRule&& _traffic_rule); - - /*! - * @brief This function returns a constant reference to member traffic_rule - * @return Constant reference to member traffic_rule - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::TrafficRule& traffic_rule() const; - - /*! - * @brief This function returns a reference to member traffic_rule - * @return Reference to member traffic_rule - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::TrafficRule& traffic_rule(); - /*! - * @brief This function sets a value in member traffic_rule_is_present - * @param _traffic_rule_is_present New value for member traffic_rule_is_present - */ - eProsima_user_DllExport void traffic_rule_is_present( - bool _traffic_rule_is_present); - - /*! - * @brief This function returns the value of member traffic_rule_is_present - * @return Value of member traffic_rule_is_present - */ - eProsima_user_DllExport bool traffic_rule_is_present() const; - - /*! - * @brief This function returns a reference to member traffic_rule_is_present - * @return Reference to member traffic_rule_is_present - */ - eProsima_user_DllExport bool& traffic_rule_is_present(); - - /*! - * @brief This function copies the value in member speed_limit - * @param _speed_limit New value to be copied in member speed_limit - */ - eProsima_user_DllExport void speed_limit( - const etsi_its_cam_msgs::msg::SpeedLimit& _speed_limit); - - /*! - * @brief This function moves the value in member speed_limit - * @param _speed_limit New value to be moved in member speed_limit - */ - eProsima_user_DllExport void speed_limit( - etsi_its_cam_msgs::msg::SpeedLimit&& _speed_limit); - - /*! - * @brief This function returns a constant reference to member speed_limit - * @return Constant reference to member speed_limit - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedLimit& speed_limit() const; - - /*! - * @brief This function returns a reference to member speed_limit - * @return Reference to member speed_limit - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedLimit& speed_limit(); - /*! - * @brief This function sets a value in member speed_limit_is_present - * @param _speed_limit_is_present New value for member speed_limit_is_present - */ - eProsima_user_DllExport void speed_limit_is_present( - bool _speed_limit_is_present); - - /*! - * @brief This function returns the value of member speed_limit_is_present - * @return Value of member speed_limit_is_present - */ - eProsima_user_DllExport bool speed_limit_is_present() const; - - /*! - * @brief This function returns a reference to member speed_limit_is_present - * @return Reference to member speed_limit_is_present - */ - eProsima_user_DllExport bool& speed_limit_is_present(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SafetyCarContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; - etsi_its_cam_msgs::msg::CauseCode m_incident_indication; - bool m_incident_indication_is_present; - etsi_its_cam_msgs::msg::TrafficRule m_traffic_rule; - bool m_traffic_rule_is_present; - etsi_its_cam_msgs::msg::SpeedLimit m_speed_limit; - bool m_speed_limit_is_present; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure SafetyCarContainer defined by the user in the IDL file. + * @ingroup SafetyCarContainer + */ +class SafetyCarContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SafetyCarContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SafetyCarContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. + */ + eProsima_user_DllExport SafetyCarContainer( + const SafetyCarContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. + */ + eProsima_user_DllExport SafetyCarContainer( + SafetyCarContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. + */ + eProsima_user_DllExport SafetyCarContainer& operator =( + const SafetyCarContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SafetyCarContainer that will be copied. + */ + eProsima_user_DllExport SafetyCarContainer& operator =( + SafetyCarContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SafetyCarContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SafetyCarContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SafetyCarContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SafetyCarContainer& x) const; + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + + + /*! + * @brief This function copies the value in member incident_indication + * @param _incident_indication New value to be copied in member incident_indication + */ + eProsima_user_DllExport void incident_indication( + const etsi_its_cam_msgs::msg::CauseCode& _incident_indication); + + /*! + * @brief This function moves the value in member incident_indication + * @param _incident_indication New value to be moved in member incident_indication + */ + eProsima_user_DllExport void incident_indication( + etsi_its_cam_msgs::msg::CauseCode&& _incident_indication); + + /*! + * @brief This function returns a constant reference to member incident_indication + * @return Constant reference to member incident_indication + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::CauseCode& incident_indication() const; + + /*! + * @brief This function returns a reference to member incident_indication + * @return Reference to member incident_indication + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::CauseCode& incident_indication(); + + + /*! + * @brief This function sets a value in member incident_indication_is_present + * @param _incident_indication_is_present New value for member incident_indication_is_present + */ + eProsima_user_DllExport void incident_indication_is_present( + bool _incident_indication_is_present); + + /*! + * @brief This function returns the value of member incident_indication_is_present + * @return Value of member incident_indication_is_present + */ + eProsima_user_DllExport bool incident_indication_is_present() const; + + /*! + * @brief This function returns a reference to member incident_indication_is_present + * @return Reference to member incident_indication_is_present + */ + eProsima_user_DllExport bool& incident_indication_is_present(); + + + /*! + * @brief This function copies the value in member traffic_rule + * @param _traffic_rule New value to be copied in member traffic_rule + */ + eProsima_user_DllExport void traffic_rule( + const etsi_its_cam_msgs::msg::TrafficRule& _traffic_rule); + + /*! + * @brief This function moves the value in member traffic_rule + * @param _traffic_rule New value to be moved in member traffic_rule + */ + eProsima_user_DllExport void traffic_rule( + etsi_its_cam_msgs::msg::TrafficRule&& _traffic_rule); + + /*! + * @brief This function returns a constant reference to member traffic_rule + * @return Constant reference to member traffic_rule + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::TrafficRule& traffic_rule() const; + + /*! + * @brief This function returns a reference to member traffic_rule + * @return Reference to member traffic_rule + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::TrafficRule& traffic_rule(); + + + /*! + * @brief This function sets a value in member traffic_rule_is_present + * @param _traffic_rule_is_present New value for member traffic_rule_is_present + */ + eProsima_user_DllExport void traffic_rule_is_present( + bool _traffic_rule_is_present); + + /*! + * @brief This function returns the value of member traffic_rule_is_present + * @return Value of member traffic_rule_is_present + */ + eProsima_user_DllExport bool traffic_rule_is_present() const; + + /*! + * @brief This function returns a reference to member traffic_rule_is_present + * @return Reference to member traffic_rule_is_present + */ + eProsima_user_DllExport bool& traffic_rule_is_present(); + + + /*! + * @brief This function copies the value in member speed_limit + * @param _speed_limit New value to be copied in member speed_limit + */ + eProsima_user_DllExport void speed_limit( + const etsi_its_cam_msgs::msg::SpeedLimit& _speed_limit); + + /*! + * @brief This function moves the value in member speed_limit + * @param _speed_limit New value to be moved in member speed_limit + */ + eProsima_user_DllExport void speed_limit( + etsi_its_cam_msgs::msg::SpeedLimit&& _speed_limit); + + /*! + * @brief This function returns a constant reference to member speed_limit + * @return Constant reference to member speed_limit + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedLimit& speed_limit() const; + + /*! + * @brief This function returns a reference to member speed_limit + * @return Reference to member speed_limit + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedLimit& speed_limit(); + + + /*! + * @brief This function sets a value in member speed_limit_is_present + * @param _speed_limit_is_present New value for member speed_limit_is_present + */ + eProsima_user_DllExport void speed_limit_is_present( + bool _speed_limit_is_present); + + /*! + * @brief This function returns the value of member speed_limit_is_present + * @return Value of member speed_limit_is_present + */ + eProsima_user_DllExport bool speed_limit_is_present() const; + + /*! + * @brief This function returns a reference to member speed_limit_is_present + * @return Reference to member speed_limit_is_present + */ + eProsima_user_DllExport bool& speed_limit_is_present(); + +private: + + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + etsi_its_cam_msgs::msg::CauseCode m_incident_indication; + bool m_incident_indication_is_present{false}; + etsi_its_cam_msgs::msg::TrafficRule m_traffic_rule; + bool m_traffic_rule_is_present{false}; + etsi_its_cam_msgs::msg::SpeedLimit m_speed_limit; + bool m_speed_limit_is_present{false}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerCdrAux.hpp new file mode 100644 index 00000000000..032a8fdc675 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerCdrAux.hpp @@ -0,0 +1,53 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SafetyCarContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINERCDRAUX_HPP_ + +#include "SafetyCarContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SafetyCarContainer_max_cdr_typesize {150UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SafetyCarContainer_max_key_cdr_typesize {0UL}; + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SafetyCarContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerCdrAux.ipp new file mode 100644 index 00000000000..7379785f840 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerCdrAux.ipp @@ -0,0 +1,178 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SafetyCarContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINERCDRAUX_IPP_ + +#include "SafetyCarContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SafetyCarContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.light_bar_siren_in_use(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.incident_indication(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.incident_indication_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.traffic_rule(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.traffic_rule_is_present(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.speed_limit(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.speed_limit_is_present(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SafetyCarContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.light_bar_siren_in_use() + << eprosima::fastcdr::MemberId(1) << data.incident_indication() + << eprosima::fastcdr::MemberId(2) << data.incident_indication_is_present() + << eprosima::fastcdr::MemberId(3) << data.traffic_rule() + << eprosima::fastcdr::MemberId(4) << data.traffic_rule_is_present() + << eprosima::fastcdr::MemberId(5) << data.speed_limit() + << eprosima::fastcdr::MemberId(6) << data.speed_limit_is_present() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SafetyCarContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.light_bar_siren_in_use(); + break; + + case 1: + dcdr >> data.incident_indication(); + break; + + case 2: + dcdr >> data.incident_indication_is_present(); + break; + + case 3: + dcdr >> data.traffic_rule(); + break; + + case 4: + dcdr >> data.traffic_rule_is_present(); + break; + + case 5: + dcdr >> data.speed_limit(); + break; + + case 6: + dcdr >> data.speed_limit_is_present(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SafetyCarContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.cxx index 1c39058a1b1..3d1ab901105 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file SafetyCarContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SafetyCarContainerPubSubTypes.h" +#include "SafetyCarContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - SafetyCarContainerPubSubType::SafetyCarContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SafetyCarContainer_"); - auto type_size = SafetyCarContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SafetyCarContainer::isKeyDefined(); - size_t keyLength = SafetyCarContainer::getKeyMaxCdrSerializedSize() > 16 ? - SafetyCarContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SafetyCarContainerPubSubType::~SafetyCarContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SafetyCarContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SafetyCarContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SafetyCarContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SafetyCarContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SafetyCarContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SafetyCarContainerPubSubType::createData() - { - return reinterpret_cast(new SafetyCarContainer()); - } - - void SafetyCarContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SafetyCarContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SafetyCarContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SafetyCarContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SafetyCarContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +SafetyCarContainerPubSubType::SafetyCarContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SafetyCarContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SafetyCarContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SafetyCarContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SafetyCarContainerPubSubType::~SafetyCarContainerPubSubType() +{ +} + +bool SafetyCarContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SafetyCarContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SafetyCarContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SafetyCarContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SafetyCarContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SafetyCarContainerPubSubType::createData() +{ + return reinterpret_cast(new SafetyCarContainer()); +} + +void SafetyCarContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SafetyCarContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.h index f0770ab0dcd..49d649f38ec 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SafetyCarContainerPubSubTypes.h @@ -16,92 +16,124 @@ * @file SafetyCarContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SafetyCarContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "SpeedLimitPubSubTypes.h" +#include "CauseCodePubSubTypes.h" +#include "LightBarSirenInUsePubSubTypes.h" +#include "TrafficRulePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SafetyCarContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type SafetyCarContainer defined by the user in the IDL file. + * @ingroup SafetyCarContainer + */ +class SafetyCarContainerPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type SafetyCarContainer defined by the user in the IDL file. - * @ingroup SAFETYCARCONTAINER - */ - class SafetyCarContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef SafetyCarContainer type; + typedef SafetyCarContainer type; - eProsima_user_DllExport SafetyCarContainerPubSubType(); + eProsima_user_DllExport SafetyCarContainerPubSubType(); - eProsima_user_DllExport virtual ~SafetyCarContainerPubSubType(); + eProsima_user_DllExport ~SafetyCarContainerPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SAFETYCARCONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.cxx index 4db3bb66bd7..f5506857820 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.cxx @@ -14,9 +14,9 @@ /*! * @file SemiAxisLength.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "SemiAxisLength.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace SemiAxisLength_Constants { +} // namespace SemiAxisLength_Constants -etsi_its_cam_msgs::msg::SemiAxisLength::SemiAxisLength() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@109d724c - m_value = 0; +SemiAxisLength::SemiAxisLength() +{ } -etsi_its_cam_msgs::msg::SemiAxisLength::~SemiAxisLength() +SemiAxisLength::~SemiAxisLength() { } -etsi_its_cam_msgs::msg::SemiAxisLength::SemiAxisLength( +SemiAxisLength::SemiAxisLength( const SemiAxisLength& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SemiAxisLength::SemiAxisLength( - SemiAxisLength&& x) +SemiAxisLength::SemiAxisLength( + SemiAxisLength&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::SemiAxisLength::operator =( +SemiAxisLength& SemiAxisLength::operator =( const SemiAxisLength& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::SemiAxisLength& etsi_its_cam_msgs::msg::SemiAxisLength::operator =( - SemiAxisLength&& x) +SemiAxisLength& SemiAxisLength::operator =( + SemiAxisLength&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::SemiAxisLength::operator ==( +bool SemiAxisLength::operator ==( const SemiAxisLength& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::SemiAxisLength::operator !=( +bool SemiAxisLength::operator !=( const SemiAxisLength& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SemiAxisLength::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SemiAxisLength::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SemiAxisLength& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SemiAxisLength::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::SemiAxisLength::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::SemiAxisLength::value( +void SemiAxisLength::value( uint16_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::SemiAxisLength::value( * @brief This function returns the value of member value * @return Value of member value */ -uint16_t etsi_its_cam_msgs::msg::SemiAxisLength::value() const +uint16_t SemiAxisLength::value() const { return m_value; } @@ -158,32 +118,18 @@ uint16_t etsi_its_cam_msgs::msg::SemiAxisLength::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint16_t& etsi_its_cam_msgs::msg::SemiAxisLength::value() +uint16_t& SemiAxisLength::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::SemiAxisLength::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::SemiAxisLength::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::SemiAxisLength::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SemiAxisLengthCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.h index 42d59a56d62..2d4714c65cd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLength.h @@ -16,19 +16,24 @@ * @file SemiAxisLength.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SemiAxisLength_SOURCE) -#define SemiAxisLength_DllAPI __declspec( dllexport ) +#if defined(SEMIAXISLENGTH_SOURCE) +#define SEMIAXISLENGTH_DllAPI __declspec( dllexport ) #else -#define SemiAxisLength_DllAPI __declspec( dllimport ) -#endif // SemiAxisLength_SOURCE +#define SEMIAXISLENGTH_DllAPI __declspec( dllimport ) +#endif // SEMIAXISLENGTH_SOURCE #else -#define SemiAxisLength_DllAPI +#define SEMIAXISLENGTH_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SemiAxisLength_DllAPI +#define SEMIAXISLENGTH_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SemiAxisLength_Constants { - const uint16_t MIN = 0; - const uint16_t MAX = 4095; - const uint16_t ONE_CENTIMETER = 1; - const uint16_t OUT_OF_RANGE = 4094; - const uint16_t UNAVAILABLE = 4095; - } // namespace SemiAxisLength_Constants - /*! - * @brief This class represents the structure SemiAxisLength defined by the user in the IDL file. - * @ingroup SEMIAXISLENGTH - */ - class SemiAxisLength - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SemiAxisLength(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SemiAxisLength(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. - */ - eProsima_user_DllExport SemiAxisLength( - const SemiAxisLength& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. - */ - eProsima_user_DllExport SemiAxisLength( - SemiAxisLength&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. - */ - eProsima_user_DllExport SemiAxisLength& operator =( - const SemiAxisLength& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. - */ - eProsima_user_DllExport SemiAxisLength& operator =( - SemiAxisLength&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SemiAxisLength object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SemiAxisLength& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SemiAxisLength object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SemiAxisLength& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SemiAxisLength& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace SemiAxisLength_Constants { + +const uint16_t MIN = 0; +const uint16_t MAX = 4095; +const uint16_t ONE_CENTIMETER = 1; +const uint16_t OUT_OF_RANGE = 4094; +const uint16_t UNAVAILABLE = 4095; + +} // namespace SemiAxisLength_Constants + + +/*! + * @brief This class represents the structure SemiAxisLength defined by the user in the IDL file. + * @ingroup SemiAxisLength + */ +class SemiAxisLength +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SemiAxisLength(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SemiAxisLength(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. + */ + eProsima_user_DllExport SemiAxisLength( + const SemiAxisLength& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. + */ + eProsima_user_DllExport SemiAxisLength( + SemiAxisLength&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. + */ + eProsima_user_DllExport SemiAxisLength& operator =( + const SemiAxisLength& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SemiAxisLength that will be copied. + */ + eProsima_user_DllExport SemiAxisLength& operator =( + SemiAxisLength&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SemiAxisLength object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SemiAxisLength& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SemiAxisLength object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SemiAxisLength& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + +private: + + uint16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthCdrAux.hpp new file mode 100644 index 00000000000..9b8d8b83a75 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SemiAxisLengthCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTHCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTHCDRAUX_HPP_ + +#include "SemiAxisLength.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SemiAxisLength_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SemiAxisLength_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SemiAxisLength& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTHCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthCdrAux.ipp new file mode 100644 index 00000000000..857a6cc8343 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SemiAxisLengthCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTHCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTHCDRAUX_IPP_ + +#include "SemiAxisLengthCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SemiAxisLength& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SemiAxisLength& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SemiAxisLength& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SemiAxisLength& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTHCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.cxx index 53e4abd9bab..cd2ba3d6a05 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.cxx @@ -16,169 +16,197 @@ * @file SemiAxisLengthPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SemiAxisLengthPubSubTypes.h" +#include "SemiAxisLengthCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SemiAxisLength_Constants { - - - - - - - } //End of namespace SemiAxisLength_Constants - SemiAxisLengthPubSubType::SemiAxisLengthPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SemiAxisLength_"); - auto type_size = SemiAxisLength::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SemiAxisLength::isKeyDefined(); - size_t keyLength = SemiAxisLength::getKeyMaxCdrSerializedSize() > 16 ? - SemiAxisLength::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SemiAxisLengthPubSubType::~SemiAxisLengthPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SemiAxisLengthPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SemiAxisLength* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SemiAxisLengthPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SemiAxisLength* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SemiAxisLengthPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SemiAxisLengthPubSubType::createData() - { - return reinterpret_cast(new SemiAxisLength()); - } - - void SemiAxisLengthPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SemiAxisLengthPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SemiAxisLength* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SemiAxisLength::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SemiAxisLength::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SemiAxisLength_Constants { + + + + + + + + + + + +} //End of namespace SemiAxisLength_Constants + + + +SemiAxisLengthPubSubType::SemiAxisLengthPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SemiAxisLength_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SemiAxisLength::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SemiAxisLength_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SemiAxisLengthPubSubType::~SemiAxisLengthPubSubType() +{ +} + +bool SemiAxisLengthPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SemiAxisLength* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SemiAxisLengthPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SemiAxisLength* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SemiAxisLengthPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SemiAxisLengthPubSubType::createData() +{ + return reinterpret_cast(new SemiAxisLength()); +} + +void SemiAxisLengthPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SemiAxisLengthPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.h index ecf8b8f362d..ce852ac1c53 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SemiAxisLengthPubSubTypes.h @@ -16,100 +16,132 @@ * @file SemiAxisLengthPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SemiAxisLength.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SemiAxisLength is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SemiAxisLength_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SemiAxisLength_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type SemiAxisLength defined by the user in the IDL file. - * @ingroup SEMIAXISLENGTH - */ - class SemiAxisLengthPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SemiAxisLength type; +} // namespace SemiAxisLength_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type SemiAxisLength defined by the user in the IDL file. + * @ingroup SemiAxisLength + */ +class SemiAxisLengthPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SemiAxisLength type; + + eProsima_user_DllExport SemiAxisLengthPubSubType(); - eProsima_user_DllExport SemiAxisLengthPubSubType(); + eProsima_user_DllExport ~SemiAxisLengthPubSubType() override; - eProsima_user_DllExport virtual ~SemiAxisLengthPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SemiAxisLength(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SEMIAXISLENGTH_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.cxx index 7c8f9ec8d9e..22d94af4908 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.cxx @@ -14,9 +14,9 @@ /*! * @file SpecialTransportContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "SpecialTransportContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::SpecialTransportContainer::SpecialTransportContainer() -{ - // m_special_transport_type com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@9bd0fa6 - // m_light_bar_siren_in_use com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@59d2103b +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::SpecialTransportContainer::~SpecialTransportContainer() +SpecialTransportContainer::SpecialTransportContainer() { +} +SpecialTransportContainer::~SpecialTransportContainer() +{ } -etsi_its_cam_msgs::msg::SpecialTransportContainer::SpecialTransportContainer( +SpecialTransportContainer::SpecialTransportContainer( const SpecialTransportContainer& x) { m_special_transport_type = x.m_special_transport_type; m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; } -etsi_its_cam_msgs::msg::SpecialTransportContainer::SpecialTransportContainer( - SpecialTransportContainer&& x) +SpecialTransportContainer::SpecialTransportContainer( + SpecialTransportContainer&& x) noexcept { m_special_transport_type = std::move(x.m_special_transport_type); m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); } -etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg::SpecialTransportContainer::operator =( +SpecialTransportContainer& SpecialTransportContainer::operator =( const SpecialTransportContainer& x) { m_special_transport_type = x.m_special_transport_type; m_light_bar_siren_in_use = x.m_light_bar_siren_in_use; - return *this; } -etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg::SpecialTransportContainer::operator =( - SpecialTransportContainer&& x) +SpecialTransportContainer& SpecialTransportContainer::operator =( + SpecialTransportContainer&& x) noexcept { m_special_transport_type = std::move(x.m_special_transport_type); m_light_bar_siren_in_use = std::move(x.m_light_bar_siren_in_use); - return *this; } -bool etsi_its_cam_msgs::msg::SpecialTransportContainer::operator ==( +bool SpecialTransportContainer::operator ==( const SpecialTransportContainer& x) const { - - return (m_special_transport_type == x.m_special_transport_type && m_light_bar_siren_in_use == x.m_light_bar_siren_in_use); + return (m_special_transport_type == x.m_special_transport_type && + m_light_bar_siren_in_use == x.m_light_bar_siren_in_use); } -bool etsi_its_cam_msgs::msg::SpecialTransportContainer::operator !=( +bool SpecialTransportContainer::operator !=( const SpecialTransportContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SpecialTransportContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::SpecialTransportType::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SpecialTransportContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpecialTransportContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::SpecialTransportType::getCdrSerializedSize(data.special_transport_type(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::LightBarSirenInUse::getCdrSerializedSize(data.light_bar_siren_in_use(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SpecialTransportContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_special_transport_type; - scdr << m_light_bar_siren_in_use; - -} - -void etsi_its_cam_msgs::msg::SpecialTransportContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_special_transport_type; - dcdr >> m_light_bar_siren_in_use; -} - /*! * @brief This function copies the value in member special_transport_type * @param _special_transport_type New value to be copied in member special_transport_type */ -void etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type( +void SpecialTransportContainer::special_transport_type( const etsi_its_cam_msgs::msg::SpecialTransportType& _special_transport_type) { m_special_transport_type = _special_transport_type; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type( * @brief This function moves the value in member special_transport_type * @param _special_transport_type New value to be moved in member special_transport_type */ -void etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type( +void SpecialTransportContainer::special_transport_type( etsi_its_cam_msgs::msg::SpecialTransportType&& _special_transport_type) { m_special_transport_type = std::move(_special_transport_type); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type( * @brief This function returns a constant reference to member special_transport_type * @return Constant reference to member special_transport_type */ -const etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type() const +const etsi_its_cam_msgs::msg::SpecialTransportType& SpecialTransportContainer::special_transport_type() const { return m_special_transport_type; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::Spec * @brief This function returns a reference to member special_transport_type * @return Reference to member special_transport_type */ -etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::SpecialTransportContainer::special_transport_type() +etsi_its_cam_msgs::msg::SpecialTransportType& SpecialTransportContainer::special_transport_type() { return m_special_transport_type; } + + /*! * @brief This function copies the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use( +void SpecialTransportContainer::light_bar_siren_in_use( const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use) { m_light_bar_siren_in_use = _light_bar_siren_in_use; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use( * @brief This function moves the value in member light_bar_siren_in_use * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use */ -void etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use( +void SpecialTransportContainer::light_bar_siren_in_use( etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use) { m_light_bar_siren_in_use = std::move(_light_bar_siren_in_use); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use( * @brief This function returns a constant reference to member light_bar_siren_in_use * @return Constant reference to member light_bar_siren_in_use */ -const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use() const +const etsi_its_cam_msgs::msg::LightBarSirenInUse& SpecialTransportContainer::light_bar_siren_in_use() const { return m_light_bar_siren_in_use; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::Specia * @brief This function returns a reference to member light_bar_siren_in_use * @return Reference to member light_bar_siren_in_use */ -etsi_its_cam_msgs::msg::LightBarSirenInUse& etsi_its_cam_msgs::msg::SpecialTransportContainer::light_bar_siren_in_use() +etsi_its_cam_msgs::msg::LightBarSirenInUse& SpecialTransportContainer::light_bar_siren_in_use() { return m_light_bar_siren_in_use; } -size_t etsi_its_cam_msgs::msg::SpecialTransportContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::SpecialTransportContainer::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::SpecialTransportContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SpecialTransportContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.h index 33bd8613f87..3a62b40d2af 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainer.h @@ -16,21 +16,26 @@ * @file SpecialTransportContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_H_ -#include "SpecialTransportType.h" -#include "LightBarSirenInUse.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "SpecialTransportType.h" +#include "LightBarSirenInUse.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SpecialTransportContainer_SOURCE) -#define SpecialTransportContainer_DllAPI __declspec( dllexport ) +#if defined(SPECIALTRANSPORTCONTAINER_SOURCE) +#define SPECIALTRANSPORTCONTAINER_DllAPI __declspec( dllexport ) #else -#define SpecialTransportContainer_DllAPI __declspec( dllimport ) -#endif // SpecialTransportContainer_SOURCE +#define SPECIALTRANSPORTCONTAINER_DllAPI __declspec( dllimport ) +#endif // SPECIALTRANSPORTCONTAINER_SOURCE #else -#define SpecialTransportContainer_DllAPI +#define SPECIALTRANSPORTCONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SpecialTransportContainer_DllAPI +#define SPECIALTRANSPORTCONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure SpecialTransportContainer defined by the user in the IDL file. - * @ingroup SPECIALTRANSPORTCONTAINER - */ - class SpecialTransportContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SpecialTransportContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SpecialTransportContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. - */ - eProsima_user_DllExport SpecialTransportContainer( - const SpecialTransportContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. - */ - eProsima_user_DllExport SpecialTransportContainer( - SpecialTransportContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. - */ - eProsima_user_DllExport SpecialTransportContainer& operator =( - const SpecialTransportContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. - */ - eProsima_user_DllExport SpecialTransportContainer& operator =( - SpecialTransportContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpecialTransportContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SpecialTransportContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpecialTransportContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SpecialTransportContainer& x) const; - - /*! - * @brief This function copies the value in member special_transport_type - * @param _special_transport_type New value to be copied in member special_transport_type - */ - eProsima_user_DllExport void special_transport_type( - const etsi_its_cam_msgs::msg::SpecialTransportType& _special_transport_type); - - /*! - * @brief This function moves the value in member special_transport_type - * @param _special_transport_type New value to be moved in member special_transport_type - */ - eProsima_user_DllExport void special_transport_type( - etsi_its_cam_msgs::msg::SpecialTransportType&& _special_transport_type); - - /*! - * @brief This function returns a constant reference to member special_transport_type - * @return Constant reference to member special_transport_type - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialTransportType& special_transport_type() const; - - /*! - * @brief This function returns a reference to member special_transport_type - * @return Reference to member special_transport_type - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialTransportType& special_transport_type(); - /*! - * @brief This function copies the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); - - /*! - * @brief This function moves the value in member light_bar_siren_in_use - * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use - */ - eProsima_user_DllExport void light_bar_siren_in_use( - etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); - - /*! - * @brief This function returns a constant reference to member light_bar_siren_in_use - * @return Constant reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; - - /*! - * @brief This function returns a reference to member light_bar_siren_in_use - * @return Reference to member light_bar_siren_in_use - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpecialTransportContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::SpecialTransportType m_special_transport_type; - etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure SpecialTransportContainer defined by the user in the IDL file. + * @ingroup SpecialTransportContainer + */ +class SpecialTransportContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpecialTransportContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpecialTransportContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. + */ + eProsima_user_DllExport SpecialTransportContainer( + const SpecialTransportContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. + */ + eProsima_user_DllExport SpecialTransportContainer( + SpecialTransportContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. + */ + eProsima_user_DllExport SpecialTransportContainer& operator =( + const SpecialTransportContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportContainer that will be copied. + */ + eProsima_user_DllExport SpecialTransportContainer& operator =( + SpecialTransportContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialTransportContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpecialTransportContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialTransportContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpecialTransportContainer& x) const; + + /*! + * @brief This function copies the value in member special_transport_type + * @param _special_transport_type New value to be copied in member special_transport_type + */ + eProsima_user_DllExport void special_transport_type( + const etsi_its_cam_msgs::msg::SpecialTransportType& _special_transport_type); + + /*! + * @brief This function moves the value in member special_transport_type + * @param _special_transport_type New value to be moved in member special_transport_type + */ + eProsima_user_DllExport void special_transport_type( + etsi_its_cam_msgs::msg::SpecialTransportType&& _special_transport_type); + + /*! + * @brief This function returns a constant reference to member special_transport_type + * @return Constant reference to member special_transport_type + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialTransportType& special_transport_type() const; + + /*! + * @brief This function returns a reference to member special_transport_type + * @return Reference to member special_transport_type + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialTransportType& special_transport_type(); + + + /*! + * @brief This function copies the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be copied in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + const etsi_its_cam_msgs::msg::LightBarSirenInUse& _light_bar_siren_in_use); + + /*! + * @brief This function moves the value in member light_bar_siren_in_use + * @param _light_bar_siren_in_use New value to be moved in member light_bar_siren_in_use + */ + eProsima_user_DllExport void light_bar_siren_in_use( + etsi_its_cam_msgs::msg::LightBarSirenInUse&& _light_bar_siren_in_use); + + /*! + * @brief This function returns a constant reference to member light_bar_siren_in_use + * @return Constant reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use() const; + + /*! + * @brief This function returns a reference to member light_bar_siren_in_use + * @return Reference to member light_bar_siren_in_use + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::LightBarSirenInUse& light_bar_siren_in_use(); + +private: + + etsi_its_cam_msgs::msg::SpecialTransportType m_special_transport_type; + etsi_its_cam_msgs::msg::LightBarSirenInUse m_light_bar_siren_in_use; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerCdrAux.hpp new file mode 100644 index 00000000000..0ed6ff9942d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINERCDRAUX_HPP_ + +#include "SpecialTransportContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SpecialTransportContainer_max_cdr_typesize {225UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SpecialTransportContainer_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialTransportContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerCdrAux.ipp new file mode 100644 index 00000000000..c3993c40925 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINERCDRAUX_IPP_ + +#include "SpecialTransportContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SpecialTransportContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.special_transport_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.light_bar_siren_in_use(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialTransportContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.special_transport_type() + << eprosima::fastcdr::MemberId(1) << data.light_bar_siren_in_use() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SpecialTransportContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.special_transport_type(); + break; + + case 1: + dcdr >> data.light_bar_siren_in_use(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialTransportContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.cxx index 2133fa070e7..97f98aa0020 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file SpecialTransportContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SpecialTransportContainerPubSubTypes.h" +#include "SpecialTransportContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - SpecialTransportContainerPubSubType::SpecialTransportContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SpecialTransportContainer_"); - auto type_size = SpecialTransportContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SpecialTransportContainer::isKeyDefined(); - size_t keyLength = SpecialTransportContainer::getKeyMaxCdrSerializedSize() > 16 ? - SpecialTransportContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpecialTransportContainerPubSubType::~SpecialTransportContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpecialTransportContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SpecialTransportContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpecialTransportContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SpecialTransportContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpecialTransportContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpecialTransportContainerPubSubType::createData() - { - return reinterpret_cast(new SpecialTransportContainer()); - } - - void SpecialTransportContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpecialTransportContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SpecialTransportContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SpecialTransportContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SpecialTransportContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +SpecialTransportContainerPubSubType::SpecialTransportContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SpecialTransportContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SpecialTransportContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SpecialTransportContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpecialTransportContainerPubSubType::~SpecialTransportContainerPubSubType() +{ +} + +bool SpecialTransportContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SpecialTransportContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpecialTransportContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SpecialTransportContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpecialTransportContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpecialTransportContainerPubSubType::createData() +{ + return reinterpret_cast(new SpecialTransportContainer()); +} + +void SpecialTransportContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpecialTransportContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.h index b1b215b7ecb..32c06fc2fbb 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportContainerPubSubTypes.h @@ -16,92 +16,122 @@ * @file SpecialTransportContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SpecialTransportContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "SpecialTransportTypePubSubTypes.h" +#include "LightBarSirenInUsePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SpecialTransportContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type SpecialTransportContainer defined by the user in the IDL file. + * @ingroup SpecialTransportContainer + */ +class SpecialTransportContainerPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type SpecialTransportContainer defined by the user in the IDL file. - * @ingroup SPECIALTRANSPORTCONTAINER - */ - class SpecialTransportContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef SpecialTransportContainer type; + typedef SpecialTransportContainer type; - eProsima_user_DllExport SpecialTransportContainerPubSubType(); + eProsima_user_DllExport SpecialTransportContainerPubSubType(); - eProsima_user_DllExport virtual ~SpecialTransportContainerPubSubType(); + eProsima_user_DllExport ~SpecialTransportContainerPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTCONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.cxx index a78fde6112c..be9633e1ccf 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.cxx @@ -14,9 +14,9 @@ /*! * @file SpecialTransportType.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,145 +27,84 @@ char dummy; #endif // _WIN32 #include "SpecialTransportType.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpecialTransportType_Constants { +} // namespace SpecialTransportType_Constants -etsi_its_cam_msgs::msg::SpecialTransportType::SpecialTransportType() -{ - // m_value com.eprosima.idl.parser.typecode.SequenceTypeCode@4ae33a11 - - // m_bits_unused com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7a48e6e2 - m_bits_unused = 0; +SpecialTransportType::SpecialTransportType() +{ } -etsi_its_cam_msgs::msg::SpecialTransportType::~SpecialTransportType() +SpecialTransportType::~SpecialTransportType() { - } -etsi_its_cam_msgs::msg::SpecialTransportType::SpecialTransportType( +SpecialTransportType::SpecialTransportType( const SpecialTransportType& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::SpecialTransportType::SpecialTransportType( - SpecialTransportType&& x) +SpecialTransportType::SpecialTransportType( + SpecialTransportType&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; } -etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::SpecialTransportType::operator =( +SpecialTransportType& SpecialTransportType::operator =( const SpecialTransportType& x) { m_value = x.m_value; m_bits_unused = x.m_bits_unused; - return *this; } -etsi_its_cam_msgs::msg::SpecialTransportType& etsi_its_cam_msgs::msg::SpecialTransportType::operator =( - SpecialTransportType&& x) +SpecialTransportType& SpecialTransportType::operator =( + SpecialTransportType&& x) noexcept { m_value = std::move(x.m_value); m_bits_unused = x.m_bits_unused; - return *this; } -bool etsi_its_cam_msgs::msg::SpecialTransportType::operator ==( +bool SpecialTransportType::operator ==( const SpecialTransportType& x) const { - - return (m_value == x.m_value && m_bits_unused == x.m_bits_unused); + return (m_value == x.m_value && + m_bits_unused == x.m_bits_unused); } -bool etsi_its_cam_msgs::msg::SpecialTransportType::operator !=( +bool SpecialTransportType::operator !=( const SpecialTransportType& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SpecialTransportType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SpecialTransportType::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpecialTransportType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.value().size() > 0) - { - current_alignment += (data.value().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SpecialTransportType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - scdr << m_bits_unused; - -} - -void etsi_its_cam_msgs::msg::SpecialTransportType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; - dcdr >> m_bits_unused; -} - /*! * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void etsi_its_cam_msgs::msg::SpecialTransportType::value( +void SpecialTransportType::value( const std::vector& _value) { m_value = _value; @@ -175,7 +114,7 @@ void etsi_its_cam_msgs::msg::SpecialTransportType::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void etsi_its_cam_msgs::msg::SpecialTransportType::value( +void SpecialTransportType::value( std::vector&& _value) { m_value = std::move(_value); @@ -185,7 +124,7 @@ void etsi_its_cam_msgs::msg::SpecialTransportType::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::vector& etsi_its_cam_msgs::msg::SpecialTransportType::value() const +const std::vector& SpecialTransportType::value() const { return m_value; } @@ -194,15 +133,17 @@ const std::vector& etsi_its_cam_msgs::msg::SpecialTransportType::value( * @brief This function returns a reference to member value * @return Reference to member value */ -std::vector& etsi_its_cam_msgs::msg::SpecialTransportType::value() +std::vector& SpecialTransportType::value() { return m_value; } + + /*! * @brief This function sets a value in member bits_unused * @param _bits_unused New value for member bits_unused */ -void etsi_its_cam_msgs::msg::SpecialTransportType::bits_unused( +void SpecialTransportType::bits_unused( uint8_t _bits_unused) { m_bits_unused = _bits_unused; @@ -212,7 +153,7 @@ void etsi_its_cam_msgs::msg::SpecialTransportType::bits_unused( * @brief This function returns the value of member bits_unused * @return Value of member bits_unused */ -uint8_t etsi_its_cam_msgs::msg::SpecialTransportType::bits_unused() const +uint8_t SpecialTransportType::bits_unused() const { return m_bits_unused; } @@ -221,32 +162,18 @@ uint8_t etsi_its_cam_msgs::msg::SpecialTransportType::bits_unused() const * @brief This function returns a reference to member bits_unused * @return Reference to member bits_unused */ -uint8_t& etsi_its_cam_msgs::msg::SpecialTransportType::bits_unused() +uint8_t& SpecialTransportType::bits_unused() { return m_bits_unused; } -size_t etsi_its_cam_msgs::msg::SpecialTransportType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::SpecialTransportType::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::SpecialTransportType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SpecialTransportTypeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.h index 7782f292b84..cbf90945c1e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportType.h @@ -16,19 +16,24 @@ * @file SpecialTransportType.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,202 +47,160 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SpecialTransportType_SOURCE) -#define SpecialTransportType_DllAPI __declspec( dllexport ) +#if defined(SPECIALTRANSPORTTYPE_SOURCE) +#define SPECIALTRANSPORTTYPE_DllAPI __declspec( dllexport ) #else -#define SpecialTransportType_DllAPI __declspec( dllimport ) -#endif // SpecialTransportType_SOURCE +#define SPECIALTRANSPORTTYPE_DllAPI __declspec( dllimport ) +#endif // SPECIALTRANSPORTTYPE_SOURCE #else -#define SpecialTransportType_DllAPI +#define SPECIALTRANSPORTTYPE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SpecialTransportType_DllAPI +#define SPECIALTRANSPORTTYPE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SpecialTransportType_Constants { - const uint8_t SIZE_BITS = 4; - const uint8_t BIT_INDEX_HEAVY_LOAD = 0; - const uint8_t BIT_INDEX_EXCESS_WIDTH = 1; - const uint8_t BIT_INDEX_EXCESS_LENGTH = 2; - const uint8_t BIT_INDEX_EXCESS_HEIGHT = 3; - } // namespace SpecialTransportType_Constants - /*! - * @brief This class represents the structure SpecialTransportType defined by the user in the IDL file. - * @ingroup SPECIALTRANSPORTTYPE - */ - class SpecialTransportType - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SpecialTransportType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SpecialTransportType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. - */ - eProsima_user_DllExport SpecialTransportType( - const SpecialTransportType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. - */ - eProsima_user_DllExport SpecialTransportType( - SpecialTransportType&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. - */ - eProsima_user_DllExport SpecialTransportType& operator =( - const SpecialTransportType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. - */ - eProsima_user_DllExport SpecialTransportType& operator =( - SpecialTransportType&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpecialTransportType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SpecialTransportType& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpecialTransportType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SpecialTransportType& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::vector& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::vector&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::vector& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::vector& value(); - /*! - * @brief This function sets a value in member bits_unused - * @param _bits_unused New value for member bits_unused - */ - eProsima_user_DllExport void bits_unused( - uint8_t _bits_unused); - - /*! - * @brief This function returns the value of member bits_unused - * @return Value of member bits_unused - */ - eProsima_user_DllExport uint8_t bits_unused() const; - - /*! - * @brief This function returns a reference to member bits_unused - * @return Reference to member bits_unused - */ - eProsima_user_DllExport uint8_t& bits_unused(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpecialTransportType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_value; - uint8_t m_bits_unused; - }; - } // namespace msg + +namespace msg { + +namespace SpecialTransportType_Constants { + +const uint8_t SIZE_BITS = 4; +const uint8_t BIT_INDEX_HEAVY_LOAD = 0; +const uint8_t BIT_INDEX_EXCESS_WIDTH = 1; +const uint8_t BIT_INDEX_EXCESS_LENGTH = 2; +const uint8_t BIT_INDEX_EXCESS_HEIGHT = 3; + +} // namespace SpecialTransportType_Constants + + +/*! + * @brief This class represents the structure SpecialTransportType defined by the user in the IDL file. + * @ingroup SpecialTransportType + */ +class SpecialTransportType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpecialTransportType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpecialTransportType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. + */ + eProsima_user_DllExport SpecialTransportType( + const SpecialTransportType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. + */ + eProsima_user_DllExport SpecialTransportType( + SpecialTransportType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. + */ + eProsima_user_DllExport SpecialTransportType& operator =( + const SpecialTransportType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialTransportType that will be copied. + */ + eProsima_user_DllExport SpecialTransportType& operator =( + SpecialTransportType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialTransportType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpecialTransportType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialTransportType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpecialTransportType& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::vector& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::vector&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::vector& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::vector& value(); + + + /*! + * @brief This function sets a value in member bits_unused + * @param _bits_unused New value for member bits_unused + */ + eProsima_user_DllExport void bits_unused( + uint8_t _bits_unused); + + /*! + * @brief This function returns the value of member bits_unused + * @return Value of member bits_unused + */ + eProsima_user_DllExport uint8_t bits_unused() const; + + /*! + * @brief This function returns a reference to member bits_unused + * @return Reference to member bits_unused + */ + eProsima_user_DllExport uint8_t& bits_unused(); + +private: + + std::vector m_value; + uint8_t m_bits_unused{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypeCdrAux.hpp new file mode 100644 index 00000000000..a4255e59181 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypeCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportTypeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPECDRAUX_HPP_ + +#include "SpecialTransportType.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SpecialTransportType_max_cdr_typesize {109UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SpecialTransportType_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialTransportType& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypeCdrAux.ipp new file mode 100644 index 00000000000..03d6663e33f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypeCdrAux.ipp @@ -0,0 +1,149 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialTransportTypeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPECDRAUX_IPP_ + +#include "SpecialTransportTypeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SpecialTransportType& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bits_unused(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialTransportType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() + << eprosima::fastcdr::MemberId(1) << data.bits_unused() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SpecialTransportType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + case 1: + dcdr >> data.bits_unused(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialTransportType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.cxx index 4cf1d4b6bbb..28ed380ad13 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file SpecialTransportTypePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SpecialTransportTypePubSubTypes.h" +#include "SpecialTransportTypeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SpecialTransportType_Constants { - - - - - - - } //End of namespace SpecialTransportType_Constants - SpecialTransportTypePubSubType::SpecialTransportTypePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SpecialTransportType_"); - auto type_size = SpecialTransportType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SpecialTransportType::isKeyDefined(); - size_t keyLength = SpecialTransportType::getKeyMaxCdrSerializedSize() > 16 ? - SpecialTransportType::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpecialTransportTypePubSubType::~SpecialTransportTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpecialTransportTypePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SpecialTransportType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpecialTransportTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SpecialTransportType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpecialTransportTypePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpecialTransportTypePubSubType::createData() - { - return reinterpret_cast(new SpecialTransportType()); - } - - void SpecialTransportTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpecialTransportTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SpecialTransportType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SpecialTransportType::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SpecialTransportType::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SpecialTransportType_Constants { + + + + + + + + + + + +} //End of namespace SpecialTransportType_Constants + + + +SpecialTransportTypePubSubType::SpecialTransportTypePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SpecialTransportType_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SpecialTransportType::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SpecialTransportType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpecialTransportTypePubSubType::~SpecialTransportTypePubSubType() +{ +} + +bool SpecialTransportTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SpecialTransportType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpecialTransportTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SpecialTransportType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpecialTransportTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpecialTransportTypePubSubType::createData() +{ + return reinterpret_cast(new SpecialTransportType()); +} + +void SpecialTransportTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpecialTransportTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.h index 4ba09070054..5fbc7fad7d8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialTransportTypePubSubTypes.h @@ -16,100 +16,132 @@ * @file SpecialTransportTypePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SpecialTransportType.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SpecialTransportType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SpecialTransportType_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpecialTransportType_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type SpecialTransportType defined by the user in the IDL file. - * @ingroup SPECIALTRANSPORTTYPE - */ - class SpecialTransportTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SpecialTransportType type; +} // namespace SpecialTransportType_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type SpecialTransportType defined by the user in the IDL file. + * @ingroup SpecialTransportType + */ +class SpecialTransportTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SpecialTransportType type; + + eProsima_user_DllExport SpecialTransportTypePubSubType(); - eProsima_user_DllExport SpecialTransportTypePubSubType(); + eProsima_user_DllExport ~SpecialTransportTypePubSubType() override; - eProsima_user_DllExport virtual ~SpecialTransportTypePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALTRANSPORTTYPE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.cxx index cfe1e0a9ecc..d775f32ed81 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.cxx @@ -14,9 +14,9 @@ /*! * @file SpecialVehicleContainer.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,54 +27,35 @@ char dummy; #endif // _WIN32 #include "SpecialVehicleContainer.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpecialVehicleContainer_Constants { +} // namespace SpecialVehicleContainer_Constants - -etsi_its_cam_msgs::msg::SpecialVehicleContainer::SpecialVehicleContainer() +SpecialVehicleContainer::SpecialVehicleContainer() { - // m_choice com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4275c20c - m_choice = 0; - // m_public_transport_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7c56e013 - - // m_special_transport_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@3fc9dfc5 - - // m_dangerous_goods_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@40258c2f - - // m_road_works_container_basic com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2cac4385 - - // m_rescue_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6731787b - - // m_emergency_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@16f7b4af - - // m_safety_car_container com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7adf16aa - - } -etsi_its_cam_msgs::msg::SpecialVehicleContainer::~SpecialVehicleContainer() +SpecialVehicleContainer::~SpecialVehicleContainer() { - - - - - - - } -etsi_its_cam_msgs::msg::SpecialVehicleContainer::SpecialVehicleContainer( +SpecialVehicleContainer::SpecialVehicleContainer( const SpecialVehicleContainer& x) { m_choice = x.m_choice; @@ -87,8 +68,8 @@ etsi_its_cam_msgs::msg::SpecialVehicleContainer::SpecialVehicleContainer( m_safety_car_container = x.m_safety_car_container; } -etsi_its_cam_msgs::msg::SpecialVehicleContainer::SpecialVehicleContainer( - SpecialVehicleContainer&& x) +SpecialVehicleContainer::SpecialVehicleContainer( + SpecialVehicleContainer&& x) noexcept { m_choice = x.m_choice; m_public_transport_container = std::move(x.m_public_transport_container); @@ -100,7 +81,7 @@ etsi_its_cam_msgs::msg::SpecialVehicleContainer::SpecialVehicleContainer( m_safety_car_container = std::move(x.m_safety_car_container); } -etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::operator =( +SpecialVehicleContainer& SpecialVehicleContainer::operator =( const SpecialVehicleContainer& x) { @@ -112,12 +93,11 @@ etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::Special m_rescue_container = x.m_rescue_container; m_emergency_container = x.m_emergency_container; m_safety_car_container = x.m_safety_car_container; - return *this; } -etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::operator =( - SpecialVehicleContainer&& x) +SpecialVehicleContainer& SpecialVehicleContainer::operator =( + SpecialVehicleContainer&& x) noexcept { m_choice = x.m_choice; @@ -128,99 +108,33 @@ etsi_its_cam_msgs::msg::SpecialVehicleContainer& etsi_its_cam_msgs::msg::Special m_rescue_container = std::move(x.m_rescue_container); m_emergency_container = std::move(x.m_emergency_container); m_safety_car_container = std::move(x.m_safety_car_container); - return *this; } -bool etsi_its_cam_msgs::msg::SpecialVehicleContainer::operator ==( +bool SpecialVehicleContainer::operator ==( const SpecialVehicleContainer& x) const { - - return (m_choice == x.m_choice && m_public_transport_container == x.m_public_transport_container && m_special_transport_container == x.m_special_transport_container && m_dangerous_goods_container == x.m_dangerous_goods_container && m_road_works_container_basic == x.m_road_works_container_basic && m_rescue_container == x.m_rescue_container && m_emergency_container == x.m_emergency_container && m_safety_car_container == x.m_safety_car_container); + return (m_choice == x.m_choice && + m_public_transport_container == x.m_public_transport_container && + m_special_transport_container == x.m_special_transport_container && + m_dangerous_goods_container == x.m_dangerous_goods_container && + m_road_works_container_basic == x.m_road_works_container_basic && + m_rescue_container == x.m_rescue_container && + m_emergency_container == x.m_emergency_container && + m_safety_car_container == x.m_safety_car_container); } -bool etsi_its_cam_msgs::msg::SpecialVehicleContainer::operator !=( +bool SpecialVehicleContainer::operator !=( const SpecialVehicleContainer& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::PublicTransportContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SpecialTransportContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::DangerousGoodsContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::RescueContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::EmergencyContainer::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SafetyCarContainer::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpecialVehicleContainer& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += etsi_its_cam_msgs::msg::PublicTransportContainer::getCdrSerializedSize(data.public_transport_container(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SpecialTransportContainer::getCdrSerializedSize(data.special_transport_container(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::DangerousGoodsContainer::getCdrSerializedSize(data.dangerous_goods_container(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::RoadWorksContainerBasic::getCdrSerializedSize(data.road_works_container_basic(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::RescueContainer::getCdrSerializedSize(data.rescue_container(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::EmergencyContainer::getCdrSerializedSize(data.emergency_container(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SafetyCarContainer::getCdrSerializedSize(data.safety_car_container(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_choice; - scdr << m_public_transport_container; - scdr << m_special_transport_container; - scdr << m_dangerous_goods_container; - scdr << m_road_works_container_basic; - scdr << m_rescue_container; - scdr << m_emergency_container; - scdr << m_safety_car_container; - -} - -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_choice; - dcdr >> m_public_transport_container; - dcdr >> m_special_transport_container; - dcdr >> m_dangerous_goods_container; - dcdr >> m_road_works_container_basic; - dcdr >> m_rescue_container; - dcdr >> m_emergency_container; - dcdr >> m_safety_car_container; -} - /*! * @brief This function sets a value in member choice * @param _choice New value for member choice */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::choice( +void SpecialVehicleContainer::choice( uint8_t _choice) { m_choice = _choice; @@ -230,7 +144,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::choice( * @brief This function returns the value of member choice * @return Value of member choice */ -uint8_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::choice() const +uint8_t SpecialVehicleContainer::choice() const { return m_choice; } @@ -239,16 +153,17 @@ uint8_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::choice() const * @brief This function returns a reference to member choice * @return Reference to member choice */ -uint8_t& etsi_its_cam_msgs::msg::SpecialVehicleContainer::choice() +uint8_t& SpecialVehicleContainer::choice() { return m_choice; } + /*! * @brief This function copies the value in member public_transport_container * @param _public_transport_container New value to be copied in member public_transport_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container( +void SpecialVehicleContainer::public_transport_container( const etsi_its_cam_msgs::msg::PublicTransportContainer& _public_transport_container) { m_public_transport_container = _public_transport_container; @@ -258,7 +173,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container * @brief This function moves the value in member public_transport_container * @param _public_transport_container New value to be moved in member public_transport_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container( +void SpecialVehicleContainer::public_transport_container( etsi_its_cam_msgs::msg::PublicTransportContainer&& _public_transport_container) { m_public_transport_container = std::move(_public_transport_container); @@ -268,7 +183,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container * @brief This function returns a constant reference to member public_transport_container * @return Constant reference to member public_transport_container */ -const etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container() const +const etsi_its_cam_msgs::msg::PublicTransportContainer& SpecialVehicleContainer::public_transport_container() const { return m_public_transport_container; } @@ -277,15 +192,17 @@ const etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg:: * @brief This function returns a reference to member public_transport_container * @return Reference to member public_transport_container */ -etsi_its_cam_msgs::msg::PublicTransportContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::public_transport_container() +etsi_its_cam_msgs::msg::PublicTransportContainer& SpecialVehicleContainer::public_transport_container() { return m_public_transport_container; } + + /*! * @brief This function copies the value in member special_transport_container * @param _special_transport_container New value to be copied in member special_transport_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_container( +void SpecialVehicleContainer::special_transport_container( const etsi_its_cam_msgs::msg::SpecialTransportContainer& _special_transport_container) { m_special_transport_container = _special_transport_container; @@ -295,7 +212,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_containe * @brief This function moves the value in member special_transport_container * @param _special_transport_container New value to be moved in member special_transport_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_container( +void SpecialVehicleContainer::special_transport_container( etsi_its_cam_msgs::msg::SpecialTransportContainer&& _special_transport_container) { m_special_transport_container = std::move(_special_transport_container); @@ -305,7 +222,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_containe * @brief This function returns a constant reference to member special_transport_container * @return Constant reference to member special_transport_container */ -const etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_container() const +const etsi_its_cam_msgs::msg::SpecialTransportContainer& SpecialVehicleContainer::special_transport_container() const { return m_special_transport_container; } @@ -314,15 +231,17 @@ const etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg: * @brief This function returns a reference to member special_transport_container * @return Reference to member special_transport_container */ -etsi_its_cam_msgs::msg::SpecialTransportContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::special_transport_container() +etsi_its_cam_msgs::msg::SpecialTransportContainer& SpecialVehicleContainer::special_transport_container() { return m_special_transport_container; } + + /*! * @brief This function copies the value in member dangerous_goods_container * @param _dangerous_goods_container New value to be copied in member dangerous_goods_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container( +void SpecialVehicleContainer::dangerous_goods_container( const etsi_its_cam_msgs::msg::DangerousGoodsContainer& _dangerous_goods_container) { m_dangerous_goods_container = _dangerous_goods_container; @@ -332,7 +251,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container( * @brief This function moves the value in member dangerous_goods_container * @param _dangerous_goods_container New value to be moved in member dangerous_goods_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container( +void SpecialVehicleContainer::dangerous_goods_container( etsi_its_cam_msgs::msg::DangerousGoodsContainer&& _dangerous_goods_container) { m_dangerous_goods_container = std::move(_dangerous_goods_container); @@ -342,7 +261,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container( * @brief This function returns a constant reference to member dangerous_goods_container * @return Constant reference to member dangerous_goods_container */ -const etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container() const +const etsi_its_cam_msgs::msg::DangerousGoodsContainer& SpecialVehicleContainer::dangerous_goods_container() const { return m_dangerous_goods_container; } @@ -351,15 +270,17 @@ const etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::S * @brief This function returns a reference to member dangerous_goods_container * @return Reference to member dangerous_goods_container */ -etsi_its_cam_msgs::msg::DangerousGoodsContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::dangerous_goods_container() +etsi_its_cam_msgs::msg::DangerousGoodsContainer& SpecialVehicleContainer::dangerous_goods_container() { return m_dangerous_goods_container; } + + /*! * @brief This function copies the value in member road_works_container_basic * @param _road_works_container_basic New value to be copied in member road_works_container_basic */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic( +void SpecialVehicleContainer::road_works_container_basic( const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& _road_works_container_basic) { m_road_works_container_basic = _road_works_container_basic; @@ -369,7 +290,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic * @brief This function moves the value in member road_works_container_basic * @param _road_works_container_basic New value to be moved in member road_works_container_basic */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic( +void SpecialVehicleContainer::road_works_container_basic( etsi_its_cam_msgs::msg::RoadWorksContainerBasic&& _road_works_container_basic) { m_road_works_container_basic = std::move(_road_works_container_basic); @@ -379,7 +300,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic * @brief This function returns a constant reference to member road_works_container_basic * @return Constant reference to member road_works_container_basic */ -const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic() const +const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& SpecialVehicleContainer::road_works_container_basic() const { return m_road_works_container_basic; } @@ -388,15 +309,17 @@ const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::S * @brief This function returns a reference to member road_works_container_basic * @return Reference to member road_works_container_basic */ -etsi_its_cam_msgs::msg::RoadWorksContainerBasic& etsi_its_cam_msgs::msg::SpecialVehicleContainer::road_works_container_basic() +etsi_its_cam_msgs::msg::RoadWorksContainerBasic& SpecialVehicleContainer::road_works_container_basic() { return m_road_works_container_basic; } + + /*! * @brief This function copies the value in member rescue_container * @param _rescue_container New value to be copied in member rescue_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container( +void SpecialVehicleContainer::rescue_container( const etsi_its_cam_msgs::msg::RescueContainer& _rescue_container) { m_rescue_container = _rescue_container; @@ -406,7 +329,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container( * @brief This function moves the value in member rescue_container * @param _rescue_container New value to be moved in member rescue_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container( +void SpecialVehicleContainer::rescue_container( etsi_its_cam_msgs::msg::RescueContainer&& _rescue_container) { m_rescue_container = std::move(_rescue_container); @@ -416,7 +339,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container( * @brief This function returns a constant reference to member rescue_container * @return Constant reference to member rescue_container */ -const etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container() const +const etsi_its_cam_msgs::msg::RescueContainer& SpecialVehicleContainer::rescue_container() const { return m_rescue_container; } @@ -425,15 +348,17 @@ const etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::SpecialVe * @brief This function returns a reference to member rescue_container * @return Reference to member rescue_container */ -etsi_its_cam_msgs::msg::RescueContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::rescue_container() +etsi_its_cam_msgs::msg::RescueContainer& SpecialVehicleContainer::rescue_container() { return m_rescue_container; } + + /*! * @brief This function copies the value in member emergency_container * @param _emergency_container New value to be copied in member emergency_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container( +void SpecialVehicleContainer::emergency_container( const etsi_its_cam_msgs::msg::EmergencyContainer& _emergency_container) { m_emergency_container = _emergency_container; @@ -443,7 +368,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container( * @brief This function moves the value in member emergency_container * @param _emergency_container New value to be moved in member emergency_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container( +void SpecialVehicleContainer::emergency_container( etsi_its_cam_msgs::msg::EmergencyContainer&& _emergency_container) { m_emergency_container = std::move(_emergency_container); @@ -453,7 +378,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container( * @brief This function returns a constant reference to member emergency_container * @return Constant reference to member emergency_container */ -const etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container() const +const etsi_its_cam_msgs::msg::EmergencyContainer& SpecialVehicleContainer::emergency_container() const { return m_emergency_container; } @@ -462,15 +387,17 @@ const etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::Specia * @brief This function returns a reference to member emergency_container * @return Reference to member emergency_container */ -etsi_its_cam_msgs::msg::EmergencyContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::emergency_container() +etsi_its_cam_msgs::msg::EmergencyContainer& SpecialVehicleContainer::emergency_container() { return m_emergency_container; } + + /*! * @brief This function copies the value in member safety_car_container * @param _safety_car_container New value to be copied in member safety_car_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container( +void SpecialVehicleContainer::safety_car_container( const etsi_its_cam_msgs::msg::SafetyCarContainer& _safety_car_container) { m_safety_car_container = _safety_car_container; @@ -480,7 +407,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container( * @brief This function moves the value in member safety_car_container * @param _safety_car_container New value to be moved in member safety_car_container */ -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container( +void SpecialVehicleContainer::safety_car_container( etsi_its_cam_msgs::msg::SafetyCarContainer&& _safety_car_container) { m_safety_car_container = std::move(_safety_car_container); @@ -490,7 +417,7 @@ void etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container( * @brief This function returns a constant reference to member safety_car_container * @return Constant reference to member safety_car_container */ -const etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container() const +const etsi_its_cam_msgs::msg::SafetyCarContainer& SpecialVehicleContainer::safety_car_container() const { return m_safety_car_container; } @@ -499,31 +426,18 @@ const etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::Specia * @brief This function returns a reference to member safety_car_container * @return Reference to member safety_car_container */ -etsi_its_cam_msgs::msg::SafetyCarContainer& etsi_its_cam_msgs::msg::SpecialVehicleContainer::safety_car_container() +etsi_its_cam_msgs::msg::SafetyCarContainer& SpecialVehicleContainer::safety_car_container() { return m_safety_car_container; } -size_t etsi_its_cam_msgs::msg::SpecialVehicleContainer::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::SpecialVehicleContainer::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::SpecialVehicleContainer::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SpecialVehicleContainerCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.h index 7b23d3d8275..3ef2d734c86 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainer.h @@ -16,12 +16,23 @@ * @file SpecialVehicleContainer.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_H_ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include "PublicTransportContainer.h" #include "DangerousGoodsContainer.h" #include "RescueContainer.h" @@ -30,12 +41,6 @@ #include "SafetyCarContainer.h" #include "SpecialTransportContainer.h" -#include -#include -#include -#include -#include -#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -49,360 +54,330 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SpecialVehicleContainer_SOURCE) -#define SpecialVehicleContainer_DllAPI __declspec( dllexport ) +#if defined(SPECIALVEHICLECONTAINER_SOURCE) +#define SPECIALVEHICLECONTAINER_DllAPI __declspec( dllexport ) #else -#define SpecialVehicleContainer_DllAPI __declspec( dllimport ) -#endif // SpecialVehicleContainer_SOURCE +#define SPECIALVEHICLECONTAINER_DllAPI __declspec( dllimport ) +#endif // SPECIALVEHICLECONTAINER_SOURCE #else -#define SpecialVehicleContainer_DllAPI +#define SPECIALVEHICLECONTAINER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SpecialVehicleContainer_DllAPI +#define SPECIALVEHICLECONTAINER_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SpecialVehicleContainer_Constants { - const uint8_t CHOICE_PUBLIC_TRANSPORT_CONTAINER = 0; - const uint8_t CHOICE_SPECIAL_TRANSPORT_CONTAINER = 1; - const uint8_t CHOICE_DANGEROUS_GOODS_CONTAINER = 2; - const uint8_t CHOICE_ROAD_WORKS_CONTAINER_BASIC = 3; - const uint8_t CHOICE_RESCUE_CONTAINER = 4; - const uint8_t CHOICE_EMERGENCY_CONTAINER = 5; - const uint8_t CHOICE_SAFETY_CAR_CONTAINER = 6; - } // namespace SpecialVehicleContainer_Constants - /*! - * @brief This class represents the structure SpecialVehicleContainer defined by the user in the IDL file. - * @ingroup SPECIALVEHICLECONTAINER - */ - class SpecialVehicleContainer - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SpecialVehicleContainer(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SpecialVehicleContainer(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. - */ - eProsima_user_DllExport SpecialVehicleContainer( - const SpecialVehicleContainer& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. - */ - eProsima_user_DllExport SpecialVehicleContainer( - SpecialVehicleContainer&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. - */ - eProsima_user_DllExport SpecialVehicleContainer& operator =( - const SpecialVehicleContainer& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. - */ - eProsima_user_DllExport SpecialVehicleContainer& operator =( - SpecialVehicleContainer&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpecialVehicleContainer object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SpecialVehicleContainer& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpecialVehicleContainer object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SpecialVehicleContainer& x) const; - - /*! - * @brief This function sets a value in member choice - * @param _choice New value for member choice - */ - eProsima_user_DllExport void choice( - uint8_t _choice); - - /*! - * @brief This function returns the value of member choice - * @return Value of member choice - */ - eProsima_user_DllExport uint8_t choice() const; - - /*! - * @brief This function returns a reference to member choice - * @return Reference to member choice - */ - eProsima_user_DllExport uint8_t& choice(); - - /*! - * @brief This function copies the value in member public_transport_container - * @param _public_transport_container New value to be copied in member public_transport_container - */ - eProsima_user_DllExport void public_transport_container( - const etsi_its_cam_msgs::msg::PublicTransportContainer& _public_transport_container); - - /*! - * @brief This function moves the value in member public_transport_container - * @param _public_transport_container New value to be moved in member public_transport_container - */ - eProsima_user_DllExport void public_transport_container( - etsi_its_cam_msgs::msg::PublicTransportContainer&& _public_transport_container); - - /*! - * @brief This function returns a constant reference to member public_transport_container - * @return Constant reference to member public_transport_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::PublicTransportContainer& public_transport_container() const; - - /*! - * @brief This function returns a reference to member public_transport_container - * @return Reference to member public_transport_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::PublicTransportContainer& public_transport_container(); - /*! - * @brief This function copies the value in member special_transport_container - * @param _special_transport_container New value to be copied in member special_transport_container - */ - eProsima_user_DllExport void special_transport_container( - const etsi_its_cam_msgs::msg::SpecialTransportContainer& _special_transport_container); - - /*! - * @brief This function moves the value in member special_transport_container - * @param _special_transport_container New value to be moved in member special_transport_container - */ - eProsima_user_DllExport void special_transport_container( - etsi_its_cam_msgs::msg::SpecialTransportContainer&& _special_transport_container); - - /*! - * @brief This function returns a constant reference to member special_transport_container - * @return Constant reference to member special_transport_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialTransportContainer& special_transport_container() const; - - /*! - * @brief This function returns a reference to member special_transport_container - * @return Reference to member special_transport_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialTransportContainer& special_transport_container(); - /*! - * @brief This function copies the value in member dangerous_goods_container - * @param _dangerous_goods_container New value to be copied in member dangerous_goods_container - */ - eProsima_user_DllExport void dangerous_goods_container( - const etsi_its_cam_msgs::msg::DangerousGoodsContainer& _dangerous_goods_container); - - /*! - * @brief This function moves the value in member dangerous_goods_container - * @param _dangerous_goods_container New value to be moved in member dangerous_goods_container - */ - eProsima_user_DllExport void dangerous_goods_container( - etsi_its_cam_msgs::msg::DangerousGoodsContainer&& _dangerous_goods_container); - - /*! - * @brief This function returns a constant reference to member dangerous_goods_container - * @return Constant reference to member dangerous_goods_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::DangerousGoodsContainer& dangerous_goods_container() const; - - /*! - * @brief This function returns a reference to member dangerous_goods_container - * @return Reference to member dangerous_goods_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::DangerousGoodsContainer& dangerous_goods_container(); - /*! - * @brief This function copies the value in member road_works_container_basic - * @param _road_works_container_basic New value to be copied in member road_works_container_basic - */ - eProsima_user_DllExport void road_works_container_basic( - const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& _road_works_container_basic); - - /*! - * @brief This function moves the value in member road_works_container_basic - * @param _road_works_container_basic New value to be moved in member road_works_container_basic - */ - eProsima_user_DllExport void road_works_container_basic( - etsi_its_cam_msgs::msg::RoadWorksContainerBasic&& _road_works_container_basic); - - /*! - * @brief This function returns a constant reference to member road_works_container_basic - * @return Constant reference to member road_works_container_basic - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& road_works_container_basic() const; - - /*! - * @brief This function returns a reference to member road_works_container_basic - * @return Reference to member road_works_container_basic - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::RoadWorksContainerBasic& road_works_container_basic(); - /*! - * @brief This function copies the value in member rescue_container - * @param _rescue_container New value to be copied in member rescue_container - */ - eProsima_user_DllExport void rescue_container( - const etsi_its_cam_msgs::msg::RescueContainer& _rescue_container); - - /*! - * @brief This function moves the value in member rescue_container - * @param _rescue_container New value to be moved in member rescue_container - */ - eProsima_user_DllExport void rescue_container( - etsi_its_cam_msgs::msg::RescueContainer&& _rescue_container); - - /*! - * @brief This function returns a constant reference to member rescue_container - * @return Constant reference to member rescue_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::RescueContainer& rescue_container() const; - - /*! - * @brief This function returns a reference to member rescue_container - * @return Reference to member rescue_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::RescueContainer& rescue_container(); - /*! - * @brief This function copies the value in member emergency_container - * @param _emergency_container New value to be copied in member emergency_container - */ - eProsima_user_DllExport void emergency_container( - const etsi_its_cam_msgs::msg::EmergencyContainer& _emergency_container); - - /*! - * @brief This function moves the value in member emergency_container - * @param _emergency_container New value to be moved in member emergency_container - */ - eProsima_user_DllExport void emergency_container( - etsi_its_cam_msgs::msg::EmergencyContainer&& _emergency_container); - - /*! - * @brief This function returns a constant reference to member emergency_container - * @return Constant reference to member emergency_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmergencyContainer& emergency_container() const; - - /*! - * @brief This function returns a reference to member emergency_container - * @return Reference to member emergency_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::EmergencyContainer& emergency_container(); - /*! - * @brief This function copies the value in member safety_car_container - * @param _safety_car_container New value to be copied in member safety_car_container - */ - eProsima_user_DllExport void safety_car_container( - const etsi_its_cam_msgs::msg::SafetyCarContainer& _safety_car_container); - - /*! - * @brief This function moves the value in member safety_car_container - * @param _safety_car_container New value to be moved in member safety_car_container - */ - eProsima_user_DllExport void safety_car_container( - etsi_its_cam_msgs::msg::SafetyCarContainer&& _safety_car_container); - - /*! - * @brief This function returns a constant reference to member safety_car_container - * @return Constant reference to member safety_car_container - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SafetyCarContainer& safety_car_container() const; - - /*! - * @brief This function returns a reference to member safety_car_container - * @return Reference to member safety_car_container - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SafetyCarContainer& safety_car_container(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpecialVehicleContainer& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_choice; - etsi_its_cam_msgs::msg::PublicTransportContainer m_public_transport_container; - etsi_its_cam_msgs::msg::SpecialTransportContainer m_special_transport_container; - etsi_its_cam_msgs::msg::DangerousGoodsContainer m_dangerous_goods_container; - etsi_its_cam_msgs::msg::RoadWorksContainerBasic m_road_works_container_basic; - etsi_its_cam_msgs::msg::RescueContainer m_rescue_container; - etsi_its_cam_msgs::msg::EmergencyContainer m_emergency_container; - etsi_its_cam_msgs::msg::SafetyCarContainer m_safety_car_container; - }; - } // namespace msg + +namespace msg { + +namespace SpecialVehicleContainer_Constants { + +const uint8_t CHOICE_PUBLIC_TRANSPORT_CONTAINER = 0; +const uint8_t CHOICE_SPECIAL_TRANSPORT_CONTAINER = 1; +const uint8_t CHOICE_DANGEROUS_GOODS_CONTAINER = 2; +const uint8_t CHOICE_ROAD_WORKS_CONTAINER_BASIC = 3; +const uint8_t CHOICE_RESCUE_CONTAINER = 4; +const uint8_t CHOICE_EMERGENCY_CONTAINER = 5; +const uint8_t CHOICE_SAFETY_CAR_CONTAINER = 6; + +} // namespace SpecialVehicleContainer_Constants + + +/*! + * @brief This class represents the structure SpecialVehicleContainer defined by the user in the IDL file. + * @ingroup SpecialVehicleContainer + */ +class SpecialVehicleContainer +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpecialVehicleContainer(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpecialVehicleContainer(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. + */ + eProsima_user_DllExport SpecialVehicleContainer( + const SpecialVehicleContainer& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. + */ + eProsima_user_DllExport SpecialVehicleContainer( + SpecialVehicleContainer&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. + */ + eProsima_user_DllExport SpecialVehicleContainer& operator =( + const SpecialVehicleContainer& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpecialVehicleContainer that will be copied. + */ + eProsima_user_DllExport SpecialVehicleContainer& operator =( + SpecialVehicleContainer&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialVehicleContainer object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpecialVehicleContainer& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpecialVehicleContainer object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpecialVehicleContainer& x) const; + + /*! + * @brief This function sets a value in member choice + * @param _choice New value for member choice + */ + eProsima_user_DllExport void choice( + uint8_t _choice); + + /*! + * @brief This function returns the value of member choice + * @return Value of member choice + */ + eProsima_user_DllExport uint8_t choice() const; + + /*! + * @brief This function returns a reference to member choice + * @return Reference to member choice + */ + eProsima_user_DllExport uint8_t& choice(); + + + /*! + * @brief This function copies the value in member public_transport_container + * @param _public_transport_container New value to be copied in member public_transport_container + */ + eProsima_user_DllExport void public_transport_container( + const etsi_its_cam_msgs::msg::PublicTransportContainer& _public_transport_container); + + /*! + * @brief This function moves the value in member public_transport_container + * @param _public_transport_container New value to be moved in member public_transport_container + */ + eProsima_user_DllExport void public_transport_container( + etsi_its_cam_msgs::msg::PublicTransportContainer&& _public_transport_container); + + /*! + * @brief This function returns a constant reference to member public_transport_container + * @return Constant reference to member public_transport_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::PublicTransportContainer& public_transport_container() const; + + /*! + * @brief This function returns a reference to member public_transport_container + * @return Reference to member public_transport_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::PublicTransportContainer& public_transport_container(); + + + /*! + * @brief This function copies the value in member special_transport_container + * @param _special_transport_container New value to be copied in member special_transport_container + */ + eProsima_user_DllExport void special_transport_container( + const etsi_its_cam_msgs::msg::SpecialTransportContainer& _special_transport_container); + + /*! + * @brief This function moves the value in member special_transport_container + * @param _special_transport_container New value to be moved in member special_transport_container + */ + eProsima_user_DllExport void special_transport_container( + etsi_its_cam_msgs::msg::SpecialTransportContainer&& _special_transport_container); + + /*! + * @brief This function returns a constant reference to member special_transport_container + * @return Constant reference to member special_transport_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpecialTransportContainer& special_transport_container() const; + + /*! + * @brief This function returns a reference to member special_transport_container + * @return Reference to member special_transport_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpecialTransportContainer& special_transport_container(); + + + /*! + * @brief This function copies the value in member dangerous_goods_container + * @param _dangerous_goods_container New value to be copied in member dangerous_goods_container + */ + eProsima_user_DllExport void dangerous_goods_container( + const etsi_its_cam_msgs::msg::DangerousGoodsContainer& _dangerous_goods_container); + + /*! + * @brief This function moves the value in member dangerous_goods_container + * @param _dangerous_goods_container New value to be moved in member dangerous_goods_container + */ + eProsima_user_DllExport void dangerous_goods_container( + etsi_its_cam_msgs::msg::DangerousGoodsContainer&& _dangerous_goods_container); + + /*! + * @brief This function returns a constant reference to member dangerous_goods_container + * @return Constant reference to member dangerous_goods_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::DangerousGoodsContainer& dangerous_goods_container() const; + + /*! + * @brief This function returns a reference to member dangerous_goods_container + * @return Reference to member dangerous_goods_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::DangerousGoodsContainer& dangerous_goods_container(); + + + /*! + * @brief This function copies the value in member road_works_container_basic + * @param _road_works_container_basic New value to be copied in member road_works_container_basic + */ + eProsima_user_DllExport void road_works_container_basic( + const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& _road_works_container_basic); + + /*! + * @brief This function moves the value in member road_works_container_basic + * @param _road_works_container_basic New value to be moved in member road_works_container_basic + */ + eProsima_user_DllExport void road_works_container_basic( + etsi_its_cam_msgs::msg::RoadWorksContainerBasic&& _road_works_container_basic); + + /*! + * @brief This function returns a constant reference to member road_works_container_basic + * @return Constant reference to member road_works_container_basic + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::RoadWorksContainerBasic& road_works_container_basic() const; + + /*! + * @brief This function returns a reference to member road_works_container_basic + * @return Reference to member road_works_container_basic + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::RoadWorksContainerBasic& road_works_container_basic(); + + + /*! + * @brief This function copies the value in member rescue_container + * @param _rescue_container New value to be copied in member rescue_container + */ + eProsima_user_DllExport void rescue_container( + const etsi_its_cam_msgs::msg::RescueContainer& _rescue_container); + + /*! + * @brief This function moves the value in member rescue_container + * @param _rescue_container New value to be moved in member rescue_container + */ + eProsima_user_DllExport void rescue_container( + etsi_its_cam_msgs::msg::RescueContainer&& _rescue_container); + + /*! + * @brief This function returns a constant reference to member rescue_container + * @return Constant reference to member rescue_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::RescueContainer& rescue_container() const; + + /*! + * @brief This function returns a reference to member rescue_container + * @return Reference to member rescue_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::RescueContainer& rescue_container(); + + + /*! + * @brief This function copies the value in member emergency_container + * @param _emergency_container New value to be copied in member emergency_container + */ + eProsima_user_DllExport void emergency_container( + const etsi_its_cam_msgs::msg::EmergencyContainer& _emergency_container); + + /*! + * @brief This function moves the value in member emergency_container + * @param _emergency_container New value to be moved in member emergency_container + */ + eProsima_user_DllExport void emergency_container( + etsi_its_cam_msgs::msg::EmergencyContainer&& _emergency_container); + + /*! + * @brief This function returns a constant reference to member emergency_container + * @return Constant reference to member emergency_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::EmergencyContainer& emergency_container() const; + + /*! + * @brief This function returns a reference to member emergency_container + * @return Reference to member emergency_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::EmergencyContainer& emergency_container(); + + + /*! + * @brief This function copies the value in member safety_car_container + * @param _safety_car_container New value to be copied in member safety_car_container + */ + eProsima_user_DllExport void safety_car_container( + const etsi_its_cam_msgs::msg::SafetyCarContainer& _safety_car_container); + + /*! + * @brief This function moves the value in member safety_car_container + * @param _safety_car_container New value to be moved in member safety_car_container + */ + eProsima_user_DllExport void safety_car_container( + etsi_its_cam_msgs::msg::SafetyCarContainer&& _safety_car_container); + + /*! + * @brief This function returns a constant reference to member safety_car_container + * @return Constant reference to member safety_car_container + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SafetyCarContainer& safety_car_container() const; + + /*! + * @brief This function returns a reference to member safety_car_container + * @return Reference to member safety_car_container + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SafetyCarContainer& safety_car_container(); + +private: + + uint8_t m_choice{0}; + etsi_its_cam_msgs::msg::PublicTransportContainer m_public_transport_container; + etsi_its_cam_msgs::msg::SpecialTransportContainer m_special_transport_container; + etsi_its_cam_msgs::msg::DangerousGoodsContainer m_dangerous_goods_container; + etsi_its_cam_msgs::msg::RoadWorksContainerBasic m_road_works_container_basic; + etsi_its_cam_msgs::msg::RescueContainer m_rescue_container; + etsi_its_cam_msgs::msg::EmergencyContainer m_emergency_container; + etsi_its_cam_msgs::msg::SafetyCarContainer m_safety_car_container; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerCdrAux.hpp new file mode 100644 index 00000000000..0a750527f6f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerCdrAux.hpp @@ -0,0 +1,87 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialVehicleContainerCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINERCDRAUX_HPP_ + +#include "SpecialVehicleContainer.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SpecialVehicleContainer_max_cdr_typesize {1154UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SpecialVehicleContainer_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerCdrAux.ipp new file mode 100644 index 00000000000..1034d03330c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerCdrAux.ipp @@ -0,0 +1,201 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpecialVehicleContainerCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINERCDRAUX_IPP_ + +#include "SpecialVehicleContainerCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.choice(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.public_transport_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.special_transport_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.dangerous_goods_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.road_works_container_basic(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.rescue_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.emergency_container(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.safety_car_container(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.choice() + << eprosima::fastcdr::MemberId(1) << data.public_transport_container() + << eprosima::fastcdr::MemberId(2) << data.special_transport_container() + << eprosima::fastcdr::MemberId(3) << data.dangerous_goods_container() + << eprosima::fastcdr::MemberId(4) << data.road_works_container_basic() + << eprosima::fastcdr::MemberId(5) << data.rescue_container() + << eprosima::fastcdr::MemberId(6) << data.emergency_container() + << eprosima::fastcdr::MemberId(7) << data.safety_car_container() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SpecialVehicleContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.choice(); + break; + + case 1: + dcdr >> data.public_transport_container(); + break; + + case 2: + dcdr >> data.special_transport_container(); + break; + + case 3: + dcdr >> data.dangerous_goods_container(); + break; + + case 4: + dcdr >> data.road_works_container_basic(); + break; + + case 5: + dcdr >> data.rescue_container(); + break; + + case 6: + dcdr >> data.emergency_container(); + break; + + case 7: + dcdr >> data.safety_car_container(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpecialVehicleContainer& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.cxx index c341e7ee7ef..2dedb13f0e1 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.cxx @@ -16,171 +16,201 @@ * @file SpecialVehicleContainerPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SpecialVehicleContainerPubSubTypes.h" +#include "SpecialVehicleContainerCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SpecialVehicleContainer_Constants { - - - - - - - - - } //End of namespace SpecialVehicleContainer_Constants - SpecialVehicleContainerPubSubType::SpecialVehicleContainerPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SpecialVehicleContainer_"); - auto type_size = SpecialVehicleContainer::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SpecialVehicleContainer::isKeyDefined(); - size_t keyLength = SpecialVehicleContainer::getKeyMaxCdrSerializedSize() > 16 ? - SpecialVehicleContainer::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpecialVehicleContainerPubSubType::~SpecialVehicleContainerPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpecialVehicleContainerPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SpecialVehicleContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpecialVehicleContainerPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SpecialVehicleContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpecialVehicleContainerPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpecialVehicleContainerPubSubType::createData() - { - return reinterpret_cast(new SpecialVehicleContainer()); - } - - void SpecialVehicleContainerPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpecialVehicleContainerPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SpecialVehicleContainer* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SpecialVehicleContainer::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SpecialVehicleContainer::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SpecialVehicleContainer_Constants { + + + + + + + + + + + + + + + +} //End of namespace SpecialVehicleContainer_Constants + + + +SpecialVehicleContainerPubSubType::SpecialVehicleContainerPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SpecialVehicleContainer_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SpecialVehicleContainer::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SpecialVehicleContainer_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpecialVehicleContainerPubSubType::~SpecialVehicleContainerPubSubType() +{ +} + +bool SpecialVehicleContainerPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SpecialVehicleContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpecialVehicleContainerPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SpecialVehicleContainer* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpecialVehicleContainerPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpecialVehicleContainerPubSubType::createData() +{ + return reinterpret_cast(new SpecialVehicleContainer()); +} + +void SpecialVehicleContainerPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpecialVehicleContainerPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.h index b46bee1df9b..260012c2999 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpecialVehicleContainerPubSubTypes.h @@ -16,29 +16,43 @@ * @file SpecialVehicleContainerPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SpecialVehicleContainer.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "PublicTransportContainerPubSubTypes.h" +#include "DangerousGoodsContainerPubSubTypes.h" +#include "RescueContainerPubSubTypes.h" +#include "EmergencyContainerPubSubTypes.h" +#include "RoadWorksContainerBasicPubSubTypes.h" +#include "SafetyCarContainerPubSubTypes.h" +#include "SpecialTransportContainerPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SpecialVehicleContainer is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SpecialVehicleContainer_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpecialVehicleContainer_Constants { + + + + @@ -46,72 +60,99 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type SpecialVehicleContainer defined by the user in the IDL file. - * @ingroup SPECIALVEHICLECONTAINER - */ - class SpecialVehicleContainerPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SpecialVehicleContainer type; - eProsima_user_DllExport SpecialVehicleContainerPubSubType(); - eProsima_user_DllExport virtual ~SpecialVehicleContainerPubSubType(); +} // namespace SpecialVehicleContainer_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type SpecialVehicleContainer defined by the user in the IDL file. + * @ingroup SpecialVehicleContainer + */ +class SpecialVehicleContainerPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SpecialVehicleContainer type; + + eProsima_user_DllExport SpecialVehicleContainerPubSubType(); + + eProsima_user_DllExport ~SpecialVehicleContainerPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPECIALVEHICLECONTAINER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.cxx index a7a292e82d2..acc2c1723c4 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.cxx @@ -14,9 +14,9 @@ /*! * @file Speed.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "Speed.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::Speed::Speed() -{ - // m_speed_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1d3e6d34 - // m_speed_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6eafb10e +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::Speed::~Speed() +Speed::Speed() { +} +Speed::~Speed() +{ } -etsi_its_cam_msgs::msg::Speed::Speed( +Speed::Speed( const Speed& x) { m_speed_value = x.m_speed_value; m_speed_confidence = x.m_speed_confidence; } -etsi_its_cam_msgs::msg::Speed::Speed( - Speed&& x) +Speed::Speed( + Speed&& x) noexcept { m_speed_value = std::move(x.m_speed_value); m_speed_confidence = std::move(x.m_speed_confidence); } -etsi_its_cam_msgs::msg::Speed& etsi_its_cam_msgs::msg::Speed::operator =( +Speed& Speed::operator =( const Speed& x) { m_speed_value = x.m_speed_value; m_speed_confidence = x.m_speed_confidence; - return *this; } -etsi_its_cam_msgs::msg::Speed& etsi_its_cam_msgs::msg::Speed::operator =( - Speed&& x) +Speed& Speed::operator =( + Speed&& x) noexcept { m_speed_value = std::move(x.m_speed_value); m_speed_confidence = std::move(x.m_speed_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::Speed::operator ==( +bool Speed::operator ==( const Speed& x) const { - - return (m_speed_value == x.m_speed_value && m_speed_confidence == x.m_speed_confidence); + return (m_speed_value == x.m_speed_value && + m_speed_confidence == x.m_speed_confidence); } -bool etsi_its_cam_msgs::msg::Speed::operator !=( +bool Speed::operator !=( const Speed& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::Speed::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::SpeedValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SpeedConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::Speed::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Speed& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::SpeedValue::getCdrSerializedSize(data.speed_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SpeedConfidence::getCdrSerializedSize(data.speed_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::Speed::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_speed_value; - scdr << m_speed_confidence; - -} - -void etsi_its_cam_msgs::msg::Speed::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_speed_value; - dcdr >> m_speed_confidence; -} - /*! * @brief This function copies the value in member speed_value * @param _speed_value New value to be copied in member speed_value */ -void etsi_its_cam_msgs::msg::Speed::speed_value( +void Speed::speed_value( const etsi_its_cam_msgs::msg::SpeedValue& _speed_value) { m_speed_value = _speed_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::Speed::speed_value( * @brief This function moves the value in member speed_value * @param _speed_value New value to be moved in member speed_value */ -void etsi_its_cam_msgs::msg::Speed::speed_value( +void Speed::speed_value( etsi_its_cam_msgs::msg::SpeedValue&& _speed_value) { m_speed_value = std::move(_speed_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::Speed::speed_value( * @brief This function returns a constant reference to member speed_value * @return Constant reference to member speed_value */ -const etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::Speed::speed_value() const +const etsi_its_cam_msgs::msg::SpeedValue& Speed::speed_value() const { return m_speed_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::Speed::speed_v * @brief This function returns a reference to member speed_value * @return Reference to member speed_value */ -etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::Speed::speed_value() +etsi_its_cam_msgs::msg::SpeedValue& Speed::speed_value() { return m_speed_value; } + + /*! * @brief This function copies the value in member speed_confidence * @param _speed_confidence New value to be copied in member speed_confidence */ -void etsi_its_cam_msgs::msg::Speed::speed_confidence( +void Speed::speed_confidence( const etsi_its_cam_msgs::msg::SpeedConfidence& _speed_confidence) { m_speed_confidence = _speed_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::Speed::speed_confidence( * @brief This function moves the value in member speed_confidence * @param _speed_confidence New value to be moved in member speed_confidence */ -void etsi_its_cam_msgs::msg::Speed::speed_confidence( +void Speed::speed_confidence( etsi_its_cam_msgs::msg::SpeedConfidence&& _speed_confidence) { m_speed_confidence = std::move(_speed_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::Speed::speed_confidence( * @brief This function returns a constant reference to member speed_confidence * @return Constant reference to member speed_confidence */ -const etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::Speed::speed_confidence() const +const etsi_its_cam_msgs::msg::SpeedConfidence& Speed::speed_confidence() const { return m_speed_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::Speed::sp * @brief This function returns a reference to member speed_confidence * @return Reference to member speed_confidence */ -etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::Speed::speed_confidence() +etsi_its_cam_msgs::msg::SpeedConfidence& Speed::speed_confidence() { return m_speed_confidence; } -size_t etsi_its_cam_msgs::msg::Speed::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::Speed::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::Speed::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SpeedCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.h index 53db960580c..be5bd8d6525 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/Speed.h @@ -16,21 +16,26 @@ * @file Speed.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_H_ -#include "SpeedValue.h" -#include "SpeedConfidence.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "SpeedValue.h" +#include "SpeedConfidence.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Speed_SOURCE) -#define Speed_DllAPI __declspec( dllexport ) +#if defined(SPEED_SOURCE) +#define SPEED_DllAPI __declspec( dllexport ) #else -#define Speed_DllAPI __declspec( dllimport ) -#endif // Speed_SOURCE +#define SPEED_DllAPI __declspec( dllimport ) +#endif // SPEED_SOURCE #else -#define Speed_DllAPI +#define SPEED_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Speed_DllAPI +#define SPEED_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure Speed defined by the user in the IDL file. - * @ingroup SPEED - */ - class Speed - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Speed(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Speed(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. - */ - eProsima_user_DllExport Speed( - const Speed& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. - */ - eProsima_user_DllExport Speed( - Speed&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. - */ - eProsima_user_DllExport Speed& operator =( - const Speed& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. - */ - eProsima_user_DllExport Speed& operator =( - Speed&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Speed object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Speed& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::Speed object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Speed& x) const; - - /*! - * @brief This function copies the value in member speed_value - * @param _speed_value New value to be copied in member speed_value - */ - eProsima_user_DllExport void speed_value( - const etsi_its_cam_msgs::msg::SpeedValue& _speed_value); - - /*! - * @brief This function moves the value in member speed_value - * @param _speed_value New value to be moved in member speed_value - */ - eProsima_user_DllExport void speed_value( - etsi_its_cam_msgs::msg::SpeedValue&& _speed_value); - - /*! - * @brief This function returns a constant reference to member speed_value - * @return Constant reference to member speed_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedValue& speed_value() const; - - /*! - * @brief This function returns a reference to member speed_value - * @return Reference to member speed_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedValue& speed_value(); - /*! - * @brief This function copies the value in member speed_confidence - * @param _speed_confidence New value to be copied in member speed_confidence - */ - eProsima_user_DllExport void speed_confidence( - const etsi_its_cam_msgs::msg::SpeedConfidence& _speed_confidence); - - /*! - * @brief This function moves the value in member speed_confidence - * @param _speed_confidence New value to be moved in member speed_confidence - */ - eProsima_user_DllExport void speed_confidence( - etsi_its_cam_msgs::msg::SpeedConfidence&& _speed_confidence); - - /*! - * @brief This function returns a constant reference to member speed_confidence - * @return Constant reference to member speed_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedConfidence& speed_confidence() const; - - /*! - * @brief This function returns a reference to member speed_confidence - * @return Reference to member speed_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedConfidence& speed_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::Speed& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::SpeedValue m_speed_value; - etsi_its_cam_msgs::msg::SpeedConfidence m_speed_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Speed defined by the user in the IDL file. + * @ingroup Speed + */ +class Speed +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Speed(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Speed(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. + */ + eProsima_user_DllExport Speed( + const Speed& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. + */ + eProsima_user_DllExport Speed( + Speed&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. + */ + eProsima_user_DllExport Speed& operator =( + const Speed& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::Speed that will be copied. + */ + eProsima_user_DllExport Speed& operator =( + Speed&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Speed object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Speed& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::Speed object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Speed& x) const; + + /*! + * @brief This function copies the value in member speed_value + * @param _speed_value New value to be copied in member speed_value + */ + eProsima_user_DllExport void speed_value( + const etsi_its_cam_msgs::msg::SpeedValue& _speed_value); + + /*! + * @brief This function moves the value in member speed_value + * @param _speed_value New value to be moved in member speed_value + */ + eProsima_user_DllExport void speed_value( + etsi_its_cam_msgs::msg::SpeedValue&& _speed_value); + + /*! + * @brief This function returns a constant reference to member speed_value + * @return Constant reference to member speed_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedValue& speed_value() const; + + /*! + * @brief This function returns a reference to member speed_value + * @return Reference to member speed_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedValue& speed_value(); + + + /*! + * @brief This function copies the value in member speed_confidence + * @param _speed_confidence New value to be copied in member speed_confidence + */ + eProsima_user_DllExport void speed_confidence( + const etsi_its_cam_msgs::msg::SpeedConfidence& _speed_confidence); + + /*! + * @brief This function moves the value in member speed_confidence + * @param _speed_confidence New value to be moved in member speed_confidence + */ + eProsima_user_DllExport void speed_confidence( + etsi_its_cam_msgs::msg::SpeedConfidence&& _speed_confidence); + + /*! + * @brief This function returns a constant reference to member speed_confidence + * @return Constant reference to member speed_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SpeedConfidence& speed_confidence() const; + + /*! + * @brief This function returns a reference to member speed_confidence + * @return Reference to member speed_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SpeedConfidence& speed_confidence(); + +private: + + etsi_its_cam_msgs::msg::SpeedValue m_speed_value; + etsi_its_cam_msgs::msg::SpeedConfidence m_speed_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedCdrAux.hpp new file mode 100644 index 00000000000..59803cabe71 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCDRAUX_HPP_ + +#include "Speed.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_Speed_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_Speed_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Speed& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedCdrAux.ipp new file mode 100644 index 00000000000..2c6565575ed --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCDRAUX_IPP_ + +#include "SpeedCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::Speed& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.speed_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.speed_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Speed& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.speed_value() + << eprosima::fastcdr::MemberId(1) << data.speed_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::Speed& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.speed_value(); + break; + + case 1: + dcdr >> data.speed_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::Speed& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.cxx index 936602ff0d3..489a882171c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.cxx @@ -14,9 +14,9 @@ /*! * @file SpeedConfidence.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,120 +27,79 @@ char dummy; #endif // _WIN32 #include "SpeedConfidence.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpeedConfidence_Constants { +} // namespace SpeedConfidence_Constants -etsi_its_cam_msgs::msg::SpeedConfidence::SpeedConfidence() +SpeedConfidence::SpeedConfidence() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@bcb09a6 - m_value = 0; - } -etsi_its_cam_msgs::msg::SpeedConfidence::~SpeedConfidence() +SpeedConfidence::~SpeedConfidence() { } -etsi_its_cam_msgs::msg::SpeedConfidence::SpeedConfidence( +SpeedConfidence::SpeedConfidence( const SpeedConfidence& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SpeedConfidence::SpeedConfidence( - SpeedConfidence&& x) +SpeedConfidence::SpeedConfidence( + SpeedConfidence&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::SpeedConfidence::operator =( +SpeedConfidence& SpeedConfidence::operator =( const SpeedConfidence& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::SpeedConfidence& etsi_its_cam_msgs::msg::SpeedConfidence::operator =( - SpeedConfidence&& x) +SpeedConfidence& SpeedConfidence::operator =( + SpeedConfidence&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::SpeedConfidence::operator ==( +bool SpeedConfidence::operator ==( const SpeedConfidence& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::SpeedConfidence::operator !=( +bool SpeedConfidence::operator !=( const SpeedConfidence& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SpeedConfidence::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SpeedConfidence::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpeedConfidence& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SpeedConfidence::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::SpeedConfidence::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::SpeedConfidence::value( +void SpeedConfidence::value( uint8_t _value) { m_value = _value; @@ -150,7 +109,7 @@ void etsi_its_cam_msgs::msg::SpeedConfidence::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::SpeedConfidence::value() const +uint8_t SpeedConfidence::value() const { return m_value; } @@ -159,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::SpeedConfidence::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::SpeedConfidence::value() +uint8_t& SpeedConfidence::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::SpeedConfidence::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::SpeedConfidence::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::SpeedConfidence::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SpeedConfidenceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.h index 1f88c66aecf..6de0ba41bd8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidence.h @@ -16,19 +16,24 @@ * @file SpeedConfidence.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,177 +47,133 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SpeedConfidence_SOURCE) -#define SpeedConfidence_DllAPI __declspec( dllexport ) +#if defined(SPEEDCONFIDENCE_SOURCE) +#define SPEEDCONFIDENCE_DllAPI __declspec( dllexport ) #else -#define SpeedConfidence_DllAPI __declspec( dllimport ) -#endif // SpeedConfidence_SOURCE +#define SPEEDCONFIDENCE_DllAPI __declspec( dllimport ) +#endif // SPEEDCONFIDENCE_SOURCE #else -#define SpeedConfidence_DllAPI +#define SPEEDCONFIDENCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SpeedConfidence_DllAPI +#define SPEEDCONFIDENCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SpeedConfidence_Constants { - const uint8_t MIN = 1; - const uint8_t MAX = 127; - const uint8_t EQUAL_OR_WITHIN_ONE_CENTIMETER_PER_SEC = 1; - const uint8_t EQUAL_OR_WITHIN_ONE_METER_PER_SEC = 100; - const uint8_t OUT_OF_RANGE = 126; - const uint8_t UNAVAILABLE = 127; - } // namespace SpeedConfidence_Constants - /*! - * @brief This class represents the structure SpeedConfidence defined by the user in the IDL file. - * @ingroup SPEEDCONFIDENCE - */ - class SpeedConfidence - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SpeedConfidence(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SpeedConfidence(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. - */ - eProsima_user_DllExport SpeedConfidence( - const SpeedConfidence& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. - */ - eProsima_user_DllExport SpeedConfidence( - SpeedConfidence&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. - */ - eProsima_user_DllExport SpeedConfidence& operator =( - const SpeedConfidence& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. - */ - eProsima_user_DllExport SpeedConfidence& operator =( - SpeedConfidence&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpeedConfidence object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SpeedConfidence& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpeedConfidence object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SpeedConfidence& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpeedConfidence& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace SpeedConfidence_Constants { + +const uint8_t MIN = 1; +const uint8_t MAX = 127; +const uint8_t EQUAL_OR_WITHIN_ONE_CENTIMETER_PER_SEC = 1; +const uint8_t EQUAL_OR_WITHIN_ONE_METER_PER_SEC = 100; +const uint8_t OUT_OF_RANGE = 126; +const uint8_t UNAVAILABLE = 127; + +} // namespace SpeedConfidence_Constants + + +/*! + * @brief This class represents the structure SpeedConfidence defined by the user in the IDL file. + * @ingroup SpeedConfidence + */ +class SpeedConfidence +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpeedConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpeedConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. + */ + eProsima_user_DllExport SpeedConfidence( + const SpeedConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. + */ + eProsima_user_DllExport SpeedConfidence( + SpeedConfidence&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. + */ + eProsima_user_DllExport SpeedConfidence& operator =( + const SpeedConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedConfidence that will be copied. + */ + eProsima_user_DllExport SpeedConfidence& operator =( + SpeedConfidence&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpeedConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpeedConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidenceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidenceCdrAux.hpp new file mode 100644 index 00000000000..b4597e311f4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidenceCdrAux.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedConfidenceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCECDRAUX_HPP_ + +#include "SpeedConfidence.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SpeedConfidence_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SpeedConfidence_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedConfidence& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidenceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidenceCdrAux.ipp new file mode 100644 index 00000000000..49b77751115 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidenceCdrAux.ipp @@ -0,0 +1,143 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedConfidenceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCECDRAUX_IPP_ + +#include "SpeedConfidenceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SpeedConfidence& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SpeedConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.cxx index 117c751390b..80be5398999 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.cxx @@ -16,170 +16,199 @@ * @file SpeedConfidencePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SpeedConfidencePubSubTypes.h" +#include "SpeedConfidenceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SpeedConfidence_Constants { - - - - - - - - } //End of namespace SpeedConfidence_Constants - SpeedConfidencePubSubType::SpeedConfidencePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SpeedConfidence_"); - auto type_size = SpeedConfidence::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SpeedConfidence::isKeyDefined(); - size_t keyLength = SpeedConfidence::getKeyMaxCdrSerializedSize() > 16 ? - SpeedConfidence::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpeedConfidencePubSubType::~SpeedConfidencePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpeedConfidencePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SpeedConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpeedConfidencePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SpeedConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpeedConfidencePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpeedConfidencePubSubType::createData() - { - return reinterpret_cast(new SpeedConfidence()); - } - - void SpeedConfidencePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpeedConfidencePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SpeedConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SpeedConfidence::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SpeedConfidence::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SpeedConfidence_Constants { + + + + + + + + + + + + + +} //End of namespace SpeedConfidence_Constants + + + +SpeedConfidencePubSubType::SpeedConfidencePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SpeedConfidence_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SpeedConfidence::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SpeedConfidence_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpeedConfidencePubSubType::~SpeedConfidencePubSubType() +{ +} + +bool SpeedConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SpeedConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpeedConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SpeedConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpeedConfidencePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpeedConfidencePubSubType::createData() +{ + return reinterpret_cast(new SpeedConfidence()); +} + +void SpeedConfidencePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpeedConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.h index 0590ba645fd..13275d6eb0e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedConfidencePubSubTypes.h @@ -16,101 +16,134 @@ * @file SpeedConfidencePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SpeedConfidence.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SpeedConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SpeedConfidence_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpeedConfidence_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type SpeedConfidence defined by the user in the IDL file. - * @ingroup SPEEDCONFIDENCE - */ - class SpeedConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SpeedConfidence type; - eProsima_user_DllExport SpeedConfidencePubSubType(); - eProsima_user_DllExport virtual ~SpeedConfidencePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +} // namespace SpeedConfidence_Constants - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type SpeedConfidence defined by the user in the IDL file. + * @ingroup SpeedConfidence + */ +class SpeedConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + typedef SpeedConfidence type; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport SpeedConfidencePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport ~SpeedConfidencePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SpeedConfidence(); - return true; - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDCONFIDENCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.cxx index da0805886c4..3d1683bb032 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.cxx @@ -14,9 +14,9 @@ /*! * @file SpeedLimit.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,117 +27,79 @@ char dummy; #endif // _WIN32 #include "SpeedLimit.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpeedLimit_Constants { + + +} // namespace SpeedLimit_Constants -etsi_its_cam_msgs::msg::SpeedLimit::SpeedLimit() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fd4acee - m_value = 0; +SpeedLimit::SpeedLimit() +{ } -etsi_its_cam_msgs::msg::SpeedLimit::~SpeedLimit() +SpeedLimit::~SpeedLimit() { } -etsi_its_cam_msgs::msg::SpeedLimit::SpeedLimit( +SpeedLimit::SpeedLimit( const SpeedLimit& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SpeedLimit::SpeedLimit( - SpeedLimit&& x) +SpeedLimit::SpeedLimit( + SpeedLimit&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SpeedLimit::operator =( +SpeedLimit& SpeedLimit::operator =( const SpeedLimit& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::SpeedLimit& etsi_its_cam_msgs::msg::SpeedLimit::operator =( - SpeedLimit&& x) +SpeedLimit& SpeedLimit::operator =( + SpeedLimit&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::SpeedLimit::operator ==( +bool SpeedLimit::operator ==( const SpeedLimit& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::SpeedLimit::operator !=( +bool SpeedLimit::operator !=( const SpeedLimit& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SpeedLimit::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SpeedLimit::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpeedLimit& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SpeedLimit::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::SpeedLimit::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::SpeedLimit::value( +void SpeedLimit::value( uint8_t _value) { m_value = _value; @@ -147,7 +109,7 @@ void etsi_its_cam_msgs::msg::SpeedLimit::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::SpeedLimit::value() const +uint8_t SpeedLimit::value() const { return m_value; } @@ -156,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::SpeedLimit::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::SpeedLimit::value() +uint8_t& SpeedLimit::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::SpeedLimit::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::SpeedLimit::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::SpeedLimit::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SpeedLimitCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.h index 4ec5893b373..45ad28629bd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimit.h @@ -16,19 +16,24 @@ * @file SpeedLimit.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,174 +47,130 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SpeedLimit_SOURCE) -#define SpeedLimit_DllAPI __declspec( dllexport ) +#if defined(SPEEDLIMIT_SOURCE) +#define SPEEDLIMIT_DllAPI __declspec( dllexport ) #else -#define SpeedLimit_DllAPI __declspec( dllimport ) -#endif // SpeedLimit_SOURCE +#define SPEEDLIMIT_DllAPI __declspec( dllimport ) +#endif // SPEEDLIMIT_SOURCE #else -#define SpeedLimit_DllAPI +#define SPEEDLIMIT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SpeedLimit_DllAPI +#define SPEEDLIMIT_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SpeedLimit_Constants { - const uint8_t MIN = 1; - const uint8_t MAX = 255; - const uint8_t ONE_KM_PER_HOUR = 1; - } // namespace SpeedLimit_Constants - /*! - * @brief This class represents the structure SpeedLimit defined by the user in the IDL file. - * @ingroup SPEEDLIMIT - */ - class SpeedLimit - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SpeedLimit(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SpeedLimit(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. - */ - eProsima_user_DllExport SpeedLimit( - const SpeedLimit& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. - */ - eProsima_user_DllExport SpeedLimit( - SpeedLimit&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. - */ - eProsima_user_DllExport SpeedLimit& operator =( - const SpeedLimit& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. - */ - eProsima_user_DllExport SpeedLimit& operator =( - SpeedLimit&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpeedLimit object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SpeedLimit& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpeedLimit object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SpeedLimit& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpeedLimit& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace SpeedLimit_Constants { + +const uint8_t MIN = 1; +const uint8_t MAX = 255; +const uint8_t ONE_KM_PER_HOUR = 1; + +} // namespace SpeedLimit_Constants + + +/*! + * @brief This class represents the structure SpeedLimit defined by the user in the IDL file. + * @ingroup SpeedLimit + */ +class SpeedLimit +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpeedLimit(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpeedLimit(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. + */ + eProsima_user_DllExport SpeedLimit( + const SpeedLimit& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. + */ + eProsima_user_DllExport SpeedLimit( + SpeedLimit&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. + */ + eProsima_user_DllExport SpeedLimit& operator =( + const SpeedLimit& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedLimit that will be copied. + */ + eProsima_user_DllExport SpeedLimit& operator =( + SpeedLimit&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedLimit object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpeedLimit& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedLimit object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpeedLimit& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitCdrAux.hpp new file mode 100644 index 00000000000..f82506a5190 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedLimitCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMITCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMITCDRAUX_HPP_ + +#include "SpeedLimit.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SpeedLimit_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SpeedLimit_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedLimit& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMITCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitCdrAux.ipp new file mode 100644 index 00000000000..c725604dc44 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitCdrAux.ipp @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedLimitCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMITCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMITCDRAUX_IPP_ + +#include "SpeedLimitCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SpeedLimit& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedLimit& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SpeedLimit& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedLimit& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMITCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.cxx index 643f1e77dd1..7492afb9125 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.cxx @@ -16,167 +16,193 @@ * @file SpeedLimitPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SpeedLimitPubSubTypes.h" +#include "SpeedLimitCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SpeedLimit_Constants { - - - - - } //End of namespace SpeedLimit_Constants - SpeedLimitPubSubType::SpeedLimitPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SpeedLimit_"); - auto type_size = SpeedLimit::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SpeedLimit::isKeyDefined(); - size_t keyLength = SpeedLimit::getKeyMaxCdrSerializedSize() > 16 ? - SpeedLimit::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpeedLimitPubSubType::~SpeedLimitPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpeedLimitPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SpeedLimit* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpeedLimitPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SpeedLimit* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpeedLimitPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpeedLimitPubSubType::createData() - { - return reinterpret_cast(new SpeedLimit()); - } - - void SpeedLimitPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpeedLimitPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SpeedLimit* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SpeedLimit::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SpeedLimit::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SpeedLimit_Constants { + + + + + + + +} //End of namespace SpeedLimit_Constants + + + +SpeedLimitPubSubType::SpeedLimitPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SpeedLimit_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SpeedLimit::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SpeedLimit_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpeedLimitPubSubType::~SpeedLimitPubSubType() +{ +} + +bool SpeedLimitPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SpeedLimit* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpeedLimitPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SpeedLimit* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpeedLimitPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpeedLimitPubSubType::createData() +{ + return reinterpret_cast(new SpeedLimit()); +} + +void SpeedLimitPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpeedLimitPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.h index 4e22177920d..bc9cc3c5046 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedLimitPubSubTypes.h @@ -16,98 +16,128 @@ * @file SpeedLimitPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SpeedLimit.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SpeedLimit is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SpeedLimit_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpeedLimit_Constants { + + + - } - /*! - * @brief This class represents the TopicDataType of the type SpeedLimit defined by the user in the IDL file. - * @ingroup SPEEDLIMIT - */ - class SpeedLimitPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +} // namespace SpeedLimit_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type SpeedLimit defined by the user in the IDL file. + * @ingroup SpeedLimit + */ +class SpeedLimitPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SpeedLimit type; - typedef SpeedLimit type; + eProsima_user_DllExport SpeedLimitPubSubType(); - eProsima_user_DllExport SpeedLimitPubSubType(); + eProsima_user_DllExport ~SpeedLimitPubSubType() override; - eProsima_user_DllExport virtual ~SpeedLimitPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SpeedLimit(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDLIMIT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.cxx index 2dc44d40b17..bcb01b15c2a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file SpeedPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SpeedPubSubTypes.h" +#include "SpeedCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - SpeedPubSubType::SpeedPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::Speed_"); - auto type_size = Speed::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Speed::isKeyDefined(); - size_t keyLength = Speed::getKeyMaxCdrSerializedSize() > 16 ? - Speed::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpeedPubSubType::~SpeedPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpeedPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Speed* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpeedPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Speed* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpeedPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpeedPubSubType::createData() - { - return reinterpret_cast(new Speed()); - } - - void SpeedPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpeedPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Speed* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Speed::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Speed::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +SpeedPubSubType::SpeedPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::Speed_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Speed::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_Speed_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpeedPubSubType::~SpeedPubSubType() +{ +} + +bool SpeedPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Speed* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpeedPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Speed* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpeedPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpeedPubSubType::createData() +{ + return reinterpret_cast(new Speed()); +} + +void SpeedPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpeedPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.h index 14bab114d7e..ed377528855 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedPubSubTypes.h @@ -16,92 +16,122 @@ * @file SpeedPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Speed.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "SpeedValuePubSubTypes.h" +#include "SpeedConfidencePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Speed is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Speed defined by the user in the IDL file. + * @ingroup Speed + */ +class SpeedPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Speed defined by the user in the IDL file. - * @ingroup SPEED - */ - class SpeedPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Speed type; + typedef Speed type; - eProsima_user_DllExport SpeedPubSubType(); + eProsima_user_DllExport SpeedPubSubType(); - eProsima_user_DllExport virtual ~SpeedPubSubType(); + eProsima_user_DllExport ~SpeedPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Speed(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEED_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.cxx index a1fbb345de5..a0ea77db534 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.cxx @@ -14,9 +14,9 @@ /*! * @file SpeedValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "SpeedValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpeedValue_Constants { +} // namespace SpeedValue_Constants -etsi_its_cam_msgs::msg::SpeedValue::SpeedValue() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@41477a6d - m_value = 0; +SpeedValue::SpeedValue() +{ } -etsi_its_cam_msgs::msg::SpeedValue::~SpeedValue() +SpeedValue::~SpeedValue() { } -etsi_its_cam_msgs::msg::SpeedValue::SpeedValue( +SpeedValue::SpeedValue( const SpeedValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SpeedValue::SpeedValue( - SpeedValue&& x) +SpeedValue::SpeedValue( + SpeedValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::SpeedValue::operator =( +SpeedValue& SpeedValue::operator =( const SpeedValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::SpeedValue& etsi_its_cam_msgs::msg::SpeedValue::operator =( - SpeedValue&& x) +SpeedValue& SpeedValue::operator =( + SpeedValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::SpeedValue::operator ==( +bool SpeedValue::operator ==( const SpeedValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::SpeedValue::operator !=( +bool SpeedValue::operator !=( const SpeedValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SpeedValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SpeedValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpeedValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SpeedValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::SpeedValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::SpeedValue::value( +void SpeedValue::value( uint16_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::SpeedValue::value( * @brief This function returns the value of member value * @return Value of member value */ -uint16_t etsi_its_cam_msgs::msg::SpeedValue::value() const +uint16_t SpeedValue::value() const { return m_value; } @@ -158,32 +118,18 @@ uint16_t etsi_its_cam_msgs::msg::SpeedValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint16_t& etsi_its_cam_msgs::msg::SpeedValue::value() +uint16_t& SpeedValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::SpeedValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::SpeedValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::SpeedValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SpeedValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.h index 34951129a8d..b7766f69d2a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValue.h @@ -16,19 +16,24 @@ * @file SpeedValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SpeedValue_SOURCE) -#define SpeedValue_DllAPI __declspec( dllexport ) +#if defined(SPEEDVALUE_SOURCE) +#define SPEEDVALUE_DllAPI __declspec( dllexport ) #else -#define SpeedValue_DllAPI __declspec( dllimport ) -#endif // SpeedValue_SOURCE +#define SPEEDVALUE_DllAPI __declspec( dllimport ) +#endif // SPEEDVALUE_SOURCE #else -#define SpeedValue_DllAPI +#define SPEEDVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SpeedValue_DllAPI +#define SPEEDVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SpeedValue_Constants { - const uint16_t MIN = 0; - const uint16_t MAX = 16383; - const uint16_t STANDSTILL = 0; - const uint16_t ONE_CENTIMETER_PER_SEC = 1; - const uint16_t UNAVAILABLE = 16383; - } // namespace SpeedValue_Constants - /*! - * @brief This class represents the structure SpeedValue defined by the user in the IDL file. - * @ingroup SPEEDVALUE - */ - class SpeedValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SpeedValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SpeedValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. - */ - eProsima_user_DllExport SpeedValue( - const SpeedValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. - */ - eProsima_user_DllExport SpeedValue( - SpeedValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. - */ - eProsima_user_DllExport SpeedValue& operator =( - const SpeedValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. - */ - eProsima_user_DllExport SpeedValue& operator =( - SpeedValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpeedValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SpeedValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SpeedValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SpeedValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SpeedValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace SpeedValue_Constants { + +const uint16_t MIN = 0; +const uint16_t MAX = 16383; +const uint16_t STANDSTILL = 0; +const uint16_t ONE_CENTIMETER_PER_SEC = 1; +const uint16_t UNAVAILABLE = 16383; + +} // namespace SpeedValue_Constants + + +/*! + * @brief This class represents the structure SpeedValue defined by the user in the IDL file. + * @ingroup SpeedValue + */ +class SpeedValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SpeedValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SpeedValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. + */ + eProsima_user_DllExport SpeedValue( + const SpeedValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. + */ + eProsima_user_DllExport SpeedValue( + SpeedValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. + */ + eProsima_user_DllExport SpeedValue& operator =( + const SpeedValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SpeedValue that will be copied. + */ + eProsima_user_DllExport SpeedValue& operator =( + SpeedValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SpeedValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SpeedValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SpeedValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + +private: + + uint16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValueCdrAux.hpp new file mode 100644 index 00000000000..5193283203d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValueCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUECDRAUX_HPP_ + +#include "SpeedValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SpeedValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SpeedValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValueCdrAux.ipp new file mode 100644 index 00000000000..c38925f10ea --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValueCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SpeedValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUECDRAUX_IPP_ + +#include "SpeedValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SpeedValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SpeedValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SpeedValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.cxx index 13b08fc8e7e..600d4194020 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file SpeedValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SpeedValuePubSubTypes.h" +#include "SpeedValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SpeedValue_Constants { - - - - - - - } //End of namespace SpeedValue_Constants - SpeedValuePubSubType::SpeedValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SpeedValue_"); - auto type_size = SpeedValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SpeedValue::isKeyDefined(); - size_t keyLength = SpeedValue::getKeyMaxCdrSerializedSize() > 16 ? - SpeedValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SpeedValuePubSubType::~SpeedValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SpeedValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SpeedValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SpeedValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SpeedValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SpeedValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SpeedValuePubSubType::createData() - { - return reinterpret_cast(new SpeedValue()); - } - - void SpeedValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SpeedValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SpeedValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SpeedValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SpeedValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SpeedValue_Constants { + + + + + + + + + + + +} //End of namespace SpeedValue_Constants + + + +SpeedValuePubSubType::SpeedValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SpeedValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SpeedValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SpeedValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SpeedValuePubSubType::~SpeedValuePubSubType() +{ +} + +bool SpeedValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SpeedValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SpeedValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SpeedValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SpeedValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SpeedValuePubSubType::createData() +{ + return reinterpret_cast(new SpeedValue()); +} + +void SpeedValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SpeedValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.h index 9d5ee7fb807..5f4788f633f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SpeedValuePubSubTypes.h @@ -16,100 +16,132 @@ * @file SpeedValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SpeedValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SpeedValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SpeedValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SpeedValue_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type SpeedValue defined by the user in the IDL file. - * @ingroup SPEEDVALUE - */ - class SpeedValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SpeedValue type; +} // namespace SpeedValue_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type SpeedValue defined by the user in the IDL file. + * @ingroup SpeedValue + */ +class SpeedValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SpeedValue type; + + eProsima_user_DllExport SpeedValuePubSubType(); - eProsima_user_DllExport SpeedValuePubSubType(); + eProsima_user_DllExport ~SpeedValuePubSubType() override; - eProsima_user_DllExport virtual ~SpeedValuePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SpeedValue(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SPEEDVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.cxx index 1aacaed0d10..93e7773f46e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.cxx @@ -14,9 +14,9 @@ /*! * @file StationID.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,116 +27,79 @@ char dummy; #endif // _WIN32 #include "StationID.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { + +namespace StationID_Constants { + + +} // namespace StationID_Constants -etsi_its_cam_msgs::msg::StationID::StationID() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e6d5d29 - m_value = 0; +StationID::StationID() +{ } -etsi_its_cam_msgs::msg::StationID::~StationID() +StationID::~StationID() { } -etsi_its_cam_msgs::msg::StationID::StationID( +StationID::StationID( const StationID& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::StationID::StationID( - StationID&& x) +StationID::StationID( + StationID&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::StationID::operator =( +StationID& StationID::operator =( const StationID& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::StationID& etsi_its_cam_msgs::msg::StationID::operator =( - StationID&& x) +StationID& StationID::operator =( + StationID&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::StationID::operator ==( +bool StationID::operator ==( const StationID& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::StationID::operator !=( +bool StationID::operator !=( const StationID& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::StationID::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::StationID::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::StationID& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::StationID::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::StationID::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::StationID::value( +void StationID::value( uint32_t _value) { m_value = _value; @@ -146,7 +109,7 @@ void etsi_its_cam_msgs::msg::StationID::value( * @brief This function returns the value of member value * @return Value of member value */ -uint32_t etsi_its_cam_msgs::msg::StationID::value() const +uint32_t StationID::value() const { return m_value; } @@ -155,32 +118,18 @@ uint32_t etsi_its_cam_msgs::msg::StationID::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint32_t& etsi_its_cam_msgs::msg::StationID::value() +uint32_t& StationID::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::StationID::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::StationID::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::StationID::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "StationIDCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.h index 101b07253f0..6fad8ea8291 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationID.h @@ -16,19 +16,24 @@ * @file StationID.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,173 +47,129 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(StationID_SOURCE) -#define StationID_DllAPI __declspec( dllexport ) +#if defined(STATIONID_SOURCE) +#define STATIONID_DllAPI __declspec( dllexport ) #else -#define StationID_DllAPI __declspec( dllimport ) -#endif // StationID_SOURCE +#define STATIONID_DllAPI __declspec( dllimport ) +#endif // STATIONID_SOURCE #else -#define StationID_DllAPI +#define STATIONID_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define StationID_DllAPI +#define STATIONID_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace StationID_Constants { - const uint32_t MIN = 0; - const uint32_t MAX = 4294967295; - } // namespace StationID_Constants - /*! - * @brief This class represents the structure StationID defined by the user in the IDL file. - * @ingroup STATIONID - */ - class StationID - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StationID(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StationID(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. - */ - eProsima_user_DllExport StationID( - const StationID& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. - */ - eProsima_user_DllExport StationID( - StationID&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. - */ - eProsima_user_DllExport StationID& operator =( - const StationID& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. - */ - eProsima_user_DllExport StationID& operator =( - StationID&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::StationID object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StationID& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::StationID object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StationID& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint32_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint32_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint32_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::StationID& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint32_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace StationID_Constants { + +const uint32_t MIN = 0; +const uint32_t MAX = 4294967295; + +} // namespace StationID_Constants + + +/*! + * @brief This class represents the structure StationID defined by the user in the IDL file. + * @ingroup StationID + */ +class StationID +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StationID(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StationID(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. + */ + eProsima_user_DllExport StationID( + const StationID& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. + */ + eProsima_user_DllExport StationID( + StationID&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. + */ + eProsima_user_DllExport StationID& operator =( + const StationID& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationID that will be copied. + */ + eProsima_user_DllExport StationID& operator =( + StationID&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::StationID object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StationID& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::StationID object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StationID& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint32_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint32_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint32_t& value(); + +private: + + uint32_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDCdrAux.hpp new file mode 100644 index 00000000000..a648da0e2b0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDCdrAux.hpp @@ -0,0 +1,55 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationIDCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONIDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONIDCDRAUX_HPP_ + +#include "StationID.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_StationID_max_cdr_typesize {8UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_StationID_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::StationID& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONIDCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDCdrAux.ipp new file mode 100644 index 00000000000..f4378726852 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDCdrAux.ipp @@ -0,0 +1,135 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationIDCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONIDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONIDCDRAUX_IPP_ + +#include "StationIDCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::StationID& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::StationID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::StationID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::StationID& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONIDCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.cxx index d501c2176e5..4417859eab4 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.cxx @@ -16,166 +16,191 @@ * @file StationIDPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "StationIDPubSubTypes.h" +#include "StationIDCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace StationID_Constants { - - - - } //End of namespace StationID_Constants - StationIDPubSubType::StationIDPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::StationID_"); - auto type_size = StationID::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = StationID::isKeyDefined(); - size_t keyLength = StationID::getKeyMaxCdrSerializedSize() > 16 ? - StationID::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - StationIDPubSubType::~StationIDPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool StationIDPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - StationID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool StationIDPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - StationID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function StationIDPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* StationIDPubSubType::createData() - { - return reinterpret_cast(new StationID()); - } - - void StationIDPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool StationIDPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - StationID* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StationID::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || StationID::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace StationID_Constants { + + + + + +} //End of namespace StationID_Constants + + + +StationIDPubSubType::StationIDPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::StationID_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StationID::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_StationID_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +StationIDPubSubType::~StationIDPubSubType() +{ +} + +bool StationIDPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + StationID* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool StationIDPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + StationID* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function StationIDPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* StationIDPubSubType::createData() +{ + return reinterpret_cast(new StationID()); +} + +void StationIDPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool StationIDPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.h index 90a59a096d4..73289d28cc9 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationIDPubSubTypes.h @@ -16,97 +16,126 @@ * @file StationIDPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "StationID.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated StationID is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace StationID_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace StationID_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type StationID defined by the user in the IDL file. - * @ingroup STATIONID - */ - class StationIDPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef StationID type; - eProsima_user_DllExport StationIDPubSubType(); +} // namespace StationID_Constants - eProsima_user_DllExport virtual ~StationIDPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type StationID defined by the user in the IDL file. + * @ingroup StationID + */ +class StationIDPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef StationID type; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport StationIDPubSubType(); - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport ~StationIDPubSubType() override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) StationID(); - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport void deleteData( + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONID_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.cxx index ada976c13a0..b10ffd98d77 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.cxx @@ -14,9 +14,9 @@ /*! * @file StationType.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,129 +27,79 @@ char dummy; #endif // _WIN32 #include "StationType.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace StationType_Constants { +} // namespace StationType_Constants - - - - - - - - - -etsi_its_cam_msgs::msg::StationType::StationType() +StationType::StationType() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4632cfc - m_value = 0; - } -etsi_its_cam_msgs::msg::StationType::~StationType() +StationType::~StationType() { } -etsi_its_cam_msgs::msg::StationType::StationType( +StationType::StationType( const StationType& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::StationType::StationType( - StationType&& x) +StationType::StationType( + StationType&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::StationType::operator =( +StationType& StationType::operator =( const StationType& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::StationType& etsi_its_cam_msgs::msg::StationType::operator =( - StationType&& x) +StationType& StationType::operator =( + StationType&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::StationType::operator ==( +bool StationType::operator ==( const StationType& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::StationType::operator !=( +bool StationType::operator !=( const StationType& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::StationType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::StationType::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::StationType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::StationType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::StationType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::StationType::value( +void StationType::value( uint8_t _value) { m_value = _value; @@ -159,7 +109,7 @@ void etsi_its_cam_msgs::msg::StationType::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::StationType::value() const +uint8_t StationType::value() const { return m_value; } @@ -168,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::StationType::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::StationType::value() +uint8_t& StationType::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::StationType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::StationType::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::StationType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "StationTypeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.h index 05d0439663e..cd7f06e2f95 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationType.h @@ -16,19 +16,24 @@ * @file StationType.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,186 +47,142 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(StationType_SOURCE) -#define StationType_DllAPI __declspec( dllexport ) +#if defined(STATIONTYPE_SOURCE) +#define STATIONTYPE_DllAPI __declspec( dllexport ) #else -#define StationType_DllAPI __declspec( dllimport ) -#endif // StationType_SOURCE +#define STATIONTYPE_DllAPI __declspec( dllimport ) +#endif // STATIONTYPE_SOURCE #else -#define StationType_DllAPI +#define STATIONTYPE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define StationType_DllAPI +#define STATIONTYPE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace StationType_Constants { - const uint8_t MIN = 0; - const uint8_t MAX = 255; - const uint8_t UNKNOWN = 0; - const uint8_t PEDESTRIAN = 1; - const uint8_t CYCLIST = 2; - const uint8_t MOPED = 3; - const uint8_t MOTORCYCLE = 4; - const uint8_t PASSENGER_CAR = 5; - const uint8_t BUS = 6; - const uint8_t LIGHT_TRUCK = 7; - const uint8_t HEAVY_TRUCK = 8; - const uint8_t TRAILER = 9; - const uint8_t SPECIAL_VEHICLES = 10; - const uint8_t TRAM = 11; - const uint8_t ROAD_SIDE_UNIT = 15; - } // namespace StationType_Constants - /*! - * @brief This class represents the structure StationType defined by the user in the IDL file. - * @ingroup STATIONTYPE - */ - class StationType - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StationType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StationType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. - */ - eProsima_user_DllExport StationType( - const StationType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. - */ - eProsima_user_DllExport StationType( - StationType&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. - */ - eProsima_user_DllExport StationType& operator =( - const StationType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. - */ - eProsima_user_DllExport StationType& operator =( - StationType&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::StationType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StationType& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::StationType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StationType& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::StationType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace StationType_Constants { + +const uint8_t MIN = 0; +const uint8_t MAX = 255; +const uint8_t UNKNOWN = 0; +const uint8_t PEDESTRIAN = 1; +const uint8_t CYCLIST = 2; +const uint8_t MOPED = 3; +const uint8_t MOTORCYCLE = 4; +const uint8_t PASSENGER_CAR = 5; +const uint8_t BUS = 6; +const uint8_t LIGHT_TRUCK = 7; +const uint8_t HEAVY_TRUCK = 8; +const uint8_t TRAILER = 9; +const uint8_t SPECIAL_VEHICLES = 10; +const uint8_t TRAM = 11; +const uint8_t ROAD_SIDE_UNIT = 15; + +} // namespace StationType_Constants + + +/*! + * @brief This class represents the structure StationType defined by the user in the IDL file. + * @ingroup StationType + */ +class StationType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StationType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StationType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. + */ + eProsima_user_DllExport StationType( + const StationType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. + */ + eProsima_user_DllExport StationType( + StationType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. + */ + eProsima_user_DllExport StationType& operator =( + const StationType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::StationType that will be copied. + */ + eProsima_user_DllExport StationType& operator =( + StationType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::StationType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StationType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::StationType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StationType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypeCdrAux.hpp new file mode 100644 index 00000000000..568889c0f11 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypeCdrAux.hpp @@ -0,0 +1,81 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationTypeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPECDRAUX_HPP_ + +#include "StationType.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_StationType_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_StationType_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::StationType& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypeCdrAux.ipp new file mode 100644 index 00000000000..5d45354d15e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypeCdrAux.ipp @@ -0,0 +1,161 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StationTypeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPECDRAUX_IPP_ + +#include "StationTypeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::StationType& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::StationType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::StationType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::StationType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.cxx index 9efeedb04cd..b29550c2a2e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.cxx @@ -16,21 +16,38 @@ * @file StationTypePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "StationTypePubSubTypes.h" +#include "StationTypeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace StationType_Constants { +namespace msg { +namespace StationType_Constants { + + + + + + + + + + + + + @@ -47,148 +64,169 @@ namespace etsi_its_cam_msgs { - } //End of namespace StationType_Constants - StationTypePubSubType::StationTypePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::StationType_"); - auto type_size = StationType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = StationType::isKeyDefined(); - size_t keyLength = StationType::getKeyMaxCdrSerializedSize() > 16 ? - StationType::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - StationTypePubSubType::~StationTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool StationTypePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - StationType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool StationTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - StationType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function StationTypePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* StationTypePubSubType::createData() - { - return reinterpret_cast(new StationType()); - } - - void StationTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool StationTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - StationType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StationType::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || StationType::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + +} //End of namespace StationType_Constants + + + +StationTypePubSubType::StationTypePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::StationType_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StationType::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_StationType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +StationTypePubSubType::~StationTypePubSubType() +{ +} + +bool StationTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + StationType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool StationTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + StationType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function StationTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* StationTypePubSubType::createData() +{ + return reinterpret_cast(new StationType()); +} + +void StationTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool StationTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.h index df1af41207c..2ee587efe24 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/StationTypePubSubTypes.h @@ -16,29 +16,48 @@ * @file StationTypePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "StationType.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated StationType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace StationType_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace StationType_Constants { + + + + + + + + + + + + + + + + @@ -53,73 +72,96 @@ namespace etsi_its_cam_msgs +} // namespace StationType_Constants - } - /*! - * @brief This class represents the TopicDataType of the type StationType defined by the user in the IDL file. - * @ingroup STATIONTYPE - */ - class StationTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef StationType type; - eProsima_user_DllExport StationTypePubSubType(); +/*! + * @brief This class represents the TopicDataType of the type StationType defined by the user in the IDL file. + * @ingroup StationType + */ +class StationTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef StationType type; + + eProsima_user_DllExport StationTypePubSubType(); - eProsima_user_DllExport virtual ~StationTypePubSubType(); + eProsima_user_DllExport ~StationTypePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) StationType(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STATIONTYPE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.cxx index 59e0e867a0d..853e5208828 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.cxx @@ -14,9 +14,9 @@ /*! * @file SteeringWheelAngle.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "SteeringWheelAngle.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::SteeringWheelAngle::SteeringWheelAngle() -{ - // m_steering_wheel_angle_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@89c65d5 - // m_steering_wheel_angle_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@faa3fed +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::SteeringWheelAngle::~SteeringWheelAngle() +SteeringWheelAngle::SteeringWheelAngle() { +} +SteeringWheelAngle::~SteeringWheelAngle() +{ } -etsi_its_cam_msgs::msg::SteeringWheelAngle::SteeringWheelAngle( +SteeringWheelAngle::SteeringWheelAngle( const SteeringWheelAngle& x) { m_steering_wheel_angle_value = x.m_steering_wheel_angle_value; m_steering_wheel_angle_confidence = x.m_steering_wheel_angle_confidence; } -etsi_its_cam_msgs::msg::SteeringWheelAngle::SteeringWheelAngle( - SteeringWheelAngle&& x) +SteeringWheelAngle::SteeringWheelAngle( + SteeringWheelAngle&& x) noexcept { m_steering_wheel_angle_value = std::move(x.m_steering_wheel_angle_value); m_steering_wheel_angle_confidence = std::move(x.m_steering_wheel_angle_confidence); } -etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::SteeringWheelAngle::operator =( +SteeringWheelAngle& SteeringWheelAngle::operator =( const SteeringWheelAngle& x) { m_steering_wheel_angle_value = x.m_steering_wheel_angle_value; m_steering_wheel_angle_confidence = x.m_steering_wheel_angle_confidence; - return *this; } -etsi_its_cam_msgs::msg::SteeringWheelAngle& etsi_its_cam_msgs::msg::SteeringWheelAngle::operator =( - SteeringWheelAngle&& x) +SteeringWheelAngle& SteeringWheelAngle::operator =( + SteeringWheelAngle&& x) noexcept { m_steering_wheel_angle_value = std::move(x.m_steering_wheel_angle_value); m_steering_wheel_angle_confidence = std::move(x.m_steering_wheel_angle_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::SteeringWheelAngle::operator ==( +bool SteeringWheelAngle::operator ==( const SteeringWheelAngle& x) const { - - return (m_steering_wheel_angle_value == x.m_steering_wheel_angle_value && m_steering_wheel_angle_confidence == x.m_steering_wheel_angle_confidence); + return (m_steering_wheel_angle_value == x.m_steering_wheel_angle_value && + m_steering_wheel_angle_confidence == x.m_steering_wheel_angle_confidence); } -bool etsi_its_cam_msgs::msg::SteeringWheelAngle::operator !=( +bool SteeringWheelAngle::operator !=( const SteeringWheelAngle& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SteeringWheelAngle::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SteeringWheelAngle::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SteeringWheelAngle& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getCdrSerializedSize(data.steering_wheel_angle_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getCdrSerializedSize(data.steering_wheel_angle_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SteeringWheelAngle::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_steering_wheel_angle_value; - scdr << m_steering_wheel_angle_confidence; - -} - -void etsi_its_cam_msgs::msg::SteeringWheelAngle::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_steering_wheel_angle_value; - dcdr >> m_steering_wheel_angle_confidence; -} - /*! * @brief This function copies the value in member steering_wheel_angle_value * @param _steering_wheel_angle_value New value to be copied in member steering_wheel_angle_value */ -void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value( +void SteeringWheelAngle::steering_wheel_angle_value( const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& _steering_wheel_angle_value) { m_steering_wheel_angle_value = _steering_wheel_angle_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value( * @brief This function moves the value in member steering_wheel_angle_value * @param _steering_wheel_angle_value New value to be moved in member steering_wheel_angle_value */ -void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value( +void SteeringWheelAngle::steering_wheel_angle_value( etsi_its_cam_msgs::msg::SteeringWheelAngleValue&& _steering_wheel_angle_value) { m_steering_wheel_angle_value = std::move(_steering_wheel_angle_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value( * @brief This function returns a constant reference to member steering_wheel_angle_value * @return Constant reference to member steering_wheel_angle_value */ -const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value() const +const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& SteeringWheelAngle::steering_wheel_angle_value() const { return m_steering_wheel_angle_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::S * @brief This function returns a reference to member steering_wheel_angle_value * @return Reference to member steering_wheel_angle_value */ -etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_value() +etsi_its_cam_msgs::msg::SteeringWheelAngleValue& SteeringWheelAngle::steering_wheel_angle_value() { return m_steering_wheel_angle_value; } + + /*! * @brief This function copies the value in member steering_wheel_angle_confidence * @param _steering_wheel_angle_confidence New value to be copied in member steering_wheel_angle_confidence */ -void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence( +void SteeringWheelAngle::steering_wheel_angle_confidence( const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& _steering_wheel_angle_confidence) { m_steering_wheel_angle_confidence = _steering_wheel_angle_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence * @brief This function moves the value in member steering_wheel_angle_confidence * @param _steering_wheel_angle_confidence New value to be moved in member steering_wheel_angle_confidence */ -void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence( +void SteeringWheelAngle::steering_wheel_angle_confidence( etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence&& _steering_wheel_angle_confidence) { m_steering_wheel_angle_confidence = std::move(_steering_wheel_angle_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence * @brief This function returns a constant reference to member steering_wheel_angle_confidence * @return Constant reference to member steering_wheel_angle_confidence */ -const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence() const +const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& SteeringWheelAngle::steering_wheel_angle_confidence() const { return m_steering_wheel_angle_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::m * @brief This function returns a reference to member steering_wheel_angle_confidence * @return Reference to member steering_wheel_angle_confidence */ -etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::msg::SteeringWheelAngle::steering_wheel_angle_confidence() +etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& SteeringWheelAngle::steering_wheel_angle_confidence() { return m_steering_wheel_angle_confidence; } -size_t etsi_its_cam_msgs::msg::SteeringWheelAngle::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::SteeringWheelAngle::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::SteeringWheelAngle::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SteeringWheelAngleCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.h index 6287e887d4b..ba035957b36 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngle.h @@ -16,21 +16,26 @@ * @file SteeringWheelAngle.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_H_ -#include "SteeringWheelAngleConfidence.h" -#include "SteeringWheelAngleValue.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "SteeringWheelAngleConfidence.h" +#include "SteeringWheelAngleValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SteeringWheelAngle_SOURCE) -#define SteeringWheelAngle_DllAPI __declspec( dllexport ) +#if defined(STEERINGWHEELANGLE_SOURCE) +#define STEERINGWHEELANGLE_DllAPI __declspec( dllexport ) #else -#define SteeringWheelAngle_DllAPI __declspec( dllimport ) -#endif // SteeringWheelAngle_SOURCE +#define STEERINGWHEELANGLE_DllAPI __declspec( dllimport ) +#endif // STEERINGWHEELANGLE_SOURCE #else -#define SteeringWheelAngle_DllAPI +#define STEERINGWHEELANGLE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SteeringWheelAngle_DllAPI +#define STEERINGWHEELANGLE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure SteeringWheelAngle defined by the user in the IDL file. - * @ingroup STEERINGWHEELANGLE - */ - class SteeringWheelAngle - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SteeringWheelAngle(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SteeringWheelAngle(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngle( - const SteeringWheelAngle& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngle( - SteeringWheelAngle&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngle& operator =( - const SteeringWheelAngle& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngle& operator =( - SteeringWheelAngle&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SteeringWheelAngle object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SteeringWheelAngle& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SteeringWheelAngle object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SteeringWheelAngle& x) const; - - /*! - * @brief This function copies the value in member steering_wheel_angle_value - * @param _steering_wheel_angle_value New value to be copied in member steering_wheel_angle_value - */ - eProsima_user_DllExport void steering_wheel_angle_value( - const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& _steering_wheel_angle_value); - - /*! - * @brief This function moves the value in member steering_wheel_angle_value - * @param _steering_wheel_angle_value New value to be moved in member steering_wheel_angle_value - */ - eProsima_user_DllExport void steering_wheel_angle_value( - etsi_its_cam_msgs::msg::SteeringWheelAngleValue&& _steering_wheel_angle_value); - - /*! - * @brief This function returns a constant reference to member steering_wheel_angle_value - * @return Constant reference to member steering_wheel_angle_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& steering_wheel_angle_value() const; - - /*! - * @brief This function returns a reference to member steering_wheel_angle_value - * @return Reference to member steering_wheel_angle_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngleValue& steering_wheel_angle_value(); - /*! - * @brief This function copies the value in member steering_wheel_angle_confidence - * @param _steering_wheel_angle_confidence New value to be copied in member steering_wheel_angle_confidence - */ - eProsima_user_DllExport void steering_wheel_angle_confidence( - const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& _steering_wheel_angle_confidence); - - /*! - * @brief This function moves the value in member steering_wheel_angle_confidence - * @param _steering_wheel_angle_confidence New value to be moved in member steering_wheel_angle_confidence - */ - eProsima_user_DllExport void steering_wheel_angle_confidence( - etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence&& _steering_wheel_angle_confidence); - - /*! - * @brief This function returns a constant reference to member steering_wheel_angle_confidence - * @return Constant reference to member steering_wheel_angle_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& steering_wheel_angle_confidence() const; - - /*! - * @brief This function returns a reference to member steering_wheel_angle_confidence - * @return Reference to member steering_wheel_angle_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& steering_wheel_angle_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SteeringWheelAngle& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::SteeringWheelAngleValue m_steering_wheel_angle_value; - etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence m_steering_wheel_angle_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure SteeringWheelAngle defined by the user in the IDL file. + * @ingroup SteeringWheelAngle + */ +class SteeringWheelAngle +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SteeringWheelAngle(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SteeringWheelAngle(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngle( + const SteeringWheelAngle& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngle( + SteeringWheelAngle&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngle& operator =( + const SteeringWheelAngle& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngle that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngle& operator =( + SteeringWheelAngle&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngle object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SteeringWheelAngle& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngle object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SteeringWheelAngle& x) const; + + /*! + * @brief This function copies the value in member steering_wheel_angle_value + * @param _steering_wheel_angle_value New value to be copied in member steering_wheel_angle_value + */ + eProsima_user_DllExport void steering_wheel_angle_value( + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& _steering_wheel_angle_value); + + /*! + * @brief This function moves the value in member steering_wheel_angle_value + * @param _steering_wheel_angle_value New value to be moved in member steering_wheel_angle_value + */ + eProsima_user_DllExport void steering_wheel_angle_value( + etsi_its_cam_msgs::msg::SteeringWheelAngleValue&& _steering_wheel_angle_value); + + /*! + * @brief This function returns a constant reference to member steering_wheel_angle_value + * @return Constant reference to member steering_wheel_angle_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& steering_wheel_angle_value() const; + + /*! + * @brief This function returns a reference to member steering_wheel_angle_value + * @return Reference to member steering_wheel_angle_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngleValue& steering_wheel_angle_value(); + + + /*! + * @brief This function copies the value in member steering_wheel_angle_confidence + * @param _steering_wheel_angle_confidence New value to be copied in member steering_wheel_angle_confidence + */ + eProsima_user_DllExport void steering_wheel_angle_confidence( + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& _steering_wheel_angle_confidence); + + /*! + * @brief This function moves the value in member steering_wheel_angle_confidence + * @param _steering_wheel_angle_confidence New value to be moved in member steering_wheel_angle_confidence + */ + eProsima_user_DllExport void steering_wheel_angle_confidence( + etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence&& _steering_wheel_angle_confidence); + + /*! + * @brief This function returns a constant reference to member steering_wheel_angle_confidence + * @return Constant reference to member steering_wheel_angle_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& steering_wheel_angle_confidence() const; + + /*! + * @brief This function returns a reference to member steering_wheel_angle_confidence + * @return Reference to member steering_wheel_angle_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& steering_wheel_angle_confidence(); + +private: + + etsi_its_cam_msgs::msg::SteeringWheelAngleValue m_steering_wheel_angle_value; + etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence m_steering_wheel_angle_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleCdrAux.hpp new file mode 100644 index 00000000000..d1efb84fd8f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECDRAUX_HPP_ + +#include "SteeringWheelAngle.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SteeringWheelAngle_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SteeringWheelAngle_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngle& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleCdrAux.ipp new file mode 100644 index 00000000000..09d62fcdd5f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECDRAUX_IPP_ + +#include "SteeringWheelAngleCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SteeringWheelAngle& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.steering_wheel_angle_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.steering_wheel_angle_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngle& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.steering_wheel_angle_value() + << eprosima::fastcdr::MemberId(1) << data.steering_wheel_angle_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SteeringWheelAngle& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.steering_wheel_angle_value(); + break; + + case 1: + dcdr >> data.steering_wheel_angle_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngle& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.cxx index d9cee4202da..8e1fc809160 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.cxx @@ -14,9 +14,9 @@ /*! * @file SteeringWheelAngleConfidence.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "SteeringWheelAngleConfidence.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace SteeringWheelAngleConfidence_Constants { +} // namespace SteeringWheelAngleConfidence_Constants -etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::SteeringWheelAngleConfidence() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@400d912a - m_value = 0; +SteeringWheelAngleConfidence::SteeringWheelAngleConfidence() +{ } -etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::~SteeringWheelAngleConfidence() +SteeringWheelAngleConfidence::~SteeringWheelAngleConfidence() { } -etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::SteeringWheelAngleConfidence( +SteeringWheelAngleConfidence::SteeringWheelAngleConfidence( const SteeringWheelAngleConfidence& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::SteeringWheelAngleConfidence( - SteeringWheelAngleConfidence&& x) +SteeringWheelAngleConfidence::SteeringWheelAngleConfidence( + SteeringWheelAngleConfidence&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::operator =( +SteeringWheelAngleConfidence& SteeringWheelAngleConfidence::operator =( const SteeringWheelAngleConfidence& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::operator =( - SteeringWheelAngleConfidence&& x) +SteeringWheelAngleConfidence& SteeringWheelAngleConfidence::operator =( + SteeringWheelAngleConfidence&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::operator ==( +bool SteeringWheelAngleConfidence::operator ==( const SteeringWheelAngleConfidence& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::operator !=( +bool SteeringWheelAngleConfidence::operator !=( const SteeringWheelAngleConfidence& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::value( +void SteeringWheelAngleConfidence::value( uint8_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::value() const +uint8_t SteeringWheelAngleConfidence::value() const { return m_value; } @@ -158,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::value() +uint8_t& SteeringWheelAngleConfidence::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SteeringWheelAngleConfidenceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.h index d582bf820f0..eb6edad6f3d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidence.h @@ -16,19 +16,24 @@ * @file SteeringWheelAngleConfidence.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SteeringWheelAngleConfidence_SOURCE) -#define SteeringWheelAngleConfidence_DllAPI __declspec( dllexport ) +#if defined(STEERINGWHEELANGLECONFIDENCE_SOURCE) +#define STEERINGWHEELANGLECONFIDENCE_DllAPI __declspec( dllexport ) #else -#define SteeringWheelAngleConfidence_DllAPI __declspec( dllimport ) -#endif // SteeringWheelAngleConfidence_SOURCE +#define STEERINGWHEELANGLECONFIDENCE_DllAPI __declspec( dllimport ) +#endif // STEERINGWHEELANGLECONFIDENCE_SOURCE #else -#define SteeringWheelAngleConfidence_DllAPI +#define STEERINGWHEELANGLECONFIDENCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SteeringWheelAngleConfidence_DllAPI +#define STEERINGWHEELANGLECONFIDENCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SteeringWheelAngleConfidence_Constants { - const uint8_t MIN = 1; - const uint8_t MAX = 127; - const uint8_t EQUAL_OR_WITHIN_ONE_POINT_FIVE_DEGREE = 1; - const uint8_t OUT_OF_RANGE = 126; - const uint8_t UNAVAILABLE = 127; - } // namespace SteeringWheelAngleConfidence_Constants - /*! - * @brief This class represents the structure SteeringWheelAngleConfidence defined by the user in the IDL file. - * @ingroup STEERINGWHEELANGLECONFIDENCE - */ - class SteeringWheelAngleConfidence - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SteeringWheelAngleConfidence(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SteeringWheelAngleConfidence(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngleConfidence( - const SteeringWheelAngleConfidence& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngleConfidence( - SteeringWheelAngleConfidence&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngleConfidence& operator =( - const SteeringWheelAngleConfidence& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngleConfidence& operator =( - SteeringWheelAngleConfidence&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SteeringWheelAngleConfidence& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SteeringWheelAngleConfidence& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace SteeringWheelAngleConfidence_Constants { + +const uint8_t MIN = 1; +const uint8_t MAX = 127; +const uint8_t EQUAL_OR_WITHIN_ONE_POINT_FIVE_DEGREE = 1; +const uint8_t OUT_OF_RANGE = 126; +const uint8_t UNAVAILABLE = 127; + +} // namespace SteeringWheelAngleConfidence_Constants + + +/*! + * @brief This class represents the structure SteeringWheelAngleConfidence defined by the user in the IDL file. + * @ingroup SteeringWheelAngleConfidence + */ +class SteeringWheelAngleConfidence +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SteeringWheelAngleConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence( + const SteeringWheelAngleConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence( + SteeringWheelAngleConfidence&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence& operator =( + const SteeringWheelAngleConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleConfidence& operator =( + SteeringWheelAngleConfidence&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SteeringWheelAngleConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SteeringWheelAngleConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidenceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidenceCdrAux.hpp new file mode 100644 index 00000000000..c82ddca8a06 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidenceCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleConfidenceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCECDRAUX_HPP_ + +#include "SteeringWheelAngleConfidence.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SteeringWheelAngleConfidence_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SteeringWheelAngleConfidence_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidenceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidenceCdrAux.ipp new file mode 100644 index 00000000000..356e7939dac --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidenceCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleConfidenceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCECDRAUX_IPP_ + +#include "SteeringWheelAngleConfidenceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngleConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.cxx index 2b5fe2baaad..447bee931b8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file SteeringWheelAngleConfidencePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SteeringWheelAngleConfidencePubSubTypes.h" +#include "SteeringWheelAngleConfidenceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SteeringWheelAngleConfidence_Constants { - - - - - - - } //End of namespace SteeringWheelAngleConfidence_Constants - SteeringWheelAngleConfidencePubSubType::SteeringWheelAngleConfidencePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngleConfidence_"); - auto type_size = SteeringWheelAngleConfidence::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SteeringWheelAngleConfidence::isKeyDefined(); - size_t keyLength = SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize() > 16 ? - SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SteeringWheelAngleConfidencePubSubType::~SteeringWheelAngleConfidencePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SteeringWheelAngleConfidencePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SteeringWheelAngleConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SteeringWheelAngleConfidencePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SteeringWheelAngleConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SteeringWheelAngleConfidencePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SteeringWheelAngleConfidencePubSubType::createData() - { - return reinterpret_cast(new SteeringWheelAngleConfidence()); - } - - void SteeringWheelAngleConfidencePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SteeringWheelAngleConfidencePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SteeringWheelAngleConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SteeringWheelAngleConfidence::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SteeringWheelAngleConfidence_Constants { + + + + + + + + + + + +} //End of namespace SteeringWheelAngleConfidence_Constants + + + +SteeringWheelAngleConfidencePubSubType::SteeringWheelAngleConfidencePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngleConfidence_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SteeringWheelAngleConfidence::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SteeringWheelAngleConfidence_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SteeringWheelAngleConfidencePubSubType::~SteeringWheelAngleConfidencePubSubType() +{ +} + +bool SteeringWheelAngleConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SteeringWheelAngleConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SteeringWheelAngleConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SteeringWheelAngleConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SteeringWheelAngleConfidencePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SteeringWheelAngleConfidencePubSubType::createData() +{ + return reinterpret_cast(new SteeringWheelAngleConfidence()); +} + +void SteeringWheelAngleConfidencePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SteeringWheelAngleConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.h index f294f5cc3a0..af65791d08c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleConfidencePubSubTypes.h @@ -16,100 +16,132 @@ * @file SteeringWheelAngleConfidencePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SteeringWheelAngleConfidence.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SteeringWheelAngleConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SteeringWheelAngleConfidence_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SteeringWheelAngleConfidence_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type SteeringWheelAngleConfidence defined by the user in the IDL file. - * @ingroup STEERINGWHEELANGLECONFIDENCE - */ - class SteeringWheelAngleConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SteeringWheelAngleConfidence type; +} // namespace SteeringWheelAngleConfidence_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type SteeringWheelAngleConfidence defined by the user in the IDL file. + * @ingroup SteeringWheelAngleConfidence + */ +class SteeringWheelAngleConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SteeringWheelAngleConfidence type; + + eProsima_user_DllExport SteeringWheelAngleConfidencePubSubType(); - eProsima_user_DllExport SteeringWheelAngleConfidencePubSubType(); + eProsima_user_DllExport ~SteeringWheelAngleConfidencePubSubType() override; - eProsima_user_DllExport virtual ~SteeringWheelAngleConfidencePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SteeringWheelAngleConfidence(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLECONFIDENCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.cxx index 543b4a07415..10b4d7d76ea 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file SteeringWheelAnglePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SteeringWheelAnglePubSubTypes.h" +#include "SteeringWheelAngleCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - SteeringWheelAnglePubSubType::SteeringWheelAnglePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngle_"); - auto type_size = SteeringWheelAngle::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SteeringWheelAngle::isKeyDefined(); - size_t keyLength = SteeringWheelAngle::getKeyMaxCdrSerializedSize() > 16 ? - SteeringWheelAngle::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SteeringWheelAnglePubSubType::~SteeringWheelAnglePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SteeringWheelAnglePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SteeringWheelAngle* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SteeringWheelAnglePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SteeringWheelAngle* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SteeringWheelAnglePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SteeringWheelAnglePubSubType::createData() - { - return reinterpret_cast(new SteeringWheelAngle()); - } - - void SteeringWheelAnglePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SteeringWheelAnglePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SteeringWheelAngle* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SteeringWheelAngle::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SteeringWheelAngle::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +SteeringWheelAnglePubSubType::SteeringWheelAnglePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngle_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SteeringWheelAngle::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SteeringWheelAngle_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SteeringWheelAnglePubSubType::~SteeringWheelAnglePubSubType() +{ +} + +bool SteeringWheelAnglePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SteeringWheelAngle* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SteeringWheelAnglePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SteeringWheelAngle* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SteeringWheelAnglePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SteeringWheelAnglePubSubType::createData() +{ + return reinterpret_cast(new SteeringWheelAngle()); +} + +void SteeringWheelAnglePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SteeringWheelAnglePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.h index e68a26c4288..5eb7a6cfd23 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAnglePubSubTypes.h @@ -16,92 +16,122 @@ * @file SteeringWheelAnglePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SteeringWheelAngle.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "SteeringWheelAngleConfidencePubSubTypes.h" +#include "SteeringWheelAngleValuePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SteeringWheelAngle is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type SteeringWheelAngle defined by the user in the IDL file. + * @ingroup SteeringWheelAngle + */ +class SteeringWheelAnglePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type SteeringWheelAngle defined by the user in the IDL file. - * @ingroup STEERINGWHEELANGLE - */ - class SteeringWheelAnglePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef SteeringWheelAngle type; + typedef SteeringWheelAngle type; - eProsima_user_DllExport SteeringWheelAnglePubSubType(); + eProsima_user_DllExport SteeringWheelAnglePubSubType(); - eProsima_user_DllExport virtual ~SteeringWheelAnglePubSubType(); + eProsima_user_DllExport ~SteeringWheelAnglePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SteeringWheelAngle(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.cxx index d742c6602cc..3b19faafb47 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.cxx @@ -14,9 +14,9 @@ /*! * @file SteeringWheelAngleValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,120 +27,79 @@ char dummy; #endif // _WIN32 #include "SteeringWheelAngleValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace SteeringWheelAngleValue_Constants { +} // namespace SteeringWheelAngleValue_Constants -etsi_its_cam_msgs::msg::SteeringWheelAngleValue::SteeringWheelAngleValue() +SteeringWheelAngleValue::SteeringWheelAngleValue() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@456be73c - m_value = 0; - } -etsi_its_cam_msgs::msg::SteeringWheelAngleValue::~SteeringWheelAngleValue() +SteeringWheelAngleValue::~SteeringWheelAngleValue() { } -etsi_its_cam_msgs::msg::SteeringWheelAngleValue::SteeringWheelAngleValue( +SteeringWheelAngleValue::SteeringWheelAngleValue( const SteeringWheelAngleValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SteeringWheelAngleValue::SteeringWheelAngleValue( - SteeringWheelAngleValue&& x) +SteeringWheelAngleValue::SteeringWheelAngleValue( + SteeringWheelAngleValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::SteeringWheelAngleValue::operator =( +SteeringWheelAngleValue& SteeringWheelAngleValue::operator =( const SteeringWheelAngleValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::SteeringWheelAngleValue& etsi_its_cam_msgs::msg::SteeringWheelAngleValue::operator =( - SteeringWheelAngleValue&& x) +SteeringWheelAngleValue& SteeringWheelAngleValue::operator =( + SteeringWheelAngleValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::SteeringWheelAngleValue::operator ==( +bool SteeringWheelAngleValue::operator ==( const SteeringWheelAngleValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::SteeringWheelAngleValue::operator !=( +bool SteeringWheelAngleValue::operator !=( const SteeringWheelAngleValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::value( +void SteeringWheelAngleValue::value( int16_t _value) { m_value = _value; @@ -150,7 +109,7 @@ void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::value( * @brief This function returns the value of member value * @return Value of member value */ -int16_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::value() const +int16_t SteeringWheelAngleValue::value() const { return m_value; } @@ -159,32 +118,18 @@ int16_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int16_t& etsi_its_cam_msgs::msg::SteeringWheelAngleValue::value() +int16_t& SteeringWheelAngleValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::SteeringWheelAngleValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::SteeringWheelAngleValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::SteeringWheelAngleValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SteeringWheelAngleValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.h index a7702bff64d..35cc4da8778 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValue.h @@ -16,19 +16,24 @@ * @file SteeringWheelAngleValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,177 +47,133 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SteeringWheelAngleValue_SOURCE) -#define SteeringWheelAngleValue_DllAPI __declspec( dllexport ) +#if defined(STEERINGWHEELANGLEVALUE_SOURCE) +#define STEERINGWHEELANGLEVALUE_DllAPI __declspec( dllexport ) #else -#define SteeringWheelAngleValue_DllAPI __declspec( dllimport ) -#endif // SteeringWheelAngleValue_SOURCE +#define STEERINGWHEELANGLEVALUE_DllAPI __declspec( dllimport ) +#endif // STEERINGWHEELANGLEVALUE_SOURCE #else -#define SteeringWheelAngleValue_DllAPI +#define STEERINGWHEELANGLEVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SteeringWheelAngleValue_DllAPI +#define STEERINGWHEELANGLEVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SteeringWheelAngleValue_Constants { - const int16_t MIN = -511; - const int16_t MAX = 512; - const int16_t STRAIGHT = 0; - const int16_t ONE_POINT_FIVE_DEGREES_TO_RIGHT = -1; - const int16_t ONE_POINT_FIVE_DEGREES_TO_LEFT = 1; - const int16_t UNAVAILABLE = 512; - } // namespace SteeringWheelAngleValue_Constants - /*! - * @brief This class represents the structure SteeringWheelAngleValue defined by the user in the IDL file. - * @ingroup STEERINGWHEELANGLEVALUE - */ - class SteeringWheelAngleValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SteeringWheelAngleValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SteeringWheelAngleValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngleValue( - const SteeringWheelAngleValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngleValue( - SteeringWheelAngleValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngleValue& operator =( - const SteeringWheelAngleValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. - */ - eProsima_user_DllExport SteeringWheelAngleValue& operator =( - SteeringWheelAngleValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SteeringWheelAngleValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SteeringWheelAngleValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace SteeringWheelAngleValue_Constants { + +const int16_t MIN = -511; +const int16_t MAX = 512; +const int16_t STRAIGHT = 0; +const int16_t ONE_POINT_FIVE_DEGREES_TO_RIGHT = -1; +const int16_t ONE_POINT_FIVE_DEGREES_TO_LEFT = 1; +const int16_t UNAVAILABLE = 512; + +} // namespace SteeringWheelAngleValue_Constants + + +/*! + * @brief This class represents the structure SteeringWheelAngleValue defined by the user in the IDL file. + * @ingroup SteeringWheelAngleValue + */ +class SteeringWheelAngleValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SteeringWheelAngleValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SteeringWheelAngleValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleValue( + const SteeringWheelAngleValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleValue( + SteeringWheelAngleValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleValue& operator =( + const SteeringWheelAngleValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SteeringWheelAngleValue that will be copied. + */ + eProsima_user_DllExport SteeringWheelAngleValue& operator =( + SteeringWheelAngleValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SteeringWheelAngleValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SteeringWheelAngleValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SteeringWheelAngleValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + +private: + + int16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValueCdrAux.hpp new file mode 100644 index 00000000000..337e9e776d7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValueCdrAux.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUECDRAUX_HPP_ + +#include "SteeringWheelAngleValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SteeringWheelAngleValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SteeringWheelAngleValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValueCdrAux.ipp new file mode 100644 index 00000000000..b0b5d91ddf6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValueCdrAux.ipp @@ -0,0 +1,143 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SteeringWheelAngleValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUECDRAUX_IPP_ + +#include "SteeringWheelAngleValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SteeringWheelAngleValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.cxx index ad25606f66a..6d5072986d7 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.cxx @@ -16,170 +16,199 @@ * @file SteeringWheelAngleValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SteeringWheelAngleValuePubSubTypes.h" +#include "SteeringWheelAngleValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SteeringWheelAngleValue_Constants { - - - - - - - - } //End of namespace SteeringWheelAngleValue_Constants - SteeringWheelAngleValuePubSubType::SteeringWheelAngleValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngleValue_"); - auto type_size = SteeringWheelAngleValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SteeringWheelAngleValue::isKeyDefined(); - size_t keyLength = SteeringWheelAngleValue::getKeyMaxCdrSerializedSize() > 16 ? - SteeringWheelAngleValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SteeringWheelAngleValuePubSubType::~SteeringWheelAngleValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SteeringWheelAngleValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SteeringWheelAngleValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SteeringWheelAngleValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SteeringWheelAngleValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SteeringWheelAngleValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SteeringWheelAngleValuePubSubType::createData() - { - return reinterpret_cast(new SteeringWheelAngleValue()); - } - - void SteeringWheelAngleValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SteeringWheelAngleValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SteeringWheelAngleValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SteeringWheelAngleValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SteeringWheelAngleValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SteeringWheelAngleValue_Constants { + + + + + + + + + + + + + +} //End of namespace SteeringWheelAngleValue_Constants + + + +SteeringWheelAngleValuePubSubType::SteeringWheelAngleValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SteeringWheelAngleValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SteeringWheelAngleValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SteeringWheelAngleValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SteeringWheelAngleValuePubSubType::~SteeringWheelAngleValuePubSubType() +{ +} + +bool SteeringWheelAngleValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SteeringWheelAngleValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SteeringWheelAngleValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SteeringWheelAngleValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SteeringWheelAngleValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SteeringWheelAngleValuePubSubType::createData() +{ + return reinterpret_cast(new SteeringWheelAngleValue()); +} + +void SteeringWheelAngleValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SteeringWheelAngleValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.h index 96b5b2f7d8e..ad022d99491 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SteeringWheelAngleValuePubSubTypes.h @@ -16,101 +16,134 @@ * @file SteeringWheelAngleValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SteeringWheelAngleValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SteeringWheelAngleValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SteeringWheelAngleValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SteeringWheelAngleValue_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type SteeringWheelAngleValue defined by the user in the IDL file. - * @ingroup STEERINGWHEELANGLEVALUE - */ - class SteeringWheelAngleValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SteeringWheelAngleValue type; - eProsima_user_DllExport SteeringWheelAngleValuePubSubType(); - eProsima_user_DllExport virtual ~SteeringWheelAngleValuePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +} // namespace SteeringWheelAngleValue_Constants - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type SteeringWheelAngleValue defined by the user in the IDL file. + * @ingroup SteeringWheelAngleValue + */ +class SteeringWheelAngleValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + typedef SteeringWheelAngleValue type; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport SteeringWheelAngleValuePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport ~SteeringWheelAngleValuePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SteeringWheelAngleValue(); - return true; - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_STEERINGWHEELANGLEVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.cxx index d709f6c4764..3c9e0fdbb74 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.cxx @@ -14,9 +14,9 @@ /*! * @file SubCauseCodeType.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,116 +27,79 @@ char dummy; #endif // _WIN32 #include "SubCauseCodeType.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { + +namespace SubCauseCodeType_Constants { + + +} // namespace SubCauseCodeType_Constants -etsi_its_cam_msgs::msg::SubCauseCodeType::SubCauseCodeType() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@8ab78bc - m_value = 0; +SubCauseCodeType::SubCauseCodeType() +{ } -etsi_its_cam_msgs::msg::SubCauseCodeType::~SubCauseCodeType() +SubCauseCodeType::~SubCauseCodeType() { } -etsi_its_cam_msgs::msg::SubCauseCodeType::SubCauseCodeType( +SubCauseCodeType::SubCauseCodeType( const SubCauseCodeType& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SubCauseCodeType::SubCauseCodeType( - SubCauseCodeType&& x) +SubCauseCodeType::SubCauseCodeType( + SubCauseCodeType&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::SubCauseCodeType::operator =( +SubCauseCodeType& SubCauseCodeType::operator =( const SubCauseCodeType& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::SubCauseCodeType& etsi_its_cam_msgs::msg::SubCauseCodeType::operator =( - SubCauseCodeType&& x) +SubCauseCodeType& SubCauseCodeType::operator =( + SubCauseCodeType&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::SubCauseCodeType::operator ==( +bool SubCauseCodeType::operator ==( const SubCauseCodeType& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::SubCauseCodeType::operator !=( +bool SubCauseCodeType::operator !=( const SubCauseCodeType& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::SubCauseCodeType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::SubCauseCodeType::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SubCauseCodeType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::SubCauseCodeType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::SubCauseCodeType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::SubCauseCodeType::value( +void SubCauseCodeType::value( uint8_t _value) { m_value = _value; @@ -146,7 +109,7 @@ void etsi_its_cam_msgs::msg::SubCauseCodeType::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::SubCauseCodeType::value() const +uint8_t SubCauseCodeType::value() const { return m_value; } @@ -155,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::SubCauseCodeType::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::SubCauseCodeType::value() +uint8_t& SubCauseCodeType::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::SubCauseCodeType::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::SubCauseCodeType::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::SubCauseCodeType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SubCauseCodeTypeCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.h index a9660bba5a7..6ab0c7c2e5a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeType.h @@ -16,19 +16,24 @@ * @file SubCauseCodeType.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,173 +47,129 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SubCauseCodeType_SOURCE) -#define SubCauseCodeType_DllAPI __declspec( dllexport ) +#if defined(SUBCAUSECODETYPE_SOURCE) +#define SUBCAUSECODETYPE_DllAPI __declspec( dllexport ) #else -#define SubCauseCodeType_DllAPI __declspec( dllimport ) -#endif // SubCauseCodeType_SOURCE +#define SUBCAUSECODETYPE_DllAPI __declspec( dllimport ) +#endif // SUBCAUSECODETYPE_SOURCE #else -#define SubCauseCodeType_DllAPI +#define SUBCAUSECODETYPE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SubCauseCodeType_DllAPI +#define SUBCAUSECODETYPE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace SubCauseCodeType_Constants { - const uint8_t MIN = 0; - const uint8_t MAX = 255; - } // namespace SubCauseCodeType_Constants - /*! - * @brief This class represents the structure SubCauseCodeType defined by the user in the IDL file. - * @ingroup SUBCAUSECODETYPE - */ - class SubCauseCodeType - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SubCauseCodeType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SubCauseCodeType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. - */ - eProsima_user_DllExport SubCauseCodeType( - const SubCauseCodeType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. - */ - eProsima_user_DllExport SubCauseCodeType( - SubCauseCodeType&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. - */ - eProsima_user_DllExport SubCauseCodeType& operator =( - const SubCauseCodeType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. - */ - eProsima_user_DllExport SubCauseCodeType& operator =( - SubCauseCodeType&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SubCauseCodeType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SubCauseCodeType& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::SubCauseCodeType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SubCauseCodeType& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::SubCauseCodeType& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace SubCauseCodeType_Constants { + +const uint8_t MIN = 0; +const uint8_t MAX = 255; + +} // namespace SubCauseCodeType_Constants + + +/*! + * @brief This class represents the structure SubCauseCodeType defined by the user in the IDL file. + * @ingroup SubCauseCodeType + */ +class SubCauseCodeType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SubCauseCodeType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SubCauseCodeType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. + */ + eProsima_user_DllExport SubCauseCodeType( + const SubCauseCodeType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. + */ + eProsima_user_DllExport SubCauseCodeType( + SubCauseCodeType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. + */ + eProsima_user_DllExport SubCauseCodeType& operator =( + const SubCauseCodeType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::SubCauseCodeType that will be copied. + */ + eProsima_user_DllExport SubCauseCodeType& operator =( + SubCauseCodeType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SubCauseCodeType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SubCauseCodeType& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::SubCauseCodeType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SubCauseCodeType& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypeCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypeCdrAux.hpp new file mode 100644 index 00000000000..9f56b507eea --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypeCdrAux.hpp @@ -0,0 +1,55 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SubCauseCodeTypeCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPECDRAUX_HPP_ + +#include "SubCauseCodeType.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_SubCauseCodeType_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_SubCauseCodeType_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SubCauseCodeType& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypeCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypeCdrAux.ipp new file mode 100644 index 00000000000..bb58a0cea10 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypeCdrAux.ipp @@ -0,0 +1,135 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SubCauseCodeTypeCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPECDRAUX_IPP_ + +#include "SubCauseCodeTypeCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::SubCauseCodeType& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SubCauseCodeType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::SubCauseCodeType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::SubCauseCodeType& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.cxx index 13465ad99bc..2a6fa60f283 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.cxx @@ -16,166 +16,191 @@ * @file SubCauseCodeTypePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SubCauseCodeTypePubSubTypes.h" +#include "SubCauseCodeTypeCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace SubCauseCodeType_Constants { - - - - } //End of namespace SubCauseCodeType_Constants - SubCauseCodeTypePubSubType::SubCauseCodeTypePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::SubCauseCodeType_"); - auto type_size = SubCauseCodeType::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SubCauseCodeType::isKeyDefined(); - size_t keyLength = SubCauseCodeType::getKeyMaxCdrSerializedSize() > 16 ? - SubCauseCodeType::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - SubCauseCodeTypePubSubType::~SubCauseCodeTypePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SubCauseCodeTypePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SubCauseCodeType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SubCauseCodeTypePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SubCauseCodeType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SubCauseCodeTypePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SubCauseCodeTypePubSubType::createData() - { - return reinterpret_cast(new SubCauseCodeType()); - } - - void SubCauseCodeTypePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SubCauseCodeTypePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SubCauseCodeType* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SubCauseCodeType::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SubCauseCodeType::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace SubCauseCodeType_Constants { + + + + + +} //End of namespace SubCauseCodeType_Constants + + + +SubCauseCodeTypePubSubType::SubCauseCodeTypePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::SubCauseCodeType_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SubCauseCodeType::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_SubCauseCodeType_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SubCauseCodeTypePubSubType::~SubCauseCodeTypePubSubType() +{ +} + +bool SubCauseCodeTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SubCauseCodeType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SubCauseCodeTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SubCauseCodeType* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SubCauseCodeTypePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SubCauseCodeTypePubSubType::createData() +{ + return reinterpret_cast(new SubCauseCodeType()); +} + +void SubCauseCodeTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SubCauseCodeTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.h index 8e93c1cde2e..76719bf93a1 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/SubCauseCodeTypePubSubTypes.h @@ -16,97 +16,126 @@ * @file SubCauseCodeTypePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "SubCauseCodeType.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated SubCauseCodeType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace SubCauseCodeType_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace SubCauseCodeType_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type SubCauseCodeType defined by the user in the IDL file. - * @ingroup SUBCAUSECODETYPE - */ - class SubCauseCodeTypePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef SubCauseCodeType type; - eProsima_user_DllExport SubCauseCodeTypePubSubType(); +} // namespace SubCauseCodeType_Constants - eProsima_user_DllExport virtual ~SubCauseCodeTypePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type SubCauseCodeType defined by the user in the IDL file. + * @ingroup SubCauseCodeType + */ +class SubCauseCodeTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SubCauseCodeType type; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport SubCauseCodeTypePubSubType(); - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport ~SubCauseCodeTypePubSubType() override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) SubCauseCodeType(); - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport void deleteData( + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_SUBCAUSECODETYPE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.cxx index 0e3a486c4ab..b97c317a8ca 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.cxx @@ -14,9 +14,9 @@ /*! * @file TimestampIts.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,118 +27,79 @@ char dummy; #endif // _WIN32 #include "TimestampIts.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace TimestampIts_Constants { -etsi_its_cam_msgs::msg::TimestampIts::TimestampIts() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4163f1cd - m_value = 0; +} // namespace TimestampIts_Constants + +TimestampIts::TimestampIts() +{ } -etsi_its_cam_msgs::msg::TimestampIts::~TimestampIts() +TimestampIts::~TimestampIts() { } -etsi_its_cam_msgs::msg::TimestampIts::TimestampIts( +TimestampIts::TimestampIts( const TimestampIts& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::TimestampIts::TimestampIts( - TimestampIts&& x) +TimestampIts::TimestampIts( + TimestampIts&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::TimestampIts::operator =( +TimestampIts& TimestampIts::operator =( const TimestampIts& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::TimestampIts& etsi_its_cam_msgs::msg::TimestampIts::operator =( - TimestampIts&& x) +TimestampIts& TimestampIts::operator =( + TimestampIts&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::TimestampIts::operator ==( +bool TimestampIts::operator ==( const TimestampIts& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::TimestampIts::operator !=( +bool TimestampIts::operator !=( const TimestampIts& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::TimestampIts::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::TimestampIts::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::TimestampIts& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::TimestampIts::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::TimestampIts::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::TimestampIts::value( +void TimestampIts::value( uint64_t _value) { m_value = _value; @@ -148,7 +109,7 @@ void etsi_its_cam_msgs::msg::TimestampIts::value( * @brief This function returns the value of member value * @return Value of member value */ -uint64_t etsi_its_cam_msgs::msg::TimestampIts::value() const +uint64_t TimestampIts::value() const { return m_value; } @@ -157,32 +118,18 @@ uint64_t etsi_its_cam_msgs::msg::TimestampIts::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint64_t& etsi_its_cam_msgs::msg::TimestampIts::value() +uint64_t& TimestampIts::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::TimestampIts::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::TimestampIts::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::TimestampIts::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "TimestampItsCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.h index 03a4a76a376..cbcbd15eac9 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampIts.h @@ -16,19 +16,24 @@ * @file TimestampIts.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,175 +47,131 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TimestampIts_SOURCE) -#define TimestampIts_DllAPI __declspec( dllexport ) +#if defined(TIMESTAMPITS_SOURCE) +#define TIMESTAMPITS_DllAPI __declspec( dllexport ) #else -#define TimestampIts_DllAPI __declspec( dllimport ) -#endif // TimestampIts_SOURCE +#define TIMESTAMPITS_DllAPI __declspec( dllimport ) +#endif // TIMESTAMPITS_SOURCE #else -#define TimestampIts_DllAPI +#define TIMESTAMPITS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TimestampIts_DllAPI +#define TIMESTAMPITS_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace TimestampIts_Constants { - const uint64_t MIN = 0; - const uint64_t MAX = 4398046511103; - const uint64_t UTC_START_OF_2004 = 0; - const uint64_t ONE_MILLISEC_AFTER_UTC_START_OF_2004 = 1; - } // namespace TimestampIts_Constants - /*! - * @brief This class represents the structure TimestampIts defined by the user in the IDL file. - * @ingroup TIMESTAMPITS - */ - class TimestampIts - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TimestampIts(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TimestampIts(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. - */ - eProsima_user_DllExport TimestampIts( - const TimestampIts& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. - */ - eProsima_user_DllExport TimestampIts( - TimestampIts&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. - */ - eProsima_user_DllExport TimestampIts& operator =( - const TimestampIts& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. - */ - eProsima_user_DllExport TimestampIts& operator =( - TimestampIts&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::TimestampIts object to compare. - */ - eProsima_user_DllExport bool operator ==( - const TimestampIts& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::TimestampIts object to compare. - */ - eProsima_user_DllExport bool operator !=( - const TimestampIts& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint64_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint64_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint64_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::TimestampIts& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint64_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace TimestampIts_Constants { + +const uint64_t MIN = 0; +const uint64_t MAX = 4398046511103; +const uint64_t UTC_START_OF2004 = 0; +const uint64_t ONE_MILLISEC_AFTER_UTC_START_OF2004 = 1; + +} // namespace TimestampIts_Constants + + +/*! + * @brief This class represents the structure TimestampIts defined by the user in the IDL file. + * @ingroup TimestampIts + */ +class TimestampIts +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TimestampIts(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TimestampIts(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. + */ + eProsima_user_DllExport TimestampIts( + const TimestampIts& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. + */ + eProsima_user_DllExport TimestampIts( + TimestampIts&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. + */ + eProsima_user_DllExport TimestampIts& operator =( + const TimestampIts& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::TimestampIts that will be copied. + */ + eProsima_user_DllExport TimestampIts& operator =( + TimestampIts&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::TimestampIts object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TimestampIts& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::TimestampIts object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TimestampIts& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint64_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint64_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint64_t& value(); + +private: + + uint64_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsCdrAux.hpp new file mode 100644 index 00000000000..4d103faabeb --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsCdrAux.hpp @@ -0,0 +1,59 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimestampItsCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITSCDRAUX_HPP_ + +#include "TimestampIts.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_TimestampIts_max_cdr_typesize {16UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_TimestampIts_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::TimestampIts& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsCdrAux.ipp new file mode 100644 index 00000000000..e2ed317c638 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TimestampItsCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITSCDRAUX_IPP_ + +#include "TimestampItsCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::TimestampIts& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::TimestampIts& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::TimestampIts& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::TimestampIts& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.cxx index 30a817f4b8c..d5411d02b2f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.cxx @@ -16,168 +16,195 @@ * @file TimestampItsPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "TimestampItsPubSubTypes.h" +#include "TimestampItsCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace TimestampIts_Constants { - - - - - - } //End of namespace TimestampIts_Constants - TimestampItsPubSubType::TimestampItsPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::TimestampIts_"); - auto type_size = TimestampIts::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = TimestampIts::isKeyDefined(); - size_t keyLength = TimestampIts::getKeyMaxCdrSerializedSize() > 16 ? - TimestampIts::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TimestampItsPubSubType::~TimestampItsPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TimestampItsPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - TimestampIts* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TimestampItsPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - TimestampIts* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TimestampItsPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TimestampItsPubSubType::createData() - { - return reinterpret_cast(new TimestampIts()); - } - - void TimestampItsPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TimestampItsPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - TimestampIts* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - TimestampIts::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || TimestampIts::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace TimestampIts_Constants { + + + + + + + + + +} //End of namespace TimestampIts_Constants + + + +TimestampItsPubSubType::TimestampItsPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::TimestampIts_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TimestampIts::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_TimestampIts_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +TimestampItsPubSubType::~TimestampItsPubSubType() +{ +} + +bool TimestampItsPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TimestampIts* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool TimestampItsPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TimestampIts* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function TimestampItsPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* TimestampItsPubSubType::createData() +{ + return reinterpret_cast(new TimestampIts()); +} + +void TimestampItsPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TimestampItsPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.h index 56f04f21f6e..c9494fa4270 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TimestampItsPubSubTypes.h @@ -16,99 +16,130 @@ * @file TimestampItsPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "TimestampIts.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated TimestampIts is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace TimestampIts_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace TimestampIts_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type TimestampIts defined by the user in the IDL file. - * @ingroup TIMESTAMPITS - */ - class TimestampItsPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef TimestampIts type; - eProsima_user_DllExport TimestampItsPubSubType(); - eProsima_user_DllExport virtual ~TimestampItsPubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; +} // namespace TimestampIts_Constants - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +/*! + * @brief This class represents the TopicDataType of the type TimestampIts defined by the user in the IDL file. + * @ingroup TimestampIts + */ +class TimestampItsPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport virtual void* createData() override; + typedef TimestampIts type; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport TimestampItsPubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport ~TimestampItsPubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) TimestampIts(); - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TIMESTAMPITS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.cxx index 3e5fcc040a9..68b8fb683db 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.cxx @@ -14,9 +14,9 @@ /*! * @file TrafficRule.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,118 +27,79 @@ char dummy; #endif // _WIN32 #include "TrafficRule.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace TrafficRule_Constants { -etsi_its_cam_msgs::msg::TrafficRule::TrafficRule() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@44c79f32 - m_value = 0; +} // namespace TrafficRule_Constants + +TrafficRule::TrafficRule() +{ } -etsi_its_cam_msgs::msg::TrafficRule::~TrafficRule() +TrafficRule::~TrafficRule() { } -etsi_its_cam_msgs::msg::TrafficRule::TrafficRule( +TrafficRule::TrafficRule( const TrafficRule& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::TrafficRule::TrafficRule( - TrafficRule&& x) +TrafficRule::TrafficRule( + TrafficRule&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::TrafficRule::operator =( +TrafficRule& TrafficRule::operator =( const TrafficRule& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::TrafficRule& etsi_its_cam_msgs::msg::TrafficRule::operator =( - TrafficRule&& x) +TrafficRule& TrafficRule::operator =( + TrafficRule&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::TrafficRule::operator ==( +bool TrafficRule::operator ==( const TrafficRule& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::TrafficRule::operator !=( +bool TrafficRule::operator !=( const TrafficRule& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::TrafficRule::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::TrafficRule::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::TrafficRule& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::TrafficRule::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::TrafficRule::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::TrafficRule::value( +void TrafficRule::value( uint8_t _value) { m_value = _value; @@ -148,7 +109,7 @@ void etsi_its_cam_msgs::msg::TrafficRule::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::TrafficRule::value() const +uint8_t TrafficRule::value() const { return m_value; } @@ -157,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::TrafficRule::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::TrafficRule::value() +uint8_t& TrafficRule::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::TrafficRule::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::TrafficRule::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::TrafficRule::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "TrafficRuleCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.h index 1c74abe5183..345d1b3dcc1 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRule.h @@ -16,19 +16,24 @@ * @file TrafficRule.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,175 +47,131 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TrafficRule_SOURCE) -#define TrafficRule_DllAPI __declspec( dllexport ) +#if defined(TRAFFICRULE_SOURCE) +#define TRAFFICRULE_DllAPI __declspec( dllexport ) #else -#define TrafficRule_DllAPI __declspec( dllimport ) -#endif // TrafficRule_SOURCE +#define TRAFFICRULE_DllAPI __declspec( dllimport ) +#endif // TRAFFICRULE_SOURCE #else -#define TrafficRule_DllAPI +#define TRAFFICRULE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TrafficRule_DllAPI +#define TRAFFICRULE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace TrafficRule_Constants { - const uint8_t NO_PASSING = 0; - const uint8_t NO_PASSING_FOR_TRUCKS = 1; - const uint8_t PASS_TO_RIGHT = 2; - const uint8_t PASS_TO_LEFT = 3; - } // namespace TrafficRule_Constants - /*! - * @brief This class represents the structure TrafficRule defined by the user in the IDL file. - * @ingroup TRAFFICRULE - */ - class TrafficRule - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TrafficRule(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TrafficRule(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. - */ - eProsima_user_DllExport TrafficRule( - const TrafficRule& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. - */ - eProsima_user_DllExport TrafficRule( - TrafficRule&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. - */ - eProsima_user_DllExport TrafficRule& operator =( - const TrafficRule& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. - */ - eProsima_user_DllExport TrafficRule& operator =( - TrafficRule&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::TrafficRule object to compare. - */ - eProsima_user_DllExport bool operator ==( - const TrafficRule& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::TrafficRule object to compare. - */ - eProsima_user_DllExport bool operator !=( - const TrafficRule& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::TrafficRule& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace TrafficRule_Constants { + +const uint8_t NO_PASSING = 0; +const uint8_t NO_PASSING_FOR_TRUCKS = 1; +const uint8_t PASS_TO_RIGHT = 2; +const uint8_t PASS_TO_LEFT = 3; + +} // namespace TrafficRule_Constants + + +/*! + * @brief This class represents the structure TrafficRule defined by the user in the IDL file. + * @ingroup TrafficRule + */ +class TrafficRule +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TrafficRule(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TrafficRule(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. + */ + eProsima_user_DllExport TrafficRule( + const TrafficRule& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. + */ + eProsima_user_DllExport TrafficRule( + TrafficRule&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. + */ + eProsima_user_DllExport TrafficRule& operator =( + const TrafficRule& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::TrafficRule that will be copied. + */ + eProsima_user_DllExport TrafficRule& operator =( + TrafficRule&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::TrafficRule object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TrafficRule& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::TrafficRule object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TrafficRule& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRuleCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRuleCdrAux.hpp new file mode 100644 index 00000000000..32816ea8a7a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRuleCdrAux.hpp @@ -0,0 +1,59 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TrafficRuleCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULECDRAUX_HPP_ + +#include "TrafficRule.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_TrafficRule_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_TrafficRule_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::TrafficRule& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRuleCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRuleCdrAux.ipp new file mode 100644 index 00000000000..5c1036bde47 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRuleCdrAux.ipp @@ -0,0 +1,139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TrafficRuleCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULECDRAUX_IPP_ + +#include "TrafficRuleCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::TrafficRule& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::TrafficRule& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::TrafficRule& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::TrafficRule& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.cxx index 279cfd5846c..38625ec62ee 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.cxx @@ -16,168 +16,195 @@ * @file TrafficRulePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "TrafficRulePubSubTypes.h" +#include "TrafficRuleCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace TrafficRule_Constants { - - - - - - } //End of namespace TrafficRule_Constants - TrafficRulePubSubType::TrafficRulePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::TrafficRule_"); - auto type_size = TrafficRule::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = TrafficRule::isKeyDefined(); - size_t keyLength = TrafficRule::getKeyMaxCdrSerializedSize() > 16 ? - TrafficRule::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TrafficRulePubSubType::~TrafficRulePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TrafficRulePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - TrafficRule* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TrafficRulePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - TrafficRule* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TrafficRulePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TrafficRulePubSubType::createData() - { - return reinterpret_cast(new TrafficRule()); - } - - void TrafficRulePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TrafficRulePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - TrafficRule* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - TrafficRule::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || TrafficRule::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace TrafficRule_Constants { + + + + + + + + + +} //End of namespace TrafficRule_Constants + + + +TrafficRulePubSubType::TrafficRulePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::TrafficRule_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TrafficRule::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_TrafficRule_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +TrafficRulePubSubType::~TrafficRulePubSubType() +{ +} + +bool TrafficRulePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TrafficRule* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool TrafficRulePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TrafficRule* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function TrafficRulePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* TrafficRulePubSubType::createData() +{ + return reinterpret_cast(new TrafficRule()); +} + +void TrafficRulePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TrafficRulePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.h index a5dc3e8de11..4704e3f8b07 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/TrafficRulePubSubTypes.h @@ -16,99 +16,130 @@ * @file TrafficRulePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "TrafficRule.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated TrafficRule is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace TrafficRule_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace TrafficRule_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type TrafficRule defined by the user in the IDL file. - * @ingroup TRAFFICRULE - */ - class TrafficRulePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef TrafficRule type; - eProsima_user_DllExport TrafficRulePubSubType(); - eProsima_user_DllExport virtual ~TrafficRulePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; +} // namespace TrafficRule_Constants - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; +/*! + * @brief This class represents the TopicDataType of the type TrafficRule defined by the user in the IDL file. + * @ingroup TrafficRule + */ +class TrafficRulePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - eProsima_user_DllExport virtual void* createData() override; + typedef TrafficRule type; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport TrafficRulePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport ~TrafficRulePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) TrafficRule(); - return true; - } + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_TRAFFICRULE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.cxx index c6c9e1236cf..07dd1d23510 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.cxx @@ -14,9 +14,9 @@ /*! * @file VehicleLength.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "VehicleLength.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::VehicleLength::VehicleLength() -{ - // m_vehicle_length_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@48b0e701 - // m_vehicle_length_confidence_indication com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@241a0c3a +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::VehicleLength::~VehicleLength() +VehicleLength::VehicleLength() { +} +VehicleLength::~VehicleLength() +{ } -etsi_its_cam_msgs::msg::VehicleLength::VehicleLength( +VehicleLength::VehicleLength( const VehicleLength& x) { m_vehicle_length_value = x.m_vehicle_length_value; m_vehicle_length_confidence_indication = x.m_vehicle_length_confidence_indication; } -etsi_its_cam_msgs::msg::VehicleLength::VehicleLength( - VehicleLength&& x) +VehicleLength::VehicleLength( + VehicleLength&& x) noexcept { m_vehicle_length_value = std::move(x.m_vehicle_length_value); m_vehicle_length_confidence_indication = std::move(x.m_vehicle_length_confidence_indication); } -etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::VehicleLength::operator =( +VehicleLength& VehicleLength::operator =( const VehicleLength& x) { m_vehicle_length_value = x.m_vehicle_length_value; m_vehicle_length_confidence_indication = x.m_vehicle_length_confidence_indication; - return *this; } -etsi_its_cam_msgs::msg::VehicleLength& etsi_its_cam_msgs::msg::VehicleLength::operator =( - VehicleLength&& x) +VehicleLength& VehicleLength::operator =( + VehicleLength&& x) noexcept { m_vehicle_length_value = std::move(x.m_vehicle_length_value); m_vehicle_length_confidence_indication = std::move(x.m_vehicle_length_confidence_indication); - return *this; } -bool etsi_its_cam_msgs::msg::VehicleLength::operator ==( +bool VehicleLength::operator ==( const VehicleLength& x) const { - - return (m_vehicle_length_value == x.m_vehicle_length_value && m_vehicle_length_confidence_indication == x.m_vehicle_length_confidence_indication); + return (m_vehicle_length_value == x.m_vehicle_length_value && + m_vehicle_length_confidence_indication == x.m_vehicle_length_confidence_indication); } -bool etsi_its_cam_msgs::msg::VehicleLength::operator !=( +bool VehicleLength::operator !=( const VehicleLength& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::VehicleLength::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::VehicleLengthValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::VehicleLength::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleLength& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::VehicleLengthValue::getCdrSerializedSize(data.vehicle_length_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getCdrSerializedSize(data.vehicle_length_confidence_indication(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::VehicleLength::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_vehicle_length_value; - scdr << m_vehicle_length_confidence_indication; - -} - -void etsi_its_cam_msgs::msg::VehicleLength::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_vehicle_length_value; - dcdr >> m_vehicle_length_confidence_indication; -} - /*! * @brief This function copies the value in member vehicle_length_value * @param _vehicle_length_value New value to be copied in member vehicle_length_value */ -void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value( +void VehicleLength::vehicle_length_value( const etsi_its_cam_msgs::msg::VehicleLengthValue& _vehicle_length_value) { m_vehicle_length_value = _vehicle_length_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value( * @brief This function moves the value in member vehicle_length_value * @param _vehicle_length_value New value to be moved in member vehicle_length_value */ -void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value( +void VehicleLength::vehicle_length_value( etsi_its_cam_msgs::msg::VehicleLengthValue&& _vehicle_length_value) { m_vehicle_length_value = std::move(_vehicle_length_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value( * @brief This function returns a constant reference to member vehicle_length_value * @return Constant reference to member vehicle_length_value */ -const etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value() const +const etsi_its_cam_msgs::msg::VehicleLengthValue& VehicleLength::vehicle_length_value() const { return m_vehicle_length_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::Vehicl * @brief This function returns a reference to member vehicle_length_value * @return Reference to member vehicle_length_value */ -etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_value() +etsi_its_cam_msgs::msg::VehicleLengthValue& VehicleLength::vehicle_length_value() { return m_vehicle_length_value; } + + /*! * @brief This function copies the value in member vehicle_length_confidence_indication * @param _vehicle_length_confidence_indication New value to be copied in member vehicle_length_confidence_indication */ -void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication( +void VehicleLength::vehicle_length_confidence_indication( const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& _vehicle_length_confidence_indication) { m_vehicle_length_confidence_indication = _vehicle_length_confidence_indication; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication * @brief This function moves the value in member vehicle_length_confidence_indication * @param _vehicle_length_confidence_indication New value to be moved in member vehicle_length_confidence_indication */ -void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication( +void VehicleLength::vehicle_length_confidence_indication( etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication&& _vehicle_length_confidence_indication) { m_vehicle_length_confidence_indication = std::move(_vehicle_length_confidence_indication); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication * @brief This function returns a constant reference to member vehicle_length_confidence_indication * @return Constant reference to member vehicle_length_confidence_indication */ -const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication() const +const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& VehicleLength::vehicle_length_confidence_indication() const { return m_vehicle_length_confidence_indication; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_ms * @brief This function returns a reference to member vehicle_length_confidence_indication * @return Reference to member vehicle_length_confidence_indication */ -etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_msgs::msg::VehicleLength::vehicle_length_confidence_indication() +etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& VehicleLength::vehicle_length_confidence_indication() { return m_vehicle_length_confidence_indication; } -size_t etsi_its_cam_msgs::msg::VehicleLength::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::VehicleLength::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::VehicleLength::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "VehicleLengthCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.h index 87e83045daa..a8a35ec421d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLength.h @@ -16,21 +16,26 @@ * @file VehicleLength.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_H_ -#include "VehicleLengthValue.h" -#include "VehicleLengthConfidenceIndication.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "VehicleLengthValue.h" +#include "VehicleLengthConfidenceIndication.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VehicleLength_SOURCE) -#define VehicleLength_DllAPI __declspec( dllexport ) +#if defined(VEHICLELENGTH_SOURCE) +#define VEHICLELENGTH_DllAPI __declspec( dllexport ) #else -#define VehicleLength_DllAPI __declspec( dllimport ) -#endif // VehicleLength_SOURCE +#define VEHICLELENGTH_DllAPI __declspec( dllimport ) +#endif // VEHICLELENGTH_SOURCE #else -#define VehicleLength_DllAPI +#define VEHICLELENGTH_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define VehicleLength_DllAPI +#define VEHICLELENGTH_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure VehicleLength defined by the user in the IDL file. - * @ingroup VEHICLELENGTH - */ - class VehicleLength - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport VehicleLength(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~VehicleLength(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. - */ - eProsima_user_DllExport VehicleLength( - const VehicleLength& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. - */ - eProsima_user_DllExport VehicleLength( - VehicleLength&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. - */ - eProsima_user_DllExport VehicleLength& operator =( - const VehicleLength& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. - */ - eProsima_user_DllExport VehicleLength& operator =( - VehicleLength&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleLength object to compare. - */ - eProsima_user_DllExport bool operator ==( - const VehicleLength& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleLength object to compare. - */ - eProsima_user_DllExport bool operator !=( - const VehicleLength& x) const; - - /*! - * @brief This function copies the value in member vehicle_length_value - * @param _vehicle_length_value New value to be copied in member vehicle_length_value - */ - eProsima_user_DllExport void vehicle_length_value( - const etsi_its_cam_msgs::msg::VehicleLengthValue& _vehicle_length_value); - - /*! - * @brief This function moves the value in member vehicle_length_value - * @param _vehicle_length_value New value to be moved in member vehicle_length_value - */ - eProsima_user_DllExport void vehicle_length_value( - etsi_its_cam_msgs::msg::VehicleLengthValue&& _vehicle_length_value); - - /*! - * @brief This function returns a constant reference to member vehicle_length_value - * @return Constant reference to member vehicle_length_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLengthValue& vehicle_length_value() const; - - /*! - * @brief This function returns a reference to member vehicle_length_value - * @return Reference to member vehicle_length_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLengthValue& vehicle_length_value(); - /*! - * @brief This function copies the value in member vehicle_length_confidence_indication - * @param _vehicle_length_confidence_indication New value to be copied in member vehicle_length_confidence_indication - */ - eProsima_user_DllExport void vehicle_length_confidence_indication( - const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& _vehicle_length_confidence_indication); - - /*! - * @brief This function moves the value in member vehicle_length_confidence_indication - * @param _vehicle_length_confidence_indication New value to be moved in member vehicle_length_confidence_indication - */ - eProsima_user_DllExport void vehicle_length_confidence_indication( - etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication&& _vehicle_length_confidence_indication); - - /*! - * @brief This function returns a constant reference to member vehicle_length_confidence_indication - * @return Constant reference to member vehicle_length_confidence_indication - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& vehicle_length_confidence_indication() const; - - /*! - * @brief This function returns a reference to member vehicle_length_confidence_indication - * @return Reference to member vehicle_length_confidence_indication - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& vehicle_length_confidence_indication(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleLength& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::VehicleLengthValue m_vehicle_length_value; - etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication m_vehicle_length_confidence_indication; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure VehicleLength defined by the user in the IDL file. + * @ingroup VehicleLength + */ +class VehicleLength +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleLength(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleLength(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. + */ + eProsima_user_DllExport VehicleLength( + const VehicleLength& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. + */ + eProsima_user_DllExport VehicleLength( + VehicleLength&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. + */ + eProsima_user_DllExport VehicleLength& operator =( + const VehicleLength& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLength that will be copied. + */ + eProsima_user_DllExport VehicleLength& operator =( + VehicleLength&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLength object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleLength& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLength object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleLength& x) const; + + /*! + * @brief This function copies the value in member vehicle_length_value + * @param _vehicle_length_value New value to be copied in member vehicle_length_value + */ + eProsima_user_DllExport void vehicle_length_value( + const etsi_its_cam_msgs::msg::VehicleLengthValue& _vehicle_length_value); + + /*! + * @brief This function moves the value in member vehicle_length_value + * @param _vehicle_length_value New value to be moved in member vehicle_length_value + */ + eProsima_user_DllExport void vehicle_length_value( + etsi_its_cam_msgs::msg::VehicleLengthValue&& _vehicle_length_value); + + /*! + * @brief This function returns a constant reference to member vehicle_length_value + * @return Constant reference to member vehicle_length_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLengthValue& vehicle_length_value() const; + + /*! + * @brief This function returns a reference to member vehicle_length_value + * @return Reference to member vehicle_length_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLengthValue& vehicle_length_value(); + + + /*! + * @brief This function copies the value in member vehicle_length_confidence_indication + * @param _vehicle_length_confidence_indication New value to be copied in member vehicle_length_confidence_indication + */ + eProsima_user_DllExport void vehicle_length_confidence_indication( + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& _vehicle_length_confidence_indication); + + /*! + * @brief This function moves the value in member vehicle_length_confidence_indication + * @param _vehicle_length_confidence_indication New value to be moved in member vehicle_length_confidence_indication + */ + eProsima_user_DllExport void vehicle_length_confidence_indication( + etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication&& _vehicle_length_confidence_indication); + + /*! + * @brief This function returns a constant reference to member vehicle_length_confidence_indication + * @return Constant reference to member vehicle_length_confidence_indication + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& vehicle_length_confidence_indication() const; + + /*! + * @brief This function returns a reference to member vehicle_length_confidence_indication + * @return Reference to member vehicle_length_confidence_indication + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& vehicle_length_confidence_indication(); + +private: + + etsi_its_cam_msgs::msg::VehicleLengthValue m_vehicle_length_value; + etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication m_vehicle_length_confidence_indication; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthCdrAux.hpp new file mode 100644 index 00000000000..fc18006a78e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCDRAUX_HPP_ + +#include "VehicleLength.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleLength_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleLength_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLength& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthCdrAux.ipp new file mode 100644 index 00000000000..fb92c591d5f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCDRAUX_IPP_ + +#include "VehicleLengthCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::VehicleLength& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.vehicle_length_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.vehicle_length_confidence_indication(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLength& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.vehicle_length_value() + << eprosima::fastcdr::MemberId(1) << data.vehicle_length_confidence_indication() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::VehicleLength& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.vehicle_length_value(); + break; + + case 1: + dcdr >> data.vehicle_length_confidence_indication(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLength& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.cxx index 3cab8baacdd..5a9a6dfcf1f 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.cxx @@ -14,9 +14,9 @@ /*! * @file VehicleLengthConfidenceIndication.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "VehicleLengthConfidenceIndication.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace VehicleLengthConfidenceIndication_Constants { +} // namespace VehicleLengthConfidenceIndication_Constants -etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4d7e7435 - m_value = 0; +VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication() +{ } -etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::~VehicleLengthConfidenceIndication() +VehicleLengthConfidenceIndication::~VehicleLengthConfidenceIndication() { } -etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication( +VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication( const VehicleLengthConfidenceIndication& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication( - VehicleLengthConfidenceIndication&& x) +VehicleLengthConfidenceIndication::VehicleLengthConfidenceIndication( + VehicleLengthConfidenceIndication&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::operator =( +VehicleLengthConfidenceIndication& VehicleLengthConfidenceIndication::operator =( const VehicleLengthConfidenceIndication& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::operator =( - VehicleLengthConfidenceIndication&& x) +VehicleLengthConfidenceIndication& VehicleLengthConfidenceIndication::operator =( + VehicleLengthConfidenceIndication&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::operator ==( +bool VehicleLengthConfidenceIndication::operator ==( const VehicleLengthConfidenceIndication& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::operator !=( +bool VehicleLengthConfidenceIndication::operator !=( const VehicleLengthConfidenceIndication& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::value( +void VehicleLengthConfidenceIndication::value( uint8_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::value() const +uint8_t VehicleLengthConfidenceIndication::value() const { return m_value; } @@ -158,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::value() +uint8_t& VehicleLengthConfidenceIndication::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "VehicleLengthConfidenceIndicationCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.h index 42f3fb4cd8a..badb41a8501 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndication.h @@ -16,19 +16,24 @@ * @file VehicleLengthConfidenceIndication.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VehicleLengthConfidenceIndication_SOURCE) -#define VehicleLengthConfidenceIndication_DllAPI __declspec( dllexport ) +#if defined(VEHICLELENGTHCONFIDENCEINDICATION_SOURCE) +#define VEHICLELENGTHCONFIDENCEINDICATION_DllAPI __declspec( dllexport ) #else -#define VehicleLengthConfidenceIndication_DllAPI __declspec( dllimport ) -#endif // VehicleLengthConfidenceIndication_SOURCE +#define VEHICLELENGTHCONFIDENCEINDICATION_DllAPI __declspec( dllimport ) +#endif // VEHICLELENGTHCONFIDENCEINDICATION_SOURCE #else -#define VehicleLengthConfidenceIndication_DllAPI +#define VEHICLELENGTHCONFIDENCEINDICATION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define VehicleLengthConfidenceIndication_DllAPI +#define VEHICLELENGTHCONFIDENCEINDICATION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace VehicleLengthConfidenceIndication_Constants { - const uint8_t NO_TRAILER_PRESENT = 0; - const uint8_t TRAILER_PRESENT_WITH_KNOWN_LENGTH = 1; - const uint8_t TRAILER_PRESENT_WITH_UNKNOWN_LENGTH = 2; - const uint8_t TRAILER_PRESENCE_IS_UNKNOWN = 3; - const uint8_t UNAVAILABLE = 4; - } // namespace VehicleLengthConfidenceIndication_Constants - /*! - * @brief This class represents the structure VehicleLengthConfidenceIndication defined by the user in the IDL file. - * @ingroup VEHICLELENGTHCONFIDENCEINDICATION - */ - class VehicleLengthConfidenceIndication - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport VehicleLengthConfidenceIndication(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~VehicleLengthConfidenceIndication(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. - */ - eProsima_user_DllExport VehicleLengthConfidenceIndication( - const VehicleLengthConfidenceIndication& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. - */ - eProsima_user_DllExport VehicleLengthConfidenceIndication( - VehicleLengthConfidenceIndication&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. - */ - eProsima_user_DllExport VehicleLengthConfidenceIndication& operator =( - const VehicleLengthConfidenceIndication& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. - */ - eProsima_user_DllExport VehicleLengthConfidenceIndication& operator =( - VehicleLengthConfidenceIndication&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication object to compare. - */ - eProsima_user_DllExport bool operator ==( - const VehicleLengthConfidenceIndication& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication object to compare. - */ - eProsima_user_DllExport bool operator !=( - const VehicleLengthConfidenceIndication& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace VehicleLengthConfidenceIndication_Constants { + +const uint8_t NO_TRAILER_PRESENT = 0; +const uint8_t TRAILER_PRESENT_WITH_KNOWN_LENGTH = 1; +const uint8_t TRAILER_PRESENT_WITH_UNKNOWN_LENGTH = 2; +const uint8_t TRAILER_PRESENCE_IS_UNKNOWN = 3; +const uint8_t UNAVAILABLE = 4; + +} // namespace VehicleLengthConfidenceIndication_Constants + + +/*! + * @brief This class represents the structure VehicleLengthConfidenceIndication defined by the user in the IDL file. + * @ingroup VehicleLengthConfidenceIndication + */ +class VehicleLengthConfidenceIndication +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleLengthConfidenceIndication(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication( + const VehicleLengthConfidenceIndication& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication( + VehicleLengthConfidenceIndication&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication& operator =( + const VehicleLengthConfidenceIndication& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication that will be copied. + */ + eProsima_user_DllExport VehicleLengthConfidenceIndication& operator =( + VehicleLengthConfidenceIndication&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleLengthConfidenceIndication& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleLengthConfidenceIndication& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationCdrAux.hpp new file mode 100644 index 00000000000..95a59117e8b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthConfidenceIndicationCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATIONCDRAUX_HPP_ + +#include "VehicleLengthConfidenceIndication.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleLengthConfidenceIndication_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleLengthConfidenceIndication_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationCdrAux.ipp new file mode 100644 index 00000000000..da4eae444e1 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthConfidenceIndicationCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATIONCDRAUX_IPP_ + +#include "VehicleLengthConfidenceIndicationCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLengthConfidenceIndication& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.cxx index 6ece85a29e1..b4cec45cc28 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.cxx @@ -16,169 +16,197 @@ * @file VehicleLengthConfidenceIndicationPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "VehicleLengthConfidenceIndicationPubSubTypes.h" +#include "VehicleLengthConfidenceIndicationCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace VehicleLengthConfidenceIndication_Constants { - - - - - - - } //End of namespace VehicleLengthConfidenceIndication_Constants - VehicleLengthConfidenceIndicationPubSubType::VehicleLengthConfidenceIndicationPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::VehicleLengthConfidenceIndication_"); - auto type_size = VehicleLengthConfidenceIndication::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = VehicleLengthConfidenceIndication::isKeyDefined(); - size_t keyLength = VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize() > 16 ? - VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - VehicleLengthConfidenceIndicationPubSubType::~VehicleLengthConfidenceIndicationPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool VehicleLengthConfidenceIndicationPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - VehicleLengthConfidenceIndication* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool VehicleLengthConfidenceIndicationPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - VehicleLengthConfidenceIndication* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function VehicleLengthConfidenceIndicationPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* VehicleLengthConfidenceIndicationPubSubType::createData() - { - return reinterpret_cast(new VehicleLengthConfidenceIndication()); - } - - void VehicleLengthConfidenceIndicationPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool VehicleLengthConfidenceIndicationPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - VehicleLengthConfidenceIndication* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || VehicleLengthConfidenceIndication::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace VehicleLengthConfidenceIndication_Constants { + + + + + + + + + + + +} //End of namespace VehicleLengthConfidenceIndication_Constants + + + +VehicleLengthConfidenceIndicationPubSubType::VehicleLengthConfidenceIndicationPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::VehicleLengthConfidenceIndication_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(VehicleLengthConfidenceIndication::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_VehicleLengthConfidenceIndication_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +VehicleLengthConfidenceIndicationPubSubType::~VehicleLengthConfidenceIndicationPubSubType() +{ +} + +bool VehicleLengthConfidenceIndicationPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + VehicleLengthConfidenceIndication* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool VehicleLengthConfidenceIndicationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + VehicleLengthConfidenceIndication* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function VehicleLengthConfidenceIndicationPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* VehicleLengthConfidenceIndicationPubSubType::createData() +{ + return reinterpret_cast(new VehicleLengthConfidenceIndication()); +} + +void VehicleLengthConfidenceIndicationPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool VehicleLengthConfidenceIndicationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.h index e256a7a8097..0d27713a69a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthConfidenceIndicationPubSubTypes.h @@ -16,100 +16,132 @@ * @file VehicleLengthConfidenceIndicationPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "VehicleLengthConfidenceIndication.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated VehicleLengthConfidenceIndication is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace VehicleLengthConfidenceIndication_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace VehicleLengthConfidenceIndication_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type VehicleLengthConfidenceIndication defined by the user in the IDL file. - * @ingroup VEHICLELENGTHCONFIDENCEINDICATION - */ - class VehicleLengthConfidenceIndicationPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef VehicleLengthConfidenceIndication type; +} // namespace VehicleLengthConfidenceIndication_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type VehicleLengthConfidenceIndication defined by the user in the IDL file. + * @ingroup VehicleLengthConfidenceIndication + */ +class VehicleLengthConfidenceIndicationPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef VehicleLengthConfidenceIndication type; + + eProsima_user_DllExport VehicleLengthConfidenceIndicationPubSubType(); - eProsima_user_DllExport VehicleLengthConfidenceIndicationPubSubType(); + eProsima_user_DllExport ~VehicleLengthConfidenceIndicationPubSubType() override; - eProsima_user_DllExport virtual ~VehicleLengthConfidenceIndicationPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) VehicleLengthConfidenceIndication(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHCONFIDENCEINDICATION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.cxx index cf09e754801..51a7762d0fa 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file VehicleLengthPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "VehicleLengthPubSubTypes.h" +#include "VehicleLengthCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - VehicleLengthPubSubType::VehicleLengthPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::VehicleLength_"); - auto type_size = VehicleLength::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = VehicleLength::isKeyDefined(); - size_t keyLength = VehicleLength::getKeyMaxCdrSerializedSize() > 16 ? - VehicleLength::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - VehicleLengthPubSubType::~VehicleLengthPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool VehicleLengthPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - VehicleLength* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool VehicleLengthPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - VehicleLength* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function VehicleLengthPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* VehicleLengthPubSubType::createData() - { - return reinterpret_cast(new VehicleLength()); - } - - void VehicleLengthPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool VehicleLengthPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - VehicleLength* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - VehicleLength::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || VehicleLength::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +VehicleLengthPubSubType::VehicleLengthPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::VehicleLength_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(VehicleLength::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_VehicleLength_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +VehicleLengthPubSubType::~VehicleLengthPubSubType() +{ +} + +bool VehicleLengthPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + VehicleLength* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool VehicleLengthPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + VehicleLength* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function VehicleLengthPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* VehicleLengthPubSubType::createData() +{ + return reinterpret_cast(new VehicleLength()); +} + +void VehicleLengthPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool VehicleLengthPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.h index b80d91d3f61..b50c950f09e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthPubSubTypes.h @@ -16,92 +16,122 @@ * @file VehicleLengthPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "VehicleLength.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "VehicleLengthValuePubSubTypes.h" +#include "VehicleLengthConfidenceIndicationPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated VehicleLength is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type VehicleLength defined by the user in the IDL file. + * @ingroup VehicleLength + */ +class VehicleLengthPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type VehicleLength defined by the user in the IDL file. - * @ingroup VEHICLELENGTH - */ - class VehicleLengthPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef VehicleLength type; + typedef VehicleLength type; - eProsima_user_DllExport VehicleLengthPubSubType(); + eProsima_user_DllExport VehicleLengthPubSubType(); - eProsima_user_DllExport virtual ~VehicleLengthPubSubType(); + eProsima_user_DllExport ~VehicleLengthPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) VehicleLength(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTH_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.cxx index 8a9a1fa74a4..eb78bffd206 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.cxx @@ -14,9 +14,9 @@ /*! * @file VehicleLengthValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "VehicleLengthValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace VehicleLengthValue_Constants { +} // namespace VehicleLengthValue_Constants -etsi_its_cam_msgs::msg::VehicleLengthValue::VehicleLengthValue() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5f212d84 - m_value = 0; +VehicleLengthValue::VehicleLengthValue() +{ } -etsi_its_cam_msgs::msg::VehicleLengthValue::~VehicleLengthValue() +VehicleLengthValue::~VehicleLengthValue() { } -etsi_its_cam_msgs::msg::VehicleLengthValue::VehicleLengthValue( +VehicleLengthValue::VehicleLengthValue( const VehicleLengthValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VehicleLengthValue::VehicleLengthValue( - VehicleLengthValue&& x) +VehicleLengthValue::VehicleLengthValue( + VehicleLengthValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::VehicleLengthValue::operator =( +VehicleLengthValue& VehicleLengthValue::operator =( const VehicleLengthValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::VehicleLengthValue& etsi_its_cam_msgs::msg::VehicleLengthValue::operator =( - VehicleLengthValue&& x) +VehicleLengthValue& VehicleLengthValue::operator =( + VehicleLengthValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::VehicleLengthValue::operator ==( +bool VehicleLengthValue::operator ==( const VehicleLengthValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::VehicleLengthValue::operator !=( +bool VehicleLengthValue::operator !=( const VehicleLengthValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::VehicleLengthValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::VehicleLengthValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleLengthValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::VehicleLengthValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::VehicleLengthValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::VehicleLengthValue::value( +void VehicleLengthValue::value( uint16_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::VehicleLengthValue::value( * @brief This function returns the value of member value * @return Value of member value */ -uint16_t etsi_its_cam_msgs::msg::VehicleLengthValue::value() const +uint16_t VehicleLengthValue::value() const { return m_value; } @@ -158,32 +118,18 @@ uint16_t etsi_its_cam_msgs::msg::VehicleLengthValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint16_t& etsi_its_cam_msgs::msg::VehicleLengthValue::value() +uint16_t& VehicleLengthValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::VehicleLengthValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::VehicleLengthValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::VehicleLengthValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "VehicleLengthValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.h index 3fc1974de2d..c5a838c00fe 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValue.h @@ -16,19 +16,24 @@ * @file VehicleLengthValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VehicleLengthValue_SOURCE) -#define VehicleLengthValue_DllAPI __declspec( dllexport ) +#if defined(VEHICLELENGTHVALUE_SOURCE) +#define VEHICLELENGTHVALUE_DllAPI __declspec( dllexport ) #else -#define VehicleLengthValue_DllAPI __declspec( dllimport ) -#endif // VehicleLengthValue_SOURCE +#define VEHICLELENGTHVALUE_DllAPI __declspec( dllimport ) +#endif // VEHICLELENGTHVALUE_SOURCE #else -#define VehicleLengthValue_DllAPI +#define VEHICLELENGTHVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define VehicleLengthValue_DllAPI +#define VEHICLELENGTHVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace VehicleLengthValue_Constants { - const uint16_t MIN = 1; - const uint16_t MAX = 1023; - const uint16_t TEN_CENTIMETERS = 1; - const uint16_t OUT_OF_RANGE = 1022; - const uint16_t UNAVAILABLE = 1023; - } // namespace VehicleLengthValue_Constants - /*! - * @brief This class represents the structure VehicleLengthValue defined by the user in the IDL file. - * @ingroup VEHICLELENGTHVALUE - */ - class VehicleLengthValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport VehicleLengthValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~VehicleLengthValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. - */ - eProsima_user_DllExport VehicleLengthValue( - const VehicleLengthValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. - */ - eProsima_user_DllExport VehicleLengthValue( - VehicleLengthValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. - */ - eProsima_user_DllExport VehicleLengthValue& operator =( - const VehicleLengthValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. - */ - eProsima_user_DllExport VehicleLengthValue& operator =( - VehicleLengthValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleLengthValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const VehicleLengthValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleLengthValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const VehicleLengthValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleLengthValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace VehicleLengthValue_Constants { + +const uint16_t MIN = 1; +const uint16_t MAX = 1023; +const uint16_t TEN_CENTIMETERS = 1; +const uint16_t OUT_OF_RANGE = 1022; +const uint16_t UNAVAILABLE = 1023; + +} // namespace VehicleLengthValue_Constants + + +/*! + * @brief This class represents the structure VehicleLengthValue defined by the user in the IDL file. + * @ingroup VehicleLengthValue + */ +class VehicleLengthValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleLengthValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleLengthValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. + */ + eProsima_user_DllExport VehicleLengthValue( + const VehicleLengthValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. + */ + eProsima_user_DllExport VehicleLengthValue( + VehicleLengthValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. + */ + eProsima_user_DllExport VehicleLengthValue& operator =( + const VehicleLengthValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleLengthValue that will be copied. + */ + eProsima_user_DllExport VehicleLengthValue& operator =( + VehicleLengthValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLengthValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleLengthValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleLengthValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleLengthValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint16_t& value(); + +private: + + uint16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValueCdrAux.hpp new file mode 100644 index 00000000000..0f953afc930 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValueCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUECDRAUX_HPP_ + +#include "VehicleLengthValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleLengthValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleLengthValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLengthValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValueCdrAux.ipp new file mode 100644 index 00000000000..e84ce535c00 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValueCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleLengthValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUECDRAUX_IPP_ + +#include "VehicleLengthValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::VehicleLengthValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLengthValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::VehicleLengthValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleLengthValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.cxx index 0123f5caa87..fd846bb1cdd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file VehicleLengthValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "VehicleLengthValuePubSubTypes.h" +#include "VehicleLengthValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace VehicleLengthValue_Constants { - - - - - - - } //End of namespace VehicleLengthValue_Constants - VehicleLengthValuePubSubType::VehicleLengthValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::VehicleLengthValue_"); - auto type_size = VehicleLengthValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = VehicleLengthValue::isKeyDefined(); - size_t keyLength = VehicleLengthValue::getKeyMaxCdrSerializedSize() > 16 ? - VehicleLengthValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - VehicleLengthValuePubSubType::~VehicleLengthValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool VehicleLengthValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - VehicleLengthValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool VehicleLengthValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - VehicleLengthValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function VehicleLengthValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* VehicleLengthValuePubSubType::createData() - { - return reinterpret_cast(new VehicleLengthValue()); - } - - void VehicleLengthValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool VehicleLengthValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - VehicleLengthValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - VehicleLengthValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || VehicleLengthValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace VehicleLengthValue_Constants { + + + + + + + + + + + +} //End of namespace VehicleLengthValue_Constants + + + +VehicleLengthValuePubSubType::VehicleLengthValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::VehicleLengthValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(VehicleLengthValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_VehicleLengthValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +VehicleLengthValuePubSubType::~VehicleLengthValuePubSubType() +{ +} + +bool VehicleLengthValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + VehicleLengthValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool VehicleLengthValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + VehicleLengthValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function VehicleLengthValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* VehicleLengthValuePubSubType::createData() +{ + return reinterpret_cast(new VehicleLengthValue()); +} + +void VehicleLengthValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool VehicleLengthValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.h index 00923b86fe1..cf41c772d19 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleLengthValuePubSubTypes.h @@ -16,100 +16,132 @@ * @file VehicleLengthValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "VehicleLengthValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated VehicleLengthValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace VehicleLengthValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace VehicleLengthValue_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type VehicleLengthValue defined by the user in the IDL file. - * @ingroup VEHICLELENGTHVALUE - */ - class VehicleLengthValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef VehicleLengthValue type; +} // namespace VehicleLengthValue_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type VehicleLengthValue defined by the user in the IDL file. + * @ingroup VehicleLengthValue + */ +class VehicleLengthValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef VehicleLengthValue type; + + eProsima_user_DllExport VehicleLengthValuePubSubType(); - eProsima_user_DllExport VehicleLengthValuePubSubType(); + eProsima_user_DllExport ~VehicleLengthValuePubSubType() override; - eProsima_user_DllExport virtual ~VehicleLengthValuePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) VehicleLengthValue(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLELENGTHVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.cxx index e4f2f9b7378..e806ede9d14 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.cxx @@ -14,9 +14,9 @@ /*! * @file VehicleRole.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,130 +27,79 @@ char dummy; #endif // _WIN32 #include "VehicleRole.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace VehicleRole_Constants { +} // namespace VehicleRole_Constants - - - - - - - - - - -etsi_its_cam_msgs::msg::VehicleRole::VehicleRole() +VehicleRole::VehicleRole() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@51a06cbe - m_value = 0; - } -etsi_its_cam_msgs::msg::VehicleRole::~VehicleRole() +VehicleRole::~VehicleRole() { } -etsi_its_cam_msgs::msg::VehicleRole::VehicleRole( +VehicleRole::VehicleRole( const VehicleRole& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VehicleRole::VehicleRole( - VehicleRole&& x) +VehicleRole::VehicleRole( + VehicleRole&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::VehicleRole::operator =( +VehicleRole& VehicleRole::operator =( const VehicleRole& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::VehicleRole& etsi_its_cam_msgs::msg::VehicleRole::operator =( - VehicleRole&& x) +VehicleRole& VehicleRole::operator =( + VehicleRole&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::VehicleRole::operator ==( +bool VehicleRole::operator ==( const VehicleRole& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::VehicleRole::operator !=( +bool VehicleRole::operator !=( const VehicleRole& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::VehicleRole::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::VehicleRole::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleRole& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::VehicleRole::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::VehicleRole::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::VehicleRole::value( +void VehicleRole::value( uint8_t _value) { m_value = _value; @@ -160,7 +109,7 @@ void etsi_its_cam_msgs::msg::VehicleRole::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::VehicleRole::value() const +uint8_t VehicleRole::value() const { return m_value; } @@ -169,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::VehicleRole::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::VehicleRole::value() +uint8_t& VehicleRole::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::VehicleRole::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool etsi_its_cam_msgs::msg::VehicleRole::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::VehicleRole::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "VehicleRoleCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.h index 030657b2f71..487f7ce609c 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRole.h @@ -16,19 +16,24 @@ * @file VehicleRole.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,187 +47,143 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VehicleRole_SOURCE) -#define VehicleRole_DllAPI __declspec( dllexport ) +#if defined(VEHICLEROLE_SOURCE) +#define VEHICLEROLE_DllAPI __declspec( dllexport ) #else -#define VehicleRole_DllAPI __declspec( dllimport ) -#endif // VehicleRole_SOURCE +#define VEHICLEROLE_DllAPI __declspec( dllimport ) +#endif // VEHICLEROLE_SOURCE #else -#define VehicleRole_DllAPI +#define VEHICLEROLE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define VehicleRole_DllAPI +#define VEHICLEROLE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace VehicleRole_Constants { - const uint8_t DEFAULT = 0; - const uint8_t PUBLIC_TRANSPORT = 1; - const uint8_t SPECIAL_TRANSPORT = 2; - const uint8_t DANGEROUS_GOODS = 3; - const uint8_t ROAD_WORK = 4; - const uint8_t RESCUE = 5; - const uint8_t EMERGENCY = 6; - const uint8_t SAFETY_CAR = 7; - const uint8_t AGRICULTURE = 8; - const uint8_t COMMERCIAL = 9; - const uint8_t MILITARY = 10; - const uint8_t ROAD_OPERATOR = 11; - const uint8_t TAXI = 12; - const uint8_t RESERVED_1 = 13; - const uint8_t RESERVED_2 = 14; - const uint8_t RESERVED_3 = 15; - } // namespace VehicleRole_Constants - /*! - * @brief This class represents the structure VehicleRole defined by the user in the IDL file. - * @ingroup VEHICLEROLE - */ - class VehicleRole - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport VehicleRole(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~VehicleRole(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. - */ - eProsima_user_DllExport VehicleRole( - const VehicleRole& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. - */ - eProsima_user_DllExport VehicleRole( - VehicleRole&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. - */ - eProsima_user_DllExport VehicleRole& operator =( - const VehicleRole& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. - */ - eProsima_user_DllExport VehicleRole& operator =( - VehicleRole&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleRole object to compare. - */ - eProsima_user_DllExport bool operator ==( - const VehicleRole& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleRole object to compare. - */ - eProsima_user_DllExport bool operator !=( - const VehicleRole& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleRole& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace VehicleRole_Constants { + +const uint8_t DEFAULT = 0; +const uint8_t PUBLIC_TRANSPORT = 1; +const uint8_t SPECIAL_TRANSPORT = 2; +const uint8_t DANGEROUS_GOODS = 3; +const uint8_t ROAD_WORK = 4; +const uint8_t RESCUE = 5; +const uint8_t EMERGENCY = 6; +const uint8_t SAFETY_CAR = 7; +const uint8_t AGRICULTURE = 8; +const uint8_t COMMERCIAL = 9; +const uint8_t MILITARY = 10; +const uint8_t ROAD_OPERATOR = 11; +const uint8_t TAXI = 12; +const uint8_t RESERVED1 = 13; +const uint8_t RESERVED2 = 14; +const uint8_t RESERVED3 = 15; + +} // namespace VehicleRole_Constants + + +/*! + * @brief This class represents the structure VehicleRole defined by the user in the IDL file. + * @ingroup VehicleRole + */ +class VehicleRole +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleRole(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleRole(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. + */ + eProsima_user_DllExport VehicleRole( + const VehicleRole& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. + */ + eProsima_user_DllExport VehicleRole( + VehicleRole&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. + */ + eProsima_user_DllExport VehicleRole& operator =( + const VehicleRole& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleRole that will be copied. + */ + eProsima_user_DllExport VehicleRole& operator =( + VehicleRole&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleRole object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleRole& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleRole object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleRole& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRoleCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRoleCdrAux.hpp new file mode 100644 index 00000000000..2c896a94b36 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRoleCdrAux.hpp @@ -0,0 +1,83 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleRoleCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLECDRAUX_HPP_ + +#include "VehicleRole.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleRole_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleRole_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleRole& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRoleCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRoleCdrAux.ipp new file mode 100644 index 00000000000..aa9bae62445 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRoleCdrAux.ipp @@ -0,0 +1,163 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleRoleCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLECDRAUX_IPP_ + +#include "VehicleRoleCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::VehicleRole& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleRole& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::VehicleRole& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleRole& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.cxx index cec30c7dd14..e7fe4dc755a 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.cxx @@ -16,21 +16,38 @@ * @file VehicleRolePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "VehicleRolePubSubTypes.h" +#include "VehicleRoleCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace VehicleRole_Constants { +namespace msg { +namespace VehicleRole_Constants { + + + + + + + + + + + + + @@ -48,148 +65,170 @@ namespace etsi_its_cam_msgs { - } //End of namespace VehicleRole_Constants - VehicleRolePubSubType::VehicleRolePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::VehicleRole_"); - auto type_size = VehicleRole::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = VehicleRole::isKeyDefined(); - size_t keyLength = VehicleRole::getKeyMaxCdrSerializedSize() > 16 ? - VehicleRole::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - VehicleRolePubSubType::~VehicleRolePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - bool VehicleRolePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - VehicleRole* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool VehicleRolePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - VehicleRole* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function VehicleRolePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* VehicleRolePubSubType::createData() - { - return reinterpret_cast(new VehicleRole()); - } - - void VehicleRolePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool VehicleRolePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - VehicleRole* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - VehicleRole::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || VehicleRole::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + +} //End of namespace VehicleRole_Constants + + + +VehicleRolePubSubType::VehicleRolePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::VehicleRole_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(VehicleRole::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_VehicleRole_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +VehicleRolePubSubType::~VehicleRolePubSubType() +{ +} + +bool VehicleRolePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + VehicleRole* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool VehicleRolePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + VehicleRole* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function VehicleRolePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* VehicleRolePubSubType::createData() +{ + return reinterpret_cast(new VehicleRole()); +} + +void VehicleRolePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool VehicleRolePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.h index 6f60c5fce1e..6db539edf26 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleRolePubSubTypes.h @@ -16,29 +16,34 @@ * @file VehicleRolePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "VehicleRole.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated VehicleRole is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace VehicleRole_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace VehicleRole_Constants { + + @@ -55,72 +60,110 @@ namespace etsi_its_cam_msgs - } - /*! - * @brief This class represents the TopicDataType of the type VehicleRole defined by the user in the IDL file. - * @ingroup VEHICLEROLE - */ - class VehicleRolePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef VehicleRole type; - eProsima_user_DllExport VehicleRolePubSubType(); - eProsima_user_DllExport virtual ~VehicleRolePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) VehicleRole(); - return true; - } +} // namespace VehicleRole_Constants - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + +/*! + * @brief This class represents the TopicDataType of the type VehicleRole defined by the user in the IDL file. + * @ingroup VehicleRole + */ +class VehicleRolePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef VehicleRole type; + + eProsima_user_DllExport VehicleRolePubSubType(); + + eProsima_user_DllExport ~VehicleRolePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEROLE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.cxx index b6e0f93b52f..d2f60e9576d 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.cxx @@ -14,9 +14,9 @@ /*! * @file VehicleWidth.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "VehicleWidth.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace VehicleWidth_Constants { +} // namespace VehicleWidth_Constants -etsi_its_cam_msgs::msg::VehicleWidth::VehicleWidth() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@29d37757 - m_value = 0; +VehicleWidth::VehicleWidth() +{ } -etsi_its_cam_msgs::msg::VehicleWidth::~VehicleWidth() +VehicleWidth::~VehicleWidth() { } -etsi_its_cam_msgs::msg::VehicleWidth::VehicleWidth( +VehicleWidth::VehicleWidth( const VehicleWidth& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VehicleWidth::VehicleWidth( - VehicleWidth&& x) +VehicleWidth::VehicleWidth( + VehicleWidth&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::VehicleWidth::operator =( +VehicleWidth& VehicleWidth::operator =( const VehicleWidth& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::VehicleWidth& etsi_its_cam_msgs::msg::VehicleWidth::operator =( - VehicleWidth&& x) +VehicleWidth& VehicleWidth::operator =( + VehicleWidth&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::VehicleWidth::operator ==( +bool VehicleWidth::operator ==( const VehicleWidth& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::VehicleWidth::operator !=( +bool VehicleWidth::operator !=( const VehicleWidth& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::VehicleWidth::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::VehicleWidth::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleWidth& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::VehicleWidth::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::VehicleWidth::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::VehicleWidth::value( +void VehicleWidth::value( uint8_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::VehicleWidth::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::VehicleWidth::value() const +uint8_t VehicleWidth::value() const { return m_value; } @@ -158,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::VehicleWidth::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::VehicleWidth::value() +uint8_t& VehicleWidth::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::VehicleWidth::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::VehicleWidth::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::VehicleWidth::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "VehicleWidthCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.h index fdcd6b7a244..f553fda52fc 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidth.h @@ -16,19 +16,24 @@ * @file VehicleWidth.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VehicleWidth_SOURCE) -#define VehicleWidth_DllAPI __declspec( dllexport ) +#if defined(VEHICLEWIDTH_SOURCE) +#define VEHICLEWIDTH_DllAPI __declspec( dllexport ) #else -#define VehicleWidth_DllAPI __declspec( dllimport ) -#endif // VehicleWidth_SOURCE +#define VEHICLEWIDTH_DllAPI __declspec( dllimport ) +#endif // VEHICLEWIDTH_SOURCE #else -#define VehicleWidth_DllAPI +#define VEHICLEWIDTH_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define VehicleWidth_DllAPI +#define VEHICLEWIDTH_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace VehicleWidth_Constants { - const uint8_t MIN = 1; - const uint8_t MAX = 62; - const uint8_t TEN_CENTIMETERS = 1; - const uint8_t OUT_OF_RANGE = 61; - const uint8_t UNAVAILABLE = 62; - } // namespace VehicleWidth_Constants - /*! - * @brief This class represents the structure VehicleWidth defined by the user in the IDL file. - * @ingroup VEHICLEWIDTH - */ - class VehicleWidth - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport VehicleWidth(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~VehicleWidth(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. - */ - eProsima_user_DllExport VehicleWidth( - const VehicleWidth& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. - */ - eProsima_user_DllExport VehicleWidth( - VehicleWidth&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. - */ - eProsima_user_DllExport VehicleWidth& operator =( - const VehicleWidth& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. - */ - eProsima_user_DllExport VehicleWidth& operator =( - VehicleWidth&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleWidth object to compare. - */ - eProsima_user_DllExport bool operator ==( - const VehicleWidth& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VehicleWidth object to compare. - */ - eProsima_user_DllExport bool operator !=( - const VehicleWidth& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VehicleWidth& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace VehicleWidth_Constants { + +const uint8_t MIN = 1; +const uint8_t MAX = 62; +const uint8_t TEN_CENTIMETERS = 1; +const uint8_t OUT_OF_RANGE = 61; +const uint8_t UNAVAILABLE = 62; + +} // namespace VehicleWidth_Constants + + +/*! + * @brief This class represents the structure VehicleWidth defined by the user in the IDL file. + * @ingroup VehicleWidth + */ +class VehicleWidth +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VehicleWidth(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VehicleWidth(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. + */ + eProsima_user_DllExport VehicleWidth( + const VehicleWidth& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. + */ + eProsima_user_DllExport VehicleWidth( + VehicleWidth&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. + */ + eProsima_user_DllExport VehicleWidth& operator =( + const VehicleWidth& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VehicleWidth that will be copied. + */ + eProsima_user_DllExport VehicleWidth& operator =( + VehicleWidth&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleWidth object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VehicleWidth& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VehicleWidth object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VehicleWidth& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthCdrAux.hpp new file mode 100644 index 00000000000..008c7688e12 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleWidthCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTHCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTHCDRAUX_HPP_ + +#include "VehicleWidth.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleWidth_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_VehicleWidth_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleWidth& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTHCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthCdrAux.ipp new file mode 100644 index 00000000000..f59cd944720 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VehicleWidthCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTHCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTHCDRAUX_IPP_ + +#include "VehicleWidthCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::VehicleWidth& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleWidth& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::VehicleWidth& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VehicleWidth& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTHCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.cxx index 006e32dc819..ab9cf9833c8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.cxx @@ -16,169 +16,197 @@ * @file VehicleWidthPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "VehicleWidthPubSubTypes.h" +#include "VehicleWidthCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace VehicleWidth_Constants { - - - - - - - } //End of namespace VehicleWidth_Constants - VehicleWidthPubSubType::VehicleWidthPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::VehicleWidth_"); - auto type_size = VehicleWidth::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = VehicleWidth::isKeyDefined(); - size_t keyLength = VehicleWidth::getKeyMaxCdrSerializedSize() > 16 ? - VehicleWidth::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - VehicleWidthPubSubType::~VehicleWidthPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool VehicleWidthPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - VehicleWidth* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool VehicleWidthPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - VehicleWidth* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function VehicleWidthPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* VehicleWidthPubSubType::createData() - { - return reinterpret_cast(new VehicleWidth()); - } - - void VehicleWidthPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool VehicleWidthPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - VehicleWidth* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - VehicleWidth::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || VehicleWidth::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace VehicleWidth_Constants { + + + + + + + + + + + +} //End of namespace VehicleWidth_Constants + + + +VehicleWidthPubSubType::VehicleWidthPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::VehicleWidth_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(VehicleWidth::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_VehicleWidth_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +VehicleWidthPubSubType::~VehicleWidthPubSubType() +{ +} + +bool VehicleWidthPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + VehicleWidth* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool VehicleWidthPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + VehicleWidth* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function VehicleWidthPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* VehicleWidthPubSubType::createData() +{ + return reinterpret_cast(new VehicleWidth()); +} + +void VehicleWidthPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool VehicleWidthPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.h index fbeb1df502c..a37d4f58c23 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VehicleWidthPubSubTypes.h @@ -16,100 +16,132 @@ * @file VehicleWidthPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "VehicleWidth.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated VehicleWidth is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace VehicleWidth_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace VehicleWidth_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type VehicleWidth defined by the user in the IDL file. - * @ingroup VEHICLEWIDTH - */ - class VehicleWidthPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef VehicleWidth type; +} // namespace VehicleWidth_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type VehicleWidth defined by the user in the IDL file. + * @ingroup VehicleWidth + */ +class VehicleWidthPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef VehicleWidth type; + + eProsima_user_DllExport VehicleWidthPubSubType(); - eProsima_user_DllExport VehicleWidthPubSubType(); + eProsima_user_DllExport ~VehicleWidthPubSubType() override; - eProsima_user_DllExport virtual ~VehicleWidthPubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) VehicleWidth(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VEHICLEWIDTH_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.cxx index c384c790c1d..d003d7b5940 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.cxx @@ -14,9 +14,9 @@ /*! * @file VerticalAcceleration.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "VerticalAcceleration.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::VerticalAcceleration::VerticalAcceleration() -{ - // m_vertical_acceleration_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6e4ea0bd - // m_vertical_acceleration_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@56f2bbea +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::VerticalAcceleration::~VerticalAcceleration() +VerticalAcceleration::VerticalAcceleration() { +} +VerticalAcceleration::~VerticalAcceleration() +{ } -etsi_its_cam_msgs::msg::VerticalAcceleration::VerticalAcceleration( +VerticalAcceleration::VerticalAcceleration( const VerticalAcceleration& x) { m_vertical_acceleration_value = x.m_vertical_acceleration_value; m_vertical_acceleration_confidence = x.m_vertical_acceleration_confidence; } -etsi_its_cam_msgs::msg::VerticalAcceleration::VerticalAcceleration( - VerticalAcceleration&& x) +VerticalAcceleration::VerticalAcceleration( + VerticalAcceleration&& x) noexcept { m_vertical_acceleration_value = std::move(x.m_vertical_acceleration_value); m_vertical_acceleration_confidence = std::move(x.m_vertical_acceleration_confidence); } -etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::VerticalAcceleration::operator =( +VerticalAcceleration& VerticalAcceleration::operator =( const VerticalAcceleration& x) { m_vertical_acceleration_value = x.m_vertical_acceleration_value; m_vertical_acceleration_confidence = x.m_vertical_acceleration_confidence; - return *this; } -etsi_its_cam_msgs::msg::VerticalAcceleration& etsi_its_cam_msgs::msg::VerticalAcceleration::operator =( - VerticalAcceleration&& x) +VerticalAcceleration& VerticalAcceleration::operator =( + VerticalAcceleration&& x) noexcept { m_vertical_acceleration_value = std::move(x.m_vertical_acceleration_value); m_vertical_acceleration_confidence = std::move(x.m_vertical_acceleration_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::VerticalAcceleration::operator ==( +bool VerticalAcceleration::operator ==( const VerticalAcceleration& x) const { - - return (m_vertical_acceleration_value == x.m_vertical_acceleration_value && m_vertical_acceleration_confidence == x.m_vertical_acceleration_confidence); + return (m_vertical_acceleration_value == x.m_vertical_acceleration_value && + m_vertical_acceleration_confidence == x.m_vertical_acceleration_confidence); } -bool etsi_its_cam_msgs::msg::VerticalAcceleration::operator !=( +bool VerticalAcceleration::operator !=( const VerticalAcceleration& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::VerticalAcceleration::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::VerticalAccelerationValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::VerticalAcceleration::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VerticalAcceleration& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::VerticalAccelerationValue::getCdrSerializedSize(data.vertical_acceleration_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::AccelerationConfidence::getCdrSerializedSize(data.vertical_acceleration_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::VerticalAcceleration::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_vertical_acceleration_value; - scdr << m_vertical_acceleration_confidence; - -} - -void etsi_its_cam_msgs::msg::VerticalAcceleration::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_vertical_acceleration_value; - dcdr >> m_vertical_acceleration_confidence; -} - /*! * @brief This function copies the value in member vertical_acceleration_value * @param _vertical_acceleration_value New value to be copied in member vertical_acceleration_value */ -void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value( +void VerticalAcceleration::vertical_acceleration_value( const etsi_its_cam_msgs::msg::VerticalAccelerationValue& _vertical_acceleration_value) { m_vertical_acceleration_value = _vertical_acceleration_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value( * @brief This function moves the value in member vertical_acceleration_value * @param _vertical_acceleration_value New value to be moved in member vertical_acceleration_value */ -void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value( +void VerticalAcceleration::vertical_acceleration_value( etsi_its_cam_msgs::msg::VerticalAccelerationValue&& _vertical_acceleration_value) { m_vertical_acceleration_value = std::move(_vertical_acceleration_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value( * @brief This function returns a constant reference to member vertical_acceleration_value * @return Constant reference to member vertical_acceleration_value */ -const etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value() const +const etsi_its_cam_msgs::msg::VerticalAccelerationValue& VerticalAcceleration::vertical_acceleration_value() const { return m_vertical_acceleration_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg: * @brief This function returns a reference to member vertical_acceleration_value * @return Reference to member vertical_acceleration_value */ -etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_value() +etsi_its_cam_msgs::msg::VerticalAccelerationValue& VerticalAcceleration::vertical_acceleration_value() { return m_vertical_acceleration_value; } + + /*! * @brief This function copies the value in member vertical_acceleration_confidence * @param _vertical_acceleration_confidence New value to be copied in member vertical_acceleration_confidence */ -void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confidence( +void VerticalAcceleration::vertical_acceleration_confidence( const etsi_its_cam_msgs::msg::AccelerationConfidence& _vertical_acceleration_confidence) { m_vertical_acceleration_confidence = _vertical_acceleration_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confide * @brief This function moves the value in member vertical_acceleration_confidence * @param _vertical_acceleration_confidence New value to be moved in member vertical_acceleration_confidence */ -void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confidence( +void VerticalAcceleration::vertical_acceleration_confidence( etsi_its_cam_msgs::msg::AccelerationConfidence&& _vertical_acceleration_confidence) { m_vertical_acceleration_confidence = std::move(_vertical_acceleration_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confide * @brief This function returns a constant reference to member vertical_acceleration_confidence * @return Constant reference to member vertical_acceleration_confidence */ -const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confidence() const +const etsi_its_cam_msgs::msg::AccelerationConfidence& VerticalAcceleration::vertical_acceleration_confidence() const { return m_vertical_acceleration_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::Ve * @brief This function returns a reference to member vertical_acceleration_confidence * @return Reference to member vertical_acceleration_confidence */ -etsi_its_cam_msgs::msg::AccelerationConfidence& etsi_its_cam_msgs::msg::VerticalAcceleration::vertical_acceleration_confidence() +etsi_its_cam_msgs::msg::AccelerationConfidence& VerticalAcceleration::vertical_acceleration_confidence() { return m_vertical_acceleration_confidence; } -size_t etsi_its_cam_msgs::msg::VerticalAcceleration::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::VerticalAcceleration::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::VerticalAcceleration::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "VerticalAccelerationCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.h index 0d256bb7d7c..df36fceb7b9 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAcceleration.h @@ -16,21 +16,26 @@ * @file VerticalAcceleration.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_H_ -#include "AccelerationConfidence.h" -#include "VerticalAccelerationValue.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "AccelerationConfidence.h" +#include "VerticalAccelerationValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VerticalAcceleration_SOURCE) -#define VerticalAcceleration_DllAPI __declspec( dllexport ) +#if defined(VERTICALACCELERATION_SOURCE) +#define VERTICALACCELERATION_DllAPI __declspec( dllexport ) #else -#define VerticalAcceleration_DllAPI __declspec( dllimport ) -#endif // VerticalAcceleration_SOURCE +#define VERTICALACCELERATION_DllAPI __declspec( dllimport ) +#endif // VERTICALACCELERATION_SOURCE #else -#define VerticalAcceleration_DllAPI +#define VERTICALACCELERATION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define VerticalAcceleration_DllAPI +#define VERTICALACCELERATION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure VerticalAcceleration defined by the user in the IDL file. - * @ingroup VERTICALACCELERATION - */ - class VerticalAcceleration - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport VerticalAcceleration(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~VerticalAcceleration(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. - */ - eProsima_user_DllExport VerticalAcceleration( - const VerticalAcceleration& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. - */ - eProsima_user_DllExport VerticalAcceleration( - VerticalAcceleration&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. - */ - eProsima_user_DllExport VerticalAcceleration& operator =( - const VerticalAcceleration& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. - */ - eProsima_user_DllExport VerticalAcceleration& operator =( - VerticalAcceleration&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VerticalAcceleration object to compare. - */ - eProsima_user_DllExport bool operator ==( - const VerticalAcceleration& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VerticalAcceleration object to compare. - */ - eProsima_user_DllExport bool operator !=( - const VerticalAcceleration& x) const; - - /*! - * @brief This function copies the value in member vertical_acceleration_value - * @param _vertical_acceleration_value New value to be copied in member vertical_acceleration_value - */ - eProsima_user_DllExport void vertical_acceleration_value( - const etsi_its_cam_msgs::msg::VerticalAccelerationValue& _vertical_acceleration_value); - - /*! - * @brief This function moves the value in member vertical_acceleration_value - * @param _vertical_acceleration_value New value to be moved in member vertical_acceleration_value - */ - eProsima_user_DllExport void vertical_acceleration_value( - etsi_its_cam_msgs::msg::VerticalAccelerationValue&& _vertical_acceleration_value); - - /*! - * @brief This function returns a constant reference to member vertical_acceleration_value - * @return Constant reference to member vertical_acceleration_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::VerticalAccelerationValue& vertical_acceleration_value() const; - - /*! - * @brief This function returns a reference to member vertical_acceleration_value - * @return Reference to member vertical_acceleration_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::VerticalAccelerationValue& vertical_acceleration_value(); - /*! - * @brief This function copies the value in member vertical_acceleration_confidence - * @param _vertical_acceleration_confidence New value to be copied in member vertical_acceleration_confidence - */ - eProsima_user_DllExport void vertical_acceleration_confidence( - const etsi_its_cam_msgs::msg::AccelerationConfidence& _vertical_acceleration_confidence); - - /*! - * @brief This function moves the value in member vertical_acceleration_confidence - * @param _vertical_acceleration_confidence New value to be moved in member vertical_acceleration_confidence - */ - eProsima_user_DllExport void vertical_acceleration_confidence( - etsi_its_cam_msgs::msg::AccelerationConfidence&& _vertical_acceleration_confidence); - - /*! - * @brief This function returns a constant reference to member vertical_acceleration_confidence - * @return Constant reference to member vertical_acceleration_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& vertical_acceleration_confidence() const; - - /*! - * @brief This function returns a reference to member vertical_acceleration_confidence - * @return Reference to member vertical_acceleration_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& vertical_acceleration_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VerticalAcceleration& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::VerticalAccelerationValue m_vertical_acceleration_value; - etsi_its_cam_msgs::msg::AccelerationConfidence m_vertical_acceleration_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure VerticalAcceleration defined by the user in the IDL file. + * @ingroup VerticalAcceleration + */ +class VerticalAcceleration +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VerticalAcceleration(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VerticalAcceleration(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. + */ + eProsima_user_DllExport VerticalAcceleration( + const VerticalAcceleration& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. + */ + eProsima_user_DllExport VerticalAcceleration( + VerticalAcceleration&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. + */ + eProsima_user_DllExport VerticalAcceleration& operator =( + const VerticalAcceleration& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAcceleration that will be copied. + */ + eProsima_user_DllExport VerticalAcceleration& operator =( + VerticalAcceleration&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VerticalAcceleration object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VerticalAcceleration& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VerticalAcceleration object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VerticalAcceleration& x) const; + + /*! + * @brief This function copies the value in member vertical_acceleration_value + * @param _vertical_acceleration_value New value to be copied in member vertical_acceleration_value + */ + eProsima_user_DllExport void vertical_acceleration_value( + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& _vertical_acceleration_value); + + /*! + * @brief This function moves the value in member vertical_acceleration_value + * @param _vertical_acceleration_value New value to be moved in member vertical_acceleration_value + */ + eProsima_user_DllExport void vertical_acceleration_value( + etsi_its_cam_msgs::msg::VerticalAccelerationValue&& _vertical_acceleration_value); + + /*! + * @brief This function returns a constant reference to member vertical_acceleration_value + * @return Constant reference to member vertical_acceleration_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::VerticalAccelerationValue& vertical_acceleration_value() const; + + /*! + * @brief This function returns a reference to member vertical_acceleration_value + * @return Reference to member vertical_acceleration_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::VerticalAccelerationValue& vertical_acceleration_value(); + + + /*! + * @brief This function copies the value in member vertical_acceleration_confidence + * @param _vertical_acceleration_confidence New value to be copied in member vertical_acceleration_confidence + */ + eProsima_user_DllExport void vertical_acceleration_confidence( + const etsi_its_cam_msgs::msg::AccelerationConfidence& _vertical_acceleration_confidence); + + /*! + * @brief This function moves the value in member vertical_acceleration_confidence + * @param _vertical_acceleration_confidence New value to be moved in member vertical_acceleration_confidence + */ + eProsima_user_DllExport void vertical_acceleration_confidence( + etsi_its_cam_msgs::msg::AccelerationConfidence&& _vertical_acceleration_confidence); + + /*! + * @brief This function returns a constant reference to member vertical_acceleration_confidence + * @return Constant reference to member vertical_acceleration_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::AccelerationConfidence& vertical_acceleration_confidence() const; + + /*! + * @brief This function returns a reference to member vertical_acceleration_confidence + * @return Reference to member vertical_acceleration_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::AccelerationConfidence& vertical_acceleration_confidence(); + +private: + + etsi_its_cam_msgs::msg::VerticalAccelerationValue m_vertical_acceleration_value; + etsi_its_cam_msgs::msg::AccelerationConfidence m_vertical_acceleration_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationCdrAux.hpp new file mode 100644 index 00000000000..d751788d516 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONCDRAUX_HPP_ + +#include "VerticalAcceleration.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_VerticalAcceleration_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_VerticalAcceleration_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VerticalAcceleration& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationCdrAux.ipp new file mode 100644 index 00000000000..ae26b6d946d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONCDRAUX_IPP_ + +#include "VerticalAccelerationCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::VerticalAcceleration& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.vertical_acceleration_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.vertical_acceleration_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VerticalAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.vertical_acceleration_value() + << eprosima::fastcdr::MemberId(1) << data.vertical_acceleration_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::VerticalAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.vertical_acceleration_value(); + break; + + case 1: + dcdr >> data.vertical_acceleration_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VerticalAcceleration& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.cxx index 641e64c0966..74aecbe10b8 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file VerticalAccelerationPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "VerticalAccelerationPubSubTypes.h" +#include "VerticalAccelerationCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - VerticalAccelerationPubSubType::VerticalAccelerationPubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::VerticalAcceleration_"); - auto type_size = VerticalAcceleration::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = VerticalAcceleration::isKeyDefined(); - size_t keyLength = VerticalAcceleration::getKeyMaxCdrSerializedSize() > 16 ? - VerticalAcceleration::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - VerticalAccelerationPubSubType::~VerticalAccelerationPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool VerticalAccelerationPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - VerticalAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool VerticalAccelerationPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - VerticalAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function VerticalAccelerationPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* VerticalAccelerationPubSubType::createData() - { - return reinterpret_cast(new VerticalAcceleration()); - } - - void VerticalAccelerationPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool VerticalAccelerationPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - VerticalAcceleration* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - VerticalAcceleration::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || VerticalAcceleration::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +VerticalAccelerationPubSubType::VerticalAccelerationPubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::VerticalAcceleration_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(VerticalAcceleration::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_VerticalAcceleration_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +VerticalAccelerationPubSubType::~VerticalAccelerationPubSubType() +{ +} + +bool VerticalAccelerationPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + VerticalAcceleration* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool VerticalAccelerationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + VerticalAcceleration* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function VerticalAccelerationPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* VerticalAccelerationPubSubType::createData() +{ + return reinterpret_cast(new VerticalAcceleration()); +} + +void VerticalAccelerationPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool VerticalAccelerationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.h index 7d48f81ee84..57be2ce0115 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationPubSubTypes.h @@ -16,92 +16,122 @@ * @file VerticalAccelerationPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "VerticalAcceleration.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "AccelerationConfidencePubSubTypes.h" +#include "VerticalAccelerationValuePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated VerticalAcceleration is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type VerticalAcceleration defined by the user in the IDL file. + * @ingroup VerticalAcceleration + */ +class VerticalAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type VerticalAcceleration defined by the user in the IDL file. - * @ingroup VERTICALACCELERATION - */ - class VerticalAccelerationPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef VerticalAcceleration type; + typedef VerticalAcceleration type; - eProsima_user_DllExport VerticalAccelerationPubSubType(); + eProsima_user_DllExport VerticalAccelerationPubSubType(); - eProsima_user_DllExport virtual ~VerticalAccelerationPubSubType(); + eProsima_user_DllExport ~VerticalAccelerationPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) VerticalAcceleration(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.cxx index b42614299c2..9745c49024b 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.cxx @@ -14,9 +14,9 @@ /*! * @file VerticalAccelerationValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,79 @@ char dummy; #endif // _WIN32 #include "VerticalAccelerationValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace VerticalAccelerationValue_Constants { +} // namespace VerticalAccelerationValue_Constants -etsi_its_cam_msgs::msg::VerticalAccelerationValue::VerticalAccelerationValue() -{ - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e411d81 - m_value = 0; +VerticalAccelerationValue::VerticalAccelerationValue() +{ } -etsi_its_cam_msgs::msg::VerticalAccelerationValue::~VerticalAccelerationValue() +VerticalAccelerationValue::~VerticalAccelerationValue() { } -etsi_its_cam_msgs::msg::VerticalAccelerationValue::VerticalAccelerationValue( +VerticalAccelerationValue::VerticalAccelerationValue( const VerticalAccelerationValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VerticalAccelerationValue::VerticalAccelerationValue( - VerticalAccelerationValue&& x) +VerticalAccelerationValue::VerticalAccelerationValue( + VerticalAccelerationValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg::VerticalAccelerationValue::operator =( +VerticalAccelerationValue& VerticalAccelerationValue::operator =( const VerticalAccelerationValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::VerticalAccelerationValue& etsi_its_cam_msgs::msg::VerticalAccelerationValue::operator =( - VerticalAccelerationValue&& x) +VerticalAccelerationValue& VerticalAccelerationValue::operator =( + VerticalAccelerationValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::VerticalAccelerationValue::operator ==( +bool VerticalAccelerationValue::operator ==( const VerticalAccelerationValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::VerticalAccelerationValue::operator !=( +bool VerticalAccelerationValue::operator !=( const VerticalAccelerationValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VerticalAccelerationValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::VerticalAccelerationValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::VerticalAccelerationValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::VerticalAccelerationValue::value( +void VerticalAccelerationValue::value( int16_t _value) { m_value = _value; @@ -149,7 +109,7 @@ void etsi_its_cam_msgs::msg::VerticalAccelerationValue::value( * @brief This function returns the value of member value * @return Value of member value */ -int16_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::value() const +int16_t VerticalAccelerationValue::value() const { return m_value; } @@ -158,32 +118,18 @@ int16_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int16_t& etsi_its_cam_msgs::msg::VerticalAccelerationValue::value() +int16_t& VerticalAccelerationValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::VerticalAccelerationValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::VerticalAccelerationValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::VerticalAccelerationValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "VerticalAccelerationValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.h index 7d547cafde5..82cbee7d407 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValue.h @@ -16,19 +16,24 @@ * @file VerticalAccelerationValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,176 +47,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(VerticalAccelerationValue_SOURCE) -#define VerticalAccelerationValue_DllAPI __declspec( dllexport ) +#if defined(VERTICALACCELERATIONVALUE_SOURCE) +#define VERTICALACCELERATIONVALUE_DllAPI __declspec( dllexport ) #else -#define VerticalAccelerationValue_DllAPI __declspec( dllimport ) -#endif // VerticalAccelerationValue_SOURCE +#define VERTICALACCELERATIONVALUE_DllAPI __declspec( dllimport ) +#endif // VERTICALACCELERATIONVALUE_SOURCE #else -#define VerticalAccelerationValue_DllAPI +#define VERTICALACCELERATIONVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define VerticalAccelerationValue_DllAPI +#define VERTICALACCELERATIONVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace VerticalAccelerationValue_Constants { - const int16_t MIN = -160; - const int16_t MAX = 161; - const int16_t POINT_ONE_METER_PER_SEC_SQUARED_UP = 1; - const int16_t POINT_ONE_METER_PER_SEC_SQUARED_DOWN = -1; - const int16_t UNAVAILABLE = 161; - } // namespace VerticalAccelerationValue_Constants - /*! - * @brief This class represents the structure VerticalAccelerationValue defined by the user in the IDL file. - * @ingroup VERTICALACCELERATIONVALUE - */ - class VerticalAccelerationValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport VerticalAccelerationValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~VerticalAccelerationValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. - */ - eProsima_user_DllExport VerticalAccelerationValue( - const VerticalAccelerationValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. - */ - eProsima_user_DllExport VerticalAccelerationValue( - VerticalAccelerationValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. - */ - eProsima_user_DllExport VerticalAccelerationValue& operator =( - const VerticalAccelerationValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. - */ - eProsima_user_DllExport VerticalAccelerationValue& operator =( - VerticalAccelerationValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VerticalAccelerationValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const VerticalAccelerationValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::VerticalAccelerationValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const VerticalAccelerationValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::VerticalAccelerationValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace VerticalAccelerationValue_Constants { + +const int16_t MIN = -160; +const int16_t MAX = 161; +const int16_t POINT_ONE_METER_PER_SEC_SQUARED_UP = 1; +const int16_t POINT_ONE_METER_PER_SEC_SQUARED_DOWN = -1; +const int16_t UNAVAILABLE = 161; + +} // namespace VerticalAccelerationValue_Constants + + +/*! + * @brief This class represents the structure VerticalAccelerationValue defined by the user in the IDL file. + * @ingroup VerticalAccelerationValue + */ +class VerticalAccelerationValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport VerticalAccelerationValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~VerticalAccelerationValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. + */ + eProsima_user_DllExport VerticalAccelerationValue( + const VerticalAccelerationValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. + */ + eProsima_user_DllExport VerticalAccelerationValue( + VerticalAccelerationValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. + */ + eProsima_user_DllExport VerticalAccelerationValue& operator =( + const VerticalAccelerationValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::VerticalAccelerationValue that will be copied. + */ + eProsima_user_DllExport VerticalAccelerationValue& operator =( + VerticalAccelerationValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VerticalAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const VerticalAccelerationValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::VerticalAccelerationValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const VerticalAccelerationValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + +private: + + int16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValueCdrAux.hpp new file mode 100644 index 00000000000..a88179855a0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValueCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUECDRAUX_HPP_ + +#include "VerticalAccelerationValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_VerticalAccelerationValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_VerticalAccelerationValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValueCdrAux.ipp new file mode 100644 index 00000000000..f2d5eb7f226 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValueCdrAux.ipp @@ -0,0 +1,141 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file VerticalAccelerationValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUECDRAUX_IPP_ + +#include "VerticalAccelerationValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::VerticalAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::VerticalAccelerationValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.cxx index 57fc138db1d..5bacca7a0e5 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.cxx @@ -16,169 +16,197 @@ * @file VerticalAccelerationValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "VerticalAccelerationValuePubSubTypes.h" +#include "VerticalAccelerationValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace VerticalAccelerationValue_Constants { - - - - - - - } //End of namespace VerticalAccelerationValue_Constants - VerticalAccelerationValuePubSubType::VerticalAccelerationValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::VerticalAccelerationValue_"); - auto type_size = VerticalAccelerationValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = VerticalAccelerationValue::isKeyDefined(); - size_t keyLength = VerticalAccelerationValue::getKeyMaxCdrSerializedSize() > 16 ? - VerticalAccelerationValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - VerticalAccelerationValuePubSubType::~VerticalAccelerationValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool VerticalAccelerationValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - VerticalAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool VerticalAccelerationValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - VerticalAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function VerticalAccelerationValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* VerticalAccelerationValuePubSubType::createData() - { - return reinterpret_cast(new VerticalAccelerationValue()); - } - - void VerticalAccelerationValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool VerticalAccelerationValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - VerticalAccelerationValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - VerticalAccelerationValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || VerticalAccelerationValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace VerticalAccelerationValue_Constants { + + + + + + + + + + + +} //End of namespace VerticalAccelerationValue_Constants + + + +VerticalAccelerationValuePubSubType::VerticalAccelerationValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::VerticalAccelerationValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(VerticalAccelerationValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_VerticalAccelerationValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +VerticalAccelerationValuePubSubType::~VerticalAccelerationValuePubSubType() +{ +} + +bool VerticalAccelerationValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + VerticalAccelerationValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool VerticalAccelerationValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + VerticalAccelerationValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function VerticalAccelerationValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* VerticalAccelerationValuePubSubType::createData() +{ + return reinterpret_cast(new VerticalAccelerationValue()); +} + +void VerticalAccelerationValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool VerticalAccelerationValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.h index 217790a0fc6..37ea0ce760e 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/VerticalAccelerationValuePubSubTypes.h @@ -16,100 +16,132 @@ * @file VerticalAccelerationValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "VerticalAccelerationValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated VerticalAccelerationValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace VerticalAccelerationValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace VerticalAccelerationValue_Constants { + + + + - } - /*! - * @brief This class represents the TopicDataType of the type VerticalAccelerationValue defined by the user in the IDL file. - * @ingroup VERTICALACCELERATIONVALUE - */ - class VerticalAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef VerticalAccelerationValue type; +} // namespace VerticalAccelerationValue_Constants + + + +/*! + * @brief This class represents the TopicDataType of the type VerticalAccelerationValue defined by the user in the IDL file. + * @ingroup VerticalAccelerationValue + */ +class VerticalAccelerationValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef VerticalAccelerationValue type; + + eProsima_user_DllExport VerticalAccelerationValuePubSubType(); - eProsima_user_DllExport VerticalAccelerationValuePubSubType(); + eProsima_user_DllExport ~VerticalAccelerationValuePubSubType() override; - eProsima_user_DllExport virtual ~VerticalAccelerationValuePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) VerticalAccelerationValue(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_VERTICALACCELERATIONVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.cxx index 4a061f251d6..f5aa4890a18 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.cxx @@ -14,9 +14,9 @@ /*! * @file YawRate.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "YawRate.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -etsi_its_cam_msgs::msg::YawRate::YawRate() -{ - // m_yaw_rate_value com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1654a892 - // m_yaw_rate_confidence com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2577d6c8 +namespace etsi_its_cam_msgs { + +namespace msg { -} -etsi_its_cam_msgs::msg::YawRate::~YawRate() +YawRate::YawRate() { +} +YawRate::~YawRate() +{ } -etsi_its_cam_msgs::msg::YawRate::YawRate( +YawRate::YawRate( const YawRate& x) { m_yaw_rate_value = x.m_yaw_rate_value; m_yaw_rate_confidence = x.m_yaw_rate_confidence; } -etsi_its_cam_msgs::msg::YawRate::YawRate( - YawRate&& x) +YawRate::YawRate( + YawRate&& x) noexcept { m_yaw_rate_value = std::move(x.m_yaw_rate_value); m_yaw_rate_confidence = std::move(x.m_yaw_rate_confidence); } -etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::YawRate::operator =( +YawRate& YawRate::operator =( const YawRate& x) { m_yaw_rate_value = x.m_yaw_rate_value; m_yaw_rate_confidence = x.m_yaw_rate_confidence; - return *this; } -etsi_its_cam_msgs::msg::YawRate& etsi_its_cam_msgs::msg::YawRate::operator =( - YawRate&& x) +YawRate& YawRate::operator =( + YawRate&& x) noexcept { m_yaw_rate_value = std::move(x.m_yaw_rate_value); m_yaw_rate_confidence = std::move(x.m_yaw_rate_confidence); - return *this; } -bool etsi_its_cam_msgs::msg::YawRate::operator ==( +bool YawRate::operator ==( const YawRate& x) const { - - return (m_yaw_rate_value == x.m_yaw_rate_value && m_yaw_rate_confidence == x.m_yaw_rate_confidence); + return (m_yaw_rate_value == x.m_yaw_rate_value && + m_yaw_rate_confidence == x.m_yaw_rate_confidence); } -bool etsi_its_cam_msgs::msg::YawRate::operator !=( +bool YawRate::operator !=( const YawRate& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::YawRate::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::YawRateValue::getMaxCdrSerializedSize(current_alignment); - current_alignment += etsi_its_cam_msgs::msg::YawRateConfidence::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::YawRate::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::YawRate& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += etsi_its_cam_msgs::msg::YawRateValue::getCdrSerializedSize(data.yaw_rate_value(), current_alignment); - current_alignment += etsi_its_cam_msgs::msg::YawRateConfidence::getCdrSerializedSize(data.yaw_rate_confidence(), current_alignment); - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::YawRate::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_yaw_rate_value; - scdr << m_yaw_rate_confidence; - -} - -void etsi_its_cam_msgs::msg::YawRate::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_yaw_rate_value; - dcdr >> m_yaw_rate_confidence; -} - /*! * @brief This function copies the value in member yaw_rate_value * @param _yaw_rate_value New value to be copied in member yaw_rate_value */ -void etsi_its_cam_msgs::msg::YawRate::yaw_rate_value( +void YawRate::yaw_rate_value( const etsi_its_cam_msgs::msg::YawRateValue& _yaw_rate_value) { m_yaw_rate_value = _yaw_rate_value; @@ -152,7 +110,7 @@ void etsi_its_cam_msgs::msg::YawRate::yaw_rate_value( * @brief This function moves the value in member yaw_rate_value * @param _yaw_rate_value New value to be moved in member yaw_rate_value */ -void etsi_its_cam_msgs::msg::YawRate::yaw_rate_value( +void YawRate::yaw_rate_value( etsi_its_cam_msgs::msg::YawRateValue&& _yaw_rate_value) { m_yaw_rate_value = std::move(_yaw_rate_value); @@ -162,7 +120,7 @@ void etsi_its_cam_msgs::msg::YawRate::yaw_rate_value( * @brief This function returns a constant reference to member yaw_rate_value * @return Constant reference to member yaw_rate_value */ -const etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRate::yaw_rate_value() const +const etsi_its_cam_msgs::msg::YawRateValue& YawRate::yaw_rate_value() const { return m_yaw_rate_value; } @@ -171,15 +129,17 @@ const etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRate::yaw * @brief This function returns a reference to member yaw_rate_value * @return Reference to member yaw_rate_value */ -etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRate::yaw_rate_value() +etsi_its_cam_msgs::msg::YawRateValue& YawRate::yaw_rate_value() { return m_yaw_rate_value; } + + /*! * @brief This function copies the value in member yaw_rate_confidence * @param _yaw_rate_confidence New value to be copied in member yaw_rate_confidence */ -void etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence( +void YawRate::yaw_rate_confidence( const etsi_its_cam_msgs::msg::YawRateConfidence& _yaw_rate_confidence) { m_yaw_rate_confidence = _yaw_rate_confidence; @@ -189,7 +149,7 @@ void etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence( * @brief This function moves the value in member yaw_rate_confidence * @param _yaw_rate_confidence New value to be moved in member yaw_rate_confidence */ -void etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence( +void YawRate::yaw_rate_confidence( etsi_its_cam_msgs::msg::YawRateConfidence&& _yaw_rate_confidence) { m_yaw_rate_confidence = std::move(_yaw_rate_confidence); @@ -199,7 +159,7 @@ void etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence( * @brief This function returns a constant reference to member yaw_rate_confidence * @return Constant reference to member yaw_rate_confidence */ -const etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence() const +const etsi_its_cam_msgs::msg::YawRateConfidence& YawRate::yaw_rate_confidence() const { return m_yaw_rate_confidence; } @@ -208,31 +168,18 @@ const etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRate * @brief This function returns a reference to member yaw_rate_confidence * @return Reference to member yaw_rate_confidence */ -etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRate::yaw_rate_confidence() +etsi_its_cam_msgs::msg::YawRateConfidence& YawRate::yaw_rate_confidence() { return m_yaw_rate_confidence; } -size_t etsi_its_cam_msgs::msg::YawRate::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool etsi_its_cam_msgs::msg::YawRate::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::YawRate::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "YawRateCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.h index fd230133b32..de9a8dd16eb 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRate.h @@ -16,21 +16,26 @@ * @file YawRate.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_H_ -#include "YawRateConfidence.h" -#include "YawRateValue.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "YawRateConfidence.h" +#include "YawRateValue.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(YawRate_SOURCE) -#define YawRate_DllAPI __declspec( dllexport ) +#if defined(YAWRATE_SOURCE) +#define YAWRATE_DllAPI __declspec( dllexport ) #else -#define YawRate_DllAPI __declspec( dllimport ) -#endif // YawRate_SOURCE +#define YAWRATE_DllAPI __declspec( dllimport ) +#endif // YAWRATE_SOURCE #else -#define YawRate_DllAPI +#define YAWRATE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define YawRate_DllAPI +#define YAWRATE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - /*! - * @brief This class represents the structure YawRate defined by the user in the IDL file. - * @ingroup YAWRATE - */ - class YawRate - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport YawRate(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~YawRate(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. - */ - eProsima_user_DllExport YawRate( - const YawRate& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. - */ - eProsima_user_DllExport YawRate( - YawRate&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. - */ - eProsima_user_DllExport YawRate& operator =( - const YawRate& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. - */ - eProsima_user_DllExport YawRate& operator =( - YawRate&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::YawRate object to compare. - */ - eProsima_user_DllExport bool operator ==( - const YawRate& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::YawRate object to compare. - */ - eProsima_user_DllExport bool operator !=( - const YawRate& x) const; - - /*! - * @brief This function copies the value in member yaw_rate_value - * @param _yaw_rate_value New value to be copied in member yaw_rate_value - */ - eProsima_user_DllExport void yaw_rate_value( - const etsi_its_cam_msgs::msg::YawRateValue& _yaw_rate_value); - - /*! - * @brief This function moves the value in member yaw_rate_value - * @param _yaw_rate_value New value to be moved in member yaw_rate_value - */ - eProsima_user_DllExport void yaw_rate_value( - etsi_its_cam_msgs::msg::YawRateValue&& _yaw_rate_value); - - /*! - * @brief This function returns a constant reference to member yaw_rate_value - * @return Constant reference to member yaw_rate_value - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRateValue& yaw_rate_value() const; - - /*! - * @brief This function returns a reference to member yaw_rate_value - * @return Reference to member yaw_rate_value - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRateValue& yaw_rate_value(); - /*! - * @brief This function copies the value in member yaw_rate_confidence - * @param _yaw_rate_confidence New value to be copied in member yaw_rate_confidence - */ - eProsima_user_DllExport void yaw_rate_confidence( - const etsi_its_cam_msgs::msg::YawRateConfidence& _yaw_rate_confidence); - - /*! - * @brief This function moves the value in member yaw_rate_confidence - * @param _yaw_rate_confidence New value to be moved in member yaw_rate_confidence - */ - eProsima_user_DllExport void yaw_rate_confidence( - etsi_its_cam_msgs::msg::YawRateConfidence&& _yaw_rate_confidence); - - /*! - * @brief This function returns a constant reference to member yaw_rate_confidence - * @return Constant reference to member yaw_rate_confidence - */ - eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRateConfidence& yaw_rate_confidence() const; - - /*! - * @brief This function returns a reference to member yaw_rate_confidence - * @return Reference to member yaw_rate_confidence - */ - eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRateConfidence& yaw_rate_confidence(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::YawRate& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - etsi_its_cam_msgs::msg::YawRateValue m_yaw_rate_value; - etsi_its_cam_msgs::msg::YawRateConfidence m_yaw_rate_confidence; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure YawRate defined by the user in the IDL file. + * @ingroup YawRate + */ +class YawRate +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport YawRate(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~YawRate(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. + */ + eProsima_user_DllExport YawRate( + const YawRate& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. + */ + eProsima_user_DllExport YawRate( + YawRate&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. + */ + eProsima_user_DllExport YawRate& operator =( + const YawRate& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRate that will be copied. + */ + eProsima_user_DllExport YawRate& operator =( + YawRate&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRate object to compare. + */ + eProsima_user_DllExport bool operator ==( + const YawRate& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRate object to compare. + */ + eProsima_user_DllExport bool operator !=( + const YawRate& x) const; + + /*! + * @brief This function copies the value in member yaw_rate_value + * @param _yaw_rate_value New value to be copied in member yaw_rate_value + */ + eProsima_user_DllExport void yaw_rate_value( + const etsi_its_cam_msgs::msg::YawRateValue& _yaw_rate_value); + + /*! + * @brief This function moves the value in member yaw_rate_value + * @param _yaw_rate_value New value to be moved in member yaw_rate_value + */ + eProsima_user_DllExport void yaw_rate_value( + etsi_its_cam_msgs::msg::YawRateValue&& _yaw_rate_value); + + /*! + * @brief This function returns a constant reference to member yaw_rate_value + * @return Constant reference to member yaw_rate_value + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRateValue& yaw_rate_value() const; + + /*! + * @brief This function returns a reference to member yaw_rate_value + * @return Reference to member yaw_rate_value + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRateValue& yaw_rate_value(); + + + /*! + * @brief This function copies the value in member yaw_rate_confidence + * @param _yaw_rate_confidence New value to be copied in member yaw_rate_confidence + */ + eProsima_user_DllExport void yaw_rate_confidence( + const etsi_its_cam_msgs::msg::YawRateConfidence& _yaw_rate_confidence); + + /*! + * @brief This function moves the value in member yaw_rate_confidence + * @param _yaw_rate_confidence New value to be moved in member yaw_rate_confidence + */ + eProsima_user_DllExport void yaw_rate_confidence( + etsi_its_cam_msgs::msg::YawRateConfidence&& _yaw_rate_confidence); + + /*! + * @brief This function returns a constant reference to member yaw_rate_confidence + * @return Constant reference to member yaw_rate_confidence + */ + eProsima_user_DllExport const etsi_its_cam_msgs::msg::YawRateConfidence& yaw_rate_confidence() const; + + /*! + * @brief This function returns a reference to member yaw_rate_confidence + * @return Reference to member yaw_rate_confidence + */ + eProsima_user_DllExport etsi_its_cam_msgs::msg::YawRateConfidence& yaw_rate_confidence(); + +private: + + etsi_its_cam_msgs::msg::YawRateValue m_yaw_rate_value; + etsi_its_cam_msgs::msg::YawRateConfidence m_yaw_rate_confidence; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateCdrAux.hpp new file mode 100644 index 00000000000..efe614ad20f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECDRAUX_HPP_ + +#include "YawRate.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_YawRate_max_cdr_typesize {17UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_YawRate_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRate& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateCdrAux.ipp new file mode 100644 index 00000000000..a6e474c91cd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECDRAUX_IPP_ + +#include "YawRateCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::YawRate& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.yaw_rate_value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.yaw_rate_confidence(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRate& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.yaw_rate_value() + << eprosima::fastcdr::MemberId(1) << data.yaw_rate_confidence() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::YawRate& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.yaw_rate_value(); + break; + + case 1: + dcdr >> data.yaw_rate_confidence(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRate& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.cxx index a6e6e176577..9b295341d88 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.cxx @@ -14,9 +14,9 @@ /*! * @file YawRateConfidence.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,123 +27,79 @@ char dummy; #endif // _WIN32 #include "YawRateConfidence.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace YawRateConfidence_Constants { +} // namespace YawRateConfidence_Constants - - - -etsi_its_cam_msgs::msg::YawRateConfidence::YawRateConfidence() +YawRateConfidence::YawRateConfidence() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@654c1a54 - m_value = 0; - } -etsi_its_cam_msgs::msg::YawRateConfidence::~YawRateConfidence() +YawRateConfidence::~YawRateConfidence() { } -etsi_its_cam_msgs::msg::YawRateConfidence::YawRateConfidence( +YawRateConfidence::YawRateConfidence( const YawRateConfidence& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::YawRateConfidence::YawRateConfidence( - YawRateConfidence&& x) +YawRateConfidence::YawRateConfidence( + YawRateConfidence&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRateConfidence::operator =( +YawRateConfidence& YawRateConfidence::operator =( const YawRateConfidence& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::YawRateConfidence& etsi_its_cam_msgs::msg::YawRateConfidence::operator =( - YawRateConfidence&& x) +YawRateConfidence& YawRateConfidence::operator =( + YawRateConfidence&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::YawRateConfidence::operator ==( +bool YawRateConfidence::operator ==( const YawRateConfidence& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::YawRateConfidence::operator !=( +bool YawRateConfidence::operator !=( const YawRateConfidence& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::YawRateConfidence::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::YawRateConfidence::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::YawRateConfidence& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::YawRateConfidence::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::YawRateConfidence::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::YawRateConfidence::value( +void YawRateConfidence::value( uint8_t _value) { m_value = _value; @@ -153,7 +109,7 @@ void etsi_its_cam_msgs::msg::YawRateConfidence::value( * @brief This function returns the value of member value * @return Value of member value */ -uint8_t etsi_its_cam_msgs::msg::YawRateConfidence::value() const +uint8_t YawRateConfidence::value() const { return m_value; } @@ -162,32 +118,18 @@ uint8_t etsi_its_cam_msgs::msg::YawRateConfidence::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -uint8_t& etsi_its_cam_msgs::msg::YawRateConfidence::value() +uint8_t& YawRateConfidence::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::YawRateConfidence::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} -bool etsi_its_cam_msgs::msg::YawRateConfidence::isKeyDefined() -{ - return false; -} +} // namespace msg -void etsi_its_cam_msgs::msg::YawRateConfidence::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "YawRateConfidenceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.h index 6f9b788e944..8aba07d1972 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidence.h @@ -16,19 +16,24 @@ * @file YawRateConfidence.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,180 +47,136 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(YawRateConfidence_SOURCE) -#define YawRateConfidence_DllAPI __declspec( dllexport ) +#if defined(YAWRATECONFIDENCE_SOURCE) +#define YAWRATECONFIDENCE_DllAPI __declspec( dllexport ) #else -#define YawRateConfidence_DllAPI __declspec( dllimport ) -#endif // YawRateConfidence_SOURCE +#define YAWRATECONFIDENCE_DllAPI __declspec( dllimport ) +#endif // YAWRATECONFIDENCE_SOURCE #else -#define YawRateConfidence_DllAPI +#define YAWRATECONFIDENCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define YawRateConfidence_DllAPI +#define YAWRATECONFIDENCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace YawRateConfidence_Constants { - const uint8_t DEG_SEC_000_01 = 0; - const uint8_t DEG_SEC_000_05 = 1; - const uint8_t DEG_SEC_000_10 = 2; - const uint8_t DEG_SEC_001_00 = 3; - const uint8_t DEG_SEC_005_00 = 4; - const uint8_t DEG_SEC_010_00 = 5; - const uint8_t DEG_SEC_100_00 = 6; - const uint8_t OUT_OF_RANGE = 7; - const uint8_t UNAVAILABLE = 8; - } // namespace YawRateConfidence_Constants - /*! - * @brief This class represents the structure YawRateConfidence defined by the user in the IDL file. - * @ingroup YAWRATECONFIDENCE - */ - class YawRateConfidence - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport YawRateConfidence(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~YawRateConfidence(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. - */ - eProsima_user_DllExport YawRateConfidence( - const YawRateConfidence& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. - */ - eProsima_user_DllExport YawRateConfidence( - YawRateConfidence&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. - */ - eProsima_user_DllExport YawRateConfidence& operator =( - const YawRateConfidence& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. - */ - eProsima_user_DllExport YawRateConfidence& operator =( - YawRateConfidence&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::YawRateConfidence object to compare. - */ - eProsima_user_DllExport bool operator ==( - const YawRateConfidence& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::YawRateConfidence object to compare. - */ - eProsima_user_DllExport bool operator !=( - const YawRateConfidence& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - uint8_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport uint8_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport uint8_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::YawRateConfidence& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - uint8_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace YawRateConfidence_Constants { + +const uint8_t DEG_SEC_000_01 = 0; +const uint8_t DEG_SEC_000_05 = 1; +const uint8_t DEG_SEC_000_10 = 2; +const uint8_t DEG_SEC_001_00 = 3; +const uint8_t DEG_SEC_005_00 = 4; +const uint8_t DEG_SEC_010_00 = 5; +const uint8_t DEG_SEC_100_00 = 6; +const uint8_t OUT_OF_RANGE = 7; +const uint8_t UNAVAILABLE = 8; + +} // namespace YawRateConfidence_Constants + + +/*! + * @brief This class represents the structure YawRateConfidence defined by the user in the IDL file. + * @ingroup YawRateConfidence + */ +class YawRateConfidence +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport YawRateConfidence(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~YawRateConfidence(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. + */ + eProsima_user_DllExport YawRateConfidence( + const YawRateConfidence& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. + */ + eProsima_user_DllExport YawRateConfidence( + YawRateConfidence&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. + */ + eProsima_user_DllExport YawRateConfidence& operator =( + const YawRateConfidence& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateConfidence that will be copied. + */ + eProsima_user_DllExport YawRateConfidence& operator =( + YawRateConfidence&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRateConfidence object to compare. + */ + eProsima_user_DllExport bool operator ==( + const YawRateConfidence& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRateConfidence object to compare. + */ + eProsima_user_DllExport bool operator !=( + const YawRateConfidence& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + uint8_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport uint8_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport uint8_t& value(); + +private: + + uint8_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidenceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidenceCdrAux.hpp new file mode 100644 index 00000000000..2468c875974 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidenceCdrAux.hpp @@ -0,0 +1,69 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateConfidenceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCECDRAUX_HPP_ + +#include "YawRateConfidence.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_YawRateConfidence_max_cdr_typesize {5UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_YawRateConfidence_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRateConfidence& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidenceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidenceCdrAux.ipp new file mode 100644 index 00000000000..de4730f7e16 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidenceCdrAux.ipp @@ -0,0 +1,149 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateConfidenceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCECDRAUX_IPP_ + +#include "YawRateConfidenceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::YawRateConfidence& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRateConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::YawRateConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRateConfidence& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.cxx index e987bf872ca..77ed48b5974 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.cxx @@ -16,173 +16,205 @@ * @file YawRateConfidencePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "YawRateConfidencePubSubTypes.h" +#include "YawRateConfidenceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace YawRateConfidence_Constants { - - - - - - - - - - - } //End of namespace YawRateConfidence_Constants - YawRateConfidencePubSubType::YawRateConfidencePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::YawRateConfidence_"); - auto type_size = YawRateConfidence::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = YawRateConfidence::isKeyDefined(); - size_t keyLength = YawRateConfidence::getKeyMaxCdrSerializedSize() > 16 ? - YawRateConfidence::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - YawRateConfidencePubSubType::~YawRateConfidencePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool YawRateConfidencePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - YawRateConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool YawRateConfidencePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - YawRateConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function YawRateConfidencePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* YawRateConfidencePubSubType::createData() - { - return reinterpret_cast(new YawRateConfidence()); - } - - void YawRateConfidencePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool YawRateConfidencePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - YawRateConfidence* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - YawRateConfidence::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || YawRateConfidence::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace YawRateConfidence_Constants { + + + + + + + + + + + + + + + + + + + +} //End of namespace YawRateConfidence_Constants + + + +YawRateConfidencePubSubType::YawRateConfidencePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::YawRateConfidence_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(YawRateConfidence::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_YawRateConfidence_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +YawRateConfidencePubSubType::~YawRateConfidencePubSubType() +{ +} + +bool YawRateConfidencePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + YawRateConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool YawRateConfidencePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + YawRateConfidence* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function YawRateConfidencePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* YawRateConfidencePubSubType::createData() +{ + return reinterpret_cast(new YawRateConfidence()); +} + +void YawRateConfidencePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool YawRateConfidencePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.h index cbf8227f0a6..082f55b2e46 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateConfidencePubSubTypes.h @@ -16,104 +16,140 @@ * @file YawRateConfidencePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "YawRateConfidence.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated YawRateConfidence is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace YawRateConfidence_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace YawRateConfidence_Constants { + + + + + + + + + + + + + +} // namespace YawRateConfidence_Constants +/*! + * @brief This class represents the TopicDataType of the type YawRateConfidence defined by the user in the IDL file. + * @ingroup YawRateConfidence + */ +class YawRateConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - } - /*! - * @brief This class represents the TopicDataType of the type YawRateConfidence defined by the user in the IDL file. - * @ingroup YAWRATECONFIDENCE - */ - class YawRateConfidencePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: + typedef YawRateConfidence type; - typedef YawRateConfidence type; + eProsima_user_DllExport YawRateConfidencePubSubType(); - eProsima_user_DllExport YawRateConfidencePubSubType(); + eProsima_user_DllExport ~YawRateConfidencePubSubType() override; - eProsima_user_DllExport virtual ~YawRateConfidencePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) YawRateConfidence(); - return true; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATECONFIDENCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.cxx index b0bca8db5da..33e82627d88 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file YawRatePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "YawRatePubSubTypes.h" +#include "YawRateCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - YawRatePubSubType::YawRatePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::YawRate_"); - auto type_size = YawRate::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = YawRate::isKeyDefined(); - size_t keyLength = YawRate::getKeyMaxCdrSerializedSize() > 16 ? - YawRate::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - YawRatePubSubType::~YawRatePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool YawRatePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - YawRate* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool YawRatePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - YawRate* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function YawRatePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* YawRatePubSubType::createData() - { - return reinterpret_cast(new YawRate()); - } - - void YawRatePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool YawRatePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - YawRate* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - YawRate::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || YawRate::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +YawRatePubSubType::YawRatePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::YawRate_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(YawRate::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_YawRate_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +YawRatePubSubType::~YawRatePubSubType() +{ +} + +bool YawRatePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + YawRate* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool YawRatePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + YawRate* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function YawRatePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* YawRatePubSubType::createData() +{ + return reinterpret_cast(new YawRate()); +} + +void YawRatePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool YawRatePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.h index 7f1e2ba702f..054388f6dde 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRatePubSubTypes.h @@ -16,92 +16,122 @@ * @file YawRatePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "YawRate.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "YawRateConfidencePubSubTypes.h" +#include "YawRateValuePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated YawRate is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs +namespace etsi_its_cam_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type YawRate defined by the user in the IDL file. + * @ingroup YawRate + */ +class YawRatePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type YawRate defined by the user in the IDL file. - * @ingroup YAWRATE - */ - class YawRatePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef YawRate type; + typedef YawRate type; - eProsima_user_DllExport YawRatePubSubType(); + eProsima_user_DllExport YawRatePubSubType(); - eProsima_user_DllExport virtual ~YawRatePubSubType(); + eProsima_user_DllExport ~YawRatePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) YawRate(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.cxx index d775473d2a2..45dbf8c2cd0 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.cxx @@ -14,9 +14,9 @@ /*! * @file YawRateValue.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,120 +27,79 @@ char dummy; #endif // _WIN32 #include "YawRateValue.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace etsi_its_cam_msgs { +namespace msg { +namespace YawRateValue_Constants { +} // namespace YawRateValue_Constants -etsi_its_cam_msgs::msg::YawRateValue::YawRateValue() +YawRateValue::YawRateValue() { - // m_value com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1adb7478 - m_value = 0; - } -etsi_its_cam_msgs::msg::YawRateValue::~YawRateValue() +YawRateValue::~YawRateValue() { } -etsi_its_cam_msgs::msg::YawRateValue::YawRateValue( +YawRateValue::YawRateValue( const YawRateValue& x) { m_value = x.m_value; } -etsi_its_cam_msgs::msg::YawRateValue::YawRateValue( - YawRateValue&& x) +YawRateValue::YawRateValue( + YawRateValue&& x) noexcept { m_value = x.m_value; } -etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRateValue::operator =( +YawRateValue& YawRateValue::operator =( const YawRateValue& x) { m_value = x.m_value; - return *this; } -etsi_its_cam_msgs::msg::YawRateValue& etsi_its_cam_msgs::msg::YawRateValue::operator =( - YawRateValue&& x) +YawRateValue& YawRateValue::operator =( + YawRateValue&& x) noexcept { m_value = x.m_value; - return *this; } -bool etsi_its_cam_msgs::msg::YawRateValue::operator ==( +bool YawRateValue::operator ==( const YawRateValue& x) const { - return (m_value == x.m_value); } -bool etsi_its_cam_msgs::msg::YawRateValue::operator !=( +bool YawRateValue::operator !=( const YawRateValue& x) const { return !(*this == x); } -size_t etsi_its_cam_msgs::msg::YawRateValue::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -size_t etsi_its_cam_msgs::msg::YawRateValue::getCdrSerializedSize( - const etsi_its_cam_msgs::msg::YawRateValue& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - -void etsi_its_cam_msgs::msg::YawRateValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_value; - -} - -void etsi_its_cam_msgs::msg::YawRateValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_value; -} - /*! * @brief This function sets a value in member value * @param _value New value for member value */ -void etsi_its_cam_msgs::msg::YawRateValue::value( +void YawRateValue::value( int16_t _value) { m_value = _value; @@ -150,7 +109,7 @@ void etsi_its_cam_msgs::msg::YawRateValue::value( * @brief This function returns the value of member value * @return Value of member value */ -int16_t etsi_its_cam_msgs::msg::YawRateValue::value() const +int16_t YawRateValue::value() const { return m_value; } @@ -159,32 +118,18 @@ int16_t etsi_its_cam_msgs::msg::YawRateValue::value() const * @brief This function returns a reference to member value * @return Reference to member value */ -int16_t& etsi_its_cam_msgs::msg::YawRateValue::value() +int16_t& YawRateValue::value() { return m_value; } -size_t etsi_its_cam_msgs::msg::YawRateValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool etsi_its_cam_msgs::msg::YawRateValue::isKeyDefined() -{ - return false; -} - -void etsi_its_cam_msgs::msg::YawRateValue::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace etsi_its_cam_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "YawRateValueCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.h index 52b3fbbcc9f..25c82b7b7fd 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValue.h @@ -16,19 +16,24 @@ * @file YawRateValue.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,177 +47,133 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(YawRateValue_SOURCE) -#define YawRateValue_DllAPI __declspec( dllexport ) +#if defined(YAWRATEVALUE_SOURCE) +#define YAWRATEVALUE_DllAPI __declspec( dllexport ) #else -#define YawRateValue_DllAPI __declspec( dllimport ) -#endif // YawRateValue_SOURCE +#define YAWRATEVALUE_DllAPI __declspec( dllimport ) +#endif // YAWRATEVALUE_SOURCE #else -#define YawRateValue_DllAPI +#define YAWRATEVALUE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define YawRateValue_DllAPI +#define YAWRATEVALUE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace etsi_its_cam_msgs { - namespace msg { - namespace YawRateValue_Constants { - const int16_t MIN = -32766; - const int16_t MAX = 32767; - const int16_t STRAIGHT = 0; - const int16_t DEG_SEC_000_01_TO_RIGHT = -1; - const int16_t DEG_SEC_000_01_TO_LEFT = 1; - const int16_t UNAVAILABLE = 32767; - } // namespace YawRateValue_Constants - /*! - * @brief This class represents the structure YawRateValue defined by the user in the IDL file. - * @ingroup YAWRATEVALUE - */ - class YawRateValue - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport YawRateValue(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~YawRateValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. - */ - eProsima_user_DllExport YawRateValue( - const YawRateValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. - */ - eProsima_user_DllExport YawRateValue( - YawRateValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. - */ - eProsima_user_DllExport YawRateValue& operator =( - const YawRateValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. - */ - eProsima_user_DllExport YawRateValue& operator =( - YawRateValue&& x); - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::YawRateValue object to compare. - */ - eProsima_user_DllExport bool operator ==( - const YawRateValue& x) const; - - /*! - * @brief Comparison operator. - * @param x etsi_its_cam_msgs::msg::YawRateValue object to compare. - */ - eProsima_user_DllExport bool operator !=( - const YawRateValue& x) const; - - /*! - * @brief This function sets a value in member value - * @param _value New value for member value - */ - eProsima_user_DllExport void value( - int16_t _value); - - /*! - * @brief This function returns the value of member value - * @return Value of member value - */ - eProsima_user_DllExport int16_t value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport int16_t& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const etsi_its_cam_msgs::msg::YawRateValue& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - int16_t m_value; - }; - } // namespace msg + +namespace msg { + +namespace YawRateValue_Constants { + +const int16_t MIN = -32766; +const int16_t MAX = 32767; +const int16_t STRAIGHT = 0; +const int16_t DEG_SEC_000_01_TO_RIGHT = -1; +const int16_t DEG_SEC_000_01_TO_LEFT = 1; +const int16_t UNAVAILABLE = 32767; + +} // namespace YawRateValue_Constants + + +/*! + * @brief This class represents the structure YawRateValue defined by the user in the IDL file. + * @ingroup YawRateValue + */ +class YawRateValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport YawRateValue(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~YawRateValue(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. + */ + eProsima_user_DllExport YawRateValue( + const YawRateValue& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. + */ + eProsima_user_DllExport YawRateValue( + YawRateValue&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. + */ + eProsima_user_DllExport YawRateValue& operator =( + const YawRateValue& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object etsi_its_cam_msgs::msg::YawRateValue that will be copied. + */ + eProsima_user_DllExport YawRateValue& operator =( + YawRateValue&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRateValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const YawRateValue& x) const; + + /*! + * @brief Comparison operator. + * @param x etsi_its_cam_msgs::msg::YawRateValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const YawRateValue& x) const; + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int16_t _value); + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int16_t value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int16_t& value(); + +private: + + int16_t m_value{0}; + +}; + +} // namespace msg + } // namespace etsi_its_cam_msgs -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValueCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValueCdrAux.hpp new file mode 100644 index 00000000000..61477dfda86 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValueCdrAux.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateValueCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUECDRAUX_HPP_ + +#include "YawRateValue.h" + +constexpr uint32_t etsi_its_cam_msgs_msg_YawRateValue_max_cdr_typesize {6UL}; +constexpr uint32_t etsi_its_cam_msgs_msg_YawRateValue_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRateValue& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValueCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValueCdrAux.ipp new file mode 100644 index 00000000000..57bdfb4c0bf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValueCdrAux.ipp @@ -0,0 +1,143 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file YawRateValueCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUECDRAUX_IPP_ + +#include "YawRateValueCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const etsi_its_cam_msgs::msg::YawRateValue& data, + size_t& current_alignment) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRateValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + etsi_its_cam_msgs::msg::YawRateValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const etsi_its_cam_msgs::msg::YawRateValue& data) +{ + using namespace etsi_its_cam_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.cxx index 9769e0d6495..c30e3a24526 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.cxx @@ -16,170 +16,199 @@ * @file YawRateValuePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "YawRateValuePubSubTypes.h" +#include "YawRateValueCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace etsi_its_cam_msgs { - namespace msg { - namespace YawRateValue_Constants { - - - - - - - - } //End of namespace YawRateValue_Constants - YawRateValuePubSubType::YawRateValuePubSubType() - { - setName("etsi_its_cam_msgs::msg::dds_::YawRateValue_"); - auto type_size = YawRateValue::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = YawRateValue::isKeyDefined(); - size_t keyLength = YawRateValue::getKeyMaxCdrSerializedSize() > 16 ? - YawRateValue::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - YawRateValuePubSubType::~YawRateValuePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool YawRateValuePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - YawRateValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool YawRateValuePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - YawRateValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function YawRateValuePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* YawRateValuePubSubType::createData() - { - return reinterpret_cast(new YawRateValue()); - } - - void YawRateValuePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool YawRateValuePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - YawRateValue* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - YawRateValue::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || YawRateValue::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { +namespace YawRateValue_Constants { + + + + + + + + + + + + + +} //End of namespace YawRateValue_Constants + + + +YawRateValuePubSubType::YawRateValuePubSubType() +{ + setName("etsi_its_cam_msgs::msg::dds_::YawRateValue_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(YawRateValue::getMaxCdrSerializedSize()); +#else + etsi_its_cam_msgs_msg_YawRateValue_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +YawRateValuePubSubType::~YawRateValuePubSubType() +{ +} + +bool YawRateValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + YawRateValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool YawRateValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + YawRateValue* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function YawRateValuePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* YawRateValuePubSubType::createData() +{ + return reinterpret_cast(new YawRateValue()); +} + +void YawRateValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool YawRateValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace etsi_its_cam_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.h index 54504cc5def..63c3bea4047 100644 --- a/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/etsi_its_cam_msgs/msg/YawRateValuePubSubTypes.h @@ -16,101 +16,134 @@ * @file YawRateValuePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "YawRateValue.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated YawRateValue is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace etsi_its_cam_msgs -{ - namespace msg - { - namespace YawRateValue_Constants - { +namespace etsi_its_cam_msgs { +namespace msg { +namespace YawRateValue_Constants { - } - /*! - * @brief This class represents the TopicDataType of the type YawRateValue defined by the user in the IDL file. - * @ingroup YAWRATEVALUE - */ - class YawRateValuePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - typedef YawRateValue type; - eProsima_user_DllExport YawRateValuePubSubType(); - eProsima_user_DllExport virtual ~YawRateValuePubSubType(); - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; +} // namespace YawRateValue_Constants - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; +/*! + * @brief This class represents the TopicDataType of the type YawRateValue defined by the user in the IDL file. + * @ingroup YawRateValue + */ +class YawRateValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + typedef YawRateValue type; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport YawRateValuePubSubType(); - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } + eProsima_user_DllExport ~YawRateValuePubSubType() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) YawRateValue(); - return true; - } + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - MD5 m_md5; - unsigned char* m_keyBuffer; - }; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); } -} -#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_PUBSUBTYPES_H_ \ No newline at end of file + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace etsi_its_cam_msgs + +#endif // _FAST_DDS_GENERATED_ETSI_ITS_CAM_MSGS_MSG_YAWRATEVALUE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/fastcdr/Cdr.h b/LibCarla/source/carla/ros2/fastdds/fastcdr/Cdr.h index f9e2d9e52f3..6aa131b1ab5 100644 --- a/LibCarla/source/carla/ros2/fastdds/fastcdr/Cdr.h +++ b/LibCarla/source/carla/ros2/fastdds/fastcdr/Cdr.h @@ -15,3051 +15,3540 @@ #ifndef _FASTCDR_CDR_H_ #define _FASTCDR_CDR_H_ -#include -#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include #include -#include "fastcdr/FastBuffer.h" -#include "fastcdr/exceptions/NotEnoughMemoryException.h" + #include "fastcdr/fastcdr_dll.h" +#include "fastcdr/CdrEncoding.hpp" +#include "fastcdr/cdr/fixed_size_string.hpp" +#include "fastcdr/detail/container_recursive_inspector.hpp" +#include "fastcdr/exceptions/BadParamException.h" +#include "fastcdr/exceptions/Exception.h" +#include "fastcdr/exceptions/NotEnoughMemoryException.h" +#include "fastcdr/FastBuffer.h" +#include "fastcdr/xcdr/external.hpp" +#include "fastcdr/xcdr/MemberId.hpp" +#include "fastcdr/xcdr/optional.hpp" + #if !__APPLE__ && !__FreeBSD__ && !__VXWORKS__ #include #else #include -#endif // if !__APPLE__ && !__FreeBSD__ && !__VXWORKS__ - -#include +#endif // if !__APPLE__ && !__FreeBSD__ && !__VXWORKS__ namespace eprosima { namespace fastcdr { + +class Cdr; + +template +extern void serialize( + Cdr&, + const _T&); + +template +extern void deserialize( + Cdr&, + _T&); + /*! - * @brief This class offers an interface to serialize/deserialize some basic types using CDR protocol inside an - * eprosima::fastcdr::FastBuffer. + * @brief This class offers an interface to serialize/deserialize some basic types using CDR protocol inside an eprosima::fastcdr::FastBuffer. * @ingroup FASTCDRAPIREFERENCE */ -class Cdr_DllAPI Cdr { +class Cdr +{ public: - //! @brief This enumeration represents the two kinds of CDR serialization supported by eprosima::fastcdr::CDR. - typedef enum { - //! @brief Common CORBA CDR serialization. - CORBA_CDR, - //! @brief DDS CDR serialization. - DDS_CDR - } CdrType; - - //! @brief This enumeration represents the two posible values of the flag that points if the content is a parameter - //! list (only in DDS CDR). - - typedef enum : uint8_t { - //! @brief Specifies that the content is not a parameter list. - DDS_CDR_WITHOUT_PL = 0x0, - //! @brief Specifies that the content is a parameter list. - DDS_CDR_WITH_PL = 0x2 - } DDSCdrPlFlag; - - /*! - * @brief This enumeration represents endianness types. - */ - typedef enum : uint8_t { - //! @brief Big endianness. - BIG_ENDIANNESS = 0x0, - //! @brief Little endianness. - LITTLE_ENDIANNESS = 0x1 - } Endianness; - - //! @brief Default endiness in the system. - static const Endianness DEFAULT_ENDIAN; - - /*! - * @brief This class stores the current state of a CDR serialization. - */ - class Cdr_DllAPI state { - friend class Cdr; - - public: - /*! - * @brief Default constructor. - */ - state(const Cdr& cdr); - - /*! - * @brief Copy constructor. - */ - state(const state&); - - private: - state& operator=(const state&) = delete; - - //! @brief The position in the buffer when the state was created. - const FastBuffer::iterator m_currentPosition; - - //! @brief The position from the aligment is calculated, when the state was created.. - const FastBuffer::iterator m_alignPosition; - - //! @brief This attribute specified if it is needed to swap the bytes when the state was created.. - bool m_swapBytes; - - //! @brief Stores the last datasize serialized/deserialized when the state was created. - size_t m_lastDataSize; - }; - - /*! - * @brief This constructor creates an eprosima::fastcdr::Cdr object that can serialize/deserialize - * the assigned buffer. - * - * @param cdrBuffer A reference to the buffer that contains (or will contain) the CDR representation. - * @param endianness The initial endianness that will be used. The default value is the endianness of the system. - * @param cdrType Represents the type of CDR that will be used in serialization/deserialization. The default value is - * CORBA CDR. - */ - Cdr(FastBuffer& cdrBuffer, const Endianness endianness = DEFAULT_ENDIAN, const CdrType cdrType = CORBA_CDR); - - /*! - * @brief This function reads the encapsulation of the CDR stream. - * If the CDR stream contains an encapsulation, then this function should be called before starting to - * deserialize. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. - */ - Cdr& read_encapsulation(); - - /*! - * @brief This function writes the encapsulation of the CDR stream. - * If the CDR stream should contain an encapsulation, then this function should be called before starting to - * serialize. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize_encapsulation(); - - /*! - * @brief This function returns the parameter list flag when the CDR type is eprosima::fastcdr::DDS_CDR. - * @return The flag that specifies if the content is a parameter list. - */ - DDSCdrPlFlag getDDSCdrPlFlag() const; - - /*! - * @brief This function sets the parameter list flag when the CDR type is eprosima::fastcdr::DDS_CDR. - * @param plFlag New value for the flag that specifies if the content is a parameter list. - */ - void setDDSCdrPlFlag(DDSCdrPlFlag plFlag); - - /*! - * @brief This function returns the option flags when the CDR type is eprosima::fastcdr::DDS_CDR. - * @return The option flags. - */ - uint16_t getDDSCdrOptions() const; - - /*! - * @brief This function sets the option flags when the CDR type is eprosima::fastcdr::DDS_CDR. - * @param options New value for the option flags. - */ - void setDDSCdrOptions(uint16_t options); - - /*! - * @brief This function sets the current endianness used by the CDR type. - * @param endianness The new endianness value. - */ - void changeEndianness(Endianness endianness); - - /*! - * @brief This function returns the current endianness used by the CDR type. - * @return The endianness. - */ - Endianness endianness() const { - return static_cast(m_endianness); - } - - /*! - * @brief This function skips a number of bytes in the CDR stream buffer. - * @param numBytes The number of bytes that will be jumped. - * @return True is returned when it works successfully. Otherwise, false is returned. - */ - bool jump(size_t numBytes); - - /*! - * @brief This function resets the current position in the buffer to the beginning. - */ - void reset(); - - /*! - * @brief This function returns the pointer to the current used buffer. - * @return Pointer to the starting position of the buffer. - */ - char* getBufferPointer(); - - /*! - * @brief This function returns the current position in the CDR stream. - * @return Pointer to the current position in the buffer. - */ - char* getCurrentPosition(); - - /*! - * @brief This function returns the length of the serialized data inside the stream. - * @return The length of the serialized data. - */ - inline size_t getSerializedDataLength() const { - return m_currentPosition - m_cdrBuffer.begin(); - } - - /*! - * @brief Get the number of bytes needed to align a position to certain data size. - * @param current_alignment Position to be aligned. - * @param dataSize Size of next data to process (should be power of two). - * @return Number of required alignment bytes. - */ - inline static size_t alignment(size_t current_alignment, size_t dataSize) { - return (dataSize - (current_alignment % dataSize)) & (dataSize - 1); - } - - /*! - * @brief This function returns the current state of the CDR serialization process. - * @return The current state of the CDR serialization process. - */ - state getState(); - - /*! - * @brief This function sets a previous state of the CDR serialization process; - * @param state Previous state that will be set. - */ - void setState(state& state); - - /*! - * @brief This function moves the alignment forward. - * @param numBytes The number of bytes the alignment should advance. - * @return True If alignment was moved successfully. - */ - bool moveAlignmentForward(size_t numBytes); - - /*! - * @brief This function resets the alignment to the current position in the buffer. - */ - inline void resetAlignment() { - m_alignPosition = m_currentPosition; - } - - /*! - * @brief This operator serializes an octet. - * @param octet_t The value of the octet that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const uint8_t octet_t) { - return serialize(octet_t); - } - - /*! - * @brief This operator serializes a character. - * @param char_t The value of the character that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const char char_t) { - return serialize(char_t); - } - - /*! - * @brief This operator serializes a int8_t. - * @param int8 The value of the int8_t that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const int8_t int8) { - return serialize(int8); - } - - /*! - * @brief This operator serializes an unsigned short. - * @param ushort_t The value of the unsigned short that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const uint16_t ushort_t) { - return serialize(ushort_t); - } - - /*! - * @brief This operator serializes a short. - * @param short_t The value of the short that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const int16_t short_t) { - return serialize(short_t); - } - - /*! - * @brief This operator serializes an unsigned long. - * @param ulong_t The value of the unsigned long that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const uint32_t ulong_t) { - return serialize(ulong_t); - } - - /*! - * @brief This operator serializes a long. - * @param long_t The value of the long that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const int32_t long_t) { - return serialize(long_t); - } - - /*! - * @brief This operator serializes a wide-char. - * @param wchar The value of the wide-char that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const wchar_t wchar) { - return serialize(wchar); - } - - /*! - * @brief This operator serializes an unsigned long long. - * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const uint64_t ulonglong_t) { - return serialize(ulonglong_t); - } - - /*! - * @brief This operator serializes a long long. - * @param longlong_t The value of the long long that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const int64_t longlong_t) { - return serialize(longlong_t); - } - - /*! - * @brief This operator serializes a float. - * @param float_t The value of the float that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const float float_t) { - return serialize(float_t); - } - - /*! - * @brief This operator serializes a double. - * @param double_t The value of the double that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const double double_t) { - return serialize(double_t); - } - - /*! - * @brief This operator serializes a long double. - * @param ldouble_t The value of the long double that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const long double ldouble_t) { - return serialize(ldouble_t); - } - - /*! - * @brief This operator serializes a boolean. - * @param bool_t The value of the boolean that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const bool bool_t) { - return serialize(bool_t); - } - - /*! - * @brief This operator serializes a null-terminated c-string. - * @param string_t Pointer to the begining of the string that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const char* string_t) { - return serialize(string_t); - } - - /*! - * @brief This operator serializes a null-terminated c-string. - * @param string_t Pointer to the begining of the string that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(char* string_t) { - return serialize(string_t); - } - - /*! - * @brief This operator serializes a string. - * @param string_t The string that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const std::string& string_t) { - return serialize(string_t); - } - - /*! - * @brief This operator serializes a wstring. - * @param string_t The wstring that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator<<(const std::wstring& string_t) { - return serialize(string_t); - } - - /*! - * @brief This operator template is used to serialize arrays. - * @param array_t The array that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& operator<<(const std::array<_T, _Size>& array_t) { - return serialize<_T, _Size>(array_t); - } - - /*! - * @brief This operator template is used to serialize sequences. - * @param vector_t The sequence that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& operator<<(const std::vector<_T, _Alloc>& vector_t) { - return serialize<_T>(vector_t); - } - - /*! - * @brief This operator template is used to serialize maps. - * @param map_t The map that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& operator<<(const std::map<_K, _T>& map_t) { - return serialize<_K, _T>(map_t); - } - - /*! - * @brief This operator template is used to serialize any other non-basic type. - * @param type_t A reference to the object that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& operator<<(const _T& type_t) { - type_t.serialize(*this); - return *this; - } - - /*! - * @brief This operator deserializes an octet. - * @param octet_t The variable that will store the octet read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(uint8_t& octet_t) { - return deserialize(octet_t); - } - - /*! - * @brief This operator deserializes a character. - * @param char_t The variable that will store the character read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(char& char_t) { - return deserialize(char_t); - } - - /*! - * @brief This operator deserializes a int8_t. - * @param int8 The variable that will store the int8_t read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(int8_t& int8) { - return deserialize(int8); - } - - /*! - * @brief This operator deserializes an unsigned short. - * @param ushort_t The variable that will store the unsigned short read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(uint16_t& ushort_t) { - return deserialize(ushort_t); - } - - /*! - * @brief This operator deserializes a short. - * @param short_t The variable that will store the short read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(int16_t& short_t) { - return deserialize(short_t); - } - - /*! - * @brief This operator deserializes an unsigned long. - * @param ulong_t The variable that will store the unsigned long read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(uint32_t& ulong_t) { - return deserialize(ulong_t); - } - - /*! - * @brief This operator deserializes a long. - * @param long_t The variable that will store the long read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(int32_t& long_t) { - return deserialize(long_t); - } - - // TODO in FastCdr - /*! - * @brief This operator deserializes a wide-char. - * @param wchar The variable that will store the wide-char read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(wchar_t& wchar) { - return deserialize(wchar); - } - - /*! - * @brief This operator deserializes a unsigned long long. - * @param ulonglong_t The variable that will store the unsigned long long read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(uint64_t& ulonglong_t) { - return deserialize(ulonglong_t); - } - - /*! - * @brief This operator deserializes a long long. - * @param longlong_t The variable that will store the long long read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(int64_t& longlong_t) { - return deserialize(longlong_t); - } - - /*! - * @brief This operator deserializes a float. - * @param float_t The variable that will store the float read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(float& float_t) { - return deserialize(float_t); - } - - /*! - * @brief This operator deserializes a double. - * @param double_t The variable that will store the double read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(double& double_t) { - return deserialize(double_t); - } - - /*! - * @brief This operator deserializes a long double. - * @param ldouble_t The variable that will store the long double read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(long double& ldouble_t) { - return deserialize(ldouble_t); - } - - /*! - * @brief This operator deserializes a boolean. - * @param bool_t The variable that will store the boolean read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. - */ - inline Cdr& operator>>(bool& bool_t) { - return deserialize(bool_t); - } - - /*! - * @brief This operator deserializes a null-terminated c-string. - * @param string_t The variable that will store the c-string read from the buffer. - * Please note that a newly allocated string will be returned. - * The caller should free the returned pointer when appropiate. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. - */ - inline Cdr& operator>>(char*& string_t) { - return deserialize(string_t); - } - - /*! - * @brief This operator deserializes a string. - * @param string_t The variable that will store the string read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(std::string& string_t) { - return deserialize(string_t); - } - - /*! - * @brief This operator deserializes a string. - * @param string_t The variable that will store the string read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& operator>>(std::wstring& string_t) { - return deserialize(string_t); - } - - /*! - * @brief This operator template is used to deserialize arrays. - * @param array_t The variable that will store the array read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& operator>>(std::array<_T, _Size>& array_t) { - return deserialize<_T, _Size>(array_t); - } - - /*! - * @brief This operator template is used to deserialize sequences. - * @param vector_t The variable that will store the sequence read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& operator>>(std::vector<_T, _Alloc>& vector_t) { - return deserialize<_T>(vector_t); - } - - /*! - * @brief This operator template is used to deserialize maps. - * @param map_t The variable that will store the map read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& operator>>(std::map<_K, _T>& map_t) { - return deserialize<_K, _T>(map_t); - } - - /*! - * @brief This operator template is used to deserialize any other non-basic type. - * @param type_t The variable that will store the object read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& operator>>(_T& type_t) { - type_t.deserialize(*this); - return *this; - } - - /*! - * @brief This function serializes an octet. - * @param octet_t The value of the octet that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const uint8_t octet_t) { - return serialize(static_cast(octet_t)); - } - - /*! - * @brief This function serializes an octet with a different endianness. - * @param octet_t The value of the octet that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const uint8_t octet_t, Endianness endianness) { - return serialize(static_cast(octet_t), endianness); - } - - /*! - * @brief This function serializes a character. - * @param char_t The value of the character that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const char char_t); - - /*! - * @brief This function serializes a character with a different endianness. - * @param char_t The value of the character that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const char char_t, Endianness endianness) { - (void)endianness; - return serialize(char_t); - } - - /*! - * @brief This function serializes an int8_t. - * @param int8 The value of the int8_t that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const int8_t int8) { - return serialize(static_cast(int8)); - } - - /*! - * @brief This function serializes an int8_t with a different endianness. - * @param int8 The value of the int8_t that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const int8_t int8, Endianness endianness) { - return serialize(static_cast(int8), endianness); - } - - /*! - * @brief This function serializes an unsigned short. - * @param ushort_t The value of the unsigned short that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const uint16_t ushort_t) { - return serialize(static_cast(ushort_t)); - } - - /*! - * @brief This function serializes an unsigned short with a different endianness. - * @param ushort_t The value of the unsigned short that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const uint16_t ushort_t, Endianness endianness) { - return serialize(static_cast(ushort_t), endianness); - } - - /*! - * @brief This function serializes a short. - * @param short_t The value of the short that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const int16_t short_t); - - /*! - * @brief This function serializes a short with a different endianness. - * @param short_t The value of the short that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const int16_t short_t, Endianness endianness); - - /*! - * @brief This function serializes an unsigned long. - * @param ulong_t The value of the unsigned long that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const uint32_t ulong_t) { - return serialize(static_cast(ulong_t)); - } - - /*! - * @brief This function serializes an unsigned long with a different endianness. - * @param ulong_t The value of the unsigned long that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const uint32_t ulong_t, Endianness endianness) { - return serialize(static_cast(ulong_t), endianness); - } - - /*! - * @brief This function serializes a long. - * @param long_t The value of the long that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const int32_t long_t); - - /*! - * @brief This function serializes a long with a different endianness. - * @param long_t The value of the long that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const int32_t long_t, Endianness endianness); - - /*! - * @brief This function serializes a wide-char. - * @param wchar The value of the wide-char that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const wchar_t wchar) { - return serialize(static_cast(wchar)); - } - - /*! - * @brief This function serializes a wide-char with a different endianness. - * @param wchar The value of the wide-char that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const wchar_t wchar, Endianness endianness) { - return serialize(static_cast(wchar), endianness); - } - - /*! - * @brief This function serializes an unsigned long long. - * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const uint64_t ulonglong_t) { - return serialize(static_cast(ulonglong_t)); - } - - /*! - * @brief This function serializes an unsigned long long with a different endianness. - * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const uint64_t ulonglong_t, Endianness endianness) { - return serialize(static_cast(ulonglong_t), endianness); - } - - /*! - * @brief This function serializes a long long. - * @param longlong_t The value of the long long that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const int64_t longlong_t); - - /*! - * @brief This function serializes a long long with a different endianness. - * @param longlong_t The value of the long long that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const int64_t longlong_t, Endianness endianness); - - /*! - * @brief This function serializes a float. - * @param float_t The value of the float that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const float float_t); - - /*! - * @brief This function serializes a float with a different endianness. - * @param float_t The value of the float that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const float float_t, Endianness endianness); - - /*! - * @brief This function serializes a double. - * @param double_t The value of the double that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const double double_t); - - /*! - * @brief This function serializes a double with a different endianness. - * @param double_t The value of the double that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const double double_t, Endianness endianness); - - /*! - * @brief This function serializes a long double. - * @param ldouble_t The value of the long double that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. - */ - Cdr& serialize(const long double ldouble_t); - - /*! - * @brief This function serializes a long double with a different endianness. - * @param ldouble_t The value of the long double that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. - */ - Cdr& serialize(const long double ldouble_t, Endianness endianness); - - /*! - * @brief This function serializes a boolean. - * @param bool_t The value of the boolean that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const bool bool_t); - - /*! - * @brief This function serializes a boolean with a different endianness. - * @param bool_t The value of the boolean that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const bool bool_t, Endianness endianness) { - (void)endianness; - return serialize(bool_t); - } - - /*! - * @brief This function serializes a string. - * @param string_t The pointer to the string that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(char* string_t) { - return serialize(static_cast(string_t)); - } - - /*! - * @brief This function serializes a string. - * @param string_t The pointer to the string that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const char* string_t); - - /*! - * @brief This function serializes a wstring. - * @param string_t The pointer to the wstring that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const wchar_t* string_t); - - /*! - * @brief This function serializes a string with a different endianness. - * @param string_t The pointer to the string that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const char* string_t, Endianness endianness); - - /*! - * @brief This function serializes a wstring with a different endianness. - * @param string_t The pointer to the wstring that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serialize(const wchar_t* string_t, Endianness endianness); - - /*! - * @brief This function serializes a std::string. - * @param string_t The string that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const std::string& string_t) { - return serialize(string_t.c_str()); - } - - /*! - * @brief This function serializes a std::wstring. - * @param string_t The wstring that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const std::wstring& string_t) { - return serialize(string_t.c_str()); - } - - /*! - * @brief This function serializes a std::string with a different endianness. - * @param string_t The string that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serialize(const std::string& string_t, Endianness endianness) { - return serialize(string_t.c_str(), endianness); - } - - /*! - * @brief This function template serializes an array. - * @param array_t The array that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& serialize(const std::array<_T, _Size>& array_t) { - return serializeArray(array_t.data(), array_t.size()); - } - - /*! - * @brief This function template serializes an array with a different endianness. - * @param array_t The array that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& serialize(const std::array<_T, _Size>& array_t, Endianness endianness) { - return serializeArray(array_t.data(), array_t.size(), endianness); - } - - /*! - * @brief This function template serializes a sequence of booleans. - * @param vector_t The sequence that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serialize(const std::vector& vector_t) { - return serializeBoolSequence(vector_t); - } - - /*! - * @brief This function template serializes a sequence. - * @param vector_t The sequence that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serialize(const std::vector<_T, _Alloc>& vector_t) { - state state_before_error(*this); - - *this << static_cast(vector_t.size()); - - try { - return serializeArray(vector_t.data(), vector_t.size()); - } catch (eprosima::fastcdr::exception::Exception& ex) { - setState(state_before_error); - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template serializes a map. - * @param map_t The map that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serialize(const std::map<_K, _T>& map_t) { - state state_(*this); - - *this << static_cast(map_t.size()); - - try { - for (auto it_pair = map_t.begin(); it_pair != map_t.end(); ++it_pair) { - *this << it_pair->first; - *this << it_pair->second; - } - // return serializeArray(map_t.data(), map_t.size()); - } catch (eprosima::fastcdr::exception::Exception& ex) { - setState(state_); - ex.raise(); - } - - return *this; - } - -#ifdef _MSC_VER - /*! - * @brief This function template serializes a sequence of booleans. - * @param vector_t The sequence that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template <> - Cdr& serialize(const std::vector& vector_t) { - return serializeBoolSequence(vector_t); - } - -#endif // ifdef _MSC_VER - - /*! - * @brief This function template serializes a sequence with a different endianness. - * @param vector_t The sequence that will be serialized in the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serialize(const std::vector<_T, _Alloc>& vector_t, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - serialize(vector_t); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template serializes a non-basic object. - * @param type_t The object that will be serialized in the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& serialize(const _T& type_t) { - type_t.serialize(*this); - return *this; - } - - /*! - * @brief This function serializes an array of octets. - * @param octet_t The sequence of octets that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const uint8_t* octet_t, size_t numElements) { - return serializeArray(reinterpret_cast(octet_t), numElements); - } - - /*! - * @brief This function serializes an array of octets with a different endianness. - * @param octet_t The array of octets that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const uint8_t* octet_t, size_t numElements, Endianness endianness) { - (void)endianness; - return serializeArray(reinterpret_cast(octet_t), numElements); - } - - /*! - * @brief This function serializes an array of characters. - * @param char_t The array of characters that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const char* char_t, size_t numElements); - - /*! - * @brief This function serializes an array of characters with a different endianness. - * @param char_t The array of characters that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const char* char_t, size_t numElements, Endianness endianness) { - (void)endianness; - return serializeArray(char_t, numElements); - } - - /*! - * @brief This function serializes an array of int8_t. - * @param int8 The sequence of int8_t that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const int8_t* int8, size_t numElements) { - return serializeArray(reinterpret_cast(int8), numElements); - } - - /*! - * @brief This function serializes an array of int8_t with a different endianness. - * @param int8 The array of int8_t that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const int8_t* int8, size_t numElements, Endianness endianness) { - (void)endianness; - return serializeArray(reinterpret_cast(int8), numElements); - } - - /*! - * @brief This function serializes an array of unsigned shorts. - * @param ushort_t The array of unsigned shorts that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const uint16_t* ushort_t, size_t numElements) { - return serializeArray(reinterpret_cast(ushort_t), numElements); - } - - /*! - * @brief This function serializes an array of unsigned shorts with a different endianness. - * @param ushort_t The array of unsigned shorts that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const uint16_t* ushort_t, size_t numElements, Endianness endianness) { - return serializeArray(reinterpret_cast(ushort_t), numElements, endianness); - } - - /*! - * @brief This function serializes an array of shorts. - * @param short_t The array of shorts that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const int16_t* short_t, size_t numElements); - - /*! - * @brief This function serializes an array of shorts with a different endianness. - * @param short_t The array of shorts that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const int16_t* short_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function serializes an array of unsigned longs. - * @param ulong_t The array of unsigned longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const uint32_t* ulong_t, size_t numElements) { - return serializeArray(reinterpret_cast(ulong_t), numElements); - } - - /*! - * @brief This function serializes an array of unsigned longs with a different endianness. - * @param ulong_t The array of unsigned longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const uint32_t* ulong_t, size_t numElements, Endianness endianness) { - return serializeArray(reinterpret_cast(ulong_t), numElements, endianness); - } - - /*! - * @brief This function serializes an array of longs. - * @param long_t The array of longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const int32_t* long_t, size_t numElements); - - /*! - * @brief This function serializes an array of longs with a different endianness. - * @param long_t The array of longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const int32_t* long_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function serializes an array of wide-chars. - * @param wchar The array of wide-chars that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const wchar_t* wchar, size_t numElements); - - /*! - * @brief This function serializes an array of wide-chars with a different endianness. - * @param wchar The array of longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const wchar_t* wchar, size_t numElements, Endianness endianness); - - /*! - * @brief This function serializes an array of unsigned long longs. - * @param ulonglong_t The array of unsigned long longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const uint64_t* ulonglong_t, size_t numElements) { - return serializeArray(reinterpret_cast(ulonglong_t), numElements); - } - - /*! - * @brief This function serializes an array of unsigned long longs with a different endianness. - * @param ulonglong_t The array of unsigned long longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const uint64_t* ulonglong_t, size_t numElements, Endianness endianness) { - return serializeArray(reinterpret_cast(ulonglong_t), numElements, endianness); - } - - /*! - * @brief This function serializes an array of long longs. - * @param longlong_t The array of long longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const int64_t* longlong_t, size_t numElements); - - /*! - * @brief This function serializes an array of long longs with a different endianness. - * @param longlong_t The array of long longs that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const int64_t* longlong_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function serializes an array of floats. - * @param float_t The array of floats that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const float* float_t, size_t numElements); - - /*! - * @brief This function serializes an array of floats with a different endianness. - * @param float_t The array of floats that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const float* float_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function serializes an array of doubles. - * @param double_t The array of doubles that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const double* double_t, size_t numElements); - - /*! - * @brief This function serializes an array of doubles with a different endianness. - * @param double_t The array of doubles that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const double* double_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function serializes an array of long doubles. - * @param ldouble_t The array of long doubles that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const long double* ldouble_t, size_t numElements); - - /*! - * @brief This function serializes an array of long doubles with a different endianness. - * @param ldouble_t The array of long doubles that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const long double* ldouble_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function serializes an array of booleans. - * @param bool_t The array of booleans that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - Cdr& serializeArray(const bool* bool_t, size_t numElements); - - /*! - * @brief This function serializes an array of booleans with a different endianness. - * @param bool_t The array of booleans that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const bool* bool_t, size_t numElements, Endianness endianness) { - (void)endianness; - return serializeArray(bool_t, numElements); - } - - /*! - * @brief This function serializes an array of strings. - * @param string_t The array of strings that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const std::string* string_t, size_t numElements) { - for (size_t count = 0; count < numElements; ++count) { - serialize(string_t[count].c_str()); - } - return *this; - } - - /*! - * @brief This function serializes an array of wide-strings. - * @param string_t The array of wide-strings that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const std::wstring* string_t, size_t numElements) { - for (size_t count = 0; count < numElements; ++count) { - serialize(string_t[count].c_str()); - } - return *this; - } - - /*! - * @brief This function serializes an array of strings with a different endianness. - * @param string_t The array of strings that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const std::string* string_t, size_t numElements, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - serializeArray(string_t, numElements); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function serializes an array of wide-strings with a different endianness. - * @param string_t The array of wide-strings that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - inline Cdr& serializeArray(const std::wstring* string_t, size_t numElements, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - serializeArray(string_t, numElements); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template serializes an array of sequences of objects. - * @param vector_t The array of sequences of objects that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serializeArray(const std::vector<_T, _Alloc>* vector_t, size_t numElements) { - for (size_t count = 0; count < numElements; ++count) { - serialize(vector_t[count]); - } - return *this; - } - - /*! - * @brief This function template serializes an array of non-basic objects. - * @param type_t The array of objects that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serializeArray(const _T* type_t, size_t numElements) { - for (size_t count = 0; count < numElements; ++count) { - type_t[count].serialize(*this); - } - return *this; - } - - /*! - * @brief This function template serializes an array of non-basic objects with a different endianness. - * @param type_t The array of objects that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serializeArray(const _T* type_t, size_t numElements, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - serializeArray(type_t, numElements); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template serializes a raw sequence. - * @param sequence_t Pointer to the sequence that will be serialized in the buffer. - * @param numElements The number of elements contained in the sequence. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serializeSequence(const _T* sequence_t, size_t numElements) { - state state_before_error(*this); - - serialize(static_cast(numElements)); - - try { - return serializeArray(sequence_t, numElements); - } catch (eprosima::fastcdr::exception::Exception& ex) { - setState(state_before_error); - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template serializes a raw sequence with a different endianness. - * @param sequence_t Pointer to the sequence that will be serialized in the buffer. - * @param numElements The number of elements contained in the sequence. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serializeSequence(const _T* sequence_t, size_t numElements, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - serializeSequence(sequence_t, numElements); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function deserializes an octet. - * @param octet_t The variable that will store the octet read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(uint8_t& octet_t) { - return deserialize(reinterpret_cast(octet_t)); - } - - /*! - * @brief This function deserializes an octet with a different endianness. - * @param octet_t The variable that will store the octet read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(uint8_t& octet_t, Endianness endianness) { - return deserialize(reinterpret_cast(octet_t), endianness); - } - - /*! - * @brief This function deserializes a character. - * @param char_t The variable that will store the character read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(char& char_t); - - /*! - * @brief This function deserializes a character with a different endianness. - * @param char_t The variable that will store the character read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(char& char_t, Endianness endianness) { - (void)endianness; - return deserialize(char_t); - } - - /*! - * @brief This function deserializes an int8_t. - * @param int8 The variable that will store the int8_t read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(int8_t& int8) { - return deserialize(reinterpret_cast(int8)); - } - - /*! - * @brief This function deserializes an int8_t with a different endianness. - * @param int8 The variable that will store the int8_t read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(int8_t& int8, Endianness endianness) { - return deserialize(reinterpret_cast(int8), endianness); - } - - /*! - * @brief This function deserializes an unsigned short. - * @param ushort_t The variable that will store the unsigned short read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(uint16_t& ushort_t) { - return deserialize(reinterpret_cast(ushort_t)); - } - - /*! - * @brief This function deserializes an unsigned short with a different endianness. - * @param ushort_t The variable that will store the unsigned short read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(uint16_t& ushort_t, Endianness endianness) { - return deserialize(reinterpret_cast(ushort_t), endianness); - } - - /*! - * @brief This function deserializes a short. - * @param short_t The variable that will store the short read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(int16_t& short_t); - - /*! - * @brief This function deserializes a short with a different endianness. - * @param short_t The variable that will store the short read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(int16_t& short_t, Endianness endianness); - - /*! - * @brief This function deserializes an unsigned long. - * @param ulong_t The variable that will store the unsigned long read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(uint32_t& ulong_t) { - return deserialize(reinterpret_cast(ulong_t)); - } - - /*! - * @brief This function deserializes an unsigned long with a different endianness. - * @param ulong_t The variable that will store the unsigned long read from the buffer.. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(uint32_t& ulong_t, Endianness endianness) { - return deserialize(reinterpret_cast(ulong_t), endianness); - } - - /*! - * @brief This function deserializes a long. - * @param long_t The variable that will store the long read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(int32_t& long_t); - - /*! - * @brief This function deserializes a long with a different endianness. - * @param long_t The variable that will store the long read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(int32_t& long_t, Endianness endianness); - - /*! - * @brief This function deserializes a wide-char. - * @param wchar The variable that will store the wide-char read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(wchar_t& wchar) { - uint32_t ret; - deserialize(ret); - wchar = static_cast(ret); - return *this; - } - - /*! - * @brief This function deserializes a wide-char with a different endianness. - * @param wchar The variable that will store the wide-char read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(wchar_t& wchar, Endianness endianness) { - uint32_t ret; - deserialize(ret, endianness); - wchar = static_cast(ret); - return *this; - } - - /*! - * @brief This function deserializes an unsigned long long. - * @param ulonglong_t The variable that will store the unsigned long long read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(uint64_t& ulonglong_t) { - return deserialize(reinterpret_cast(ulonglong_t)); - } - - /*! - * @brief This function deserializes an unsigned long long with a different endianness. - * @param ulonglong_t The variable that will store the unsigned long long read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(uint64_t& ulonglong_t, Endianness endianness) { - return deserialize(reinterpret_cast(ulonglong_t), endianness); - } - - /*! - * @brief This function deserializes a long long. - * @param longlong_t The variable that will store the long long read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(int64_t& longlong_t); - - /*! - * @brief This function deserializes a long long with a different endianness. - * @param longlong_t The variable that will store the long long read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(int64_t& longlong_t, Endianness endianness); - - /*! - * @brief This function deserializes a float. - * @param float_t The variable that will store the float read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(float& float_t); - - /*! - * @brief This function deserializes a float with a different endianness. - * @param float_t The variable that will store the float read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(float& float_t, Endianness endianness); - - /*! - * @brief This function deserializes a double. - * @param double_t The variable that will store the double read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(double& double_t); - - /*! - * @brief This function deserializes a double with a different endianness. - * @param double_t The variable that will store the double read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(double& double_t, Endianness endianness); - - /*! - * @brief This function deserializes a long double. - * @param ldouble_t The variable that will store the long double read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. - */ - Cdr& deserialize(long double& ldouble_t); - - /*! - * @brief This function deserializes a long double with a different endianness. - * @param ldouble_t The variable that will store the long double read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. - */ - Cdr& deserialize(long double& ldouble_t, Endianness endianness); - - /*! - * @brief This function deserializes a boolean. - * @param bool_t The variable that will store the boolean read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. - */ - Cdr& deserialize(bool& bool_t); - - /*! - * @brief This function deserializes a boolean with a different endianness. - * @param bool_t The variable that will store the boolean read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. - */ - inline Cdr& deserialize(bool& bool_t, Endianness endianness) { - (void)endianness; - return deserialize(bool_t); - } - - /*! - * @brief This function deserializes a string. - * This function allocates memory to store the string. The user pointer will be set to point this allocated memory. - * The user will have to free this allocated memory using free() - * @param string_t The pointer that will point to the string read from the buffer. - * The user will have to free the allocated memory using free() - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(char*& string_t); - - /*! - * @brief This function deserializes a wide string. - * This function allocates memory to store the wide string. The user pointer will be set to point this allocated - * memory. The user will have to free this allocated memory using free() - * @param string_t The pointer that will point to the wide string read from the buffer. - * The user will have to free the allocated memory using free() - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(wchar_t*& string_t); - - /*! - * @brief This function deserializes a string with a different endianness. - * This function allocates memory to store the string. The user pointer will be set to point this allocated memory. - * The user will have to free this allocated memory using free() - * @param string_t The pointer that will point to the string read from the buffer. - * @param endianness Endianness that will be used in the deserialization of this value. - * The user will have to free the allocated memory using free() - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(char*& string_t, Endianness endianness); - - /*! - * @brief This function deserializes a wide string with a different endianness. - * This function allocates memory to store the wide string. The user pointer will be set to point this allocated - * memory. The user will have to free this allocated memory using free() - * @param string_t The pointer that will point to the wide string read from the buffer. - * @param endianness Endianness that will be used in the deserialization of this value. - * The user will have to free the allocated memory using free() - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserialize(wchar_t*& string_t, Endianness endianness); - - /*! - * @brief This function deserializes a std::string. - * @param string_t The variable that will store the string read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(std::string& string_t) { - uint32_t length = 0; - const char* str = readString(length); - string_t.assign(str, length); - return *this; - } - - /*! - * @brief This function deserializes a std::string. - * @param string_t The variable that will store the string read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(std::wstring& string_t) { - uint32_t length = 0; - string_t = readWString(length); - return *this; - } - - /*! - * @brief This function deserializes a string with a different endianness. - * @param string_t The variable that will store the string read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(std::string& string_t, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - deserialize(string_t); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function deserializes a string with a different endianness. - * @param string_t The variable that will store the string read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserialize(std::wstring& string_t, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - deserialize(string_t); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template deserializes an array. - * @param array_t The variable that will store the array read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& deserialize(std::array<_T, _Size>& array_t) { - return deserializeArray(array_t.data(), array_t.size()); - } - - /*! - * @brief This function template deserializes an array with a different endianness. - * @param array_t The variable that will store the array read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& deserialize(std::array<_T, _Size>& array_t, Endianness endianness) { - return deserializeArray(array_t.data(), array_t.size(), endianness); - } - - /*! - * @brief This function template deserializes a sequence. - * @param vector_t The variable that will store the sequence read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserialize(std::vector& vector_t) { - return deserializeBoolSequence(vector_t); - } - - /*! - * @brief This function template deserializes a sequence. - * @param vector_t The variable that will store the sequence read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserialize(std::vector<_T, _Alloc>& vector_t) { - uint32_t seqLength = 0; - state state_before_error(*this); - - *this >> seqLength; - - if (seqLength == 0) { - vector_t.clear(); - return *this; - } - - if ((m_lastPosition - m_currentPosition) < seqLength) { - setState(state_before_error); - throw eprosima::fastcdr::exception::NotEnoughMemoryException( - eprosima::fastcdr::exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); - } - - try { - vector_t.resize(seqLength); - return deserializeArray(vector_t.data(), vector_t.size()); - } catch (eprosima::fastcdr::exception::Exception& ex) { - setState(state_before_error); - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template deserializes a map. - * @param map_t The variable that will store the map read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserialize(std::map<_K, _T>& map_t) { - uint32_t seqLength = 0; - state state_(*this); - - *this >> seqLength; - - try { - for (uint32_t i = 0; i < seqLength; ++i) { - _K key; - _T value; - *this >> key; - *this >> value; - map_t.emplace(std::pair<_K, _T>(std::move(key), std::move(value))); - } - } catch (eprosima::fastcdr::exception::Exception& ex) { - setState(state_); - ex.raise(); - } - - return *this; - } - -#ifdef _MSC_VER - /*! - * @brief This function template deserializes a sequence. - * @param vector_t The variable that will store the sequence read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template <> - Cdr& deserialize(std::vector& vector_t) { - return deserializeBoolSequence(vector_t); - } - -#endif // ifdef _MSC_VER - - /*! - * @brief This function template deserializes a sequence with a different endianness. - * @param vector_t The variable that will store the sequence read from the buffer. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserialize(std::vector<_T, _Alloc>& vector_t, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - deserialize(vector_t); - m_swapBytes = auxSwap; - } catch (exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template deserializes a non-basic object. - * @param type_t The variable that will store the object read from the buffer. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - inline Cdr& deserialize(_T& type_t) { - type_t.deserialize(*this); - return *this; - } - - /*! - * @brief This function deserializes an array of octets. - * @param octet_t The variable that will store the array of octets read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(uint8_t* octet_t, size_t numElements) { - return deserializeArray(reinterpret_cast(octet_t), numElements); - } - - /*! - * @brief This function deserializes an array of octets with a different endianness. - * @param octet_t The variable that will store the array of octets read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(uint8_t* octet_t, size_t numElements, Endianness endianness) { - return deserializeArray(reinterpret_cast(octet_t), numElements, endianness); - } - - /*! - * @brief This function deserializes an array of characters. - * @param char_t The variable that will store the array of characters read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(char* char_t, size_t numElements); - - /*! - * @brief This function deserializes an array of characters with a different endianness. - * @param char_t The variable that will store the array of characters read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(char* char_t, size_t numElements, Endianness endianness) { - (void)endianness; - return deserializeArray(char_t, numElements); - } - - /*! - * @brief This function deserializes an array of int8_t. - * @param int8 The variable that will store the array of int8_t read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(int8_t* int8, size_t numElements) { - return deserializeArray(reinterpret_cast(int8), numElements); - } - - /*! - * @brief This function deserializes an array of int8_t with a different endianness. - * @param int8 The variable that will store the array of int8_t read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(int8_t* int8, size_t numElements, Endianness endianness) { - return deserializeArray(reinterpret_cast(int8), numElements, endianness); - } - - /*! - * @brief This function deserializes an array of unsigned shorts. - * @param ushort_t The variable that will store the array of unsigned shorts read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(uint16_t* ushort_t, size_t numElements) { - return deserializeArray(reinterpret_cast(ushort_t), numElements); - } - - /*! - * @brief This function deserializes an array of unsigned shorts with a different endianness. - * @param ushort_t The variable that will store the array of unsigned shorts read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(uint16_t* ushort_t, size_t numElements, Endianness endianness) { - return deserializeArray(reinterpret_cast(ushort_t), numElements, endianness); - } - - /*! - * @brief This function deserializes an array of shorts. - * @param short_t The variable that will store the array of shorts read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(int16_t* short_t, size_t numElements); - - /*! - * @brief This function deserializes an array of shorts with a different endianness. - * @param short_t The variable that will store the array of shorts read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(int16_t* short_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function deserializes an array of unsigned longs. - * @param ulong_t The variable that will store the array of unsigned longs read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(uint32_t* ulong_t, size_t numElements) { - return deserializeArray(reinterpret_cast(ulong_t), numElements); - } - - /*! - * @brief This function deserializes an array of unsigned longs with a different endianness. - * @param ulong_t The variable that will store the array of unsigned longs read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(uint32_t* ulong_t, size_t numElements, Endianness endianness) { - return deserializeArray(reinterpret_cast(ulong_t), numElements, endianness); - } - - /*! - * @brief This function deserializes an array of longs. - * @param long_t The variable that will store the array of longs read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(int32_t* long_t, size_t numElements); - - /*! - * @brief This function deserializes an array of longs with a different endianness. - * @param long_t The variable that will store the array of longs read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(int32_t* long_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function deserializes an array of wide-chars. - * @param wchar The variable that will store the array of wide-chars read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(wchar_t* wchar, size_t numElements); - - /*! - * @brief This function deserializes an array of wide-chars with a different endianness. - * @param wchar The variable that will store the array of wide-chars read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(wchar_t* wchar, size_t numElements, Endianness endianness); - - /*! - * @brief This function deserializes an array of unsigned long longs. - * @param ulonglong_t The variable that will store the array of unsigned long longs read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(uint64_t* ulonglong_t, size_t numElements) { - return deserializeArray(reinterpret_cast(ulonglong_t), numElements); - } - - /*! - * @brief This function deserializes an array of unsigned long longs with a different endianness. - * @param ulonglong_t The variable that will store the array of unsigned long longs read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(uint64_t* ulonglong_t, size_t numElements, Endianness endianness) { - return deserializeArray(reinterpret_cast(ulonglong_t), numElements, endianness); - } - - /*! - * @brief This function deserializes an array of long longs. - * @param longlong_t The variable that will store the array of long longs read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(int64_t* longlong_t, size_t numElements); - - /*! - * @brief This function deserializes an array of long longs with a different endianness. - * @param longlong_t The variable that will store the array of long longs read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(int64_t* longlong_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function deserializes an array of floats. - * @param float_t The variable that will store the array of floats read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(float* float_t, size_t numElements); - - /*! - * @brief This function deserializes an array of floats with a different endianness. - * @param float_t The variable that will store the array of floats read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(float* float_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function deserializes an array of doubles. - * @param double_t The variable that will store the array of doubles read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(double* double_t, size_t numElements); - - /*! - * @brief This function deserializes an array of doubles with a different endianness. - * @param double_t The variable that will store the array of doubles read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(double* double_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function deserializes an array of long doubles. - * @param ldouble_t The variable that will store the array of long doubles read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(long double* ldouble_t, size_t numElements); - - /*! - * @brief This function deserializes an array of long doubles with a different endianness. - * @param ldouble_t The variable that will store the array of long doubles read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(long double* ldouble_t, size_t numElements, Endianness endianness); - - /*! - * @brief This function deserializes an array of booleans. - * @param bool_t The variable that will store the array of booleans read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - Cdr& deserializeArray(bool* bool_t, size_t numElements); - - /*! - * @brief This function deserializes an array of booleans with a different endianness. - * @param bool_t The variable that will store the array of booleans read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(bool* bool_t, size_t numElements, Endianness endianness) { - (void)endianness; - return deserializeArray(bool_t, numElements); - } - - /*! - * @brief This function deserializes an array of strings. - * @param string_t The variable that will store the array of strings read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(std::string* string_t, size_t numElements) { - for (size_t count = 0; count < numElements; ++count) { - deserialize(string_t[count]); - } - return *this; - } - - /*! - * @brief This function deserializes an array of wide-strings. - * @param string_t The variable that will store the array of wide-strings read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(std::wstring* string_t, size_t numElements) { - for (size_t count = 0; count < numElements; ++count) { - deserialize(string_t[count]); - } - return *this; - } - - /*! - * @brief This function deserializes an array of strings with a different endianness. - * @param string_t The variable that will store the array of strings read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(std::string* string_t, size_t numElements, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - deserializeArray(string_t, numElements); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function deserializes an array of wide-strings with a different endianness. - * @param string_t The variable that will store the array of wide-strings read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - inline Cdr& deserializeArray(std::wstring* string_t, size_t numElements, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - deserializeArray(string_t, numElements); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function deserializes an array of sequences of objects. - * @param vector_t The variable that will store the array of sequences of objects read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeArray(std::vector<_T, _Alloc>* vector_t, size_t numElements) { - for (size_t count = 0; count < numElements; ++count) { - deserialize(vector_t[count]); - } - return *this; - } - - /*! - * @brief This function template deserializes an array of non-basic objects. - * @param type_t The variable that will store the array of objects read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeArray(_T* type_t, size_t numElements) { - for (size_t count = 0; count < numElements; ++count) { - type_t[count].deserialize(*this); - } - return *this; - } - - /*! - * @brief This function template deserializes an array of non-basic objects with a different endianness. - * @param type_t The variable that will store the array of objects read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeArray(_T* type_t, size_t numElements, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - deserializeArray(type_t, numElements); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } - - /*! - * @brief This function template deserializes a string sequence. - * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. - * The user will have to free this allocated memory using free() - * @param sequence_t The pointer that will store the sequence read from the buffer. - * @param numElements This variable return the number of elements of the sequence. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeSequence(std::string*& sequence_t, size_t& numElements) { - return deserializeStringSequence(sequence_t, numElements); - } - - /*! - * @brief This function template deserializes a wide-string sequence. - * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. - * The user will have to free this allocated memory using free() - * @param sequence_t The pointer that will store the sequence read from the buffer. - * @param numElements This variable return the number of elements of the sequence. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeSequence(std::wstring*& sequence_t, size_t& numElements) { - return deserializeWStringSequence(sequence_t, numElements); - } - - /*! - * @brief This function template deserializes a raw sequence. - * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. - * The user will have to free this allocated memory using free() - * @param sequence_t The pointer that will store the sequence read from the buffer. - * @param numElements This variable return the number of elements of the sequence. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeSequence(_T*& sequence_t, size_t& numElements) { - uint32_t seqLength = 0; - state state_before_error(*this); - - deserialize(seqLength); - - try { - sequence_t = reinterpret_cast<_T*>(calloc(seqLength, sizeof(_T))); - deserializeArray(sequence_t, seqLength); - } catch (eprosima::fastcdr::exception::Exception& ex) { - free(sequence_t); - sequence_t = NULL; - setState(state_before_error); - ex.raise(); - } - - numElements = seqLength; - return *this; - } - -#ifdef _MSC_VER - /*! - * @brief This function template deserializes a string sequence. - * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. - * The user will have to free this allocated memory using free() - * @param sequence_t The pointer that will store the sequence read from the buffer. - * @param numElements This variable return the number of elements of the sequence. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template <> - Cdr& deserializeSequence(std::string*& sequence_t, size_t& numElements) { - return deserializeStringSequence(sequence_t, numElements); - } - - /*! - * @brief This function template deserializes a wide-string sequence. - * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. - * The user will have to free this allocated memory using free() - * @param sequence_t The pointer that will store the sequence read from the buffer. - * @param numElements This variable return the number of elements of the sequence. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template <> - Cdr& deserializeSequence(std::wstring*& sequence_t, size_t& numElements) { - return deserializeWStringSequence(sequence_t, numElements); - } - -#endif // ifdef _MSC_VER - - /*! - * @brief This function template deserializes a raw sequence with a different endianness. - * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. - * The user will have to free this allocated memory using free() - * @param sequence_t The pointer that will store the sequence read from the buffer. - * @param numElements This variable return the number of elements of the sequence. - * @param endianness Endianness that will be used in the deserialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeSequence(_T*& sequence_t, size_t& numElements, Endianness endianness) { - bool auxSwap = m_swapBytes; - m_swapBytes = (m_swapBytes && (static_cast(m_endianness) == endianness)) || - (!m_swapBytes && (static_cast(m_endianness) != endianness)); - - try { - deserializeSequence(sequence_t, numElements); - m_swapBytes = auxSwap; - } catch (eprosima::fastcdr::exception::Exception& ex) { - m_swapBytes = auxSwap; - ex.raise(); - } - - return *this; - } -private: - Cdr(const Cdr&) = delete; - - Cdr& operator=(const Cdr&) = delete; - - Cdr& serializeBoolSequence(const std::vector& vector_t); - - Cdr& deserializeBoolSequence(std::vector& vector_t); - - Cdr& deserializeStringSequence(std::string*& sequence_t, size_t& numElements); - - Cdr& deserializeWStringSequence(std::wstring*& sequence_t, size_t& numElements); - - /*! - * @brief This function template detects the content type of the STD container array and serializes the array. - * @param array_t The array that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serializeArray(const std::array<_T, _Size>* array_t, size_t numElements) { - return serializeArray(array_t->data(), numElements * array_t->size()); - } - - /*! - * @brief This function template detects the content type of the STD container array and serializes the array with a - * different endianness. - * @param array_t The array that will be serialized in the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that - * exceeds the internal memory size. - */ - template - Cdr& serializeArray(const std::array<_T, _Size>* array_t, size_t numElements, Endianness endianness) { - return serializeArray(array_t->data(), numElements * array_t->size(), endianness); - } - - /*! - * @brief This function template detects the content type of the STD container array and deserializes the array. - * @param array_t The variable that will store the array read from the buffer. - * @param numElements Number of the elements in the array. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeArray(std::array<_T, _Size>* array_t, size_t numElements) { - return deserializeArray(array_t->data(), numElements * array_t->size()); - } - - /*! - * @brief This function template detects the content type of STD container array and deserializes the array with a - * different endianness. - * @param array_t The variable that will store the array read from the buffer. - * @param numElements Number of the elements in the array. - * @param endianness Endianness that will be used in the serialization of this value. - * @return Reference to the eprosima::fastcdr::Cdr object. - * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that - * exceeds the internal memory size. - */ - template - Cdr& deserializeArray(std::array<_T, _Size>* array_t, size_t numElements, Endianness endianness) { - return deserializeArray(array_t->data(), numElements * array_t->size(), endianness); - } - - /*! - * @brief This function returns the extra bytes regarding the allignment. - * @param dataSize The size of the data that will be serialized. - * @return The size needed for the aligment. - */ - inline size_t alignment(size_t dataSize) const { - return dataSize > m_lastDataSize ? (dataSize - ((m_currentPosition - m_alignPosition) % dataSize)) & (dataSize - 1) - : 0; - } - - /*! - * @brief This function jumps the number of bytes of the alignment. These bytes should be calculated with the function - * eprosima::fastcdr::Cdr::alignment. - * @param align The number of bytes to be skipped. - */ - inline void makeAlign(size_t align) { - m_currentPosition += align; - } - - /*! - * @brief This function resizes the internal buffer. It only applies if the FastBuffer object was created with the - * default constructor. - * @param minSizeInc Minimun size increase for the internal buffer - * @return True if the resize was succesful, false if it was not - */ - bool resize(size_t minSizeInc); - - // TODO - const char* readString(uint32_t& length); - const std::wstring readWString(uint32_t& length); - - //! @brief Reference to the buffer that will be serialized/deserialized. - FastBuffer& m_cdrBuffer; - - //! @brief The type of CDR that will be use in serialization/deserialization. - CdrType m_cdrType; - - //! @brief Using DDS_CDR type, this attribute stores if the stream buffer contains a parameter list or not. - DDSCdrPlFlag m_plFlag; - - //! @brief This attribute stores the option flags when the CDR type is DDS_CDR; - uint16_t m_options; - - //! @brief The endianness that will be applied over the buffer. - uint8_t m_endianness; - - //! @brief This attribute specifies if it is needed to swap the bytes. - bool m_swapBytes; - - //! @brief Stores the last datasize serialized/deserialized. It's used to optimize. - size_t m_lastDataSize; - - //! @brief The current position in the serialization/deserialization process. - FastBuffer::iterator m_currentPosition; - - //! @brief The position from where the aligment is calculated. - FastBuffer::iterator m_alignPosition; - - //! @brief The last position in the buffer; - FastBuffer::iterator m_lastPosition; -}; -} // namespace fastcdr -} // namespace eprosima + /*! + * @brief This enumeration represents endianness types. + */ + typedef enum : uint8_t + { + //! @brief Big endianness. + BIG_ENDIANNESS = 0x0, + //! @brief Little endianness. + LITTLE_ENDIANNESS = 0x1 + } Endianness; + + //! Default endianess in the system. + Cdr_DllAPI static const Endianness DEFAULT_ENDIAN; + + /*! + * Used to decide, in encoding algorithms where member headers support a short header version and a long header + * version, which one will be used. + */ + typedef enum + { + //! Initially a short member header is allocated and cannot be changed. This option may cause an exception. + SHORT_HEADER, + //! Initially a long member header is allocated and cannot be changed. + LONG_HEADER, + //! Initially a short member header is allocated but can be changed to the longer version. + AUTO_WITH_SHORT_HEADER_BY_DEFAULT, + //! Initially a long member header is allocated but can be changed to the shorter version. + AUTO_WITH_LONG_HEADER_BY_DEFAULT + } XCdrHeaderSelection; + + /*! + * @brief This class stores the current state of a CDR serialization. + */ + class state + { + friend class Cdr; + + public: + + //! Default constructor. + Cdr_DllAPI state( + const Cdr& cdr); + + //! Copy constructor. + Cdr_DllAPI state( + const state& state); + + + //! Compares two states. + Cdr_DllAPI bool operator ==( + const state& other_state) const; + + private: + + state& operator =( + const state& state) = delete; + + //! The position in the buffer when the state was created. + const FastBuffer::iterator offset_; + + //! The position from the alignment is calculated, when the state was created. + const FastBuffer::iterator origin_; + + //! This attribute specifies if it is needed to swap the bytes when the state is created. + bool swap_bytes_ {false}; + + //! Stores the last datasize serialized/deserialized when the state was created. + size_t last_data_size_ {0}; + + //! Not related with the state. Next member id which will be encoded. + MemberId next_member_id_; + + //! Not related with the state. Used by encoding algorithms to set the encoded member size. + uint32_t member_size_ {0}; + + //! Not related with the state. Used by encoding algorithms to store the selected member header version. + XCdrHeaderSelection header_selection_ {XCdrHeaderSelection::AUTO_WITH_SHORT_HEADER_BY_DEFAULT}; + + //! Not related with the state. Used by encoding algorithms to store the allocated member header version. + XCdrHeaderSelection header_serialized_ {XCdrHeaderSelection::SHORT_HEADER}; + + //! Not related with the state. Used by encoding algorithms to store the previous encoding algorithm. + EncodingAlgorithmFlag previous_encoding_ {EncodingAlgorithmFlag::PLAIN_CDR2}; + }; + + /*! + * @brief This constructor creates an eprosima::fastcdr::Cdr object that can serialize/deserialize + * the assigned buffer. + * @param cdr_buffer A reference to the buffer that contains (or will contain) the CDR representation. + * @param endianness The initial endianness that will be used. The default value is the endianness of the system. + * @param cdr_version Represents the type of encoding algorithm that will be used for the encoding. + * The default value is CdrVersion::XCDRv2. + */ + Cdr_DllAPI Cdr( + FastBuffer& cdr_buffer, + const Endianness endianness = DEFAULT_ENDIAN, + const CdrVersion cdr_version = XCDRv2); + + /*! + * @brief This function reads the encapsulation of the CDR stream. + * If the CDR stream contains an encapsulation, then this function should be called before starting to deserialize. + * CdrVersion and EncodingAlgorithmFlag internal values will be changed to the ones specified by the + * encapsulation. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. + */ + Cdr_DllAPI Cdr& read_encapsulation(); + + /*! + * @brief This function writes the encapsulation of the CDR stream. + * If the CDR stream should contain an encapsulation, then this function should be called before starting to serialize. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_encapsulation(); + + /*! + * @brief Retrieves the CdrVersion used by the instance. + * @return Configured CdrVersion. + */ + Cdr_DllAPI CdrVersion get_cdr_version() const; + + /*! + * @brief Returns the EncodingAlgorithmFlag set in the encapsulation when the CDR type is + * CdrVersion::DDS_CDR, CdrVersion::XCDRv1 or CdrVersion::XCDRv2. + * @return The specified flag in the encapsulation. + */ + Cdr_DllAPI EncodingAlgorithmFlag get_encoding_flag() const; + + /*! + * @brief Sets the EncodingAlgorithmFlag for the encapsulation when the CDR type is + * CdrVersion::DDS_CDR, CdrVersion::XCDRv1 or CdrVersion::XCDRv2. + * This function only works when is called before starting the encoding/decoding. + * @param[in] encoding_flag Value to be used in the encapsulation. + * @return Indicates whether the setting was successful. + */ + Cdr_DllAPI bool set_encoding_flag( + EncodingAlgorithmFlag encoding_flag); + + /*! + * @brief This function returns the option flags when the CDR type is eprosima::fastcdr::DDS_CDR. + * @return The option flags. + */ + Cdr_DllAPI std::array get_dds_cdr_options() const; + + /*! + * @brief This function sets the option flags when the CDR type is eprosima::fastcdr::DDS_CDR. + * @param options New value for the option flags. + */ + Cdr_DllAPI void set_dds_cdr_options( + const std::array& options); + + /*! + * @brief This function sets the current endianness used by the CDR type. + * @param endianness The new endianness value. + */ + Cdr_DllAPI void change_endianness( + Endianness endianness); + + /*! + * @brief This function returns the current endianness used by the CDR type. + * @return The endianness. + */ + Cdr_DllAPI Endianness endianness() const; + + /*! + * @brief This function skips a number of bytes in the CDR stream buffer. + * @param num_bytes The number of bytes that will be jumped. + * @return True is returned when it works successfully. Otherwise, false is returned. + */ + Cdr_DllAPI bool jump( + size_t num_bytes); + + /*! + * @brief This function resets the current position in the buffer to the beginning. + */ + Cdr_DllAPI void reset(); + + /*! + * @brief This function returns the pointer to the current used buffer. + * @return Pointer to the starting position of the buffer. + */ + Cdr_DllAPI char* get_buffer_pointer(); + + /*! + * @brief This function returns the current position in the CDR stream. + * @return Pointer to the current position in the buffer. + */ + Cdr_DllAPI char* get_current_position(); + + /*! + * @brief This function returns the length of the serialized data inside the stream. + * @return The length of the serialized data. + */ + Cdr_DllAPI size_t get_serialized_data_length() const; + + /*! + * @brief Returns the number of bytes needed to align a position to certain data size. + * @param current_alignment Position to be aligned. + * @param data_size Size of next data to process (should be power of two). + * @return Number of required alignment bytes. + */ + inline static size_t alignment( + size_t current_alignment, + size_t data_size) + { + return (data_size - (current_alignment % data_size)) & (data_size - 1); + } + + /*! + * @brief Returns the current state of the CDR serialization process. + * @return The current state of the CDR serialization process. + */ + Cdr_DllAPI state get_state() const; + + /*! + * @brief Sets a previous state of the CDR serialization process; + * @param state Previous state that will be set. + */ + Cdr_DllAPI void set_state( + const state& state); + + /*! + * @brief This function moves the alignment forward. + * @param num_bytes The number of bytes the alignment should advance. + * @return True If alignment was moved successfully. + */ + Cdr_DllAPI bool move_alignment_forward( + size_t num_bytes); + + /*! + * @brief This function resets the alignment to the current position in the buffer. + */ + inline void reset_alignment() + { + origin_ = offset_; + last_data_size_ = 0; + } + + /*! + * @brief Encodes the value into the buffer. + * + * If previously a MemberId was set using operator<<, this operator will encode the value as a member of a type + * consistent with the set member identifier and according to the encoding algorithm used. + * + * In other case, the operator will simply encode the value. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + inline Cdr& operator <<( + const _T& value) + { + if (MEMBER_ID_INVALID == next_member_id_) + { + serialize(value); + } + else + { + serialize_member(next_member_id_, value); + + } + + return *this; + } + + /*! + * @brief Decodes the value from the buffer. + * + * If this operator is called while decoding members of a type, this operator will decode the value as a member + * according to the encoding algorithm used. + * + * In other case, the operator will simply decode the value. + * + * @param[out] value Reference to the variable where the value will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a position + * that exceeds the internal memory size. + */ + template + inline Cdr& operator >>( + _T& value) + { + if (MEMBER_ID_INVALID == next_member_id_) + { + deserialize(value); + } + else + { + deserialize_member(value); + } + return *this; + } + + /*! + * @brief Encodes the value of a type into the buffer. + * + * To do that, the encoder expects a function `serialize` to be provided by the type. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, typename = void> + Cdr& serialize( + const _T& value) + { + eprosima::fastcdr::serialize(*this, value); + return *this; + } + + /*! + * @brief Encodes the value of a type with a different endianness. + * @param[in] value A reference to the value which will be encoded in the buffer. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize( + const _T& value, + Endianness endianness) + { + bool aux_swap = swap_bytes_; + swap_bytes_ = (swap_bytes_ && (static_cast(endianness_) == endianness)) || + (!swap_bytes_ && (static_cast(endianness_) != endianness)); + + try + { + serialize(value); + swap_bytes_ = aux_swap; + } + catch (exception::Exception& ex) + { + swap_bytes_ = aux_swap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief Encodes the value of a enumerator into the buffer. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int32_t>::value>::type* = nullptr> + Cdr& serialize( + const _T& value) + { + return serialize(static_cast(value)); + } + + /*! + * @brief Encodes the value of a enumerator into the buffer. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint32_t>::value>::type* = nullptr> + Cdr& serialize( + const _T& value) + { + return serialize(static_cast(value)); + } + + /*! + * @brief Encodes the value of a enumerator into the buffer. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int16_t>::value>::type* = nullptr> + Cdr& serialize( + const _T& value) + { + return serialize(static_cast(value)); + } + + /*! + * @brief Encodes the value of a enumerator into the buffer. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint16_t>::value>::type* = nullptr> + Cdr& serialize( + const _T& value) + { + return serialize(static_cast(value)); + } + + /*! + * @brief Encodes the value of a enumerator into the buffer. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int8_t>::value>::type* = nullptr> + Cdr& serialize( + const _T& value) + { + return serialize(static_cast(value)); + } + + /*! + * @brief Encodes the value of a enumerator into the buffer. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint8_t>::value>::type* = nullptr> + Cdr& serialize( + const _T& value) + { + return serialize(static_cast(value)); + } + + /*! + * @brief This function serializes an octet. + * @param octet_t The value of the octet that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const uint8_t& octet_t); + + /*! + * @brief This function serializes a character. + * @param char_t The value of the character that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const char char_t); + + /*! + * @brief This function serializes an int8_t. + * @param int8 The value of the int8_t that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const int8_t int8); + + /*! + * @brief This function serializes an unsigned short. + * @param ushort_t The value of the unsigned short that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const uint16_t ushort_t); + + /*! + * @brief This function serializes a short. + * @param short_t The value of the short that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const int16_t short_t); + + /*! + * @brief This function serializes an unsigned long. + * @param ulong_t The value of the unsigned long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const uint32_t ulong_t); + + /*! + * @brief This function serializes a long. + * @param long_t The value of the long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const int32_t long_t); + + /*! + * @brief This function serializes a wide-char. + * @param wchar The value of the wide-char that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const wchar_t wchar); + + /*! + * @brief This function serializes an unsigned long long. + * @param ulonglong_t The value of the unsigned long long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const uint64_t ulonglong_t); + + /*! + * @brief This function serializes a long long. + * @param longlong_t The value of the long long that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const int64_t longlong_t); + + /*! + * @brief This function serializes a float. + * @param float_t The value of the float that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const float float_t); + + /*! + * @brief This function serializes a double. + * @param double_t The value of the double that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const double double_t); + + /*! + * @brief This function serializes a long double. + * @param ldouble_t The value of the long double that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. + */ + Cdr_DllAPI Cdr& serialize( + const long double ldouble_t); + + /*! + * @brief This function serializes a boolean. + * @param bool_t The value of the boolean that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const bool bool_t); + + /*! + * @brief This function serializes a string. + * @param string_t The pointer to the string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + char* string_t); + + /*! + * @brief This function serializes a string. + * @param string_t The pointer to the string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const char* string_t); + + /*! + * @brief This function serializes a wstring. + * @param string_t The pointer to the wstring that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize( + const wchar_t* string_t); + + /*! + * @brief This function serializes a std::string. + * @param string_t The string that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to serialize a string with null characters. + */ + TEMPLATE_SPEC + Cdr& serialize( + const std::string& string_t) + { + // Check there are no null characters in the string. + const char* c_str = string_t.c_str(); + const auto str_len = strlen(c_str); + if (string_t.size() > str_len) + { + throw exception::BadParamException("The string contains null characters"); + } + + return serialize_sequence(c_str, str_len + 1); + } + + /*! + * @brief This function serializes a std::wstring. + * @param string_t The wstring that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize( + const std::wstring& string_t) + { + return serialize(string_t.c_str()); + } + + /*! + * @brief Encodes a eprosima::fastcdr::fixed_string in the buffer. + * @param[in] value A reference to the fixed string which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize( + const fixed_string& value) + { + return serialize(value.c_str()); + } + + /*! + * @brief This function template serializes an array. + * @param array_t The array that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template + Cdr& serialize( + const std::array<_T, _Size>& array_t) + { + if (!is_multi_array_primitive(&array_t)) + { + Cdr::state dheader_state {allocate_xcdrv2_dheader()}; + + serialize_array(array_t.data(), array_t.size()); + + set_xcdrv2_dheader(dheader_state); + } + else + { + serialize_array(array_t.data(), array_t.size()); + } + + return *this; + } + + /*! + * @brief This function template serializes a sequence of non-primitive. + * @param vector_t The sequence that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& serialize( + const std::vector<_T, _Alloc>& vector_t) + { + Cdr::state dheader_state {allocate_xcdrv2_dheader()}; + + serialize(static_cast(vector_t.size())); + + try + { + serialize_array(vector_t.data(), vector_t.size()); + } + catch (exception::Exception& ex) + { + set_state(dheader_state); + ex.raise(); + } + + set_xcdrv2_dheader(dheader_state); + + return *this; + } + + /*! + * @brief This function template serializes a sequence of primitive. + * @param vector_t The sequence that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& serialize( + const std::vector<_T, _Alloc>& vector_t) + { + state state_before_error(*this); + + serialize(static_cast(vector_t.size())); + + try + { + serialize_array(vector_t.data(), vector_t.size()); + } + catch (exception::Exception& ex) + { + set_state(state_before_error); + ex.raise(); + } + + if (CdrVersion::XCDRv2 == cdr_version_) + { + serialized_member_size_ = get_serialized_member_size<_T>(); + } + + return *this; + } + + /*! + * @brief This function template serializes a sequence of booleans. + * @param vector_t The sequence that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize( + const std::vector& vector_t) + { + return serialize_bool_sequence(vector_t); + } + + /*! + * @brief This function template serializes a map of non-primitive. + * @param map_t The map that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& serialize( + const std::map<_K, _T>& map_t) + { + Cdr::state dheader_state {allocate_xcdrv2_dheader()}; + + serialize(static_cast(map_t.size())); + + try + { + for (auto it_pair = map_t.begin(); it_pair != map_t.end(); ++it_pair) + { + serialize(it_pair->first); + serialize(it_pair->second); + } + } + catch (exception::Exception& ex) + { + set_state(dheader_state); + ex.raise(); + } + + set_xcdrv2_dheader(dheader_state); + + return *this; + } + + /*! + * @brief This function template serializes a map of primitive. + * @param map_t The map that will be serialized in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& serialize( + const std::map<_K, _T>& map_t) + { + state state_(*this); + + serialize(static_cast(map_t.size())); + + try + { + for (auto it_pair = map_t.begin(); it_pair != map_t.end(); ++it_pair) + { + serialize(it_pair->first); + serialize(it_pair->second); + } + } + catch (exception::Exception& ex) + { + set_state(state_); + ex.raise(); + } + + return *this; + } + + /*! + * @brief Encodes the value of a bitset into the buffer. + * + * @param[in] value A reference to the value which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template ::type* = nullptr> + Cdr& serialize( + const std::bitset& value) + { + return serialize(static_cast(value.to_ulong())); + } + + template ::type* = nullptr> + Cdr& serialize( + const std::bitset& value) + { + return serialize(static_cast(value.to_ulong())); + } + + template ::type* = nullptr> + Cdr& serialize( + const std::bitset& value) + { + return serialize(static_cast(value.to_ulong())); + } + + template ::type* = nullptr> + Cdr& serialize( + const std::bitset& value) + { + return serialize(static_cast(value.to_ullong())); + } + + /*! + * @brief Encodes an array of a type not managed by this encoder into the buffer. + * + * To do that, the encoder expects a function `serialize` to be provided by the type. + * + * @param[in] value Array which will be encoded in the buffer. + * @param[in] num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize_array( + const _T* value, + size_t num_elements) + { + for (size_t count = 0; count < num_elements; ++count) + { + serialize(value[count]); + } + return *this; + } + + /*! + * @brief This function template serializes an array of non-basic objects with a different endianness. + * @param type_t The array of objects that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template + Cdr& serialize_array( + const _T* type_t, + size_t num_elements, + Endianness endianness) + { + bool aux_swap = swap_bytes_; + swap_bytes_ = (swap_bytes_ && (static_cast(endianness_) == endianness)) || + (!swap_bytes_ && (static_cast(endianness_) != endianness)); + + try + { + serialize_array(type_t, num_elements); + swap_bytes_ = aux_swap; + } + catch (exception::Exception& ex) + { + swap_bytes_ = aux_swap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function serializes an array of octets. + * @param octet_t The sequence of octets that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize_array( + const uint8_t* octet_t, + size_t num_elements) + { + return serialize_array(reinterpret_cast(octet_t), num_elements); + } + + /*! + * @brief This function serializes an array of characters. + * @param char_t The array of characters that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_array( + const char* char_t, + size_t num_elements); + + /*! + * @brief This function serializes an array of int8_t. + * @param int8 The sequence of int8_t that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize_array( + const int8_t* int8, + size_t num_elements) + { + return serialize_array(reinterpret_cast(int8), num_elements); + } + + /*! + * @brief This function serializes an array of unsigned shorts. + * @param ushort_t The array of unsigned shorts that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize_array( + const uint16_t* ushort_t, + size_t num_elements) + { + return serialize_array(reinterpret_cast(ushort_t), num_elements); + } + + /*! + * @brief This function serializes an array of shorts. + * @param short_t The array of shorts that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_array( + const int16_t* short_t, + size_t num_elements); + + /*! + * @brief This function serializes an array of unsigned longs. + * @param ulong_t The array of unsigned longs that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize_array( + const uint32_t* ulong_t, + size_t num_elements) + { + return serialize_array(reinterpret_cast(ulong_t), num_elements); + } + + /*! + * @brief This function serializes an array of longs. + * @param long_t The array of longs that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_array( + const int32_t* long_t, + size_t num_elements); + + /*! + * @brief This function serializes an array of wide-chars. + * @param wchar The array of wide-chars that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_array( + const wchar_t* wchar, + size_t num_elements); + + /*! + * @brief This function serializes an array of unsigned long longs. + * @param ulonglong_t The array of unsigned long longs that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize_array( + const uint64_t* ulonglong_t, + size_t num_elements) + { + return serialize_array(reinterpret_cast(ulonglong_t), num_elements); + } + + /*! + * @brief This function serializes an array of long longs. + * @param longlong_t The array of long longs that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_array( + const int64_t* longlong_t, + size_t num_elements); + + /*! + * @brief This function serializes an array of floats. + * @param float_t The array of floats that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_array( + const float* float_t, + size_t num_elements); + + /*! + * @brief This function serializes an array of doubles. + * @param double_t The array of doubles that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_array( + const double* double_t, + size_t num_elements); + + /*! + * @brief This function serializes an array of long doubles. + * @param ldouble_t The array of long doubles that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. + */ + Cdr_DllAPI Cdr& serialize_array( + const long double* ldouble_t, + size_t num_elements); + + /*! + * @brief This function serializes an array of booleans. + * @param bool_t The array of booleans that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& serialize_array( + const bool* bool_t, + size_t num_elements); + + /*! + * @brief This function serializes an array of strings. + * @param string_t The array of strings that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize_array( + const std::string* string_t, + size_t num_elements) + { + for (size_t count = 0; count < num_elements; ++count) + { + serialize(string_t[count].c_str()); + } + return *this; + } + + /*! + * @brief This function serializes an array of wide-strings. + * @param string_t The array of wide-strings that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize_array( + const std::wstring* string_t, + size_t num_elements) + { + for (size_t count = 0; count < num_elements; ++count) + { + serialize(string_t[count].c_str()); + } + return *this; + } + + /*! + * @brief Encodes an array of fixed strings. + * @param[in] value Array of fixed strings which will be encoded in the buffer. + * @param[in] num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize_array( + const fixed_string* value, + size_t num_elements) + { + for (size_t count = 0; count < num_elements; ++count) + { + serialize(value[count].c_str()); + } + return *this; + } + + /*! + * @brief Encodes an std::vector of primitives as an array. + * @param[in] value Reference to a std::vector. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& serialize_array( + const std::vector<_T, _Alloc>& value) + { + serialize_array(value.data(), value.size()); + + return *this; + } + + /*! + * @brief Encodes an std::vector of non-primitives as an array. + * @param[in] value Reference to a std::vector. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& serialize_array( + const std::vector<_T, _Alloc>& value) + { + Cdr::state dheader_state {allocate_xcdrv2_dheader()}; + + serialize_array(value.data(), value.size()); + + set_xcdrv2_dheader(dheader_state); + + return *this; + } + + /*! + * @brief Encodes an std::vector as an array with a different endianness. + * @param[in] value Reference to a std::vector. + * @param[in] endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize_array( + const std::vector<_T, _Alloc>& value, + Endianness endianness) + { + bool aux_swap = swap_bytes_; + swap_bytes_ = (swap_bytes_ && (static_cast(endianness_) == endianness)) || + (!swap_bytes_ && (static_cast(endianness_) != endianness)); + + try + { + serialize_array(value); + swap_bytes_ = aux_swap; + } + catch (exception::Exception& ex) + { + swap_bytes_ = aux_swap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief Encodes an std::vector of booleans as an array. + * @param[in] value Reference to a std::vector. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& serialize_array( + const std::vector& value) + { + serialize_bool_array(value); + + return *this; + } + + /*! + * @brief This function template serializes a raw sequence of non-primitives + * @param sequence_t Pointer to the sequence that will be serialized in the buffer. + * @param num_elements The number of elements contained in the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& serialize_sequence( + const _T* sequence_t, + size_t num_elements) + { + Cdr::state dheader_state {allocate_xcdrv2_dheader()}; + + serialize(static_cast(num_elements)); + + try + { + serialize_array(sequence_t, num_elements); + } + catch (exception::Exception& ex) + { + set_state(dheader_state); + ex.raise(); + } + + set_xcdrv2_dheader(dheader_state); + + return *this; + } + + /*! + * @brief This function template serializes a raw sequence of primitives + * @param sequence_t Pointer to the sequence that will be serialized in the buffer. + * @param num_elements The number of elements contained in the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& serialize_sequence( + const _T* sequence_t, + size_t num_elements) + { + state state_before_error(*this); + + serialize(static_cast(num_elements)); + + try + { + serialize_array(sequence_t, num_elements); + } + catch (exception::Exception& ex) + { + set_state(state_before_error); + ex.raise(); + } + + if (CdrVersion::XCDRv2 == cdr_version_) + { + serialized_member_size_ = get_serialized_member_size<_T>(); + } + + return *this; + } + + /*! + * @brief This function template serializes a raw sequence with a different endianness. + * @param sequence_t Pointer to the sequence that will be serialized in the buffer. + * @param num_elements The number of elements contained in the sequence. + * @param endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template + Cdr& serialize_sequence( + const _T* sequence_t, + size_t num_elements, + Endianness endianness) + { + bool aux_swap = swap_bytes_; + swap_bytes_ = (swap_bytes_ && (static_cast(endianness_) == endianness)) || + (!swap_bytes_ && (static_cast(endianness_) != endianness)); + + try + { + serialize_sequence(sequence_t, num_elements); + swap_bytes_ = aux_swap; + } + catch (exception::Exception& ex) + { + swap_bytes_ = aux_swap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief Decodes the value of a type from the buffer. + * + * To do that, the encoder expects a function `deserialize` to be provided by the type. + * + * @param[out] value Reference to the variable where the value will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, typename = void> + Cdr& deserialize( + _T& value) + { + eprosima::fastcdr::deserialize(*this, value); + return *this; + } + + /*! + * @brief Decodes the value of a type with a different endianness. + * @param[out] value Reference to the variable where the value will be stored after decoding from the buffer. + * @param endianness Endianness that will be used in the deserialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize( + _T& value, + Endianness endianness) + { + bool aux_swap = swap_bytes_; + swap_bytes_ = (swap_bytes_ && (static_cast(endianness_) == endianness)) || + (!swap_bytes_ && (static_cast(endianness_) != endianness)); + + try + { + deserialize(value); + swap_bytes_ = aux_swap; + } + catch (exception::Exception& ex) + { + swap_bytes_ = aux_swap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief Decodes an enumeration from the buffer. + * @param[out] value Reference to the variable where the enumeration will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int32_t>::value>::type* = nullptr> + Cdr& deserialize( + _T& value) + { + int32_t decode_value {0}; + deserialize(decode_value); + value = static_cast<_T>(decode_value); + return *this; + } + + /*! + * @brief Decodes an enumeration from the buffer. + * @param[out] value Reference to the variable where the enumeration will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint32_t>::value>::type* = nullptr> + Cdr& deserialize( + _T& value) + { + uint32_t decode_value {0}; + deserialize(decode_value); + value = static_cast<_T>(decode_value); + return *this; + } + + /*! + * @brief Decodes an enumeration from the buffer. + * @param[out] value Reference to the variable where the enumeration will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int16_t>::value>::type* = nullptr> + Cdr& deserialize( + _T& value) + { + int16_t decode_value {0}; + deserialize(decode_value); + value = static_cast<_T>(decode_value); + return *this; + } + + /*! + * @brief Decodes an enumeration from the buffer. + * @param[out] value Reference to the variable where the enumeration will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint16_t>::value>::type* = nullptr> + Cdr& deserialize( + _T& value) + { + uint16_t decode_value {0}; + deserialize(decode_value); + value = static_cast<_T>(decode_value); + return *this; + } + + /*! + * @brief Decodes an enumeration from the buffer. + * @param[out] value Reference to the variable where the enumeration will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int8_t>::value>::type* = nullptr> + Cdr& deserialize( + _T& value) + { + int8_t decode_value {0}; + deserialize(decode_value); + value = static_cast<_T>(decode_value); + return *this; + } + + /*! + * @brief Decodes an enumeration from the buffer. + * @param[out] value Reference to the variable where the enumeration will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint8_t>::value>::type* = nullptr> + Cdr& deserialize( + _T& value) + { + uint8_t decode_value {0}; + deserialize(decode_value); + value = static_cast<_T>(decode_value); + return *this; + } + + /*! + * @brief This function deserializes an octet. + * @param octet_t The variable that will store the octet read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + uint8_t& octet_t) + { + return deserialize(reinterpret_cast(octet_t)); + } + + /*! + * @brief This function deserializes a character. + * @param char_t The variable that will store the character read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize( + char& char_t); + + /*! + * @brief This function deserializes an int8_t. + * @param int8 The variable that will store the int8_t read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + int8_t& int8) + { + return deserialize(reinterpret_cast(int8)); + } + + /*! + * @brief This function deserializes an unsigned short. + * @param ushort_t The variable that will store the unsigned short read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + uint16_t& ushort_t) + { + return deserialize(reinterpret_cast(ushort_t)); + } + + /*! + * @brief This function deserializes a short. + * @param short_t The variable that will store the short read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize( + int16_t& short_t); + + /*! + * @brief This function deserializes an unsigned long. + * @param ulong_t The variable that will store the unsigned long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + uint32_t& ulong_t) + { + return deserialize(reinterpret_cast(ulong_t)); + } + + /*! + * @brief This function deserializes a long. + * @param long_t The variable that will store the long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize( + int32_t& long_t); + + /*! + * @brief This function deserializes a wide-char. + * @param wchar The variable that will store the wide-char read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + wchar_t& wchar) + { + uint16_t ret; + deserialize(ret); + wchar = static_cast(ret); + return *this; + } + + /*! + * @brief This function deserializes an unsigned long long. + * @param ulonglong_t The variable that will store the unsigned long long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + uint64_t& ulonglong_t) + { + return deserialize(reinterpret_cast(ulonglong_t)); + } + + /*! + * @brief This function deserializes a long long. + * @param longlong_t The variable that will store the long long read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize( + int64_t& longlong_t); + + /*! + * @brief This function deserializes a float. + * @param float_t The variable that will store the float read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize( + float& float_t); + + /*! + * @brief This function deserializes a double. + * @param double_t The variable that will store the double read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize( + double& double_t); + + /*! + * @brief This function deserializes a long double. + * @param ldouble_t The variable that will store the long double read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. + */ + Cdr_DllAPI Cdr& deserialize( + long double& ldouble_t); + + /*! + * @brief This function deserializes a boolean. + * @param bool_t The variable that will store the boolean read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to deserialize an invalid value. + */ + Cdr_DllAPI Cdr& deserialize( + bool& bool_t); + + /*! + * @brief This function deserializes a string. + * This function allocates memory to store the string. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param string_t The pointer that will point to the string read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize( + char*& string_t); + + /*! + * @brief This function deserializes a wide-string. + * This function allocates memory to store the wide string. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param string_t The pointer that will point to the wide string read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize( + wchar_t*& string_t); + + /*! + * @brief This function deserializes a std::string. + * @param string_t The variable that will store the string read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + std::string& string_t) + { + uint32_t length = 0; + const char* str = read_string(length); + string_t.assign(str, length); + return *this; + } + + /*! + * @brief This function deserializes a std::wstring. + * @param string_t The variable that will store the string read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + std::wstring& string_t) + { + uint32_t length = 0; + string_t = read_wstring(length); + return *this; + } + + /*! + * @brief Decodes a fixed string. + * @param[out] value Reference to the variable where the fixed string will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize( + fixed_string& value) + { + uint32_t length = 0; + const char* str = read_string(length); + value.assign(str, length); + return *this; + } + + /*! + * @brief This function template deserializes an array. + * @param array_t The variable that will store the array read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template + Cdr& deserialize( + std::array<_T, _Size>& array_t) + { + if (CdrVersion::XCDRv2 == cdr_version_ && !is_multi_array_primitive(&array_t)) + { + uint32_t dheader {0}; + deserialize(dheader); + + uint32_t count {0}; + auto offset = offset_; + while (offset_ - offset < dheader && count < _Size) + { + deserialize_array(&array_t.data()[count], 1); + ++count; + } + + if (offset_ - offset != dheader) + { + throw exception::BadParamException("Member size greater than size specified by DHEADER"); + } + } + else + { + return deserialize_array(array_t.data(), array_t.size()); + } + + return *this; + } + + /*! + * @brief This function template deserializes a sequence of non-primitive. + * @param vector_t The variable that will store the sequence read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& deserialize( + std::vector<_T, _Alloc>& vector_t) + { + uint32_t sequence_length {0}; + + if (CdrVersion::XCDRv2 == cdr_version_) + { + uint32_t dheader {0}; + deserialize(dheader); + + auto offset = offset_; + + deserialize(sequence_length); + + if (0 == sequence_length) + { + vector_t.clear(); + return *this; + } + else + { + vector_t.resize(sequence_length); + } + + uint32_t count {0}; + while (offset_ - offset < dheader && count < sequence_length) + { + deserialize(vector_t.data()[count]); + ++count; + } + + if (offset_ - offset != dheader) + { + throw exception::BadParamException("Member size differs from the size specified by DHEADER"); + } + } + else + { + state state_before_error(*this); + + deserialize(sequence_length); + + if (sequence_length == 0) + { + vector_t.clear(); + return *this; + } + + if ((end_ - offset_) < sequence_length) + { + set_state(state_before_error); + throw exception::NotEnoughMemoryException( + exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); + } + + try + { + vector_t.resize(sequence_length); + return deserialize_array(vector_t.data(), vector_t.size()); + } + catch (exception::Exception& ex) + { + set_state(state_before_error); + ex.raise(); + } + } + + return *this; + } + + /*! + * @brief This function template deserializes a sequence of primitive. + * @param vector_t The variable that will store the sequence read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& deserialize( + std::vector<_T, _Alloc>& vector_t) + { + uint32_t sequence_length = 0; + state state_before_error(*this); + + deserialize(sequence_length); + + if (sequence_length == 0) + { + vector_t.clear(); + return *this; + } + + if ((end_ - offset_) < sequence_length) + { + set_state(state_before_error); + throw exception::NotEnoughMemoryException( + exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); + } + + try + { + vector_t.resize(sequence_length); + return deserialize_array(vector_t.data(), vector_t.size()); + } + catch (exception::Exception& ex) + { + set_state(state_before_error); + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template deserializes a sequence. + * @param vector_t The variable that will store the sequence read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize( + std::vector& vector_t) + { + return deserialize_bool_sequence(vector_t); + } + + /*! + * @brief This function template deserializes a map of non-primitive. + * @param map_t The variable that will store the map read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& deserialize( + std::map<_K, _T>& map_t) + { + if (CdrVersion::XCDRv2 == cdr_version_) + { + uint32_t dheader {0}; + deserialize(dheader); + + auto offset = offset_; + + uint32_t map_length {0}; + deserialize(map_length); + + map_t.clear(); + + uint32_t count {0}; + while (offset_ - offset < dheader && count < map_length) + { + _K key; + _T val; + deserialize(key); + deserialize(val); + map_t.emplace(std::pair<_K, _T>(std::move(key), std::move(val))); + ++count; + } + + if (offset_ - offset != dheader) + { + throw exception::BadParamException("Member size greater than size specified by DHEADER"); + } + } + else + { + uint32_t sequence_length = 0; + state state_(*this); + + deserialize(sequence_length); + + map_t.clear(); + + try + { + for (uint32_t i = 0; i < sequence_length; ++i) + { + _K key; + _T value; + deserialize(key); + deserialize(value); + map_t.emplace(std::pair<_K, _T>(std::move(key), std::move(value))); + } + } + catch (exception::Exception& ex) + { + set_state(state_); + ex.raise(); + } + } + + return *this; + } + + /*! + * @brief This function template deserializes a map of primitive. + * @param map_t The variable that will store the map read from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& deserialize( + std::map<_K, _T>& map_t) + { + uint32_t sequence_length = 0; + state state_(*this); + + deserialize(sequence_length); + + try + { + for (uint32_t i = 0; i < sequence_length; ++i) + { + _K key; + _T value; + deserialize(key); + deserialize(value); + map_t.emplace(std::pair<_K, _T>(std::move(key), std::move(value))); + } + } + catch (exception::Exception& ex) + { + set_state(state_); + ex.raise(); + } + + return *this; + } + + /*! + * @brief Decodes a bitset from the buffer. + * @param[out] value Reference to the variable where the bitset will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template ::type* = nullptr> + Cdr& deserialize( + std::bitset& value) + { + uint8_t decode_value {0}; + deserialize(decode_value); + value = decode_value; + return *this; + } + + template ::type* = nullptr> + Cdr& deserialize( + std::bitset& value) + { + uint16_t decode_value {0}; + deserialize(decode_value); + value = decode_value; + return *this; + } + + template ::type* = nullptr> + Cdr& deserialize( + std::bitset& value) + { + uint32_t decode_value {0}; + deserialize(decode_value); + value = decode_value; + return *this; + } + + template ::type* = nullptr> + Cdr& deserialize( + std::bitset& value) + { + uint64_t decode_value {0}; + deserialize(decode_value); + value = decode_value; + return *this; + } + + /*! + * @brief Decodes an array of a type not managed by this encoder from the buffer. + * + * To do that, the encoder expects a function `deserialize` to be provided by the type. + * + * @param[out] value Reference to the variable where the array will be stored after decoding from the buffer. + * @param[in] num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize_array( + _T* value, + size_t num_elements) + { + for (size_t count = 0; count < num_elements; ++count) + { + deserialize(value[count]); + } + return *this; + } + + /*! + * @brief This function template deserializes an array of non-basic objects with a different endianness. + * @param type_t The variable that will store the array of objects read from the buffer. + * @param num_elements Number of the elements in the array. + * @param endianness Endianness that will be used in the deserialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template + Cdr& deserialize_array( + _T* type_t, + size_t num_elements, + Endianness endianness) + { + bool aux_swap = swap_bytes_; + swap_bytes_ = (swap_bytes_ && (static_cast(endianness_) == endianness)) || + (!swap_bytes_ && (static_cast(endianness_) != endianness)); + + try + { + deserialize_array(type_t, num_elements); + swap_bytes_ = aux_swap; + } + catch (exception::Exception& ex) + { + swap_bytes_ = aux_swap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function deserializes an array of octets. + * @param octet_t The variable that will store the array of octets read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize_array( + uint8_t* octet_t, + size_t num_elements) + { + return deserialize_array(reinterpret_cast(octet_t), num_elements); + } + + /*! + * @brief This function deserializes an array of characters. + * @param char_t The variable that will store the array of characters read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_array( + char* char_t, + size_t num_elements); + + /*! + * @brief This function deserializes an array of int8_t. + * @param int8 The variable that will store the array of int8_t read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize_array( + int8_t* int8, + size_t num_elements) + { + return deserialize_array(reinterpret_cast(int8), num_elements); + } + + /*! + * @brief This function deserializes an array of unsigned shorts. + * @param ushort_t The variable that will store the array of unsigned shorts read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize_array( + uint16_t* ushort_t, + size_t num_elements) + { + return deserialize_array(reinterpret_cast(ushort_t), num_elements); + } + + /*! + * @brief This function deserializes an array of shorts. + * @param short_t The variable that will store the array of shorts read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_array( + int16_t* short_t, + size_t num_elements); + + /*! + * @brief This function deserializes an array of unsigned longs. + * @param ulong_t The variable that will store the array of unsigned longs read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize_array( + uint32_t* ulong_t, + size_t num_elements) + { + return deserialize_array(reinterpret_cast(ulong_t), num_elements); + } + + /*! + * @brief This function deserializes an array of longs. + * @param long_t The variable that will store the array of longs read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_array( + int32_t* long_t, + size_t num_elements); + + /*! + * @brief This function deserializes an array of wide-chars. + * @param wchar The variable that will store the array of wide-chars read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_array( + wchar_t* wchar, + size_t num_elements); + + /*! + * @brief This function deserializes an array of unsigned long longs. + * @param ulonglong_t The variable that will store the array of unsigned long longs read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize_array( + uint64_t* ulonglong_t, + size_t num_elements) + { + return deserialize_array(reinterpret_cast(ulonglong_t), num_elements); + } + + /*! + * @brief This function deserializes an array of long longs. + * @param longlong_t The variable that will store the array of long longs read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_array( + int64_t* longlong_t, + size_t num_elements); + + /*! + * @brief This function deserializes an array of floats. + * @param float_t The variable that will store the array of floats read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_array( + float* float_t, + size_t num_elements); + + /*! + * @brief This function deserializes an array of doubles. + * @param double_t The variable that will store the array of doubles read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_array( + double* double_t, + size_t num_elements); + + /*! + * @brief This function deserializes an array of long doubles. + * @param ldouble_t The variable that will store the array of long doubles read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + * @note Due to internal representation differences, WIN32 and *NIX like systems are not compatible. + */ + Cdr_DllAPI Cdr& deserialize_array( + long double* ldouble_t, + size_t num_elements); + + /*! + * @brief This function deserializes an array of booleans. + * @param bool_t The variable that will store the array of booleans read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_array( + bool* bool_t, + size_t num_elements); + + /*! + * @brief Decodes an array of primitives on a std::vector. + * + * std::vector must have allocated the number of element of the array. + * + * @param[out] value Reference to the std::vector where the array will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& deserialize_array( + std::vector<_T, _Alloc>& value) + { + deserialize_array(value.data(), value.size()); + + return *this; + } + + /*! + * @brief Decodes an array of non-primitives on a std::vector. + * + * std::vector must have allocated the number of element of the array. + * + * @param[out] value Reference to the std::vector where the array will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& deserialize_array( + std::vector<_T, _Alloc>& value) + { + if (CdrVersion::XCDRv2 == cdr_version_) + { + uint32_t dheader {0}; + deserialize(dheader); + + uint32_t count {0}; + auto offset = offset_; + while (offset_ - offset < dheader && count < value.size()) + { + deserialize_array(&value.data()[count], 1); + ++count; + } + + if (offset_ - offset != dheader) + { + throw exception::BadParamException("Member size greater than size specified by DHEADER"); + } + } + else + { + return deserialize_array(value.data(), value.size()); + } + + return *this; + } + + /*! + * @brief Decodes an array of non-primitives on a std::vector with a different endianness. + * + * std::vector must have allocated the number of element of the array. + * + * @param[out] value Reference to the std::vector where the array will be stored after decoding from the buffer. + * @param[in] endianness Endianness that will be used in the serialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize_array( + std::vector<_T, _Alloc>& value, + Endianness endianness) + { + bool aux_swap = swap_bytes_; + swap_bytes_ = (swap_bytes_ && (static_cast(endianness_) == endianness)) || + (!swap_bytes_ && (static_cast(endianness_) != endianness)); + + try + { + deserialize_array(value); + swap_bytes_ = aux_swap; + } + catch (exception::Exception& ex) + { + swap_bytes_ = aux_swap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief Decodes an array of booleans on a std::vector. + * + * std::vector must have allocated the number of element of the array. + * + * @param[out] value Reference to the std::vector where the array will be stored after decoding from the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize_array( + std::vector& value) + { + deserialize_bool_array(value); + + return *this; + } + + /*! + * @brief This function template deserializes a raw sequence of non-primitives. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param num_elements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& deserialize_sequence( + _T*& sequence_t, + size_t& num_elements) + { + uint32_t sequence_length {0}; + + if (CdrVersion::XCDRv2 == cdr_version_) + { + uint32_t dheader {0}; + deserialize(dheader); + + auto offset = offset_; + + deserialize(sequence_length); + + try + { + sequence_t = reinterpret_cast<_T*>(calloc(sequence_length, sizeof(_T))); + + uint32_t count {0}; + while (offset_ - offset < dheader && count < sequence_length) + { + deserialize(sequence_t[count]); + ++count; + } + + if (offset_ - offset != dheader) + { + throw exception::BadParamException("Member size greater than size specified by DHEADER"); + } + } + catch (exception::Exception& ex) + { + free(sequence_t); + sequence_t = NULL; + ex.raise(); + } + } + else + { + state state_before_error(*this); + + deserialize(sequence_length); + + if ((end_ - offset_) < sequence_length) + { + set_state(state_before_error); + throw exception::NotEnoughMemoryException( + exception::NotEnoughMemoryException::NOT_ENOUGH_MEMORY_MESSAGE_DEFAULT); + } + + try + { + sequence_t = reinterpret_cast<_T*>(calloc(sequence_length, sizeof(_T))); + deserialize_array(sequence_t, sequence_length); + } + catch (exception::Exception& ex) + { + free(sequence_t); + sequence_t = NULL; + set_state(state_before_error); + ex.raise(); + } + } + + num_elements = sequence_length; + return *this; + } + + /*! + * @brief This function template deserializes a raw sequence of primitives. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param num_elements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + Cdr& deserialize_sequence( + _T*& sequence_t, + size_t& num_elements) + { + uint32_t sequence_length = 0; + state state_before_error(*this); + + deserialize(sequence_length); + + try + { + sequence_t = reinterpret_cast<_T*>(calloc(sequence_length, sizeof(_T))); + deserialize_array(sequence_t, sequence_length); + } + catch (exception::Exception& ex) + { + free(sequence_t); + sequence_t = NULL; + set_state(state_before_error); + ex.raise(); + } + + num_elements = sequence_length; + return *this; + } + + /*! + * @brief This function template deserializes a raw sequence with a different endianness. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param num_elements This variable return the number of elements of the sequence. + * @param endianness Endianness that will be used in the deserialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template + Cdr& deserialize_sequence( + _T*& sequence_t, + size_t& num_elements, + Endianness endianness) + { + bool aux_swap = swap_bytes_; + swap_bytes_ = (swap_bytes_ && (static_cast(endianness_) == endianness)) || + (!swap_bytes_ && (static_cast(endianness_) != endianness)); + + try + { + deserialize_sequence(sequence_t, num_elements); + swap_bytes_ = aux_swap; + } + catch (exception::Exception& ex) + { + swap_bytes_ = aux_swap; + ex.raise(); + } + + return *this; + } + + /*! + * @brief This function template deserializes a string sequence. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param num_elements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize_sequence( + std::string*& sequence_t, + size_t& num_elements) + { + return deserialize_string_sequence(sequence_t, num_elements); + } + + /*! + * @brief This function template deserializes a wide-string sequence. + * This function allocates memory to store the sequence. The user pointer will be set to point this allocated memory. + * The user will have to free this allocated memory using free() + * @param sequence_t The pointer that will store the sequence read from the buffer. + * @param num_elements This variable return the number of elements of the sequence. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + TEMPLATE_SPEC + Cdr& deserialize_sequence( + std::wstring*& sequence_t, + size_t& num_elements) + { + return deserialize_wstring_sequence(sequence_t, num_elements); + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// XCDR extensions + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + /*! + * @brief Encodes a member of a type according to the encoding algorithm used. + * @param[in] member_id Member identifier. + * @param[in] member_value Member value. + * @param[in] header_selection Selects which member header will be used to allocate space. + * Default: XCdrHeaderSelection::AUTO_WITH_SHORT_HEADER_BY_DEFAULT. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize_member( + const MemberId& member_id, + const _T& member_value, + XCdrHeaderSelection header_selection = XCdrHeaderSelection::AUTO_WITH_SHORT_HEADER_BY_DEFAULT) + { + Cdr::state current_state(*this); + (this->*begin_serialize_member_)(member_id, true, current_state, header_selection); + serialize(member_value); + return (this->*end_serialize_member_)(current_state); + } + + /*! + * @brief Encodes an optional member of a type according to the encoding algorithm used. + * @param[in] member_id Member identifier. + * @param[in] member_value Optional member value. + * @param[in] header_selection Selects which member header will be used to allocate space. + * Default: XCdrHeaderSelection::AUTO_WITH_SHORT_HEADER_BY_DEFAULT. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize_member( + const MemberId& member_id, + const optional<_T>& member_value, + XCdrHeaderSelection header_selection = XCdrHeaderSelection::AUTO_WITH_SHORT_HEADER_BY_DEFAULT) + { + Cdr::state current_state(*this); + (this->*begin_serialize_opt_member_)(member_id, member_value.has_value(), current_state, header_selection); + serialize(member_value); + return (this->*end_serialize_opt_member_)(current_state); + } + + /*! + * @brief Decodes a member of a type according to the encoding algorithm used. + * @param[out] member_value A reference of the variable where the member value will be stored. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize_member( + _T& member_value) + { + return deserialize(member_value); + } + + /*! + * @brief Decodes an optional member of a type according to the encoding algorithm used. + * @param[out] member_value A reference of the variable where the optional member value will be stored. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize_member( + optional<_T>& member_value) + { + if (EncodingAlgorithmFlag::PLAIN_CDR == current_encoding_) + { + Cdr::state current_state(*this); + MemberId member_id; + xcdr1_deserialize_member_header(member_id, current_state); + auto prev_offset = offset_; + if (0 < current_state.member_size_) + { + deserialize(member_value); + } + size_t member_size {current_state.member_size_}; + size_t diff {offset_ - prev_offset}; + if (member_size < diff) + { + throw exception::BadParamException( + "Member size provided by member header is lower than real decoded member size"); + } + + // Skip unused bytes + offset_ += (member_size - diff); + } + else + { + deserialize(member_value); + } + return *this; + } + + /*! + * @brief Tells to the encoder a new type and its members starts to be encoded. + * @param[in,out] current_state State of the encoder previous of calling this function. + * @param[in] type_encoding The encoding algorithm used to encode the type and its members. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& begin_serialize_type( + Cdr::state& current_state, + EncodingAlgorithmFlag type_encoding); + + /*! + * @brief Tells to the encoder the encoding of the type finishes. + * @param[in] current_state State of the encoder previous of calling the function begin_serialize_type. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& end_serialize_type( + Cdr::state& current_state); + + /*! + * @brief Tells to the encoder a new type and its members starts to be decoded. + * @param[in] type_encoding The encoding algorithm used to decode the type and its members. + * @param[in] functor Functor called each time a member has to be decoded. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + Cdr_DllAPI Cdr& deserialize_type( + EncodingAlgorithmFlag type_encoding, + std::function functor); + + /*! + * @brief Encodes an optional in the buffer. + * @param[in] value A reference to the optional which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize( + const optional<_T>& value) + { + if (CdrVersion::XCDRv2 == cdr_version_ && EncodingAlgorithmFlag::PL_CDR2 != current_encoding_) + { + serialize(value.has_value()); + } + + if (value.has_value()) + { + serialize(*value); + } + return *this; + } + + /*! + * @brief Encodes an external in the buffer. + * @param[in] value A reference to the external which will be encoded in the buffer. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::BadParamException This exception is thrown when external is null. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& serialize( + const external<_T>& value) + { + if (!value) + { + throw exception::BadParamException("External member is null"); + } + + serialize(*value); + return *this; + } + + /*! + * @brief Tells the encoder the member identifier for the next member to be encoded. + * @param[in] member_id Member identifier. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::BadParamException This exception is thrown when a member id is already set without being + * encoded. + */ + Cdr_DllAPI Cdr& operator <<( + const MemberId& member_id); + + /*! + * @brief Decodes an optional from the buffer. + * @param[out] value A reference to the variable where the optional will be stored. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize( + optional<_T>& value) + { + bool is_present = true; + if (CdrVersion::XCDRv2 == cdr_version_ && EncodingAlgorithmFlag::PL_CDR2 != current_encoding_) + { + deserialize(is_present); + } + value.reset(is_present); + if (is_present) + { + deserialize(*value); + } + return *this; + } + + /*! + * @brief Decodes an external from the buffer. + * @param[out] value A reference to the variable where the external will be stored. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::BadParamException This exception is thrown when the external is locked. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize( + external<_T>& value) + { + if (value.is_locked()) + { + throw exception::BadParamException("External member is locked"); + } + + if (!value) + { + value = external<_T>{new typename external<_T>::type()}; + } + + deserialize(*value); + return *this; + } + + /*! + * @brief Decodes an optional of an external from the buffer. + * @param[out] value A reference to the variable where the optional will be stored. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::BadParamException This exception is thrown when the external is locked. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + */ + template + Cdr& deserialize( + optional>& value) + { + if (value.has_value() && value.value().is_locked()) + { + throw exception::BadParamException("External member is locked"); + } + + bool is_present = true; + if (CdrVersion::XCDRv2 == cdr_version_ && EncodingAlgorithmFlag::PL_CDR2 != current_encoding_) + { + deserialize(is_present); + } + value.reset(is_present); + if (is_present) + { + deserialize(*value); + } + return *this; + } + + /*! + * @brief Encodes an empty DHEADER if the encoding version is XCDRv2. + * After serializing the members's type, @ref set_xcdrv2_dheader must be called to set the correct DHEADER value + * using the @ref state returned by this function. + */ + Cdr_DllAPI state allocate_xcdrv2_dheader(); + + /*! + * @brief Uses the @ref state to calculate the member's type size and serialize the value in the previous allocated + * DHEADER. + * + * @param[in] state @ref state used to calculate the member's type size. + */ + Cdr_DllAPI void set_xcdrv2_dheader( + const state& state); + +private: + + Cdr( + const Cdr&) = delete; + + Cdr& operator =( + const Cdr&) = delete; + + Cdr_DllAPI Cdr& serialize_bool_array( + const std::vector& vector_t); + + Cdr_DllAPI Cdr& serialize_bool_sequence( + const std::vector& vector_t); + + Cdr_DllAPI Cdr& deserialize_bool_array( + std::vector& vector_t); + + Cdr_DllAPI Cdr& deserialize_bool_sequence( + std::vector& vector_t); + + Cdr_DllAPI Cdr& deserialize_string_sequence( + std::string*& sequence_t, + size_t& num_elements); + + Cdr_DllAPI Cdr& deserialize_wstring_sequence( + std::wstring*& sequence_t, + size_t& num_elements); + + /*! + * @brief This function template detects the content type of the STD container array and serializes the array. + * @param array_t The array that will be serialized in the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size. + */ + template + Cdr& serialize_array( + const std::array<_T, _Size>* array_t, + size_t num_elements) + { + return serialize_array(array_t->data(), num_elements * array_t->size()); + } + + /*! + * @brief This function template detects the content type of the STD container array and deserializes the array. + * @param array_t The variable that will store the array read from the buffer. + * @param num_elements Number of the elements in the array. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template + Cdr& deserialize_array( + std::array<_T, _Size>* array_t, + size_t num_elements) + { + return deserialize_array(array_t->data(), num_elements * array_t->size()); + } + + /*! + * @brief This function template detects the content type of STD container array and deserializes the array with a different endianness. + * @param array_t The variable that will store the array read from the buffer. + * @param num_elements Number of the elements in the array. + * @param endianness Endianness that will be used in the deserialization of this value. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to deserialize a position that exceeds the internal memory size. + */ + template + Cdr& deserialize_array( + std::array<_T, _Size>* array_t, + size_t num_elements, + Endianness endianness) + { + return deserialize_array(array_t->data(), num_elements * array_t->size(), endianness); + } + + /*! + * @brief Returns the number of bytes needed to align the current position (having as reference the origin) to + * certain data size. + * @param data_size The size of the data that will be serialized. + * @return The size needed for the alignment. + */ + inline size_t alignment( + size_t data_size) const + { + return data_size > last_data_size_ ? (data_size - ((offset_ - origin_) % data_size)) & (data_size - 1) : 0; + } + + /*! + * @brief This function jumps the number of bytes of the alignment. These bytes should be calculated with the function eprosima::fastcdr::Cdr::alignment. + * @param align The number of bytes to be skipped. + */ + inline void make_alignment( + size_t align) + { + offset_ += align; + last_data_size_ = 0; + } + + /*! + * @brief This function resizes the internal buffer. It only applies if the FastBuffer object was created with the default constructor. + * @param min_size_inc Minimun size increase for the internal buffer + * @return True if the resize was succesful, false if it was not + */ + bool resize( + size_t min_size_inc); + + Cdr_DllAPI const char* read_string( + uint32_t& length); + Cdr_DllAPI const std::wstring read_wstring( + uint32_t& length); + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// XCDR extensions + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /*! + * @brief Encodes a short member header of a member according to XCDRv1. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x3F00. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr1_serialize_short_member_header( + const MemberId& member_id); + + /*! + * @brief Finish the encoding of a short member header of a member according to XCDRv1. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x3F00. + * @param[in] member_serialized_size Size of the serialized member. + * @pre Serialized size equal or less than 0xFFFF. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr1_end_short_member_header( + const MemberId& member_id, + size_t member_serialized_size); + + /*! + * @brief Encodes a long member header of a member according to XCDRv1. + * @param[in] member_id Member identifier. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr1_serialize_long_member_header( + const MemberId& member_id); + + /*! + * @brief Finish the encoding of a long member header of a member according to XCDRv1. + * @param[in] member_id Member identifier. + * @param[in] member_serialized_size Size of the serialized member. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr1_end_long_member_header( + const MemberId& member_id, + size_t member_serialized_size); + + /*! + * @brief Changes the previous encoded long header to a short header according to XCDRv1. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x3F00. + * @param[in] member_serialized_size Size of the serialized member. + * @pre Serialized size equal or less than 0xFFFF. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr1_change_to_short_member_header( + const MemberId& member_id, + size_t member_serialized_size); + + /*! + * @brief Changes the previous encoded short header to a long header according to XCDRv1. + * @param[in] member_id Member identifier. + * @param[in] member_serialized_size Size of the serialized member. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr1_change_to_long_member_header( + const MemberId& member_id, + size_t member_serialized_size); + + /*! + * @brief Decodes a member header according to XCDRv1. + * @param[out] member_id Member identifier. + * @param[in,out] current_state State of the encoder previous to call this function. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to decode an invalid value. + */ + Cdr_DllAPI bool xcdr1_deserialize_member_header( + MemberId& member_id, + Cdr::state& current_state); + + /*! + * @brief Encodes a short member header of a member according to XCDRv2. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x10000000. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr2_serialize_short_member_header( + const MemberId& member_id); + + /*! + * @brief Finish the encoding of a short member header of a member according to XCDRv2. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x10000000. + * @param[in] member_serialized_size Size of the serialized member. + * @pre Serialized size equal or less than 0x8. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr2_end_short_member_header( + const MemberId& member_id, + size_t member_serialized_size); + + /*! + * @brief Encodes a long member header of a member according to XCDRv2. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x10000000. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr2_serialize_long_member_header( + const MemberId& member_id); + + /*! + * @brief Finish the encoding of a long member header of a member according to XCDRv2. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x10000000. + * @param[in] member_serialized_size Size of the serialized member. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr2_end_long_member_header( + const MemberId& member_id, + size_t member_serialized_size); + + /*! + * @brief Changes the previous encoded long header to a short header according to XCDRv2. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x10000000. + * @param[in] member_serialized_size Size of the serialized member. + * @pre Serialized size equal or less than 8. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr2_change_to_short_member_header( + const MemberId& member_id, + size_t member_serialized_size); + + /*! + * @brief Changes the previous encoded long header to a short header according to XCDRv2. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x10000000. + * @param[in] member_serialized_size Size of the serialized member. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr2_change_to_long_member_header( + const MemberId& member_id, + size_t member_serialized_size); + + /*! + * @brief Join the previous encoded long header with the next DHEADER which was serialized after. + * @param[in] member_id Member identifier. + * @pre Member identifier less than 0x10000000. + * @param[in] offset The last offset of the buffer previous to call this function. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + void xcdr2_shrink_to_long_member_header( + const MemberId& member_id, + const FastBuffer::iterator& offset); + + /*! + * @brief Decodes a member header according to XCDRv2. + * @param[out] member_id Member identifier. + * @param[in,out] current_state State of the encoder previous to call this function. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to decode from a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to decode an invalid value. + */ + void xcdr2_deserialize_member_header( + MemberId& member_id, + Cdr::state& current_state); + + /*! + * @brief Tells to the encoder a member starts to be encoded according to XCDRv1. + * @param[in] member_id Member identifier. + * @pre Member identifier cannot be MEMBER_ID_INVALID and next_member_id_ must be equal to the member identifier or + * MEMBER_ID_INVALID. + * @param[in] is_present If the member is present. + * @pre When XCDRv1, is_present must be always true. + * @param[in,out] current_state State of the encoder previous to call this function. + * @pre Current encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR or EncodingAlgorithmFlag::PL_CDR. + * @param[in] header_selection Selects which member header will be used to allocate space. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to encode a long header when + * header_selection is XCdrHeaderSelection::SHORT_HEADER. + */ + Cdr& xcdr1_begin_serialize_member( + const MemberId& member_id, + bool is_present, + Cdr::state& current_state, + XCdrHeaderSelection header_selection); + + /*! + * @brief Tells to the encoder to finish the encoding of the member. + * @param[in] current_state State of the encoder previous to call xcdr1_begin_serialize_member function. + * @pre next_member_id_ cannot be MEMBER_ID_INVALID. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to encode a long header when + * header_selection is XCdrHeaderSelection::SHORT_HEADER. + */ + Cdr& xcdr1_end_serialize_member( + const Cdr::state& current_state); + + /*! + * @brief Tells to the encoder a member starts to be encoded according to XCDRv1. + * @param[in] member_id Member identifier. + * @pre Member identifier cannot be MEMBER_ID_INVALID and next_member_id_ must be equal to the member identifier or + * MEMBER_ID_INVALID. + * @param[in] is_present If the member is present. + * @param[in,out] current_state State of the encoder previous to call this function. + * @pre Current encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR or EncodingAlgorithmFlag::PL_CDR. + * @param[in] header_selection Selects which member header will be used to allocate space. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to encode a long header when + * header_selection is XCdrHeaderSelection::SHORT_HEADER. + */ + Cdr& xcdr1_begin_serialize_opt_member( + const MemberId& member_id, + bool is_present, + Cdr::state& current_state, + XCdrHeaderSelection header_selection); + + /*! + * @brief Tells to the encoder to finish the encoding of the member. + * @param[in] current_state State of the encoder previous to call xcdr1_begin_serialize_opt_member function. + * @pre next_member_id_ cannot be MEMBER_ID_INVALID. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to encode a long header when + * header_selection is XCdrHeaderSelection::SHORT_HEADER. + */ + Cdr& xcdr1_end_serialize_opt_member( + const Cdr::state& current_state); + + /*! + * @brief Tells to the encoder a member starts to be encoded according to XCDRv2. + * @param[in] member_id Member identifier. + * @pre Member identifier cannot be MEMBER_ID_INVALID and next_member_id_ must be equal to the member identifier or + * MEMBER_ID_INVALID. + * @param[in] is_present If the member is present. + * @param[in,out] current_state State of the encoder previous to call this function. + * @pre Current encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR2, EncodingAlgorithmFlag::DELIMIT_CDR2 or + * EncodingAlgorithmFlag::PL_CDR2. + * @param[in] header_selection Selects which member header will be used to allocate space. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to encode member identifier equal or + * greater than 0x10000000. + */ + Cdr& xcdr2_begin_serialize_member( + const MemberId& member_id, + bool is_present, + Cdr::state& current_state, + XCdrHeaderSelection header_selection); + + /*! + * @brief Tells to the encoder to finish the encoding of the member. + * @param[in] current_state State of the encoder previous to call xcdr2_begin_serialize_member function. + * @pre next_member_id_ cannot be MEMBER_ID_INVALID. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when trying to encode a long header when + * header_selection is XCdrHeaderSelection::SHORT_HEADER. + */ + Cdr& xcdr2_end_serialize_member( + const Cdr::state& current_state); + + /*! + * @brief Tells to the encoder a new type and its members start to be encoded according to XCDRv1. + * @param[in,out] current_state State of the encoder previous to call this function. + * @pre Current encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR or EncodingAlgorithmFlag::PL_CDR. + * @param[in] type_encoding Encoding algorithm used to encode the type and its members. + * @pre Type encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR or EncodingAlgorithmFlag::PL_CDR. + * @pre If it is the beginning of the whole encoding, current encoding must be equal to type encoding. + * @return Reference to the eprosima::fastcdr::Cdr object. + */ + Cdr& xcdr1_begin_serialize_type( + Cdr::state& current_state, + EncodingAlgorithmFlag type_encoding) noexcept; + + /*! + * @brief Tells to the encoder to finish the encoding of the type. + * @param[in] current_state State of the encoder previous to call xcdr1_begin_serialize_type function. + * @pre Current encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR or EncodingAlgorithmFlag::PL_CDR. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + Cdr& xcdr1_end_serialize_type( + const Cdr::state& current_state); + + /*! + * @brief Tells to the encoder a new type and its members start to be encoded according to XCDRv2. + * @param[in,out] current_state State of the encoder previous to call this function. + * @pre Current encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR2, EncodingAlgorithmFlag::DELIMIT_CDR2 or + * EncodingAlgorithmFlag::PL_CDR2. + * @param[in] type_encoding Encoding algorithm used to encode the type and its members. + * @pre Type encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR2, EncodingAlgorithmFlag::DELIMIT_CDR2 or + * EncodingAlgorithmFlag::PL_CDR2. + * @pre If it is the beginning of the whole encoding, current encoding must be equal to type encoding. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + Cdr& xcdr2_begin_serialize_type( + Cdr::state& current_state, + EncodingAlgorithmFlag type_encoding); + + /*! + * @brief Tells to the encoder to finish the encoding of the type. + * @param[in] current_state State of the encoder previous to call xcdr2_begin_serialize_type function. + * @pre Current encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR2, EncodingAlgorithmFlag::DELIMIT_CDR2 or + * EncodingAlgorithmFlag::PL_CDR2. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + */ + Cdr& xcdr2_end_serialize_type( + const Cdr::state& current_state); + + /*! + * @brief Tells to the encoder a new type and its members start to be decoded according to XCDRv1. + * @param[in] type_encoding Encoding algorithm used to encode the type and its members. + * @pre Type encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR or EncodingAlgorithmFlag::PL_CDR. + * @pre If it is the beginning of the whole encoding, current encoding must be equal to type encoding. + * @param[in] functor Functor called each time a member has to be decoded. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when an incorrect behaviour happens when + * trying to decode. + */ + Cdr& xcdr1_deserialize_type( + EncodingAlgorithmFlag type_encoding, + std::function functor); + + /*! + * @brief Tells to the encoder a new type and its members start to be decoded according to XCDRv2. + * @param[in] type_encoding Encoding algorithm used to encode the type and its members. + * @pre Type encoding algorithm must be EncodingAlgorithmFlag::PLAIN_CDR2, EncodingAlgorithmFlag::DELIMIT_CDR2 or + * EncodingAlgorithmFlag::PL_CDR2. + * @pre If it is the beginning of the whole encoding, current encoding must be equal to type encoding. + * @param[in] functor Functor called each time a member has to be decoded. + * @return Reference to the eprosima::fastcdr::Cdr object. + * @exception exception::NotEnoughMemoryException This exception is thrown when trying to encode into a buffer + * position that exceeds the internal memory size. + * @exception exception::BadParamException This exception is thrown when an incorrect behaviour happens when + * trying to decode. + */ + Cdr& xcdr2_deserialize_type( + EncodingAlgorithmFlag type_encoding, + std::function functor); + + Cdr& cdr_begin_serialize_member( + const MemberId& member_id, + bool is_present, + Cdr::state& current_state, + XCdrHeaderSelection header_selection); + + Cdr& cdr_end_serialize_member( + const Cdr::state& current_state); + + Cdr& cdr_begin_serialize_type( + Cdr::state& current_state, + EncodingAlgorithmFlag type_encoding); + + Cdr& cdr_end_serialize_type( + const Cdr::state& current_state); + + Cdr& cdr_deserialize_type( + EncodingAlgorithmFlag type_encoding, + std::function functor); + + /*! + * @brief Resets the internal callbacks depending on the current selected Cdr version. + */ + void reset_callbacks(); + + using begin_serialize_member_functor = Cdr& (Cdr::*)( + const MemberId&, + bool, + Cdr::state&, + XCdrHeaderSelection); + begin_serialize_member_functor begin_serialize_member_ { nullptr }; + + using end_serialize_member_functor = Cdr& (Cdr::*)( + const Cdr::state&); + end_serialize_member_functor end_serialize_member_ { nullptr }; + + using begin_serialize_opt_member_functor = Cdr& (Cdr::*)( + const MemberId&, + bool, + Cdr::state&, + XCdrHeaderSelection); + begin_serialize_opt_member_functor begin_serialize_opt_member_ { nullptr }; + + using end_serialize_memberopt__functor = Cdr& (Cdr::*)( + const Cdr::state&); + end_serialize_member_functor end_serialize_opt_member_ { nullptr }; + + using begin_serialize_type_functor = Cdr& (Cdr::*)( + Cdr::state&, + EncodingAlgorithmFlag); + begin_serialize_type_functor begin_serialize_type_ { nullptr }; + + using end_serialize_type_functor = Cdr& (Cdr::*)( + const Cdr::state&); + end_serialize_type_functor end_serialize_type_ { nullptr }; + + using deserialize_type_functor = Cdr& (Cdr::*)( + EncodingAlgorithmFlag, + std::function); + deserialize_type_functor deserialize_type_ { nullptr }; + + //! @brief Reference to the buffer that will be serialized/deserialized. + FastBuffer& cdr_buffer_; + + //! @brief The type of CDR that will be use in serialization/deserialization. + CdrVersion cdr_version_ {CdrVersion::XCDRv2}; + + //! @brief Stores the main encoding algorithm. + EncodingAlgorithmFlag encoding_flag_ {EncodingAlgorithmFlag::PLAIN_CDR2}; + + //! @brief Stores the current encoding algorithm. + EncodingAlgorithmFlag current_encoding_ {EncodingAlgorithmFlag::PLAIN_CDR2}; + + //! @brief This attribute stores the option flags when the CDR type is DDS_CDR; + std::array options_{{0}}; + + //! @brief The endianness that will be applied over the buffer. + uint8_t endianness_ {Endianness::LITTLE_ENDIANNESS}; + + //! @brief This attribute specifies if it is needed to swap the bytes. + bool swap_bytes_ {false}; + + //! @brief Stores the last datasize serialized/deserialized. It's used to optimize. + size_t last_data_size_ {0}; + + //! @brief The current position in the serialization/deserialization process. + FastBuffer::iterator offset_; + + //! @brief The position from where the alignment is calculated. + FastBuffer::iterator origin_; + + //! @brief The last position in the buffer; + FastBuffer::iterator end_; + + //! Next member identifier to be processed. + MemberId next_member_id_; + + //! Align for types equal or greater than 64bits. + size_t align64_ {4}; + + /*! + * When serializing a member's type using XCDRv2, this enumerator is used to inform the type was serialized with a + * DHEADER and the algorithm could optimize the XCDRv2 member header. + */ + enum SerializedMemberSizeForNextInt + { + NO_SERIALIZED_MEMBER_SIZE, //! Default. No serialized member size in a DHEADER. + SERIALIZED_MEMBER_SIZE, //! Serialized member size in a DHEADER. + SERIALIZED_MEMBER_SIZE_4, //! Serialized member size (which is a multiple of 4) in a DHEADER. + SERIALIZED_MEMBER_SIZE_8 //! Serialized member size (which is a multiple of 8) in a DHEADER. + } + //! Specifies if a DHEADER was serialized. Used to optimize XCDRv2 member headers. + serialized_member_size_ {NO_SERIALIZED_MEMBER_SIZE}; + + //! Stores the initial state. + state initial_state_; + + //! Whether the encapsulation was serialized. + bool encapsulation_serialized_ {false}; + + + uint32_t get_long_lc( + SerializedMemberSizeForNextInt serialized_member_size); + + uint32_t get_short_lc( + size_t member_serialized_size); + + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + constexpr SerializedMemberSizeForNextInt get_serialized_member_size() const + { + return (1 == sizeof(_T) ? SERIALIZED_MEMBER_SIZE : + (4 == sizeof(_T) ? SERIALIZED_MEMBER_SIZE_4 : + (8 == sizeof(_T) ? SERIALIZED_MEMBER_SIZE_8 : NO_SERIALIZED_MEMBER_SIZE))); + } + +}; + +} //namespace fastcdr +} //namespace eprosima -#endif // _CDR_CDR_H_ +#endif // _CDR_CDR_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/fastcdr/CdrSizeCalculator.hpp b/LibCarla/source/carla/ros2/fastdds/fastcdr/CdrSizeCalculator.hpp new file mode 100644 index 00000000000..c49799a2fbd --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/fastcdr/CdrSizeCalculator.hpp @@ -0,0 +1,1347 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTCDR_CDRSIZECALCULATOR_HPP_ +#define _FASTCDR_CDRSIZECALCULATOR_HPP_ + +#include +#include +#include +#include +#include +#include + +#include "fastcdr/fastcdr_dll.h" + +#include "fastcdr/CdrEncoding.hpp" +#include "fastcdr/cdr/fixed_size_string.hpp" +#include "fastcdr/detail/container_recursive_inspector.hpp" +#include "fastcdr/exceptions/BadParamException.h" +#include "fastcdr/xcdr/external.hpp" +#include "fastcdr/xcdr/MemberId.hpp" +#include "fastcdr/xcdr/optional.hpp" + +namespace eprosima { +namespace fastcdr { + +class CdrSizeCalculator; + +template +extern size_t calculate_serialized_size( + CdrSizeCalculator&, + const _T&, + size_t&); + +/*! + * @brief This class offers an interface to calculate the encoded size of a type serialized using a support encoding + * algorithm. + * @ingroup FASTCDRAPIREFERENCE + */ +class CdrSizeCalculator +{ +public: + + /*! + * @brief Constructor. + * @param[in] cdr_version Represents the version of the encoding algorithm that will be used for the encoding. + * The default value is CdrVersion::XCDRv2. + */ + Cdr_DllAPI CdrSizeCalculator( + CdrVersion cdr_version); + + /*! + * @brief Constructor. + * @param[in] cdr_version Represents the version of the encoding algorithm that will be used for the encoding. + * The default value is CdrVersion::XCDRv2. + * @param[in] encoding Represents the initial encoding. + */ + Cdr_DllAPI CdrSizeCalculator( + CdrVersion cdr_version, + EncodingAlgorithmFlag encoding); + + /*! + * @brief Retrieves the version of the encoding algorithm used by the instance. + * @return Configured CdrVersion. + */ + Cdr_DllAPI CdrVersion get_cdr_version() const; + + /*! + * @brief Retrieves the current encoding algorithm used by the instance. + * @return Configured EncodingAlgorithmFlag. + */ + Cdr_DllAPI EncodingAlgorithmFlag get_encoding() const; + + /*! + * @brief Generic template which calculates the encoded size of an instance of an unknown type. + * @tparam _T Instance's type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value>::type* = nullptr, typename = void> + size_t calculate_serialized_size( + const _T& data, + size_t& current_alignment) + { + return eprosima::fastcdr::calculate_serialized_size(*this, data, current_alignment); + } + + /*! + * @brief Template which calculates the encoded size of an instance of an enumeration of 32bits. + * @tparam _T Instance's type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int32_t>::value>::type* = nullptr> + size_t calculate_serialized_size( + const _T& data, + size_t& current_alignment) + { + return calculate_serialized_size(static_cast(data), current_alignment); + } + + /*! + * @brief Template which calculates the encoded size of an instance of an enumeration of unsigned 32bits. + * @tparam _T Instance's type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint32_t>::value>::type* = nullptr> + size_t calculate_serialized_size( + const _T& data, + size_t& current_alignment) + { + return calculate_serialized_size(static_cast(data), current_alignment); + } + + /*! + * @brief Template which calculates the encoded size of an instance of an enumeration of 16bits. + * @tparam _T Instance's type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int16_t>::value>::type* = nullptr> + size_t calculate_serialized_size( + const _T& data, + size_t& current_alignment) + { + return calculate_serialized_size(static_cast(data), current_alignment); + } + + /*! + * @brief Template which calculates the encoded size of an instance of an enumeration of unsigned 16bits. + * @tparam _T Instance's type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint16_t>::value>::type* = nullptr> + size_t calculate_serialized_size( + const _T& data, + size_t& current_alignment) + { + return calculate_serialized_size(static_cast(data), current_alignment); + } + + /*! + * @brief Template which calculates the encoded size of an instance of an enumeration of 8bits. + * @tparam _T Instance's type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + int8_t>::value>::type* = nullptr> + size_t calculate_serialized_size( + const _T& data, + size_t& current_alignment) + { + return calculate_serialized_size(static_cast(data), current_alignment); + } + + /*! + * @brief Template which calculates the encoded size of an instance of an enumeration of unsigned 8bits. + * @tparam _T Instance's type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value>::type* = nullptr, + typename std::enable_if::type, + uint8_t>::value>::type* = nullptr> + size_t calculate_serialized_size( + const _T& data, + size_t& current_alignment) + { + return calculate_serialized_size(static_cast(data), current_alignment); + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an int8_t. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const int8_t& data, + size_t& current_alignment) + { + static_cast(data); + ++current_alignment; + return 1; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an uint8_t. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const uint8_t& data, + size_t& current_alignment) + { + static_cast(data); + ++current_alignment; + return 1; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a char. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const char& data, + size_t& current_alignment) + { + static_cast(data); + ++current_alignment; + return 1; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a bool. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const bool& data, + size_t& current_alignment) + { + static_cast(data); + ++current_alignment; + return 1; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a wchar. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const wchar_t& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {2 + alignment(current_alignment, 2)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a int16_t. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const int16_t& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {2 + alignment(current_alignment, 2)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a uint16_t. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const uint16_t& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {2 + alignment(current_alignment, 2)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a int32_t. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const int32_t& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {4 + alignment(current_alignment, 4)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a uint32_t. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const uint32_t& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {4 + alignment(current_alignment, 4)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a int64_t. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const int64_t& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {8 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a uint64_t. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const uint64_t& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {8 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a float. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const float& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {4 + alignment(current_alignment, 4)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a double. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const double& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {8 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a long double. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const long double& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {16 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a std::string. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const std::string& data, + size_t& current_alignment) + { + size_t calculated_size {4 + alignment(current_alignment, 4) + data.size() + 1}; + current_alignment += calculated_size; + serialized_member_size_ = SERIALIZED_MEMBER_SIZE; + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a std::wstring. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const std::wstring& data, + size_t& current_alignment) + { + size_t calculated_size {4 + alignment(current_alignment, 4) + data.size() * 2}; + current_alignment += calculated_size; + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a fixed_string. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template + size_t calculate_serialized_size( + const fixed_string& data, + size_t& current_alignment) + { + size_t calculated_size {4 + alignment(current_alignment, 4) + data.size() + 1}; + current_alignment += calculated_size; + serialized_member_size_ = SERIALIZED_MEMBER_SIZE; + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a sequence of non-primitives. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + size_t calculate_serialized_size( + const std::vector<_T, _Alloc>& data, + size_t& current_alignment) + { + size_t initial_alignment {current_alignment}; + + if (CdrVersion::XCDRv2 == cdr_version_) + { + // DHEADER + current_alignment += 4 + alignment(current_alignment, 4); + } + + current_alignment += 4 + alignment(current_alignment, 4); + + size_t calculated_size {current_alignment - initial_alignment}; + calculated_size += calculate_array_serialized_size(data.data(), data.size(), current_alignment); + + if (CdrVersion::XCDRv2 == cdr_version_) + { + // Inform DHEADER can be joined with NEXTINT + serialized_member_size_ = SERIALIZED_MEMBER_SIZE; + } + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a sequence of primitives. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + size_t calculate_serialized_size( + const std::vector<_T, _Alloc>& data, + size_t& current_alignment) + { + size_t initial_alignment {current_alignment}; + + current_alignment += 4 + alignment(current_alignment, 4); + + size_t calculated_size {current_alignment - initial_alignment}; + calculated_size += calculate_array_serialized_size(data.data(), data.size(), current_alignment); + + if (CdrVersion::XCDRv2 == cdr_version_) + { + serialized_member_size_ = get_serialized_member_size<_T>(); + } + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a sequence of bool. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_serialized_size( + const std::vector& data, + size_t& current_alignment) + { + size_t calculated_size {data.size() + 4 + alignment(current_alignment, 4)}; + current_alignment += calculated_size; + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template + size_t calculate_serialized_size( + const std::array<_T, _Size>& data, + size_t& current_alignment) + { + size_t initial_alignment {current_alignment}; + + if (CdrVersion::XCDRv2 == cdr_version_ && + !is_multi_array_primitive(&data)) + { + // DHEADER + current_alignment += 4 + alignment(current_alignment, 4); + } + + size_t calculated_size {current_alignment - initial_alignment}; + calculated_size += calculate_array_serialized_size(data.data(), data.size(), current_alignment); + + if (CdrVersion::XCDRv2 == cdr_version_ && + !is_multi_array_primitive(&data)) + { + // Inform DHEADER can be joined with NEXTINT + serialized_member_size_ = SERIALIZED_MEMBER_SIZE; + } + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a map of non-primitives. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value && + !std::is_arithmetic<_V>::value>::type* = nullptr> + size_t calculate_serialized_size( + const std::map<_K, _V>& data, + size_t& current_alignment) + { + size_t initial_alignment {current_alignment}; + + if (CdrVersion::XCDRv2 == cdr_version_) + { + // DHEADER + current_alignment += 4 + alignment(current_alignment, 4); + } + + current_alignment += 4 + alignment(current_alignment, 4); + + size_t calculated_size {current_alignment - initial_alignment}; + for (auto it = data.begin(); it != data.end(); ++it) + { + calculated_size += calculate_serialized_size(it->first, current_alignment); + calculated_size += calculate_serialized_size(it->second, current_alignment); + } + + if (CdrVersion::XCDRv2 == cdr_version_) + { + // Inform DHEADER can be joined with NEXTINT + serialized_member_size_ = SERIALIZED_MEMBER_SIZE; + } + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a map of primitives. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value || + std::is_arithmetic<_V>::value>::type* = nullptr> + size_t calculate_serialized_size( + const std::map<_K, _V>& data, + size_t& current_alignment) + { + size_t initial_alignment {current_alignment}; + + current_alignment += 4 + alignment(current_alignment, 4); + + size_t calculated_size {current_alignment - initial_alignment}; + for (auto it = data.begin(); it != data.end(); ++it) + { + calculated_size += calculate_serialized_size(it->first, current_alignment); + calculated_size += calculate_serialized_size(it->second, current_alignment); + } + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a bitset of 8bits. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template ::type* = nullptr> + size_t calculate_serialized_size( + const std::bitset& data, + size_t& current_alignment) + { + static_cast(data); + ++current_alignment; + return 1; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a bitset of 16bits. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template ::type* = nullptr> + size_t calculate_serialized_size( + const std::bitset& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {2 + alignment(current_alignment, 2)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a bitset of 32bits. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template ::type* = nullptr> + size_t calculate_serialized_size( + const std::bitset& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {4 + alignment(current_alignment, 4)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a bitset of 64bits. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template ::type* = nullptr> + size_t calculate_serialized_size( + const std::bitset& data, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {8 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an optional type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template + size_t calculate_serialized_size( + const optional<_T>& data, + size_t& current_alignment) + { + size_t initial_alignment = current_alignment; + + if (CdrVersion::XCDRv2 == cdr_version_ && + EncodingAlgorithmFlag::PL_CDR2 != current_encoding_) + { + // Take into account the boolean is_present; + ++current_alignment; + } + + size_t calculated_size {current_alignment - initial_alignment}; + + if (data.has_value()) + { + calculated_size += calculate_serialized_size(data.value(), current_alignment); + } + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an external type. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @exception exception::BadParamException This exception is thrown when the external is null. + * @return Encoded size of the instance. + */ + template + size_t calculate_serialized_size( + const external<_T>& data, + size_t& current_alignment) + { + if (!data) + { + throw exception::BadParamException("External member is null"); + } + + return calculate_serialized_size(*data, current_alignment); + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of unknown type. + * @tparam _T Array's type. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template + size_t calculate_array_serialized_size( + const _T* data, + size_t num_elements, + size_t& current_alignment) + { + size_t calculated_size {0}; + + for (size_t count = 0; count < num_elements; ++count) + { + calculated_size += calculate_serialized_size(data[count], current_alignment); + } + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of int8_t. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const int8_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + current_alignment += num_elements; + return num_elements; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of uint8_t. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const uint8_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + current_alignment += num_elements; + return num_elements; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of char. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const char* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + current_alignment += num_elements; + return num_elements; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of wchar. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const wchar_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 2 + alignment(current_alignment, 2)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of int16_t. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const int16_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 2 + alignment(current_alignment, 2)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of uint16_t. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const uint16_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 2 + alignment(current_alignment, 2)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of int32_t. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const int32_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 4 + alignment(current_alignment, 4)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of uint32_t. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const uint32_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 4 + alignment(current_alignment, 4)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of int64_t. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const int64_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 8 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of uint64_t. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const uint64_t* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 8 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of float. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const float* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 4 + alignment(current_alignment, 4)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of double. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const double* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 8 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of an array of long double. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const long double* data, + size_t num_elements, + size_t& current_alignment) + { + static_cast(data); + size_t calculated_size {num_elements* 16 + alignment(current_alignment, align64_)}; + current_alignment += calculated_size; + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an instance of a multi-dimensional array. + * @param[in] data Reference to the array's instance. + * @param[in] num_elements Number of elements in the array. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template + size_t calculate_array_serialized_size( + const std::array<_T, _N>* data, + size_t num_elements, + size_t& current_alignment) + { + return calculate_array_serialized_size(data->data(), num_elements * data->size(), current_alignment); + } + + /*! + * @brief Specific template which calculates the encoded size of an std::vector of primitives as an array. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + size_t calculate_array_serialized_size( + const std::vector<_T, _Alloc>& data, + size_t& current_alignment) + { + return calculate_array_serialized_size(data.data(), data.size(), current_alignment); + } + + /*! + * @brief Specific template which calculates the encoded size of an std::vector of non-primitives as an array. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + template::value && + !std::is_arithmetic<_T>::value>::type* = nullptr> + size_t calculate_array_serialized_size( + const std::vector<_T, _Alloc>& data, + size_t& current_alignment) + { + size_t initial_alignment {current_alignment}; + + if (CdrVersion::XCDRv2 == cdr_version_) + { + // DHEADER + current_alignment += 4 + alignment(current_alignment, 4); + } + + size_t calculated_size {current_alignment - initial_alignment}; + calculated_size += calculate_array_serialized_size(data.data(), data.size(), current_alignment); + + if (CdrVersion::XCDRv2 == cdr_version_) + { + // Inform DHEADER can be joined with NEXTINT + serialized_member_size_ = SERIALIZED_MEMBER_SIZE; + } + + return calculated_size; + } + + /*! + * @brief Specific template which calculates the encoded size of an std::vector of bool as an array. + * @param[in] data Reference to the instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the instance. + */ + TEMPLATE_SPEC + size_t calculate_array_serialized_size( + const std::vector& data, + size_t& current_alignment) + { + current_alignment += data.size(); + return data.size(); + } + + /*! + * @brief Generic template which calculates the encoded size of the constructed type's member of a unknown type. + * @tparam _T Member's type. + * @param[in] id Member's identifier. + * @param[in] data Reference to the member's instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the member's instance. + */ + template + size_t calculate_member_serialized_size( + const MemberId& id, + const _T& data, + size_t& current_alignment) + { + size_t initial_alignment {current_alignment}; + + if (EncodingAlgorithmFlag::PL_CDR == current_encoding_ || + EncodingAlgorithmFlag::PL_CDR2 == current_encoding_) + { + // Align to 4 for the XCDR header before calculating the data serialized size. + current_alignment += alignment(current_alignment, 4); + } + + size_t prev_size {current_alignment - initial_alignment}; + size_t extra_size {0}; + + if (EncodingAlgorithmFlag::PL_CDR == current_encoding_) + { + current_alignment = 0; + } + + size_t calculated_size {calculate_serialized_size(data, current_alignment)}; + + if (CdrVersion::XCDRv2 == cdr_version_ && EncodingAlgorithmFlag::PL_CDR2 == current_encoding_ && + 0 < calculated_size) + { + + if (8 < calculated_size || + (1 != calculated_size && 2 != calculated_size && 4 != calculated_size && + 8 != calculated_size)) + { + extra_size = 8; // Long EMHEADER. + if (NO_SERIALIZED_MEMBER_SIZE != serialized_member_size_) + { + calculated_size -= 4; // Join NEXTINT and DHEADER. + } + } + else + { + extra_size = 4; // EMHEADER; + } + } + else if (CdrVersion::XCDRv1 == cdr_version_ && EncodingAlgorithmFlag::PL_CDR == current_encoding_ && + 0 < calculated_size) + { + extra_size = 4; // ShortMemberHeader + + if (0x3F00 < id.id || calculated_size > std::numeric_limits::max()) + { + extra_size += 8; // LongMemberHeader + } + + } + + calculated_size += prev_size + extra_size; + if (EncodingAlgorithmFlag::PL_CDR != current_encoding_) + { + current_alignment += extra_size; + } + + serialized_member_size_ = NO_SERIALIZED_MEMBER_SIZE; + + return calculated_size; + } + + /*! + * @brief Generic template which calculates the encoded size of the constructed type's member of type optional. + * @tparam _T Member's optional type. + * @param[in] id Member's identifier. + * @param[in] data Reference to the member's instance. + * @param[inout] current_alignment Current alignment in the encoding. + * @return Encoded size of the member's instance. + */ + template + size_t calculate_member_serialized_size( + const MemberId& id, + const optional<_T>& data, + size_t& current_alignment) + { + size_t initial_alignment = current_alignment; + + if (CdrVersion::XCDRv2 != cdr_version_ || + EncodingAlgorithmFlag::PL_CDR2 == current_encoding_) + { + if (data.has_value() || EncodingAlgorithmFlag::PLAIN_CDR == current_encoding_) + { + // Align to 4 for the XCDR header before calculating the data serialized size. + current_alignment += alignment(current_alignment, 4); + } + } + + size_t prev_size = {current_alignment - initial_alignment}; + size_t extra_size {0}; + + if (CdrVersion::XCDRv1 == cdr_version_ && + (data.has_value() || EncodingAlgorithmFlag::PLAIN_CDR == current_encoding_)) + { + current_alignment = 0; + } + + size_t calculated_size {calculate_serialized_size(data, current_alignment)}; + + if (CdrVersion::XCDRv2 == cdr_version_ && EncodingAlgorithmFlag::PL_CDR2 == current_encoding_ && + 0 < calculated_size) + { + if (8 < calculated_size || + (1 != calculated_size && 2 != calculated_size && 4 != calculated_size && + 8 != calculated_size)) + { + extra_size = 8; // Long EMHEADER. + if (NO_SERIALIZED_MEMBER_SIZE != serialized_member_size_) + { + calculated_size -= 4; // Join NEXTINT and DHEADER. + } + } + else + { + extra_size = 4; // EMHEADER; + } + } + else if (CdrVersion::XCDRv1 == cdr_version_ && + (0 < calculated_size || EncodingAlgorithmFlag::PLAIN_CDR == current_encoding_)) + { + extra_size = 4; // ShortMemberHeader + + if (0x3F00 < id.id || calculated_size > std::numeric_limits::max()) + { + extra_size += 8; // LongMemberHeader + } + + } + + calculated_size += prev_size + extra_size; + if (CdrVersion::XCDRv1 != cdr_version_) + { + current_alignment += extra_size; + } + + + return calculated_size; + } + + /*! + * @brief Indicates a new constructed type will be calculated. + * @param[in] new_encoding New encoding algorithm used for the constructed type. + * @param[inout] current_alignment Current alignment in the encoding. + * @return If new encoding algorithm encodes a header, return the encoded size of it. + */ + Cdr_DllAPI size_t begin_calculate_type_serialized_size( + EncodingAlgorithmFlag new_encoding, + size_t& current_alignment); + + /*! + * @brief Indicates the ending of a constructed type. + * @param[in] new_encoding New encoding algorithm used after the constructed type. + * @param[inout] current_alignment Current alignment in the encoding. + * @return If current encoding algorithm encodes a final mark, return the encoded size of it. + */ + Cdr_DllAPI size_t end_calculate_type_serialized_size( + EncodingAlgorithmFlag new_encoding, + size_t& current_alignment); + +private: + + CdrSizeCalculator() = delete; + + CdrVersion cdr_version_ {CdrVersion::XCDRv2}; + + EncodingAlgorithmFlag current_encoding_ {EncodingAlgorithmFlag::PLAIN_CDR2}; + + enum SerializedMemberSizeForNextInt + { + NO_SERIALIZED_MEMBER_SIZE, + SERIALIZED_MEMBER_SIZE, + SERIALIZED_MEMBER_SIZE_4, + SERIALIZED_MEMBER_SIZE_8 + } + //! Specifies if a DHEADER was serialized. Used to calculate XCDRv2 member headers. + serialized_member_size_ {NO_SERIALIZED_MEMBER_SIZE}; + + //! Align for types equal or greater than 64bits. + size_t align64_ {4}; + + inline size_t alignment( + size_t current_alignment, + size_t data_size) const + { + return (data_size - (current_alignment % data_size)) & (data_size - 1); + } + + template::value || + std::is_arithmetic<_T>::value>::type* = nullptr> + constexpr SerializedMemberSizeForNextInt get_serialized_member_size() const + { + return (1 == sizeof(_T) ? SERIALIZED_MEMBER_SIZE : + (4 == sizeof(_T) ? SERIALIZED_MEMBER_SIZE_4 : + (8 == sizeof(_T) ? SERIALIZED_MEMBER_SIZE_8 : NO_SERIALIZED_MEMBER_SIZE))); + } + +}; + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FASTCDR_CDRSIZECALCULATOR_HPP_ diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.cxx index 10c74e1e912..4d4e6efd775 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.cxx @@ -14,9 +14,9 @@ /*! * @file Accel.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "Accel.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::Accel::Accel() -{ - // m_linear com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7d0b7e3c - // m_angular com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7d0b7e3c +namespace geometry_msgs { + +namespace msg { -} -geometry_msgs::msg::Accel::~Accel() +Accel::Accel() { +} +Accel::~Accel() +{ } -geometry_msgs::msg::Accel::Accel( +Accel::Accel( const Accel& x) { m_linear = x.m_linear; m_angular = x.m_angular; } -geometry_msgs::msg::Accel::Accel( - Accel&& x) +Accel::Accel( + Accel&& x) noexcept { m_linear = std::move(x.m_linear); m_angular = std::move(x.m_angular); } -geometry_msgs::msg::Accel& geometry_msgs::msg::Accel::operator =( +Accel& Accel::operator =( const Accel& x) { m_linear = x.m_linear; m_angular = x.m_angular; - return *this; } -geometry_msgs::msg::Accel& geometry_msgs::msg::Accel::operator =( - Accel&& x) +Accel& Accel::operator =( + Accel&& x) noexcept { m_linear = std::move(x.m_linear); m_angular = std::move(x.m_angular); - return *this; } -bool geometry_msgs::msg::Accel::operator ==( +bool Accel::operator ==( const Accel& x) const { - - return (m_linear == x.m_linear && m_angular == x.m_angular); + return (m_linear == x.m_linear && + m_angular == x.m_angular); } -bool geometry_msgs::msg::Accel::operator !=( +bool Accel::operator !=( const Accel& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Accel::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::Accel::getCdrSerializedSize( - const geometry_msgs::msg::Accel& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.linear(), current_alignment); - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.angular(), current_alignment); - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Accel::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_linear; - scdr << m_angular; - -} - -void geometry_msgs::msg::Accel::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_linear; - dcdr >> m_angular; -} - /*! * @brief This function copies the value in member linear * @param _linear New value to be copied in member linear */ -void geometry_msgs::msg::Accel::linear( +void Accel::linear( const geometry_msgs::msg::Vector3& _linear) { m_linear = _linear; @@ -152,7 +110,7 @@ void geometry_msgs::msg::Accel::linear( * @brief This function moves the value in member linear * @param _linear New value to be moved in member linear */ -void geometry_msgs::msg::Accel::linear( +void Accel::linear( geometry_msgs::msg::Vector3&& _linear) { m_linear = std::move(_linear); @@ -162,7 +120,7 @@ void geometry_msgs::msg::Accel::linear( * @brief This function returns a constant reference to member linear * @return Constant reference to member linear */ -const geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::linear() const +const geometry_msgs::msg::Vector3& Accel::linear() const { return m_linear; } @@ -171,15 +129,17 @@ const geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::linear() const * @brief This function returns a reference to member linear * @return Reference to member linear */ -geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::linear() +geometry_msgs::msg::Vector3& Accel::linear() { return m_linear; } + + /*! * @brief This function copies the value in member angular * @param _angular New value to be copied in member angular */ -void geometry_msgs::msg::Accel::angular( +void Accel::angular( const geometry_msgs::msg::Vector3& _angular) { m_angular = _angular; @@ -189,7 +149,7 @@ void geometry_msgs::msg::Accel::angular( * @brief This function moves the value in member angular * @param _angular New value to be moved in member angular */ -void geometry_msgs::msg::Accel::angular( +void Accel::angular( geometry_msgs::msg::Vector3&& _angular) { m_angular = std::move(_angular); @@ -199,7 +159,7 @@ void geometry_msgs::msg::Accel::angular( * @brief This function returns a constant reference to member angular * @return Constant reference to member angular */ -const geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::angular() const +const geometry_msgs::msg::Vector3& Accel::angular() const { return m_angular; } @@ -208,31 +168,18 @@ const geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::angular() const * @brief This function returns a reference to member angular * @return Reference to member angular */ -geometry_msgs::msg::Vector3& geometry_msgs::msg::Accel::angular() +geometry_msgs::msg::Vector3& Accel::angular() { return m_angular; } -size_t geometry_msgs::msg::Accel::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool geometry_msgs::msg::Accel::isKeyDefined() -{ - return false; -} +} // namespace msg -void geometry_msgs::msg::Accel::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AccelCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.h index eb08dbd8aad..84c7a956e8f 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Accel.h @@ -16,20 +16,25 @@ * @file Accel.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_H_ -#include "Vector3.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "Vector3.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,201 +48,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Accel_SOURCE) -#define Accel_DllAPI __declspec( dllexport ) +#if defined(ACCEL_SOURCE) +#define ACCEL_DllAPI __declspec( dllexport ) #else -#define Accel_DllAPI __declspec( dllimport ) -#endif // Accel_SOURCE +#define ACCEL_DllAPI __declspec( dllimport ) +#endif // ACCEL_SOURCE #else -#define Accel_DllAPI +#define ACCEL_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Accel_DllAPI +#define ACCEL_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Accel defined by the user in the IDL file. - * @ingroup ACCEL - */ - class Accel - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Accel(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Accel(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. - */ - eProsima_user_DllExport Accel( - const Accel& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. - */ - eProsima_user_DllExport Accel( - Accel&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. - */ - eProsima_user_DllExport Accel& operator =( - const Accel& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. - */ - eProsima_user_DllExport Accel& operator =( - Accel&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Accel object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Accel& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Accel object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Accel& x) const; - - /*! - * @brief This function copies the value in member linear - * @param _linear New value to be copied in member linear - */ - eProsima_user_DllExport void linear( - const geometry_msgs::msg::Vector3& _linear); - - /*! - * @brief This function moves the value in member linear - * @param _linear New value to be moved in member linear - */ - eProsima_user_DllExport void linear( - geometry_msgs::msg::Vector3&& _linear); - - /*! - * @brief This function returns a constant reference to member linear - * @return Constant reference to member linear - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear() const; - - /*! - * @brief This function returns a reference to member linear - * @return Reference to member linear - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& linear(); - /*! - * @brief This function copies the value in member angular - * @param _angular New value to be copied in member angular - */ - eProsima_user_DllExport void angular( - const geometry_msgs::msg::Vector3& _angular); - - /*! - * @brief This function moves the value in member angular - * @param _angular New value to be moved in member angular - */ - eProsima_user_DllExport void angular( - geometry_msgs::msg::Vector3&& _angular); - - /*! - * @brief This function returns a constant reference to member angular - * @return Constant reference to member angular - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular() const; - - /*! - * @brief This function returns a reference to member angular - * @return Reference to member angular - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& angular(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Accel& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - geometry_msgs::msg::Vector3 m_linear; - geometry_msgs::msg::Vector3 m_angular; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Accel defined by the user in the IDL file. + * @ingroup Accel + */ +class Accel +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Accel(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Accel(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. + */ + eProsima_user_DllExport Accel( + const Accel& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. + */ + eProsima_user_DllExport Accel( + Accel&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. + */ + eProsima_user_DllExport Accel& operator =( + const Accel& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Accel that will be copied. + */ + eProsima_user_DllExport Accel& operator =( + Accel&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Accel object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Accel& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Accel object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Accel& x) const; + + /*! + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear + */ + eProsima_user_DllExport void linear( + const geometry_msgs::msg::Vector3& _linear); + + /*! + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear + */ + eProsima_user_DllExport void linear( + geometry_msgs::msg::Vector3&& _linear); + + /*! + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear() const; + + /*! + * @brief This function returns a reference to member linear + * @return Reference to member linear + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& linear(); + + + /*! + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular + */ + eProsima_user_DllExport void angular( + const geometry_msgs::msg::Vector3& _angular); + + /*! + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular + */ + eProsima_user_DllExport void angular( + geometry_msgs::msg::Vector3&& _angular); + + /*! + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular() const; + + /*! + * @brief This function returns a reference to member angular + * @return Reference to member angular + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& angular(); + +private: + + geometry_msgs::msg::Vector3 m_linear; + geometry_msgs::msg::Vector3 m_angular; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelCdrAux.hpp new file mode 100644 index 00000000000..aa54a1b4946 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELCDRAUX_HPP_ + +#include "Accel.h" + +constexpr uint32_t geometry_msgs_msg_Accel_max_cdr_typesize {64UL}; +constexpr uint32_t geometry_msgs_msg_Accel_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Accel& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelCdrAux.ipp new file mode 100644 index 00000000000..fa72bc23fd2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELCDRAUX_IPP_ + +#include "AccelCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Accel& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.linear(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.angular(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Accel& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.linear() + << eprosima::fastcdr::MemberId(1) << data.angular() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Accel& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.linear(); + break; + + case 1: + dcdr >> data.angular(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Accel& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.cxx index ab7bd76ee39..6b77938d505 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file AccelPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AccelPubSubTypes.h" +#include "AccelCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - AccelPubSubType::AccelPubSubType() - { - setName("geometry_msgs::msg::dds_::Accel_"); - auto type_size = Accel::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Accel::isKeyDefined(); - size_t keyLength = Accel::getKeyMaxCdrSerializedSize() > 16 ? - Accel::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - AccelPubSubType::~AccelPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool AccelPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Accel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AccelPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Accel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AccelPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AccelPubSubType::createData() - { - return reinterpret_cast(new Accel()); - } - - void AccelPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AccelPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Accel* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Accel::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Accel::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +AccelPubSubType::AccelPubSubType() +{ + setName("geometry_msgs::msg::dds_::Accel_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Accel::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Accel_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AccelPubSubType::~AccelPubSubType() +{ +} + +bool AccelPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Accel* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AccelPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Accel* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AccelPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AccelPubSubType::createData() +{ + return reinterpret_cast(new Accel()); +} + +void AccelPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AccelPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.h index 4e7a852de6f..70f5984497f 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelPubSubTypes.h @@ -16,92 +16,121 @@ * @file AccelPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Accel.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "Vector3PubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Accel is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Accel defined by the user in the IDL file. + * @ingroup Accel + */ +class AccelPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Accel defined by the user in the IDL file. - * @ingroup ACCEL - */ - class AccelPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Accel type; + typedef Accel type; - eProsima_user_DllExport AccelPubSubType(); + eProsima_user_DllExport AccelPubSubType(); - eProsima_user_DllExport virtual ~AccelPubSubType(); + eProsima_user_DllExport ~AccelPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Accel(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCEL_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.cxx index a00aa4ca240..5bc03edb0cb 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.cxx @@ -14,9 +14,9 @@ /*! * @file AccelWithCovariance.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,131 +27,80 @@ char dummy; #endif // _WIN32 #include "AccelWithCovariance.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::AccelWithCovariance::AccelWithCovariance() -{ - // m_accel com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@738dc9b +namespace geometry_msgs { + +namespace msg { - // m_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@3c77d488 - memset(&m_covariance, 0, (36) * 8); -} -geometry_msgs::msg::AccelWithCovariance::~AccelWithCovariance() +AccelWithCovariance::AccelWithCovariance() { +} +AccelWithCovariance::~AccelWithCovariance() +{ } -geometry_msgs::msg::AccelWithCovariance::AccelWithCovariance( +AccelWithCovariance::AccelWithCovariance( const AccelWithCovariance& x) { m_accel = x.m_accel; m_covariance = x.m_covariance; } -geometry_msgs::msg::AccelWithCovariance::AccelWithCovariance( - AccelWithCovariance&& x) +AccelWithCovariance::AccelWithCovariance( + AccelWithCovariance&& x) noexcept { m_accel = std::move(x.m_accel); m_covariance = std::move(x.m_covariance); } -geometry_msgs::msg::AccelWithCovariance& geometry_msgs::msg::AccelWithCovariance::operator =( +AccelWithCovariance& AccelWithCovariance::operator =( const AccelWithCovariance& x) { m_accel = x.m_accel; m_covariance = x.m_covariance; - return *this; } -geometry_msgs::msg::AccelWithCovariance& geometry_msgs::msg::AccelWithCovariance::operator =( - AccelWithCovariance&& x) +AccelWithCovariance& AccelWithCovariance::operator =( + AccelWithCovariance&& x) noexcept { m_accel = std::move(x.m_accel); m_covariance = std::move(x.m_covariance); - return *this; } -bool geometry_msgs::msg::AccelWithCovariance::operator ==( +bool AccelWithCovariance::operator ==( const AccelWithCovariance& x) const { - - return (m_accel == x.m_accel && m_covariance == x.m_covariance); + return (m_accel == x.m_accel && + m_covariance == x.m_covariance); } -bool geometry_msgs::msg::AccelWithCovariance::operator !=( +bool AccelWithCovariance::operator !=( const AccelWithCovariance& x) const { return !(*this == x); } -size_t geometry_msgs::msg::AccelWithCovariance::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Accel::getMaxCdrSerializedSize(current_alignment); - current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::AccelWithCovariance::getCdrSerializedSize( - const geometry_msgs::msg::AccelWithCovariance& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Accel::getCdrSerializedSize(data.accel(), current_alignment); - if ((36) > 0) - { - current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::AccelWithCovariance::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_accel; - scdr << m_covariance; - - -} - -void geometry_msgs::msg::AccelWithCovariance::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_accel; - dcdr >> m_covariance; - -} - /*! * @brief This function copies the value in member accel * @param _accel New value to be copied in member accel */ -void geometry_msgs::msg::AccelWithCovariance::accel( +void AccelWithCovariance::accel( const geometry_msgs::msg::Accel& _accel) { m_accel = _accel; @@ -161,7 +110,7 @@ void geometry_msgs::msg::AccelWithCovariance::accel( * @brief This function moves the value in member accel * @param _accel New value to be moved in member accel */ -void geometry_msgs::msg::AccelWithCovariance::accel( +void AccelWithCovariance::accel( geometry_msgs::msg::Accel&& _accel) { m_accel = std::move(_accel); @@ -171,7 +120,7 @@ void geometry_msgs::msg::AccelWithCovariance::accel( * @brief This function returns a constant reference to member accel * @return Constant reference to member accel */ -const geometry_msgs::msg::Accel& geometry_msgs::msg::AccelWithCovariance::accel() const +const geometry_msgs::msg::Accel& AccelWithCovariance::accel() const { return m_accel; } @@ -180,16 +129,18 @@ const geometry_msgs::msg::Accel& geometry_msgs::msg::AccelWithCovariance::accel( * @brief This function returns a reference to member accel * @return Reference to member accel */ -geometry_msgs::msg::Accel& geometry_msgs::msg::AccelWithCovariance::accel() +geometry_msgs::msg::Accel& AccelWithCovariance::accel() { return m_accel; } + + /*! * @brief This function copies the value in member covariance * @param _covariance New value to be copied in member covariance */ -void geometry_msgs::msg::AccelWithCovariance::covariance( - const geometry_msgs::msg::double_accel_36& _covariance) +void AccelWithCovariance::covariance( + const geometry_msgs::msg::double__36& _covariance) { m_covariance = _covariance; } @@ -198,8 +149,8 @@ void geometry_msgs::msg::AccelWithCovariance::covariance( * @brief This function moves the value in member covariance * @param _covariance New value to be moved in member covariance */ -void geometry_msgs::msg::AccelWithCovariance::covariance( - geometry_msgs::msg::double_accel_36&& _covariance) +void AccelWithCovariance::covariance( + geometry_msgs::msg::double__36&& _covariance) { m_covariance = std::move(_covariance); } @@ -208,7 +159,7 @@ void geometry_msgs::msg::AccelWithCovariance::covariance( * @brief This function returns a constant reference to member covariance * @return Constant reference to member covariance */ -const geometry_msgs::msg::double_accel_36& geometry_msgs::msg::AccelWithCovariance::covariance() const +const geometry_msgs::msg::double__36& AccelWithCovariance::covariance() const { return m_covariance; } @@ -217,31 +168,18 @@ const geometry_msgs::msg::double_accel_36& geometry_msgs::msg::AccelWithCovarian * @brief This function returns a reference to member covariance * @return Reference to member covariance */ -geometry_msgs::msg::double_accel_36& geometry_msgs::msg::AccelWithCovariance::covariance() +geometry_msgs::msg::double__36& AccelWithCovariance::covariance() { return m_covariance; } -size_t geometry_msgs::msg::AccelWithCovariance::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool geometry_msgs::msg::AccelWithCovariance::isKeyDefined() -{ - return false; -} - -void geometry_msgs::msg::AccelWithCovariance::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "AccelWithCovarianceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.h index ff059f65813..54aef9b8d77 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariance.h @@ -16,20 +16,25 @@ * @file AccelWithCovariance.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_H_ -#include "Accel.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "Accel.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,202 +48,160 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(AccelWithCovariance_SOURCE) -#define AccelWithCovariance_DllAPI __declspec( dllexport ) +#if defined(ACCELWITHCOVARIANCE_SOURCE) +#define ACCELWITHCOVARIANCE_DllAPI __declspec( dllexport ) #else -#define AccelWithCovariance_DllAPI __declspec( dllimport ) -#endif // AccelWithCovariance_SOURCE +#define ACCELWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // ACCELWITHCOVARIANCE_SOURCE #else -#define AccelWithCovariance_DllAPI +#define ACCELWITHCOVARIANCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define AccelWithCovariance_DllAPI +#define ACCELWITHCOVARIANCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - typedef std::array double_accel_36; - /*! - * @brief This class represents the structure AccelWithCovariance defined by the user in the IDL file. - * @ingroup ACCELWITHCOVARIANCE - */ - class AccelWithCovariance - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AccelWithCovariance(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AccelWithCovariance(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. - */ - eProsima_user_DllExport AccelWithCovariance( - const AccelWithCovariance& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. - */ - eProsima_user_DllExport AccelWithCovariance( - AccelWithCovariance&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. - */ - eProsima_user_DllExport AccelWithCovariance& operator =( - const AccelWithCovariance& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. - */ - eProsima_user_DllExport AccelWithCovariance& operator =( - AccelWithCovariance&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::AccelWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AccelWithCovariance& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::AccelWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AccelWithCovariance& x) const; - - /*! - * @brief This function copies the value in member accel - * @param _accel New value to be copied in member accel - */ - eProsima_user_DllExport void accel( - const geometry_msgs::msg::Accel& _accel); - - /*! - * @brief This function moves the value in member accel - * @param _accel New value to be moved in member accel - */ - eProsima_user_DllExport void accel( - geometry_msgs::msg::Accel&& _accel); - - /*! - * @brief This function returns a constant reference to member accel - * @return Constant reference to member accel - */ - eProsima_user_DllExport const geometry_msgs::msg::Accel& accel() const; - - /*! - * @brief This function returns a reference to member accel - * @return Reference to member accel - */ - eProsima_user_DllExport geometry_msgs::msg::Accel& accel(); - /*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ - eProsima_user_DllExport void covariance( - const geometry_msgs::msg::double_accel_36& _covariance); - - /*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ - eProsima_user_DllExport void covariance( - geometry_msgs::msg::double_accel_36&& _covariance); - - /*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ - eProsima_user_DllExport const geometry_msgs::msg::double_accel_36& covariance() const; - - /*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ - eProsima_user_DllExport geometry_msgs::msg::double_accel_36& covariance(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::AccelWithCovariance& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - geometry_msgs::msg::Accel m_accel; - geometry_msgs::msg::double_accel_36 m_covariance; - }; - } // namespace msg + +namespace msg { + +typedef std::array double__36; + + + +/*! + * @brief This class represents the structure AccelWithCovariance defined by the user in the IDL file. + * @ingroup AccelWithCovariance + */ +class AccelWithCovariance +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AccelWithCovariance(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AccelWithCovariance(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. + */ + eProsima_user_DllExport AccelWithCovariance( + const AccelWithCovariance& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. + */ + eProsima_user_DllExport AccelWithCovariance( + AccelWithCovariance&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. + */ + eProsima_user_DllExport AccelWithCovariance& operator =( + const AccelWithCovariance& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::AccelWithCovariance that will be copied. + */ + eProsima_user_DllExport AccelWithCovariance& operator =( + AccelWithCovariance&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::AccelWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AccelWithCovariance& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::AccelWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AccelWithCovariance& x) const; + + /*! + * @brief This function copies the value in member accel + * @param _accel New value to be copied in member accel + */ + eProsima_user_DllExport void accel( + const geometry_msgs::msg::Accel& _accel); + + /*! + * @brief This function moves the value in member accel + * @param _accel New value to be moved in member accel + */ + eProsima_user_DllExport void accel( + geometry_msgs::msg::Accel&& _accel); + + /*! + * @brief This function returns a constant reference to member accel + * @return Constant reference to member accel + */ + eProsima_user_DllExport const geometry_msgs::msg::Accel& accel() const; + + /*! + * @brief This function returns a reference to member accel + * @return Reference to member accel + */ + eProsima_user_DllExport geometry_msgs::msg::Accel& accel(); + + + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const geometry_msgs::msg::double__36& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + geometry_msgs::msg::double__36&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const geometry_msgs::msg::double__36& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport geometry_msgs::msg::double__36& covariance(); + +private: + + geometry_msgs::msg::Accel m_accel; + geometry_msgs::msg::double__36 m_covariance{0.0}; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovarianceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovarianceCdrAux.hpp new file mode 100644 index 00000000000..7fbbdf7c84e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovarianceCdrAux.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCECDRAUX_HPP_ + +#include "AccelWithCovariance.h" + +constexpr uint32_t geometry_msgs_msg_AccelWithCovariance_max_cdr_typesize {360UL}; +constexpr uint32_t geometry_msgs_msg_AccelWithCovariance_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::AccelWithCovariance& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovarianceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovarianceCdrAux.ipp new file mode 100644 index 00000000000..30d59d765a6 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovarianceCdrAux.ipp @@ -0,0 +1,140 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AccelWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCECDRAUX_IPP_ + +#include "AccelWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::AccelWithCovariance& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.accel(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::AccelWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.accel() + << eprosima::fastcdr::MemberId(1) << data.covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::AccelWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.accel(); + break; + + case 1: + dcdr >> data.covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::AccelWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.cxx index 0447b9326fc..a6b22c328ff 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.cxx @@ -16,162 +16,185 @@ * @file AccelWithCovariancePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "AccelWithCovariancePubSubTypes.h" +#include "AccelWithCovarianceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - - AccelWithCovariancePubSubType::AccelWithCovariancePubSubType() - { - setName("geometry_msgs::msg::dds_::AccelWithCovariance_"); - auto type_size = AccelWithCovariance::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = AccelWithCovariance::isKeyDefined(); - size_t keyLength = AccelWithCovariance::getKeyMaxCdrSerializedSize() > 16 ? - AccelWithCovariance::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - AccelWithCovariancePubSubType::~AccelWithCovariancePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool AccelWithCovariancePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - AccelWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool AccelWithCovariancePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - AccelWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function AccelWithCovariancePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* AccelWithCovariancePubSubType::createData() - { - return reinterpret_cast(new AccelWithCovariance()); - } - - void AccelWithCovariancePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool AccelWithCovariancePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - AccelWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AccelWithCovariance::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || AccelWithCovariance::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +AccelWithCovariancePubSubType::AccelWithCovariancePubSubType() +{ + setName("geometry_msgs::msg::dds_::AccelWithCovariance_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AccelWithCovariance::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_AccelWithCovariance_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +AccelWithCovariancePubSubType::~AccelWithCovariancePubSubType() +{ +} + +bool AccelWithCovariancePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AccelWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool AccelWithCovariancePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AccelWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function AccelWithCovariancePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* AccelWithCovariancePubSubType::createData() +{ + return reinterpret_cast(new AccelWithCovariance()); +} + +void AccelWithCovariancePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AccelWithCovariancePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.h index 15c87c82c78..0c51d5cc73c 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/AccelWithCovariancePubSubTypes.h @@ -16,93 +16,122 @@ * @file AccelWithCovariancePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "AccelWithCovariance.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "AccelPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated AccelWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { +typedef std::array double__36; + + + +/*! + * @brief This class represents the TopicDataType of the type AccelWithCovariance defined by the user in the IDL file. + * @ingroup AccelWithCovariance + */ +class AccelWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - typedef std::array double_accel_36; - /*! - * @brief This class represents the TopicDataType of the type AccelWithCovariance defined by the user in the IDL file. - * @ingroup ACCELWITHCOVARIANCE - */ - class AccelWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef AccelWithCovariance type; + typedef AccelWithCovariance type; - eProsima_user_DllExport AccelWithCovariancePubSubType(); + eProsima_user_DllExport AccelWithCovariancePubSubType(); - eProsima_user_DllExport virtual ~AccelWithCovariancePubSubType(); + eProsima_user_DllExport ~AccelWithCovariancePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) AccelWithCovariance(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_ACCELWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.cxx index b160f59cd8c..8c961c13b61 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.cxx @@ -14,9 +14,9 @@ /*! * @file Point.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "Point.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::Point::Point() -{ - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1e1a0406 - m_x = 0.0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@290222c1 - m_y = 0.0; - // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@67f639d3 - m_z = 0.0; -} +namespace geometry_msgs { + +namespace msg { + -geometry_msgs::msg::Point::~Point() -{ +Point::Point() +{ +} +Point::~Point() +{ } -geometry_msgs::msg::Point::Point( +Point::Point( const Point& x) { m_x = x.m_x; @@ -59,113 +59,53 @@ geometry_msgs::msg::Point::Point( m_z = x.m_z; } -geometry_msgs::msg::Point::Point( - Point&& x) +Point::Point( + Point&& x) noexcept { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; } -geometry_msgs::msg::Point& geometry_msgs::msg::Point::operator =( +Point& Point::operator =( const Point& x) { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; - return *this; } -geometry_msgs::msg::Point& geometry_msgs::msg::Point::operator =( - Point&& x) +Point& Point::operator =( + Point&& x) noexcept { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; - return *this; } -bool geometry_msgs::msg::Point::operator ==( +bool Point::operator ==( const Point& x) const { - - return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z); + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z); } -bool geometry_msgs::msg::Point::operator !=( +bool Point::operator !=( const Point& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Point::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::Point::getCdrSerializedSize( - const geometry_msgs::msg::Point& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Point::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_x; - scdr << m_y; - scdr << m_z; - -} - -void geometry_msgs::msg::Point::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_x; - dcdr >> m_y; - dcdr >> m_z; -} - /*! * @brief This function sets a value in member x * @param _x New value for member x */ -void geometry_msgs::msg::Point::x( +void Point::x( double _x) { m_x = _x; @@ -175,7 +115,7 @@ void geometry_msgs::msg::Point::x( * @brief This function returns the value of member x * @return Value of member x */ -double geometry_msgs::msg::Point::x() const +double Point::x() const { return m_x; } @@ -184,16 +124,17 @@ double geometry_msgs::msg::Point::x() const * @brief This function returns a reference to member x * @return Reference to member x */ -double& geometry_msgs::msg::Point::x() +double& Point::x() { return m_x; } + /*! * @brief This function sets a value in member y * @param _y New value for member y */ -void geometry_msgs::msg::Point::y( +void Point::y( double _y) { m_y = _y; @@ -203,7 +144,7 @@ void geometry_msgs::msg::Point::y( * @brief This function returns the value of member y * @return Value of member y */ -double geometry_msgs::msg::Point::y() const +double Point::y() const { return m_y; } @@ -212,16 +153,17 @@ double geometry_msgs::msg::Point::y() const * @brief This function returns a reference to member y * @return Reference to member y */ -double& geometry_msgs::msg::Point::y() +double& Point::y() { return m_y; } + /*! * @brief This function sets a value in member z * @param _z New value for member z */ -void geometry_msgs::msg::Point::z( +void Point::z( double _z) { m_z = _z; @@ -231,7 +173,7 @@ void geometry_msgs::msg::Point::z( * @brief This function returns the value of member z * @return Value of member z */ -double geometry_msgs::msg::Point::z() const +double Point::z() const { return m_z; } @@ -240,32 +182,18 @@ double geometry_msgs::msg::Point::z() const * @brief This function returns a reference to member z * @return Reference to member z */ -double& geometry_msgs::msg::Point::z() +double& Point::z() { return m_z; } -size_t geometry_msgs::msg::Point::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool geometry_msgs::msg::Point::isKeyDefined() -{ - return false; -} - -void geometry_msgs::msg::Point::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PointCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.h index 38cea0c8f44..87bb0ab2745 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point.h @@ -16,19 +16,24 @@ * @file Point.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,209 +47,165 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Point_SOURCE) -#define Point_DllAPI __declspec( dllexport ) +#if defined(POINT_SOURCE) +#define POINT_DllAPI __declspec( dllexport ) #else -#define Point_DllAPI __declspec( dllimport ) -#endif // Point_SOURCE +#define POINT_DllAPI __declspec( dllimport ) +#endif // POINT_SOURCE #else -#define Point_DllAPI +#define POINT_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Point_DllAPI +#define POINT_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Point defined by the user in the IDL file. - * @ingroup POINT - */ - class Point - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Point(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Point(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Point that will be copied. - */ - eProsima_user_DllExport Point( - const Point& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Point that will be copied. - */ - eProsima_user_DllExport Point( - Point&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Point that will be copied. - */ - eProsima_user_DllExport Point& operator =( - const Point& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Point that will be copied. - */ - eProsima_user_DllExport Point& operator =( - Point&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Point object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Point& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Point object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Point& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Point& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - double m_x; - double m_y; - double m_z; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Point defined by the user in the IDL file. + * @ingroup Point + */ +class Point +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Point(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Point(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Point that will be copied. + */ + eProsima_user_DllExport Point( + const Point& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Point that will be copied. + */ + eProsima_user_DllExport Point( + Point&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Point that will be copied. + */ + eProsima_user_DllExport Point& operator =( + const Point& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Point that will be copied. + */ + eProsima_user_DllExport Point& operator =( + Point&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Point object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Point& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Point object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Point& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + +private: + + double m_x{0.0}; + double m_y{0.0}; + double m_z{0.0}; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.cxx index 9d779321703..e5e90485ee9 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.cxx @@ -14,9 +14,9 @@ /*! * @file Point32.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "Point32.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::Point32::Point32() -{ - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3012646b - m_x = 0.0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4a883b15 - m_y = 0.0; - // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@25641d39 - m_z = 0.0; -} +namespace geometry_msgs { + +namespace msg { + -geometry_msgs::msg::Point32::~Point32() -{ +Point32::Point32() +{ +} +Point32::~Point32() +{ } -geometry_msgs::msg::Point32::Point32( +Point32::Point32( const Point32& x) { m_x = x.m_x; @@ -59,113 +59,53 @@ geometry_msgs::msg::Point32::Point32( m_z = x.m_z; } -geometry_msgs::msg::Point32::Point32( - Point32&& x) +Point32::Point32( + Point32&& x) noexcept { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; } -geometry_msgs::msg::Point32& geometry_msgs::msg::Point32::operator =( +Point32& Point32::operator =( const Point32& x) { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; - return *this; } -geometry_msgs::msg::Point32& geometry_msgs::msg::Point32::operator =( - Point32&& x) +Point32& Point32::operator =( + Point32&& x) noexcept { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; - return *this; } -bool geometry_msgs::msg::Point32::operator ==( +bool Point32::operator ==( const Point32& x) const { - - return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z); + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z); } -bool geometry_msgs::msg::Point32::operator !=( +bool Point32::operator !=( const Point32& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Point32::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::Point32::getCdrSerializedSize( - const geometry_msgs::msg::Point32& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Point32::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_x; - scdr << m_y; - scdr << m_z; - -} - -void geometry_msgs::msg::Point32::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_x; - dcdr >> m_y; - dcdr >> m_z; -} - /*! * @brief This function sets a value in member x * @param _x New value for member x */ -void geometry_msgs::msg::Point32::x( +void Point32::x( float _x) { m_x = _x; @@ -175,7 +115,7 @@ void geometry_msgs::msg::Point32::x( * @brief This function returns the value of member x * @return Value of member x */ -float geometry_msgs::msg::Point32::x() const +float Point32::x() const { return m_x; } @@ -184,16 +124,17 @@ float geometry_msgs::msg::Point32::x() const * @brief This function returns a reference to member x * @return Reference to member x */ -float& geometry_msgs::msg::Point32::x() +float& Point32::x() { return m_x; } + /*! * @brief This function sets a value in member y * @param _y New value for member y */ -void geometry_msgs::msg::Point32::y( +void Point32::y( float _y) { m_y = _y; @@ -203,7 +144,7 @@ void geometry_msgs::msg::Point32::y( * @brief This function returns the value of member y * @return Value of member y */ -float geometry_msgs::msg::Point32::y() const +float Point32::y() const { return m_y; } @@ -212,16 +153,17 @@ float geometry_msgs::msg::Point32::y() const * @brief This function returns a reference to member y * @return Reference to member y */ -float& geometry_msgs::msg::Point32::y() +float& Point32::y() { return m_y; } + /*! * @brief This function sets a value in member z * @param _z New value for member z */ -void geometry_msgs::msg::Point32::z( +void Point32::z( float _z) { m_z = _z; @@ -231,7 +173,7 @@ void geometry_msgs::msg::Point32::z( * @brief This function returns the value of member z * @return Value of member z */ -float geometry_msgs::msg::Point32::z() const +float Point32::z() const { return m_z; } @@ -240,32 +182,18 @@ float geometry_msgs::msg::Point32::z() const * @brief This function returns a reference to member z * @return Reference to member z */ -float& geometry_msgs::msg::Point32::z() +float& Point32::z() { return m_z; } -size_t geometry_msgs::msg::Point32::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool geometry_msgs::msg::Point32::isKeyDefined() -{ - return false; -} - -void geometry_msgs::msg::Point32::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "Point32CdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.h index 8117cf9950c..2032e6675c5 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32.h @@ -16,19 +16,24 @@ * @file Point32.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,209 +47,165 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Point32_SOURCE) -#define Point32_DllAPI __declspec( dllexport ) +#if defined(POINT32_SOURCE) +#define POINT32_DllAPI __declspec( dllexport ) #else -#define Point32_DllAPI __declspec( dllimport ) -#endif // Point32_SOURCE +#define POINT32_DllAPI __declspec( dllimport ) +#endif // POINT32_SOURCE #else -#define Point32_DllAPI +#define POINT32_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Point32_DllAPI +#define POINT32_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Point32 defined by the user in the IDL file. - * @ingroup POINT32 - */ - class Point32 - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Point32(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Point32(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. - */ - eProsima_user_DllExport Point32( - const Point32& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. - */ - eProsima_user_DllExport Point32( - Point32&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. - */ - eProsima_user_DllExport Point32& operator =( - const Point32& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. - */ - eProsima_user_DllExport Point32& operator =( - Point32&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Point32 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Point32& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Point32 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Point32& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - float _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport float x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport float& x(); - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - float _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport float y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport float& y(); - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - float _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport float z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport float& z(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Point32& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - float m_x; - float m_y; - float m_z; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Point32 defined by the user in the IDL file. + * @ingroup Point32 + */ +class Point32 +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Point32(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Point32(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. + */ + eProsima_user_DllExport Point32( + const Point32& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. + */ + eProsima_user_DllExport Point32( + Point32&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. + */ + eProsima_user_DllExport Point32& operator =( + const Point32& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Point32 that will be copied. + */ + eProsima_user_DllExport Point32& operator =( + Point32&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Point32 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Point32& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Point32 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Point32& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + float _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport float x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport float& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + float _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport float y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport float& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + float _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport float z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport float& z(); + +private: + + float m_x{0.0}; + float m_y{0.0}; + float m_z{0.0}; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32CdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32CdrAux.hpp new file mode 100644 index 00000000000..10535a4278b --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32CdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Point32CdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32CDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32CDRAUX_HPP_ + +#include "Point32.h" + +constexpr uint32_t geometry_msgs_msg_Point32_max_cdr_typesize {16UL}; +constexpr uint32_t geometry_msgs_msg_Point32_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Point32& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32CDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32CdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32CdrAux.ipp new file mode 100644 index 00000000000..888859ca3cc --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32CdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Point32CdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32CDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32CDRAUX_IPP_ + +#include "Point32CdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Point32& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Point32& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Point32& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Point32& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32CDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.cxx index 979bddb197e..7b9912c15b9 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.cxx @@ -16,161 +16,183 @@ * @file Point32PubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "Point32PubSubTypes.h" +#include "Point32CdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - Point32PubSubType::Point32PubSubType() - { - setName("geometry_msgs::msg::dds_::Point32_"); - auto type_size = Point32::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Point32::isKeyDefined(); - size_t keyLength = Point32::getKeyMaxCdrSerializedSize() > 16 ? - Point32::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Point32PubSubType::~Point32PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Point32PubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Point32* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool Point32PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Point32* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function Point32PubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* Point32PubSubType::createData() - { - return reinterpret_cast(new Point32()); - } - - void Point32PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Point32PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Point32* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Point32::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Point32::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +Point32PubSubType::Point32PubSubType() +{ + setName("geometry_msgs::msg::dds_::Point32_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Point32::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Point32_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +Point32PubSubType::~Point32PubSubType() +{ +} + +bool Point32PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Point32* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool Point32PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Point32* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function Point32PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* Point32PubSubType::createData() +{ + return reinterpret_cast(new Point32()); +} + +void Point32PubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool Point32PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.h index 346f91f5d4d..6fa6e87369a 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Point32PubSubTypes.h @@ -16,92 +16,120 @@ * @file Point32PubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Point32.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Point32 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Point32 defined by the user in the IDL file. + * @ingroup Point32 + */ +class Point32PubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Point32 defined by the user in the IDL file. - * @ingroup POINT32 - */ - class Point32PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Point32 type; + typedef Point32 type; - eProsima_user_DllExport Point32PubSubType(); + eProsima_user_DllExport Point32PubSubType(); - eProsima_user_DllExport virtual ~Point32PubSubType(); + eProsima_user_DllExport ~Point32PubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Point32(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT32_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointCdrAux.hpp new file mode 100644 index 00000000000..2e6f45415b5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINTCDRAUX_HPP_ + +#include "Point.h" + +constexpr uint32_t geometry_msgs_msg_Point_max_cdr_typesize {32UL}; +constexpr uint32_t geometry_msgs_msg_Point_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Point& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointCdrAux.ipp new file mode 100644 index 00000000000..06fef6778c5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINTCDRAUX_IPP_ + +#include "PointCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Point& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Point& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Point& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Point& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.cxx index 6c69a36b12a..839631831a9 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file PointPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PointPubSubTypes.h" +#include "PointCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - PointPubSubType::PointPubSubType() - { - setName("geometry_msgs::msg::dds_::Point_"); - auto type_size = Point::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Point::isKeyDefined(); - size_t keyLength = Point::getKeyMaxCdrSerializedSize() > 16 ? - Point::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PointPubSubType::~PointPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PointPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Point* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PointPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Point* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PointPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PointPubSubType::createData() - { - return reinterpret_cast(new Point()); - } - - void PointPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PointPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Point* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Point::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Point::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +PointPubSubType::PointPubSubType() +{ + setName("geometry_msgs::msg::dds_::Point_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Point::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Point_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PointPubSubType::~PointPubSubType() +{ +} + +bool PointPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Point* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PointPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Point* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PointPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PointPubSubType::createData() +{ + return reinterpret_cast(new Point()); +} + +void PointPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PointPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.h index 241f4d4b9e9..7bd57976c26 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PointPubSubTypes.h @@ -16,92 +16,120 @@ * @file PointPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Point.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Point is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Point defined by the user in the IDL file. + * @ingroup Point + */ +class PointPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Point defined by the user in the IDL file. - * @ingroup POINT - */ - class PointPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Point type; + typedef Point type; - eProsima_user_DllExport PointPubSubType(); + eProsima_user_DllExport PointPubSubType(); - eProsima_user_DllExport virtual ~PointPubSubType(); + eProsima_user_DllExport ~PointPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Point(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.cxx index 7f3821c9019..4cb62d86a8d 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.cxx @@ -14,9 +14,9 @@ /*! * @file Polygon.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,119 +27,77 @@ char dummy; #endif // _WIN32 #include "Polygon.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::Polygon::Polygon() -{ - // m_points com.eprosima.idl.parser.typecode.SequenceTypeCode@b9b00e0 + +namespace geometry_msgs { + +namespace msg { + + + +Polygon::Polygon() +{ } -geometry_msgs::msg::Polygon::~Polygon() +Polygon::~Polygon() { } -geometry_msgs::msg::Polygon::Polygon( +Polygon::Polygon( const Polygon& x) { m_points = x.m_points; } -geometry_msgs::msg::Polygon::Polygon( - Polygon&& x) +Polygon::Polygon( + Polygon&& x) noexcept { m_points = std::move(x.m_points); } -geometry_msgs::msg::Polygon& geometry_msgs::msg::Polygon::operator =( +Polygon& Polygon::operator =( const Polygon& x) { m_points = x.m_points; - return *this; } -geometry_msgs::msg::Polygon& geometry_msgs::msg::Polygon::operator =( - Polygon&& x) +Polygon& Polygon::operator =( + Polygon&& x) noexcept { m_points = std::move(x.m_points); - return *this; } -bool geometry_msgs::msg::Polygon::operator ==( +bool Polygon::operator ==( const Polygon& x) const { - return (m_points == x.m_points); } -bool geometry_msgs::msg::Polygon::operator !=( +bool Polygon::operator !=( const Polygon& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Polygon::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < 100; ++a) - { - current_alignment += geometry_msgs::msg::Point32::getMaxCdrSerializedSize(current_alignment);} - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::Polygon::getCdrSerializedSize( - const geometry_msgs::msg::Polygon& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.points().size(); ++a) - { - current_alignment += geometry_msgs::msg::Point32::getCdrSerializedSize(data.points().at(a), current_alignment);} - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Polygon::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_points; -} - -void geometry_msgs::msg::Polygon::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_points;} - /*! * @brief This function copies the value in member points * @param _points New value to be copied in member points */ -void geometry_msgs::msg::Polygon::points( +void Polygon::points( const std::vector& _points) { m_points = _points; @@ -149,7 +107,7 @@ void geometry_msgs::msg::Polygon::points( * @brief This function moves the value in member points * @param _points New value to be moved in member points */ -void geometry_msgs::msg::Polygon::points( +void Polygon::points( std::vector&& _points) { m_points = std::move(_points); @@ -159,7 +117,7 @@ void geometry_msgs::msg::Polygon::points( * @brief This function returns a constant reference to member points * @return Constant reference to member points */ -const std::vector& geometry_msgs::msg::Polygon::points() const +const std::vector& Polygon::points() const { return m_points; } @@ -168,31 +126,18 @@ const std::vector& geometry_msgs::msg::Polygon::poi * @brief This function returns a reference to member points * @return Reference to member points */ -std::vector& geometry_msgs::msg::Polygon::points() +std::vector& Polygon::points() { return m_points; } -size_t geometry_msgs::msg::Polygon::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool geometry_msgs::msg::Polygon::isKeyDefined() -{ - return false; -} +} // namespace msg -void geometry_msgs::msg::Polygon::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PolygonCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.h index fe1202ebf6b..29c3149ee1d 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Polygon.h @@ -16,20 +16,25 @@ * @file Polygon.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_H_ -#include "Point32.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "Point32.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,175 +48,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Polygon_SOURCE) -#define Polygon_DllAPI __declspec( dllexport ) +#if defined(POLYGON_SOURCE) +#define POLYGON_DllAPI __declspec( dllexport ) #else -#define Polygon_DllAPI __declspec( dllimport ) -#endif // Polygon_SOURCE +#define POLYGON_DllAPI __declspec( dllimport ) +#endif // POLYGON_SOURCE #else -#define Polygon_DllAPI +#define POLYGON_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Polygon_DllAPI +#define POLYGON_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Polygon defined by the user in the IDL file. - * @ingroup POLYGON - */ - class Polygon - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Polygon(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Polygon(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. - */ - eProsima_user_DllExport Polygon( - const Polygon& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. - */ - eProsima_user_DllExport Polygon( - Polygon&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. - */ - eProsima_user_DllExport Polygon& operator =( - const Polygon& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. - */ - eProsima_user_DllExport Polygon& operator =( - Polygon&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Polygon object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Polygon& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Polygon object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Polygon& x) const; - - /*! - * @brief This function copies the value in member points - * @param _points New value to be copied in member points - */ - eProsima_user_DllExport void points( - const std::vector& _points); - - /*! - * @brief This function moves the value in member points - * @param _points New value to be moved in member points - */ - eProsima_user_DllExport void points( - std::vector&& _points); - - /*! - * @brief This function returns a constant reference to member points - * @return Constant reference to member points - */ - eProsima_user_DllExport const std::vector& points() const; - - /*! - * @brief This function returns a reference to member points - * @return Reference to member points - */ - eProsima_user_DllExport std::vector& points(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Polygon& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - std::vector m_points; - }; - } // namespace msg + +namespace msg { + + + + + +/*! + * @brief This class represents the structure Polygon defined by the user in the IDL file. + * @ingroup Polygon + */ +class Polygon +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Polygon(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Polygon(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. + */ + eProsima_user_DllExport Polygon( + const Polygon& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. + */ + eProsima_user_DllExport Polygon( + Polygon&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. + */ + eProsima_user_DllExport Polygon& operator =( + const Polygon& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Polygon that will be copied. + */ + eProsima_user_DllExport Polygon& operator =( + Polygon&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Polygon object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Polygon& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Polygon object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Polygon& x) const; + + /*! + * @brief This function copies the value in member points + * @param _points New value to be copied in member points + */ + eProsima_user_DllExport void points( + const std::vector& _points); + + /*! + * @brief This function moves the value in member points + * @param _points New value to be moved in member points + */ + eProsima_user_DllExport void points( + std::vector&& _points); + + /*! + * @brief This function returns a constant reference to member points + * @return Constant reference to member points + */ + eProsima_user_DllExport const std::vector& points() const; + + /*! + * @brief This function returns a reference to member points + * @return Reference to member points + */ + eProsima_user_DllExport std::vector& points(); + +private: + + std::vector m_points; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonCdrAux.hpp new file mode 100644 index 00000000000..c40622add24 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PolygonCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGONCDRAUX_HPP_ + +#include "Polygon.h" + +constexpr uint32_t geometry_msgs_msg_Polygon_max_cdr_typesize {1612UL}; +constexpr uint32_t geometry_msgs_msg_Polygon_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Polygon& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonCdrAux.ipp new file mode 100644 index 00000000000..b09a70e9532 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonCdrAux.ipp @@ -0,0 +1,132 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PolygonCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGONCDRAUX_IPP_ + +#include "PolygonCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Polygon& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.points(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Polygon& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.points() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Polygon& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.points(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Polygon& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.cxx index 671dbdfd821..3713e481e74 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.cxx @@ -16,161 +16,185 @@ * @file PolygonPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PolygonPubSubTypes.h" +#include "PolygonCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - PolygonPubSubType::PolygonPubSubType() - { - setName("geometry_msgs::msg::dds_::Polygon_"); - auto type_size = Polygon::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Polygon::isKeyDefined(); - size_t keyLength = Polygon::getKeyMaxCdrSerializedSize() > 16 ? - Polygon::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PolygonPubSubType::~PolygonPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PolygonPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Polygon* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PolygonPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Polygon* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PolygonPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PolygonPubSubType::createData() - { - return reinterpret_cast(new Polygon()); - } - - void PolygonPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PolygonPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Polygon* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Polygon::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Polygon::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +PolygonPubSubType::PolygonPubSubType() +{ + setName("geometry_msgs::msg::dds_::Polygon_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Polygon::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Polygon_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PolygonPubSubType::~PolygonPubSubType() +{ +} + +bool PolygonPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Polygon* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PolygonPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Polygon* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PolygonPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PolygonPubSubType::createData() +{ + return reinterpret_cast(new Polygon()); +} + +void PolygonPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PolygonPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.h index f621ad859dd..b21c062afae 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PolygonPubSubTypes.h @@ -16,92 +16,123 @@ * @file PolygonPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Polygon.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "Point32PubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Polygon is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { + + + + + +/*! + * @brief This class represents the TopicDataType of the type Polygon defined by the user in the IDL file. + * @ingroup Polygon + */ +class PolygonPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Polygon defined by the user in the IDL file. - * @ingroup POLYGON - */ - class PolygonPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Polygon type; + typedef Polygon type; - eProsima_user_DllExport PolygonPubSubType(); + eProsima_user_DllExport PolygonPubSubType(); - eProsima_user_DllExport virtual ~PolygonPubSubType(); + eProsima_user_DllExport ~PolygonPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport void* createData() override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + eProsima_user_DllExport void deleteData( + void* data) override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POLYGON_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.cxx index 04a4cccfc48..8406befe2a3 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.cxx @@ -14,9 +14,9 @@ /*! * @file Pose.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "Pose.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::Pose::Pose() -{ - // m_position com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6cd28fa7 - // m_orientation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@614ca7df +namespace geometry_msgs { + +namespace msg { -} -geometry_msgs::msg::Pose::~Pose() +Pose::Pose() { +} +Pose::~Pose() +{ } -geometry_msgs::msg::Pose::Pose( +Pose::Pose( const Pose& x) { m_position = x.m_position; m_orientation = x.m_orientation; } -geometry_msgs::msg::Pose::Pose( - Pose&& x) +Pose::Pose( + Pose&& x) noexcept { m_position = std::move(x.m_position); m_orientation = std::move(x.m_orientation); } -geometry_msgs::msg::Pose& geometry_msgs::msg::Pose::operator =( +Pose& Pose::operator =( const Pose& x) { m_position = x.m_position; m_orientation = x.m_orientation; - return *this; } -geometry_msgs::msg::Pose& geometry_msgs::msg::Pose::operator =( - Pose&& x) +Pose& Pose::operator =( + Pose&& x) noexcept { m_position = std::move(x.m_position); m_orientation = std::move(x.m_orientation); - return *this; } -bool geometry_msgs::msg::Pose::operator ==( +bool Pose::operator ==( const Pose& x) const { - - return (m_position == x.m_position && m_orientation == x.m_orientation); + return (m_position == x.m_position && + m_orientation == x.m_orientation); } -bool geometry_msgs::msg::Pose::operator !=( +bool Pose::operator !=( const Pose& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Pose::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Point::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Quaternion::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::Pose::getCdrSerializedSize( - const geometry_msgs::msg::Pose& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Point::getCdrSerializedSize(data.position(), current_alignment); - current_alignment += geometry_msgs::msg::Quaternion::getCdrSerializedSize(data.orientation(), current_alignment); - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Pose::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_position; - scdr << m_orientation; - -} - -void geometry_msgs::msg::Pose::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_position; - dcdr >> m_orientation; -} - /*! * @brief This function copies the value in member position * @param _position New value to be copied in member position */ -void geometry_msgs::msg::Pose::position( +void Pose::position( const geometry_msgs::msg::Point& _position) { m_position = _position; @@ -152,7 +110,7 @@ void geometry_msgs::msg::Pose::position( * @brief This function moves the value in member position * @param _position New value to be moved in member position */ -void geometry_msgs::msg::Pose::position( +void Pose::position( geometry_msgs::msg::Point&& _position) { m_position = std::move(_position); @@ -162,7 +120,7 @@ void geometry_msgs::msg::Pose::position( * @brief This function returns a constant reference to member position * @return Constant reference to member position */ -const geometry_msgs::msg::Point& geometry_msgs::msg::Pose::position() const +const geometry_msgs::msg::Point& Pose::position() const { return m_position; } @@ -171,15 +129,17 @@ const geometry_msgs::msg::Point& geometry_msgs::msg::Pose::position() const * @brief This function returns a reference to member position * @return Reference to member position */ -geometry_msgs::msg::Point& geometry_msgs::msg::Pose::position() +geometry_msgs::msg::Point& Pose::position() { return m_position; } + + /*! * @brief This function copies the value in member orientation * @param _orientation New value to be copied in member orientation */ -void geometry_msgs::msg::Pose::orientation( +void Pose::orientation( const geometry_msgs::msg::Quaternion& _orientation) { m_orientation = _orientation; @@ -189,7 +149,7 @@ void geometry_msgs::msg::Pose::orientation( * @brief This function moves the value in member orientation * @param _orientation New value to be moved in member orientation */ -void geometry_msgs::msg::Pose::orientation( +void Pose::orientation( geometry_msgs::msg::Quaternion&& _orientation) { m_orientation = std::move(_orientation); @@ -199,7 +159,7 @@ void geometry_msgs::msg::Pose::orientation( * @brief This function returns a constant reference to member orientation * @return Constant reference to member orientation */ -const geometry_msgs::msg::Quaternion& geometry_msgs::msg::Pose::orientation() const +const geometry_msgs::msg::Quaternion& Pose::orientation() const { return m_orientation; } @@ -208,31 +168,18 @@ const geometry_msgs::msg::Quaternion& geometry_msgs::msg::Pose::orientation() co * @brief This function returns a reference to member orientation * @return Reference to member orientation */ -geometry_msgs::msg::Quaternion& geometry_msgs::msg::Pose::orientation() +geometry_msgs::msg::Quaternion& Pose::orientation() { return m_orientation; } -size_t geometry_msgs::msg::Pose::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool geometry_msgs::msg::Pose::isKeyDefined() -{ - return false; -} +} // namespace msg -void geometry_msgs::msg::Pose::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PoseCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.h index d21efb6beb3..ca22e2533b5 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Pose.h @@ -16,21 +16,26 @@ * @file Pose.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_H_ -#include "Quaternion.h" -#include "Point.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "Quaternion.h" +#include "Point.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -44,201 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Pose_SOURCE) -#define Pose_DllAPI __declspec( dllexport ) +#if defined(POSE_SOURCE) +#define POSE_DllAPI __declspec( dllexport ) #else -#define Pose_DllAPI __declspec( dllimport ) -#endif // Pose_SOURCE +#define POSE_DllAPI __declspec( dllimport ) +#endif // POSE_SOURCE #else -#define Pose_DllAPI +#define POSE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Pose_DllAPI +#define POSE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Pose defined by the user in the IDL file. - * @ingroup POSE - */ - class Pose - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Pose(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Pose(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. - */ - eProsima_user_DllExport Pose( - const Pose& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. - */ - eProsima_user_DllExport Pose( - Pose&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. - */ - eProsima_user_DllExport Pose& operator =( - const Pose& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. - */ - eProsima_user_DllExport Pose& operator =( - Pose&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Pose object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Pose& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Pose object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Pose& x) const; - - /*! - * @brief This function copies the value in member position - * @param _position New value to be copied in member position - */ - eProsima_user_DllExport void position( - const geometry_msgs::msg::Point& _position); - - /*! - * @brief This function moves the value in member position - * @param _position New value to be moved in member position - */ - eProsima_user_DllExport void position( - geometry_msgs::msg::Point&& _position); - - /*! - * @brief This function returns a constant reference to member position - * @return Constant reference to member position - */ - eProsima_user_DllExport const geometry_msgs::msg::Point& position() const; - - /*! - * @brief This function returns a reference to member position - * @return Reference to member position - */ - eProsima_user_DllExport geometry_msgs::msg::Point& position(); - /*! - * @brief This function copies the value in member orientation - * @param _orientation New value to be copied in member orientation - */ - eProsima_user_DllExport void orientation( - const geometry_msgs::msg::Quaternion& _orientation); - - /*! - * @brief This function moves the value in member orientation - * @param _orientation New value to be moved in member orientation - */ - eProsima_user_DllExport void orientation( - geometry_msgs::msg::Quaternion&& _orientation); - - /*! - * @brief This function returns a constant reference to member orientation - * @return Constant reference to member orientation - */ - eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; - - /*! - * @brief This function returns a reference to member orientation - * @return Reference to member orientation - */ - eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Pose& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - geometry_msgs::msg::Point m_position; - geometry_msgs::msg::Quaternion m_orientation; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Pose defined by the user in the IDL file. + * @ingroup Pose + */ +class Pose +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Pose(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Pose(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. + */ + eProsima_user_DllExport Pose( + const Pose& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. + */ + eProsima_user_DllExport Pose( + Pose&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. + */ + eProsima_user_DllExport Pose& operator =( + const Pose& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Pose that will be copied. + */ + eProsima_user_DllExport Pose& operator =( + Pose&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Pose object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Pose& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Pose object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Pose& x) const; + + /*! + * @brief This function copies the value in member position + * @param _position New value to be copied in member position + */ + eProsima_user_DllExport void position( + const geometry_msgs::msg::Point& _position); + + /*! + * @brief This function moves the value in member position + * @param _position New value to be moved in member position + */ + eProsima_user_DllExport void position( + geometry_msgs::msg::Point&& _position); + + /*! + * @brief This function returns a constant reference to member position + * @return Constant reference to member position + */ + eProsima_user_DllExport const geometry_msgs::msg::Point& position() const; + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport geometry_msgs::msg::Point& position(); + + + /*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ + eProsima_user_DllExport void orientation( + const geometry_msgs::msg::Quaternion& _orientation); + + /*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ + eProsima_user_DllExport void orientation( + geometry_msgs::msg::Quaternion&& _orientation); + + /*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ + eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; + + /*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ + eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); + +private: + + geometry_msgs::msg::Point m_position; + geometry_msgs::msg::Quaternion m_orientation; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseCdrAux.hpp new file mode 100644 index 00000000000..f28738dfd37 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSECDRAUX_HPP_ + +#include "Pose.h" + +constexpr uint32_t geometry_msgs_msg_Pose_max_cdr_typesize {72UL}; +constexpr uint32_t geometry_msgs_msg_Pose_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Pose& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseCdrAux.ipp new file mode 100644 index 00000000000..a33adbe12ce --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSECDRAUX_IPP_ + +#include "PoseCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Pose& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.position(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.orientation(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Pose& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.position() + << eprosima::fastcdr::MemberId(1) << data.orientation() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Pose& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.position(); + break; + + case 1: + dcdr >> data.orientation(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Pose& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.cxx index 9cc1f414fb7..760633e5039 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.cxx @@ -16,161 +16,183 @@ * @file PosePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PosePubSubTypes.h" +#include "PoseCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - PosePubSubType::PosePubSubType() - { - setName("geometry_msgs::msg::dds_::Pose_"); - auto type_size = Pose::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Pose::isKeyDefined(); - size_t keyLength = Pose::getKeyMaxCdrSerializedSize() > 16 ? - Pose::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PosePubSubType::~PosePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PosePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Pose* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PosePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Pose* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PosePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PosePubSubType::createData() - { - return reinterpret_cast(new Pose()); - } - - void PosePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PosePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Pose* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Pose::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Pose::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +PosePubSubType::PosePubSubType() +{ + setName("geometry_msgs::msg::dds_::Pose_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Pose::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Pose_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PosePubSubType::~PosePubSubType() +{ +} + +bool PosePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Pose* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PosePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Pose* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PosePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PosePubSubType::createData() +{ + return reinterpret_cast(new Pose()); +} + +void PosePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PosePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.h index 3cdddb9946d..4367dfe277c 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PosePubSubTypes.h @@ -16,92 +16,122 @@ * @file PosePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Pose.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "QuaternionPubSubTypes.h" +#include "PointPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Pose is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Pose defined by the user in the IDL file. + * @ingroup Pose + */ +class PosePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Pose defined by the user in the IDL file. - * @ingroup POSE - */ - class PosePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Pose type; + typedef Pose type; - eProsima_user_DllExport PosePubSubType(); + eProsima_user_DllExport PosePubSubType(); - eProsima_user_DllExport virtual ~PosePubSubType(); + eProsima_user_DllExport ~PosePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Pose(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.cxx index 0e89095fd2a..6f3fbcabac0 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.cxx @@ -14,9 +14,9 @@ /*! * @file PoseWithCovariance.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,131 +27,80 @@ char dummy; #endif // _WIN32 #include "PoseWithCovariance.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::PoseWithCovariance::PoseWithCovariance() -{ - // m_pose com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4efc180e +namespace geometry_msgs { + +namespace msg { - // m_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@bd4dc25 - memset(&m_covariance, 0, (36) * 8); -} -geometry_msgs::msg::PoseWithCovariance::~PoseWithCovariance() +PoseWithCovariance::PoseWithCovariance() { +} +PoseWithCovariance::~PoseWithCovariance() +{ } -geometry_msgs::msg::PoseWithCovariance::PoseWithCovariance( +PoseWithCovariance::PoseWithCovariance( const PoseWithCovariance& x) { m_pose = x.m_pose; m_covariance = x.m_covariance; } -geometry_msgs::msg::PoseWithCovariance::PoseWithCovariance( - PoseWithCovariance&& x) +PoseWithCovariance::PoseWithCovariance( + PoseWithCovariance&& x) noexcept { m_pose = std::move(x.m_pose); m_covariance = std::move(x.m_covariance); } -geometry_msgs::msg::PoseWithCovariance& geometry_msgs::msg::PoseWithCovariance::operator =( +PoseWithCovariance& PoseWithCovariance::operator =( const PoseWithCovariance& x) { m_pose = x.m_pose; m_covariance = x.m_covariance; - return *this; } -geometry_msgs::msg::PoseWithCovariance& geometry_msgs::msg::PoseWithCovariance::operator =( - PoseWithCovariance&& x) +PoseWithCovariance& PoseWithCovariance::operator =( + PoseWithCovariance&& x) noexcept { m_pose = std::move(x.m_pose); m_covariance = std::move(x.m_covariance); - return *this; } -bool geometry_msgs::msg::PoseWithCovariance::operator ==( +bool PoseWithCovariance::operator ==( const PoseWithCovariance& x) const { - - return (m_pose == x.m_pose && m_covariance == x.m_covariance); + return (m_pose == x.m_pose && + m_covariance == x.m_covariance); } -bool geometry_msgs::msg::PoseWithCovariance::operator !=( +bool PoseWithCovariance::operator !=( const PoseWithCovariance& x) const { return !(*this == x); } -size_t geometry_msgs::msg::PoseWithCovariance::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Pose::getMaxCdrSerializedSize(current_alignment); - current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::PoseWithCovariance::getCdrSerializedSize( - const geometry_msgs::msg::PoseWithCovariance& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Pose::getCdrSerializedSize(data.pose(), current_alignment); - if ((36) > 0) - { - current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::PoseWithCovariance::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_pose; - scdr << m_covariance; - - -} - -void geometry_msgs::msg::PoseWithCovariance::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_pose; - dcdr >> m_covariance; - -} - /*! * @brief This function copies the value in member pose * @param _pose New value to be copied in member pose */ -void geometry_msgs::msg::PoseWithCovariance::pose( +void PoseWithCovariance::pose( const geometry_msgs::msg::Pose& _pose) { m_pose = _pose; @@ -161,7 +110,7 @@ void geometry_msgs::msg::PoseWithCovariance::pose( * @brief This function moves the value in member pose * @param _pose New value to be moved in member pose */ -void geometry_msgs::msg::PoseWithCovariance::pose( +void PoseWithCovariance::pose( geometry_msgs::msg::Pose&& _pose) { m_pose = std::move(_pose); @@ -171,7 +120,7 @@ void geometry_msgs::msg::PoseWithCovariance::pose( * @brief This function returns a constant reference to member pose * @return Constant reference to member pose */ -const geometry_msgs::msg::Pose& geometry_msgs::msg::PoseWithCovariance::pose() const +const geometry_msgs::msg::Pose& PoseWithCovariance::pose() const { return m_pose; } @@ -180,16 +129,18 @@ const geometry_msgs::msg::Pose& geometry_msgs::msg::PoseWithCovariance::pose() c * @brief This function returns a reference to member pose * @return Reference to member pose */ -geometry_msgs::msg::Pose& geometry_msgs::msg::PoseWithCovariance::pose() +geometry_msgs::msg::Pose& PoseWithCovariance::pose() { return m_pose; } + + /*! * @brief This function copies the value in member covariance * @param _covariance New value to be copied in member covariance */ -void geometry_msgs::msg::PoseWithCovariance::covariance( - const geometry_msgs::msg::double_pose_36& _covariance) +void PoseWithCovariance::covariance( + const geometry_msgs::msg::double__36& _covariance) { m_covariance = _covariance; } @@ -198,8 +149,8 @@ void geometry_msgs::msg::PoseWithCovariance::covariance( * @brief This function moves the value in member covariance * @param _covariance New value to be moved in member covariance */ -void geometry_msgs::msg::PoseWithCovariance::covariance( - geometry_msgs::msg::double_pose_36&& _covariance) +void PoseWithCovariance::covariance( + geometry_msgs::msg::double__36&& _covariance) { m_covariance = std::move(_covariance); } @@ -208,7 +159,7 @@ void geometry_msgs::msg::PoseWithCovariance::covariance( * @brief This function returns a constant reference to member covariance * @return Constant reference to member covariance */ -const geometry_msgs::msg::double_pose_36& geometry_msgs::msg::PoseWithCovariance::covariance() const +const geometry_msgs::msg::double__36& PoseWithCovariance::covariance() const { return m_covariance; } @@ -217,31 +168,18 @@ const geometry_msgs::msg::double_pose_36& geometry_msgs::msg::PoseWithCovariance * @brief This function returns a reference to member covariance * @return Reference to member covariance */ -geometry_msgs::msg::double_pose_36& geometry_msgs::msg::PoseWithCovariance::covariance() +geometry_msgs::msg::double__36& PoseWithCovariance::covariance() { return m_covariance; } -size_t geometry_msgs::msg::PoseWithCovariance::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool geometry_msgs::msg::PoseWithCovariance::isKeyDefined() -{ - return false; -} - -void geometry_msgs::msg::PoseWithCovariance::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PoseWithCovarianceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.h index dd98e464e18..d2c65faa433 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariance.h @@ -16,20 +16,25 @@ * @file PoseWithCovariance.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_H_ -#include "Pose.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "Pose.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,202 +48,160 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PoseWithCovariance_SOURCE) -#define PoseWithCovariance_DllAPI __declspec( dllexport ) +#if defined(POSEWITHCOVARIANCE_SOURCE) +#define POSEWITHCOVARIANCE_DllAPI __declspec( dllexport ) #else -#define PoseWithCovariance_DllAPI __declspec( dllimport ) -#endif // PoseWithCovariance_SOURCE +#define POSEWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // POSEWITHCOVARIANCE_SOURCE #else -#define PoseWithCovariance_DllAPI +#define POSEWITHCOVARIANCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PoseWithCovariance_DllAPI +#define POSEWITHCOVARIANCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - typedef std::array double_pose_36; - /*! - * @brief This class represents the structure PoseWithCovariance defined by the user in the IDL file. - * @ingroup POSEWITHCOVARIANCE - */ - class PoseWithCovariance - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PoseWithCovariance(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PoseWithCovariance(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance( - const PoseWithCovariance& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance( - PoseWithCovariance&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance& operator =( - const PoseWithCovariance& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. - */ - eProsima_user_DllExport PoseWithCovariance& operator =( - PoseWithCovariance&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::PoseWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PoseWithCovariance& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::PoseWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PoseWithCovariance& x) const; - - /*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ - eProsima_user_DllExport void pose( - const geometry_msgs::msg::Pose& _pose); - - /*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ - eProsima_user_DllExport void pose( - geometry_msgs::msg::Pose&& _pose); - - /*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ - eProsima_user_DllExport const geometry_msgs::msg::Pose& pose() const; - - /*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ - eProsima_user_DllExport geometry_msgs::msg::Pose& pose(); - /*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ - eProsima_user_DllExport void covariance( - const geometry_msgs::msg::double_pose_36& _covariance); - - /*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ - eProsima_user_DllExport void covariance( - geometry_msgs::msg::double_pose_36&& _covariance); - - /*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ - eProsima_user_DllExport const geometry_msgs::msg::double_pose_36& covariance() const; - - /*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ - eProsima_user_DllExport geometry_msgs::msg::double_pose_36& covariance(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::PoseWithCovariance& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - geometry_msgs::msg::Pose m_pose; - geometry_msgs::msg::double_pose_36 m_covariance; - }; - } // namespace msg + +namespace msg { + +typedef std::array double__36; + + + +/*! + * @brief This class represents the structure PoseWithCovariance defined by the user in the IDL file. + * @ingroup PoseWithCovariance + */ +class PoseWithCovariance +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PoseWithCovariance(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PoseWithCovariance(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance( + const PoseWithCovariance& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance( + PoseWithCovariance&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance& operator =( + const PoseWithCovariance& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::PoseWithCovariance that will be copied. + */ + eProsima_user_DllExport PoseWithCovariance& operator =( + PoseWithCovariance&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::PoseWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PoseWithCovariance& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::PoseWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PoseWithCovariance& x) const; + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose( + const geometry_msgs::msg::Pose& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose( + geometry_msgs::msg::Pose&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::Pose& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::Pose& pose(); + + + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const geometry_msgs::msg::double__36& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + geometry_msgs::msg::double__36&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const geometry_msgs::msg::double__36& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport geometry_msgs::msg::double__36& covariance(); + +private: + + geometry_msgs::msg::Pose m_pose; + geometry_msgs::msg::double__36 m_covariance{0.0}; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovarianceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovarianceCdrAux.hpp new file mode 100644 index 00000000000..b610c1d96d9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovarianceCdrAux.hpp @@ -0,0 +1,53 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCECDRAUX_HPP_ + +#include "PoseWithCovariance.h" + +constexpr uint32_t geometry_msgs_msg_PoseWithCovariance_max_cdr_typesize {368UL}; +constexpr uint32_t geometry_msgs_msg_PoseWithCovariance_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::PoseWithCovariance& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovarianceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovarianceCdrAux.ipp new file mode 100644 index 00000000000..7cbafe07cd5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovarianceCdrAux.ipp @@ -0,0 +1,140 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PoseWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCECDRAUX_IPP_ + +#include "PoseWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::PoseWithCovariance& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.pose(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::PoseWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.pose() + << eprosima::fastcdr::MemberId(1) << data.covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::PoseWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.pose(); + break; + + case 1: + dcdr >> data.covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::PoseWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.cxx index 5757f76168d..fb964e35768 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.cxx @@ -16,162 +16,185 @@ * @file PoseWithCovariancePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "PoseWithCovariancePubSubTypes.h" +#include "PoseWithCovarianceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - - PoseWithCovariancePubSubType::PoseWithCovariancePubSubType() - { - setName("geometry_msgs::msg::dds_::PoseWithCovariance_"); - auto type_size = PoseWithCovariance::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PoseWithCovariance::isKeyDefined(); - size_t keyLength = PoseWithCovariance::getKeyMaxCdrSerializedSize() > 16 ? - PoseWithCovariance::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PoseWithCovariancePubSubType::~PoseWithCovariancePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PoseWithCovariancePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PoseWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PoseWithCovariancePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - PoseWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PoseWithCovariancePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PoseWithCovariancePubSubType::createData() - { - return reinterpret_cast(new PoseWithCovariance()); - } - - void PoseWithCovariancePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PoseWithCovariancePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PoseWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PoseWithCovariance::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PoseWithCovariance::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +PoseWithCovariancePubSubType::PoseWithCovariancePubSubType() +{ + setName("geometry_msgs::msg::dds_::PoseWithCovariance_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PoseWithCovariance::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_PoseWithCovariance_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PoseWithCovariancePubSubType::~PoseWithCovariancePubSubType() +{ +} + +bool PoseWithCovariancePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PoseWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PoseWithCovariancePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PoseWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PoseWithCovariancePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PoseWithCovariancePubSubType::createData() +{ + return reinterpret_cast(new PoseWithCovariance()); +} + +void PoseWithCovariancePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PoseWithCovariancePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.h index afe95d852f9..ca88a0fc7f3 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/PoseWithCovariancePubSubTypes.h @@ -16,93 +16,122 @@ * @file PoseWithCovariancePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "PoseWithCovariance.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "PosePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated PoseWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { +typedef std::array double__36; + + + +/*! + * @brief This class represents the TopicDataType of the type PoseWithCovariance defined by the user in the IDL file. + * @ingroup PoseWithCovariance + */ +class PoseWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - typedef std::array double_pose_36; - /*! - * @brief This class represents the TopicDataType of the type PoseWithCovariance defined by the user in the IDL file. - * @ingroup POSEWITHCOVARIANCE - */ - class PoseWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef PoseWithCovariance type; + typedef PoseWithCovariance type; - eProsima_user_DllExport PoseWithCovariancePubSubType(); + eProsima_user_DllExport PoseWithCovariancePubSubType(); - eProsima_user_DllExport virtual ~PoseWithCovariancePubSubType(); + eProsima_user_DllExport ~PoseWithCovariancePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) PoseWithCovariance(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POSEWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.cxx index 8146a4ad617..c8af7051f43 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.cxx @@ -14,9 +14,9 @@ /*! * @file Quaternion.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,34 +27,31 @@ char dummy; #endif // _WIN32 #include "Quaternion.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::Quaternion::Quaternion() -{ - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@593aaf41 - m_x = 0.0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5a56cdac - m_y = 0.0; - // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7c711375 - m_z = 0.0; - // m_w com.eprosima.idl.parser.typecode.PrimitiveTypeCode@57cf54e1 - m_w = 1.0; -} +namespace geometry_msgs { -geometry_msgs::msg::Quaternion::~Quaternion() -{ +namespace msg { +Quaternion::Quaternion() +{ } -geometry_msgs::msg::Quaternion::Quaternion( +Quaternion::~Quaternion() +{ +} + +Quaternion::Quaternion( const Quaternion& x) { m_x = x.m_x; @@ -63,8 +60,8 @@ geometry_msgs::msg::Quaternion::Quaternion( m_w = x.m_w; } -geometry_msgs::msg::Quaternion::Quaternion( - Quaternion&& x) +Quaternion::Quaternion( + Quaternion&& x) noexcept { m_x = x.m_x; m_y = x.m_y; @@ -72,7 +69,7 @@ geometry_msgs::msg::Quaternion::Quaternion( m_w = x.m_w; } -geometry_msgs::msg::Quaternion& geometry_msgs::msg::Quaternion::operator =( +Quaternion& Quaternion::operator =( const Quaternion& x) { @@ -80,107 +77,40 @@ geometry_msgs::msg::Quaternion& geometry_msgs::msg::Quaternion::operator =( m_y = x.m_y; m_z = x.m_z; m_w = x.m_w; - return *this; } -geometry_msgs::msg::Quaternion& geometry_msgs::msg::Quaternion::operator =( - Quaternion&& x) +Quaternion& Quaternion::operator =( + Quaternion&& x) noexcept { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; m_w = x.m_w; - return *this; } -bool geometry_msgs::msg::Quaternion::operator ==( +bool Quaternion::operator ==( const Quaternion& x) const { - - return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z && m_w == x.m_w); + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z && + m_w == x.m_w); } -bool geometry_msgs::msg::Quaternion::operator !=( +bool Quaternion::operator !=( const Quaternion& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Quaternion::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::Quaternion::getCdrSerializedSize( - const geometry_msgs::msg::Quaternion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Quaternion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_x; - scdr << m_y; - scdr << m_z; - scdr << m_w; - -} - -void geometry_msgs::msg::Quaternion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_x; - dcdr >> m_y; - dcdr >> m_z; - dcdr >> m_w; -} - /*! * @brief This function sets a value in member x * @param _x New value for member x */ -void geometry_msgs::msg::Quaternion::x( +void Quaternion::x( double _x) { m_x = _x; @@ -190,7 +120,7 @@ void geometry_msgs::msg::Quaternion::x( * @brief This function returns the value of member x * @return Value of member x */ -double geometry_msgs::msg::Quaternion::x() const +double Quaternion::x() const { return m_x; } @@ -199,16 +129,17 @@ double geometry_msgs::msg::Quaternion::x() const * @brief This function returns a reference to member x * @return Reference to member x */ -double& geometry_msgs::msg::Quaternion::x() +double& Quaternion::x() { return m_x; } + /*! * @brief This function sets a value in member y * @param _y New value for member y */ -void geometry_msgs::msg::Quaternion::y( +void Quaternion::y( double _y) { m_y = _y; @@ -218,7 +149,7 @@ void geometry_msgs::msg::Quaternion::y( * @brief This function returns the value of member y * @return Value of member y */ -double geometry_msgs::msg::Quaternion::y() const +double Quaternion::y() const { return m_y; } @@ -227,16 +158,17 @@ double geometry_msgs::msg::Quaternion::y() const * @brief This function returns a reference to member y * @return Reference to member y */ -double& geometry_msgs::msg::Quaternion::y() +double& Quaternion::y() { return m_y; } + /*! * @brief This function sets a value in member z * @param _z New value for member z */ -void geometry_msgs::msg::Quaternion::z( +void Quaternion::z( double _z) { m_z = _z; @@ -246,7 +178,7 @@ void geometry_msgs::msg::Quaternion::z( * @brief This function returns the value of member z * @return Value of member z */ -double geometry_msgs::msg::Quaternion::z() const +double Quaternion::z() const { return m_z; } @@ -255,16 +187,17 @@ double geometry_msgs::msg::Quaternion::z() const * @brief This function returns a reference to member z * @return Reference to member z */ -double& geometry_msgs::msg::Quaternion::z() +double& Quaternion::z() { return m_z; } + /*! * @brief This function sets a value in member w * @param _w New value for member w */ -void geometry_msgs::msg::Quaternion::w( +void Quaternion::w( double _w) { m_w = _w; @@ -274,7 +207,7 @@ void geometry_msgs::msg::Quaternion::w( * @brief This function returns the value of member w * @return Value of member w */ -double geometry_msgs::msg::Quaternion::w() const +double Quaternion::w() const { return m_w; } @@ -283,32 +216,18 @@ double geometry_msgs::msg::Quaternion::w() const * @brief This function returns a reference to member w * @return Reference to member w */ -double& geometry_msgs::msg::Quaternion::w() +double& Quaternion::w() { return m_w; } -size_t geometry_msgs::msg::Quaternion::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; +} // namespace msg - return current_align; -} - -bool geometry_msgs::msg::Quaternion::isKeyDefined() -{ - return false; -} - -void geometry_msgs::msg::Quaternion::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "QuaternionCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.h index bc793f05b18..9692f430aee 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Quaternion.h @@ -16,19 +16,24 @@ * @file Quaternion.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,229 +47,186 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Quaternion_SOURCE) -#define Quaternion_DllAPI __declspec( dllexport ) +#if defined(QUATERNION_SOURCE) +#define QUATERNION_DllAPI __declspec( dllexport ) #else -#define Quaternion_DllAPI __declspec( dllimport ) -#endif // Quaternion_SOURCE +#define QUATERNION_DllAPI __declspec( dllimport ) +#endif // QUATERNION_SOURCE #else -#define Quaternion_DllAPI +#define QUATERNION_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Quaternion_DllAPI +#define QUATERNION_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Quaternion defined by the user in the IDL file. - * @ingroup QUATERNION - */ - class Quaternion - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Quaternion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Quaternion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. - */ - eProsima_user_DllExport Quaternion( - const Quaternion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. - */ - eProsima_user_DllExport Quaternion( - Quaternion&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. - */ - eProsima_user_DllExport Quaternion& operator =( - const Quaternion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. - */ - eProsima_user_DllExport Quaternion& operator =( - Quaternion&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Quaternion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Quaternion& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Quaternion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Quaternion& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - /*! - * @brief This function sets a value in member w - * @param _w New value for member w - */ - eProsima_user_DllExport void w( - double _w); - - /*! - * @brief This function returns the value of member w - * @return Value of member w - */ - eProsima_user_DllExport double w() const; - - /*! - * @brief This function returns a reference to member w - * @return Reference to member w - */ - eProsima_user_DllExport double& w(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Quaternion& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - double m_x; - double m_y; - double m_z; - double m_w; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Quaternion defined by the user in the IDL file. + * @ingroup Quaternion + */ +class Quaternion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Quaternion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Quaternion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. + */ + eProsima_user_DllExport Quaternion( + const Quaternion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. + */ + eProsima_user_DllExport Quaternion( + Quaternion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. + */ + eProsima_user_DllExport Quaternion& operator =( + const Quaternion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Quaternion that will be copied. + */ + eProsima_user_DllExport Quaternion& operator =( + Quaternion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Quaternion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Quaternion& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Quaternion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Quaternion& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + + + /*! + * @brief This function sets a value in member w + * @param _w New value for member w + */ + eProsima_user_DllExport void w( + double _w); + + /*! + * @brief This function returns the value of member w + * @return Value of member w + */ + eProsima_user_DllExport double w() const; + + /*! + * @brief This function returns a reference to member w + * @return Reference to member w + */ + eProsima_user_DllExport double& w(); + +private: + + double m_x{0.0}; + double m_y{0.0}; + double m_z{0.0}; + double m_w{1.0}; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionCdrAux.hpp new file mode 100644 index 00000000000..1284f107077 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNIONCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNIONCDRAUX_HPP_ + +#include "Quaternion.h" + +constexpr uint32_t geometry_msgs_msg_Quaternion_max_cdr_typesize {40UL}; +constexpr uint32_t geometry_msgs_msg_Quaternion_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Quaternion& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNIONCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionCdrAux.ipp new file mode 100644 index 00000000000..908fc8f3ae4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionCdrAux.ipp @@ -0,0 +1,154 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file QuaternionCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNIONCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNIONCDRAUX_IPP_ + +#include "QuaternionCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Quaternion& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.w(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Quaternion& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() + << eprosima::fastcdr::MemberId(3) << data.w() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Quaternion& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + case 3: + dcdr >> data.w(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Quaternion& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNIONCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.cxx index f3f6fc8873a..6b4163c8702 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file QuaternionPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "QuaternionPubSubTypes.h" +#include "QuaternionCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - QuaternionPubSubType::QuaternionPubSubType() - { - setName("geometry_msgs::msg::dds_::Quaternion_"); - auto type_size = Quaternion::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Quaternion::isKeyDefined(); - size_t keyLength = Quaternion::getKeyMaxCdrSerializedSize() > 16 ? - Quaternion::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - QuaternionPubSubType::~QuaternionPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool QuaternionPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Quaternion* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool QuaternionPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Quaternion* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function QuaternionPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* QuaternionPubSubType::createData() - { - return reinterpret_cast(new Quaternion()); - } - - void QuaternionPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool QuaternionPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Quaternion* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Quaternion::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Quaternion::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +QuaternionPubSubType::QuaternionPubSubType() +{ + setName("geometry_msgs::msg::dds_::Quaternion_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Quaternion::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Quaternion_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +QuaternionPubSubType::~QuaternionPubSubType() +{ +} + +bool QuaternionPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Quaternion* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool QuaternionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Quaternion* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function QuaternionPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* QuaternionPubSubType::createData() +{ + return reinterpret_cast(new Quaternion()); +} + +void QuaternionPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool QuaternionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.h index df71e2249c9..8a9def53d95 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/QuaternionPubSubTypes.h @@ -16,92 +16,120 @@ * @file QuaternionPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Quaternion.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Quaternion is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Quaternion defined by the user in the IDL file. + * @ingroup Quaternion + */ +class QuaternionPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Quaternion defined by the user in the IDL file. - * @ingroup QUATERNION - */ - class QuaternionPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Quaternion type; + typedef Quaternion type; - eProsima_user_DllExport QuaternionPubSubType(); + eProsima_user_DllExport QuaternionPubSubType(); - eProsima_user_DllExport virtual ~QuaternionPubSubType(); + eProsima_user_DllExport ~QuaternionPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Quaternion(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_QUATERNION_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.cxx index 0d2056533ab..1b6238f7136 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.cxx @@ -14,9 +14,9 @@ /*! * @file Transform.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,109 +27,80 @@ char dummy; #endif // _WIN32 #include "Transform.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Transform_max_cdr_typesize 56ULL; -#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL; -#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Transform_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL; -geometry_msgs::msg::Transform::Transform() +namespace geometry_msgs { + +namespace msg { + + + +Transform::Transform() { } -geometry_msgs::msg::Transform::~Transform() +Transform::~Transform() { } -geometry_msgs::msg::Transform::Transform( +Transform::Transform( const Transform& x) { m_translation = x.m_translation; m_rotation = x.m_rotation; } -geometry_msgs::msg::Transform::Transform( +Transform::Transform( Transform&& x) noexcept { m_translation = std::move(x.m_translation); m_rotation = std::move(x.m_rotation); } -geometry_msgs::msg::Transform& geometry_msgs::msg::Transform::operator =( +Transform& Transform::operator =( const Transform& x) { + m_translation = x.m_translation; m_rotation = x.m_rotation; - return *this; } -geometry_msgs::msg::Transform& geometry_msgs::msg::Transform::operator =( +Transform& Transform::operator =( Transform&& x) noexcept { + m_translation = std::move(x.m_translation); m_rotation = std::move(x.m_rotation); - return *this; } -bool geometry_msgs::msg::Transform::operator ==( +bool Transform::operator ==( const Transform& x) const { - return (m_translation == x.m_translation && m_rotation == x.m_rotation); + return (m_translation == x.m_translation && + m_rotation == x.m_rotation); } -bool geometry_msgs::msg::Transform::operator !=( +bool Transform::operator !=( const Transform& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Transform::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_Transform_max_cdr_typesize; -} - -size_t geometry_msgs::msg::Transform::getCdrSerializedSize( - const geometry_msgs::msg::Transform& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.translation(), current_alignment); - current_alignment += geometry_msgs::msg::Quaternion::getCdrSerializedSize(data.rotation(), current_alignment); - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Transform::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_translation; - scdr << m_rotation; -} - -void geometry_msgs::msg::Transform::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_translation; - dcdr >> m_rotation; -} - /*! * @brief This function copies the value in member translation * @param _translation New value to be copied in member translation */ -void geometry_msgs::msg::Transform::translation( +void Transform::translation( const geometry_msgs::msg::Vector3& _translation) { m_translation = _translation; @@ -139,7 +110,7 @@ void geometry_msgs::msg::Transform::translation( * @brief This function moves the value in member translation * @param _translation New value to be moved in member translation */ -void geometry_msgs::msg::Transform::translation( +void Transform::translation( geometry_msgs::msg::Vector3&& _translation) { m_translation = std::move(_translation); @@ -149,7 +120,7 @@ void geometry_msgs::msg::Transform::translation( * @brief This function returns a constant reference to member translation * @return Constant reference to member translation */ -const geometry_msgs::msg::Vector3& geometry_msgs::msg::Transform::translation() const +const geometry_msgs::msg::Vector3& Transform::translation() const { return m_translation; } @@ -158,15 +129,17 @@ const geometry_msgs::msg::Vector3& geometry_msgs::msg::Transform::translation() * @brief This function returns a reference to member translation * @return Reference to member translation */ -geometry_msgs::msg::Vector3& geometry_msgs::msg::Transform::translation() +geometry_msgs::msg::Vector3& Transform::translation() { return m_translation; } + + /*! * @brief This function copies the value in member rotation * @param _rotation New value to be copied in member rotation */ -void geometry_msgs::msg::Transform::rotation( +void Transform::rotation( const geometry_msgs::msg::Quaternion& _rotation) { m_rotation = _rotation; @@ -176,7 +149,7 @@ void geometry_msgs::msg::Transform::rotation( * @brief This function moves the value in member rotation * @param _rotation New value to be moved in member rotation */ -void geometry_msgs::msg::Transform::rotation( +void Transform::rotation( geometry_msgs::msg::Quaternion&& _rotation) { m_rotation = std::move(_rotation); @@ -186,7 +159,7 @@ void geometry_msgs::msg::Transform::rotation( * @brief This function returns a constant reference to member rotation * @return Constant reference to member rotation */ -const geometry_msgs::msg::Quaternion& geometry_msgs::msg::Transform::rotation() const +const geometry_msgs::msg::Quaternion& Transform::rotation() const { return m_rotation; } @@ -195,25 +168,18 @@ const geometry_msgs::msg::Quaternion& geometry_msgs::msg::Transform::rotation() * @brief This function returns a reference to member rotation * @return Reference to member rotation */ -geometry_msgs::msg::Quaternion& geometry_msgs::msg::Transform::rotation() +geometry_msgs::msg::Quaternion& Transform::rotation() { return m_rotation; } -size_t geometry_msgs::msg::Transform::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_Transform_max_key_cdr_typesize; -} -bool geometry_msgs::msg::Transform::isKeyDefined() -{ - return false; -} -void geometry_msgs::msg::Transform::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "TransformCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.h index 2d84f30f040..542c0b33bc4 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Transform.h @@ -16,27 +16,30 @@ * @file Transform.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ -#include "Quaternion.h" -#include "Vector3.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "Quaternion.h" +#include "Vector3.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -46,178 +49,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Transform_SOURCE) -#define Transform_DllAPI __declspec(dllexport) +#if defined(TRANSFORM_SOURCE) +#define TRANSFORM_DllAPI __declspec( dllexport ) #else -#define Transform_DllAPI __declspec(dllimport) -#endif // Transform_SOURCE +#define TRANSFORM_DllAPI __declspec( dllimport ) +#endif // TRANSFORM_SOURCE #else -#define Transform_DllAPI +#define TRANSFORM_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Transform_DllAPI -#endif // _WIN32 +#define TRANSFORM_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace geometry_msgs { + namespace msg { + + + /*! * @brief This class represents the structure Transform defined by the user in the IDL file. - * @ingroup TRANSFORM + * @ingroup Transform */ -class Transform { +class Transform +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Transform(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Transform(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. - */ - eProsima_user_DllExport Transform(const Transform& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. - */ - eProsima_user_DllExport Transform(Transform&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. - */ - eProsima_user_DllExport Transform& operator=(const Transform& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. - */ - eProsima_user_DllExport Transform& operator=(Transform&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Transform object to compare. - */ - eProsima_user_DllExport bool operator==(const Transform& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Transform object to compare. - */ - eProsima_user_DllExport bool operator!=(const Transform& x) const; - - /*! - * @brief This function copies the value in member translation - * @param _translation New value to be copied in member translation - */ - eProsima_user_DllExport void translation(const geometry_msgs::msg::Vector3& _translation); - - /*! - * @brief This function moves the value in member translation - * @param _translation New value to be moved in member translation - */ - eProsima_user_DllExport void translation(geometry_msgs::msg::Vector3&& _translation); - - /*! - * @brief This function returns a constant reference to member translation - * @return Constant reference to member translation - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& translation() const; - - /*! - * @brief This function returns a reference to member translation - * @return Reference to member translation - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& translation(); - /*! - * @brief This function copies the value in member rotation - * @param _rotation New value to be copied in member rotation - */ - eProsima_user_DllExport void rotation(const geometry_msgs::msg::Quaternion& _rotation); - - /*! - * @brief This function moves the value in member rotation - * @param _rotation New value to be moved in member rotation - */ - eProsima_user_DllExport void rotation(geometry_msgs::msg::Quaternion&& _rotation); - - /*! - * @brief This function returns a constant reference to member rotation - * @return Constant reference to member rotation - */ - eProsima_user_DllExport const geometry_msgs::msg::Quaternion& rotation() const; - - /*! - * @brief This function returns a reference to member rotation - * @return Reference to member rotation - */ - eProsima_user_DllExport geometry_msgs::msg::Quaternion& rotation(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const geometry_msgs::msg::Transform& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Transform(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Transform(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. + */ + eProsima_user_DllExport Transform( + const Transform& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. + */ + eProsima_user_DllExport Transform( + Transform&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. + */ + eProsima_user_DllExport Transform& operator =( + const Transform& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Transform that will be copied. + */ + eProsima_user_DllExport Transform& operator =( + Transform&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Transform object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Transform& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Transform object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Transform& x) const; + + /*! + * @brief This function copies the value in member translation + * @param _translation New value to be copied in member translation + */ + eProsima_user_DllExport void translation( + const geometry_msgs::msg::Vector3& _translation); + + /*! + * @brief This function moves the value in member translation + * @param _translation New value to be moved in member translation + */ + eProsima_user_DllExport void translation( + geometry_msgs::msg::Vector3&& _translation); + + /*! + * @brief This function returns a constant reference to member translation + * @return Constant reference to member translation + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& translation() const; + + /*! + * @brief This function returns a reference to member translation + * @return Reference to member translation + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& translation(); + + + /*! + * @brief This function copies the value in member rotation + * @param _rotation New value to be copied in member rotation + */ + eProsima_user_DllExport void rotation( + const geometry_msgs::msg::Quaternion& _rotation); + + /*! + * @brief This function moves the value in member rotation + * @param _rotation New value to be moved in member rotation + */ + eProsima_user_DllExport void rotation( + geometry_msgs::msg::Quaternion&& _rotation); + + /*! + * @brief This function returns a constant reference to member rotation + * @return Constant reference to member rotation + */ + eProsima_user_DllExport const geometry_msgs::msg::Quaternion& rotation() const; + + /*! + * @brief This function returns a reference to member rotation + * @return Reference to member rotation + */ + eProsima_user_DllExport geometry_msgs::msg::Quaternion& rotation(); private: - geometry_msgs::msg::Vector3 m_translation; - geometry_msgs::msg::Quaternion m_rotation; + + geometry_msgs::msg::Vector3 m_translation; + geometry_msgs::msg::Quaternion m_rotation; + }; -} // namespace msg -} // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ +} // namespace msg + +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformCdrAux.hpp new file mode 100644 index 00000000000..b05278fca64 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformCdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TransformCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMCDRAUX_HPP_ + +#include "Transform.h" + +constexpr uint32_t geometry_msgs_msg_Transform_max_cdr_typesize {72UL}; +constexpr uint32_t geometry_msgs_msg_Transform_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Transform& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformCdrAux.ipp new file mode 100644 index 00000000000..2efb7ce1140 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TransformCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMCDRAUX_IPP_ + +#include "TransformCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Transform& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.translation(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.rotation(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Transform& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.translation() + << eprosima::fastcdr::MemberId(1) << data.rotation() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Transform& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.translation(); + break; + + case 1: + dcdr >> data.rotation(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Transform& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.cxx index 6acb6b5ee51..2cf35c3f936 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.cxx @@ -16,157 +16,183 @@ * @file TransformPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "TransformPubSubTypes.h" +#include "TransformCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - TransformPubSubType::TransformPubSubType() - { - setName("geometry_msgs::msg::dds_::Transform_"); - auto type_size = Transform::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Transform::isKeyDefined(); - size_t keyLength = Transform::getKeyMaxCdrSerializedSize() > 16 ? - Transform::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TransformPubSubType::~TransformPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TransformPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Transform* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TransformPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - Transform* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TransformPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TransformPubSubType::createData() - { - return reinterpret_cast(new Transform()); - } - - void TransformPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TransformPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Transform* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Transform::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Transform::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + +TransformPubSubType::TransformPubSubType() +{ + setName("geometry_msgs::msg::dds_::Transform_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Transform::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Transform_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +TransformPubSubType::~TransformPubSubType() +{ +} + +bool TransformPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Transform* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool TransformPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Transform* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function TransformPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* TransformPubSubType::createData() +{ + return reinterpret_cast(new Transform()); +} + +void TransformPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TransformPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.h index 6f463271b55..bb13e517dc1 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformPubSubTypes.h @@ -16,109 +16,122 @@ * @file TransformPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "Transform.h" #include "QuaternionPubSubTypes.h" #include "Vector3PubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Transform is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Transform is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace geometry_msgs { namespace msg { -#ifndef SWIG -namespace detail { - -template -struct Transform_rob { - friend constexpr typename Tag::type get(Tag) { - return M; - } -}; - -struct Transform_f { - typedef geometry_msgs::msg::Quaternion Transform::*type; - friend constexpr type get(Transform_f); -}; - -template struct Transform_rob; -template -inline size_t constexpr Transform_offset_of() { - return ((::size_t) & reinterpret_cast((((T*)0)->*get(Tag())))); -} -} // namespace detail -#endif /*! * @brief This class represents the TopicDataType of the type Transform defined by the user in the IDL file. - * @ingroup TRANSFORM + * @ingroup Transform */ -class TransformPubSubType : public eprosima::fastdds::dds::TopicDataType { +class TransformPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef Transform type; - eProsima_user_DllExport TransformPubSubType(); + typedef Transform type; + + eProsima_user_DllExport TransformPubSubType(); + + eProsima_user_DllExport ~TransformPubSubType() override; - eProsima_user_DllExport virtual ~TransformPubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return true; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - new (memory) Transform(); - return true; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - -private: - static constexpr bool is_plain_impl() { - return 56ULL == - (detail::Transform_offset_of() + sizeof(geometry_msgs::msg::Quaternion)); - } + }; } // namespace msg } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORM_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.cxx index 243d28fbe60..5b3fc3016e2 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.cxx @@ -14,9 +14,9 @@ /*! * @file TransformStamped.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,40 +27,31 @@ char dummy; #endif // _WIN32 #include "TransformStamped.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Transform_max_cdr_typesize 56ULL; -#define std_msgs_msg_Time_max_cdr_typesize 8ULL; -#define geometry_msgs_msg_TransformStamped_max_cdr_typesize 584ULL; -#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Transform_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_TransformStamped_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - -geometry_msgs::msg::TransformStamped::TransformStamped() -{ - // std_msgs::msg::Header m_header - // string m_child_frame_id - m_child_frame_id =""; - // geometry_msgs::msg::Transform m_transform +namespace geometry_msgs { + +namespace msg { + + + +TransformStamped::TransformStamped() +{ } -geometry_msgs::msg::TransformStamped::~TransformStamped() +TransformStamped::~TransformStamped() { } -geometry_msgs::msg::TransformStamped::TransformStamped( +TransformStamped::TransformStamped( const TransformStamped& x) { m_header = x.m_header; @@ -68,7 +59,7 @@ geometry_msgs::msg::TransformStamped::TransformStamped( m_transform = x.m_transform; } -geometry_msgs::msg::TransformStamped::TransformStamped( +TransformStamped::TransformStamped( TransformStamped&& x) noexcept { m_header = std::move(x.m_header); @@ -76,78 +67,45 @@ geometry_msgs::msg::TransformStamped::TransformStamped( m_transform = std::move(x.m_transform); } -geometry_msgs::msg::TransformStamped& geometry_msgs::msg::TransformStamped::operator =( +TransformStamped& TransformStamped::operator =( const TransformStamped& x) { + m_header = x.m_header; m_child_frame_id = x.m_child_frame_id; m_transform = x.m_transform; - return *this; } -geometry_msgs::msg::TransformStamped& geometry_msgs::msg::TransformStamped::operator =( +TransformStamped& TransformStamped::operator =( TransformStamped&& x) noexcept { + m_header = std::move(x.m_header); m_child_frame_id = std::move(x.m_child_frame_id); m_transform = std::move(x.m_transform); - return *this; } -bool geometry_msgs::msg::TransformStamped::operator ==( +bool TransformStamped::operator ==( const TransformStamped& x) const { - return (m_header == x.m_header && m_child_frame_id == x.m_child_frame_id && m_transform == x.m_transform); + return (m_header == x.m_header && + m_child_frame_id == x.m_child_frame_id && + m_transform == x.m_transform); } -bool geometry_msgs::msg::TransformStamped::operator !=( +bool TransformStamped::operator !=( const TransformStamped& x) const { return !(*this == x); } -size_t geometry_msgs::msg::TransformStamped::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_TransformStamped_max_cdr_typesize; -} - -size_t geometry_msgs::msg::TransformStamped::getCdrSerializedSize( - const geometry_msgs::msg::TransformStamped& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.child_frame_id().size() + 1; - current_alignment += geometry_msgs::msg::Transform::getCdrSerializedSize(data.transform(), current_alignment); - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::TransformStamped::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - scdr << m_child_frame_id.c_str(); - scdr << m_transform; -} - -void geometry_msgs::msg::TransformStamped::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - dcdr >> m_child_frame_id; - dcdr >> m_transform; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void geometry_msgs::msg::TransformStamped::header( +void TransformStamped::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -157,7 +115,7 @@ void geometry_msgs::msg::TransformStamped::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void geometry_msgs::msg::TransformStamped::header( +void TransformStamped::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -167,7 +125,7 @@ void geometry_msgs::msg::TransformStamped::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& geometry_msgs::msg::TransformStamped::header() const +const std_msgs::msg::Header& TransformStamped::header() const { return m_header; } @@ -176,16 +134,17 @@ const std_msgs::msg::Header& geometry_msgs::msg::TransformStamped::header() cons * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& geometry_msgs::msg::TransformStamped::header() +std_msgs::msg::Header& TransformStamped::header() { return m_header; } + /*! * @brief This function copies the value in member child_frame_id * @param _child_frame_id New value to be copied in member child_frame_id */ -void geometry_msgs::msg::TransformStamped::child_frame_id( +void TransformStamped::child_frame_id( const std::string& _child_frame_id) { m_child_frame_id = _child_frame_id; @@ -195,7 +154,7 @@ void geometry_msgs::msg::TransformStamped::child_frame_id( * @brief This function moves the value in member child_frame_id * @param _child_frame_id New value to be moved in member child_frame_id */ -void geometry_msgs::msg::TransformStamped::child_frame_id( +void TransformStamped::child_frame_id( std::string&& _child_frame_id) { m_child_frame_id = std::move(_child_frame_id); @@ -205,7 +164,7 @@ void geometry_msgs::msg::TransformStamped::child_frame_id( * @brief This function returns a constant reference to member child_frame_id * @return Constant reference to member child_frame_id */ -const std::string& geometry_msgs::msg::TransformStamped::child_frame_id() const +const std::string& TransformStamped::child_frame_id() const { return m_child_frame_id; } @@ -214,16 +173,17 @@ const std::string& geometry_msgs::msg::TransformStamped::child_frame_id() const * @brief This function returns a reference to member child_frame_id * @return Reference to member child_frame_id */ -std::string& geometry_msgs::msg::TransformStamped::child_frame_id() +std::string& TransformStamped::child_frame_id() { return m_child_frame_id; } + /*! * @brief This function copies the value in member transform * @param _transform New value to be copied in member transform */ -void geometry_msgs::msg::TransformStamped::transform( +void TransformStamped::transform( const geometry_msgs::msg::Transform& _transform) { m_transform = _transform; @@ -233,7 +193,7 @@ void geometry_msgs::msg::TransformStamped::transform( * @brief This function moves the value in member transform * @param _transform New value to be moved in member transform */ -void geometry_msgs::msg::TransformStamped::transform( +void TransformStamped::transform( geometry_msgs::msg::Transform&& _transform) { m_transform = std::move(_transform); @@ -243,7 +203,7 @@ void geometry_msgs::msg::TransformStamped::transform( * @brief This function returns a constant reference to member transform * @return Constant reference to member transform */ -const geometry_msgs::msg::Transform& geometry_msgs::msg::TransformStamped::transform() const +const geometry_msgs::msg::Transform& TransformStamped::transform() const { return m_transform; } @@ -252,25 +212,18 @@ const geometry_msgs::msg::Transform& geometry_msgs::msg::TransformStamped::trans * @brief This function returns a reference to member transform * @return Reference to member transform */ -geometry_msgs::msg::Transform& geometry_msgs::msg::TransformStamped::transform() +geometry_msgs::msg::Transform& TransformStamped::transform() { return m_transform; } -size_t geometry_msgs::msg::TransformStamped::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return geometry_msgs_msg_TransformStamped_max_key_cdr_typesize; -} -bool geometry_msgs::msg::TransformStamped::isKeyDefined() -{ - return false; -} -void geometry_msgs::msg::TransformStamped::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "TransformStampedCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.h index 07821eb4179..fad7d457f9f 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStamped.h @@ -16,27 +16,30 @@ * @file TransformStamped.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ -#include "Transform.h" -#include "std_msgs/msg/Header.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "std_msgs/msg/Header.h" +#include "Transform.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -46,202 +49,186 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TransformStamped_SOURCE) -#define TransformStamped_DllAPI __declspec(dllexport) +#if defined(TRANSFORMSTAMPED_SOURCE) +#define TRANSFORMSTAMPED_DllAPI __declspec( dllexport ) #else -#define TransformStamped_DllAPI __declspec(dllimport) -#endif // TransformStamped_SOURCE +#define TRANSFORMSTAMPED_DllAPI __declspec( dllimport ) +#endif // TRANSFORMSTAMPED_SOURCE #else -#define TransformStamped_DllAPI +#define TRANSFORMSTAMPED_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TransformStamped_DllAPI -#endif // _WIN32 +#define TRANSFORMSTAMPED_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace geometry_msgs { + namespace msg { + + + /*! * @brief This class represents the structure TransformStamped defined by the user in the IDL file. - * @ingroup TRANSFORMSTAMPED + * @ingroup TransformStamped */ -class TransformStamped { +class TransformStamped +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TransformStamped(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TransformStamped(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. - */ - eProsima_user_DllExport TransformStamped(const TransformStamped& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. - */ - eProsima_user_DllExport TransformStamped(TransformStamped&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. - */ - eProsima_user_DllExport TransformStamped& operator=(const TransformStamped& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. - */ - eProsima_user_DllExport TransformStamped& operator=(TransformStamped&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::TransformStamped object to compare. - */ - eProsima_user_DllExport bool operator==(const TransformStamped& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::TransformStamped object to compare. - */ - eProsima_user_DllExport bool operator!=(const TransformStamped& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member child_frame_id - * @param _child_frame_id New value to be copied in member child_frame_id - */ - eProsima_user_DllExport void child_frame_id(const std::string& _child_frame_id); - - /*! - * @brief This function moves the value in member child_frame_id - * @param _child_frame_id New value to be moved in member child_frame_id - */ - eProsima_user_DllExport void child_frame_id(std::string&& _child_frame_id); - - /*! - * @brief This function returns a constant reference to member child_frame_id - * @return Constant reference to member child_frame_id - */ - eProsima_user_DllExport const std::string& child_frame_id() const; - - /*! - * @brief This function returns a reference to member child_frame_id - * @return Reference to member child_frame_id - */ - eProsima_user_DllExport std::string& child_frame_id(); - /*! - * @brief This function copies the value in member transform - * @param _transform New value to be copied in member transform - */ - eProsima_user_DllExport void transform(const geometry_msgs::msg::Transform& _transform); - - /*! - * @brief This function moves the value in member transform - * @param _transform New value to be moved in member transform - */ - eProsima_user_DllExport void transform(geometry_msgs::msg::Transform&& _transform); - - /*! - * @brief This function returns a constant reference to member transform - * @return Constant reference to member transform - */ - eProsima_user_DllExport const geometry_msgs::msg::Transform& transform() const; - - /*! - * @brief This function returns a reference to member transform - * @return Reference to member transform - */ - eProsima_user_DllExport geometry_msgs::msg::Transform& transform(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const geometry_msgs::msg::TransformStamped& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TransformStamped(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TransformStamped(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + */ + eProsima_user_DllExport TransformStamped( + const TransformStamped& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + */ + eProsima_user_DllExport TransformStamped( + TransformStamped&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + */ + eProsima_user_DllExport TransformStamped& operator =( + const TransformStamped& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::TransformStamped that will be copied. + */ + eProsima_user_DllExport TransformStamped& operator =( + TransformStamped&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::TransformStamped object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TransformStamped& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::TransformStamped object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TransformStamped& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member child_frame_id + * @param _child_frame_id New value to be copied in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id( + const std::string& _child_frame_id); + + /*! + * @brief This function moves the value in member child_frame_id + * @param _child_frame_id New value to be moved in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id( + std::string&& _child_frame_id); + + /*! + * @brief This function returns a constant reference to member child_frame_id + * @return Constant reference to member child_frame_id + */ + eProsima_user_DllExport const std::string& child_frame_id() const; + + /*! + * @brief This function returns a reference to member child_frame_id + * @return Reference to member child_frame_id + */ + eProsima_user_DllExport std::string& child_frame_id(); + + + /*! + * @brief This function copies the value in member transform + * @param _transform New value to be copied in member transform + */ + eProsima_user_DllExport void transform( + const geometry_msgs::msg::Transform& _transform); + + /*! + * @brief This function moves the value in member transform + * @param _transform New value to be moved in member transform + */ + eProsima_user_DllExport void transform( + geometry_msgs::msg::Transform&& _transform); + + /*! + * @brief This function returns a constant reference to member transform + * @return Constant reference to member transform + */ + eProsima_user_DllExport const geometry_msgs::msg::Transform& transform() const; + + /*! + * @brief This function returns a reference to member transform + * @return Reference to member transform + */ + eProsima_user_DllExport geometry_msgs::msg::Transform& transform(); private: - std_msgs::msg::Header m_header; - std::string m_child_frame_id; - geometry_msgs::msg::Transform m_transform; + + std_msgs::msg::Header m_header; + std::string m_child_frame_id; + geometry_msgs::msg::Transform m_transform; + }; -} // namespace msg -} // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ +} // namespace msg + +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedCdrAux.hpp new file mode 100644 index 00000000000..3fb5ad36aff --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TransformStampedCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPEDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPEDCDRAUX_HPP_ + +#include "TransformStamped.h" + +constexpr uint32_t geometry_msgs_msg_TransformStamped_max_cdr_typesize {616UL}; +constexpr uint32_t geometry_msgs_msg_TransformStamped_max_key_cdr_typesize {0UL}; + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::TransformStamped& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPEDCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedCdrAux.ipp new file mode 100644 index 00000000000..c7a7f566d1f --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedCdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TransformStampedCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPEDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPEDCDRAUX_IPP_ + +#include "TransformStampedCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::TransformStamped& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.child_frame_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.transform(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::TransformStamped& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.child_frame_id() + << eprosima::fastcdr::MemberId(2) << data.transform() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::TransformStamped& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.child_frame_id(); + break; + + case 2: + dcdr >> data.transform(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::TransformStamped& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPEDCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.cxx index afb9fb31ae7..c0ecfc64fdb 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.cxx @@ -16,157 +16,183 @@ * @file TransformStampedPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "TransformStampedPubSubTypes.h" +#include "TransformStampedCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - TransformStampedPubSubType::TransformStampedPubSubType() - { - setName("geometry_msgs::msg::dds_::TransformStamped_"); - auto type_size = TransformStamped::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = TransformStamped::isKeyDefined(); - size_t keyLength = TransformStamped::getKeyMaxCdrSerializedSize() > 16 ? - TransformStamped::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TransformStampedPubSubType::~TransformStampedPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TransformStampedPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - TransformStamped* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TransformStampedPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - TransformStamped* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TransformStampedPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TransformStampedPubSubType::createData() - { - return reinterpret_cast(new TransformStamped()); - } - - void TransformStampedPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TransformStampedPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - TransformStamped* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - TransformStamped::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || TransformStamped::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + +TransformStampedPubSubType::TransformStampedPubSubType() +{ + setName("geometry_msgs::msg::dds_::TransformStamped_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TransformStamped::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_TransformStamped_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +TransformStampedPubSubType::~TransformStampedPubSubType() +{ +} + +bool TransformStampedPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TransformStamped* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool TransformStampedPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TransformStamped* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function TransformStampedPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* TransformStampedPubSubType::createData() +{ + return reinterpret_cast(new TransformStamped()); +} + +void TransformStampedPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TransformStampedPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.h index c8fcaba9ce3..84ef84deb16 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TransformStampedPubSubTypes.h @@ -16,21 +16,27 @@ * @file TransformStampedPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "TransformStamped.h" -#include "TransformPubSubTypes.h" #include "std_msgs/msg/HeaderPubSubTypes.h" +#include "TransformPubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated TransformStamped is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER @@ -38,58 +44,94 @@ namespace geometry_msgs { namespace msg { + + /*! * @brief This class represents the TopicDataType of the type TransformStamped defined by the user in the IDL file. - * @ingroup TRANSFORMSTAMPED + * @ingroup TransformStamped */ -class TransformStampedPubSubType : public eprosima::fastdds::dds::TopicDataType { +class TransformStampedPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef TransformStamped type; - eProsima_user_DllExport TransformStampedPubSubType(); + typedef TransformStamped type; + + eProsima_user_DllExport TransformStampedPubSubType(); + + eProsima_user_DllExport ~TransformStampedPubSubType() override; - eProsima_user_DllExport virtual ~TransformStampedPubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; + }; } // namespace msg } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TRANSFORMSTAMPED_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.cxx index 1e4ea4150d7..500234acc6e 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.cxx @@ -14,9 +14,9 @@ /*! * @file Twist.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,122 +27,80 @@ char dummy; #endif // _WIN32 #include "Twist.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::Twist::Twist() -{ - // m_linear com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2b48a640 - // m_angular com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@2b48a640 +namespace geometry_msgs { + +namespace msg { -} -geometry_msgs::msg::Twist::~Twist() +Twist::Twist() { +} +Twist::~Twist() +{ } -geometry_msgs::msg::Twist::Twist( +Twist::Twist( const Twist& x) { m_linear = x.m_linear; m_angular = x.m_angular; } -geometry_msgs::msg::Twist::Twist( - Twist&& x) +Twist::Twist( + Twist&& x) noexcept { m_linear = std::move(x.m_linear); m_angular = std::move(x.m_angular); } -geometry_msgs::msg::Twist& geometry_msgs::msg::Twist::operator =( +Twist& Twist::operator =( const Twist& x) { m_linear = x.m_linear; m_angular = x.m_angular; - return *this; } -geometry_msgs::msg::Twist& geometry_msgs::msg::Twist::operator =( - Twist&& x) +Twist& Twist::operator =( + Twist&& x) noexcept { m_linear = std::move(x.m_linear); m_angular = std::move(x.m_angular); - return *this; } -bool geometry_msgs::msg::Twist::operator ==( +bool Twist::operator ==( const Twist& x) const { - - return (m_linear == x.m_linear && m_angular == x.m_angular); + return (m_linear == x.m_linear && + m_angular == x.m_angular); } -bool geometry_msgs::msg::Twist::operator !=( +bool Twist::operator !=( const Twist& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Twist::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - current_alignment += geometry_msgs::msg::Vector3::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::Twist::getCdrSerializedSize( - const geometry_msgs::msg::Twist& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.linear(), current_alignment); - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.angular(), current_alignment); - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Twist::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_linear; - scdr << m_angular; - -} - -void geometry_msgs::msg::Twist::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_linear; - dcdr >> m_angular; -} - /*! * @brief This function copies the value in member linear * @param _linear New value to be copied in member linear */ -void geometry_msgs::msg::Twist::linear( +void Twist::linear( const geometry_msgs::msg::Vector3& _linear) { m_linear = _linear; @@ -152,7 +110,7 @@ void geometry_msgs::msg::Twist::linear( * @brief This function moves the value in member linear * @param _linear New value to be moved in member linear */ -void geometry_msgs::msg::Twist::linear( +void Twist::linear( geometry_msgs::msg::Vector3&& _linear) { m_linear = std::move(_linear); @@ -162,7 +120,7 @@ void geometry_msgs::msg::Twist::linear( * @brief This function returns a constant reference to member linear * @return Constant reference to member linear */ -const geometry_msgs::msg::Vector3& geometry_msgs::msg::Twist::linear() const +const geometry_msgs::msg::Vector3& Twist::linear() const { return m_linear; } @@ -171,15 +129,17 @@ const geometry_msgs::msg::Vector3& geometry_msgs::msg::Twist::linear() const * @brief This function returns a reference to member linear * @return Reference to member linear */ -geometry_msgs::msg::Vector3& geometry_msgs::msg::Twist::linear() +geometry_msgs::msg::Vector3& Twist::linear() { return m_linear; } + + /*! * @brief This function copies the value in member angular * @param _angular New value to be copied in member angular */ -void geometry_msgs::msg::Twist::angular( +void Twist::angular( const geometry_msgs::msg::Vector3& _angular) { m_angular = _angular; @@ -189,7 +149,7 @@ void geometry_msgs::msg::Twist::angular( * @brief This function moves the value in member angular * @param _angular New value to be moved in member angular */ -void geometry_msgs::msg::Twist::angular( +void Twist::angular( geometry_msgs::msg::Vector3&& _angular) { m_angular = std::move(_angular); @@ -199,7 +159,7 @@ void geometry_msgs::msg::Twist::angular( * @brief This function returns a constant reference to member angular * @return Constant reference to member angular */ -const geometry_msgs::msg::Vector3& geometry_msgs::msg::Twist::angular() const +const geometry_msgs::msg::Vector3& Twist::angular() const { return m_angular; } @@ -208,31 +168,18 @@ const geometry_msgs::msg::Vector3& geometry_msgs::msg::Twist::angular() const * @brief This function returns a reference to member angular * @return Reference to member angular */ -geometry_msgs::msg::Vector3& geometry_msgs::msg::Twist::angular() +geometry_msgs::msg::Vector3& Twist::angular() { return m_angular; } -size_t geometry_msgs::msg::Twist::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool geometry_msgs::msg::Twist::isKeyDefined() -{ - return false; -} +} // namespace msg -void geometry_msgs::msg::Twist::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "TwistCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.h index 48cca0f1b1f..e197806f04f 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Twist.h @@ -16,20 +16,25 @@ * @file Twist.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ -#include "Vector3.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "Vector3.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,201 +48,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Twist_SOURCE) -#define Twist_DllAPI __declspec( dllexport ) +#if defined(TWIST_SOURCE) +#define TWIST_DllAPI __declspec( dllexport ) #else -#define Twist_DllAPI __declspec( dllimport ) -#endif // Twist_SOURCE +#define TWIST_DllAPI __declspec( dllimport ) +#endif // TWIST_SOURCE #else -#define Twist_DllAPI +#define TWIST_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Twist_DllAPI +#define TWIST_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Twist defined by the user in the IDL file. - * @ingroup TWIST - */ - class Twist - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Twist(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Twist(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. - */ - eProsima_user_DllExport Twist( - const Twist& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. - */ - eProsima_user_DllExport Twist( - Twist&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. - */ - eProsima_user_DllExport Twist& operator =( - const Twist& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. - */ - eProsima_user_DllExport Twist& operator =( - Twist&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Twist object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Twist& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Twist object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Twist& x) const; - - /*! - * @brief This function copies the value in member linear - * @param _linear New value to be copied in member linear - */ - eProsima_user_DllExport void linear( - const geometry_msgs::msg::Vector3& _linear); - - /*! - * @brief This function moves the value in member linear - * @param _linear New value to be moved in member linear - */ - eProsima_user_DllExport void linear( - geometry_msgs::msg::Vector3&& _linear); - - /*! - * @brief This function returns a constant reference to member linear - * @return Constant reference to member linear - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear() const; - - /*! - * @brief This function returns a reference to member linear - * @return Reference to member linear - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& linear(); - /*! - * @brief This function copies the value in member angular - * @param _angular New value to be copied in member angular - */ - eProsima_user_DllExport void angular( - const geometry_msgs::msg::Vector3& _angular); - - /*! - * @brief This function moves the value in member angular - * @param _angular New value to be moved in member angular - */ - eProsima_user_DllExport void angular( - geometry_msgs::msg::Vector3&& _angular); - - /*! - * @brief This function returns a constant reference to member angular - * @return Constant reference to member angular - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular() const; - - /*! - * @brief This function returns a reference to member angular - * @return Reference to member angular - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& angular(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Twist& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - geometry_msgs::msg::Vector3 m_linear; - geometry_msgs::msg::Vector3 m_angular; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Twist defined by the user in the IDL file. + * @ingroup Twist + */ +class Twist +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Twist(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Twist(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. + */ + eProsima_user_DllExport Twist( + const Twist& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. + */ + eProsima_user_DllExport Twist( + Twist&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. + */ + eProsima_user_DllExport Twist& operator =( + const Twist& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Twist that will be copied. + */ + eProsima_user_DllExport Twist& operator =( + Twist&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Twist object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Twist& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Twist object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Twist& x) const; + + /*! + * @brief This function copies the value in member linear + * @param _linear New value to be copied in member linear + */ + eProsima_user_DllExport void linear( + const geometry_msgs::msg::Vector3& _linear); + + /*! + * @brief This function moves the value in member linear + * @param _linear New value to be moved in member linear + */ + eProsima_user_DllExport void linear( + geometry_msgs::msg::Vector3&& _linear); + + /*! + * @brief This function returns a constant reference to member linear + * @return Constant reference to member linear + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear() const; + + /*! + * @brief This function returns a reference to member linear + * @return Reference to member linear + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& linear(); + + + /*! + * @brief This function copies the value in member angular + * @param _angular New value to be copied in member angular + */ + eProsima_user_DllExport void angular( + const geometry_msgs::msg::Vector3& _angular); + + /*! + * @brief This function moves the value in member angular + * @param _angular New value to be moved in member angular + */ + eProsima_user_DllExport void angular( + geometry_msgs::msg::Vector3&& _angular); + + /*! + * @brief This function returns a constant reference to member angular + * @return Constant reference to member angular + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular() const; + + /*! + * @brief This function returns a reference to member angular + * @return Reference to member angular + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& angular(); + +private: + + geometry_msgs::msg::Vector3 m_linear; + geometry_msgs::msg::Vector3 m_angular; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistCdrAux.hpp new file mode 100644 index 00000000000..e431d85bd5e --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTCDRAUX_HPP_ + +#include "Twist.h" + +constexpr uint32_t geometry_msgs_msg_Twist_max_cdr_typesize {64UL}; +constexpr uint32_t geometry_msgs_msg_Twist_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Twist& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistCdrAux.ipp new file mode 100644 index 00000000000..c3d9511216a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTCDRAUX_IPP_ + +#include "TwistCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Twist& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.linear(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.angular(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Twist& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.linear() + << eprosima::fastcdr::MemberId(1) << data.angular() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Twist& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.linear(); + break; + + case 1: + dcdr >> data.angular(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Twist& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.cxx index 853ad47461f..97feada28d0 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file TwistPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "TwistPubSubTypes.h" +#include "TwistCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - TwistPubSubType::TwistPubSubType() - { - setName("geometry_msgs::msg::dds_::Twist_"); - auto type_size = Twist::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Twist::isKeyDefined(); - size_t keyLength = Twist::getKeyMaxCdrSerializedSize() > 16 ? - Twist::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TwistPubSubType::~TwistPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TwistPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Twist* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TwistPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Twist* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TwistPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TwistPubSubType::createData() - { - return reinterpret_cast(new Twist()); - } - - void TwistPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TwistPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Twist* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Twist::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Twist::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +TwistPubSubType::TwistPubSubType() +{ + setName("geometry_msgs::msg::dds_::Twist_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Twist::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Twist_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +TwistPubSubType::~TwistPubSubType() +{ +} + +bool TwistPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Twist* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool TwistPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Twist* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function TwistPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* TwistPubSubType::createData() +{ + return reinterpret_cast(new Twist()); +} + +void TwistPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TwistPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.h index 4a8a641bb88..caf2cf08f85 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistPubSubTypes.h @@ -16,92 +16,121 @@ * @file TwistPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Twist.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "Vector3PubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Twist is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Twist defined by the user in the IDL file. + * @ingroup Twist + */ +class TwistPubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Twist defined by the user in the IDL file. - * @ingroup TWIST - */ - class TwistPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Twist type; + typedef Twist type; - eProsima_user_DllExport TwistPubSubType(); + eProsima_user_DllExport TwistPubSubType(); - eProsima_user_DllExport virtual ~TwistPubSubType(); + eProsima_user_DllExport ~TwistPubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Twist(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWIST_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.cxx index ce9eb6c2531..fa4fd569422 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.cxx @@ -14,9 +14,9 @@ /*! * @file TwistWithCovariance.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,131 +27,80 @@ char dummy; #endif // _WIN32 #include "TwistWithCovariance.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::TwistWithCovariance::TwistWithCovariance() -{ - // m_twist com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@10163d6 +namespace geometry_msgs { + +namespace msg { - // m_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@2dde1bff - memset(&m_covariance, 0, (36) * 8); -} -geometry_msgs::msg::TwistWithCovariance::~TwistWithCovariance() +TwistWithCovariance::TwistWithCovariance() { +} +TwistWithCovariance::~TwistWithCovariance() +{ } -geometry_msgs::msg::TwistWithCovariance::TwistWithCovariance( +TwistWithCovariance::TwistWithCovariance( const TwistWithCovariance& x) { m_twist = x.m_twist; m_covariance = x.m_covariance; } -geometry_msgs::msg::TwistWithCovariance::TwistWithCovariance( - TwistWithCovariance&& x) +TwistWithCovariance::TwistWithCovariance( + TwistWithCovariance&& x) noexcept { m_twist = std::move(x.m_twist); m_covariance = std::move(x.m_covariance); } -geometry_msgs::msg::TwistWithCovariance& geometry_msgs::msg::TwistWithCovariance::operator =( +TwistWithCovariance& TwistWithCovariance::operator =( const TwistWithCovariance& x) { m_twist = x.m_twist; m_covariance = x.m_covariance; - return *this; } -geometry_msgs::msg::TwistWithCovariance& geometry_msgs::msg::TwistWithCovariance::operator =( - TwistWithCovariance&& x) +TwistWithCovariance& TwistWithCovariance::operator =( + TwistWithCovariance&& x) noexcept { m_twist = std::move(x.m_twist); m_covariance = std::move(x.m_covariance); - return *this; } -bool geometry_msgs::msg::TwistWithCovariance::operator ==( +bool TwistWithCovariance::operator ==( const TwistWithCovariance& x) const { - - return (m_twist == x.m_twist && m_covariance == x.m_covariance); + return (m_twist == x.m_twist && + m_covariance == x.m_covariance); } -bool geometry_msgs::msg::TwistWithCovariance::operator !=( +bool TwistWithCovariance::operator !=( const TwistWithCovariance& x) const { return !(*this == x); } -size_t geometry_msgs::msg::TwistWithCovariance::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Twist::getMaxCdrSerializedSize(current_alignment); - current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::TwistWithCovariance::getCdrSerializedSize( - const geometry_msgs::msg::TwistWithCovariance& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += geometry_msgs::msg::Twist::getCdrSerializedSize(data.twist(), current_alignment); - if ((36) > 0) - { - current_alignment += ((36) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::TwistWithCovariance::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_twist; - scdr << m_covariance; - - -} - -void geometry_msgs::msg::TwistWithCovariance::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_twist; - dcdr >> m_covariance; - -} - /*! * @brief This function copies the value in member twist * @param _twist New value to be copied in member twist */ -void geometry_msgs::msg::TwistWithCovariance::twist( +void TwistWithCovariance::twist( const geometry_msgs::msg::Twist& _twist) { m_twist = _twist; @@ -161,7 +110,7 @@ void geometry_msgs::msg::TwistWithCovariance::twist( * @brief This function moves the value in member twist * @param _twist New value to be moved in member twist */ -void geometry_msgs::msg::TwistWithCovariance::twist( +void TwistWithCovariance::twist( geometry_msgs::msg::Twist&& _twist) { m_twist = std::move(_twist); @@ -171,7 +120,7 @@ void geometry_msgs::msg::TwistWithCovariance::twist( * @brief This function returns a constant reference to member twist * @return Constant reference to member twist */ -const geometry_msgs::msg::Twist& geometry_msgs::msg::TwistWithCovariance::twist() const +const geometry_msgs::msg::Twist& TwistWithCovariance::twist() const { return m_twist; } @@ -180,16 +129,18 @@ const geometry_msgs::msg::Twist& geometry_msgs::msg::TwistWithCovariance::twist( * @brief This function returns a reference to member twist * @return Reference to member twist */ -geometry_msgs::msg::Twist& geometry_msgs::msg::TwistWithCovariance::twist() +geometry_msgs::msg::Twist& TwistWithCovariance::twist() { return m_twist; } + + /*! * @brief This function copies the value in member covariance * @param _covariance New value to be copied in member covariance */ -void geometry_msgs::msg::TwistWithCovariance::covariance( - const geometry_msgs::msg::double_twist_36& _covariance) +void TwistWithCovariance::covariance( + const geometry_msgs::msg::double__36& _covariance) { m_covariance = _covariance; } @@ -198,8 +149,8 @@ void geometry_msgs::msg::TwistWithCovariance::covariance( * @brief This function moves the value in member covariance * @param _covariance New value to be moved in member covariance */ -void geometry_msgs::msg::TwistWithCovariance::covariance( - geometry_msgs::msg::double_twist_36&& _covariance) +void TwistWithCovariance::covariance( + geometry_msgs::msg::double__36&& _covariance) { m_covariance = std::move(_covariance); } @@ -208,7 +159,7 @@ void geometry_msgs::msg::TwistWithCovariance::covariance( * @brief This function returns a constant reference to member covariance * @return Constant reference to member covariance */ -const geometry_msgs::msg::double_twist_36& geometry_msgs::msg::TwistWithCovariance::covariance() const +const geometry_msgs::msg::double__36& TwistWithCovariance::covariance() const { return m_covariance; } @@ -217,31 +168,18 @@ const geometry_msgs::msg::double_twist_36& geometry_msgs::msg::TwistWithCovarian * @brief This function returns a reference to member covariance * @return Reference to member covariance */ -geometry_msgs::msg::double_twist_36& geometry_msgs::msg::TwistWithCovariance::covariance() +geometry_msgs::msg::double__36& TwistWithCovariance::covariance() { return m_covariance; } -size_t geometry_msgs::msg::TwistWithCovariance::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool geometry_msgs::msg::TwistWithCovariance::isKeyDefined() -{ - return false; -} - -void geometry_msgs::msg::TwistWithCovariance::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "TwistWithCovarianceCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.h index 40c89bab4fd..ae1a23b7686 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariance.h @@ -16,20 +16,25 @@ * @file TwistWithCovariance.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_H_ -#include "Twist.h" - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + +#include "Twist.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -43,202 +48,160 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TwistWithCovariance_SOURCE) -#define TwistWithCovariance_DllAPI __declspec( dllexport ) +#if defined(TWISTWITHCOVARIANCE_SOURCE) +#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllexport ) #else -#define TwistWithCovariance_DllAPI __declspec( dllimport ) -#endif // TwistWithCovariance_SOURCE +#define TWISTWITHCOVARIANCE_DllAPI __declspec( dllimport ) +#endif // TWISTWITHCOVARIANCE_SOURCE #else -#define TwistWithCovariance_DllAPI +#define TWISTWITHCOVARIANCE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TwistWithCovariance_DllAPI +#define TWISTWITHCOVARIANCE_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - typedef std::array double_twist_36; - /*! - * @brief This class represents the structure TwistWithCovariance defined by the user in the IDL file. - * @ingroup TWISTWITHCOVARIANCE - */ - class TwistWithCovariance - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TwistWithCovariance(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TwistWithCovariance(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance( - const TwistWithCovariance& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance( - TwistWithCovariance&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance& operator =( - const TwistWithCovariance& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. - */ - eProsima_user_DllExport TwistWithCovariance& operator =( - TwistWithCovariance&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::TwistWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator ==( - const TwistWithCovariance& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::TwistWithCovariance object to compare. - */ - eProsima_user_DllExport bool operator !=( - const TwistWithCovariance& x) const; - - /*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ - eProsima_user_DllExport void twist( - const geometry_msgs::msg::Twist& _twist); - - /*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ - eProsima_user_DllExport void twist( - geometry_msgs::msg::Twist&& _twist); - - /*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ - eProsima_user_DllExport const geometry_msgs::msg::Twist& twist() const; - - /*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ - eProsima_user_DllExport geometry_msgs::msg::Twist& twist(); - /*! - * @brief This function copies the value in member covariance - * @param _covariance New value to be copied in member covariance - */ - eProsima_user_DllExport void covariance( - const geometry_msgs::msg::double_twist_36& _covariance); - - /*! - * @brief This function moves the value in member covariance - * @param _covariance New value to be moved in member covariance - */ - eProsima_user_DllExport void covariance( - geometry_msgs::msg::double_twist_36&& _covariance); - - /*! - * @brief This function returns a constant reference to member covariance - * @return Constant reference to member covariance - */ - eProsima_user_DllExport const geometry_msgs::msg::double_twist_36& covariance() const; - - /*! - * @brief This function returns a reference to member covariance - * @return Reference to member covariance - */ - eProsima_user_DllExport geometry_msgs::msg::double_twist_36& covariance(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::TwistWithCovariance& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - geometry_msgs::msg::Twist m_twist; - geometry_msgs::msg::double_twist_36 m_covariance; - }; - } // namespace msg + +namespace msg { + +typedef std::array double__36; + + + +/*! + * @brief This class represents the structure TwistWithCovariance defined by the user in the IDL file. + * @ingroup TwistWithCovariance + */ +class TwistWithCovariance +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TwistWithCovariance(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TwistWithCovariance(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance( + const TwistWithCovariance& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance( + TwistWithCovariance&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance& operator =( + const TwistWithCovariance& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::TwistWithCovariance that will be copied. + */ + eProsima_user_DllExport TwistWithCovariance& operator =( + TwistWithCovariance&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::TwistWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TwistWithCovariance& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::TwistWithCovariance object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TwistWithCovariance& x) const; + + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist( + const geometry_msgs::msg::Twist& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist( + geometry_msgs::msg::Twist&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::Twist& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::Twist& twist(); + + + /*! + * @brief This function copies the value in member covariance + * @param _covariance New value to be copied in member covariance + */ + eProsima_user_DllExport void covariance( + const geometry_msgs::msg::double__36& _covariance); + + /*! + * @brief This function moves the value in member covariance + * @param _covariance New value to be moved in member covariance + */ + eProsima_user_DllExport void covariance( + geometry_msgs::msg::double__36&& _covariance); + + /*! + * @brief This function returns a constant reference to member covariance + * @return Constant reference to member covariance + */ + eProsima_user_DllExport const geometry_msgs::msg::double__36& covariance() const; + + /*! + * @brief This function returns a reference to member covariance + * @return Reference to member covariance + */ + eProsima_user_DllExport geometry_msgs::msg::double__36& covariance(); + +private: + + geometry_msgs::msg::Twist m_twist; + geometry_msgs::msg::double__36 m_covariance{0.0}; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovarianceCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovarianceCdrAux.hpp new file mode 100644 index 00000000000..4b812f1d11a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovarianceCdrAux.hpp @@ -0,0 +1,55 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovarianceCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCECDRAUX_HPP_ + +#include "TwistWithCovariance.h" + +constexpr uint32_t geometry_msgs_msg_TwistWithCovariance_max_cdr_typesize {360UL}; +constexpr uint32_t geometry_msgs_msg_TwistWithCovariance_max_key_cdr_typesize {0UL}; + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::TwistWithCovariance& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovarianceCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovarianceCdrAux.ipp new file mode 100644 index 00000000000..a53a1c15986 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovarianceCdrAux.ipp @@ -0,0 +1,140 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TwistWithCovarianceCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCECDRAUX_IPP_ + +#include "TwistWithCovarianceCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::TwistWithCovariance& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.twist(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::TwistWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.twist() + << eprosima::fastcdr::MemberId(1) << data.covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::TwistWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.twist(); + break; + + case 1: + dcdr >> data.covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::TwistWithCovariance& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.cxx index a992128aef0..93f8830bb86 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.cxx @@ -16,162 +16,185 @@ * @file TwistWithCovariancePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "TwistWithCovariancePubSubTypes.h" +#include "TwistWithCovarianceCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - - TwistWithCovariancePubSubType::TwistWithCovariancePubSubType() - { - setName("geometry_msgs::msg::dds_::TwistWithCovariance_"); - auto type_size = TwistWithCovariance::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = TwistWithCovariance::isKeyDefined(); - size_t keyLength = TwistWithCovariance::getKeyMaxCdrSerializedSize() > 16 ? - TwistWithCovariance::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TwistWithCovariancePubSubType::~TwistWithCovariancePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TwistWithCovariancePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - TwistWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TwistWithCovariancePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - TwistWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TwistWithCovariancePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TwistWithCovariancePubSubType::createData() - { - return reinterpret_cast(new TwistWithCovariance()); - } - - void TwistWithCovariancePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TwistWithCovariancePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - TwistWithCovariance* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - TwistWithCovariance::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || TwistWithCovariance::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + + + +TwistWithCovariancePubSubType::TwistWithCovariancePubSubType() +{ + setName("geometry_msgs::msg::dds_::TwistWithCovariance_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TwistWithCovariance::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_TwistWithCovariance_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +TwistWithCovariancePubSubType::~TwistWithCovariancePubSubType() +{ +} + +bool TwistWithCovariancePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TwistWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool TwistWithCovariancePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TwistWithCovariance* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function TwistWithCovariancePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* TwistWithCovariancePubSubType::createData() +{ + return reinterpret_cast(new TwistWithCovariance()); +} + +void TwistWithCovariancePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TwistWithCovariancePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.h index 6113b33320f..c229f83da7e 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/TwistWithCovariancePubSubTypes.h @@ -16,93 +16,122 @@ * @file TwistWithCovariancePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "TwistWithCovariance.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) +#include "TwistPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated TwistWithCovariance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { +typedef std::array double__36; + + + +/*! + * @brief This class represents the TopicDataType of the type TwistWithCovariance defined by the user in the IDL file. + * @ingroup TwistWithCovariance + */ +class TwistWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - typedef std::array double_twist_36; - /*! - * @brief This class represents the TopicDataType of the type TwistWithCovariance defined by the user in the IDL file. - * @ingroup TWISTWITHCOVARIANCE - */ - class TwistWithCovariancePubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef TwistWithCovariance type; + typedef TwistWithCovariance type; - eProsima_user_DllExport TwistWithCovariancePubSubType(); + eProsima_user_DllExport TwistWithCovariancePubSubType(); - eProsima_user_DllExport virtual ~TwistWithCovariancePubSubType(); + eProsima_user_DllExport ~TwistWithCovariancePubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) TwistWithCovariance(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_TWISTWITHCOVARIANCE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.cxx index b1ea662638d..e347e156167 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.cxx @@ -14,9 +14,9 @@ /*! * @file Vector3.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,31 +27,31 @@ char dummy; #endif // _WIN32 #include "Vector3.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -geometry_msgs::msg::Vector3::Vector3() -{ - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@74d1dc36 - m_x = 0.0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7161d8d1 - m_y = 0.0; - // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@663c9e7a - m_z = 0.0; -} +namespace geometry_msgs { + +namespace msg { + -geometry_msgs::msg::Vector3::~Vector3() -{ +Vector3::Vector3() +{ +} +Vector3::~Vector3() +{ } -geometry_msgs::msg::Vector3::Vector3( +Vector3::Vector3( const Vector3& x) { m_x = x.m_x; @@ -59,113 +59,53 @@ geometry_msgs::msg::Vector3::Vector3( m_z = x.m_z; } -geometry_msgs::msg::Vector3::Vector3( - Vector3&& x) +Vector3::Vector3( + Vector3&& x) noexcept { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; } -geometry_msgs::msg::Vector3& geometry_msgs::msg::Vector3::operator =( +Vector3& Vector3::operator =( const Vector3& x) { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; - return *this; } -geometry_msgs::msg::Vector3& geometry_msgs::msg::Vector3::operator =( - Vector3&& x) +Vector3& Vector3::operator =( + Vector3&& x) noexcept { m_x = x.m_x; m_y = x.m_y; m_z = x.m_z; - return *this; } -bool geometry_msgs::msg::Vector3::operator ==( +bool Vector3::operator ==( const Vector3& x) const { - - return (m_x == x.m_x && m_y == x.m_y && m_z == x.m_z); + return (m_x == x.m_x && + m_y == x.m_y && + m_z == x.m_z); } -bool geometry_msgs::msg::Vector3::operator !=( +bool Vector3::operator !=( const Vector3& x) const { return !(*this == x); } -size_t geometry_msgs::msg::Vector3::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -size_t geometry_msgs::msg::Vector3::getCdrSerializedSize( - const geometry_msgs::msg::Vector3& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - -void geometry_msgs::msg::Vector3::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_x; - scdr << m_y; - scdr << m_z; - -} - -void geometry_msgs::msg::Vector3::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_x; - dcdr >> m_y; - dcdr >> m_z; -} - /*! * @brief This function sets a value in member x * @param _x New value for member x */ -void geometry_msgs::msg::Vector3::x( +void Vector3::x( double _x) { m_x = _x; @@ -175,7 +115,7 @@ void geometry_msgs::msg::Vector3::x( * @brief This function returns the value of member x * @return Value of member x */ -double geometry_msgs::msg::Vector3::x() const +double Vector3::x() const { return m_x; } @@ -184,16 +124,17 @@ double geometry_msgs::msg::Vector3::x() const * @brief This function returns a reference to member x * @return Reference to member x */ -double& geometry_msgs::msg::Vector3::x() +double& Vector3::x() { return m_x; } + /*! * @brief This function sets a value in member y * @param _y New value for member y */ -void geometry_msgs::msg::Vector3::y( +void Vector3::y( double _y) { m_y = _y; @@ -203,7 +144,7 @@ void geometry_msgs::msg::Vector3::y( * @brief This function returns the value of member y * @return Value of member y */ -double geometry_msgs::msg::Vector3::y() const +double Vector3::y() const { return m_y; } @@ -212,16 +153,17 @@ double geometry_msgs::msg::Vector3::y() const * @brief This function returns a reference to member y * @return Reference to member y */ -double& geometry_msgs::msg::Vector3::y() +double& Vector3::y() { return m_y; } + /*! * @brief This function sets a value in member z * @param _z New value for member z */ -void geometry_msgs::msg::Vector3::z( +void Vector3::z( double _z) { m_z = _z; @@ -231,7 +173,7 @@ void geometry_msgs::msg::Vector3::z( * @brief This function returns the value of member z * @return Value of member z */ -double geometry_msgs::msg::Vector3::z() const +double Vector3::z() const { return m_z; } @@ -240,32 +182,18 @@ double geometry_msgs::msg::Vector3::z() const * @brief This function returns a reference to member z * @return Reference to member z */ -double& geometry_msgs::msg::Vector3::z() +double& Vector3::z() { return m_z; } -size_t geometry_msgs::msg::Vector3::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} +} // namespace msg -bool geometry_msgs::msg::Vector3::isKeyDefined() -{ - return false; -} - -void geometry_msgs::msg::Vector3::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace geometry_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "Vector3CdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.h index 4323f7f1aed..69b5eea4724 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3.h @@ -16,19 +16,24 @@ * @file Vector3.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_H_ - -#include #include +#include +#include +#include #include #include -#include -#include + +#include +#include +#include + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -42,209 +47,165 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Vector3_SOURCE) -#define Vector3_DllAPI __declspec( dllexport ) +#if defined(VECTOR3_SOURCE) +#define VECTOR3_DllAPI __declspec( dllexport ) #else -#define Vector3_DllAPI __declspec( dllimport ) -#endif // Vector3_SOURCE +#define VECTOR3_DllAPI __declspec( dllimport ) +#endif // VECTOR3_SOURCE #else -#define Vector3_DllAPI +#define VECTOR3_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Vector3_DllAPI +#define VECTOR3_DllAPI #endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; +class CdrSizeCalculator; } // namespace fastcdr } // namespace eprosima + namespace geometry_msgs { - namespace msg { - /*! - * @brief This class represents the structure Vector3 defined by the user in the IDL file. - * @ingroup VECTOR3 - */ - class Vector3 - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Vector3(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Vector3(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. - */ - eProsima_user_DllExport Vector3( - const Vector3& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. - */ - eProsima_user_DllExport Vector3( - Vector3&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. - */ - eProsima_user_DllExport Vector3& operator =( - const Vector3& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. - */ - eProsima_user_DllExport Vector3& operator =( - Vector3&& x); - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Vector3 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Vector3& x) const; - - /*! - * @brief Comparison operator. - * @param x geometry_msgs::msg::Vector3 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Vector3& x) const; - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - double _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport double x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport double& x(); - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - double _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport double y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport double& y(); - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - double _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport double z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport double& z(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const geometry_msgs::msg::Vector3& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - double m_x; - double m_y; - double m_z; - }; - } // namespace msg + +namespace msg { + + + +/*! + * @brief This class represents the structure Vector3 defined by the user in the IDL file. + * @ingroup Vector3 + */ +class Vector3 +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Vector3(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Vector3(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. + */ + eProsima_user_DllExport Vector3( + const Vector3& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. + */ + eProsima_user_DllExport Vector3( + Vector3&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. + */ + eProsima_user_DllExport Vector3& operator =( + const Vector3& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object geometry_msgs::msg::Vector3 that will be copied. + */ + eProsima_user_DllExport Vector3& operator =( + Vector3&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Vector3 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Vector3& x) const; + + /*! + * @brief Comparison operator. + * @param x geometry_msgs::msg::Vector3 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Vector3& x) const; + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + double _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport double x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport double& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + double _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport double y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport double& y(); + + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + double _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport double z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport double& z(); + +private: + + double m_x{0.0}; + double m_y{0.0}; + double m_z{0.0}; + +}; + +} // namespace msg + } // namespace geometry_msgs -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3CdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3CdrAux.hpp new file mode 100644 index 00000000000..b64061fdc57 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3CdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3CdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3CDRAUX_HPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3CDRAUX_HPP_ + +#include "Vector3.h" + +constexpr uint32_t geometry_msgs_msg_Vector3_max_cdr_typesize {32UL}; +constexpr uint32_t geometry_msgs_msg_Vector3_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Vector3& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3CDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3CdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3CdrAux.ipp new file mode 100644 index 00000000000..a565fb67f0c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3CdrAux.ipp @@ -0,0 +1,146 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Vector3CdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3CDRAUX_IPP_ +#define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3CDRAUX_IPP_ + +#include "Vector3CdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const geometry_msgs::msg::Vector3& data, + size_t& current_alignment) +{ + using namespace geometry_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.z(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Vector3& data) +{ + using namespace geometry_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x() + << eprosima::fastcdr::MemberId(1) << data.y() + << eprosima::fastcdr::MemberId(2) << data.z() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + geometry_msgs::msg::Vector3& data) +{ + using namespace geometry_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x(); + break; + + case 1: + dcdr >> data.y(); + break; + + case 2: + dcdr >> data.z(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const geometry_msgs::msg::Vector3& data) +{ + using namespace geometry_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3CDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.cxx index d54cdd679ff..c6ebe531854 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.cxx @@ -16,161 +16,183 @@ * @file Vector3PubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "Vector3PubSubTypes.h" +#include "Vector3CdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace geometry_msgs { - namespace msg { - Vector3PubSubType::Vector3PubSubType() - { - setName("geometry_msgs::msg::dds_::Vector3_"); - auto type_size = Vector3::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Vector3::isKeyDefined(); - size_t keyLength = Vector3::getKeyMaxCdrSerializedSize() > 16 ? - Vector3::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Vector3PubSubType::~Vector3PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Vector3PubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Vector3* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool Vector3PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Vector3* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function Vector3PubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* Vector3PubSubType::createData() - { - return reinterpret_cast(new Vector3()); - } - - void Vector3PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Vector3PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Vector3* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Vector3::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Vector3::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +Vector3PubSubType::Vector3PubSubType() +{ + setName("geometry_msgs::msg::dds_::Vector3_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Vector3::getMaxCdrSerializedSize()); +#else + geometry_msgs_msg_Vector3_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +Vector3PubSubType::~Vector3PubSubType() +{ +} + +bool Vector3PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Vector3* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool Vector3PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Vector3* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function Vector3PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* Vector3PubSubType::createData() +{ + return reinterpret_cast(new Vector3()); +} + +void Vector3PubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool Vector3PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace geometry_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.h index 505a56ec972..e883ac1f3ca 100644 --- a/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/geometry_msgs/msg/Vector3PubSubTypes.h @@ -16,92 +16,120 @@ * @file Vector3PubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_PUBSUBTYPES_H_ +#include + +#include #include +#include +#include #include #include "Vector3.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated Vector3 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace geometry_msgs +namespace geometry_msgs { +namespace msg { + + + +/*! + * @brief This class represents the TopicDataType of the type Vector3 defined by the user in the IDL file. + * @ingroup Vector3 + */ +class Vector3PubSubType : public eprosima::fastdds::dds::TopicDataType { - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Vector3 defined by the user in the IDL file. - * @ingroup VECTOR3 - */ - class Vector3PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: +public: - typedef Vector3 type; + typedef Vector3 type; - eProsima_user_DllExport Vector3PubSubType(); + eProsima_user_DllExport Vector3PubSubType(); - eProsima_user_DllExport virtual ~Vector3PubSubType(); + eProsima_user_DllExport ~Vector3PubSubType() override; - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData( - void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + eProsima_user_DllExport void* createData() override; - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport void deleteData( + void* data) override; - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Vector3(); - return true; - } +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - MD5 m_md5; - unsigned char* m_keyBuffer; - }; +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; } -} -#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_PUBSUBTYPES_H_ \ No newline at end of file +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + +}; +} // namespace msg +} // namespace geometry_msgs + +#endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_VECTOR3_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.cxx b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.cxx index ce1fd661536..dc54b84b213 100644 --- a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.cxx +++ b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.cxx @@ -14,9 +14,9 @@ /*! * @file Odometry.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,50 +27,31 @@ char dummy; #endif // _WIN32 #include "Odometry.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_TwistWithCovariance_max_cdr_typesize 336ULL; -#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Pose_max_cdr_typesize 56ULL; -#define std_msgs_msg_Time_max_cdr_typesize 8ULL; -#define nav_msgs_msg_Odometry_max_cdr_typesize 1208ULL; -#define geometry_msgs_msg_Twist_max_cdr_typesize 48ULL; -#define geometry_msgs_msg_Point_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_PoseWithCovariance_max_cdr_typesize 344ULL; -#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define geometry_msgs_msg_TwistWithCovariance_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Pose_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL; -#define nav_msgs_msg_Odometry_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Twist_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Point_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_PoseWithCovariance_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - -nav_msgs::msg::Odometry::Odometry() -{ - // std_msgs::msg::Header m_header - // string m_child_frame_id - m_child_frame_id =""; - // geometry_msgs::msg::PoseWithCovariance m_pose +namespace nav_msgs { + +namespace msg { + - // geometry_msgs::msg::TwistWithCovariance m_twist + +Odometry::Odometry() +{ } -nav_msgs::msg::Odometry::~Odometry() +Odometry::~Odometry() { } -nav_msgs::msg::Odometry::Odometry( +Odometry::Odometry( const Odometry& x) { m_header = x.m_header; @@ -79,7 +60,7 @@ nav_msgs::msg::Odometry::Odometry( m_twist = x.m_twist; } -nav_msgs::msg::Odometry::Odometry( +Odometry::Odometry( Odometry&& x) noexcept { m_header = std::move(x.m_header); @@ -88,83 +69,48 @@ nav_msgs::msg::Odometry::Odometry( m_twist = std::move(x.m_twist); } -nav_msgs::msg::Odometry& nav_msgs::msg::Odometry::operator =( +Odometry& Odometry::operator =( const Odometry& x) { + m_header = x.m_header; m_child_frame_id = x.m_child_frame_id; m_pose = x.m_pose; m_twist = x.m_twist; - return *this; } -nav_msgs::msg::Odometry& nav_msgs::msg::Odometry::operator =( +Odometry& Odometry::operator =( Odometry&& x) noexcept { + m_header = std::move(x.m_header); m_child_frame_id = std::move(x.m_child_frame_id); m_pose = std::move(x.m_pose); m_twist = std::move(x.m_twist); - return *this; } -bool nav_msgs::msg::Odometry::operator ==( +bool Odometry::operator ==( const Odometry& x) const { - return (m_header == x.m_header && m_child_frame_id == x.m_child_frame_id && m_pose == x.m_pose && m_twist == x.m_twist); + return (m_header == x.m_header && + m_child_frame_id == x.m_child_frame_id && + m_pose == x.m_pose && + m_twist == x.m_twist); } -bool nav_msgs::msg::Odometry::operator !=( +bool Odometry::operator !=( const Odometry& x) const { return !(*this == x); } -size_t nav_msgs::msg::Odometry::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return nav_msgs_msg_Odometry_max_cdr_typesize; -} - -size_t nav_msgs::msg::Odometry::getCdrSerializedSize( - const nav_msgs::msg::Odometry& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.child_frame_id().size() + 1; - current_alignment += geometry_msgs::msg::PoseWithCovariance::getCdrSerializedSize(data.pose(), current_alignment); - current_alignment += geometry_msgs::msg::TwistWithCovariance::getCdrSerializedSize(data.twist(), current_alignment); - - return current_alignment - initial_alignment; -} - -void nav_msgs::msg::Odometry::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - scdr << m_child_frame_id.c_str(); - scdr << m_pose; - scdr << m_twist; -} - -void nav_msgs::msg::Odometry::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - dcdr >> m_child_frame_id; - dcdr >> m_pose; - dcdr >> m_twist; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void nav_msgs::msg::Odometry::header( +void Odometry::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -174,7 +120,7 @@ void nav_msgs::msg::Odometry::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void nav_msgs::msg::Odometry::header( +void Odometry::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -184,7 +130,7 @@ void nav_msgs::msg::Odometry::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& nav_msgs::msg::Odometry::header() const +const std_msgs::msg::Header& Odometry::header() const { return m_header; } @@ -193,15 +139,17 @@ const std_msgs::msg::Header& nav_msgs::msg::Odometry::header() const * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& nav_msgs::msg::Odometry::header() +std_msgs::msg::Header& Odometry::header() { return m_header; } + + /*! * @brief This function copies the value in member child_frame_id * @param _child_frame_id New value to be copied in member child_frame_id */ -void nav_msgs::msg::Odometry::child_frame_id( +void Odometry::child_frame_id( const std::string& _child_frame_id) { m_child_frame_id = _child_frame_id; @@ -211,7 +159,7 @@ void nav_msgs::msg::Odometry::child_frame_id( * @brief This function moves the value in member child_frame_id * @param _child_frame_id New value to be moved in member child_frame_id */ -void nav_msgs::msg::Odometry::child_frame_id( +void Odometry::child_frame_id( std::string&& _child_frame_id) { m_child_frame_id = std::move(_child_frame_id); @@ -221,7 +169,7 @@ void nav_msgs::msg::Odometry::child_frame_id( * @brief This function returns a constant reference to member child_frame_id * @return Constant reference to member child_frame_id */ -const std::string& nav_msgs::msg::Odometry::child_frame_id() const +const std::string& Odometry::child_frame_id() const { return m_child_frame_id; } @@ -230,16 +178,17 @@ const std::string& nav_msgs::msg::Odometry::child_frame_id() const * @brief This function returns a reference to member child_frame_id * @return Reference to member child_frame_id */ -std::string& nav_msgs::msg::Odometry::child_frame_id() +std::string& Odometry::child_frame_id() { return m_child_frame_id; } + /*! * @brief This function copies the value in member pose * @param _pose New value to be copied in member pose */ -void nav_msgs::msg::Odometry::pose( +void Odometry::pose( const geometry_msgs::msg::PoseWithCovariance& _pose) { m_pose = _pose; @@ -249,7 +198,7 @@ void nav_msgs::msg::Odometry::pose( * @brief This function moves the value in member pose * @param _pose New value to be moved in member pose */ -void nav_msgs::msg::Odometry::pose( +void Odometry::pose( geometry_msgs::msg::PoseWithCovariance&& _pose) { m_pose = std::move(_pose); @@ -259,7 +208,7 @@ void nav_msgs::msg::Odometry::pose( * @brief This function returns a constant reference to member pose * @return Constant reference to member pose */ -const geometry_msgs::msg::PoseWithCovariance& nav_msgs::msg::Odometry::pose() const +const geometry_msgs::msg::PoseWithCovariance& Odometry::pose() const { return m_pose; } @@ -268,16 +217,17 @@ const geometry_msgs::msg::PoseWithCovariance& nav_msgs::msg::Odometry::pose() co * @brief This function returns a reference to member pose * @return Reference to member pose */ -geometry_msgs::msg::PoseWithCovariance& nav_msgs::msg::Odometry::pose() +geometry_msgs::msg::PoseWithCovariance& Odometry::pose() { return m_pose; } + /*! * @brief This function copies the value in member twist * @param _twist New value to be copied in member twist */ -void nav_msgs::msg::Odometry::twist( +void Odometry::twist( const geometry_msgs::msg::TwistWithCovariance& _twist) { m_twist = _twist; @@ -287,7 +237,7 @@ void nav_msgs::msg::Odometry::twist( * @brief This function moves the value in member twist * @param _twist New value to be moved in member twist */ -void nav_msgs::msg::Odometry::twist( +void Odometry::twist( geometry_msgs::msg::TwistWithCovariance&& _twist) { m_twist = std::move(_twist); @@ -297,7 +247,7 @@ void nav_msgs::msg::Odometry::twist( * @brief This function returns a constant reference to member twist * @return Constant reference to member twist */ -const geometry_msgs::msg::TwistWithCovariance& nav_msgs::msg::Odometry::twist() const +const geometry_msgs::msg::TwistWithCovariance& Odometry::twist() const { return m_twist; } @@ -306,25 +256,18 @@ const geometry_msgs::msg::TwistWithCovariance& nav_msgs::msg::Odometry::twist() * @brief This function returns a reference to member twist * @return Reference to member twist */ -geometry_msgs::msg::TwistWithCovariance& nav_msgs::msg::Odometry::twist() +geometry_msgs::msg::TwistWithCovariance& Odometry::twist() { return m_twist; } -size_t nav_msgs::msg::Odometry::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return nav_msgs_msg_Odometry_max_key_cdr_typesize; -} -bool nav_msgs::msg::Odometry::isKeyDefined() -{ - return false; -} -void nav_msgs::msg::Odometry::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace nav_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "OdometryCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.h b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.h index d7bcf1499b5..ae8e930fcb4 100644 --- a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.h +++ b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/Odometry.h @@ -16,28 +16,31 @@ * @file Odometry.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ #define _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ -#include "geometry_msgs/msg/PoseWithCovariance.h" -#include "geometry_msgs/msg/TwistWithCovariance.h" -#include "std_msgs/msg/Header.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "geometry_msgs/msg/PoseWithCovariance.h" +#include "geometry_msgs/msg/TwistWithCovariance.h" +#include "std_msgs/msg/Header.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -47,226 +50,214 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Odometry_SOURCE) -#define Odometry_DllAPI __declspec(dllexport) +#if defined(ODOMETRY_SOURCE) +#define ODOMETRY_DllAPI __declspec( dllexport ) #else -#define Odometry_DllAPI __declspec(dllimport) -#endif // Odometry_SOURCE +#define ODOMETRY_DllAPI __declspec( dllimport ) +#endif // ODOMETRY_SOURCE #else -#define Odometry_DllAPI +#define ODOMETRY_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Odometry_DllAPI -#endif // _WIN32 +#define ODOMETRY_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace nav_msgs { + namespace msg { + + + /*! * @brief This class represents the structure Odometry defined by the user in the IDL file. - * @ingroup ODOMETRY + * @ingroup Odometry */ -class Odometry { +class Odometry +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Odometry(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Odometry(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. - */ - eProsima_user_DllExport Odometry(const Odometry& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. - */ - eProsima_user_DllExport Odometry(Odometry&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. - */ - eProsima_user_DllExport Odometry& operator=(const Odometry& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. - */ - eProsima_user_DllExport Odometry& operator=(Odometry&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x nav_msgs::msg::Odometry object to compare. - */ - eProsima_user_DllExport bool operator==(const Odometry& x) const; - - /*! - * @brief Comparison operator. - * @param x nav_msgs::msg::Odometry object to compare. - */ - eProsima_user_DllExport bool operator!=(const Odometry& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member child_frame_id - * @param _child_frame_id New value to be copied in member child_frame_id - */ - eProsima_user_DllExport void child_frame_id(const std::string& _child_frame_id); - - /*! - * @brief This function moves the value in member child_frame_id - * @param _child_frame_id New value to be moved in member child_frame_id - */ - eProsima_user_DllExport void child_frame_id(std::string&& _child_frame_id); - - /*! - * @brief This function returns a constant reference to member child_frame_id - * @return Constant reference to member child_frame_id - */ - eProsima_user_DllExport const std::string& child_frame_id() const; - - /*! - * @brief This function returns a reference to member child_frame_id - * @return Reference to member child_frame_id - */ - eProsima_user_DllExport std::string& child_frame_id(); - /*! - * @brief This function copies the value in member pose - * @param _pose New value to be copied in member pose - */ - eProsima_user_DllExport void pose(const geometry_msgs::msg::PoseWithCovariance& _pose); - - /*! - * @brief This function moves the value in member pose - * @param _pose New value to be moved in member pose - */ - eProsima_user_DllExport void pose(geometry_msgs::msg::PoseWithCovariance&& _pose); - - /*! - * @brief This function returns a constant reference to member pose - * @return Constant reference to member pose - */ - eProsima_user_DllExport const geometry_msgs::msg::PoseWithCovariance& pose() const; - - /*! - * @brief This function returns a reference to member pose - * @return Reference to member pose - */ - eProsima_user_DllExport geometry_msgs::msg::PoseWithCovariance& pose(); - /*! - * @brief This function copies the value in member twist - * @param _twist New value to be copied in member twist - */ - eProsima_user_DllExport void twist(const geometry_msgs::msg::TwistWithCovariance& _twist); - - /*! - * @brief This function moves the value in member twist - * @param _twist New value to be moved in member twist - */ - eProsima_user_DllExport void twist(geometry_msgs::msg::TwistWithCovariance&& _twist); - - /*! - * @brief This function returns a constant reference to member twist - * @return Constant reference to member twist - */ - eProsima_user_DllExport const geometry_msgs::msg::TwistWithCovariance& twist() const; - - /*! - * @brief This function returns a reference to member twist - * @return Reference to member twist - */ - eProsima_user_DllExport geometry_msgs::msg::TwistWithCovariance& twist(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const nav_msgs::msg::Odometry& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Odometry(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Odometry(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + */ + eProsima_user_DllExport Odometry( + const Odometry& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + */ + eProsima_user_DllExport Odometry( + Odometry&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + */ + eProsima_user_DllExport Odometry& operator =( + const Odometry& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object nav_msgs::msg::Odometry that will be copied. + */ + eProsima_user_DllExport Odometry& operator =( + Odometry&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x nav_msgs::msg::Odometry object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Odometry& x) const; + + /*! + * @brief Comparison operator. + * @param x nav_msgs::msg::Odometry object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Odometry& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member child_frame_id + * @param _child_frame_id New value to be copied in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id( + const std::string& _child_frame_id); + + /*! + * @brief This function moves the value in member child_frame_id + * @param _child_frame_id New value to be moved in member child_frame_id + */ + eProsima_user_DllExport void child_frame_id( + std::string&& _child_frame_id); + + /*! + * @brief This function returns a constant reference to member child_frame_id + * @return Constant reference to member child_frame_id + */ + eProsima_user_DllExport const std::string& child_frame_id() const; + + /*! + * @brief This function returns a reference to member child_frame_id + * @return Reference to member child_frame_id + */ + eProsima_user_DllExport std::string& child_frame_id(); + + + /*! + * @brief This function copies the value in member pose + * @param _pose New value to be copied in member pose + */ + eProsima_user_DllExport void pose( + const geometry_msgs::msg::PoseWithCovariance& _pose); + + /*! + * @brief This function moves the value in member pose + * @param _pose New value to be moved in member pose + */ + eProsima_user_DllExport void pose( + geometry_msgs::msg::PoseWithCovariance&& _pose); + + /*! + * @brief This function returns a constant reference to member pose + * @return Constant reference to member pose + */ + eProsima_user_DllExport const geometry_msgs::msg::PoseWithCovariance& pose() const; + + /*! + * @brief This function returns a reference to member pose + * @return Reference to member pose + */ + eProsima_user_DllExport geometry_msgs::msg::PoseWithCovariance& pose(); + + + /*! + * @brief This function copies the value in member twist + * @param _twist New value to be copied in member twist + */ + eProsima_user_DllExport void twist( + const geometry_msgs::msg::TwistWithCovariance& _twist); + + /*! + * @brief This function moves the value in member twist + * @param _twist New value to be moved in member twist + */ + eProsima_user_DllExport void twist( + geometry_msgs::msg::TwistWithCovariance&& _twist); + + /*! + * @brief This function returns a constant reference to member twist + * @return Constant reference to member twist + */ + eProsima_user_DllExport const geometry_msgs::msg::TwistWithCovariance& twist() const; + + /*! + * @brief This function returns a reference to member twist + * @return Reference to member twist + */ + eProsima_user_DllExport geometry_msgs::msg::TwistWithCovariance& twist(); private: - std_msgs::msg::Header m_header; - std::string m_child_frame_id; - geometry_msgs::msg::PoseWithCovariance m_pose; - geometry_msgs::msg::TwistWithCovariance m_twist; + + std_msgs::msg::Header m_header; + std::string m_child_frame_id; + geometry_msgs::msg::PoseWithCovariance m_pose; + geometry_msgs::msg::TwistWithCovariance m_twist; + }; -} // namespace msg -} // namespace nav_msgs -#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ +} // namespace msg + +} // namespace nav_msgs + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryCdrAux.hpp new file mode 100644 index 00000000000..300a7bd5e16 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OdometryCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRYCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRYCDRAUX_HPP_ + +#include "Odometry.h" + +constexpr uint32_t nav_msgs_msg_Odometry_max_cdr_typesize {1264UL}; +constexpr uint32_t nav_msgs_msg_Odometry_max_key_cdr_typesize {0UL}; + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const nav_msgs::msg::Odometry& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRYCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryCdrAux.ipp new file mode 100644 index 00000000000..cc70b44a6c4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryCdrAux.ipp @@ -0,0 +1,154 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OdometryCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRYCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRYCDRAUX_IPP_ + +#include "OdometryCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const nav_msgs::msg::Odometry& data, + size_t& current_alignment) +{ + using namespace nav_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.child_frame_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.pose(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.twist(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const nav_msgs::msg::Odometry& data) +{ + using namespace nav_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.child_frame_id() + << eprosima::fastcdr::MemberId(2) << data.pose() + << eprosima::fastcdr::MemberId(3) << data.twist() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + nav_msgs::msg::Odometry& data) +{ + using namespace nav_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.child_frame_id(); + break; + + case 2: + dcdr >> data.pose(); + break; + + case 3: + dcdr >> data.twist(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const nav_msgs::msg::Odometry& data) +{ + using namespace nav_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRYCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.cxx index 836c765a133..b02dcb1bda6 100644 --- a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.cxx @@ -16,157 +16,183 @@ * @file OdometryPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "OdometryPubSubTypes.h" +#include "OdometryCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace nav_msgs { - namespace msg { - OdometryPubSubType::OdometryPubSubType() - { - setName("nav_msgs::msg::dds_::Odometry_"); - auto type_size = Odometry::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Odometry::isKeyDefined(); - size_t keyLength = Odometry::getKeyMaxCdrSerializedSize() > 16 ? - Odometry::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - OdometryPubSubType::~OdometryPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool OdometryPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Odometry* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool OdometryPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - Odometry* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function OdometryPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* OdometryPubSubType::createData() - { - return reinterpret_cast(new Odometry()); - } - - void OdometryPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool OdometryPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Odometry* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Odometry::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Odometry::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + +OdometryPubSubType::OdometryPubSubType() +{ + setName("nav_msgs::msg::dds_::Odometry_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Odometry::getMaxCdrSerializedSize()); +#else + nav_msgs_msg_Odometry_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +OdometryPubSubType::~OdometryPubSubType() +{ +} + +bool OdometryPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Odometry* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool OdometryPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Odometry* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function OdometryPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* OdometryPubSubType::createData() +{ + return reinterpret_cast(new Odometry()); +} + +void OdometryPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool OdometryPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace nav_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.h index faafa5dfa36..ac0558d1e8a 100644 --- a/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/nav_msgs/msg/OdometryPubSubTypes.h @@ -16,79 +16,123 @@ * @file OdometryPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "Odometry.h" + #include "geometry_msgs/msg/PoseWithCovariancePubSubTypes.h" #include "geometry_msgs/msg/TwistWithCovariancePubSubTypes.h" #include "std_msgs/msg/HeaderPubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Odometry is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Odometry is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace nav_msgs { namespace msg { + + /*! * @brief This class represents the TopicDataType of the type Odometry defined by the user in the IDL file. - * @ingroup ODOMETRY + * @ingroup Odometry */ -class OdometryPubSubType : public eprosima::fastdds::dds::TopicDataType { +class OdometryPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef Odometry type; - eProsima_user_DllExport OdometryPubSubType(); + typedef Odometry type; + + eProsima_user_DllExport OdometryPubSubType(); + + eProsima_user_DllExport ~OdometryPubSubType() override; - eProsima_user_DllExport virtual ~OdometryPubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; + }; } // namespace msg } // namespace nav_msgs -#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_NAV_MSGS_MSG_ODOMETRY_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/post_process_generated_files.bash b/LibCarla/source/carla/ros2/fastdds/post_process_generated_files.bash new file mode 100755 index 00000000000..57616641846 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/post_process_generated_files.bash @@ -0,0 +1,25 @@ +#!/bin/bash + +# --- Configuration --- +# Set the directory where your generated files are located. +# "." means the current directory. +TARGET_DIR="." + +# --- Replacement Rules --- +# Rule 1: ' BEFORE_DECLARATION' -> ' PlacementKind::BEFORE_DECLARATION' +# Rule 2: 'PlacementKindValue' -> 'PlacementKind' +# Rule 3. 'BLABLA' (temporary type/name fixes) -> '' (remove this) +# Rule 4. '""' (empty quotes) -> '"' (single quotes) + +echo "Starting post-processing of Fast DDS generated files in: $TARGET_DIR" + +# We use find to target only relevant source/header files. +# -i is for in-place editing. +# We use a '|' as a separator in sed to handle spaces safely. +find "$TARGET_DIR" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cxx" -o -name "*.cpp" \) -print0 | xargs -0 sed -i \ + -e 's|BLABLA||g' \ + -e 's| BEFORE_DECLARATION| PlacementKind::BEFORE_DECLARATION|g' \ + -e 's|PlacementKindValue|PlacementKind|g' \ + -e 's|\"\"|"|g' \ + +echo "Done! Processed $(find "$TARGET_DIR" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cxx" -o -name "*.cpp" \) | wc -l) files." diff --git a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.cxx b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.cxx index 24bd064b6b2..e660f6576b9 100644 --- a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.cxx +++ b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.cxx @@ -14,9 +14,9 @@ /*! * @file Clock.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,101 +27,75 @@ char dummy; #endif // _WIN32 #include "Clock.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define Time_max_cdr_typesize 0ULL; -#define rosgraph_msg_Clock_max_cdr_typesize 0ULL; -#define Time_max_key_cdr_typesize 0ULL; -#define rosgraph_msg_Clock_max_key_cdr_typesize 0ULL; -rosgraph::msg::Clock::Clock() +namespace rosgraph_msgs { + +namespace msg { + + + +Clock::Clock() { } -rosgraph::msg::Clock::~Clock() +Clock::~Clock() { } -rosgraph::msg::Clock::Clock( - const rosgraph::msg::Clock& x) +Clock::Clock( + const Clock& x) { m_clock = x.m_clock; } -rosgraph::msg::Clock::Clock( - rosgraph::msg::Clock&& x) noexcept +Clock::Clock( + Clock&& x) noexcept { - m_clock = x.m_clock; + m_clock = std::move(x.m_clock); } -rosgraph::msg::Clock& rosgraph::msg::Clock::operator =( - const rosgraph::msg::Clock& x) +Clock& Clock::operator =( + const Clock& x) { + m_clock = x.m_clock; return *this; } -rosgraph::msg::Clock& rosgraph::msg::Clock::operator =( - rosgraph::msg::Clock&& x) noexcept +Clock& Clock::operator =( + Clock&& x) noexcept { - m_clock = x.m_clock; + + m_clock = std::move(x.m_clock); return *this; } -bool rosgraph::msg::Clock::operator ==( +bool Clock::operator ==( const Clock& x) const { return (m_clock == x.m_clock); } -bool rosgraph::msg::Clock::operator !=( +bool Clock::operator !=( const Clock& x) const { return !(*this == x); } -size_t rosgraph::msg::Clock::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return rosgraph_msg_Clock_max_cdr_typesize; -} - -size_t rosgraph::msg::Clock::getCdrSerializedSize( - const rosgraph::msg::Clock& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += builtin_interfaces::msg::Time::getCdrSerializedSize(data.clock(), current_alignment); - - return current_alignment - initial_alignment; -} - -void rosgraph::msg::Clock::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_clock; -} - -void rosgraph::msg::Clock::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_clock; -} - /*! * @brief This function copies the value in member clock * @param _clock New value to be copied in member clock */ -void rosgraph::msg::Clock::clock( +void Clock::clock( const builtin_interfaces::msg::Time& _clock) { m_clock = _clock; @@ -131,7 +105,7 @@ void rosgraph::msg::Clock::clock( * @brief This function moves the value in member clock * @param _clock New value to be moved in member clock */ -void rosgraph::msg::Clock::clock( +void Clock::clock( builtin_interfaces::msg::Time&& _clock) { m_clock = std::move(_clock); @@ -141,7 +115,7 @@ void rosgraph::msg::Clock::clock( * @brief This function returns a constant reference to member clock * @return Constant reference to member clock */ -const builtin_interfaces::msg::Time& rosgraph::msg::Clock::clock() const +const builtin_interfaces::msg::Time& Clock::clock() const { return m_clock; } @@ -150,25 +124,18 @@ const builtin_interfaces::msg::Time& rosgraph::msg::Clock::clock() const * @brief This function returns a reference to member clock * @return Reference to member clock */ -builtin_interfaces::msg::Time& rosgraph::msg::Clock::clock() +builtin_interfaces::msg::Time& Clock::clock() { return m_clock; } -size_t rosgraph::msg::Clock::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return rosgraph_msg_Clock_max_key_cdr_typesize; -} -bool rosgraph::msg::Clock::isKeyDefined() -{ - return false; -} -void rosgraph::msg::Clock::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace rosgraph_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ClockCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.h b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.h index 88cd6b74253..af85a0b8e53 100644 --- a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.h +++ b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/Clock.h @@ -16,26 +16,29 @@ * @file Clock.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ -#define _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ +#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCK_H_ +#define _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCK_H_ -#include "builtin_interfaces/msg/Time.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "builtin_interfaces/msg/Time.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -46,153 +49,129 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) #if defined(CLOCK_SOURCE) -#define CLOCK_DllAPI __declspec(dllexport) +#define CLOCK_DllAPI __declspec( dllexport ) #else -#define CLOCK_DllAPI __declspec(dllimport) -#endif // CLOCK_SOURCE +#define CLOCK_DllAPI __declspec( dllimport ) +#endif // CLOCK_SOURCE #else #define CLOCK_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else #define CLOCK_DllAPI -#endif // _WIN32 +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + + +namespace rosgraph_msgs { -namespace rosgraph { namespace msg { + + + /*! * @brief This class represents the structure Clock defined by the user in the IDL file. * @ingroup Clock */ -class Clock { +class Clock +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Clock(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Clock(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object rosgraph::msg::Clock that will be copied. - */ - eProsima_user_DllExport Clock(const Clock& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object rosgraph::msg::Clock that will be copied. - */ - eProsima_user_DllExport Clock(Clock&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object rosgraph::msg::Clock that will be copied. - */ - eProsima_user_DllExport Clock& operator=(const Clock& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object rosgraph::msg::Clock that will be copied. - */ - eProsima_user_DllExport Clock& operator=(Clock&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x rosgraph::msg::Clock object to compare. - */ - eProsima_user_DllExport bool operator==(const Clock& x) const; - - /*! - * @brief Comparison operator. - * @param x rosgraph::msg::Clock object to compare. - */ - eProsima_user_DllExport bool operator!=(const Clock& x) const; - - /*! - * @brief This function copies the value in member clock - * @param _clock New value to be copied in member clock - */ - eProsima_user_DllExport void clock(const builtin_interfaces::msg::Time& _clock); - - /*! - * @brief This function moves the value in member clock - * @param _clock New value to be moved in member clock - */ - eProsima_user_DllExport void clock(builtin_interfaces::msg::Time&& _clock); - - /*! - * @brief This function returns a constant reference to member clock - * @return Constant reference to member clock - */ - eProsima_user_DllExport const builtin_interfaces::msg::Time& clock() const; - - /*! - * @brief This function returns a reference to member clock - * @return Reference to member clock - */ - eProsima_user_DllExport builtin_interfaces::msg::Time& clock(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const rosgraph::msg::Clock& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Clock(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Clock(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object rosgraph_msgs::msg::Clock that will be copied. + */ + eProsima_user_DllExport Clock( + const Clock& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object rosgraph_msgs::msg::Clock that will be copied. + */ + eProsima_user_DllExport Clock( + Clock&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object rosgraph_msgs::msg::Clock that will be copied. + */ + eProsima_user_DllExport Clock& operator =( + const Clock& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object rosgraph_msgs::msg::Clock that will be copied. + */ + eProsima_user_DllExport Clock& operator =( + Clock&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x rosgraph_msgs::msg::Clock object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Clock& x) const; + + /*! + * @brief Comparison operator. + * @param x rosgraph_msgs::msg::Clock object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Clock& x) const; + + /*! + * @brief This function copies the value in member clock + * @param _clock New value to be copied in member clock + */ + eProsima_user_DllExport void clock( + const builtin_interfaces::msg::Time& _clock); + + /*! + * @brief This function moves the value in member clock + * @param _clock New value to be moved in member clock + */ + eProsima_user_DllExport void clock( + builtin_interfaces::msg::Time&& _clock); + + /*! + * @brief This function returns a constant reference to member clock + * @return Constant reference to member clock + */ + eProsima_user_DllExport const builtin_interfaces::msg::Time& clock() const; + + /*! + * @brief This function returns a reference to member clock + * @return Reference to member clock + */ + eProsima_user_DllExport builtin_interfaces::msg::Time& clock(); private: - builtin_interfaces::msg::Time m_clock; + + builtin_interfaces::msg::Time m_clock; + }; -} // namespace msg -} // namespace rosgraph -#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_H_ +} // namespace msg + +} // namespace rosgraph_msgs + +#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCK_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockCdrAux.hpp new file mode 100644 index 00000000000..3030113ca7a --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ClockCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCKCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCKCDRAUX_HPP_ + +#include "Clock.h" + +constexpr uint32_t rosgraph_msgs_msg_Clock_max_cdr_typesize {16UL}; +constexpr uint32_t rosgraph_msgs_msg_Clock_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const rosgraph_msgs::msg::Clock& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCKCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockCdrAux.ipp new file mode 100644 index 00000000000..f54406a13f4 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockCdrAux.ipp @@ -0,0 +1,130 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ClockCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCKCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCKCDRAUX_IPP_ + +#include "ClockCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const rosgraph_msgs::msg::Clock& data, + size_t& current_alignment) +{ + using namespace rosgraph_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.clock(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const rosgraph_msgs::msg::Clock& data) +{ + using namespace rosgraph_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.clock() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + rosgraph_msgs::msg::Clock& data) +{ + using namespace rosgraph_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.clock(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const rosgraph_msgs::msg::Clock& data) +{ + using namespace rosgraph_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCKCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.cxx index 010968d776b..2e7131f17c3 100644 --- a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.cxx @@ -16,157 +16,183 @@ * @file ClockPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "ClockPubSubTypes.h" +#include "ClockCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace rosgraph_msgs { +namespace msg { + + +ClockPubSubType::ClockPubSubType() +{ + setName("rosgraph_msgs::msg::dds_::Clock_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Clock::getMaxCdrSerializedSize()); +#else + rosgraph_msgs_msg_Clock_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ClockPubSubType::~ClockPubSubType() +{ +} + +bool ClockPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Clock* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ClockPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Clock* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ClockPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ClockPubSubType::createData() +{ + return reinterpret_cast(new Clock()); +} + +void ClockPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ClockPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + +} //End of namespace rosgraph_msgs -namespace rosgraph { - namespace msg { - ClockPubSubType::ClockPubSubType() - { - setName("rosgraph_msgs::msg::dds_::Clock_"); - auto type_size = Clock::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Clock::isKeyDefined(); - size_t keyLength = Clock::getKeyMaxCdrSerializedSize() > 16 ? - Clock::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ClockPubSubType::~ClockPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ClockPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Clock* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ClockPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - Clock* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function ClockPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ClockPubSubType::createData() - { - return reinterpret_cast(new Clock()); - } - - void ClockPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ClockPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Clock* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Clock::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Clock::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg -} //End of namespace rosgraph diff --git a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.h index ea836ebdca0..22785644006 100644 --- a/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/rosgraph_msgs/msg/ClockPubSubTypes.h @@ -16,75 +16,121 @@ * @file ClockPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ -#include +#ifndef _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCK_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCK_PUBSUBTYPES_H_ + +#include + +#include #include +#include +#include +#include #include "Clock.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Clock is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#include "builtin_interfaces/msg/TimePubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Clock is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace rosgraph { +namespace rosgraph_msgs { namespace msg { + + + /*! * @brief This class represents the TopicDataType of the type Clock defined by the user in the IDL file. * @ingroup Clock */ -class ClockPubSubType : public eprosima::fastdds::dds::TopicDataType { +class ClockPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef Clock type; - eProsima_user_DllExport ClockPubSubType(); + typedef Clock type; + + eProsima_user_DllExport ClockPubSubType(); + + eProsima_user_DllExport ~ClockPubSubType() override; - eProsima_user_DllExport virtual ~ClockPubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; + }; } // namespace msg -} // namespace rosgraph +} // namespace rosgraph_msgs + +#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSGS_MSG_CLOCK_PUBSUBTYPES_H_ -#endif // _FAST_DDS_GENERATED_ROSGRAPH_MSG_CLOCK_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.cxx index e6893ee2aff..93c3c376713 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.cxx @@ -14,14 +14,11 @@ /*! * @file CameraInfo.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#define _USE_MATH_DEFINES -#include - #ifdef _WIN32 // Remove linker warning LNK4221 on Visual Studio namespace { @@ -29,53 +26,32 @@ char dummy; } // namespace #endif // _WIN32 -// ensure that cmath header is not included elsewhere before to enable the math definitions on Win32 -#define _USE_MATH_DEFINES -#include - #include "CameraInfo.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; -#define sensor_msgs_msg_CameraInfo_max_cdr_typesize 3793ULL; -#define sensor_msgs_msg_RegionOfInterest_max_cdr_typesize 17ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_CameraInfo_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_RegionOfInterest_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; -sensor_msgs::msg::CameraInfo::CameraInfo(uint32_t height, uint32_t width, double fov) : -m_height(height), -m_width(width) -{ - // string m_distortion_model - m_distortion_model = "plumb_bob"; +namespace sensor_msgs { + +namespace msg { - const double cx = static_cast(m_width) / 2.0; - const double cy = static_cast(m_height) / 2.0; - const double fx = static_cast(m_width) / (2.0 * std::tan(fov) * M_PI / 360.0); - const double fy = fx; - m_d = { 0.0, 0.0, 0.0, 0.0, 0.0 }; - m_k = {fx, 0.0, cx, 0.0, fy, cy, 0.0, 0.0, 1.0}; - m_r = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 }; - m_p = {fx, 0.0, cx, 0.0, 0.0, fy, cy, 0.0, 0.0, 0.0, 1.0, 0.0}; - m_binning_x = 0; - m_binning_y = 0; +CameraInfo::CameraInfo() +{ } -sensor_msgs::msg::CameraInfo::~CameraInfo() +CameraInfo::~CameraInfo() { } -sensor_msgs::msg::CameraInfo::CameraInfo( +CameraInfo::CameraInfo( const CameraInfo& x) { m_header = x.m_header; @@ -91,7 +67,7 @@ sensor_msgs::msg::CameraInfo::CameraInfo( m_roi = x.m_roi; } -sensor_msgs::msg::CameraInfo::CameraInfo( +CameraInfo::CameraInfo( CameraInfo&& x) noexcept { m_header = std::move(x.m_header); @@ -107,9 +83,10 @@ sensor_msgs::msg::CameraInfo::CameraInfo( m_roi = std::move(x.m_roi); } -sensor_msgs::msg::CameraInfo& sensor_msgs::msg::CameraInfo::operator =( +CameraInfo& CameraInfo::operator =( const CameraInfo& x) { + m_header = x.m_header; m_height = x.m_height; m_width = x.m_width; @@ -121,13 +98,13 @@ sensor_msgs::msg::CameraInfo& sensor_msgs::msg::CameraInfo::operator =( m_binning_x = x.m_binning_x; m_binning_y = x.m_binning_y; m_roi = x.m_roi; - return *this; } -sensor_msgs::msg::CameraInfo& sensor_msgs::msg::CameraInfo::operator =( +CameraInfo& CameraInfo::operator =( CameraInfo&& x) noexcept { + m_header = std::move(x.m_header); m_height = x.m_height; m_width = x.m_width; @@ -139,111 +116,36 @@ sensor_msgs::msg::CameraInfo& sensor_msgs::msg::CameraInfo::operator =( m_binning_x = x.m_binning_x; m_binning_y = x.m_binning_y; m_roi = std::move(x.m_roi); - return *this; } -bool sensor_msgs::msg::CameraInfo::operator ==( +bool CameraInfo::operator ==( const CameraInfo& x) const { - return (m_header == x.m_header && m_height == x.m_height && m_width == x.m_width && m_distortion_model == x.m_distortion_model && m_d == x.m_d && m_k == x.m_k && m_r == x.m_r && m_p == x.m_p && m_binning_x == x.m_binning_x && m_binning_y == x.m_binning_y && m_roi == x.m_roi); + return (m_header == x.m_header && + m_height == x.m_height && + m_width == x.m_width && + m_distortion_model == x.m_distortion_model && + m_d == x.m_d && + m_k == x.m_k && + m_r == x.m_r && + m_p == x.m_p && + m_binning_x == x.m_binning_x && + m_binning_y == x.m_binning_y && + m_roi == x.m_roi); } -bool sensor_msgs::msg::CameraInfo::operator !=( +bool CameraInfo::operator !=( const CameraInfo& x) const { return !(*this == x); } -size_t sensor_msgs::msg::CameraInfo::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_CameraInfo_max_cdr_typesize; -} - -size_t sensor_msgs::msg::CameraInfo::getCdrSerializedSize( - const sensor_msgs::msg::CameraInfo& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.distortion_model().size() + 1; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.D().size() > 0) - { - current_alignment += (data.D().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.k().size() > 0) - { - current_alignment += (data.k().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.r().size() > 0) - { - current_alignment += (data.r().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.p().size() > 0) - { - current_alignment += (data.p().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += sensor_msgs::msg::RegionOfInterest::getCdrSerializedSize(data.roi(), current_alignment); - - return current_alignment - initial_alignment; -} - -void sensor_msgs::msg::CameraInfo::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - scdr << m_height; - scdr << m_width; - scdr << m_distortion_model.c_str(); - scdr << m_d; - scdr << m_k; - scdr << m_r; - scdr << m_p; - scdr << m_binning_x; - scdr << m_binning_y; - scdr << m_roi; -} - -void sensor_msgs::msg::CameraInfo::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - dcdr >> m_height; - dcdr >> m_width; - dcdr >> m_distortion_model; - dcdr >> m_d; - dcdr >> m_k; - dcdr >> m_r; - dcdr >> m_p; - dcdr >> m_binning_x; - dcdr >> m_binning_y; - dcdr >> m_roi; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void sensor_msgs::msg::CameraInfo::header( +void CameraInfo::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -253,7 +155,7 @@ void sensor_msgs::msg::CameraInfo::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void sensor_msgs::msg::CameraInfo::header( +void CameraInfo::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -263,7 +165,7 @@ void sensor_msgs::msg::CameraInfo::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& sensor_msgs::msg::CameraInfo::header() const +const std_msgs::msg::Header& CameraInfo::header() const { return m_header; } @@ -272,15 +174,17 @@ const std_msgs::msg::Header& sensor_msgs::msg::CameraInfo::header() const * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& sensor_msgs::msg::CameraInfo::header() +std_msgs::msg::Header& CameraInfo::header() { return m_header; } + + /*! * @brief This function sets a value in member height * @param _height New value for member height */ -void sensor_msgs::msg::CameraInfo::height( +void CameraInfo::height( uint32_t _height) { m_height = _height; @@ -290,7 +194,7 @@ void sensor_msgs::msg::CameraInfo::height( * @brief This function returns the value of member height * @return Value of member height */ -uint32_t sensor_msgs::msg::CameraInfo::height() const +uint32_t CameraInfo::height() const { return m_height; } @@ -299,16 +203,17 @@ uint32_t sensor_msgs::msg::CameraInfo::height() const * @brief This function returns a reference to member height * @return Reference to member height */ -uint32_t& sensor_msgs::msg::CameraInfo::height() +uint32_t& CameraInfo::height() { return m_height; } + /*! * @brief This function sets a value in member width * @param _width New value for member width */ -void sensor_msgs::msg::CameraInfo::width( +void CameraInfo::width( uint32_t _width) { m_width = _width; @@ -318,7 +223,7 @@ void sensor_msgs::msg::CameraInfo::width( * @brief This function returns the value of member width * @return Value of member width */ -uint32_t sensor_msgs::msg::CameraInfo::width() const +uint32_t CameraInfo::width() const { return m_width; } @@ -327,16 +232,17 @@ uint32_t sensor_msgs::msg::CameraInfo::width() const * @brief This function returns a reference to member width * @return Reference to member width */ -uint32_t& sensor_msgs::msg::CameraInfo::width() +uint32_t& CameraInfo::width() { return m_width; } + /*! * @brief This function copies the value in member distortion_model * @param _distortion_model New value to be copied in member distortion_model */ -void sensor_msgs::msg::CameraInfo::distortion_model( +void CameraInfo::distortion_model( const std::string& _distortion_model) { m_distortion_model = _distortion_model; @@ -346,7 +252,7 @@ void sensor_msgs::msg::CameraInfo::distortion_model( * @brief This function moves the value in member distortion_model * @param _distortion_model New value to be moved in member distortion_model */ -void sensor_msgs::msg::CameraInfo::distortion_model( +void CameraInfo::distortion_model( std::string&& _distortion_model) { m_distortion_model = std::move(_distortion_model); @@ -356,7 +262,7 @@ void sensor_msgs::msg::CameraInfo::distortion_model( * @brief This function returns a constant reference to member distortion_model * @return Constant reference to member distortion_model */ -const std::string& sensor_msgs::msg::CameraInfo::distortion_model() const +const std::string& CameraInfo::distortion_model() const { return m_distortion_model; } @@ -365,55 +271,57 @@ const std::string& sensor_msgs::msg::CameraInfo::distortion_model() const * @brief This function returns a reference to member distortion_model * @return Reference to member distortion_model */ -std::string& sensor_msgs::msg::CameraInfo::distortion_model() +std::string& CameraInfo::distortion_model() { return m_distortion_model; } + /*! - * @brief This function copies the value in member D - * @param _D New value to be copied in member D + * @brief This function copies the value in member d + * @param _d New value to be copied in member d */ -void sensor_msgs::msg::CameraInfo::D( - const std::vector& _D) +void CameraInfo::d( + const std::vector& _d) { - m_d = _D; + m_d = _d; } /*! - * @brief This function moves the value in member D - * @param _D New value to be moved in member D + * @brief This function moves the value in member d + * @param _d New value to be moved in member d */ -void sensor_msgs::msg::CameraInfo::D( - std::vector&& _D) +void CameraInfo::d( + std::vector&& _d) { - m_d = std::move(_D); + m_d = std::move(_d); } /*! - * @brief This function returns a constant reference to member D - * @return Constant reference to member D + * @brief This function returns a constant reference to member d + * @return Constant reference to member d */ -const std::vector& sensor_msgs::msg::CameraInfo::D() const +const std::vector& CameraInfo::d() const { return m_d; } /*! - * @brief This function returns a reference to member D - * @return Reference to member D + * @brief This function returns a reference to member d + * @return Reference to member d */ -std::vector& sensor_msgs::msg::CameraInfo::D() +std::vector& CameraInfo::d() { return m_d; } + /*! * @brief This function copies the value in member k * @param _k New value to be copied in member k */ -void sensor_msgs::msg::CameraInfo::k( - const std::array& _k) +void CameraInfo::k( + const sensor_msgs::msg::double__9& _k) { m_k = _k; } @@ -422,8 +330,8 @@ void sensor_msgs::msg::CameraInfo::k( * @brief This function moves the value in member k * @param _k New value to be moved in member k */ -void sensor_msgs::msg::CameraInfo::k( - std::array&& _k) +void CameraInfo::k( + sensor_msgs::msg::double__9&& _k) { m_k = std::move(_k); } @@ -432,7 +340,7 @@ void sensor_msgs::msg::CameraInfo::k( * @brief This function returns a constant reference to member k * @return Constant reference to member k */ -const std::array& sensor_msgs::msg::CameraInfo::k() const +const sensor_msgs::msg::double__9& CameraInfo::k() const { return m_k; } @@ -441,16 +349,18 @@ const std::array& sensor_msgs::msg::CameraInfo::k() const * @brief This function returns a reference to member k * @return Reference to member k */ -std::array& sensor_msgs::msg::CameraInfo::k() +sensor_msgs::msg::double__9& CameraInfo::k() { return m_k; } + + /*! * @brief This function copies the value in member r * @param _r New value to be copied in member r */ -void sensor_msgs::msg::CameraInfo::r( - const std::array& _r) +void CameraInfo::r( + const sensor_msgs::msg::double__9& _r) { m_r = _r; } @@ -459,8 +369,8 @@ void sensor_msgs::msg::CameraInfo::r( * @brief This function moves the value in member r * @param _r New value to be moved in member r */ -void sensor_msgs::msg::CameraInfo::r( - std::array&& _r) +void CameraInfo::r( + sensor_msgs::msg::double__9&& _r) { m_r = std::move(_r); } @@ -469,7 +379,7 @@ void sensor_msgs::msg::CameraInfo::r( * @brief This function returns a constant reference to member r * @return Constant reference to member r */ -const std::array& sensor_msgs::msg::CameraInfo::r() const +const sensor_msgs::msg::double__9& CameraInfo::r() const { return m_r; } @@ -478,17 +388,18 @@ const std::array& sensor_msgs::msg::CameraInfo::r() const * @brief This function returns a reference to member r * @return Reference to member r */ -std::array& sensor_msgs::msg::CameraInfo::r() +sensor_msgs::msg::double__9& CameraInfo::r() { return m_r; } + /*! * @brief This function copies the value in member p * @param _p New value to be copied in member p */ -void sensor_msgs::msg::CameraInfo::p( - const std::array& _p) +void CameraInfo::p( + const sensor_msgs::msg::double__12& _p) { m_p = _p; } @@ -497,8 +408,8 @@ void sensor_msgs::msg::CameraInfo::p( * @brief This function moves the value in member p * @param _p New value to be moved in member p */ -void sensor_msgs::msg::CameraInfo::p( - std::array&& _p) +void CameraInfo::p( + sensor_msgs::msg::double__12&& _p) { m_p = std::move(_p); } @@ -507,7 +418,7 @@ void sensor_msgs::msg::CameraInfo::p( * @brief This function returns a constant reference to member p * @return Constant reference to member p */ -const std::array& sensor_msgs::msg::CameraInfo::p() const +const sensor_msgs::msg::double__12& CameraInfo::p() const { return m_p; } @@ -516,16 +427,17 @@ const std::array& sensor_msgs::msg::CameraInfo::p() const * @brief This function returns a reference to member p * @return Reference to member p */ -std::array& sensor_msgs::msg::CameraInfo::p() +sensor_msgs::msg::double__12& CameraInfo::p() { return m_p; } + /*! * @brief This function sets a value in member binning_x * @param _binning_x New value for member binning_x */ -void sensor_msgs::msg::CameraInfo::binning_x( +void CameraInfo::binning_x( uint32_t _binning_x) { m_binning_x = _binning_x; @@ -535,7 +447,7 @@ void sensor_msgs::msg::CameraInfo::binning_x( * @brief This function returns the value of member binning_x * @return Value of member binning_x */ -uint32_t sensor_msgs::msg::CameraInfo::binning_x() const +uint32_t CameraInfo::binning_x() const { return m_binning_x; } @@ -544,16 +456,17 @@ uint32_t sensor_msgs::msg::CameraInfo::binning_x() const * @brief This function returns a reference to member binning_x * @return Reference to member binning_x */ -uint32_t& sensor_msgs::msg::CameraInfo::binning_x() +uint32_t& CameraInfo::binning_x() { return m_binning_x; } + /*! * @brief This function sets a value in member binning_y * @param _binning_y New value for member binning_y */ -void sensor_msgs::msg::CameraInfo::binning_y( +void CameraInfo::binning_y( uint32_t _binning_y) { m_binning_y = _binning_y; @@ -563,7 +476,7 @@ void sensor_msgs::msg::CameraInfo::binning_y( * @brief This function returns the value of member binning_y * @return Value of member binning_y */ -uint32_t sensor_msgs::msg::CameraInfo::binning_y() const +uint32_t CameraInfo::binning_y() const { return m_binning_y; } @@ -572,16 +485,17 @@ uint32_t sensor_msgs::msg::CameraInfo::binning_y() const * @brief This function returns a reference to member binning_y * @return Reference to member binning_y */ -uint32_t& sensor_msgs::msg::CameraInfo::binning_y() +uint32_t& CameraInfo::binning_y() { return m_binning_y; } + /*! * @brief This function copies the value in member roi * @param _roi New value to be copied in member roi */ -void sensor_msgs::msg::CameraInfo::roi( +void CameraInfo::roi( const sensor_msgs::msg::RegionOfInterest& _roi) { m_roi = _roi; @@ -591,7 +505,7 @@ void sensor_msgs::msg::CameraInfo::roi( * @brief This function moves the value in member roi * @param _roi New value to be moved in member roi */ -void sensor_msgs::msg::CameraInfo::roi( +void CameraInfo::roi( sensor_msgs::msg::RegionOfInterest&& _roi) { m_roi = std::move(_roi); @@ -601,7 +515,7 @@ void sensor_msgs::msg::CameraInfo::roi( * @brief This function returns a constant reference to member roi * @return Constant reference to member roi */ -const sensor_msgs::msg::RegionOfInterest& sensor_msgs::msg::CameraInfo::roi() const +const sensor_msgs::msg::RegionOfInterest& CameraInfo::roi() const { return m_roi; } @@ -610,25 +524,18 @@ const sensor_msgs::msg::RegionOfInterest& sensor_msgs::msg::CameraInfo::roi() co * @brief This function returns a reference to member roi * @return Reference to member roi */ -sensor_msgs::msg::RegionOfInterest& sensor_msgs::msg::CameraInfo::roi() +sensor_msgs::msg::RegionOfInterest& CameraInfo::roi() { return m_roi; } -size_t sensor_msgs::msg::CameraInfo::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_CameraInfo_max_key_cdr_typesize; -} -bool sensor_msgs::msg::CameraInfo::isKeyDefined() -{ - return false; -} -void sensor_msgs::msg::CameraInfo::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace sensor_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "CameraInfoCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.h index 39016b4d3ca..e98dfe68f41 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfo.h @@ -16,27 +16,30 @@ * @file CameraInfo.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ -#include "sensor_msgs/msg/RegionOfInterest.h" -#include "std_msgs/msg/Header.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "RegionOfInterest.h" +#include "std_msgs/msg/Header.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -47,373 +50,385 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) #if defined(CAMERAINFO_SOURCE) -#define CAMERAINFO_DllAPI __declspec(dllexport) +#define CAMERAINFO_DllAPI __declspec( dllexport ) #else -#define CAMERAINFO_DllAPI __declspec(dllimport) -#endif // CAMERAINFO_SOURCE +#define CAMERAINFO_DllAPI __declspec( dllimport ) +#endif // CAMERAINFO_SOURCE #else #define CAMERAINFO_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else #define CAMERAINFO_DllAPI -#endif // _WIN32 +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace sensor_msgs { + namespace msg { + +typedef std::array double__9; + +typedef std::array double__12; + + + /*! * @brief This class represents the structure CameraInfo defined by the user in the IDL file. * @ingroup CameraInfo */ -class CameraInfo { +class CameraInfo +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CameraInfo(uint32_t height = 0, uint32_t width = 0, double fov = 0.0); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CameraInfo(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. - */ - eProsima_user_DllExport CameraInfo(const CameraInfo& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. - */ - eProsima_user_DllExport CameraInfo(CameraInfo&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. - */ - eProsima_user_DllExport CameraInfo& operator=(const CameraInfo& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. - */ - eProsima_user_DllExport CameraInfo& operator=(CameraInfo&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::CameraInfo object to compare. - */ - eProsima_user_DllExport bool operator==(const CameraInfo& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::CameraInfo object to compare. - */ - eProsima_user_DllExport bool operator!=(const CameraInfo& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ - eProsima_user_DllExport void height(uint32_t _height); - - /*! - * @brief This function returns the value of member height - * @return Value of member height - */ - eProsima_user_DllExport uint32_t height() const; - - /*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ - eProsima_user_DllExport uint32_t& height(); - - /*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ - eProsima_user_DllExport void width(uint32_t _width); - - /*! - * @brief This function returns the value of member width - * @return Value of member width - */ - eProsima_user_DllExport uint32_t width() const; - - /*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ - eProsima_user_DllExport uint32_t& width(); - - /*! - * @brief This function copies the value in member distortion_model - * @param _distortion_model New value to be copied in member distortion_model - */ - eProsima_user_DllExport void distortion_model(const std::string& _distortion_model); - - /*! - * @brief This function moves the value in member distortion_model - * @param _distortion_model New value to be moved in member distortion_model - */ - eProsima_user_DllExport void distortion_model(std::string&& _distortion_model); - - /*! - * @brief This function returns a constant reference to member distortion_model - * @return Constant reference to member distortion_model - */ - eProsima_user_DllExport const std::string& distortion_model() const; - - /*! - * @brief This function returns a reference to member distortion_model - * @return Reference to member distortion_model - */ - eProsima_user_DllExport std::string& distortion_model(); - /*! - * @brief This function copies the value in member D - * @param _D New value to be copied in member D - */ - eProsima_user_DllExport void D(const std::vector& _D); - - /*! - * @brief This function moves the value in member D - * @param _D New value to be moved in member D - */ - eProsima_user_DllExport void D(std::vector&& _D); - - /*! - * @brief This function returns a constant reference to member D - * @return Constant reference to member D - */ - eProsima_user_DllExport const std::vector& D() const; - - /*! - * @brief This function returns a reference to member D - * @return Reference to member D - */ - eProsima_user_DllExport std::vector& D(); - /*! - * @brief This function copies the value in member K - * @param _K New value to be copied in member K - */ - eProsima_user_DllExport void k(const std::array& _k); - - /*! - * @brief This function moves the value in member k - * @param _k New value to be moved in member k - */ - eProsima_user_DllExport void k(std::array&& _k); - - /*! - * @brief This function returns a constant reference to member k - * @return Constant reference to member k - */ - eProsima_user_DllExport const std::array& k() const; - - /*! - * @brief This function returns a reference to member k - * @return Reference to member k - */ - eProsima_user_DllExport std::array& k(); - /*! - * @brief This function copies the value in member r - * @param _r New value to be copied in member r - */ - eProsima_user_DllExport void r(const std::array& _r); - - /*! - * @brief This function moves the value in member r - * @param _r New value to be moved in member r - */ - eProsima_user_DllExport void r(std::array&& _r); - - /*! - * @brief This function returns a constant reference to member r - * @return Constant reference to member r - */ - eProsima_user_DllExport const std::array& r() const; - - /*! - * @brief This function returns a reference to member r - * @return Reference to member r - */ - eProsima_user_DllExport std::array& r(); - /*! - * @brief This function copies the value in member p - * @param _p New value to be copied in member p - */ - eProsima_user_DllExport void p(const std::array& _p); - - /*! - * @brief This function moves the value in member p - * @param _p New value to be moved in member p - */ - eProsima_user_DllExport void p(std::array&& _p); - - /*! - * @brief This function returns a constant reference to member p - * @return Constant reference to member p - */ - eProsima_user_DllExport const std::array& p() const; - - /*! - * @brief This function returns a reference to member p - * @return Reference to member p - */ - eProsima_user_DllExport std::array& p(); - /*! - * @brief This function sets a value in member binning_x - * @param _binning_x New value for member binning_x - */ - eProsima_user_DllExport void binning_x(uint32_t _binning_x); - - /*! - * @brief This function returns the value of member binning_x - * @return Value of member binning_x - */ - eProsima_user_DllExport uint32_t binning_x() const; - - /*! - * @brief This function returns a reference to member binning_x - * @return Reference to member binning_x - */ - eProsima_user_DllExport uint32_t& binning_x(); - - /*! - * @brief This function sets a value in member binning_y - * @param _binning_y New value for member binning_y - */ - eProsima_user_DllExport void binning_y(uint32_t _binning_y); - - /*! - * @brief This function returns the value of member binning_y - * @return Value of member binning_y - */ - eProsima_user_DllExport uint32_t binning_y() const; - - /*! - * @brief This function returns a reference to member binning_y - * @return Reference to member binning_y - */ - eProsima_user_DllExport uint32_t& binning_y(); - - /*! - * @brief This function copies the value in member roi - * @param _roi New value to be copied in member roi - */ - eProsima_user_DllExport void roi(const sensor_msgs::msg::RegionOfInterest& _roi); - - /*! - * @brief This function moves the value in member roi - * @param _roi New value to be moved in member roi - */ - eProsima_user_DllExport void roi(sensor_msgs::msg::RegionOfInterest&& _roi); - - /*! - * @brief This function returns a constant reference to member roi - * @return Constant reference to member roi - */ - eProsima_user_DllExport const sensor_msgs::msg::RegionOfInterest& roi() const; - - /*! - * @brief This function returns a reference to member roi - * @return Reference to member roi - */ - eProsima_user_DllExport sensor_msgs::msg::RegionOfInterest& roi(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::CameraInfo& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CameraInfo(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CameraInfo(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. + */ + eProsima_user_DllExport CameraInfo( + const CameraInfo& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. + */ + eProsima_user_DllExport CameraInfo( + CameraInfo&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. + */ + eProsima_user_DllExport CameraInfo& operator =( + const CameraInfo& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::CameraInfo that will be copied. + */ + eProsima_user_DllExport CameraInfo& operator =( + CameraInfo&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::CameraInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CameraInfo& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::CameraInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CameraInfo& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ + eProsima_user_DllExport void height( + uint32_t _height); + + /*! + * @brief This function returns the value of member height + * @return Value of member height + */ + eProsima_user_DllExport uint32_t height() const; + + /*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ + eProsima_user_DllExport uint32_t& height(); + + + /*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ + eProsima_user_DllExport void width( + uint32_t _width); + + /*! + * @brief This function returns the value of member width + * @return Value of member width + */ + eProsima_user_DllExport uint32_t width() const; + + /*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ + eProsima_user_DllExport uint32_t& width(); + + + /*! + * @brief This function copies the value in member distortion_model + * @param _distortion_model New value to be copied in member distortion_model + */ + eProsima_user_DllExport void distortion_model( + const std::string& _distortion_model); + + /*! + * @brief This function moves the value in member distortion_model + * @param _distortion_model New value to be moved in member distortion_model + */ + eProsima_user_DllExport void distortion_model( + std::string&& _distortion_model); + + /*! + * @brief This function returns a constant reference to member distortion_model + * @return Constant reference to member distortion_model + */ + eProsima_user_DllExport const std::string& distortion_model() const; + + /*! + * @brief This function returns a reference to member distortion_model + * @return Reference to member distortion_model + */ + eProsima_user_DllExport std::string& distortion_model(); + + + /*! + * @brief This function copies the value in member d + * @param _d New value to be copied in member d + */ + eProsima_user_DllExport void d( + const std::vector& _d); + + /*! + * @brief This function moves the value in member d + * @param _d New value to be moved in member d + */ + eProsima_user_DllExport void d( + std::vector&& _d); + + /*! + * @brief This function returns a constant reference to member d + * @return Constant reference to member d + */ + eProsima_user_DllExport const std::vector& d() const; + + /*! + * @brief This function returns a reference to member d + * @return Reference to member d + */ + eProsima_user_DllExport std::vector& d(); + + + /*! + * @brief This function copies the value in member k + * @param _k New value to be copied in member k + */ + eProsima_user_DllExport void k( + const sensor_msgs::msg::double__9& _k); + + /*! + * @brief This function moves the value in member k + * @param _k New value to be moved in member k + */ + eProsima_user_DllExport void k( + sensor_msgs::msg::double__9&& _k); + + /*! + * @brief This function returns a constant reference to member k + * @return Constant reference to member k + */ + eProsima_user_DllExport const sensor_msgs::msg::double__9& k() const; + + /*! + * @brief This function returns a reference to member k + * @return Reference to member k + */ + eProsima_user_DllExport sensor_msgs::msg::double__9& k(); + + + /*! + * @brief This function copies the value in member r + * @param _r New value to be copied in member r + */ + eProsima_user_DllExport void r( + const sensor_msgs::msg::double__9& _r); + + /*! + * @brief This function moves the value in member r + * @param _r New value to be moved in member r + */ + eProsima_user_DllExport void r( + sensor_msgs::msg::double__9&& _r); + + /*! + * @brief This function returns a constant reference to member r + * @return Constant reference to member r + */ + eProsima_user_DllExport const sensor_msgs::msg::double__9& r() const; + + /*! + * @brief This function returns a reference to member r + * @return Reference to member r + */ + eProsima_user_DllExport sensor_msgs::msg::double__9& r(); + + + /*! + * @brief This function copies the value in member p + * @param _p New value to be copied in member p + */ + eProsima_user_DllExport void p( + const sensor_msgs::msg::double__12& _p); + + /*! + * @brief This function moves the value in member p + * @param _p New value to be moved in member p + */ + eProsima_user_DllExport void p( + sensor_msgs::msg::double__12&& _p); + + /*! + * @brief This function returns a constant reference to member p + * @return Constant reference to member p + */ + eProsima_user_DllExport const sensor_msgs::msg::double__12& p() const; + + /*! + * @brief This function returns a reference to member p + * @return Reference to member p + */ + eProsima_user_DllExport sensor_msgs::msg::double__12& p(); + + + /*! + * @brief This function sets a value in member binning_x + * @param _binning_x New value for member binning_x + */ + eProsima_user_DllExport void binning_x( + uint32_t _binning_x); + + /*! + * @brief This function returns the value of member binning_x + * @return Value of member binning_x + */ + eProsima_user_DllExport uint32_t binning_x() const; + + /*! + * @brief This function returns a reference to member binning_x + * @return Reference to member binning_x + */ + eProsima_user_DllExport uint32_t& binning_x(); + + + /*! + * @brief This function sets a value in member binning_y + * @param _binning_y New value for member binning_y + */ + eProsima_user_DllExport void binning_y( + uint32_t _binning_y); + + /*! + * @brief This function returns the value of member binning_y + * @return Value of member binning_y + */ + eProsima_user_DllExport uint32_t binning_y() const; + + /*! + * @brief This function returns a reference to member binning_y + * @return Reference to member binning_y + */ + eProsima_user_DllExport uint32_t& binning_y(); + + + /*! + * @brief This function copies the value in member roi + * @param _roi New value to be copied in member roi + */ + eProsima_user_DllExport void roi( + const sensor_msgs::msg::RegionOfInterest& _roi); + + /*! + * @brief This function moves the value in member roi + * @param _roi New value to be moved in member roi + */ + eProsima_user_DllExport void roi( + sensor_msgs::msg::RegionOfInterest&& _roi); + + /*! + * @brief This function returns a constant reference to member roi + * @return Constant reference to member roi + */ + eProsima_user_DllExport const sensor_msgs::msg::RegionOfInterest& roi() const; + + /*! + * @brief This function returns a reference to member roi + * @return Reference to member roi + */ + eProsima_user_DllExport sensor_msgs::msg::RegionOfInterest& roi(); private: - std_msgs::msg::Header m_header; - uint32_t m_height; - uint32_t m_width; - std::string m_distortion_model; - std::vector m_d; - std::array m_k; - std::array m_r; - std::array m_p; - uint32_t m_binning_x; - uint32_t m_binning_y; - sensor_msgs::msg::RegionOfInterest m_roi; + + std_msgs::msg::Header m_header; + uint32_t m_height{0}; + uint32_t m_width{0}; + std::string m_distortion_model; + std::vector m_d; + sensor_msgs::msg::double__9 m_k{0.0}; + sensor_msgs::msg::double__9 m_r{0.0}; + sensor_msgs::msg::double__12 m_p{0.0}; + uint32_t m_binning_x{0}; + uint32_t m_binning_y{0}; + sensor_msgs::msg::RegionOfInterest m_roi; + }; -} // namespace msg -} // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ +} // namespace msg + +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoCdrAux.hpp new file mode 100644 index 00000000000..085aa067a71 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoCdrAux.hpp @@ -0,0 +1,57 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CameraInfoCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFOCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFOCDRAUX_HPP_ + +#include "CameraInfo.h" + +constexpr uint32_t sensor_msgs_msg_CameraInfo_max_cdr_typesize {1621UL}; +constexpr uint32_t sensor_msgs_msg_CameraInfo_max_key_cdr_typesize {0UL}; + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::CameraInfo& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFOCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoCdrAux.ipp new file mode 100644 index 00000000000..6e9aa250cd9 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoCdrAux.ipp @@ -0,0 +1,214 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CameraInfoCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFOCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFOCDRAUX_IPP_ + +#include "CameraInfoCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::CameraInfo& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.height(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.width(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.distortion_model(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.d(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.k(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.r(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.p(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.binning_x(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.binning_y(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.roi(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::CameraInfo& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.height() + << eprosima::fastcdr::MemberId(2) << data.width() + << eprosima::fastcdr::MemberId(3) << data.distortion_model() + << eprosima::fastcdr::MemberId(4) << data.d() + << eprosima::fastcdr::MemberId(5) << data.k() + << eprosima::fastcdr::MemberId(6) << data.r() + << eprosima::fastcdr::MemberId(7) << data.p() + << eprosima::fastcdr::MemberId(8) << data.binning_x() + << eprosima::fastcdr::MemberId(9) << data.binning_y() + << eprosima::fastcdr::MemberId(10) << data.roi() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::CameraInfo& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.height(); + break; + + case 2: + dcdr >> data.width(); + break; + + case 3: + dcdr >> data.distortion_model(); + break; + + case 4: + dcdr >> data.d(); + break; + + case 5: + dcdr >> data.k(); + break; + + case 6: + dcdr >> data.r(); + break; + + case 7: + dcdr >> data.p(); + break; + + case 8: + dcdr >> data.binning_x(); + break; + + case 9: + dcdr >> data.binning_y(); + break; + + case 10: + dcdr >> data.roi(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::CameraInfo& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFOCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.cxx index 04ce6e70226..87aff85deaa 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.cxx @@ -16,157 +16,187 @@ * @file CameraInfoPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "CameraInfoPubSubTypes.h" +#include "CameraInfoCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace sensor_msgs { - namespace msg { - CameraInfoPubSubType::CameraInfoPubSubType() - { - setName("sensor_msgs::msg::dds_::CameraInfo_"); - auto type_size = CameraInfo::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = CameraInfo::isKeyDefined(); - size_t keyLength = CameraInfo::getKeyMaxCdrSerializedSize() > 16 ? - CameraInfo::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - CameraInfoPubSubType::~CameraInfoPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool CameraInfoPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - CameraInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool CameraInfoPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - CameraInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function CameraInfoPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* CameraInfoPubSubType::createData() - { - return reinterpret_cast(new CameraInfo()); - } - - void CameraInfoPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool CameraInfoPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - CameraInfo* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CameraInfo::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || CameraInfo::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + + + + + +CameraInfoPubSubType::CameraInfoPubSubType() +{ + setName("sensor_msgs::msg::dds_::CameraInfo_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CameraInfo::getMaxCdrSerializedSize()); +#else + sensor_msgs_msg_CameraInfo_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +CameraInfoPubSubType::~CameraInfoPubSubType() +{ +} + +bool CameraInfoPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CameraInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool CameraInfoPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CameraInfo* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function CameraInfoPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* CameraInfoPubSubType::createData() +{ + return reinterpret_cast(new CameraInfo()); +} + +void CameraInfoPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CameraInfoPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.h index 50d03342fad..971869b6c79 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/CameraInfoPubSubTypes.h @@ -16,78 +16,124 @@ * @file CameraInfoPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "CameraInfo.h" #include "RegionOfInterestPubSubTypes.h" #include "std_msgs/msg/HeaderPubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated CameraInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated CameraInfo is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace sensor_msgs { namespace msg { +typedef std::array double__9; +typedef std::array double__12; + + + /*! * @brief This class represents the TopicDataType of the type CameraInfo defined by the user in the IDL file. * @ingroup CameraInfo */ -class CameraInfoPubSubType : public eprosima::fastdds::dds::TopicDataType { +class CameraInfoPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef CameraInfo type; - eProsima_user_DllExport CameraInfoPubSubType(); + typedef CameraInfo type; + + eProsima_user_DllExport CameraInfoPubSubType(); + + eProsima_user_DllExport ~CameraInfoPubSubType() override; - eProsima_user_DllExport virtual ~CameraInfoPubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; + }; } // namespace msg } // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_CAMERAINFO_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.cc b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.cc index e607e9f9e40..fe57b4ae583 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.cc +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.cc @@ -14,154 +14,125 @@ /*! * @file Image.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 // Remove linker warning LNK4221 on Visual Studio namespace { -// char dummy; +char dummy; } // namespace #endif // _WIN32 #include "Image.h" + #include + +#include +using namespace eprosima::fastcdr::exception; + #include -#define builtin_interfaces_msg_Time_max_cdr_typesize 8ULL; -#define sensor_msgs_msg_Image_max_cdr_typesize 648ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define builtin_interfaces_msg_Time_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_Image_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; -template -sensor_msgs::msg::ImageT::ImageT() { - // std_msgs::msg::Header m_header +namespace sensor_msgs { - // unsigned long m_height - m_height = 0; - // unsigned long m_width - m_width = 0; - // string m_encoding - m_encoding = ""; - // uint8 m_is_bigendian - m_is_bigendian = 0; - // unsigned long m_step - m_step = 0; - // sequence m_data -} +namespace msg { -template -sensor_msgs::msg::ImageT::~ImageT() {} -template -sensor_msgs::msg::ImageT::ImageT(const ImageT& x) { - m_header = x.m_header; - m_height = x.m_height; - m_width = x.m_width; - m_encoding = x.m_encoding; - m_is_bigendian = x.m_is_bigendian; - m_step = x.m_step; - m_data = x.m_data; -} -template -sensor_msgs::msg::ImageT::ImageT(ImageT&& x) noexcept { - m_header = std::move(x.m_header); - m_height = x.m_height; - m_width = x.m_width; - m_encoding = std::move(x.m_encoding); - m_is_bigendian = x.m_is_bigendian; - m_step = x.m_step; - m_data = std::move(x.m_data); -} -template -sensor_msgs::msg::ImageT& sensor_msgs::msg::ImageT::operator=(const ImageT& x) { - m_header = x.m_header; - m_height = x.m_height; - m_width = x.m_width; - m_encoding = x.m_encoding; - m_is_bigendian = x.m_is_bigendian; - m_step = x.m_step; - m_data = x.m_data; - return *this; +template +ImageT::ImageT() +{ } template -sensor_msgs::msg::ImageT& sensor_msgs::msg::ImageT::operator=(ImageT&& x) noexcept { - m_header = std::move(x.m_header); - m_height = x.m_height; - m_width = x.m_width; - m_encoding = std::move(x.m_encoding); - m_is_bigendian = x.m_is_bigendian; - m_step = x.m_step; - m_data = std::move(x.m_data); - - return *this; +ImageT::~ImageT() +{ } template -bool sensor_msgs::msg::ImageT::operator==(const ImageT& x) const { - return (m_header == x.m_header && m_height == x.m_height && m_width == x.m_width && m_encoding == x.m_encoding && - m_is_bigendian == x.m_is_bigendian && m_step == x.m_step && m_data == x.m_data); +ImageT::ImageT( + const ImageT& x) +{ + m_header = x.m_header; + m_height = x.m_height; + m_width = x.m_width; + m_encoding = x.m_encoding; + m_is_bigendian = x.m_is_bigendian; + m_step = x.m_step; + m_data = x.m_data; } template -bool sensor_msgs::msg::ImageT::operator!=(const ImageT& x) const { - return !(*this == x); +ImageT::ImageT( + ImageT&& x) noexcept +{ + m_header = std::move(x.m_header); + m_height = x.m_height; + m_width = x.m_width; + m_encoding = std::move(x.m_encoding); + m_is_bigendian = x.m_is_bigendian; + m_step = x.m_step; + m_data = std::move(x.m_data); } template -size_t sensor_msgs::msg::ImageT::getMaxCdrSerializedSize(size_t current_alignment) { - static_cast(current_alignment); - return sensor_msgs_msg_Image_max_cdr_typesize; +ImageT& +ImageT::operator =( + const ImageT& x) +{ + + m_header = x.m_header; + m_height = x.m_height; + m_width = x.m_width; + m_encoding = x.m_encoding; + m_is_bigendian = x.m_is_bigendian; + m_step = x.m_step; + m_data = x.m_data; + return *this; } template -size_t sensor_msgs::msg::ImageT::getCdrSerializedSize(const sensor_msgs::msg::ImageT& data, - size_t current_alignment) { - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.encoding().size() + 1; - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); +ImageT& +ImageT::operator =( + ImageT&& x) noexcept +{ - if (data.data().size() > 0) { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - return current_alignment - initial_alignment; + m_header = std::move(x.m_header); + m_height = x.m_height; + m_width = x.m_width; + m_encoding = std::move(x.m_encoding); + m_is_bigendian = x.m_is_bigendian; + m_step = x.m_step; + m_data = std::move(x.m_data); + return *this; } template -void sensor_msgs::msg::ImageT::serialize(eprosima::fastcdr::Cdr& scdr) const { - scdr << m_header; - scdr << m_height; - scdr << m_width; - scdr << m_encoding.c_str(); - scdr << m_is_bigendian; - scdr << m_step; - scdr << m_data; +bool +ImageT::operator ==( + const ImageT& x) const +{ + return (m_header == x.m_header && + m_height == x.m_height && + m_width == x.m_width && + m_encoding == x.m_encoding && + m_is_bigendian == x.m_is_bigendian && + m_step == x.m_step && + m_data == x.m_data); } template -void sensor_msgs::msg::ImageT::deserialize(eprosima::fastcdr::Cdr& dcdr) { - dcdr >> m_header; - dcdr >> m_height; - dcdr >> m_width; - dcdr >> m_encoding; - dcdr >> m_is_bigendian; - dcdr >> m_step; - dcdr >> m_data; +bool +ImageT::operator !=( + const ImageT& x) const +{ + return !(*this == x); } /*! @@ -169,8 +140,11 @@ void sensor_msgs::msg::ImageT::deserialize(eprosima::fastcdr::Cdr& dc * @param _header New value to be copied in member header */ template -void sensor_msgs::msg::ImageT::header(const std_msgs::msg::Header& _header) { - m_header = _header; +void +ImageT::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; } /*! @@ -178,8 +152,11 @@ void sensor_msgs::msg::ImageT::header(const std_msgs::msg::Header& _h * @param _header New value to be moved in member header */ template -void sensor_msgs::msg::ImageT::header(std_msgs::msg::Header&& _header) { - m_header = std::move(_header); +void +ImageT::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); } /*! @@ -187,8 +164,10 @@ void sensor_msgs::msg::ImageT::header(std_msgs::msg::Header&& _header * @return Constant reference to member header */ template -const std_msgs::msg::Header& sensor_msgs::msg::ImageT::header() const { - return m_header; +const std_msgs::msg::Header& +ImageT::header() const +{ + return m_header; } /*! @@ -196,17 +175,23 @@ const std_msgs::msg::Header& sensor_msgs::msg::ImageT::header() const * @return Reference to member header */ template -std_msgs::msg::Header& sensor_msgs::msg::ImageT::header() { - return m_header; +std_msgs::msg::Header& +ImageT::header() +{ + return m_header; } + /*! * @brief This function sets a value in member height * @param _height New value for member height */ template -void sensor_msgs::msg::ImageT::height(uint32_t _height) { - m_height = _height; +void +ImageT::height( + uint32_t _height) +{ + m_height = _height; } /*! @@ -214,8 +199,10 @@ void sensor_msgs::msg::ImageT::height(uint32_t _height) { * @return Value of member height */ template -uint32_t sensor_msgs::msg::ImageT::height() const { - return m_height; +uint32_t +ImageT::height() const +{ + return m_height; } /*! @@ -223,17 +210,23 @@ uint32_t sensor_msgs::msg::ImageT::height() const { * @return Reference to member height */ template -uint32_t& sensor_msgs::msg::ImageT::height() { - return m_height; +uint32_t& +ImageT::height() +{ + return m_height; } + /*! * @brief This function sets a value in member width * @param _width New value for member width */ template -void sensor_msgs::msg::ImageT::width(uint32_t _width) { - m_width = _width; +void +ImageT::width( + uint32_t _width) +{ + m_width = _width; } /*! @@ -241,8 +234,10 @@ void sensor_msgs::msg::ImageT::width(uint32_t _width) { * @return Value of member width */ template -uint32_t sensor_msgs::msg::ImageT::width() const { - return m_width; +uint32_t +ImageT::width() const +{ + return m_width; } /*! @@ -250,17 +245,23 @@ uint32_t sensor_msgs::msg::ImageT::width() const { * @return Reference to member width */ template -uint32_t& sensor_msgs::msg::ImageT::width() { - return m_width; +uint32_t& +ImageT::width() +{ + return m_width; } + /*! * @brief This function copies the value in member encoding * @param _encoding New value to be copied in member encoding */ template -void sensor_msgs::msg::ImageT::encoding(const std::string& _encoding) { - m_encoding = _encoding; +void +ImageT::encoding( + const std::string& _encoding) +{ + m_encoding = _encoding; } /*! @@ -268,8 +269,11 @@ void sensor_msgs::msg::ImageT::encoding(const std::string& _encoding) * @param _encoding New value to be moved in member encoding */ template -void sensor_msgs::msg::ImageT::encoding(std::string&& _encoding) { - m_encoding = std::move(_encoding); +void +ImageT::encoding( + std::string&& _encoding) +{ + m_encoding = std::move(_encoding); } /*! @@ -277,8 +281,10 @@ void sensor_msgs::msg::ImageT::encoding(std::string&& _encoding) { * @return Constant reference to member encoding */ template -const std::string& sensor_msgs::msg::ImageT::encoding() const { - return m_encoding; +const std::string& +ImageT::encoding() const +{ + return m_encoding; } /*! @@ -286,17 +292,23 @@ const std::string& sensor_msgs::msg::ImageT::encoding() const { * @return Reference to member encoding */ template -std::string& sensor_msgs::msg::ImageT::encoding() { - return m_encoding; +std::string& +ImageT::encoding() +{ + return m_encoding; } + /*! * @brief This function sets a value in member is_bigendian * @param _is_bigendian New value for member is_bigendian */ template -void sensor_msgs::msg::ImageT::is_bigendian(uint8_t _is_bigendian) { - m_is_bigendian = _is_bigendian; +void +ImageT::is_bigendian( + uint8_t _is_bigendian) +{ + m_is_bigendian = _is_bigendian; } /*! @@ -304,8 +316,10 @@ void sensor_msgs::msg::ImageT::is_bigendian(uint8_t _is_bigendian) { * @return Value of member is_bigendian */ template -uint8_t sensor_msgs::msg::ImageT::is_bigendian() const { - return m_is_bigendian; +uint8_t +ImageT::is_bigendian() const +{ + return m_is_bigendian; } /*! @@ -313,17 +327,23 @@ uint8_t sensor_msgs::msg::ImageT::is_bigendian() const { * @return Reference to member is_bigendian */ template -uint8_t& sensor_msgs::msg::ImageT::is_bigendian() { - return m_is_bigendian; +uint8_t& +ImageT::is_bigendian() +{ + return m_is_bigendian; } + /*! * @brief This function sets a value in member step * @param _step New value for member step */ template -void sensor_msgs::msg::ImageT::step(uint32_t _step) { - m_step = _step; +void +ImageT::step( + uint32_t _step) +{ + m_step = _step; } /*! @@ -331,8 +351,10 @@ void sensor_msgs::msg::ImageT::step(uint32_t _step) { * @return Value of member step */ template -uint32_t sensor_msgs::msg::ImageT::step() const { - return m_step; +uint32_t +ImageT::step() const +{ + return m_step; } /*! @@ -340,17 +362,23 @@ uint32_t sensor_msgs::msg::ImageT::step() const { * @return Reference to member step */ template -uint32_t& sensor_msgs::msg::ImageT::step() { - return m_step; +uint32_t& +ImageT::step() +{ + return m_step; } + /*! * @brief This function copies the value in member data * @param _data New value to be copied in member data */ template -void sensor_msgs::msg::ImageT::data(const typename sensor_msgs::msg::ImageT::vector_type& _data) { - m_data = _data; +void +ImageT::data( + const typename ImageT::vector_type& _data) +{ + m_data = _data; } /*! @@ -358,8 +386,11 @@ void sensor_msgs::msg::ImageT::data(const typename sensor_msgs::msg:: * @param _data New value to be moved in member data */ template -void sensor_msgs::msg::ImageT::data(typename sensor_msgs::msg::ImageT::vector_type&& _data) { - m_data = std::move(_data); +void +ImageT::data( + typename ImageT::vector_type&& _data) +{ + m_data = std::move(_data); } /*! @@ -367,8 +398,10 @@ void sensor_msgs::msg::ImageT::data(typename sensor_msgs::msg::ImageT * @return Constant reference to member data */ template -const typename sensor_msgs::msg::ImageT::vector_type& sensor_msgs::msg::ImageT::data() const { - return m_data; +const typename ImageT::vector_type& +ImageT::data() const +{ + return m_data; } /*! @@ -376,22 +409,17 @@ const typename sensor_msgs::msg::ImageT::vector_type& sensor_msgs::ms * @return Reference to member data */ template -typename sensor_msgs::msg::ImageT::vector_type& sensor_msgs::msg::ImageT::data() { - return m_data; +typename ImageT::vector_type& +ImageT::data() +{ + return m_data; } -template -size_t sensor_msgs::msg::ImageT::getKeyMaxCdrSerializedSize(size_t current_alignment) { - static_cast(current_alignment); - return sensor_msgs_msg_Image_max_key_cdr_typesize; -} -template -bool sensor_msgs::msg::ImageT::isKeyDefined() { - return false; -} -template -void sensor_msgs::msg::ImageT::serializeKey(eprosima::fastcdr::Cdr& scdr) const { - (void)scdr; -} + +} // namespace msg + + +} // namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.h index 56482e3eb90..abc5af40391 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Image.h @@ -13,31 +13,33 @@ // limitations under the License. /*! - * @file ImageT.h + * @file Image.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_ImageT_H_ -#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_ImageT_H_ +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_ -#include "std_msgs/msg/Header.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "std_msgs/msg/Header.h" #include "carla/sensor/data/SerializerVectorAllocator.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -47,289 +49,282 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ImageT_SOURCE) -#define ImageT_DllAPI __declspec(dllexport) +#if defined(IMAGE_SOURCE) +#define IMAGE_DllAPI __declspec( dllexport ) #else -#define ImageT_DllAPI __declspec(dllimport) -#endif // ImageT_SOURCE +#define IMAGE_DllAPI __declspec( dllimport ) +#endif // IMAGE_SOURCE #else -#define ImageT_DllAPI +#define IMAGE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define ImageT_DllAPI -#endif // _WIN32 +#define IMAGE_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace sensor_msgs { + namespace msg { + + + + + /*! * @brief This class represents the structure ImageT defined by the user in the IDL file. * @ingroup ImageT */ template -class ImageT { +class ImageT +{ public: - using base_type = uint8_t; - using allocator_type = ALLOCATOR; - using vector_type = std::vector; - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ImageT(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ImageT(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. - */ - eProsima_user_DllExport ImageT(const ImageT& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. - */ - eProsima_user_DllExport ImageT(ImageT&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. - */ - eProsima_user_DllExport ImageT& operator=(const ImageT& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. - */ - eProsima_user_DllExport ImageT& operator=(ImageT&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::ImageT object to compare. - */ - eProsima_user_DllExport bool operator==(const ImageT& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::ImageT object to compare. - */ - eProsima_user_DllExport bool operator!=(const ImageT& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ - eProsima_user_DllExport void height(uint32_t _height); - - /*! - * @brief This function returns the value of member height - * @return Value of member height - */ - eProsima_user_DllExport uint32_t height() const; - - /*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ - eProsima_user_DllExport uint32_t& height(); - - /*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ - eProsima_user_DllExport void width(uint32_t _width); - - /*! - * @brief This function returns the value of member width - * @return Value of member width - */ - eProsima_user_DllExport uint32_t width() const; - - /*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ - eProsima_user_DllExport uint32_t& width(); - - /*! - * @brief This function copies the value in member encoding - * @param _encoding New value to be copied in member encoding - */ - eProsima_user_DllExport void encoding(const std::string& _encoding); - - /*! - * @brief This function moves the value in member encoding - * @param _encoding New value to be moved in member encoding - */ - eProsima_user_DllExport void encoding(std::string&& _encoding); - - /*! - * @brief This function returns a constant reference to member encoding - * @return Constant reference to member encoding - */ - eProsima_user_DllExport const std::string& encoding() const; - - /*! - * @brief This function returns a reference to member encoding - * @return Reference to member encoding - */ - eProsima_user_DllExport std::string& encoding(); - /*! - * @brief This function sets a value in member is_bigendian - * @param _is_bigendian New value for member is_bigendian - */ - eProsima_user_DllExport void is_bigendian(uint8_t _is_bigendian); - - /*! - * @brief This function returns the value of member is_bigendian - * @return Value of member is_bigendian - */ - eProsima_user_DllExport uint8_t is_bigendian() const; - - /*! - * @brief This function returns a reference to member is_bigendian - * @return Reference to member is_bigendian - */ - eProsima_user_DllExport uint8_t& is_bigendian(); - - /*! - * @brief This function sets a value in member step - * @param _step New value for member step - */ - eProsima_user_DllExport void step(uint32_t _step); - - /*! - * @brief This function returns the value of member step - * @return Value of member step - */ - eProsima_user_DllExport uint32_t step() const; - - /*! - * @brief This function returns a reference to member step - * @return Reference to member step - */ - eProsima_user_DllExport uint32_t& step(); - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data(const vector_type& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data(vector_type&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const vector_type& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport vector_type& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::ImageT& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + using base_type = uint8_t; + using allocator_type = ALLOCATOR; + using vector_type = std::vector; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ImageT(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ImageT(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. + */ + eProsima_user_DllExport ImageT( + const ImageT& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. + */ + eProsima_user_DllExport ImageT( + ImageT&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. + */ + eProsima_user_DllExport ImageT& operator =( + const ImageT& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::ImageT that will be copied. + */ + eProsima_user_DllExport ImageT& operator =( + ImageT&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::ImageT object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ImageT& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::ImageT object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ImageT& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ + eProsima_user_DllExport void height( + uint32_t _height); + + /*! + * @brief This function returns the value of member height + * @return Value of member height + */ + eProsima_user_DllExport uint32_t height() const; + + /*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ + eProsima_user_DllExport uint32_t& height(); + + + /*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ + eProsima_user_DllExport void width( + uint32_t _width); + + /*! + * @brief This function returns the value of member width + * @return Value of member width + */ + eProsima_user_DllExport uint32_t width() const; + + /*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ + eProsima_user_DllExport uint32_t& width(); + + + /*! + * @brief This function copies the value in member encoding + * @param _encoding New value to be copied in member encoding + */ + eProsima_user_DllExport void encoding( + const std::string& _encoding); + + /*! + * @brief This function moves the value in member encoding + * @param _encoding New value to be moved in member encoding + */ + eProsima_user_DllExport void encoding( + std::string&& _encoding); + + /*! + * @brief This function returns a constant reference to member encoding + * @return Constant reference to member encoding + */ + eProsima_user_DllExport const std::string& encoding() const; + + /*! + * @brief This function returns a reference to member encoding + * @return Reference to member encoding + */ + eProsima_user_DllExport std::string& encoding(); + + + /*! + * @brief This function sets a value in member is_bigendian + * @param _is_bigendian New value for member is_bigendian + */ + eProsima_user_DllExport void is_bigendian( + uint8_t _is_bigendian); + + /*! + * @brief This function returns the value of member is_bigendian + * @return Value of member is_bigendian + */ + eProsima_user_DllExport uint8_t is_bigendian() const; + + /*! + * @brief This function returns a reference to member is_bigendian + * @return Reference to member is_bigendian + */ + eProsima_user_DllExport uint8_t& is_bigendian(); + + + /*! + * @brief This function sets a value in member step + * @param _step New value for member step + */ + eProsima_user_DllExport void step( + uint32_t _step); + + /*! + * @brief This function returns the value of member step + * @return Value of member step + */ + eProsima_user_DllExport uint32_t step() const; + + /*! + * @brief This function returns a reference to member step + * @return Reference to member step + */ + eProsima_user_DllExport uint32_t& step(); + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const vector_type& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + vector_type&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const vector_type& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport vector_type& data(); private: - std_msgs::msg::Header m_header; - uint32_t m_height; - uint32_t m_width; - std::string m_encoding; - uint8_t m_is_bigendian; - uint32_t m_step; - vector_type m_data; + + std_msgs::msg::Header m_header; + uint32_t m_height{0}; + uint32_t m_width{0}; + std::string m_encoding; + uint8_t m_is_bigendian{0}; + uint32_t m_step{0}; + vector_type m_data; + }; + using ImageFromBuffer = ImageT>; using Image = ImageT>; -} // namespace msg -} // namespace sensor_msgs +} // namespace msg + +} // namespace sensor_msgs #include "Image.cc" -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_ImageT_H_ +#endif // _FAST_DDS_G>ENERATED_SENSOR_MSGS_MSG_IMAGE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAux.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAux.cxx new file mode 100644 index 00000000000..4a032213a48 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAux.cxx @@ -0,0 +1,180 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImageCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_IPP_ + +#include "ImageCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::Image& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.height(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.width(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.encoding(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.is_bigendian(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.step(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::Image& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.height() + << eprosima::fastcdr::MemberId(2) << data.width() + << eprosima::fastcdr::MemberId(3) << data.encoding() + << eprosima::fastcdr::MemberId(4) << data.is_bigendian() + << eprosima::fastcdr::MemberId(5) << data.step() + << eprosima::fastcdr::MemberId(6) << data.data() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::Image& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.height(); + break; + + case 2: + dcdr >> data.width(); + break; + + case 3: + dcdr >> data.encoding(); + break; + + case 4: + dcdr >> data.is_bigendian(); + break; + + case 5: + dcdr >> data.step(); + break; + + case 6: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::Image& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAux.hpp new file mode 100644 index 00000000000..4143c62c980 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAux.hpp @@ -0,0 +1,53 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImageCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_HPP_ + +#include "Image.h" + +constexpr uint32_t sensor_msgs_msg_Image_max_cdr_typesize {660UL}; +constexpr uint32_t sensor_msgs_msg_Image_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::Image& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAuxFromBuffer.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAuxFromBuffer.cxx new file mode 100644 index 00000000000..bf32e2bd1f2 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImageCdrAuxFromBuffer.cxx @@ -0,0 +1,180 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImageCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_IPP_ + +#include "ImageCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::ImageFromBuffer& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.height(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.width(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.encoding(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.is_bigendian(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.step(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::ImageFromBuffer& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.height() + << eprosima::fastcdr::MemberId(2) << data.width() + << eprosima::fastcdr::MemberId(3) << data.encoding() + << eprosima::fastcdr::MemberId(4) << data.is_bigendian() + << eprosima::fastcdr::MemberId(5) << data.step() + << eprosima::fastcdr::MemberId(6) << data.data() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::ImageFromBuffer& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.height(); + break; + + case 2: + dcdr >> data.width(); + break; + + case 3: + dcdr >> data.encoding(); + break; + + case 4: + dcdr >> data.is_bigendian(); + break; + + case 5: + dcdr >> data.step(); + break; + + case 6: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::ImageFromBuffer& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.cc b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.cc index e806b137209..e493315b7c8 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.cc +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.cc @@ -13,123 +13,196 @@ // limitations under the License. /*! - * @file ImagePubSubTypeTs.cpp + * @file ImagePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "ImagePubSubTypes.h" +#include "ImageCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace sensor_msgs { namespace msg { -template -ImagePubSubTypeT::ImagePubSubTypeT() { - setName("sensor_msgs::msg::dds_::Image_"); - auto type_size = type::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = type::isKeyDefined(); - size_t keyLength = type::getKeyMaxCdrSerializedSize() > 16 ? type::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} -template -ImagePubSubTypeT::~ImagePubSubTypeT() { - if (m_keyBuffer != nullptr) { - free(m_keyBuffer); - } -} + template -bool ImagePubSubTypeT::serialize(void* data, SerializedPayload_t* payload) { - type* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - p_type->serialize(ser); - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; +ImagePubSubTypeT::ImagePubSubTypeT() +{ + setName("sensor_msgs::msg::dds_::Image_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(type::getMaxCdrSerializedSize()); +#else + sensor_msgs_msg_Image_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; } template -bool ImagePubSubTypeT::deserialize(SerializedPayload_t* payload, void* data) { - // Convert DATA to pointer of your type - type* p_type = static_cast(data); +ImagePubSubTypeT::~ImagePubSubTypeT() +{ +} - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); +template bool +ImagePubSubTypeT::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + type* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +template bool +ImagePubSubTypeT::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + type* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - p_type->deserialize(deser); - return true; + return true; } -template -std::function ImagePubSubTypeT::getSerializedSizeProvider(void* data) { - return [data]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + 4u /*encapsulation*/; - }; +template std::function +ImagePubSubTypeT::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; } -template -void* ImagePubSubTypeT::createData() { - return reinterpret_cast(new type()); +template void* +ImagePubSubTypeT::createData() +{ + return reinterpret_cast(new type()); } -template -void ImagePubSubTypeT::deleteData(void* data) { - delete (reinterpret_cast(data)); +template void +ImagePubSubTypeT::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); } -template -bool ImagePubSubTypeT::getKey(void* data, InstanceHandle_t* handle, bool force_md5) { - if (!m_isGetKeyDefined) { +template bool +ImagePubSubTypeT::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + return false; - } - - type* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), type::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || type::getKeyMaxCdrSerializedSize() > 16) { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) { - handle->value[i] = m_md5.digest[i]; - } - } else { - for (uint8_t i = 0; i < 16; ++i) { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; } -} // End of namespace msg -} // End of namespace sensor_msgs + + + +} //End of namespace msg + + +} //End of namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.h index ce3b3026495..0b6f9691f4c 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImagePubSubTypes.h @@ -13,84 +13,128 @@ // limitations under the License. /*! - * @file ImagePubSubTypeTs.h + * @file ImagePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "Image.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Image is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#include "std_msgs/msg/HeaderPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Image is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace sensor_msgs { namespace msg { + + + + + /*! * @brief This class represents the TopicDataType of the type Image defined by the user in the IDL file. - * @ingroup IMAGE + * @ingroup Image */ template -class ImagePubSubTypeT : public eprosima::fastdds::dds::TopicDataType { +class ImagePubSubTypeT : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef ImageT type; + typedef ::sensor_msgs::msg::ImageT type; + + eProsima_user_DllExport ImagePubSubTypeT(); + + eProsima_user_DllExport ~ImagePubSubTypeT() override; - eProsima_user_DllExport ImagePubSubTypeT(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual ~ImagePubSubTypeT() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport void* createData() override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; -}; -using ImagePubSubTypeFromBuffer = ImagePubSubTypeT>; -using ImagePubSubType = ImagePubSubTypeT>; +}; } // namespace msg } // namespace sensor_msgs #include "ImagePubSubTypes.cc" -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.cxx index ece90e125d4..4300803b43c 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.cxx @@ -14,9 +14,9 @@ /*! * @file Imu.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,49 +27,31 @@ char dummy; #endif // _WIN32 #include "Imu.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define std_msgs_msg_Time_max_cdr_typesize 8ULL; - -#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define sensor_msgs_msg_Imu_max_cdr_typesize 568ULL; -#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_Imu_max_key_cdr_typesize 0ULL; - -sensor_msgs::msg::Imu::Imu() -{ - // std_msgs::msg::Header m_header +namespace sensor_msgs { - // geometry_msgs::msg::Quaternion m_orientation +namespace msg { - // sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_orientation_covariance - memset(&m_orientation_covariance, 0, (9) * 8); - // geometry_msgs::msg::Vector3 m_angular_velocity - // sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_angular_velocity_covariance - memset(&m_angular_velocity_covariance, 0, (9) * 8); - // geometry_msgs::msg::Vector3 m_linear_acceleration - // sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_linear_acceleration_covariance - memset(&m_linear_acceleration_covariance, 0, (9) * 8); +Imu::Imu() +{ } -sensor_msgs::msg::Imu::~Imu() +Imu::~Imu() { } -sensor_msgs::msg::Imu::Imu( +Imu::Imu( const Imu& x) { m_header = x.m_header; @@ -81,7 +63,7 @@ sensor_msgs::msg::Imu::Imu( m_linear_acceleration_covariance = x.m_linear_acceleration_covariance; } -sensor_msgs::msg::Imu::Imu( +Imu::Imu( Imu&& x) noexcept { m_header = std::move(x.m_header); @@ -93,9 +75,10 @@ sensor_msgs::msg::Imu::Imu( m_linear_acceleration_covariance = std::move(x.m_linear_acceleration_covariance); } -sensor_msgs::msg::Imu& sensor_msgs::msg::Imu::operator =( +Imu& Imu::operator =( const Imu& x) { + m_header = x.m_header; m_orientation = x.m_orientation; m_orientation_covariance = x.m_orientation_covariance; @@ -103,13 +86,13 @@ sensor_msgs::msg::Imu& sensor_msgs::msg::Imu::operator =( m_angular_velocity_covariance = x.m_angular_velocity_covariance; m_linear_acceleration = x.m_linear_acceleration; m_linear_acceleration_covariance = x.m_linear_acceleration_covariance; - return *this; } -sensor_msgs::msg::Imu& sensor_msgs::msg::Imu::operator =( +Imu& Imu::operator =( Imu&& x) noexcept { + m_header = std::move(x.m_header); m_orientation = std::move(x.m_orientation); m_orientation_covariance = std::move(x.m_orientation_covariance); @@ -117,74 +100,32 @@ sensor_msgs::msg::Imu& sensor_msgs::msg::Imu::operator =( m_angular_velocity_covariance = std::move(x.m_angular_velocity_covariance); m_linear_acceleration = std::move(x.m_linear_acceleration); m_linear_acceleration_covariance = std::move(x.m_linear_acceleration_covariance); - return *this; } -bool sensor_msgs::msg::Imu::operator ==( +bool Imu::operator ==( const Imu& x) const { - return (m_header == x.m_header && m_orientation == x.m_orientation && m_orientation_covariance == x.m_orientation_covariance && m_angular_velocity == x.m_angular_velocity && m_angular_velocity_covariance == x.m_angular_velocity_covariance && m_linear_acceleration == x.m_linear_acceleration && m_linear_acceleration_covariance == x.m_linear_acceleration_covariance); + return (m_header == x.m_header && + m_orientation == x.m_orientation && + m_orientation_covariance == x.m_orientation_covariance && + m_angular_velocity == x.m_angular_velocity && + m_angular_velocity_covariance == x.m_angular_velocity_covariance && + m_linear_acceleration == x.m_linear_acceleration && + m_linear_acceleration_covariance == x.m_linear_acceleration_covariance); } -bool sensor_msgs::msg::Imu::operator !=( +bool Imu::operator !=( const Imu& x) const { return !(*this == x); } -size_t sensor_msgs::msg::Imu::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_Imu_max_cdr_typesize; -} - -size_t sensor_msgs::msg::Imu::getCdrSerializedSize( - const sensor_msgs::msg::Imu& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += geometry_msgs::msg::Quaternion::getCdrSerializedSize(data.orientation(), current_alignment); - current_alignment += ((9) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.angular_velocity(), current_alignment); - current_alignment += ((9) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += geometry_msgs::msg::Vector3::getCdrSerializedSize(data.linear_acceleration(), current_alignment); - current_alignment += ((9) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - return current_alignment - initial_alignment; -} - -void sensor_msgs::msg::Imu::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - scdr << m_orientation; - scdr << m_orientation_covariance; - scdr << m_angular_velocity; - scdr << m_angular_velocity_covariance; - scdr << m_linear_acceleration; - scdr << m_linear_acceleration_covariance; -} - -void sensor_msgs::msg::Imu::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - dcdr >> m_orientation; - dcdr >> m_orientation_covariance; - dcdr >> m_angular_velocity; - dcdr >> m_angular_velocity_covariance; - dcdr >> m_linear_acceleration; - dcdr >> m_linear_acceleration_covariance; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void sensor_msgs::msg::Imu::header( +void Imu::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -194,7 +135,7 @@ void sensor_msgs::msg::Imu::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void sensor_msgs::msg::Imu::header( +void Imu::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -204,7 +145,7 @@ void sensor_msgs::msg::Imu::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& sensor_msgs::msg::Imu::header() const +const std_msgs::msg::Header& Imu::header() const { return m_header; } @@ -213,16 +154,17 @@ const std_msgs::msg::Header& sensor_msgs::msg::Imu::header() const * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& sensor_msgs::msg::Imu::header() +std_msgs::msg::Header& Imu::header() { return m_header; } + /*! * @brief This function copies the value in member orientation * @param _orientation New value to be copied in member orientation */ -void sensor_msgs::msg::Imu::orientation( +void Imu::orientation( const geometry_msgs::msg::Quaternion& _orientation) { m_orientation = _orientation; @@ -232,7 +174,7 @@ void sensor_msgs::msg::Imu::orientation( * @brief This function moves the value in member orientation * @param _orientation New value to be moved in member orientation */ -void sensor_msgs::msg::Imu::orientation( +void Imu::orientation( geometry_msgs::msg::Quaternion&& _orientation) { m_orientation = std::move(_orientation); @@ -242,7 +184,7 @@ void sensor_msgs::msg::Imu::orientation( * @brief This function returns a constant reference to member orientation * @return Constant reference to member orientation */ -const geometry_msgs::msg::Quaternion& sensor_msgs::msg::Imu::orientation() const +const geometry_msgs::msg::Quaternion& Imu::orientation() const { return m_orientation; } @@ -251,17 +193,18 @@ const geometry_msgs::msg::Quaternion& sensor_msgs::msg::Imu::orientation() const * @brief This function returns a reference to member orientation * @return Reference to member orientation */ -geometry_msgs::msg::Quaternion& sensor_msgs::msg::Imu::orientation() +geometry_msgs::msg::Quaternion& Imu::orientation() { return m_orientation; } + /*! * @brief This function copies the value in member orientation_covariance * @param _orientation_covariance New value to be copied in member orientation_covariance */ -void sensor_msgs::msg::Imu::orientation_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _orientation_covariance) +void Imu::orientation_covariance( + const sensor_msgs::msg::double__9& _orientation_covariance) { m_orientation_covariance = _orientation_covariance; } @@ -270,8 +213,8 @@ void sensor_msgs::msg::Imu::orientation_covariance( * @brief This function moves the value in member orientation_covariance * @param _orientation_covariance New value to be moved in member orientation_covariance */ -void sensor_msgs::msg::Imu::orientation_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _orientation_covariance) +void Imu::orientation_covariance( + sensor_msgs::msg::double__9&& _orientation_covariance) { m_orientation_covariance = std::move(_orientation_covariance); } @@ -280,7 +223,7 @@ void sensor_msgs::msg::Imu::orientation_covariance( * @brief This function returns a constant reference to member orientation_covariance * @return Constant reference to member orientation_covariance */ -const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::orientation_covariance() const +const sensor_msgs::msg::double__9& Imu::orientation_covariance() const { return m_orientation_covariance; } @@ -289,16 +232,17 @@ const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu: * @brief This function returns a reference to member orientation_covariance * @return Reference to member orientation_covariance */ -sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::orientation_covariance() +sensor_msgs::msg::double__9& Imu::orientation_covariance() { return m_orientation_covariance; } + /*! * @brief This function copies the value in member angular_velocity * @param _angular_velocity New value to be copied in member angular_velocity */ -void sensor_msgs::msg::Imu::angular_velocity( +void Imu::angular_velocity( const geometry_msgs::msg::Vector3& _angular_velocity) { m_angular_velocity = _angular_velocity; @@ -308,7 +252,7 @@ void sensor_msgs::msg::Imu::angular_velocity( * @brief This function moves the value in member angular_velocity * @param _angular_velocity New value to be moved in member angular_velocity */ -void sensor_msgs::msg::Imu::angular_velocity( +void Imu::angular_velocity( geometry_msgs::msg::Vector3&& _angular_velocity) { m_angular_velocity = std::move(_angular_velocity); @@ -318,7 +262,7 @@ void sensor_msgs::msg::Imu::angular_velocity( * @brief This function returns a constant reference to member angular_velocity * @return Constant reference to member angular_velocity */ -const geometry_msgs::msg::Vector3& sensor_msgs::msg::Imu::angular_velocity() const +const geometry_msgs::msg::Vector3& Imu::angular_velocity() const { return m_angular_velocity; } @@ -327,17 +271,18 @@ const geometry_msgs::msg::Vector3& sensor_msgs::msg::Imu::angular_velocity() con * @brief This function returns a reference to member angular_velocity * @return Reference to member angular_velocity */ -geometry_msgs::msg::Vector3& sensor_msgs::msg::Imu::angular_velocity() +geometry_msgs::msg::Vector3& Imu::angular_velocity() { return m_angular_velocity; } + /*! * @brief This function copies the value in member angular_velocity_covariance * @param _angular_velocity_covariance New value to be copied in member angular_velocity_covariance */ -void sensor_msgs::msg::Imu::angular_velocity_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _angular_velocity_covariance) +void Imu::angular_velocity_covariance( + const sensor_msgs::msg::double__9& _angular_velocity_covariance) { m_angular_velocity_covariance = _angular_velocity_covariance; } @@ -346,8 +291,8 @@ void sensor_msgs::msg::Imu::angular_velocity_covariance( * @brief This function moves the value in member angular_velocity_covariance * @param _angular_velocity_covariance New value to be moved in member angular_velocity_covariance */ -void sensor_msgs::msg::Imu::angular_velocity_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _angular_velocity_covariance) +void Imu::angular_velocity_covariance( + sensor_msgs::msg::double__9&& _angular_velocity_covariance) { m_angular_velocity_covariance = std::move(_angular_velocity_covariance); } @@ -356,7 +301,7 @@ void sensor_msgs::msg::Imu::angular_velocity_covariance( * @brief This function returns a constant reference to member angular_velocity_covariance * @return Constant reference to member angular_velocity_covariance */ -const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::angular_velocity_covariance() const +const sensor_msgs::msg::double__9& Imu::angular_velocity_covariance() const { return m_angular_velocity_covariance; } @@ -365,16 +310,17 @@ const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu: * @brief This function returns a reference to member angular_velocity_covariance * @return Reference to member angular_velocity_covariance */ -sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::angular_velocity_covariance() +sensor_msgs::msg::double__9& Imu::angular_velocity_covariance() { return m_angular_velocity_covariance; } + /*! * @brief This function copies the value in member linear_acceleration * @param _linear_acceleration New value to be copied in member linear_acceleration */ -void sensor_msgs::msg::Imu::linear_acceleration( +void Imu::linear_acceleration( const geometry_msgs::msg::Vector3& _linear_acceleration) { m_linear_acceleration = _linear_acceleration; @@ -384,7 +330,7 @@ void sensor_msgs::msg::Imu::linear_acceleration( * @brief This function moves the value in member linear_acceleration * @param _linear_acceleration New value to be moved in member linear_acceleration */ -void sensor_msgs::msg::Imu::linear_acceleration( +void Imu::linear_acceleration( geometry_msgs::msg::Vector3&& _linear_acceleration) { m_linear_acceleration = std::move(_linear_acceleration); @@ -394,7 +340,7 @@ void sensor_msgs::msg::Imu::linear_acceleration( * @brief This function returns a constant reference to member linear_acceleration * @return Constant reference to member linear_acceleration */ -const geometry_msgs::msg::Vector3& sensor_msgs::msg::Imu::linear_acceleration() const +const geometry_msgs::msg::Vector3& Imu::linear_acceleration() const { return m_linear_acceleration; } @@ -403,17 +349,18 @@ const geometry_msgs::msg::Vector3& sensor_msgs::msg::Imu::linear_acceleration() * @brief This function returns a reference to member linear_acceleration * @return Reference to member linear_acceleration */ -geometry_msgs::msg::Vector3& sensor_msgs::msg::Imu::linear_acceleration() +geometry_msgs::msg::Vector3& Imu::linear_acceleration() { return m_linear_acceleration; } + /*! * @brief This function copies the value in member linear_acceleration_covariance * @param _linear_acceleration_covariance New value to be copied in member linear_acceleration_covariance */ -void sensor_msgs::msg::Imu::linear_acceleration_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _linear_acceleration_covariance) +void Imu::linear_acceleration_covariance( + const sensor_msgs::msg::double__9& _linear_acceleration_covariance) { m_linear_acceleration_covariance = _linear_acceleration_covariance; } @@ -422,8 +369,8 @@ void sensor_msgs::msg::Imu::linear_acceleration_covariance( * @brief This function moves the value in member linear_acceleration_covariance * @param _linear_acceleration_covariance New value to be moved in member linear_acceleration_covariance */ -void sensor_msgs::msg::Imu::linear_acceleration_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _linear_acceleration_covariance) +void Imu::linear_acceleration_covariance( + sensor_msgs::msg::double__9&& _linear_acceleration_covariance) { m_linear_acceleration_covariance = std::move(_linear_acceleration_covariance); } @@ -432,7 +379,7 @@ void sensor_msgs::msg::Imu::linear_acceleration_covariance( * @brief This function returns a constant reference to member linear_acceleration_covariance * @return Constant reference to member linear_acceleration_covariance */ -const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::linear_acceleration_covariance() const +const sensor_msgs::msg::double__9& Imu::linear_acceleration_covariance() const { return m_linear_acceleration_covariance; } @@ -441,25 +388,18 @@ const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu: * @brief This function returns a reference to member linear_acceleration_covariance * @return Reference to member linear_acceleration_covariance */ -sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::linear_acceleration_covariance() +sensor_msgs::msg::double__9& Imu::linear_acceleration_covariance() { return m_linear_acceleration_covariance; } -size_t sensor_msgs::msg::Imu::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_Imu_max_key_cdr_typesize; -} -bool sensor_msgs::msg::Imu::isKeyDefined() -{ - return false; -} -void sensor_msgs::msg::Imu::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace sensor_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "ImuCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.h index 59a1a5ec242..3440b6ba54b 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/Imu.h @@ -16,28 +16,31 @@ * @file Imu.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ -#include "geometry_msgs/msg/Quaternion.h" -#include "geometry_msgs/msg/Vector3.h" -#include "std_msgs/msg/Header.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "geometry_msgs/msg/Vector3.h" +#include "geometry_msgs/msg/Quaternion.h" +#include "std_msgs/msg/Header.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -47,306 +50,300 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Imu_SOURCE) -#define Imu_DllAPI __declspec(dllexport) +#if defined(IMU_SOURCE) +#define IMU_DllAPI __declspec( dllexport ) #else -#define Imu_DllAPI __declspec(dllimport) -#endif // Imu_SOURCE +#define IMU_DllAPI __declspec( dllimport ) +#endif // IMU_SOURCE #else -#define Imu_DllAPI +#define IMU_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Imu_DllAPI -#endif // _WIN32 +#define IMU_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace sensor_msgs { + namespace msg { -typedef std::array sensor_msgs__Imu__double_array_9; + +typedef std::array double__9; + + + /*! * @brief This class represents the structure Imu defined by the user in the IDL file. - * @ingroup IMU + * @ingroup Imu */ -class Imu { +class Imu +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Imu(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Imu(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. - */ - eProsima_user_DllExport Imu(const Imu& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. - */ - eProsima_user_DllExport Imu(Imu&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. - */ - eProsima_user_DllExport Imu& operator=(const Imu& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. - */ - eProsima_user_DllExport Imu& operator=(Imu&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::Imu object to compare. - */ - eProsima_user_DllExport bool operator==(const Imu& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::Imu object to compare. - */ - eProsima_user_DllExport bool operator!=(const Imu& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member orientation - * @param _orientation New value to be copied in member orientation - */ - eProsima_user_DllExport void orientation(const geometry_msgs::msg::Quaternion& _orientation); - - /*! - * @brief This function moves the value in member orientation - * @param _orientation New value to be moved in member orientation - */ - eProsima_user_DllExport void orientation(geometry_msgs::msg::Quaternion&& _orientation); - - /*! - * @brief This function returns a constant reference to member orientation - * @return Constant reference to member orientation - */ - eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; - - /*! - * @brief This function returns a reference to member orientation - * @return Reference to member orientation - */ - eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); - /*! - * @brief This function copies the value in member orientation_covariance - * @param _orientation_covariance New value to be copied in member orientation_covariance - */ - eProsima_user_DllExport void orientation_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _orientation_covariance); - - /*! - * @brief This function moves the value in member orientation_covariance - * @param _orientation_covariance New value to be moved in member orientation_covariance - */ - eProsima_user_DllExport void orientation_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _orientation_covariance); - - /*! - * @brief This function returns a constant reference to member orientation_covariance - * @return Constant reference to member orientation_covariance - */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& orientation_covariance() const; - - /*! - * @brief This function returns a reference to member orientation_covariance - * @return Reference to member orientation_covariance - */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& orientation_covariance(); - /*! - * @brief This function copies the value in member angular_velocity - * @param _angular_velocity New value to be copied in member angular_velocity - */ - eProsima_user_DllExport void angular_velocity(const geometry_msgs::msg::Vector3& _angular_velocity); - - /*! - * @brief This function moves the value in member angular_velocity - * @param _angular_velocity New value to be moved in member angular_velocity - */ - eProsima_user_DllExport void angular_velocity(geometry_msgs::msg::Vector3&& _angular_velocity); - - /*! - * @brief This function returns a constant reference to member angular_velocity - * @return Constant reference to member angular_velocity - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular_velocity() const; - - /*! - * @brief This function returns a reference to member angular_velocity - * @return Reference to member angular_velocity - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& angular_velocity(); - /*! - * @brief This function copies the value in member angular_velocity_covariance - * @param _angular_velocity_covariance New value to be copied in member angular_velocity_covariance - */ - eProsima_user_DllExport void angular_velocity_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _angular_velocity_covariance); - - /*! - * @brief This function moves the value in member angular_velocity_covariance - * @param _angular_velocity_covariance New value to be moved in member angular_velocity_covariance - */ - eProsima_user_DllExport void angular_velocity_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _angular_velocity_covariance); - - /*! - * @brief This function returns a constant reference to member angular_velocity_covariance - * @return Constant reference to member angular_velocity_covariance - */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& angular_velocity_covariance() const; - - /*! - * @brief This function returns a reference to member angular_velocity_covariance - * @return Reference to member angular_velocity_covariance - */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& angular_velocity_covariance(); - /*! - * @brief This function copies the value in member linear_acceleration - * @param _linear_acceleration New value to be copied in member linear_acceleration - */ - eProsima_user_DllExport void linear_acceleration(const geometry_msgs::msg::Vector3& _linear_acceleration); - - /*! - * @brief This function moves the value in member linear_acceleration - * @param _linear_acceleration New value to be moved in member linear_acceleration - */ - eProsima_user_DllExport void linear_acceleration(geometry_msgs::msg::Vector3&& _linear_acceleration); - - /*! - * @brief This function returns a constant reference to member linear_acceleration - * @return Constant reference to member linear_acceleration - */ - eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear_acceleration() const; - - /*! - * @brief This function returns a reference to member linear_acceleration - * @return Reference to member linear_acceleration - */ - eProsima_user_DllExport geometry_msgs::msg::Vector3& linear_acceleration(); - /*! - * @brief This function copies the value in member linear_acceleration_covariance - * @param _linear_acceleration_covariance New value to be copied in member linear_acceleration_covariance - */ - eProsima_user_DllExport void linear_acceleration_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _linear_acceleration_covariance); - - /*! - * @brief This function moves the value in member linear_acceleration_covariance - * @param _linear_acceleration_covariance New value to be moved in member linear_acceleration_covariance - */ - eProsima_user_DllExport void linear_acceleration_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _linear_acceleration_covariance); - - /*! - * @brief This function returns a constant reference to member linear_acceleration_covariance - * @return Constant reference to member linear_acceleration_covariance - */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& linear_acceleration_covariance() - const; - - /*! - * @brief This function returns a reference to member linear_acceleration_covariance - * @return Reference to member linear_acceleration_covariance - */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& linear_acceleration_covariance(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::Imu& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Imu(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Imu(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. + */ + eProsima_user_DllExport Imu( + const Imu& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. + */ + eProsima_user_DllExport Imu( + Imu&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. + */ + eProsima_user_DllExport Imu& operator =( + const Imu& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::Imu that will be copied. + */ + eProsima_user_DllExport Imu& operator =( + Imu&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::Imu object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Imu& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::Imu object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Imu& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member orientation + * @param _orientation New value to be copied in member orientation + */ + eProsima_user_DllExport void orientation( + const geometry_msgs::msg::Quaternion& _orientation); + + /*! + * @brief This function moves the value in member orientation + * @param _orientation New value to be moved in member orientation + */ + eProsima_user_DllExport void orientation( + geometry_msgs::msg::Quaternion&& _orientation); + + /*! + * @brief This function returns a constant reference to member orientation + * @return Constant reference to member orientation + */ + eProsima_user_DllExport const geometry_msgs::msg::Quaternion& orientation() const; + + /*! + * @brief This function returns a reference to member orientation + * @return Reference to member orientation + */ + eProsima_user_DllExport geometry_msgs::msg::Quaternion& orientation(); + + + /*! + * @brief This function copies the value in member orientation_covariance + * @param _orientation_covariance New value to be copied in member orientation_covariance + */ + eProsima_user_DllExport void orientation_covariance( + const sensor_msgs::msg::double__9& _orientation_covariance); + + /*! + * @brief This function moves the value in member orientation_covariance + * @param _orientation_covariance New value to be moved in member orientation_covariance + */ + eProsima_user_DllExport void orientation_covariance( + sensor_msgs::msg::double__9&& _orientation_covariance); + + /*! + * @brief This function returns a constant reference to member orientation_covariance + * @return Constant reference to member orientation_covariance + */ + eProsima_user_DllExport const sensor_msgs::msg::double__9& orientation_covariance() const; + + /*! + * @brief This function returns a reference to member orientation_covariance + * @return Reference to member orientation_covariance + */ + eProsima_user_DllExport sensor_msgs::msg::double__9& orientation_covariance(); + + + /*! + * @brief This function copies the value in member angular_velocity + * @param _angular_velocity New value to be copied in member angular_velocity + */ + eProsima_user_DllExport void angular_velocity( + const geometry_msgs::msg::Vector3& _angular_velocity); + + /*! + * @brief This function moves the value in member angular_velocity + * @param _angular_velocity New value to be moved in member angular_velocity + */ + eProsima_user_DllExport void angular_velocity( + geometry_msgs::msg::Vector3&& _angular_velocity); + + /*! + * @brief This function returns a constant reference to member angular_velocity + * @return Constant reference to member angular_velocity + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& angular_velocity() const; + + /*! + * @brief This function returns a reference to member angular_velocity + * @return Reference to member angular_velocity + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& angular_velocity(); + + + /*! + * @brief This function copies the value in member angular_velocity_covariance + * @param _angular_velocity_covariance New value to be copied in member angular_velocity_covariance + */ + eProsima_user_DllExport void angular_velocity_covariance( + const sensor_msgs::msg::double__9& _angular_velocity_covariance); + + /*! + * @brief This function moves the value in member angular_velocity_covariance + * @param _angular_velocity_covariance New value to be moved in member angular_velocity_covariance + */ + eProsima_user_DllExport void angular_velocity_covariance( + sensor_msgs::msg::double__9&& _angular_velocity_covariance); + + /*! + * @brief This function returns a constant reference to member angular_velocity_covariance + * @return Constant reference to member angular_velocity_covariance + */ + eProsima_user_DllExport const sensor_msgs::msg::double__9& angular_velocity_covariance() const; + + /*! + * @brief This function returns a reference to member angular_velocity_covariance + * @return Reference to member angular_velocity_covariance + */ + eProsima_user_DllExport sensor_msgs::msg::double__9& angular_velocity_covariance(); + + + /*! + * @brief This function copies the value in member linear_acceleration + * @param _linear_acceleration New value to be copied in member linear_acceleration + */ + eProsima_user_DllExport void linear_acceleration( + const geometry_msgs::msg::Vector3& _linear_acceleration); + + /*! + * @brief This function moves the value in member linear_acceleration + * @param _linear_acceleration New value to be moved in member linear_acceleration + */ + eProsima_user_DllExport void linear_acceleration( + geometry_msgs::msg::Vector3&& _linear_acceleration); + + /*! + * @brief This function returns a constant reference to member linear_acceleration + * @return Constant reference to member linear_acceleration + */ + eProsima_user_DllExport const geometry_msgs::msg::Vector3& linear_acceleration() const; + + /*! + * @brief This function returns a reference to member linear_acceleration + * @return Reference to member linear_acceleration + */ + eProsima_user_DllExport geometry_msgs::msg::Vector3& linear_acceleration(); + + + /*! + * @brief This function copies the value in member linear_acceleration_covariance + * @param _linear_acceleration_covariance New value to be copied in member linear_acceleration_covariance + */ + eProsima_user_DllExport void linear_acceleration_covariance( + const sensor_msgs::msg::double__9& _linear_acceleration_covariance); + + /*! + * @brief This function moves the value in member linear_acceleration_covariance + * @param _linear_acceleration_covariance New value to be moved in member linear_acceleration_covariance + */ + eProsima_user_DllExport void linear_acceleration_covariance( + sensor_msgs::msg::double__9&& _linear_acceleration_covariance); + + /*! + * @brief This function returns a constant reference to member linear_acceleration_covariance + * @return Constant reference to member linear_acceleration_covariance + */ + eProsima_user_DllExport const sensor_msgs::msg::double__9& linear_acceleration_covariance() const; + + /*! + * @brief This function returns a reference to member linear_acceleration_covariance + * @return Reference to member linear_acceleration_covariance + */ + eProsima_user_DllExport sensor_msgs::msg::double__9& linear_acceleration_covariance(); private: - std_msgs::msg::Header m_header; - geometry_msgs::msg::Quaternion m_orientation; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_orientation_covariance; - geometry_msgs::msg::Vector3 m_angular_velocity; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_angular_velocity_covariance; - geometry_msgs::msg::Vector3 m_linear_acceleration; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_linear_acceleration_covariance; + + std_msgs::msg::Header m_header; + geometry_msgs::msg::Quaternion m_orientation; + sensor_msgs::msg::double__9 m_orientation_covariance{0.0}; + geometry_msgs::msg::Vector3 m_angular_velocity; + sensor_msgs::msg::double__9 m_angular_velocity_covariance{0.0}; + geometry_msgs::msg::Vector3 m_linear_acceleration; + sensor_msgs::msg::double__9 m_linear_acceleration_covariance{0.0}; + }; -} // namespace msg -} // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ +} // namespace msg + +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuCdrAux.hpp new file mode 100644 index 00000000000..3ea714c7465 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuCdrAux.hpp @@ -0,0 +1,52 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImuCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMUCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMUCDRAUX_HPP_ + +#include "Imu.h" + +constexpr uint32_t sensor_msgs_msg_Imu_max_cdr_typesize {600UL}; +constexpr uint32_t sensor_msgs_msg_Imu_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::Imu& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMUCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuCdrAux.ipp new file mode 100644 index 00000000000..a8eeec8869c --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuCdrAux.ipp @@ -0,0 +1,180 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ImuCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMUCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMUCDRAUX_IPP_ + +#include "ImuCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::Imu& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.orientation(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.orientation_covariance(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.angular_velocity(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.angular_velocity_covariance(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.linear_acceleration(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.linear_acceleration_covariance(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::Imu& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.orientation() + << eprosima::fastcdr::MemberId(2) << data.orientation_covariance() + << eprosima::fastcdr::MemberId(3) << data.angular_velocity() + << eprosima::fastcdr::MemberId(4) << data.angular_velocity_covariance() + << eprosima::fastcdr::MemberId(5) << data.linear_acceleration() + << eprosima::fastcdr::MemberId(6) << data.linear_acceleration_covariance() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::Imu& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.orientation(); + break; + + case 2: + dcdr >> data.orientation_covariance(); + break; + + case 3: + dcdr >> data.angular_velocity(); + break; + + case 4: + dcdr >> data.angular_velocity_covariance(); + break; + + case 5: + dcdr >> data.linear_acceleration(); + break; + + case 6: + dcdr >> data.linear_acceleration_covariance(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::Imu& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMUCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.cxx index 865d455d0c8..accffceea2a 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.cxx @@ -16,158 +16,185 @@ * @file ImuPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "ImuPubSubTypes.h" +#include "ImuCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace sensor_msgs { - namespace msg { - - ImuPubSubType::ImuPubSubType() - { - setName("sensor_msgs::msg::dds_::Imu_"); - auto type_size = Imu::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Imu::isKeyDefined(); - size_t keyLength = Imu::getKeyMaxCdrSerializedSize() > 16 ? - Imu::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - ImuPubSubType::~ImuPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool ImuPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Imu* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool ImuPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - Imu* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function ImuPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* ImuPubSubType::createData() - { - return reinterpret_cast(new Imu()); - } - - void ImuPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool ImuPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Imu* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Imu::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Imu::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + + + +ImuPubSubType::ImuPubSubType() +{ + setName("sensor_msgs::msg::dds_::Imu_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Imu::getMaxCdrSerializedSize()); +#else + sensor_msgs_msg_Imu_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +ImuPubSubType::~ImuPubSubType() +{ +} + +bool ImuPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Imu* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool ImuPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Imu* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function ImuPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* ImuPubSubType::createData() +{ + return reinterpret_cast(new Imu()); +} + +void ImuPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ImuPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.h index b4ecc2150df..5e67efeb06c 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/ImuPubSubTypes.h @@ -16,81 +16,124 @@ * @file ImuPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "Imu.h" -#include "geometry_msgs/msg/QuaternionPubSubTypes.h" #include "geometry_msgs/msg/Vector3PubSubTypes.h" +#include "geometry_msgs/msg/QuaternionPubSubTypes.h" #include "std_msgs/msg/HeaderPubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Imu is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Imu is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace sensor_msgs { namespace msg { -typedef std::array sensor_msgs__Imu__double_array_9; +typedef std::array double__9; + + /*! * @brief This class represents the TopicDataType of the type Imu defined by the user in the IDL file. - * @ingroup IMU + * @ingroup Imu */ -class ImuPubSubType : public eprosima::fastdds::dds::TopicDataType { +class ImuPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef Imu type; - eProsima_user_DllExport ImuPubSubType(); + typedef Imu type; + + eProsima_user_DllExport ImuPubSubType(); + + eProsima_user_DllExport ~ImuPubSubType() override; - eProsima_user_DllExport virtual ~ImuPubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; + }; } // namespace msg } // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.cxx index db462c96231..75ff43485e1 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.cxx @@ -14,9 +14,9 @@ /*! * @file NavSatFix.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,46 +27,35 @@ char dummy; #endif // _WIN32 #include "NavSatFix.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define std_msgs_msg_Time_max_cdr_typesize 8ULL; -#define sensor_msgs_msg_NavSatStatus_max_cdr_typesize 4ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define sensor_msgs_msg_NavSatFix_max_cdr_typesize 369ULL; -#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_NavSatStatus_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_NavSatFix_max_key_cdr_typesize 0ULL; +namespace sensor_msgs { -sensor_msgs::msg::NavSatFix::NavSatFix() -{ - // std_msgs::msg::Header m_header +namespace msg { + +namespace NavSatFix_Constants { + + +} // namespace NavSatFix_Constants - // sensor_msgs::msg::NavSatStatus m_status - // double m_latitude - m_latitude = 0.0; - // double m_longitude - m_longitude = 0.0; - // double m_altitude - m_altitude = 0.0; - // sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9 m_position_covariance - memset(&m_position_covariance, 0, (9) * 8); - // octet m_position_covariance_type - m_position_covariance_type = 0; +NavSatFix::NavSatFix() +{ } -sensor_msgs::msg::NavSatFix::~NavSatFix() +NavSatFix::~NavSatFix() { } -sensor_msgs::msg::NavSatFix::NavSatFix( +NavSatFix::NavSatFix( const NavSatFix& x) { m_header = x.m_header; @@ -78,7 +67,7 @@ sensor_msgs::msg::NavSatFix::NavSatFix( m_position_covariance_type = x.m_position_covariance_type; } -sensor_msgs::msg::NavSatFix::NavSatFix( +NavSatFix::NavSatFix( NavSatFix&& x) noexcept { m_header = std::move(x.m_header); @@ -90,9 +79,10 @@ sensor_msgs::msg::NavSatFix::NavSatFix( m_position_covariance_type = x.m_position_covariance_type; } -sensor_msgs::msg::NavSatFix& sensor_msgs::msg::NavSatFix::operator =( +NavSatFix& NavSatFix::operator =( const NavSatFix& x) { + m_header = x.m_header; m_status = x.m_status; m_latitude = x.m_latitude; @@ -100,13 +90,13 @@ sensor_msgs::msg::NavSatFix& sensor_msgs::msg::NavSatFix::operator =( m_altitude = x.m_altitude; m_position_covariance = x.m_position_covariance; m_position_covariance_type = x.m_position_covariance_type; - return *this; } -sensor_msgs::msg::NavSatFix& sensor_msgs::msg::NavSatFix::operator =( +NavSatFix& NavSatFix::operator =( NavSatFix&& x) noexcept { + m_header = std::move(x.m_header); m_status = std::move(x.m_status); m_latitude = x.m_latitude; @@ -114,74 +104,32 @@ sensor_msgs::msg::NavSatFix& sensor_msgs::msg::NavSatFix::operator =( m_altitude = x.m_altitude; m_position_covariance = std::move(x.m_position_covariance); m_position_covariance_type = x.m_position_covariance_type; - return *this; } -bool sensor_msgs::msg::NavSatFix::operator ==( +bool NavSatFix::operator ==( const NavSatFix& x) const { - return (m_header == x.m_header && m_status == x.m_status && m_latitude == x.m_latitude && m_longitude == x.m_longitude && m_altitude == x.m_altitude && m_position_covariance == x.m_position_covariance && m_position_covariance_type == x.m_position_covariance_type); + return (m_header == x.m_header && + m_status == x.m_status && + m_latitude == x.m_latitude && + m_longitude == x.m_longitude && + m_altitude == x.m_altitude && + m_position_covariance == x.m_position_covariance && + m_position_covariance_type == x.m_position_covariance_type); } -bool sensor_msgs::msg::NavSatFix::operator !=( +bool NavSatFix::operator !=( const NavSatFix& x) const { return !(*this == x); } -size_t sensor_msgs::msg::NavSatFix::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_NavSatFix_max_cdr_typesize; -} - -size_t sensor_msgs::msg::NavSatFix::getCdrSerializedSize( - const sensor_msgs::msg::NavSatFix& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += sensor_msgs::msg::NavSatStatus::getCdrSerializedSize(data.status(), current_alignment); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += ((9) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; -} - -void sensor_msgs::msg::NavSatFix::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_header; - scdr << m_status; - scdr << m_latitude; - scdr << m_longitude; - scdr << m_altitude; - scdr << m_position_covariance; - scdr << m_position_covariance_type; -} - -void sensor_msgs::msg::NavSatFix::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_header; - dcdr >> m_status; - dcdr >> m_latitude; - dcdr >> m_longitude; - dcdr >> m_altitude; - dcdr >> m_position_covariance; - dcdr >> m_position_covariance_type; -} - /*! * @brief This function copies the value in member header * @param _header New value to be copied in member header */ -void sensor_msgs::msg::NavSatFix::header( +void NavSatFix::header( const std_msgs::msg::Header& _header) { m_header = _header; @@ -191,7 +139,7 @@ void sensor_msgs::msg::NavSatFix::header( * @brief This function moves the value in member header * @param _header New value to be moved in member header */ -void sensor_msgs::msg::NavSatFix::header( +void NavSatFix::header( std_msgs::msg::Header&& _header) { m_header = std::move(_header); @@ -201,7 +149,7 @@ void sensor_msgs::msg::NavSatFix::header( * @brief This function returns a constant reference to member header * @return Constant reference to member header */ -const std_msgs::msg::Header& sensor_msgs::msg::NavSatFix::header() const +const std_msgs::msg::Header& NavSatFix::header() const { return m_header; } @@ -210,16 +158,17 @@ const std_msgs::msg::Header& sensor_msgs::msg::NavSatFix::header() const * @brief This function returns a reference to member header * @return Reference to member header */ -std_msgs::msg::Header& sensor_msgs::msg::NavSatFix::header() +std_msgs::msg::Header& NavSatFix::header() { return m_header; } + /*! * @brief This function copies the value in member status * @param _status New value to be copied in member status */ -void sensor_msgs::msg::NavSatFix::status( +void NavSatFix::status( const sensor_msgs::msg::NavSatStatus& _status) { m_status = _status; @@ -229,7 +178,7 @@ void sensor_msgs::msg::NavSatFix::status( * @brief This function moves the value in member status * @param _status New value to be moved in member status */ -void sensor_msgs::msg::NavSatFix::status( +void NavSatFix::status( sensor_msgs::msg::NavSatStatus&& _status) { m_status = std::move(_status); @@ -239,7 +188,7 @@ void sensor_msgs::msg::NavSatFix::status( * @brief This function returns a constant reference to member status * @return Constant reference to member status */ -const sensor_msgs::msg::NavSatStatus& sensor_msgs::msg::NavSatFix::status() const +const sensor_msgs::msg::NavSatStatus& NavSatFix::status() const { return m_status; } @@ -248,16 +197,17 @@ const sensor_msgs::msg::NavSatStatus& sensor_msgs::msg::NavSatFix::status() cons * @brief This function returns a reference to member status * @return Reference to member status */ -sensor_msgs::msg::NavSatStatus& sensor_msgs::msg::NavSatFix::status() +sensor_msgs::msg::NavSatStatus& NavSatFix::status() { return m_status; } + /*! * @brief This function sets a value in member latitude * @param _latitude New value for member latitude */ -void sensor_msgs::msg::NavSatFix::latitude( +void NavSatFix::latitude( double _latitude) { m_latitude = _latitude; @@ -267,7 +217,7 @@ void sensor_msgs::msg::NavSatFix::latitude( * @brief This function returns the value of member latitude * @return Value of member latitude */ -double sensor_msgs::msg::NavSatFix::latitude() const +double NavSatFix::latitude() const { return m_latitude; } @@ -276,16 +226,17 @@ double sensor_msgs::msg::NavSatFix::latitude() const * @brief This function returns a reference to member latitude * @return Reference to member latitude */ -double& sensor_msgs::msg::NavSatFix::latitude() +double& NavSatFix::latitude() { return m_latitude; } + /*! * @brief This function sets a value in member longitude * @param _longitude New value for member longitude */ -void sensor_msgs::msg::NavSatFix::longitude( +void NavSatFix::longitude( double _longitude) { m_longitude = _longitude; @@ -295,7 +246,7 @@ void sensor_msgs::msg::NavSatFix::longitude( * @brief This function returns the value of member longitude * @return Value of member longitude */ -double sensor_msgs::msg::NavSatFix::longitude() const +double NavSatFix::longitude() const { return m_longitude; } @@ -304,16 +255,17 @@ double sensor_msgs::msg::NavSatFix::longitude() const * @brief This function returns a reference to member longitude * @return Reference to member longitude */ -double& sensor_msgs::msg::NavSatFix::longitude() +double& NavSatFix::longitude() { return m_longitude; } + /*! * @brief This function sets a value in member altitude * @param _altitude New value for member altitude */ -void sensor_msgs::msg::NavSatFix::altitude( +void NavSatFix::altitude( double _altitude) { m_altitude = _altitude; @@ -323,7 +275,7 @@ void sensor_msgs::msg::NavSatFix::altitude( * @brief This function returns the value of member altitude * @return Value of member altitude */ -double sensor_msgs::msg::NavSatFix::altitude() const +double NavSatFix::altitude() const { return m_altitude; } @@ -332,17 +284,18 @@ double sensor_msgs::msg::NavSatFix::altitude() const * @brief This function returns a reference to member altitude * @return Reference to member altitude */ -double& sensor_msgs::msg::NavSatFix::altitude() +double& NavSatFix::altitude() { return m_altitude; } + /*! * @brief This function copies the value in member position_covariance * @param _position_covariance New value to be copied in member position_covariance */ -void sensor_msgs::msg::NavSatFix::position_covariance( - const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& _position_covariance) +void NavSatFix::position_covariance( + const sensor_msgs::msg::double__9& _position_covariance) { m_position_covariance = _position_covariance; } @@ -351,8 +304,8 @@ void sensor_msgs::msg::NavSatFix::position_covariance( * @brief This function moves the value in member position_covariance * @param _position_covariance New value to be moved in member position_covariance */ -void sensor_msgs::msg::NavSatFix::position_covariance( - sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9&& _position_covariance) +void NavSatFix::position_covariance( + sensor_msgs::msg::double__9&& _position_covariance) { m_position_covariance = std::move(_position_covariance); } @@ -361,7 +314,7 @@ void sensor_msgs::msg::NavSatFix::position_covariance( * @brief This function returns a constant reference to member position_covariance * @return Constant reference to member position_covariance */ -const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& sensor_msgs::msg::NavSatFix::position_covariance() const +const sensor_msgs::msg::double__9& NavSatFix::position_covariance() const { return m_position_covariance; } @@ -370,15 +323,17 @@ const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& sensor_msgs::msg * @brief This function returns a reference to member position_covariance * @return Reference to member position_covariance */ -sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& sensor_msgs::msg::NavSatFix::position_covariance() +sensor_msgs::msg::double__9& NavSatFix::position_covariance() { return m_position_covariance; } + + /*! * @brief This function sets a value in member position_covariance_type * @param _position_covariance_type New value for member position_covariance_type */ -void sensor_msgs::msg::NavSatFix::position_covariance_type( +void NavSatFix::position_covariance_type( uint8_t _position_covariance_type) { m_position_covariance_type = _position_covariance_type; @@ -388,7 +343,7 @@ void sensor_msgs::msg::NavSatFix::position_covariance_type( * @brief This function returns the value of member position_covariance_type * @return Value of member position_covariance_type */ -uint8_t sensor_msgs::msg::NavSatFix::position_covariance_type() const +uint8_t NavSatFix::position_covariance_type() const { return m_position_covariance_type; } @@ -397,25 +352,18 @@ uint8_t sensor_msgs::msg::NavSatFix::position_covariance_type() const * @brief This function returns a reference to member position_covariance_type * @return Reference to member position_covariance_type */ -uint8_t& sensor_msgs::msg::NavSatFix::position_covariance_type() +uint8_t& NavSatFix::position_covariance_type() { return m_position_covariance_type; } -size_t sensor_msgs::msg::NavSatFix::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_NavSatFix_max_key_cdr_typesize; -} -bool sensor_msgs::msg::NavSatFix::isKeyDefined() -{ - return false; -} -void sensor_msgs::msg::NavSatFix::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace sensor_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "NavSatFixCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.h index 64985f357b4..8b565bbe162 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFix.h @@ -16,27 +16,30 @@ * @file NavSatFix.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ -#include "NavSatStatus.h" -#include "std_msgs/msg/Header.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "std_msgs/msg/Header.h" +#include "NavSatStatus.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -46,284 +49,280 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(NavSatFix_SOURCE) -#define NavSatFix_DllAPI __declspec(dllexport) +#if defined(NAVSATFIX_SOURCE) +#define NAVSATFIX_DllAPI __declspec( dllexport ) #else -#define NavSatFix_DllAPI __declspec(dllimport) -#endif // NavSatFix_SOURCE +#define NAVSATFIX_DllAPI __declspec( dllimport ) +#endif // NAVSATFIX_SOURCE #else -#define NavSatFix_DllAPI +#define NAVSATFIX_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define NavSatFix_DllAPI -#endif // _WIN32 +#define NAVSATFIX_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace sensor_msgs { + namespace msg { -const uint8_t NavSatFix__COVARIANCE_TYPE_UNKNOWN = 0; -const uint8_t NavSatFix__COVARIANCE_TYPE_APPROXIMATED = 1; -const uint8_t NavSatFix__COVARIANCE_TYPE_DIAGONAL_KNOWN = 2; -const uint8_t NavSatFix__COVARIANCE_TYPE_KNOWN = 3; -typedef std::array sensor_msgs__NavSatFix__double_array_9; + +typedef std::array double__9; + +namespace NavSatFix_Constants { + +const uint8_t COVARIANCE_TYPE_UNKNOWN = 0; +const uint8_t COVARIANCE_TYPE_APPROXIMATED = 1; +const uint8_t COVARIANCE_TYPE_DIAGONAL_KNOWN = 2; +const uint8_t COVARIANCE_TYPE_KNOWN = 3; + +} // namespace NavSatFix_Constants + + /*! * @brief This class represents the structure NavSatFix defined by the user in the IDL file. - * @ingroup NAVSATFIX + * @ingroup NavSatFix */ -class NavSatFix { +class NavSatFix +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport NavSatFix(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~NavSatFix(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. - */ - eProsima_user_DllExport NavSatFix(const NavSatFix& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. - */ - eProsima_user_DllExport NavSatFix(NavSatFix&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. - */ - eProsima_user_DllExport NavSatFix& operator=(const NavSatFix& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. - */ - eProsima_user_DllExport NavSatFix& operator=(NavSatFix&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::NavSatFix object to compare. - */ - eProsima_user_DllExport bool operator==(const NavSatFix& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::NavSatFix object to compare. - */ - eProsima_user_DllExport bool operator!=(const NavSatFix& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function copies the value in member status - * @param _status New value to be copied in member status - */ - eProsima_user_DllExport void status(const sensor_msgs::msg::NavSatStatus& _status); - - /*! - * @brief This function moves the value in member status - * @param _status New value to be moved in member status - */ - eProsima_user_DllExport void status(sensor_msgs::msg::NavSatStatus&& _status); - - /*! - * @brief This function returns a constant reference to member status - * @return Constant reference to member status - */ - eProsima_user_DllExport const sensor_msgs::msg::NavSatStatus& status() const; - - /*! - * @brief This function returns a reference to member status - * @return Reference to member status - */ - eProsima_user_DllExport sensor_msgs::msg::NavSatStatus& status(); - /*! - * @brief This function sets a value in member latitude - * @param _latitude New value for member latitude - */ - eProsima_user_DllExport void latitude(double _latitude); - - /*! - * @brief This function returns the value of member latitude - * @return Value of member latitude - */ - eProsima_user_DllExport double latitude() const; - - /*! - * @brief This function returns a reference to member latitude - * @return Reference to member latitude - */ - eProsima_user_DllExport double& latitude(); - - /*! - * @brief This function sets a value in member longitude - * @param _longitude New value for member longitude - */ - eProsima_user_DllExport void longitude(double _longitude); - - /*! - * @brief This function returns the value of member longitude - * @return Value of member longitude - */ - eProsima_user_DllExport double longitude() const; - - /*! - * @brief This function returns a reference to member longitude - * @return Reference to member longitude - */ - eProsima_user_DllExport double& longitude(); - - /*! - * @brief This function sets a value in member altitude - * @param _altitude New value for member altitude - */ - eProsima_user_DllExport void altitude(double _altitude); - - /*! - * @brief This function returns the value of member altitude - * @return Value of member altitude - */ - eProsima_user_DllExport double altitude() const; - - /*! - * @brief This function returns a reference to member altitude - * @return Reference to member altitude - */ - eProsima_user_DllExport double& altitude(); - - /*! - * @brief This function copies the value in member position_covariance - * @param _position_covariance New value to be copied in member position_covariance - */ - eProsima_user_DllExport void position_covariance( - const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& _position_covariance); - - /*! - * @brief This function moves the value in member position_covariance - * @param _position_covariance New value to be moved in member position_covariance - */ - eProsima_user_DllExport void position_covariance( - sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9&& _position_covariance); - - /*! - * @brief This function returns a constant reference to member position_covariance - * @return Constant reference to member position_covariance - */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& position_covariance() const; - - /*! - * @brief This function returns a reference to member position_covariance - * @return Reference to member position_covariance - */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9& position_covariance(); - /*! - * @brief This function sets a value in member position_covariance_type - * @param _position_covariance_type New value for member position_covariance_type - */ - eProsima_user_DllExport void position_covariance_type(uint8_t _position_covariance_type); - - /*! - * @brief This function returns the value of member position_covariance_type - * @return Value of member position_covariance_type - */ - eProsima_user_DllExport uint8_t position_covariance_type() const; - - /*! - * @brief This function returns a reference to member position_covariance_type - * @return Reference to member position_covariance_type - */ - eProsima_user_DllExport uint8_t& position_covariance_type(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::NavSatFix& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport NavSatFix(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~NavSatFix(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. + */ + eProsima_user_DllExport NavSatFix( + const NavSatFix& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. + */ + eProsima_user_DllExport NavSatFix( + NavSatFix&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. + */ + eProsima_user_DllExport NavSatFix& operator =( + const NavSatFix& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::NavSatFix that will be copied. + */ + eProsima_user_DllExport NavSatFix& operator =( + NavSatFix&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::NavSatFix object to compare. + */ + eProsima_user_DllExport bool operator ==( + const NavSatFix& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::NavSatFix object to compare. + */ + eProsima_user_DllExport bool operator !=( + const NavSatFix& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function copies the value in member status + * @param _status New value to be copied in member status + */ + eProsima_user_DllExport void status( + const sensor_msgs::msg::NavSatStatus& _status); + + /*! + * @brief This function moves the value in member status + * @param _status New value to be moved in member status + */ + eProsima_user_DllExport void status( + sensor_msgs::msg::NavSatStatus&& _status); + + /*! + * @brief This function returns a constant reference to member status + * @return Constant reference to member status + */ + eProsima_user_DllExport const sensor_msgs::msg::NavSatStatus& status() const; + + /*! + * @brief This function returns a reference to member status + * @return Reference to member status + */ + eProsima_user_DllExport sensor_msgs::msg::NavSatStatus& status(); + + + /*! + * @brief This function sets a value in member latitude + * @param _latitude New value for member latitude + */ + eProsima_user_DllExport void latitude( + double _latitude); + + /*! + * @brief This function returns the value of member latitude + * @return Value of member latitude + */ + eProsima_user_DllExport double latitude() const; + + /*! + * @brief This function returns a reference to member latitude + * @return Reference to member latitude + */ + eProsima_user_DllExport double& latitude(); + + + /*! + * @brief This function sets a value in member longitude + * @param _longitude New value for member longitude + */ + eProsima_user_DllExport void longitude( + double _longitude); + + /*! + * @brief This function returns the value of member longitude + * @return Value of member longitude + */ + eProsima_user_DllExport double longitude() const; + + /*! + * @brief This function returns a reference to member longitude + * @return Reference to member longitude + */ + eProsima_user_DllExport double& longitude(); + + + /*! + * @brief This function sets a value in member altitude + * @param _altitude New value for member altitude + */ + eProsima_user_DllExport void altitude( + double _altitude); + + /*! + * @brief This function returns the value of member altitude + * @return Value of member altitude + */ + eProsima_user_DllExport double altitude() const; + + /*! + * @brief This function returns a reference to member altitude + * @return Reference to member altitude + */ + eProsima_user_DllExport double& altitude(); + + + /*! + * @brief This function copies the value in member position_covariance + * @param _position_covariance New value to be copied in member position_covariance + */ + eProsima_user_DllExport void position_covariance( + const sensor_msgs::msg::double__9& _position_covariance); + + /*! + * @brief This function moves the value in member position_covariance + * @param _position_covariance New value to be moved in member position_covariance + */ + eProsima_user_DllExport void position_covariance( + sensor_msgs::msg::double__9&& _position_covariance); + + /*! + * @brief This function returns a constant reference to member position_covariance + * @return Constant reference to member position_covariance + */ + eProsima_user_DllExport const sensor_msgs::msg::double__9& position_covariance() const; + + /*! + * @brief This function returns a reference to member position_covariance + * @return Reference to member position_covariance + */ + eProsima_user_DllExport sensor_msgs::msg::double__9& position_covariance(); + + + /*! + * @brief This function sets a value in member position_covariance_type + * @param _position_covariance_type New value for member position_covariance_type + */ + eProsima_user_DllExport void position_covariance_type( + uint8_t _position_covariance_type); + + /*! + * @brief This function returns the value of member position_covariance_type + * @return Value of member position_covariance_type + */ + eProsima_user_DllExport uint8_t position_covariance_type() const; + + /*! + * @brief This function returns a reference to member position_covariance_type + * @return Reference to member position_covariance_type + */ + eProsima_user_DllExport uint8_t& position_covariance_type(); private: - std_msgs::msg::Header m_header; - sensor_msgs::msg::NavSatStatus m_status; - double m_latitude; - double m_longitude; - double m_altitude; - sensor_msgs::msg::sensor_msgs__NavSatFix__double_array_9 m_position_covariance; - uint8_t m_position_covariance_type; + + std_msgs::msg::Header m_header; + sensor_msgs::msg::NavSatStatus m_status; + double m_latitude{0.0}; + double m_longitude{0.0}; + double m_altitude{0.0}; + sensor_msgs::msg::double__9 m_position_covariance{0.0}; + uint8_t m_position_covariance_type{0}; + }; -} // namespace msg -} // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ +} // namespace msg + +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixCdrAux.hpp new file mode 100644 index 00000000000..c6c78712895 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixCdrAux.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file NavSatFixCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIXCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIXCDRAUX_HPP_ + +#include "NavSatFix.h" + +constexpr uint32_t sensor_msgs_msg_NavSatFix_max_cdr_typesize {385UL}; +constexpr uint32_t sensor_msgs_msg_NavSatFix_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::NavSatFix& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIXCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixCdrAux.ipp new file mode 100644 index 00000000000..d0d37b1b403 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixCdrAux.ipp @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file NavSatFixCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIXCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIXCDRAUX_IPP_ + +#include "NavSatFixCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::NavSatFix& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.status(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.latitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.longitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.altitude(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.position_covariance(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.position_covariance_type(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::NavSatFix& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.status() + << eprosima::fastcdr::MemberId(2) << data.latitude() + << eprosima::fastcdr::MemberId(3) << data.longitude() + << eprosima::fastcdr::MemberId(4) << data.altitude() + << eprosima::fastcdr::MemberId(5) << data.position_covariance() + << eprosima::fastcdr::MemberId(6) << data.position_covariance_type() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::NavSatFix& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.status(); + break; + + case 2: + dcdr >> data.latitude(); + break; + + case 3: + dcdr >> data.longitude(); + break; + + case 4: + dcdr >> data.altitude(); + break; + + case 5: + dcdr >> data.position_covariance(); + break; + + case 6: + dcdr >> data.position_covariance_type(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::NavSatFix& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIXCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.cxx index a975d95adfa..449dfda8cb4 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.cxx @@ -16,157 +16,197 @@ * @file NavSatFixPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "NavSatFixPubSubTypes.h" +#include "NavSatFixCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace sensor_msgs { - namespace msg { - NavSatFixPubSubType::NavSatFixPubSubType() - { - setName("sensor_msgs::msg::dds_::NavSatFix_"); - auto type_size = NavSatFix::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = NavSatFix::isKeyDefined(); - size_t keyLength = NavSatFix::getKeyMaxCdrSerializedSize() > 16 ? - NavSatFix::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - NavSatFixPubSubType::~NavSatFixPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool NavSatFixPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - NavSatFix* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool NavSatFixPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - NavSatFix* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function NavSatFixPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* NavSatFixPubSubType::createData() - { - return reinterpret_cast(new NavSatFix()); - } - - void NavSatFixPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool NavSatFixPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - NavSatFix* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - NavSatFix::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || NavSatFix::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + +namespace NavSatFix_Constants { + + + + + + + + + +} //End of namespace NavSatFix_Constants + + + +NavSatFixPubSubType::NavSatFixPubSubType() +{ + setName("sensor_msgs::msg::dds_::NavSatFix_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(NavSatFix::getMaxCdrSerializedSize()); +#else + sensor_msgs_msg_NavSatFix_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +NavSatFixPubSubType::~NavSatFixPubSubType() +{ +} + +bool NavSatFixPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + NavSatFix* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool NavSatFixPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + NavSatFix* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function NavSatFixPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* NavSatFixPubSubType::createData() +{ + return reinterpret_cast(new NavSatFix()); +} + +void NavSatFixPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool NavSatFixPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.h index 5a41522e6e1..01e41641ccc 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatFixPubSubTypes.h @@ -16,80 +16,133 @@ * @file NavSatFixPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "NavSatFix.h" -#include "NavSatStatusPubSubTypes.h" #include "std_msgs/msg/HeaderPubSubTypes.h" +#include "NavSatStatusPubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated NavSatFix is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated NavSatFix is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace sensor_msgs { namespace msg { -typedef std::array sensor_msgs__NavSatFix__double_array_9; +typedef std::array double__9; +namespace NavSatFix_Constants { + + + + + + + + +} // namespace NavSatFix_Constants + + /*! * @brief This class represents the TopicDataType of the type NavSatFix defined by the user in the IDL file. - * @ingroup NAVSATFIX + * @ingroup NavSatFix */ -class NavSatFixPubSubType : public eprosima::fastdds::dds::TopicDataType { +class NavSatFixPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef NavSatFix type; - eProsima_user_DllExport NavSatFixPubSubType(); + typedef NavSatFix type; - eProsima_user_DllExport virtual ~NavSatFixPubSubType() override; + eProsima_user_DllExport NavSatFixPubSubType(); - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport ~NavSatFixPubSubType() override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; + }; } // namespace msg } // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATFIX_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.cxx index 5e2f6029e8c..b391e4c8b3f 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.cxx @@ -14,9 +14,9 @@ /*! * @file NavSatStatus.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,111 +27,85 @@ char dummy; #endif // _WIN32 #include "NavSatStatus.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define sensor_msgs_msg_NavSatStatus_max_cdr_typesize 4ULL; -#define sensor_msgs_msg_NavSatStatus_max_key_cdr_typesize 0ULL; -sensor_msgs::msg::NavSatStatus::NavSatStatus() +namespace sensor_msgs { + +namespace msg { + +namespace NavSatStatus_Constants { + + +} // namespace NavSatStatus_Constants + + +NavSatStatus::NavSatStatus() { - // octet m_status - m_status = 0; - // unsigned short m_service - m_service = 0; } -sensor_msgs::msg::NavSatStatus::~NavSatStatus() +NavSatStatus::~NavSatStatus() { } -sensor_msgs::msg::NavSatStatus::NavSatStatus( +NavSatStatus::NavSatStatus( const NavSatStatus& x) { m_status = x.m_status; m_service = x.m_service; } -sensor_msgs::msg::NavSatStatus::NavSatStatus( +NavSatStatus::NavSatStatus( NavSatStatus&& x) noexcept { m_status = x.m_status; m_service = x.m_service; } -sensor_msgs::msg::NavSatStatus& sensor_msgs::msg::NavSatStatus::operator =( +NavSatStatus& NavSatStatus::operator =( const NavSatStatus& x) { + m_status = x.m_status; m_service = x.m_service; - return *this; } -sensor_msgs::msg::NavSatStatus& sensor_msgs::msg::NavSatStatus::operator =( +NavSatStatus& NavSatStatus::operator =( NavSatStatus&& x) noexcept { + m_status = x.m_status; m_service = x.m_service; - return *this; } -bool sensor_msgs::msg::NavSatStatus::operator ==( +bool NavSatStatus::operator ==( const NavSatStatus& x) const { - return (m_status == x.m_status && m_service == x.m_service); + return (m_status == x.m_status && + m_service == x.m_service); } -bool sensor_msgs::msg::NavSatStatus::operator !=( +bool NavSatStatus::operator !=( const NavSatStatus& x) const { return !(*this == x); } -size_t sensor_msgs::msg::NavSatStatus::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_NavSatStatus_max_cdr_typesize; -} - -size_t sensor_msgs::msg::NavSatStatus::getCdrSerializedSize( - const sensor_msgs::msg::NavSatStatus& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - return current_alignment - initial_alignment; -} - -void sensor_msgs::msg::NavSatStatus::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_status; - scdr << m_service; -} - -void sensor_msgs::msg::NavSatStatus::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_status; - dcdr >> m_service; -} - /*! * @brief This function sets a value in member status * @param _status New value for member status */ -void sensor_msgs::msg::NavSatStatus::status( - uint8_t _status) +void NavSatStatus::status( + int8_t _status) { m_status = _status; } @@ -140,7 +114,7 @@ void sensor_msgs::msg::NavSatStatus::status( * @brief This function returns the value of member status * @return Value of member status */ -uint8_t sensor_msgs::msg::NavSatStatus::status() const +int8_t NavSatStatus::status() const { return m_status; } @@ -149,16 +123,17 @@ uint8_t sensor_msgs::msg::NavSatStatus::status() const * @brief This function returns a reference to member status * @return Reference to member status */ -uint8_t& sensor_msgs::msg::NavSatStatus::status() +int8_t& NavSatStatus::status() { return m_status; } + /*! * @brief This function sets a value in member service * @param _service New value for member service */ -void sensor_msgs::msg::NavSatStatus::service( +void NavSatStatus::service( uint16_t _service) { m_service = _service; @@ -168,7 +143,7 @@ void sensor_msgs::msg::NavSatStatus::service( * @brief This function returns the value of member service * @return Value of member service */ -uint16_t sensor_msgs::msg::NavSatStatus::service() const +uint16_t NavSatStatus::service() const { return m_service; } @@ -177,25 +152,18 @@ uint16_t sensor_msgs::msg::NavSatStatus::service() const * @brief This function returns a reference to member service * @return Reference to member service */ -uint16_t& sensor_msgs::msg::NavSatStatus::service() +uint16_t& NavSatStatus::service() { return m_service; } -size_t sensor_msgs::msg::NavSatStatus::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_NavSatStatus_max_key_cdr_typesize; -} -bool sensor_msgs::msg::NavSatStatus::isKeyDefined() -{ - return false; -} -void sensor_msgs::msg::NavSatStatus::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace sensor_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "NavSatStatusCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.h index 183499cf74c..c88f7b10b7f 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatus.h @@ -16,24 +16,28 @@ * @file NavSatStatus.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -43,175 +47,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(NavSatStatus_SOURCE) -#define NavSatStatus_DllAPI __declspec(dllexport) +#if defined(NAVSATSTATUS_SOURCE) +#define NAVSATSTATUS_DllAPI __declspec( dllexport ) #else -#define NavSatStatus_DllAPI __declspec(dllimport) -#endif // NavSatStatus_SOURCE +#define NAVSATSTATUS_DllAPI __declspec( dllimport ) +#endif // NAVSATSTATUS_SOURCE #else -#define NavSatStatus_DllAPI +#define NAVSATSTATUS_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define NavSatStatus_DllAPI -#endif // _WIN32 +#define NAVSATSTATUS_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace sensor_msgs { + namespace msg { -const uint8_t NavSatStatus__STATUS_NO_FIX = 255; -const uint8_t NavSatStatus__STATUS_FIX = 0; -const uint8_t NavSatStatus__STATUS_SBAS_FIX = 1; -const uint8_t NavSatStatus__STATUS_GBAS_FIX = 2; -const uint16_t NavSatStatus__SERVICE_GPS = 1; -const uint16_t NavSatStatus__SERVICE_GLONASS = 2; -const uint16_t NavSatStatus__SERVICE_COMPASS = 4; -const uint16_t NavSatStatus__SERVICE_GALILEO = 8; + +namespace NavSatStatus_Constants { + +const int8_t STATUS_UNKNOWN = -2; +const int8_t STATUS_NO_FIX = -1; +const int8_t STATUS_FIX = 0; +const int8_t STATUS_SBAS_FIX = 1; +const int8_t STATUS_GBAS_FIX = 2; +const uint16_t SERVICE_UNKNOWN = 0; +const uint16_t SERVICE_GPS = 1; +const uint16_t SERVICE_GLONASS = 2; +const uint16_t SERVICE_COMPASS = 4; +const uint16_t SERVICE_GALILEO = 8; + +} // namespace NavSatStatus_Constants + + /*! * @brief This class represents the structure NavSatStatus defined by the user in the IDL file. - * @ingroup NAVSATSTATUS + * @ingroup NavSatStatus */ -class NavSatStatus { +class NavSatStatus +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport NavSatStatus(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~NavSatStatus(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. - */ - eProsima_user_DllExport NavSatStatus(const NavSatStatus& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. - */ - eProsima_user_DllExport NavSatStatus(NavSatStatus&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. - */ - eProsima_user_DllExport NavSatStatus& operator=(const NavSatStatus& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. - */ - eProsima_user_DllExport NavSatStatus& operator=(NavSatStatus&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::NavSatStatus object to compare. - */ - eProsima_user_DllExport bool operator==(const NavSatStatus& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::NavSatStatus object to compare. - */ - eProsima_user_DllExport bool operator!=(const NavSatStatus& x) const; - - /*! - * @brief This function sets a value in member status - * @param _status New value for member status - */ - eProsima_user_DllExport void status(uint8_t _status); - - /*! - * @brief This function returns the value of member status - * @return Value of member status - */ - eProsima_user_DllExport uint8_t status() const; - - /*! - * @brief This function returns a reference to member status - * @return Reference to member status - */ - eProsima_user_DllExport uint8_t& status(); - - /*! - * @brief This function sets a value in member service - * @param _service New value for member service - */ - eProsima_user_DllExport void service(uint16_t _service); - - /*! - * @brief This function returns the value of member service - * @return Value of member service - */ - eProsima_user_DllExport uint16_t service() const; - - /*! - * @brief This function returns a reference to member service - * @return Reference to member service - */ - eProsima_user_DllExport uint16_t& service(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::NavSatStatus& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport NavSatStatus(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~NavSatStatus(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + */ + eProsima_user_DllExport NavSatStatus( + const NavSatStatus& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + */ + eProsima_user_DllExport NavSatStatus( + NavSatStatus&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + */ + eProsima_user_DllExport NavSatStatus& operator =( + const NavSatStatus& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::NavSatStatus that will be copied. + */ + eProsima_user_DllExport NavSatStatus& operator =( + NavSatStatus&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::NavSatStatus object to compare. + */ + eProsima_user_DllExport bool operator ==( + const NavSatStatus& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::NavSatStatus object to compare. + */ + eProsima_user_DllExport bool operator !=( + const NavSatStatus& x) const; + + /*! + * @brief This function sets a value in member status + * @param _status New value for member status + */ + eProsima_user_DllExport void status( + int8_t _status); + + /*! + * @brief This function returns the value of member status + * @return Value of member status + */ + eProsima_user_DllExport int8_t status() const; + + /*! + * @brief This function returns a reference to member status + * @return Reference to member status + */ + eProsima_user_DllExport int8_t& status(); + + + /*! + * @brief This function sets a value in member service + * @param _service New value for member service + */ + eProsima_user_DllExport void service( + uint16_t _service); + + /*! + * @brief This function returns the value of member service + * @return Value of member service + */ + eProsima_user_DllExport uint16_t service() const; + + /*! + * @brief This function returns a reference to member service + * @return Reference to member service + */ + eProsima_user_DllExport uint16_t& service(); private: - uint8_t m_status; - uint16_t m_service; + + int8_t m_status{-2}; + uint16_t m_service{0}; + }; -} // namespace msg -} // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ +} // namespace msg + +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusCdrAux.hpp new file mode 100644 index 00000000000..3933ca29e01 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusCdrAux.hpp @@ -0,0 +1,71 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file NavSatStatusCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUSCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUSCDRAUX_HPP_ + +#include "NavSatStatus.h" + +constexpr uint32_t sensor_msgs_msg_NavSatStatus_max_cdr_typesize {8UL}; +constexpr uint32_t sensor_msgs_msg_NavSatStatus_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::NavSatStatus& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUSCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusCdrAux.ipp new file mode 100644 index 00000000000..05609d1fa78 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusCdrAux.ipp @@ -0,0 +1,159 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file NavSatStatusCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUSCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUSCDRAUX_IPP_ + +#include "NavSatStatusCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::NavSatStatus& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.status(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.service(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::NavSatStatus& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.status() + << eprosima::fastcdr::MemberId(1) << data.service() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::NavSatStatus& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.status(); + break; + + case 1: + dcdr >> data.service(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::NavSatStatus& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUSCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.cxx index bf6448f16ee..2de2e0c5573 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.cxx @@ -16,157 +16,207 @@ * @file NavSatStatusPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "NavSatStatusPubSubTypes.h" +#include "NavSatStatusCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace sensor_msgs { - namespace msg { - NavSatStatusPubSubType::NavSatStatusPubSubType() - { - setName("sensor_msgs::msg::dds_::NavSatStatus_"); - auto type_size = NavSatStatus::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = NavSatStatus::isKeyDefined(); - size_t keyLength = NavSatStatus::getKeyMaxCdrSerializedSize() > 16 ? - NavSatStatus::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - NavSatStatusPubSubType::~NavSatStatusPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool NavSatStatusPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - NavSatStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool NavSatStatusPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - NavSatStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function NavSatStatusPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* NavSatStatusPubSubType::createData() - { - return reinterpret_cast(new NavSatStatus()); - } - - void NavSatStatusPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool NavSatStatusPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - NavSatStatus* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - NavSatStatus::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || NavSatStatus::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { +namespace NavSatStatus_Constants { + + + + + + + + + + + + + + + + + + + + + +} //End of namespace NavSatStatus_Constants + + + +NavSatStatusPubSubType::NavSatStatusPubSubType() +{ + setName("sensor_msgs::msg::dds_::NavSatStatus_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(NavSatStatus::getMaxCdrSerializedSize()); +#else + sensor_msgs_msg_NavSatStatus_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +NavSatStatusPubSubType::~NavSatStatusPubSubType() +{ +} + +bool NavSatStatusPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + NavSatStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool NavSatStatusPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + NavSatStatus* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function NavSatStatusPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* NavSatStatusPubSubType::createData() +{ + return reinterpret_cast(new NavSatStatus()); +} + +void NavSatStatusPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool NavSatStatusPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.h index ec4276146a3..1db7c63ca58 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/NavSatStatusPubSubTypes.h @@ -16,104 +16,142 @@ * @file NavSatStatusPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "NavSatStatus.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated NavSatStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated NavSatStatus is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace sensor_msgs { namespace msg { -#ifndef SWIG -namespace detail { - -template -struct NavSatStatus_rob { - friend constexpr typename Tag::type get(Tag) { - return M; - } -}; +namespace NavSatStatus_Constants { + + + + + + + + -struct NavSatStatus_f { - typedef uint16_t NavSatStatus::*type; - friend constexpr type get(NavSatStatus_f); -}; -template struct NavSatStatus_rob; -template -inline size_t constexpr NavSatStatus_offset_of() { - return ((::size_t) & reinterpret_cast((((T*)0)->*get(Tag())))); -} -} // namespace detail -#endif + + + + + + + + + +} // namespace NavSatStatus_Constants + + /*! * @brief This class represents the TopicDataType of the type NavSatStatus defined by the user in the IDL file. - * @ingroup NAVSATSTATUS + * @ingroup NavSatStatus */ -class NavSatStatusPubSubType : public eprosima::fastdds::dds::TopicDataType { +class NavSatStatusPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef NavSatStatus type; - eProsima_user_DllExport NavSatStatusPubSubType(); + typedef NavSatStatus type; + + eProsima_user_DllExport NavSatStatusPubSubType(); - eProsima_user_DllExport virtual ~NavSatStatusPubSubType() override; + eProsima_user_DllExport ~NavSatStatusPubSubType() override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return true; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - new (memory) NavSatStatus(); - return true; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; -private: - static constexpr bool is_plain_impl() { - return 4ULL == (detail::NavSatStatus_offset_of() + sizeof(uint16_t)); - } }; } // namespace msg } // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_NAVSATSTATUS_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cc b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cc deleted file mode 100644 index 27919c778b1..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cc +++ /dev/null @@ -1,487 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointCloud2.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "PointCloud2.h" -#include - -#include -using namespace eprosima::fastcdr::exception; - -#include - -#define sensor_msgs_msg_PointField_max_cdr_typesize 272ULL; -#define std_msgs_msg_Time_max_cdr_typesize 8ULL; -#define sensor_msgs_msg_PointCloud2_max_cdr_typesize 27597ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define sensor_msgs_msg_PointField_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL; -#define sensor_msgs_msg_PointCloud2_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - -template -sensor_msgs::msg::PointCloud2T::PointCloud2T() { - // std_msgs::msg::Header m_header - - // unsigned long m_height - m_height = 0; - // unsigned long m_width - m_width = 0; - // sequence m_fields - - // boolean m_is_bigendian - m_is_bigendian = false; - // unsigned long m_point_step - m_point_step = 0; - // unsigned long m_row_step - m_row_step = 0; - // sequence m_data - - // boolean m_is_dense - m_is_dense = false; -} - -template -sensor_msgs::msg::PointCloud2T::~PointCloud2T() {} - -template -sensor_msgs::msg::PointCloud2T::PointCloud2T(const PointCloud2T& x) { - m_header = x.m_header; - m_height = x.m_height; - m_width = x.m_width; - m_fields = x.m_fields; - m_is_bigendian = x.m_is_bigendian; - m_point_step = x.m_point_step; - m_row_step = x.m_row_step; - m_data = x.m_data; - m_is_dense = x.m_is_dense; -} - -template -sensor_msgs::msg::PointCloud2T::PointCloud2T(PointCloud2T&& x) noexcept { - m_header = std::move(x.m_header); - m_height = x.m_height; - m_width = x.m_width; - m_fields = std::move(x.m_fields); - m_is_bigendian = x.m_is_bigendian; - m_point_step = x.m_point_step; - m_row_step = x.m_row_step; - m_data = std::move(x.m_data); - m_is_dense = x.m_is_dense; -} - -template -sensor_msgs::msg::PointCloud2T& sensor_msgs::msg::PointCloud2T::operator=( - const PointCloud2T& x) { - m_header = x.m_header; - m_height = x.m_height; - m_width = x.m_width; - m_fields = x.m_fields; - m_is_bigendian = x.m_is_bigendian; - m_point_step = x.m_point_step; - m_row_step = x.m_row_step; - m_data = x.m_data; - m_is_dense = x.m_is_dense; - - return *this; -} - -template -sensor_msgs::msg::PointCloud2T& sensor_msgs::msg::PointCloud2T::operator=( - PointCloud2T&& x) noexcept { - m_header = std::move(x.m_header); - m_height = x.m_height; - m_width = x.m_width; - m_fields = std::move(x.m_fields); - m_is_bigendian = x.m_is_bigendian; - m_point_step = x.m_point_step; - m_row_step = x.m_row_step; - m_data = std::move(x.m_data); - m_is_dense = x.m_is_dense; - - return *this; -} - -template -bool sensor_msgs::msg::PointCloud2T::operator==(const PointCloud2T& x) const { - return (m_header == x.m_header && m_height == x.m_height && m_width == x.m_width && m_fields == x.m_fields && - m_is_bigendian == x.m_is_bigendian && m_point_step == x.m_point_step && m_row_step == x.m_row_step && - m_data == x.m_data && m_is_dense == x.m_is_dense); -} - -template -bool sensor_msgs::msg::PointCloud2T::operator!=(const PointCloud2T& x) const { - return !(*this == x); -} - -template -size_t sensor_msgs::msg::PointCloud2T::getMaxCdrSerializedSize(size_t current_alignment) { - static_cast(current_alignment); - return sensor_msgs_msg_PointCloud2_max_cdr_typesize; -} - -template -size_t sensor_msgs::msg::PointCloud2T::getCdrSerializedSize( - const sensor_msgs::msg::PointCloud2T& data, size_t current_alignment) { - size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Header::getCdrSerializedSize(data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for (size_t a = 0; a < data.fields().size(); ++a) { - current_alignment += sensor_msgs::msg::PointField::getCdrSerializedSize(data.fields().at(a), current_alignment); - } - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.data().size() > 0) { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; -} - -template -void sensor_msgs::msg::PointCloud2T::serialize(eprosima::fastcdr::Cdr& scdr) const { - scdr << m_header; - scdr << m_height; - scdr << m_width; - scdr << m_fields; - scdr << m_is_bigendian; - scdr << m_point_step; - scdr << m_row_step; - scdr << m_data; - scdr << m_is_dense; -} - -template -void sensor_msgs::msg::PointCloud2T::deserialize(eprosima::fastcdr::Cdr& dcdr) { - dcdr >> m_header; - dcdr >> m_height; - dcdr >> m_width; - dcdr >> m_fields; - dcdr >> m_is_bigendian; - dcdr >> m_point_step; - dcdr >> m_row_step; - dcdr >> m_data; - dcdr >> m_is_dense; -} - -/*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ -template -void sensor_msgs::msg::PointCloud2T::header(const std_msgs::msg::Header& _header) { - m_header = _header; -} - -/*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ -template -void sensor_msgs::msg::PointCloud2T::header(std_msgs::msg::Header&& _header) { - m_header = std::move(_header); -} - -/*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ -template -const std_msgs::msg::Header& sensor_msgs::msg::PointCloud2T::header() const { - return m_header; -} - -/*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ -template -std_msgs::msg::Header& sensor_msgs::msg::PointCloud2T::header() { - return m_header; -} - -/*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ -template -void sensor_msgs::msg::PointCloud2T::height(uint32_t _height) { - m_height = _height; -} - -/*! - * @brief This function returns the value of member height - * @return Value of member height - */ -template -uint32_t sensor_msgs::msg::PointCloud2T::height() const { - return m_height; -} - -/*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ -template -uint32_t& sensor_msgs::msg::PointCloud2T::height() { - return m_height; -} - -/*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ -template -void sensor_msgs::msg::PointCloud2T::width(uint32_t _width) { - m_width = _width; -} - -/*! - * @brief This function returns the value of member width - * @return Value of member width - */ -template -uint32_t sensor_msgs::msg::PointCloud2T::width() const { - return m_width; -} - -/*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ -template -uint32_t& sensor_msgs::msg::PointCloud2T::width() { - return m_width; -} - -/*! - * @brief This function copies the value in member fields - * @param _fields New value to be copied in member fields - */ -template -void sensor_msgs::msg::PointCloud2T::fields(const std::vector& _fields) { - m_fields = _fields; -} - -/*! - * @brief This function moves the value in member fields - * @param _fields New value to be moved in member fields - */ -template -void sensor_msgs::msg::PointCloud2T::fields(std::vector&& _fields) { - m_fields = std::move(_fields); -} - -/*! - * @brief This function returns a constant reference to member fields - * @return Constant reference to member fields - */ -template -const std::vector& sensor_msgs::msg::PointCloud2T::fields() const { - return m_fields; -} - -/*! - * @brief This function returns a reference to member fields - * @return Reference to member fields - */ -template -std::vector& sensor_msgs::msg::PointCloud2T::fields() { - return m_fields; -} - -/*! - * @brief This function sets a value in member is_bigendian - * @param _is_bigendian New value for member is_bigendian - */ -template -void sensor_msgs::msg::PointCloud2T::is_bigendian(bool _is_bigendian) { - m_is_bigendian = _is_bigendian; -} - -/*! - * @brief This function returns the value of member is_bigendian - * @return Value of member is_bigendian - */ -template -bool sensor_msgs::msg::PointCloud2T::is_bigendian() const { - return m_is_bigendian; -} - -/*! - * @brief This function returns a reference to member is_bigendian - * @return Reference to member is_bigendian - */ -template -bool& sensor_msgs::msg::PointCloud2T::is_bigendian() { - return m_is_bigendian; -} - -/*! - * @brief This function sets a value in member point_step - * @param _point_step New value for member point_step - */ -template -void sensor_msgs::msg::PointCloud2T::point_step(uint32_t _point_step) { - m_point_step = _point_step; -} - -/*! - * @brief This function returns the value of member point_step - * @return Value of member point_step - */ -template -uint32_t sensor_msgs::msg::PointCloud2T::point_step() const { - return m_point_step; -} - -/*! - * @brief This function returns a reference to member point_step - * @return Reference to member point_step - */ -template -uint32_t& sensor_msgs::msg::PointCloud2T::point_step() { - return m_point_step; -} - -/*! - * @brief This function sets a value in member row_step - * @param _row_step New value for member row_step - */ -template -void sensor_msgs::msg::PointCloud2T::row_step(uint32_t _row_step) { - m_row_step = _row_step; -} - -/*! - * @brief This function returns the value of member row_step - * @return Value of member row_step - */ -template -uint32_t sensor_msgs::msg::PointCloud2T::row_step() const { - return m_row_step; -} - -/*! - * @brief This function returns a reference to member row_step - * @return Reference to member row_step - */ -template -uint32_t& sensor_msgs::msg::PointCloud2T::row_step() { - return m_row_step; -} - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -template -void sensor_msgs::msg::PointCloud2T::data( - const typename sensor_msgs::msg::PointCloud2T::vector_type& _data) { - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -template -void sensor_msgs::msg::PointCloud2T::data( - typename sensor_msgs::msg::PointCloud2T::vector_type&& _data) { - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -template -const typename sensor_msgs::msg::PointCloud2T::vector_type& sensor_msgs::msg::PointCloud2T::data() - const { - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -template -typename sensor_msgs::msg::PointCloud2T::vector_type& sensor_msgs::msg::PointCloud2T::data() { - return m_data; -} - -/*! - * @brief This function sets a value in member is_dense - * @param _is_dense New value for member is_dense - */ -template -void sensor_msgs::msg::PointCloud2T::is_dense(bool _is_dense) { - m_is_dense = _is_dense; -} - -/*! - * @brief This function returns the value of member is_dense - * @return Value of member is_dense - */ -template -bool sensor_msgs::msg::PointCloud2T::is_dense() const { - return m_is_dense; -} - -/*! - * @brief This function returns a reference to member is_dense - * @return Reference to member is_dense - */ -template -bool& sensor_msgs::msg::PointCloud2T::is_dense() { - return m_is_dense; -} - -template -size_t sensor_msgs::msg::PointCloud2T::getKeyMaxCdrSerializedSize(size_t current_alignment) { - static_cast(current_alignment); - return sensor_msgs_msg_PointCloud2_max_key_cdr_typesize; -} - -template -bool sensor_msgs::msg::PointCloud2T::isKeyDefined() { - return false; -} - -template -void sensor_msgs::msg::PointCloud2T::serializeKey(eprosima::fastcdr::Cdr& scdr) const { - (void)scdr; -} diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cxx new file mode 100644 index 00000000000..e6120a30004 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.cxx @@ -0,0 +1,433 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCloud2.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "PointCloud2.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + + +namespace sensor_msgs { + +namespace msg { + + + +PointCloud2::PointCloud2() +{ +} + +PointCloud2::~PointCloud2() +{ +} + +PointCloud2::PointCloud2( + const PointCloud2& x) +{ + m_header = x.m_header; + m_height = x.m_height; + m_width = x.m_width; + m_fields = x.m_fields; + m_is_bigendian = x.m_is_bigendian; + m_point_step = x.m_point_step; + m_row_step = x.m_row_step; + m_data = x.m_data; + m_is_dense = x.m_is_dense; +} + +PointCloud2::PointCloud2( + PointCloud2&& x) noexcept +{ + m_header = std::move(x.m_header); + m_height = x.m_height; + m_width = x.m_width; + m_fields = std::move(x.m_fields); + m_is_bigendian = x.m_is_bigendian; + m_point_step = x.m_point_step; + m_row_step = x.m_row_step; + m_data = std::move(x.m_data); + m_is_dense = x.m_is_dense; +} + +PointCloud2& PointCloud2::operator =( + const PointCloud2& x) +{ + + m_header = x.m_header; + m_height = x.m_height; + m_width = x.m_width; + m_fields = x.m_fields; + m_is_bigendian = x.m_is_bigendian; + m_point_step = x.m_point_step; + m_row_step = x.m_row_step; + m_data = x.m_data; + m_is_dense = x.m_is_dense; + return *this; +} + +PointCloud2& PointCloud2::operator =( + PointCloud2&& x) noexcept +{ + + m_header = std::move(x.m_header); + m_height = x.m_height; + m_width = x.m_width; + m_fields = std::move(x.m_fields); + m_is_bigendian = x.m_is_bigendian; + m_point_step = x.m_point_step; + m_row_step = x.m_row_step; + m_data = std::move(x.m_data); + m_is_dense = x.m_is_dense; + return *this; +} + +bool PointCloud2::operator ==( + const PointCloud2& x) const +{ + return (m_header == x.m_header && + m_height == x.m_height && + m_width == x.m_width && + m_fields == x.m_fields && + m_is_bigendian == x.m_is_bigendian && + m_point_step == x.m_point_step && + m_row_step == x.m_row_step && + m_data == x.m_data && + m_is_dense == x.m_is_dense); +} + +bool PointCloud2::operator !=( + const PointCloud2& x) const +{ + return !(*this == x); +} + +/*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ +void PointCloud2::header( + const std_msgs::msg::Header& _header) +{ + m_header = _header; +} + +/*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ +void PointCloud2::header( + std_msgs::msg::Header&& _header) +{ + m_header = std::move(_header); +} + +/*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ +const std_msgs::msg::Header& PointCloud2::header() const +{ + return m_header; +} + +/*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ +std_msgs::msg::Header& PointCloud2::header() +{ + return m_header; +} + + +/*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ +void PointCloud2::height( + uint32_t _height) +{ + m_height = _height; +} + +/*! + * @brief This function returns the value of member height + * @return Value of member height + */ +uint32_t PointCloud2::height() const +{ + return m_height; +} + +/*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ +uint32_t& PointCloud2::height() +{ + return m_height; +} + + +/*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ +void PointCloud2::width( + uint32_t _width) +{ + m_width = _width; +} + +/*! + * @brief This function returns the value of member width + * @return Value of member width + */ +uint32_t PointCloud2::width() const +{ + return m_width; +} + +/*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ +uint32_t& PointCloud2::width() +{ + return m_width; +} + + +/*! + * @brief This function copies the value in member fields + * @param _fields New value to be copied in member fields + */ +void PointCloud2::fields( + const std::vector& _fields) +{ + m_fields = _fields; +} + +/*! + * @brief This function moves the value in member fields + * @param _fields New value to be moved in member fields + */ +void PointCloud2::fields( + std::vector&& _fields) +{ + m_fields = std::move(_fields); +} + +/*! + * @brief This function returns a constant reference to member fields + * @return Constant reference to member fields + */ +const std::vector& PointCloud2::fields() const +{ + return m_fields; +} + +/*! + * @brief This function returns a reference to member fields + * @return Reference to member fields + */ +std::vector& PointCloud2::fields() +{ + return m_fields; +} + + +/*! + * @brief This function sets a value in member is_bigendian + * @param _is_bigendian New value for member is_bigendian + */ +void PointCloud2::is_bigendian( + bool _is_bigendian) +{ + m_is_bigendian = _is_bigendian; +} + +/*! + * @brief This function returns the value of member is_bigendian + * @return Value of member is_bigendian + */ +bool PointCloud2::is_bigendian() const +{ + return m_is_bigendian; +} + +/*! + * @brief This function returns a reference to member is_bigendian + * @return Reference to member is_bigendian + */ +bool& PointCloud2::is_bigendian() +{ + return m_is_bigendian; +} + + +/*! + * @brief This function sets a value in member point_step + * @param _point_step New value for member point_step + */ +void PointCloud2::point_step( + uint32_t _point_step) +{ + m_point_step = _point_step; +} + +/*! + * @brief This function returns the value of member point_step + * @return Value of member point_step + */ +uint32_t PointCloud2::point_step() const +{ + return m_point_step; +} + +/*! + * @brief This function returns a reference to member point_step + * @return Reference to member point_step + */ +uint32_t& PointCloud2::point_step() +{ + return m_point_step; +} + + +/*! + * @brief This function sets a value in member row_step + * @param _row_step New value for member row_step + */ +void PointCloud2::row_step( + uint32_t _row_step) +{ + m_row_step = _row_step; +} + +/*! + * @brief This function returns the value of member row_step + * @return Value of member row_step + */ +uint32_t PointCloud2::row_step() const +{ + return m_row_step; +} + +/*! + * @brief This function returns a reference to member row_step + * @return Reference to member row_step + */ +uint32_t& PointCloud2::row_step() +{ + return m_row_step; +} + + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +void PointCloud2::data( + const std::vector& _data) +{ + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +void PointCloud2::data( + std::vector&& _data) +{ + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +const std::vector& PointCloud2::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +std::vector& PointCloud2::data() +{ + return m_data; +} + + +/*! + * @brief This function sets a value in member is_dense + * @param _is_dense New value for member is_dense + */ +void PointCloud2::is_dense( + bool _is_dense) +{ + m_is_dense = _is_dense; +} + +/*! + * @brief This function returns the value of member is_dense + * @return Value of member is_dense + */ +bool PointCloud2::is_dense() const +{ + return m_is_dense; +} + +/*! + * @brief This function returns a reference to member is_dense + * @return Reference to member is_dense + */ +bool& PointCloud2::is_dense() +{ + return m_is_dense; +} + + + + +} // namespace msg + + +} // namespace sensor_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PointCloud2CdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.h index 2cbfba0f4f3..88e6da85ad5 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2.h @@ -16,29 +16,30 @@ * @file PointCloud2.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ -#include "PointField.h" -#include "std_msgs/msg/Header.h" - -#include - -#include #include #include +#include #include #include #include -#include "carla/sensor/data/SerializerVectorAllocator.h" +#include +#include +#include + +#include "std_msgs/msg/Header.h" +#include "PointField.h" + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -48,325 +49,312 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PointCloud2_SOURCE) -#define PointCloud2_DllAPI __declspec(dllexport) +#if defined(POINTCLOUD2_SOURCE) +#define POINTCLOUD2_DllAPI __declspec( dllexport ) #else -#define PointCloud2_DllAPI __declspec(dllimport) -#endif // PointCloud2_SOURCE +#define POINTCLOUD2_DllAPI __declspec( dllimport ) +#endif // POINTCLOUD2_SOURCE #else -#define PointCloud2_DllAPI +#define POINTCLOUD2_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PointCloud2_DllAPI -#endif // _WIN32 +#define POINTCLOUD2_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace sensor_msgs { + namespace msg { + + + /*! - * @brief This class represents the structure PointCloud2T defined by the user in the IDL file. - * @ingroup POINTCLOUD2 + * @brief This class represents the structure PointCloud2 defined by the user in the IDL file. + * @ingroup PointCloud2 */ -template -class PointCloud2T { +class PointCloud2 +{ public: - using base_type = uint8_t; - using allocator_type = ALLOCATOR; - using vector_type = std::vector; - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PointCloud2T(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PointCloud2T(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::PointCloud2T that will be copied. - */ - eProsima_user_DllExport PointCloud2T(const PointCloud2T& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::PointCloud2T that will be copied. - */ - eProsima_user_DllExport PointCloud2T(PointCloud2T&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::PointCloud2T that will be copied. - */ - eProsima_user_DllExport PointCloud2T& operator=(const PointCloud2T& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::PointCloud2T that will be copied. - */ - eProsima_user_DllExport PointCloud2T& operator=(PointCloud2T&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::PointCloud2T object to compare. - */ - eProsima_user_DllExport bool operator==(const PointCloud2T& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::PointCloud2T object to compare. - */ - eProsima_user_DllExport bool operator!=(const PointCloud2T& x) const; - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - eProsima_user_DllExport void header(const std_msgs::msg::Header& _header); - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - eProsima_user_DllExport void header(std_msgs::msg::Header&& _header); - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - eProsima_user_DllExport const std_msgs::msg::Header& header() const; - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - eProsima_user_DllExport std_msgs::msg::Header& header(); - /*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ - eProsima_user_DllExport void height(uint32_t _height); - - /*! - * @brief This function returns the value of member height - * @return Value of member height - */ - eProsima_user_DllExport uint32_t height() const; - - /*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ - eProsima_user_DllExport uint32_t& height(); - - /*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ - eProsima_user_DllExport void width(uint32_t _width); - - /*! - * @brief This function returns the value of member width - * @return Value of member width - */ - eProsima_user_DllExport uint32_t width() const; - - /*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ - eProsima_user_DllExport uint32_t& width(); - - /*! - * @brief This function copies the value in member fields - * @param _fields New value to be copied in member fields - */ - eProsima_user_DllExport void fields(const std::vector& _fields); - - /*! - * @brief This function moves the value in member fields - * @param _fields New value to be moved in member fields - */ - eProsima_user_DllExport void fields(std::vector&& _fields); - - /*! - * @brief This function returns a constant reference to member fields - * @return Constant reference to member fields - */ - eProsima_user_DllExport const std::vector& fields() const; - - /*! - * @brief This function returns a reference to member fields - * @return Reference to member fields - */ - eProsima_user_DllExport std::vector& fields(); - /*! - * @brief This function sets a value in member is_bigendian - * @param _is_bigendian New value for member is_bigendian - */ - eProsima_user_DllExport void is_bigendian(bool _is_bigendian); - - /*! - * @brief This function returns the value of member is_bigendian - * @return Value of member is_bigendian - */ - eProsima_user_DllExport bool is_bigendian() const; - - /*! - * @brief This function returns a reference to member is_bigendian - * @return Reference to member is_bigendian - */ - eProsima_user_DllExport bool& is_bigendian(); - - /*! - * @brief This function sets a value in member point_step - * @param _point_step New value for member point_step - */ - eProsima_user_DllExport void point_step(uint32_t _point_step); - - /*! - * @brief This function returns the value of member point_step - * @return Value of member point_step - */ - eProsima_user_DllExport uint32_t point_step() const; - - /*! - * @brief This function returns a reference to member point_step - * @return Reference to member point_step - */ - eProsima_user_DllExport uint32_t& point_step(); - - /*! - * @brief This function sets a value in member row_step - * @param _row_step New value for member row_step - */ - eProsima_user_DllExport void row_step(uint32_t _row_step); - - /*! - * @brief This function returns the value of member row_step - * @return Value of member row_step - */ - eProsima_user_DllExport uint32_t row_step() const; - - /*! - * @brief This function returns a reference to member row_step - * @return Reference to member row_step - */ - eProsima_user_DllExport uint32_t& row_step(); - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data(const vector_type& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data(vector_type&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const vector_type& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport vector_type& data(); - /*! - * @brief This function sets a value in member is_dense - * @param _is_dense New value for member is_dense - */ - eProsima_user_DllExport void is_dense(bool _is_dense); - - /*! - * @brief This function returns the value of member is_dense - * @return Value of member is_dense - */ - eProsima_user_DllExport bool is_dense() const; - - /*! - * @brief This function returns a reference to member is_dense - * @return Reference to member is_dense - */ - eProsima_user_DllExport bool& is_dense(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::PointCloud2T& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PointCloud2(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PointCloud2(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied. + */ + eProsima_user_DllExport PointCloud2( + const PointCloud2& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied. + */ + eProsima_user_DllExport PointCloud2( + PointCloud2&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied. + */ + eProsima_user_DllExport PointCloud2& operator =( + const PointCloud2& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::PointCloud2 that will be copied. + */ + eProsima_user_DllExport PointCloud2& operator =( + PointCloud2&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::PointCloud2 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PointCloud2& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::PointCloud2 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PointCloud2& x) const; + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const std_msgs::msg::Header& _header); + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + std_msgs::msg::Header&& _header); + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const std_msgs::msg::Header& header() const; + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport std_msgs::msg::Header& header(); + + + /*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ + eProsima_user_DllExport void height( + uint32_t _height); + + /*! + * @brief This function returns the value of member height + * @return Value of member height + */ + eProsima_user_DllExport uint32_t height() const; + + /*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ + eProsima_user_DllExport uint32_t& height(); + + + /*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ + eProsima_user_DllExport void width( + uint32_t _width); + + /*! + * @brief This function returns the value of member width + * @return Value of member width + */ + eProsima_user_DllExport uint32_t width() const; + + /*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ + eProsima_user_DllExport uint32_t& width(); + + + /*! + * @brief This function copies the value in member fields + * @param _fields New value to be copied in member fields + */ + eProsima_user_DllExport void fields( + const std::vector& _fields); + + /*! + * @brief This function moves the value in member fields + * @param _fields New value to be moved in member fields + */ + eProsima_user_DllExport void fields( + std::vector&& _fields); + + /*! + * @brief This function returns a constant reference to member fields + * @return Constant reference to member fields + */ + eProsima_user_DllExport const std::vector& fields() const; + + /*! + * @brief This function returns a reference to member fields + * @return Reference to member fields + */ + eProsima_user_DllExport std::vector& fields(); + + + /*! + * @brief This function sets a value in member is_bigendian + * @param _is_bigendian New value for member is_bigendian + */ + eProsima_user_DllExport void is_bigendian( + bool _is_bigendian); + + /*! + * @brief This function returns the value of member is_bigendian + * @return Value of member is_bigendian + */ + eProsima_user_DllExport bool is_bigendian() const; + + /*! + * @brief This function returns a reference to member is_bigendian + * @return Reference to member is_bigendian + */ + eProsima_user_DllExport bool& is_bigendian(); + + + /*! + * @brief This function sets a value in member point_step + * @param _point_step New value for member point_step + */ + eProsima_user_DllExport void point_step( + uint32_t _point_step); + + /*! + * @brief This function returns the value of member point_step + * @return Value of member point_step + */ + eProsima_user_DllExport uint32_t point_step() const; + + /*! + * @brief This function returns a reference to member point_step + * @return Reference to member point_step + */ + eProsima_user_DllExport uint32_t& point_step(); + + + /*! + * @brief This function sets a value in member row_step + * @param _row_step New value for member row_step + */ + eProsima_user_DllExport void row_step( + uint32_t _row_step); + + /*! + * @brief This function returns the value of member row_step + * @return Value of member row_step + */ + eProsima_user_DllExport uint32_t row_step() const; + + /*! + * @brief This function returns a reference to member row_step + * @return Reference to member row_step + */ + eProsima_user_DllExport uint32_t& row_step(); + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data(); + + + /*! + * @brief This function sets a value in member is_dense + * @param _is_dense New value for member is_dense + */ + eProsima_user_DllExport void is_dense( + bool _is_dense); + + /*! + * @brief This function returns the value of member is_dense + * @return Value of member is_dense + */ + eProsima_user_DllExport bool is_dense() const; + + /*! + * @brief This function returns a reference to member is_dense + * @return Reference to member is_dense + */ + eProsima_user_DllExport bool& is_dense(); private: - std_msgs::msg::Header m_header; - uint32_t m_height; - uint32_t m_width; - std::vector m_fields; - bool m_is_bigendian; - uint32_t m_point_step; - uint32_t m_row_step; - vector_type m_data; - bool m_is_dense; + + std_msgs::msg::Header m_header; + uint32_t m_height{0}; + uint32_t m_width{0}; + std::vector m_fields; + bool m_is_bigendian{false}; + uint32_t m_point_step{0}; + uint32_t m_row_step{0}; + std::vector m_data; + bool m_is_dense{false}; + }; -using PointCloud2 = PointCloud2T>; +} // namespace msg + +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ -} // namespace msg -} // namespace sensor_msgs -#include "PointCloud2.cc" -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2CdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2CdrAux.hpp new file mode 100644 index 00000000000..495ba270564 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2CdrAux.hpp @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCloud2CdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2CDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2CDRAUX_HPP_ + +#include "PointCloud2.h" + +constexpr uint32_t sensor_msgs_msg_PointCloud2_max_cdr_typesize {28013UL}; +constexpr uint32_t sensor_msgs_msg_PointCloud2_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::PointCloud2& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2CDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2CdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2CdrAux.ipp new file mode 100644 index 00000000000..4a1f5c11621 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2CdrAux.ipp @@ -0,0 +1,194 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCloud2CdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2CDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2CDRAUX_IPP_ + +#include "PointCloud2CdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::PointCloud2& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.height(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.width(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.fields(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.is_bigendian(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.point_step(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.row_step(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.data(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.is_dense(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::PointCloud2& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.height() + << eprosima::fastcdr::MemberId(2) << data.width() + << eprosima::fastcdr::MemberId(3) << data.fields() + << eprosima::fastcdr::MemberId(4) << data.is_bigendian() + << eprosima::fastcdr::MemberId(5) << data.point_step() + << eprosima::fastcdr::MemberId(6) << data.row_step() + << eprosima::fastcdr::MemberId(7) << data.data() + << eprosima::fastcdr::MemberId(8) << data.is_dense() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::PointCloud2& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.height(); + break; + + case 2: + dcdr >> data.width(); + break; + + case 3: + dcdr >> data.fields(); + break; + + case 4: + dcdr >> data.is_bigendian(); + break; + + case 5: + dcdr >> data.point_step(); + break; + + case 6: + dcdr >> data.row_step(); + break; + + case 7: + dcdr >> data.data(); + break; + + case 8: + dcdr >> data.is_dense(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::PointCloud2& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2CDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cc b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cc deleted file mode 100644 index 3ed3d81e7f2..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cc +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file PointCloud2PubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#include -#include - -#include "PointCloud2PubSubTypes.h" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; - -namespace sensor_msgs { -namespace msg { -template -PointCloud2PubSubTypeT::PointCloud2PubSubTypeT() { - setName("sensor_msgs::msg::dds_::PointCloud2_"); - auto type_size = PointCloud2T::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PointCloud2T::isKeyDefined(); - size_t keyLength = PointCloud2T::getKeyMaxCdrSerializedSize() > 16 - ? PointCloud2T::getKeyMaxCdrSerializedSize() - : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -template -PointCloud2PubSubTypeT::~PointCloud2PubSubTypeT() { - if (m_keyBuffer != nullptr) { - free(m_keyBuffer); - } -} - -template -bool PointCloud2PubSubTypeT::serialize(void* data, SerializedPayload_t* payload) { - PointCloud2T* p_type = static_cast*>(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try { - // Serialize the object. - p_type->serialize(ser); - } catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; -} - -template -bool PointCloud2PubSubTypeT::deserialize(SerializedPayload_t* payload, void* data) { - try { - // Convert DATA to pointer of your type - PointCloud2T* p_type = static_cast*>(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) { - return false; - } - - return true; -} - -template -std::function PointCloud2PubSubTypeT::getSerializedSizeProvider(void* data) { - return [data]() -> uint32_t { - return static_cast(type::getCdrSerializedSize(*static_cast*>(data))) + - 4u /*encapsulation*/; - }; -} - -template -void* PointCloud2PubSubTypeT::createData() { - return reinterpret_cast(new PointCloud2T()); -} - -template -void PointCloud2PubSubTypeT::deleteData(void* data) { - delete (reinterpret_cast*>(data)); -} - -template -bool PointCloud2PubSubTypeT::getKey(void* data, InstanceHandle_t* handle, bool force_md5) { - if (!m_isGetKeyDefined) { - return false; - } - - PointCloud2T* p_type = static_cast*>(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PointCloud2T::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PointCloud2T::getKeyMaxCdrSerializedSize() > 16) { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) { - handle->value[i] = m_md5.digest[i]; - } - } else { - for (uint8_t i = 0; i < 16; ++i) { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} -} // End of namespace msg -} // End of namespace sensor_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cxx new file mode 100644 index 00000000000..20d26b966c7 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.cxx @@ -0,0 +1,198 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointCloud2PubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + + +#include +#include + +#include + +#include "PointCloud2PubSubTypes.h" +#include "PointCloud2CdrAux.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace sensor_msgs { +namespace msg { + + +PointCloud2PubSubType::PointCloud2PubSubType() +{ + setName("sensor_msgs::msg::dds_::PointCloud2_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PointCloud2::getMaxCdrSerializedSize()); +#else + sensor_msgs_msg_PointCloud2_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PointCloud2PubSubType::~PointCloud2PubSubType() +{ +} + +bool PointCloud2PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PointCloud2* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PointCloud2PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PointCloud2* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PointCloud2PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PointCloud2PubSubType::createData() +{ + return reinterpret_cast(new PointCloud2()); +} + +void PointCloud2PubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PointCloud2PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + +} //End of namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.h index bc992c03d29..35c4abe3427 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointCloud2PubSubTypes.h @@ -13,87 +13,125 @@ // limitations under the License. /*! - * @file PointCloud2PubSubTypeTs.h + * @file PointCloud2PubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "PointCloud2.h" -#include "PointFieldPubSubTypes.h" #include "std_msgs/msg/HeaderPubSubTypes.h" +#include "PointFieldPubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated PointCloud2 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated PointCloud2 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace sensor_msgs { namespace msg { + + /*! * @brief This class represents the TopicDataType of the type PointCloud2 defined by the user in the IDL file. - * @ingroup POINTCLOUD2 + * @ingroup PointCloud2 */ -template -class PointCloud2PubSubTypeT : public eprosima::fastdds::dds::TopicDataType { +class PointCloud2PubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef PointCloud2T type; - eProsima_user_DllExport PointCloud2PubSubTypeT(); + typedef PointCloud2 type; + + eProsima_user_DllExport PointCloud2PubSubType(); + + eProsima_user_DllExport ~PointCloud2PubSubType() override; - eProsima_user_DllExport virtual ~PointCloud2PubSubTypeT() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; -}; -using PointCloud2PubSubType = PointCloud2PubSubTypeT>; +}; } // namespace msg } // namespace sensor_msgs -#include "PointCloud2PubSubTypes.cc" +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTCLOUD2_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.cxx index 9bc2e3fd7a9..5c883168e00 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.cxx @@ -14,9 +14,9 @@ /*! * @file PointField.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,33 +27,35 @@ char dummy; #endif // _WIN32 #include "PointField.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define sensor_msgs_msg_PointField_max_cdr_typesize 272ULL; -#define sensor_msgs_msg_PointField_max_key_cdr_typesize 0ULL; -sensor_msgs::msg::PointField::PointField() +namespace sensor_msgs { + +namespace msg { + +namespace PointField_Constants { + + +} // namespace PointField_Constants + + +PointField::PointField() { - // string m_name - m_name =""; - // unsigned long m_offset - m_offset = 0; - // octet m_datatype - m_datatype = 0; - // unsigned long m_count - m_count = 0; } -sensor_msgs::msg::PointField::~PointField() +PointField::~PointField() { } -sensor_msgs::msg::PointField::PointField( +PointField::PointField( const PointField& x) { m_name = x.m_name; @@ -62,7 +64,7 @@ sensor_msgs::msg::PointField::PointField( m_count = x.m_count; } -sensor_msgs::msg::PointField::PointField( +PointField::PointField( PointField&& x) noexcept { m_name = std::move(x.m_name); @@ -71,83 +73,48 @@ sensor_msgs::msg::PointField::PointField( m_count = x.m_count; } -sensor_msgs::msg::PointField& sensor_msgs::msg::PointField::operator =( +PointField& PointField::operator =( const PointField& x) { + m_name = x.m_name; m_offset = x.m_offset; m_datatype = x.m_datatype; m_count = x.m_count; - return *this; } -sensor_msgs::msg::PointField& sensor_msgs::msg::PointField::operator =( +PointField& PointField::operator =( PointField&& x) noexcept { + m_name = std::move(x.m_name); m_offset = x.m_offset; m_datatype = x.m_datatype; m_count = x.m_count; - return *this; } -bool sensor_msgs::msg::PointField::operator ==( +bool PointField::operator ==( const PointField& x) const { - return (m_name == x.m_name && m_offset == x.m_offset && m_datatype == x.m_datatype && m_count == x.m_count); + return (m_name == x.m_name && + m_offset == x.m_offset && + m_datatype == x.m_datatype && + m_count == x.m_count); } -bool sensor_msgs::msg::PointField::operator !=( +bool PointField::operator !=( const PointField& x) const { return !(*this == x); } -size_t sensor_msgs::msg::PointField::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_PointField_max_cdr_typesize; -} - -size_t sensor_msgs::msg::PointField::getCdrSerializedSize( - const sensor_msgs::msg::PointField& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - return current_alignment - initial_alignment; -} - -void sensor_msgs::msg::PointField::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_name.c_str(); - scdr << m_offset; - scdr << m_datatype; - scdr << m_count; -} - -void sensor_msgs::msg::PointField::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_name; - dcdr >> m_offset; - dcdr >> m_datatype; - dcdr >> m_count; -} - /*! * @brief This function copies the value in member name * @param _name New value to be copied in member name */ -void sensor_msgs::msg::PointField::name( +void PointField::name( const std::string& _name) { m_name = _name; @@ -157,7 +124,7 @@ void sensor_msgs::msg::PointField::name( * @brief This function moves the value in member name * @param _name New value to be moved in member name */ -void sensor_msgs::msg::PointField::name( +void PointField::name( std::string&& _name) { m_name = std::move(_name); @@ -167,7 +134,7 @@ void sensor_msgs::msg::PointField::name( * @brief This function returns a constant reference to member name * @return Constant reference to member name */ -const std::string& sensor_msgs::msg::PointField::name() const +const std::string& PointField::name() const { return m_name; } @@ -176,16 +143,17 @@ const std::string& sensor_msgs::msg::PointField::name() const * @brief This function returns a reference to member name * @return Reference to member name */ -std::string& sensor_msgs::msg::PointField::name() +std::string& PointField::name() { return m_name; } + /*! * @brief This function sets a value in member offset * @param _offset New value for member offset */ -void sensor_msgs::msg::PointField::offset( +void PointField::offset( uint32_t _offset) { m_offset = _offset; @@ -195,7 +163,7 @@ void sensor_msgs::msg::PointField::offset( * @brief This function returns the value of member offset * @return Value of member offset */ -uint32_t sensor_msgs::msg::PointField::offset() const +uint32_t PointField::offset() const { return m_offset; } @@ -204,16 +172,17 @@ uint32_t sensor_msgs::msg::PointField::offset() const * @brief This function returns a reference to member offset * @return Reference to member offset */ -uint32_t& sensor_msgs::msg::PointField::offset() +uint32_t& PointField::offset() { return m_offset; } + /*! * @brief This function sets a value in member datatype * @param _datatype New value for member datatype */ -void sensor_msgs::msg::PointField::datatype( +void PointField::datatype( uint8_t _datatype) { m_datatype = _datatype; @@ -223,7 +192,7 @@ void sensor_msgs::msg::PointField::datatype( * @brief This function returns the value of member datatype * @return Value of member datatype */ -uint8_t sensor_msgs::msg::PointField::datatype() const +uint8_t PointField::datatype() const { return m_datatype; } @@ -232,16 +201,17 @@ uint8_t sensor_msgs::msg::PointField::datatype() const * @brief This function returns a reference to member datatype * @return Reference to member datatype */ -uint8_t& sensor_msgs::msg::PointField::datatype() +uint8_t& PointField::datatype() { return m_datatype; } + /*! * @brief This function sets a value in member count * @param _count New value for member count */ -void sensor_msgs::msg::PointField::count( +void PointField::count( uint32_t _count) { m_count = _count; @@ -251,7 +221,7 @@ void sensor_msgs::msg::PointField::count( * @brief This function returns the value of member count * @return Value of member count */ -uint32_t sensor_msgs::msg::PointField::count() const +uint32_t PointField::count() const { return m_count; } @@ -260,25 +230,18 @@ uint32_t sensor_msgs::msg::PointField::count() const * @brief This function returns a reference to member count * @return Reference to member count */ -uint32_t& sensor_msgs::msg::PointField::count() +uint32_t& PointField::count() { return m_count; } -size_t sensor_msgs::msg::PointField::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_PointField_max_key_cdr_typesize; -} -bool sensor_msgs::msg::PointField::isKeyDefined() -{ - return false; -} -void sensor_msgs::msg::PointField::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace sensor_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "PointFieldCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.h index ba12c86785c..ab0016a93d2 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointField.h @@ -16,24 +16,28 @@ * @file PointField.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -43,219 +47,205 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(PointField_SOURCE) -#define PointField_DllAPI __declspec(dllexport) +#if defined(POINTFIELD_SOURCE) +#define POINTFIELD_DllAPI __declspec( dllexport ) #else -#define PointField_DllAPI __declspec(dllimport) -#endif // PointField_SOURCE +#define POINTFIELD_DllAPI __declspec( dllimport ) +#endif // POINTFIELD_SOURCE #else -#define PointField_DllAPI +#define POINTFIELD_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define PointField_DllAPI -#endif // _WIN32 +#define POINTFIELD_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace sensor_msgs { + namespace msg { -const uint8_t PointField__INT8 = 1; -const uint8_t PointField__UINT8 = 2; -const uint8_t PointField__INT16 = 3; -const uint8_t PointField__UINT16 = 4; -const uint8_t PointField__INT32 = 5; -const uint8_t PointField__UINT32 = 6; -const uint8_t PointField__FLOAT32 = 7; -const uint8_t PointField__FLOAT64 = 8; + +namespace PointField_Constants { + +const uint8_t INT8 = 1; +const uint8_t UINT8 = 2; +const uint8_t INT16 = 3; +const uint8_t UINT16 = 4; +const uint8_t INT32 = 5; +const uint8_t UINT32 = 6; +const uint8_t FLOAT32 = 7; +const uint8_t FLOAT64 = 8; + +} // namespace PointField_Constants + /*! * @brief This class represents the structure PointField defined by the user in the IDL file. - * @ingroup POINTFIELD + * @ingroup PointField */ -class PointField { +class PointField +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PointField(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PointField(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. - */ - eProsima_user_DllExport PointField(const PointField& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. - */ - eProsima_user_DllExport PointField(PointField&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. - */ - eProsima_user_DllExport PointField& operator=(const PointField& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. - */ - eProsima_user_DllExport PointField& operator=(PointField&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::PointField object to compare. - */ - eProsima_user_DllExport bool operator==(const PointField& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::PointField object to compare. - */ - eProsima_user_DllExport bool operator!=(const PointField& x) const; - - /*! - * @brief This function copies the value in member name - * @param _name New value to be copied in member name - */ - eProsima_user_DllExport void name(const std::string& _name); - - /*! - * @brief This function moves the value in member name - * @param _name New value to be moved in member name - */ - eProsima_user_DllExport void name(std::string&& _name); - - /*! - * @brief This function returns a constant reference to member name - * @return Constant reference to member name - */ - eProsima_user_DllExport const std::string& name() const; - - /*! - * @brief This function returns a reference to member name - * @return Reference to member name - */ - eProsima_user_DllExport std::string& name(); - /*! - * @brief This function sets a value in member offset - * @param _offset New value for member offset - */ - eProsima_user_DllExport void offset(uint32_t _offset); - - /*! - * @brief This function returns the value of member offset - * @return Value of member offset - */ - eProsima_user_DllExport uint32_t offset() const; - - /*! - * @brief This function returns a reference to member offset - * @return Reference to member offset - */ - eProsima_user_DllExport uint32_t& offset(); - - /*! - * @brief This function sets a value in member datatype - * @param _datatype New value for member datatype - */ - eProsima_user_DllExport void datatype(uint8_t _datatype); - - /*! - * @brief This function returns the value of member datatype - * @return Value of member datatype - */ - eProsima_user_DllExport uint8_t datatype() const; - - /*! - * @brief This function returns a reference to member datatype - * @return Reference to member datatype - */ - eProsima_user_DllExport uint8_t& datatype(); - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count(uint32_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint32_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint32_t& count(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::PointField& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PointField(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PointField(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + */ + eProsima_user_DllExport PointField( + const PointField& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + */ + eProsima_user_DllExport PointField( + PointField&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + */ + eProsima_user_DllExport PointField& operator =( + const PointField& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::PointField that will be copied. + */ + eProsima_user_DllExport PointField& operator =( + PointField&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::PointField object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PointField& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::PointField object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PointField& x) const; + + /*! + * @brief This function copies the value in member name + * @param _name New value to be copied in member name + */ + eProsima_user_DllExport void name( + const std::string& _name); + + /*! + * @brief This function moves the value in member name + * @param _name New value to be moved in member name + */ + eProsima_user_DllExport void name( + std::string&& _name); + + /*! + * @brief This function returns a constant reference to member name + * @return Constant reference to member name + */ + eProsima_user_DllExport const std::string& name() const; + + /*! + * @brief This function returns a reference to member name + * @return Reference to member name + */ + eProsima_user_DllExport std::string& name(); + + + /*! + * @brief This function sets a value in member offset + * @param _offset New value for member offset + */ + eProsima_user_DllExport void offset( + uint32_t _offset); + + /*! + * @brief This function returns the value of member offset + * @return Value of member offset + */ + eProsima_user_DllExport uint32_t offset() const; + + /*! + * @brief This function returns a reference to member offset + * @return Reference to member offset + */ + eProsima_user_DllExport uint32_t& offset(); + + + /*! + * @brief This function sets a value in member datatype + * @param _datatype New value for member datatype + */ + eProsima_user_DllExport void datatype( + uint8_t _datatype); + + /*! + * @brief This function returns the value of member datatype + * @return Value of member datatype + */ + eProsima_user_DllExport uint8_t datatype() const; + + /*! + * @brief This function returns a reference to member datatype + * @return Reference to member datatype + */ + eProsima_user_DllExport uint8_t& datatype(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint32_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint32_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint32_t& count(); private: - std::string m_name; - uint32_t m_offset; - uint8_t m_datatype; - uint32_t m_count; + + std::string m_name; + uint32_t m_offset{0}; + uint8_t m_datatype{0}; + uint32_t m_count{0}; + }; -} // namespace msg -} // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ +} // namespace msg + +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldCdrAux.hpp new file mode 100644 index 00000000000..6229c340619 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldCdrAux.hpp @@ -0,0 +1,67 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointFieldCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELDCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELDCDRAUX_HPP_ + +#include "PointField.h" + +constexpr uint32_t sensor_msgs_msg_PointField_max_cdr_typesize {276UL}; +constexpr uint32_t sensor_msgs_msg_PointField_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::PointField& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELDCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldCdrAux.ipp new file mode 100644 index 00000000000..76b7a500dad --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldCdrAux.ipp @@ -0,0 +1,171 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file PointFieldCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELDCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELDCDRAUX_IPP_ + +#include "PointFieldCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::PointField& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.name(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.offset(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.datatype(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.count(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::PointField& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.name() + << eprosima::fastcdr::MemberId(1) << data.offset() + << eprosima::fastcdr::MemberId(2) << data.datatype() + << eprosima::fastcdr::MemberId(3) << data.count() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::PointField& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.name(); + break; + + case 1: + dcdr >> data.offset(); + break; + + case 2: + dcdr >> data.datatype(); + break; + + case 3: + dcdr >> data.count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::PointField& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELDCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.cxx index 8b7587dcfee..b3bf4e9473d 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.cxx @@ -16,157 +16,203 @@ * @file PointFieldPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "PointFieldPubSubTypes.h" +#include "PointFieldCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace sensor_msgs { - namespace msg { - PointFieldPubSubType::PointFieldPubSubType() - { - setName("sensor_msgs::msg::dds_::PointField_"); - auto type_size = PointField::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = PointField::isKeyDefined(); - size_t keyLength = PointField::getKeyMaxCdrSerializedSize() > 16 ? - PointField::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - PointFieldPubSubType::~PointFieldPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool PointFieldPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - PointField* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool PointFieldPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - PointField* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function PointFieldPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* PointFieldPubSubType::createData() - { - return reinterpret_cast(new PointField()); - } - - void PointFieldPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool PointFieldPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - PointField* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - PointField::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || PointField::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { +namespace PointField_Constants { + + + + + + + + + + + + + + + + + +} //End of namespace PointField_Constants + + + +PointFieldPubSubType::PointFieldPubSubType() +{ + setName("sensor_msgs::msg::dds_::PointField_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PointField::getMaxCdrSerializedSize()); +#else + sensor_msgs_msg_PointField_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +PointFieldPubSubType::~PointFieldPubSubType() +{ +} + +bool PointFieldPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PointField* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool PointFieldPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PointField* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function PointFieldPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* PointFieldPubSubType::createData() +{ + return reinterpret_cast(new PointField()); +} + +void PointFieldPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PointFieldPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.h index f787d0a7080..e1a56d6749e 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/PointFieldPubSubTypes.h @@ -16,75 +16,138 @@ * @file PointFieldPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "PointField.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated PointField is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated PointField is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace sensor_msgs { namespace msg { +namespace PointField_Constants { + + + + + + + + + + + + + + + + +} // namespace PointField_Constants + + + /*! * @brief This class represents the TopicDataType of the type PointField defined by the user in the IDL file. - * @ingroup POINTFIELD + * @ingroup PointField */ -class PointFieldPubSubType : public eprosima::fastdds::dds::TopicDataType { +class PointFieldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef PointField type; - eProsima_user_DllExport PointFieldPubSubType(); + typedef PointField type; + + eProsima_user_DllExport PointFieldPubSubType(); + + eProsima_user_DllExport ~PointFieldPubSubType() override; - eProsima_user_DllExport virtual ~PointFieldPubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; + }; } // namespace msg } // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_POINTFIELD_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.cxx index cf97090b2bc..20f024b0526 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.cxx @@ -14,9 +14,9 @@ /*! * @file RegionOfInterest.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,35 +27,31 @@ char dummy; #endif // _WIN32 #include "RegionOfInterest.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define sensor_msgs_msg_RegionOfInterest_max_cdr_typesize 17ULL; -#define sensor_msgs_msg_RegionOfInterest_max_key_cdr_typesize 0ULL; -sensor_msgs::msg::RegionOfInterest::RegionOfInterest() +namespace sensor_msgs { + +namespace msg { + + + +RegionOfInterest::RegionOfInterest() { - // unsigned long m_x_offset - m_x_offset = 0; - // unsigned long m_y_offset - m_y_offset = 0; - // unsigned long m_height - m_height = 0; - // unsigned long m_width - m_width = 0; - // boolean m_do_rectify - m_do_rectify = false; } -sensor_msgs::msg::RegionOfInterest::~RegionOfInterest() +RegionOfInterest::~RegionOfInterest() { } -sensor_msgs::msg::RegionOfInterest::RegionOfInterest( +RegionOfInterest::RegionOfInterest( const RegionOfInterest& x) { m_x_offset = x.m_x_offset; @@ -65,7 +61,7 @@ sensor_msgs::msg::RegionOfInterest::RegionOfInterest( m_do_rectify = x.m_do_rectify; } -sensor_msgs::msg::RegionOfInterest::RegionOfInterest( +RegionOfInterest::RegionOfInterest( RegionOfInterest&& x) noexcept { m_x_offset = x.m_x_offset; @@ -75,89 +71,51 @@ sensor_msgs::msg::RegionOfInterest::RegionOfInterest( m_do_rectify = x.m_do_rectify; } -sensor_msgs::msg::RegionOfInterest& sensor_msgs::msg::RegionOfInterest::operator =( +RegionOfInterest& RegionOfInterest::operator =( const RegionOfInterest& x) { + m_x_offset = x.m_x_offset; m_y_offset = x.m_y_offset; m_height = x.m_height; m_width = x.m_width; m_do_rectify = x.m_do_rectify; - return *this; } -sensor_msgs::msg::RegionOfInterest& sensor_msgs::msg::RegionOfInterest::operator =( +RegionOfInterest& RegionOfInterest::operator =( RegionOfInterest&& x) noexcept { + m_x_offset = x.m_x_offset; m_y_offset = x.m_y_offset; m_height = x.m_height; m_width = x.m_width; m_do_rectify = x.m_do_rectify; - return *this; } -bool sensor_msgs::msg::RegionOfInterest::operator ==( +bool RegionOfInterest::operator ==( const RegionOfInterest& x) const { - return (m_x_offset == x.m_x_offset && m_y_offset == x.m_y_offset && m_height == x.m_height && m_width == x.m_width && m_do_rectify == x.m_do_rectify); + return (m_x_offset == x.m_x_offset && + m_y_offset == x.m_y_offset && + m_height == x.m_height && + m_width == x.m_width && + m_do_rectify == x.m_do_rectify); } -bool sensor_msgs::msg::RegionOfInterest::operator !=( +bool RegionOfInterest::operator !=( const RegionOfInterest& x) const { return !(*this == x); } -size_t sensor_msgs::msg::RegionOfInterest::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_RegionOfInterest_max_cdr_typesize; -} - -size_t sensor_msgs::msg::RegionOfInterest::getCdrSerializedSize( - const sensor_msgs::msg::RegionOfInterest& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; -} - -void sensor_msgs::msg::RegionOfInterest::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_x_offset; - scdr << m_y_offset; - scdr << m_height; - scdr << m_width; - scdr << m_do_rectify; -} - -void sensor_msgs::msg::RegionOfInterest::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_x_offset; - dcdr >> m_y_offset; - dcdr >> m_height; - dcdr >> m_width; - dcdr >> m_do_rectify; -} - /*! * @brief This function sets a value in member x_offset * @param _x_offset New value for member x_offset */ -void sensor_msgs::msg::RegionOfInterest::x_offset( +void RegionOfInterest::x_offset( uint32_t _x_offset) { m_x_offset = _x_offset; @@ -167,7 +125,7 @@ void sensor_msgs::msg::RegionOfInterest::x_offset( * @brief This function returns the value of member x_offset * @return Value of member x_offset */ -uint32_t sensor_msgs::msg::RegionOfInterest::x_offset() const +uint32_t RegionOfInterest::x_offset() const { return m_x_offset; } @@ -176,16 +134,17 @@ uint32_t sensor_msgs::msg::RegionOfInterest::x_offset() const * @brief This function returns a reference to member x_offset * @return Reference to member x_offset */ -uint32_t& sensor_msgs::msg::RegionOfInterest::x_offset() +uint32_t& RegionOfInterest::x_offset() { return m_x_offset; } + /*! * @brief This function sets a value in member y_offset * @param _y_offset New value for member y_offset */ -void sensor_msgs::msg::RegionOfInterest::y_offset( +void RegionOfInterest::y_offset( uint32_t _y_offset) { m_y_offset = _y_offset; @@ -195,7 +154,7 @@ void sensor_msgs::msg::RegionOfInterest::y_offset( * @brief This function returns the value of member y_offset * @return Value of member y_offset */ -uint32_t sensor_msgs::msg::RegionOfInterest::y_offset() const +uint32_t RegionOfInterest::y_offset() const { return m_y_offset; } @@ -204,16 +163,17 @@ uint32_t sensor_msgs::msg::RegionOfInterest::y_offset() const * @brief This function returns a reference to member y_offset * @return Reference to member y_offset */ -uint32_t& sensor_msgs::msg::RegionOfInterest::y_offset() +uint32_t& RegionOfInterest::y_offset() { return m_y_offset; } + /*! * @brief This function sets a value in member height * @param _height New value for member height */ -void sensor_msgs::msg::RegionOfInterest::height( +void RegionOfInterest::height( uint32_t _height) { m_height = _height; @@ -223,7 +183,7 @@ void sensor_msgs::msg::RegionOfInterest::height( * @brief This function returns the value of member height * @return Value of member height */ -uint32_t sensor_msgs::msg::RegionOfInterest::height() const +uint32_t RegionOfInterest::height() const { return m_height; } @@ -232,16 +192,17 @@ uint32_t sensor_msgs::msg::RegionOfInterest::height() const * @brief This function returns a reference to member height * @return Reference to member height */ -uint32_t& sensor_msgs::msg::RegionOfInterest::height() +uint32_t& RegionOfInterest::height() { return m_height; } + /*! * @brief This function sets a value in member width * @param _width New value for member width */ -void sensor_msgs::msg::RegionOfInterest::width( +void RegionOfInterest::width( uint32_t _width) { m_width = _width; @@ -251,7 +212,7 @@ void sensor_msgs::msg::RegionOfInterest::width( * @brief This function returns the value of member width * @return Value of member width */ -uint32_t sensor_msgs::msg::RegionOfInterest::width() const +uint32_t RegionOfInterest::width() const { return m_width; } @@ -260,16 +221,17 @@ uint32_t sensor_msgs::msg::RegionOfInterest::width() const * @brief This function returns a reference to member width * @return Reference to member width */ -uint32_t& sensor_msgs::msg::RegionOfInterest::width() +uint32_t& RegionOfInterest::width() { return m_width; } + /*! * @brief This function sets a value in member do_rectify * @param _do_rectify New value for member do_rectify */ -void sensor_msgs::msg::RegionOfInterest::do_rectify( +void RegionOfInterest::do_rectify( bool _do_rectify) { m_do_rectify = _do_rectify; @@ -279,7 +241,7 @@ void sensor_msgs::msg::RegionOfInterest::do_rectify( * @brief This function returns the value of member do_rectify * @return Value of member do_rectify */ -bool sensor_msgs::msg::RegionOfInterest::do_rectify() const +bool RegionOfInterest::do_rectify() const { return m_do_rectify; } @@ -288,25 +250,18 @@ bool sensor_msgs::msg::RegionOfInterest::do_rectify() const * @brief This function returns a reference to member do_rectify * @return Reference to member do_rectify */ -bool& sensor_msgs::msg::RegionOfInterest::do_rectify() +bool& RegionOfInterest::do_rectify() { return m_do_rectify; } -size_t sensor_msgs::msg::RegionOfInterest::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sensor_msgs_msg_RegionOfInterest_max_key_cdr_typesize; -} -bool sensor_msgs::msg::RegionOfInterest::isKeyDefined() -{ - return false; -} -void sensor_msgs::msg::RegionOfInterest::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace sensor_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "RegionOfInterestCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.h index c36d1ddbafb..fc195e5bfc7 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterest.h @@ -16,24 +16,28 @@ * @file RegionOfInterest.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -44,223 +48,206 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) #if defined(REGIONOFINTEREST_SOURCE) -#define REGIONOFINTEREST_DllAPI __declspec(dllexport) +#define REGIONOFINTEREST_DllAPI __declspec( dllexport ) #else -#define REGIONOFINTEREST_DllAPI __declspec(dllimport) -#endif // REGIONOFINTEREST_SOURCE +#define REGIONOFINTEREST_DllAPI __declspec( dllimport ) +#endif // REGIONOFINTEREST_SOURCE #else #define REGIONOFINTEREST_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else #define REGIONOFINTEREST_DllAPI -#endif // _WIN32 +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace sensor_msgs { + namespace msg { + + + /*! * @brief This class represents the structure RegionOfInterest defined by the user in the IDL file. * @ingroup RegionOfInterest */ -class RegionOfInterest { +class RegionOfInterest +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RegionOfInterest(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RegionOfInterest(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. - */ - eProsima_user_DllExport RegionOfInterest(const RegionOfInterest& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. - */ - eProsima_user_DllExport RegionOfInterest(RegionOfInterest&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. - */ - eProsima_user_DllExport RegionOfInterest& operator=(const RegionOfInterest& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. - */ - eProsima_user_DllExport RegionOfInterest& operator=(RegionOfInterest&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::RegionOfInterest object to compare. - */ - eProsima_user_DllExport bool operator==(const RegionOfInterest& x) const; - - /*! - * @brief Comparison operator. - * @param x sensor_msgs::msg::RegionOfInterest object to compare. - */ - eProsima_user_DllExport bool operator!=(const RegionOfInterest& x) const; - - /*! - * @brief This function sets a value in member x_offset - * @param _x_offset New value for member x_offset - */ - eProsima_user_DllExport void x_offset(uint32_t _x_offset); - - /*! - * @brief This function returns the value of member x_offset - * @return Value of member x_offset - */ - eProsima_user_DllExport uint32_t x_offset() const; - - /*! - * @brief This function returns a reference to member x_offset - * @return Reference to member x_offset - */ - eProsima_user_DllExport uint32_t& x_offset(); - - /*! - * @brief This function sets a value in member y_offset - * @param _y_offset New value for member y_offset - */ - eProsima_user_DllExport void y_offset(uint32_t _y_offset); - - /*! - * @brief This function returns the value of member y_offset - * @return Value of member y_offset - */ - eProsima_user_DllExport uint32_t y_offset() const; - - /*! - * @brief This function returns a reference to member y_offset - * @return Reference to member y_offset - */ - eProsima_user_DllExport uint32_t& y_offset(); - - /*! - * @brief This function sets a value in member height - * @param _height New value for member height - */ - eProsima_user_DllExport void height(uint32_t _height); - - /*! - * @brief This function returns the value of member height - * @return Value of member height - */ - eProsima_user_DllExport uint32_t height() const; - - /*! - * @brief This function returns a reference to member height - * @return Reference to member height - */ - eProsima_user_DllExport uint32_t& height(); - - /*! - * @brief This function sets a value in member width - * @param _width New value for member width - */ - eProsima_user_DllExport void width(uint32_t _width); - - /*! - * @brief This function returns the value of member width - * @return Value of member width - */ - eProsima_user_DllExport uint32_t width() const; - - /*! - * @brief This function returns a reference to member width - * @return Reference to member width - */ - eProsima_user_DllExport uint32_t& width(); - - /*! - * @brief This function sets a value in member do_rectify - * @param _do_rectify New value for member do_rectify - */ - eProsima_user_DllExport void do_rectify(bool _do_rectify); - - /*! - * @brief This function returns the value of member do_rectify - * @return Value of member do_rectify - */ - eProsima_user_DllExport bool do_rectify() const; - - /*! - * @brief This function returns a reference to member do_rectify - * @return Reference to member do_rectify - */ - eProsima_user_DllExport bool& do_rectify(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const sensor_msgs::msg::RegionOfInterest& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RegionOfInterest(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RegionOfInterest(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. + */ + eProsima_user_DllExport RegionOfInterest( + const RegionOfInterest& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. + */ + eProsima_user_DllExport RegionOfInterest( + RegionOfInterest&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. + */ + eProsima_user_DllExport RegionOfInterest& operator =( + const RegionOfInterest& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sensor_msgs::msg::RegionOfInterest that will be copied. + */ + eProsima_user_DllExport RegionOfInterest& operator =( + RegionOfInterest&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::RegionOfInterest object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RegionOfInterest& x) const; + + /*! + * @brief Comparison operator. + * @param x sensor_msgs::msg::RegionOfInterest object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RegionOfInterest& x) const; + + /*! + * @brief This function sets a value in member x_offset + * @param _x_offset New value for member x_offset + */ + eProsima_user_DllExport void x_offset( + uint32_t _x_offset); + + /*! + * @brief This function returns the value of member x_offset + * @return Value of member x_offset + */ + eProsima_user_DllExport uint32_t x_offset() const; + + /*! + * @brief This function returns a reference to member x_offset + * @return Reference to member x_offset + */ + eProsima_user_DllExport uint32_t& x_offset(); + + + /*! + * @brief This function sets a value in member y_offset + * @param _y_offset New value for member y_offset + */ + eProsima_user_DllExport void y_offset( + uint32_t _y_offset); + + /*! + * @brief This function returns the value of member y_offset + * @return Value of member y_offset + */ + eProsima_user_DllExport uint32_t y_offset() const; + + /*! + * @brief This function returns a reference to member y_offset + * @return Reference to member y_offset + */ + eProsima_user_DllExport uint32_t& y_offset(); + + + /*! + * @brief This function sets a value in member height + * @param _height New value for member height + */ + eProsima_user_DllExport void height( + uint32_t _height); + + /*! + * @brief This function returns the value of member height + * @return Value of member height + */ + eProsima_user_DllExport uint32_t height() const; + + /*! + * @brief This function returns a reference to member height + * @return Reference to member height + */ + eProsima_user_DllExport uint32_t& height(); + + + /*! + * @brief This function sets a value in member width + * @param _width New value for member width + */ + eProsima_user_DllExport void width( + uint32_t _width); + + /*! + * @brief This function returns the value of member width + * @return Value of member width + */ + eProsima_user_DllExport uint32_t width() const; + + /*! + * @brief This function returns a reference to member width + * @return Reference to member width + */ + eProsima_user_DllExport uint32_t& width(); + + + /*! + * @brief This function sets a value in member do_rectify + * @param _do_rectify New value for member do_rectify + */ + eProsima_user_DllExport void do_rectify( + bool _do_rectify); + + /*! + * @brief This function returns the value of member do_rectify + * @return Value of member do_rectify + */ + eProsima_user_DllExport bool do_rectify() const; + + /*! + * @brief This function returns a reference to member do_rectify + * @return Reference to member do_rectify + */ + eProsima_user_DllExport bool& do_rectify(); private: - uint32_t m_x_offset; - uint32_t m_y_offset; - uint32_t m_height; - uint32_t m_width; - bool m_do_rectify; + + uint32_t m_x_offset{0}; + uint32_t m_y_offset{0}; + uint32_t m_height{0}; + uint32_t m_width{0}; + bool m_do_rectify{false}; + }; -} // namespace msg -} // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ +} // namespace msg + +} // namespace sensor_msgs + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestCdrAux.hpp new file mode 100644 index 00000000000..c754835efd5 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RegionOfInterestCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTERESTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTERESTCDRAUX_HPP_ + +#include "RegionOfInterest.h" + +constexpr uint32_t sensor_msgs_msg_RegionOfInterest_max_cdr_typesize {21UL}; +constexpr uint32_t sensor_msgs_msg_RegionOfInterest_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::RegionOfInterest& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTERESTCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestCdrAux.ipp new file mode 100644 index 00000000000..c59e7fe543d --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestCdrAux.ipp @@ -0,0 +1,162 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file RegionOfInterestCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTERESTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTERESTCDRAUX_IPP_ + +#include "RegionOfInterestCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const sensor_msgs::msg::RegionOfInterest& data, + size_t& current_alignment) +{ + using namespace sensor_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.x_offset(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.y_offset(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.height(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.width(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.do_rectify(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::RegionOfInterest& data) +{ + using namespace sensor_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.x_offset() + << eprosima::fastcdr::MemberId(1) << data.y_offset() + << eprosima::fastcdr::MemberId(2) << data.height() + << eprosima::fastcdr::MemberId(3) << data.width() + << eprosima::fastcdr::MemberId(4) << data.do_rectify() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + sensor_msgs::msg::RegionOfInterest& data) +{ + using namespace sensor_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.x_offset(); + break; + + case 1: + dcdr >> data.y_offset(); + break; + + case 2: + dcdr >> data.height(); + break; + + case 3: + dcdr >> data.width(); + break; + + case 4: + dcdr >> data.do_rectify(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const sensor_msgs::msg::RegionOfInterest& data) +{ + using namespace sensor_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTERESTCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.cxx index f622836c032..f47cad115d0 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.cxx @@ -16,157 +16,183 @@ * @file RegionOfInterestPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "RegionOfInterestPubSubTypes.h" +#include "RegionOfInterestCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace sensor_msgs { - namespace msg { - RegionOfInterestPubSubType::RegionOfInterestPubSubType() - { - setName("sensor_msgs::msg::dds_::RegionOfInterest_"); - auto type_size = RegionOfInterest::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = RegionOfInterest::isKeyDefined(); - size_t keyLength = RegionOfInterest::getKeyMaxCdrSerializedSize() > 16 ? - RegionOfInterest::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - RegionOfInterestPubSubType::~RegionOfInterestPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool RegionOfInterestPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - RegionOfInterest* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool RegionOfInterestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - RegionOfInterest* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; - } - - std::function RegionOfInterestPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* RegionOfInterestPubSubType::createData() - { - return reinterpret_cast(new RegionOfInterest()); - } - - void RegionOfInterestPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool RegionOfInterestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - RegionOfInterest* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - RegionOfInterest::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || RegionOfInterest::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + +RegionOfInterestPubSubType::RegionOfInterestPubSubType() +{ + setName("sensor_msgs::msg::dds_::RegionOfInterest_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(RegionOfInterest::getMaxCdrSerializedSize()); +#else + sensor_msgs_msg_RegionOfInterest_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +RegionOfInterestPubSubType::~RegionOfInterestPubSubType() +{ +} + +bool RegionOfInterestPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + RegionOfInterest* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool RegionOfInterestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + RegionOfInterest* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function RegionOfInterestPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* RegionOfInterestPubSubType::createData() +{ + return reinterpret_cast(new RegionOfInterest()); +} + +void RegionOfInterestPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool RegionOfInterestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace sensor_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.h index 51dffdf9b7f..017cc414279 100644 --- a/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/sensor_msgs/msg/RegionOfInterestPubSubTypes.h @@ -16,18 +16,25 @@ * @file RegionOfInterestPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "RegionOfInterest.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) #error \ Generated RegionOfInterest is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER @@ -35,88 +42,94 @@ namespace sensor_msgs { namespace msg { -#ifndef SWIG -namespace detail { - -template -struct RegionOfInterest_rob { - friend constexpr typename Tag::type get(Tag) { - return M; - } -}; -struct RegionOfInterest_f { - typedef bool RegionOfInterest::*type; - friend constexpr type get(RegionOfInterest_f); -}; - -template struct RegionOfInterest_rob; - -template -inline size_t constexpr RegionOfInterest_offset_of() { - return ((::size_t) & reinterpret_cast((((T*)0)->*get(Tag())))); -} -} // namespace detail -#endif /*! * @brief This class represents the TopicDataType of the type RegionOfInterest defined by the user in the IDL file. * @ingroup RegionOfInterest */ -class RegionOfInterestPubSubType : public eprosima::fastdds::dds::TopicDataType { +class RegionOfInterestPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef RegionOfInterest type; - eProsima_user_DllExport RegionOfInterestPubSubType(); + typedef RegionOfInterest type; + + eProsima_user_DllExport RegionOfInterestPubSubType(); + + eProsima_user_DllExport ~RegionOfInterestPubSubType() override; - eProsima_user_DllExport virtual ~RegionOfInterestPubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return true; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - new (memory) RegionOfInterest(); - return true; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; - -private: - static constexpr bool is_plain_impl() { - return 17ULL == (detail::RegionOfInterest_offset_of() + sizeof(bool)); - } }; } // namespace msg } // namespace sensor_msgs -#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_REGIONOFINTEREST_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.cxx b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.cxx index a1e4f2dfeec..557d67da896 100644 --- a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.cxx +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.cxx @@ -14,9 +14,9 @@ /*! * @file SolidPrimitive.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,46 +27,35 @@ char dummy; #endif // _WIN32 #include "SolidPrimitive.h" + #include + #include using namespace eprosima::fastcdr::exception; #include +namespace shape_msgs { +namespace msg { +namespace SolidPrimitive_Constants { +} // namespace SolidPrimitive_Constants - - - - - - - - -shape_msgs::msg::SolidPrimitive::SolidPrimitive() +SolidPrimitive::SolidPrimitive() { - // m_type com.eprosima.idl.parser.typecode.PrimitiveTypeCode@43b9fd5 - m_type = 0; - // m_dimensions com.eprosima.idl.parser.typecode.SequenceTypeCode@79dc5318 - - // m_polygon com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@8e50104 - - } -shape_msgs::msg::SolidPrimitive::~SolidPrimitive() +SolidPrimitive::~SolidPrimitive() { - - } -shape_msgs::msg::SolidPrimitive::SolidPrimitive( +SolidPrimitive::SolidPrimitive( const SolidPrimitive& x) { m_type = x.m_type; @@ -74,118 +63,53 @@ shape_msgs::msg::SolidPrimitive::SolidPrimitive( m_polygon = x.m_polygon; } -shape_msgs::msg::SolidPrimitive::SolidPrimitive( - SolidPrimitive&& x) +SolidPrimitive::SolidPrimitive( + SolidPrimitive&& x) noexcept { m_type = x.m_type; m_dimensions = std::move(x.m_dimensions); m_polygon = std::move(x.m_polygon); } -shape_msgs::msg::SolidPrimitive& shape_msgs::msg::SolidPrimitive::operator =( +SolidPrimitive& SolidPrimitive::operator =( const SolidPrimitive& x) { m_type = x.m_type; m_dimensions = x.m_dimensions; m_polygon = x.m_polygon; - return *this; } -shape_msgs::msg::SolidPrimitive& shape_msgs::msg::SolidPrimitive::operator =( - SolidPrimitive&& x) +SolidPrimitive& SolidPrimitive::operator =( + SolidPrimitive&& x) noexcept { m_type = x.m_type; m_dimensions = std::move(x.m_dimensions); m_polygon = std::move(x.m_polygon); - return *this; } -bool shape_msgs::msg::SolidPrimitive::operator ==( +bool SolidPrimitive::operator ==( const SolidPrimitive& x) const { - - return (m_type == x.m_type && m_dimensions == x.m_dimensions && m_polygon == x.m_polygon); + return (m_type == x.m_type && + m_dimensions == x.m_dimensions && + m_polygon == x.m_polygon); } -bool shape_msgs::msg::SolidPrimitive::operator !=( +bool SolidPrimitive::operator !=( const SolidPrimitive& x) const { return !(*this == x); } -size_t shape_msgs::msg::SolidPrimitive::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (3 * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += geometry_msgs::msg::Polygon::getMaxCdrSerializedSize(current_alignment); - - return current_alignment - initial_alignment; -} - -size_t shape_msgs::msg::SolidPrimitive::getCdrSerializedSize( - const shape_msgs::msg::SolidPrimitive& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.dimensions().size() > 0) - { - current_alignment += (data.dimensions().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - current_alignment += geometry_msgs::msg::Polygon::getCdrSerializedSize(data.polygon(), current_alignment); - - return current_alignment - initial_alignment; -} - -void shape_msgs::msg::SolidPrimitive::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_type; - scdr << m_dimensions; - scdr << m_polygon; - -} - -void shape_msgs::msg::SolidPrimitive::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_type; - dcdr >> m_dimensions; - dcdr >> m_polygon; -} - /*! * @brief This function sets a value in member type * @param _type New value for member type */ -void shape_msgs::msg::SolidPrimitive::type( +void SolidPrimitive::type( uint8_t _type) { m_type = _type; @@ -195,7 +119,7 @@ void shape_msgs::msg::SolidPrimitive::type( * @brief This function returns the value of member type * @return Value of member type */ -uint8_t shape_msgs::msg::SolidPrimitive::type() const +uint8_t SolidPrimitive::type() const { return m_type; } @@ -204,16 +128,17 @@ uint8_t shape_msgs::msg::SolidPrimitive::type() const * @brief This function returns a reference to member type * @return Reference to member type */ -uint8_t& shape_msgs::msg::SolidPrimitive::type() +uint8_t& SolidPrimitive::type() { return m_type; } + /*! * @brief This function copies the value in member dimensions * @param _dimensions New value to be copied in member dimensions */ -void shape_msgs::msg::SolidPrimitive::dimensions( +void SolidPrimitive::dimensions( const std::vector& _dimensions) { m_dimensions = _dimensions; @@ -223,7 +148,7 @@ void shape_msgs::msg::SolidPrimitive::dimensions( * @brief This function moves the value in member dimensions * @param _dimensions New value to be moved in member dimensions */ -void shape_msgs::msg::SolidPrimitive::dimensions( +void SolidPrimitive::dimensions( std::vector&& _dimensions) { m_dimensions = std::move(_dimensions); @@ -233,7 +158,7 @@ void shape_msgs::msg::SolidPrimitive::dimensions( * @brief This function returns a constant reference to member dimensions * @return Constant reference to member dimensions */ -const std::vector& shape_msgs::msg::SolidPrimitive::dimensions() const +const std::vector& SolidPrimitive::dimensions() const { return m_dimensions; } @@ -242,15 +167,17 @@ const std::vector& shape_msgs::msg::SolidPrimitive::dimensions() const * @brief This function returns a reference to member dimensions * @return Reference to member dimensions */ -std::vector& shape_msgs::msg::SolidPrimitive::dimensions() +std::vector& SolidPrimitive::dimensions() { return m_dimensions; } + + /*! * @brief This function copies the value in member polygon * @param _polygon New value to be copied in member polygon */ -void shape_msgs::msg::SolidPrimitive::polygon( +void SolidPrimitive::polygon( const geometry_msgs::msg::Polygon& _polygon) { m_polygon = _polygon; @@ -260,7 +187,7 @@ void shape_msgs::msg::SolidPrimitive::polygon( * @brief This function moves the value in member polygon * @param _polygon New value to be moved in member polygon */ -void shape_msgs::msg::SolidPrimitive::polygon( +void SolidPrimitive::polygon( geometry_msgs::msg::Polygon&& _polygon) { m_polygon = std::move(_polygon); @@ -270,7 +197,7 @@ void shape_msgs::msg::SolidPrimitive::polygon( * @brief This function returns a constant reference to member polygon * @return Constant reference to member polygon */ -const geometry_msgs::msg::Polygon& shape_msgs::msg::SolidPrimitive::polygon() const +const geometry_msgs::msg::Polygon& SolidPrimitive::polygon() const { return m_polygon; } @@ -279,31 +206,18 @@ const geometry_msgs::msg::Polygon& shape_msgs::msg::SolidPrimitive::polygon() co * @brief This function returns a reference to member polygon * @return Reference to member polygon */ -geometry_msgs::msg::Polygon& shape_msgs::msg::SolidPrimitive::polygon() +geometry_msgs::msg::Polygon& SolidPrimitive::polygon() { return m_polygon; } -size_t shape_msgs::msg::SolidPrimitive::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - return current_align; -} +} // namespace msg -bool shape_msgs::msg::SolidPrimitive::isKeyDefined() -{ - return false; -} - -void shape_msgs::msg::SolidPrimitive::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace shape_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "SolidPrimitiveCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.h b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.h index 69d227167d0..e47708f90b6 100644 --- a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.h +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitive.h @@ -16,24 +16,29 @@ * @file SolidPrimitive.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_H_ #define _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_H_ -#include "geometry_msgs/msg/Polygon.h" - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "geometry_msgs/msg/Polygon.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -43,27 +48,33 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SolidPrimitive_SOURCE) -#define SolidPrimitive_DllAPI __declspec(dllexport) +#if defined(SOLIDPRIMITIVE_SOURCE) +#define SOLIDPRIMITIVE_DllAPI __declspec( dllexport ) #else -#define SolidPrimitive_DllAPI __declspec(dllimport) -#endif // SolidPrimitive_SOURCE +#define SOLIDPRIMITIVE_DllAPI __declspec( dllimport ) +#endif // SOLIDPRIMITIVE_SOURCE #else -#define SolidPrimitive_DllAPI +#define SOLIDPRIMITIVE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define SolidPrimitive_DllAPI -#endif // _WIN32 +#define SOLIDPRIMITIVE_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace shape_msgs { + namespace msg { + namespace SolidPrimitive_Constants { + const uint8_t BOX = 1; const uint8_t SPHERE = 2; const uint8_t CYLINDER = 3; @@ -78,178 +89,156 @@ const uint8_t CYLINDER_RADIUS = 1; const uint8_t CONE_HEIGHT = 0; const uint8_t CONE_RADIUS = 1; const uint8_t PRISM_HEIGHT = 0; -} // namespace SolidPrimitive_Constants + +} // namespace SolidPrimitive_Constants + + /*! * @brief This class represents the structure SolidPrimitive defined by the user in the IDL file. - * @ingroup SOLIDPRIMITIVE + * @ingroup SolidPrimitive */ -class SolidPrimitive { +class SolidPrimitive +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SolidPrimitive(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SolidPrimitive(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. - */ - eProsima_user_DllExport SolidPrimitive(const SolidPrimitive& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. - */ - eProsima_user_DllExport SolidPrimitive(SolidPrimitive&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. - */ - eProsima_user_DllExport SolidPrimitive& operator=(const SolidPrimitive& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. - */ - eProsima_user_DllExport SolidPrimitive& operator=(SolidPrimitive&& x); - - /*! - * @brief Comparison operator. - * @param x shape_msgs::msg::SolidPrimitive object to compare. - */ - eProsima_user_DllExport bool operator==(const SolidPrimitive& x) const; - - /*! - * @brief Comparison operator. - * @param x shape_msgs::msg::SolidPrimitive object to compare. - */ - eProsima_user_DllExport bool operator!=(const SolidPrimitive& x) const; - - /*! - * @brief This function sets a value in member type - * @param _type New value for member type - */ - eProsima_user_DllExport void type(uint8_t _type); - - /*! - * @brief This function returns the value of member type - * @return Value of member type - */ - eProsima_user_DllExport uint8_t type() const; - - /*! - * @brief This function returns a reference to member type - * @return Reference to member type - */ - eProsima_user_DllExport uint8_t& type(); - - /*! - * @brief This function copies the value in member dimensions - * @param _dimensions New value to be copied in member dimensions - */ - eProsima_user_DllExport void dimensions(const std::vector& _dimensions); - - /*! - * @brief This function moves the value in member dimensions - * @param _dimensions New value to be moved in member dimensions - */ - eProsima_user_DllExport void dimensions(std::vector&& _dimensions); - - /*! - * @brief This function returns a constant reference to member dimensions - * @return Constant reference to member dimensions - */ - eProsima_user_DllExport const std::vector& dimensions() const; - - /*! - * @brief This function returns a reference to member dimensions - * @return Reference to member dimensions - */ - eProsima_user_DllExport std::vector& dimensions(); - /*! - * @brief This function copies the value in member polygon - * @param _polygon New value to be copied in member polygon - */ - eProsima_user_DllExport void polygon(const geometry_msgs::msg::Polygon& _polygon); - - /*! - * @brief This function moves the value in member polygon - * @param _polygon New value to be moved in member polygon - */ - eProsima_user_DllExport void polygon(geometry_msgs::msg::Polygon&& _polygon); - - /*! - * @brief This function returns a constant reference to member polygon - * @return Constant reference to member polygon - */ - eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; - - /*! - * @brief This function returns a reference to member polygon - * @return Reference to member polygon - */ - eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const shape_msgs::msg::SolidPrimitive& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SolidPrimitive(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SolidPrimitive(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. + */ + eProsima_user_DllExport SolidPrimitive( + const SolidPrimitive& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. + */ + eProsima_user_DllExport SolidPrimitive( + SolidPrimitive&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. + */ + eProsima_user_DllExport SolidPrimitive& operator =( + const SolidPrimitive& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object shape_msgs::msg::SolidPrimitive that will be copied. + */ + eProsima_user_DllExport SolidPrimitive& operator =( + SolidPrimitive&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x shape_msgs::msg::SolidPrimitive object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SolidPrimitive& x) const; + + /*! + * @brief Comparison operator. + * @param x shape_msgs::msg::SolidPrimitive object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SolidPrimitive& x) const; + + /*! + * @brief This function sets a value in member type + * @param _type New value for member type + */ + eProsima_user_DllExport void type( + uint8_t _type); + + /*! + * @brief This function returns the value of member type + * @return Value of member type + */ + eProsima_user_DllExport uint8_t type() const; + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport uint8_t& type(); + + + /*! + * @brief This function copies the value in member dimensions + * @param _dimensions New value to be copied in member dimensions + */ + eProsima_user_DllExport void dimensions( + const std::vector& _dimensions); + + /*! + * @brief This function moves the value in member dimensions + * @param _dimensions New value to be moved in member dimensions + */ + eProsima_user_DllExport void dimensions( + std::vector&& _dimensions); + + /*! + * @brief This function returns a constant reference to member dimensions + * @return Constant reference to member dimensions + */ + eProsima_user_DllExport const std::vector& dimensions() const; + + /*! + * @brief This function returns a reference to member dimensions + * @return Reference to member dimensions + */ + eProsima_user_DllExport std::vector& dimensions(); + + + /*! + * @brief This function copies the value in member polygon + * @param _polygon New value to be copied in member polygon + */ + eProsima_user_DllExport void polygon( + const geometry_msgs::msg::Polygon& _polygon); + + /*! + * @brief This function moves the value in member polygon + * @param _polygon New value to be moved in member polygon + */ + eProsima_user_DllExport void polygon( + geometry_msgs::msg::Polygon&& _polygon); + + /*! + * @brief This function returns a constant reference to member polygon + * @return Constant reference to member polygon + */ + eProsima_user_DllExport const geometry_msgs::msg::Polygon& polygon() const; + + /*! + * @brief This function returns a reference to member polygon + * @return Reference to member polygon + */ + eProsima_user_DllExport geometry_msgs::msg::Polygon& polygon(); private: - uint8_t m_type; - std::vector m_dimensions; - geometry_msgs::msg::Polygon m_polygon; + + uint8_t m_type{0}; + std::vector m_dimensions; + geometry_msgs::msg::Polygon m_polygon; + }; -} // namespace msg -} // namespace shape_msgs -#endif // _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_H_ \ No newline at end of file +} // namespace msg + +} // namespace shape_msgs + +#endif // _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitiveCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitiveCdrAux.hpp new file mode 100644 index 00000000000..87ea222fa32 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitiveCdrAux.hpp @@ -0,0 +1,79 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitiveCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVECDRAUX_HPP_ + +#include "SolidPrimitive.h" + +constexpr uint32_t shape_msgs_msg_SolidPrimitive_max_cdr_typesize {1652UL}; +constexpr uint32_t shape_msgs_msg_SolidPrimitive_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const shape_msgs::msg::SolidPrimitive& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitiveCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitiveCdrAux.ipp new file mode 100644 index 00000000000..cc661f348b0 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitiveCdrAux.ipp @@ -0,0 +1,175 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file SolidPrimitiveCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVECDRAUX_IPP_ + +#include "SolidPrimitiveCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const shape_msgs::msg::SolidPrimitive& data, + size_t& current_alignment) +{ + using namespace shape_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.dimensions(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.polygon(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const shape_msgs::msg::SolidPrimitive& data) +{ + using namespace shape_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.type() + << eprosima::fastcdr::MemberId(1) << data.dimensions() + << eprosima::fastcdr::MemberId(2) << data.polygon() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + shape_msgs::msg::SolidPrimitive& data) +{ + using namespace shape_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.type(); + break; + + case 1: + dcdr >> data.dimensions(); + break; + + case 2: + dcdr >> data.polygon(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const shape_msgs::msg::SolidPrimitive& data) +{ + using namespace shape_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.cxx index d2903a0ff85..51eeda1f9ed 100644 --- a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.cxx @@ -16,21 +16,37 @@ * @file SolidPrimitivePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include + +#include #include "SolidPrimitivePubSubTypes.h" +#include "SolidPrimitiveCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace shape_msgs { - namespace msg { - namespace SolidPrimitive_Constants { +namespace msg { +namespace SolidPrimitive_Constants { + + + + + + + + + + + + @@ -46,148 +62,169 @@ namespace shape_msgs { - } //End of namespace SolidPrimitive_Constants - SolidPrimitivePubSubType::SolidPrimitivePubSubType() - { - setName("shape_msgs::msg::dds_::SolidPrimitive_"); - auto type_size = SolidPrimitive::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = SolidPrimitive::isKeyDefined(); - size_t keyLength = SolidPrimitive::getKeyMaxCdrSerializedSize() > 16 ? - SolidPrimitive::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - SolidPrimitivePubSubType::~SolidPrimitivePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool SolidPrimitivePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - SolidPrimitive* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool SolidPrimitivePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - SolidPrimitive* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function SolidPrimitivePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* SolidPrimitivePubSubType::createData() - { - return reinterpret_cast(new SolidPrimitive()); - } - - void SolidPrimitivePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool SolidPrimitivePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - SolidPrimitive* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SolidPrimitive::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || SolidPrimitive::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg + +} //End of namespace SolidPrimitive_Constants + + + +SolidPrimitivePubSubType::SolidPrimitivePubSubType() +{ + setName("shape_msgs::msg::dds_::SolidPrimitive_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SolidPrimitive::getMaxCdrSerializedSize()); +#else + shape_msgs_msg_SolidPrimitive_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +SolidPrimitivePubSubType::~SolidPrimitivePubSubType() +{ +} + +bool SolidPrimitivePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SolidPrimitive* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool SolidPrimitivePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SolidPrimitive* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function SolidPrimitivePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* SolidPrimitivePubSubType::createData() +{ + return reinterpret_cast(new SolidPrimitive()); +} + +void SolidPrimitivePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SolidPrimitivePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace shape_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.h index 3db282002a6..110ddcad3c7 100644 --- a/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/shape_msgs/msg/SolidPrimitivePubSubTypes.h @@ -16,77 +16,151 @@ * @file SolidPrimitivePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "SolidPrimitive.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated SolidPrimitive is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#include "geometry_msgs/msg/PolygonPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated SolidPrimitive is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace shape_msgs { namespace msg { -namespace SolidPrimitive_Constants {} +namespace SolidPrimitive_Constants { + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} // namespace SolidPrimitive_Constants + + + /*! * @brief This class represents the TopicDataType of the type SolidPrimitive defined by the user in the IDL file. - * @ingroup SOLIDPRIMITIVE + * @ingroup SolidPrimitive */ -class SolidPrimitivePubSubType : public eprosima::fastdds::dds::TopicDataType { +class SolidPrimitivePubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef SolidPrimitive type; - eProsima_user_DllExport SolidPrimitivePubSubType(); + typedef SolidPrimitive type; + + eProsima_user_DllExport SolidPrimitivePubSubType(); + + eProsima_user_DllExport ~SolidPrimitivePubSubType() override; - eProsima_user_DllExport virtual ~SolidPrimitivePubSubType(); + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; }; } // namespace msg } // namespace shape_msgs -#endif // _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SHAPE_MSGS_MSG_SOLIDPRIMITIVE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.cxx deleted file mode 100644 index e179cf51609..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.cxx +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Bool.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Bool.h" -#include - -#include -using namespace eprosima::fastcdr::exception; - -#include - -std_msgs::msg::Bool::Bool() -{ - // m_data com.eprosima.idl.parser.typecode.PrimitiveTypeCode@69a10787 - m_data = false; - -} - -std_msgs::msg::Bool::~Bool() -{ -} - -std_msgs::msg::Bool::Bool( - const Bool& x) -{ - m_data = x.m_data; -} - -std_msgs::msg::Bool::Bool( - Bool&& x) -{ - m_data = x.m_data; -} - -std_msgs::msg::Bool& std_msgs::msg::Bool::operator =( - const Bool& x) -{ - - m_data = x.m_data; - - return *this; -} - -std_msgs::msg::Bool& std_msgs::msg::Bool::operator =( - Bool&& x) -{ - - m_data = x.m_data; - - return *this; -} - -bool std_msgs::msg::Bool::operator ==( - const Bool& x) const -{ - - return (m_data == x.m_data); -} - -bool std_msgs::msg::Bool::operator !=( - const Bool& x) const -{ - return !(*this == x); -} - -size_t std_msgs::msg::Bool::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -size_t std_msgs::msg::Bool::getCdrSerializedSize( - const std_msgs::msg::Bool& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - -void std_msgs::msg::Bool::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_data; - -} - -void std_msgs::msg::Bool::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_data; -} - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void std_msgs::msg::Bool::data( - bool _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -bool std_msgs::msg::Bool::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -bool& std_msgs::msg::Bool::data() -{ - return m_data; -} - - -size_t std_msgs::msg::Bool::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - - return current_align; -} - -bool std_msgs::msg::Bool::isKeyDefined() -{ - return false; -} - -void std_msgs::msg::Bool::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} - - diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.h deleted file mode 100644 index 21c453b0fd0..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Bool.h +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Bool.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_H_ - - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Bool_SOURCE) -#define Bool_DllAPI __declspec( dllexport ) -#else -#define Bool_DllAPI __declspec( dllimport ) -#endif // Bool_SOURCE -#else -#define Bool_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define Bool_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - -namespace std_msgs { - namespace msg { - /*! - * @brief This class represents the structure Bool defined by the user in the IDL file. - * @ingroup BOOL - */ - class Bool - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Bool(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Bool(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::Bool that will be copied. - */ - eProsima_user_DllExport Bool( - const Bool& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::Bool that will be copied. - */ - eProsima_user_DllExport Bool( - Bool&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::Bool that will be copied. - */ - eProsima_user_DllExport Bool& operator =( - const Bool& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::Bool that will be copied. - */ - eProsima_user_DllExport Bool& operator =( - Bool&& x); - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::Bool object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Bool& x) const; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::Bool object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Bool& x) const; - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - bool _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport bool data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport bool& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const std_msgs::msg::Bool& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - private: - - bool m_data; - }; - } // namespace msg -} // namespace std_msgs - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.cxx deleted file mode 100644 index 4bc16493adc..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.cxx +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BoolPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - - -#include -#include - -#include "BoolPubSubTypes.h" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; - -namespace std_msgs { - namespace msg { - BoolPubSubType::BoolPubSubType() - { - setName("std_msgs::msg::dds_::Bool_"); - auto type_size = Bool::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Bool::isKeyDefined(); - size_t keyLength = Bool::getKeyMaxCdrSerializedSize() > 16 ? - Bool::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BoolPubSubType::~BoolPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BoolPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Bool* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool BoolPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Bool* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function BoolPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* BoolPubSubType::createData() - { - return reinterpret_cast(new Bool()); - } - - void BoolPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BoolPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Bool* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Bool::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Bool::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg - -} //End of namespace std_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.h deleted file mode 100644 index 78a1771e781..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/BoolPubSubTypes.h +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BoolPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_PUBSUBTYPES_H_ - -#include -#include - -#include "Bool.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error \ - Generated Bool is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace std_msgs -{ - namespace msg - { - /*! - * @brief This class represents the TopicDataType of the type Bool defined by the user in the IDL file. - * @ingroup BOOL - */ - class BoolPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef Bool type; - - eProsima_user_DllExport BoolPubSubType(); - - eProsima_user_DllExport virtual ~BoolPubSubType(); - - eProsima_user_DllExport virtual bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider( - void* data) override; - - eProsima_user_DllExport virtual bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData( - void* data) override; - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - - #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - new (memory) Bool(); - return true; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - }; - } -} - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_BOOL_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.cxx index ea5c80d84ed..bca4f25edfa 100644 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.cxx +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.cxx @@ -14,9 +14,9 @@ /*! * @file Float32.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,97 +27,75 @@ char dummy; #endif // _WIN32 #include "Float32.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define std_msgs_msg_Float32_max_cdr_typesize 4ULL; -#define std_msgs_msg_Float32_max_key_cdr_typesize 0ULL; -std_msgs::msg::Float32::Float32() +namespace std_msgs { + +namespace msg { + + + +Float32::Float32() { - m_data = 0.0; } -std_msgs::msg::Float32::~Float32() +Float32::~Float32() { } -std_msgs::msg::Float32::Float32( +Float32::Float32( const Float32& x) { m_data = x.m_data; } -std_msgs::msg::Float32::Float32( +Float32::Float32( Float32&& x) noexcept { m_data = x.m_data; } -std_msgs::msg::Float32& std_msgs::msg::Float32::operator =( +Float32& Float32::operator =( const Float32& x) { + m_data = x.m_data; return *this; } -std_msgs::msg::Float32& std_msgs::msg::Float32::operator =( +Float32& Float32::operator =( Float32&& x) noexcept { + m_data = x.m_data; return *this; } -bool std_msgs::msg::Float32::operator ==( +bool Float32::operator ==( const Float32& x) const { return (m_data == x.m_data); } -bool std_msgs::msg::Float32::operator !=( +bool Float32::operator !=( const Float32& x) const { return !(*this == x); } -size_t std_msgs::msg::Float32::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return std_msgs_msg_Float32_max_cdr_typesize; -} - -size_t std_msgs::msg::Float32::getCdrSerializedSize( - const std_msgs::msg::Float32& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - return current_alignment - initial_alignment; -} - -void std_msgs::msg::Float32::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_data; -} - -void std_msgs::msg::Float32::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_data; -} - /*! * @brief This function sets a value in member data * @param _data New value for member data */ -void std_msgs::msg::Float32::data( +void Float32::data( float _data) { m_data = _data; @@ -127,7 +105,7 @@ void std_msgs::msg::Float32::data( * @brief This function returns the value of member data * @return Value of member data */ -float std_msgs::msg::Float32::data() const +float Float32::data() const { return m_data; } @@ -136,25 +114,18 @@ float std_msgs::msg::Float32::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -float& std_msgs::msg::Float32::data() +float& Float32::data() { return m_data; } -size_t std_msgs::msg::Float32::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return std_msgs_msg_Float32_max_key_cdr_typesize; -} -bool std_msgs::msg::Float32::isKeyDefined() -{ - return false; -} -void std_msgs::msg::Float32::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace std_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "Float32CdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.h index 6ce054fac44..0fec91c0220 100644 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.h +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32.h @@ -16,24 +16,28 @@ * @file Float32.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ #define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -43,148 +47,123 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Float32_SOURCE) -#define Float32_DllAPI __declspec(dllexport) +#if defined(FLOAT32_SOURCE) +#define FLOAT32_DllAPI __declspec( dllexport ) #else -#define Float32_DllAPI __declspec(dllimport) -#endif // Float32_SOURCE +#define FLOAT32_DllAPI __declspec( dllimport ) +#endif // FLOAT32_SOURCE #else -#define Float32_DllAPI +#define FLOAT32_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Float32_DllAPI -#endif // _WIN32 +#define FLOAT32_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace std_msgs { + namespace msg { + + + /*! * @brief This class represents the structure Float32 defined by the user in the IDL file. - * @ingroup FLOAT32 + * @ingroup Float32 */ -class Float32 { +class Float32 +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Float32(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Float32(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::Float32 that will be copied. - */ - eProsima_user_DllExport Float32(const Float32& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::Float32 that will be copied. - */ - eProsima_user_DllExport Float32(Float32&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::Float32 that will be copied. - */ - eProsima_user_DllExport Float32& operator=(const Float32& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::Float32 that will be copied. - */ - eProsima_user_DllExport Float32& operator=(Float32&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::Float32 object to compare. - */ - eProsima_user_DllExport bool operator==(const Float32& x) const; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::Float32 object to compare. - */ - eProsima_user_DllExport bool operator!=(const Float32& x) const; - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data(float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const std_msgs::msg::Float32& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Float32(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Float32(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + */ + eProsima_user_DllExport Float32( + const Float32& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + */ + eProsima_user_DllExport Float32( + Float32&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + */ + eProsima_user_DllExport Float32& operator =( + const Float32& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object std_msgs::msg::Float32 that will be copied. + */ + eProsima_user_DllExport Float32& operator =( + Float32&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::Float32 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Float32& x) const; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::Float32 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Float32& x) const; + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); private: - float m_data; + + float m_data{0.0}; + }; -} // namespace msg -} // namespace std_msgs -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ +} // namespace msg + +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32CdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32CdrAux.hpp new file mode 100644 index 00000000000..cec1bb34113 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32CdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Float32CdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32CDRAUX_HPP_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32CDRAUX_HPP_ + +#include "Float32.h" + +constexpr uint32_t std_msgs_msg_Float32_max_cdr_typesize {8UL}; +constexpr uint32_t std_msgs_msg_Float32_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::Float32& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32CDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32CdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32CdrAux.ipp new file mode 100644 index 00000000000..8f8c778d236 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32CdrAux.ipp @@ -0,0 +1,130 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Float32CdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32CDRAUX_IPP_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32CDRAUX_IPP_ + +#include "Float32CdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const std_msgs::msg::Float32& data, + size_t& current_alignment) +{ + using namespace std_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::Float32& data) +{ + using namespace std_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.data() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + std_msgs::msg::Float32& data) +{ + using namespace std_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::Float32& data) +{ + using namespace std_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32CDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.cxx index 844ad6011d2..a4fe5cada35 100644 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.cxx @@ -16,157 +16,183 @@ * @file Float32PubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "Float32PubSubTypes.h" +#include "Float32CdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace std_msgs { - namespace msg { - Float32PubSubType::Float32PubSubType() - { - setName("std_msgs::msg::dds_::Float32_"); - auto type_size = Float32::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Float32::isKeyDefined(); - size_t keyLength = Float32::getKeyMaxCdrSerializedSize() > 16 ? - Float32::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - Float32PubSubType::~Float32PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool Float32PubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Float32* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool Float32PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - Float32* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function Float32PubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* Float32PubSubType::createData() - { - return reinterpret_cast(new Float32()); - } - - void Float32PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool Float32PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Float32* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Float32::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Float32::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + +Float32PubSubType::Float32PubSubType() +{ + setName("std_msgs::msg::dds_::Float32_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Float32::getMaxCdrSerializedSize()); +#else + std_msgs_msg_Float32_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +Float32PubSubType::~Float32PubSubType() +{ +} + +bool Float32PubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Float32* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool Float32PubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Float32* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function Float32PubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* Float32PubSubType::createData() +{ + return reinterpret_cast(new Float32()); +} + +void Float32PubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool Float32PubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace std_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.h index f99d6d14933..6e95c734831 100644 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Float32PubSubTypes.h @@ -16,103 +16,120 @@ * @file Float32PubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "Float32.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Float32 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Float32 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace std_msgs { namespace msg { -#ifndef SWIG -namespace detail { -template -struct Float32_rob { - friend constexpr typename Tag::type get(Tag) { - return M; - } -}; -struct Float32_f { - typedef float Float32::*type; - friend constexpr type get(Float32_f); -}; - -template struct Float32_rob; -template -inline size_t constexpr Float32_offset_of() { - return ((::size_t) & reinterpret_cast((((T*)0)->*get(Tag())))); -} -} // namespace detail -#endif /*! * @brief This class represents the TopicDataType of the type Float32 defined by the user in the IDL file. - * @ingroup FLOAT32 + * @ingroup Float32 */ -class Float32PubSubType : public eprosima::fastdds::dds::TopicDataType { +class Float32PubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef Float32 type; - eProsima_user_DllExport Float32PubSubType(); + typedef Float32 type; + + eProsima_user_DllExport Float32PubSubType(); - eProsima_user_DllExport virtual ~Float32PubSubType() override; + eProsima_user_DllExport ~Float32PubSubType() override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return true; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return is_plain_impl(); - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - new (memory) Float32(); - return true; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; -private: - static constexpr bool is_plain_impl() { - return 4ULL == (detail::Float32_offset_of() + sizeof(float)); - } }; } // namespace msg } // namespace std_msgs -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_FLOAT32_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.cxx index 9311644b3f5..7325e497331 100644 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.cxx +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.cxx @@ -14,9 +14,9 @@ /*! * @file Header.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -26,125 +26,81 @@ char dummy; } // namespace #endif // _WIN32 -#include "std_msgs/msg/Header.h" +#include "Header.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -std_msgs::msg::Header::Header() -{ - // m_stamp com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@58e1d9d - // m_frame_id com.eprosima.idl.parser.typecode.StringTypeCode@446a1e84 - m_frame_id =""; +namespace std_msgs { + +namespace msg { + -} -std_msgs::msg::Header::~Header() +Header::Header() { +} +Header::~Header() +{ } -std_msgs::msg::Header::Header( +Header::Header( const Header& x) { m_stamp = x.m_stamp; m_frame_id = x.m_frame_id; } -std_msgs::msg::Header::Header( - Header&& x) +Header::Header( + Header&& x) noexcept { m_stamp = std::move(x.m_stamp); m_frame_id = std::move(x.m_frame_id); } -std_msgs::msg::Header& std_msgs::msg::Header::operator =( +Header& Header::operator =( const Header& x) { m_stamp = x.m_stamp; m_frame_id = x.m_frame_id; - return *this; } -std_msgs::msg::Header& std_msgs::msg::Header::operator =( - Header&& x) +Header& Header::operator =( + Header&& x) noexcept { m_stamp = std::move(x.m_stamp); m_frame_id = std::move(x.m_frame_id); - return *this; } -bool std_msgs::msg::Header::operator ==( +bool Header::operator ==( const Header& x) const { - - return (m_stamp == x.m_stamp && m_frame_id == x.m_frame_id); + return (m_stamp == x.m_stamp && + m_frame_id == x.m_frame_id); } -bool std_msgs::msg::Header::operator !=( +bool Header::operator !=( const Header& x) const { return !(*this == x); } -size_t std_msgs::msg::Header::getMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - - current_alignment += builtin_interfaces::msg::Time::getMaxCdrSerializedSize(current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - - return current_alignment - initial_alignment; -} - -size_t std_msgs::msg::Header::getCdrSerializedSize( - const std_msgs::msg::Header& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - current_alignment += builtin_interfaces::msg::Time::getCdrSerializedSize(data.stamp(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; - - - return current_alignment - initial_alignment; -} - -void std_msgs::msg::Header::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - - scdr << m_stamp; - scdr << m_frame_id; - -} - -void std_msgs::msg::Header::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_stamp; - dcdr >> m_frame_id; -} - /*! * @brief This function copies the value in member stamp * @param _stamp New value to be copied in member stamp */ -void std_msgs::msg::Header::stamp( +void Header::stamp( const builtin_interfaces::msg::Time& _stamp) { m_stamp = _stamp; @@ -154,7 +110,7 @@ void std_msgs::msg::Header::stamp( * @brief This function moves the value in member stamp * @param _stamp New value to be moved in member stamp */ -void std_msgs::msg::Header::stamp( +void Header::stamp( builtin_interfaces::msg::Time&& _stamp) { m_stamp = std::move(_stamp); @@ -164,7 +120,7 @@ void std_msgs::msg::Header::stamp( * @brief This function returns a constant reference to member stamp * @return Constant reference to member stamp */ -const builtin_interfaces::msg::Time& std_msgs::msg::Header::stamp() const +const builtin_interfaces::msg::Time& Header::stamp() const { return m_stamp; } @@ -173,15 +129,17 @@ const builtin_interfaces::msg::Time& std_msgs::msg::Header::stamp() const * @brief This function returns a reference to member stamp * @return Reference to member stamp */ -builtin_interfaces::msg::Time& std_msgs::msg::Header::stamp() +builtin_interfaces::msg::Time& Header::stamp() { return m_stamp; } + + /*! * @brief This function copies the value in member frame_id * @param _frame_id New value to be copied in member frame_id */ -void std_msgs::msg::Header::frame_id( +void Header::frame_id( const std::string& _frame_id) { m_frame_id = _frame_id; @@ -191,7 +149,7 @@ void std_msgs::msg::Header::frame_id( * @brief This function moves the value in member frame_id * @param _frame_id New value to be moved in member frame_id */ -void std_msgs::msg::Header::frame_id( +void Header::frame_id( std::string&& _frame_id) { m_frame_id = std::move(_frame_id); @@ -201,7 +159,7 @@ void std_msgs::msg::Header::frame_id( * @brief This function returns a constant reference to member frame_id * @return Constant reference to member frame_id */ -const std::string& std_msgs::msg::Header::frame_id() const +const std::string& Header::frame_id() const { return m_frame_id; } @@ -210,31 +168,18 @@ const std::string& std_msgs::msg::Header::frame_id() const * @brief This function returns a reference to member frame_id * @return Reference to member frame_id */ -std::string& std_msgs::msg::Header::frame_id() +std::string& Header::frame_id() { return m_frame_id; } -size_t std_msgs::msg::Header::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - return current_align; -} -bool std_msgs::msg::Header::isKeyDefined() -{ - return false; -} +} // namespace msg -void std_msgs::msg::Header::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - -} +} // namespace std_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "HeaderCdrAux.ipp" diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.h index 15c0b45c5af..7830600a303 100644 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.h +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/Header.h @@ -16,24 +16,29 @@ * @file Header.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ #define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ -#include "builtin_interfaces/msg/Time.h" - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "builtin_interfaces/msg/Time.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -43,178 +48,158 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Header_SOURCE) -#define Header_DllAPI __declspec(dllexport) +#if defined(HEADER_SOURCE) +#define HEADER_DllAPI __declspec( dllexport ) #else -#define Header_DllAPI __declspec(dllimport) -#endif // Header_SOURCE +#define HEADER_DllAPI __declspec( dllimport ) +#endif // HEADER_SOURCE #else -#define Header_DllAPI +#define HEADER_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Header_DllAPI -#endif // _WIN32 +#define HEADER_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace std_msgs { + namespace msg { + + + /*! * @brief This class represents the structure Header defined by the user in the IDL file. - * @ingroup HEADER + * @ingroup Header */ -class Header { +class Header +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Header(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Header(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::Header that will be copied. - */ - eProsima_user_DllExport Header(const Header& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::Header that will be copied. - */ - eProsima_user_DllExport Header(Header&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::Header that will be copied. - */ - eProsima_user_DllExport Header& operator=(const Header& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::Header that will be copied. - */ - eProsima_user_DllExport Header& operator=(Header&& x); - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::Header object to compare. - */ - eProsima_user_DllExport bool operator==(const Header& x) const; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::Header object to compare. - */ - eProsima_user_DllExport bool operator!=(const Header& x) const; - - /*! - * @brief This function copies the value in member stamp - * @param _stamp New value to be copied in member stamp - */ - eProsima_user_DllExport void stamp(const builtin_interfaces::msg::Time& _stamp); - - /*! - * @brief This function moves the value in member stamp - * @param _stamp New value to be moved in member stamp - */ - eProsima_user_DllExport void stamp(builtin_interfaces::msg::Time&& _stamp); - - /*! - * @brief This function returns a constant reference to member stamp - * @return Constant reference to member stamp - */ - eProsima_user_DllExport const builtin_interfaces::msg::Time& stamp() const; - - /*! - * @brief This function returns a reference to member stamp - * @return Reference to member stamp - */ - eProsima_user_DllExport builtin_interfaces::msg::Time& stamp(); - /*! - * @brief This function copies the value in member frame_id - * @param _frame_id New value to be copied in member frame_id - */ - eProsima_user_DllExport void frame_id(const std::string& _frame_id); - - /*! - * @brief This function moves the value in member frame_id - * @param _frame_id New value to be moved in member frame_id - */ - eProsima_user_DllExport void frame_id(std::string&& _frame_id); - - /*! - * @brief This function returns a constant reference to member frame_id - * @return Constant reference to member frame_id - */ - eProsima_user_DllExport const std::string& frame_id() const; - - /*! - * @brief This function returns a reference to member frame_id - * @return Reference to member frame_id - */ - eProsima_user_DllExport std::string& frame_id(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const std_msgs::msg::Header& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Header(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Header(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object std_msgs::msg::Header that will be copied. + */ + eProsima_user_DllExport Header( + const Header& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object std_msgs::msg::Header that will be copied. + */ + eProsima_user_DllExport Header( + Header&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object std_msgs::msg::Header that will be copied. + */ + eProsima_user_DllExport Header& operator =( + const Header& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object std_msgs::msg::Header that will be copied. + */ + eProsima_user_DllExport Header& operator =( + Header&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::Header object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Header& x) const; + + /*! + * @brief Comparison operator. + * @param x std_msgs::msg::Header object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Header& x) const; + + /*! + * @brief This function copies the value in member stamp + * @param _stamp New value to be copied in member stamp + */ + eProsima_user_DllExport void stamp( + const builtin_interfaces::msg::Time& _stamp); + + /*! + * @brief This function moves the value in member stamp + * @param _stamp New value to be moved in member stamp + */ + eProsima_user_DllExport void stamp( + builtin_interfaces::msg::Time&& _stamp); + + /*! + * @brief This function returns a constant reference to member stamp + * @return Constant reference to member stamp + */ + eProsima_user_DllExport const builtin_interfaces::msg::Time& stamp() const; + + /*! + * @brief This function returns a reference to member stamp + * @return Reference to member stamp + */ + eProsima_user_DllExport builtin_interfaces::msg::Time& stamp(); + + + /*! + * @brief This function copies the value in member frame_id + * @param _frame_id New value to be copied in member frame_id + */ + eProsima_user_DllExport void frame_id( + const std::string& _frame_id); + + /*! + * @brief This function moves the value in member frame_id + * @param _frame_id New value to be moved in member frame_id + */ + eProsima_user_DllExport void frame_id( + std::string&& _frame_id); + + /*! + * @brief This function returns a constant reference to member frame_id + * @return Constant reference to member frame_id + */ + eProsima_user_DllExport const std::string& frame_id() const; + + /*! + * @brief This function returns a reference to member frame_id + * @return Reference to member frame_id + */ + eProsima_user_DllExport std::string& frame_id(); private: - builtin_interfaces::msg::Time m_stamp; - std::string m_frame_id; + + builtin_interfaces::msg::Time m_stamp; + std::string m_frame_id; + }; -} // namespace msg -} // namespace std_msgs -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ \ No newline at end of file +} // namespace msg + +} // namespace std_msgs + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderCdrAux.hpp new file mode 100644 index 00000000000..b1454ed55bf --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderCdrAux.hpp @@ -0,0 +1,50 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADERCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADERCDRAUX_HPP_ + +#include "Header.h" + +constexpr uint32_t std_msgs_msg_Header_max_cdr_typesize {276UL}; +constexpr uint32_t std_msgs_msg_Header_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::Header& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADERCDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderCdrAux.ipp new file mode 100644 index 00000000000..87637400c62 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderCdrAux.ipp @@ -0,0 +1,138 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HeaderCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADERCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADERCDRAUX_IPP_ + +#include "HeaderCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const std_msgs::msg::Header& data, + size_t& current_alignment) +{ + using namespace std_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.stamp(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.frame_id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::Header& data) +{ + using namespace std_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.stamp() + << eprosima::fastcdr::MemberId(1) << data.frame_id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + std_msgs::msg::Header& data) +{ + using namespace std_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.stamp(); + break; + + case 1: + dcdr >> data.frame_id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const std_msgs::msg::Header& data) +{ + using namespace std_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADERCDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.cxx index 119a111258f..1df295aadc6 100644 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.cxx @@ -16,161 +16,183 @@ * @file HeaderPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include +#include +#include -#include "std_msgs/msg/HeaderPubSubTypes.h" +#include + +#include "HeaderPubSubTypes.h" +#include "HeaderCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace std_msgs { - namespace msg { - HeaderPubSubType::HeaderPubSubType() - { - setName("std_msgs::msg::dds_::Header_"); - auto type_size = Header::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = Header::isKeyDefined(); - size_t keyLength = Header::getKeyMaxCdrSerializedSize() > 16 ? - Header::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - HeaderPubSubType::~HeaderPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool HeaderPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - Header* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool HeaderPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - //Convert DATA to pointer of your type - Header* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function HeaderPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* HeaderPubSubType::createData() - { - return reinterpret_cast(new Header()); - } - - void HeaderPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool HeaderPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - Header* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - Header::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || Header::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - - - } //End of namespace msg +namespace msg { + + +HeaderPubSubType::HeaderPubSubType() +{ + setName("std_msgs::msg::dds_::Header_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Header::getMaxCdrSerializedSize()); +#else + std_msgs_msg_Header_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +HeaderPubSubType::~HeaderPubSubType() +{ +} + +bool HeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + Header* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool HeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + Header* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function HeaderPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* HeaderPubSubType::createData() +{ + return reinterpret_cast(new Header()); +} + +void HeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool HeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + } //End of namespace std_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.h index 5a1aeecb15b..8fc3519cdd2 100644 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/HeaderPubSubTypes.h @@ -16,76 +16,121 @@ * @file HeaderPubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include + +#include "Header.h" -#include "std_msgs/msg/Header.h" +#include "builtin_interfaces/msg/TimePubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated Header is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated Header is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace std_msgs { namespace msg { + + + /*! * @brief This class represents the TopicDataType of the type Header defined by the user in the IDL file. - * @ingroup HEADER + * @ingroup Header */ -class HeaderPubSubType : public eprosima::fastdds::dds::TopicDataType { +class HeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef Header type; - eProsima_user_DllExport HeaderPubSubType(); + typedef Header type; + + eProsima_user_DllExport HeaderPubSubType(); - eProsima_user_DllExport virtual ~HeaderPubSubType(); + eProsima_user_DllExport ~HeaderPubSubType() override; - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; }; } // namespace msg } // namespace std_msgs -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.cxx deleted file mode 100644 index 50afa10b420..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.cxx +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file String.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "String.h" -#include - -#include -using namespace eprosima::fastcdr::exception; - -#include - -#define std_msgs_msg_String_max_cdr_typesize 260ULL; -#define std_msgs_msg_String_max_key_cdr_typesize 0ULL; - -std_msgs::msg::String::String() -{ - // string m_data - m_data =""; -} - -std_msgs::msg::String::~String() -{ -} - -std_msgs::msg::String::String( - const String& x) -{ - m_data = x.m_data; -} - -std_msgs::msg::String::String( - String&& x) noexcept -{ - m_data = std::move(x.m_data); -} - -std_msgs::msg::String& std_msgs::msg::String::operator =( - const String& x) -{ - m_data = x.m_data; - - return *this; -} - -std_msgs::msg::String& std_msgs::msg::String::operator =( - String&& x) noexcept -{ - m_data = std::move(x.m_data); - - return *this; -} - -bool std_msgs::msg::String::operator ==( - const String& x) const -{ - return (m_data == x.m_data); -} - -bool std_msgs::msg::String::operator !=( - const String& x) const -{ - return !(*this == x); -} - -size_t std_msgs::msg::String::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return std_msgs_msg_String_max_cdr_typesize; -} - -size_t std_msgs::msg::String::getCdrSerializedSize( - const std_msgs::msg::String& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.data().size() + 1; - - return current_alignment - initial_alignment; -} - -void std_msgs::msg::String::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_data.c_str(); -} - -void std_msgs::msg::String::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_data; -} - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void std_msgs::msg::String::data( - const std::string& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void std_msgs::msg::String::data( - std::string&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::string& std_msgs::msg::String::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::string& std_msgs::msg::String::data() -{ - return m_data; -} - -size_t std_msgs::msg::String::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return std_msgs_msg_String_max_key_cdr_typesize; -} - -bool std_msgs::msg::String::isKeyDefined() -{ - return false; -} - -void std_msgs::msg::String::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.h deleted file mode 100644 index b50251f6a8e..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/String.h +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file String.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(String_SOURCE) -#define String_DllAPI __declspec(dllexport) -#else -#define String_DllAPI __declspec(dllimport) -#endif // String_SOURCE -#else -#define String_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define String_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace std_msgs { -namespace msg { -/*! - * @brief This class represents the structure String defined by the user in the IDL file. - * @ingroup STRING - */ -class String { -public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport String(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~String(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::String that will be copied. - */ - eProsima_user_DllExport String(const String& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::String that will be copied. - */ - eProsima_user_DllExport String(String&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::String that will be copied. - */ - eProsima_user_DllExport String& operator=(const String& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::String that will be copied. - */ - eProsima_user_DllExport String& operator=(String&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::String object to compare. - */ - eProsima_user_DllExport bool operator==(const String& x) const; - - /*! - * @brief Comparison operator. - * @param x std_msgs::msg::String object to compare. - */ - eProsima_user_DllExport bool operator!=(const String& x) const; - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data(const std::string& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data(std::string&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::string& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::string& data(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const std_msgs::msg::String& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; - -private: - std::string m_data; -}; -} // namespace msg -} // namespace std_msgs - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.cxx deleted file mode 100644 index 241514542d8..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.cxx +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file StringPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#include -#include - -#include "StringPubSubTypes.h" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; - -namespace std_msgs { - namespace msg { - StringPubSubType::StringPubSubType() - { - setName("std_msgs::msg::dds_::String_"); - auto type_size = String::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = String::isKeyDefined(); - size_t keyLength = String::getKeyMaxCdrSerializedSize() > 16 ? - String::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - StringPubSubType::~StringPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool StringPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - String* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool StringPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - String* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function StringPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* StringPubSubType::createData() - { - return reinterpret_cast(new String()); - } - - void StringPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool StringPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - String* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - String::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || String::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg -} //End of namespace std_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.h deleted file mode 100644 index 40561ef040f..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/std_msgs/msg/StringPubSubTypes.h +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file StringPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ - -#include -#include - -#include "String.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated String is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace std_msgs { -namespace msg { - -/*! - * @brief This class represents the TopicDataType of the type String defined by the user in the IDL file. - * @ingroup STRING - */ -class StringPubSubType : public eprosima::fastdds::dds::TopicDataType { -public: - typedef String type; - - eProsima_user_DllExport StringPubSubType(); - - eProsima_user_DllExport virtual ~StringPubSubType() override; - - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; - - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData(void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; -}; -} // namespace msg -} // namespace std_msgs - -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_STRING_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.cxx b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.cxx deleted file mode 100644 index 63f3ad11c5a..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.cxx +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TF2Error.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "TF2Error.h" -#include - -#include -using namespace eprosima::fastcdr::exception; - -#include - -#define tf2_msgs_msg_TF2Error_max_cdr_typesize 264ULL; -#define tf2_msgs_msg_TF2Error_max_key_cdr_typesize 0ULL; - -tf2_msgs::msg::TF2Error::TF2Error() -{ - // octet m_error - m_error = 0; - // string m_error_string - m_error_string =""; -} - -tf2_msgs::msg::TF2Error::~TF2Error() -{ -} - -tf2_msgs::msg::TF2Error::TF2Error( - const TF2Error& x) -{ - m_error = x.m_error; - m_error_string = x.m_error_string; -} - -tf2_msgs::msg::TF2Error::TF2Error( - TF2Error&& x) noexcept -{ - m_error = x.m_error; - m_error_string = std::move(x.m_error_string); -} - -tf2_msgs::msg::TF2Error& tf2_msgs::msg::TF2Error::operator =( - const TF2Error& x) -{ - m_error = x.m_error; - m_error_string = x.m_error_string; - - return *this; -} - -tf2_msgs::msg::TF2Error& tf2_msgs::msg::TF2Error::operator =( - TF2Error&& x) noexcept -{ - m_error = x.m_error; - m_error_string = std::move(x.m_error_string); - - return *this; -} - -bool tf2_msgs::msg::TF2Error::operator ==( - const TF2Error& x) const -{ - return (m_error == x.m_error && m_error_string == x.m_error_string); -} - -bool tf2_msgs::msg::TF2Error::operator !=( - const TF2Error& x) const -{ - return !(*this == x); -} - -size_t tf2_msgs::msg::TF2Error::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return tf2_msgs_msg_TF2Error_max_cdr_typesize; -} - -size_t tf2_msgs::msg::TF2Error::getCdrSerializedSize( - const tf2_msgs::msg::TF2Error& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.error_string().size() + 1; - - return current_alignment - initial_alignment; -} - -void tf2_msgs::msg::TF2Error::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_error; - scdr << m_error_string.c_str(); -} - -void tf2_msgs::msg::TF2Error::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_error; - dcdr >> m_error_string; -} - -/*! - * @brief This function sets a value in member error - * @param _error New value for member error - */ -void tf2_msgs::msg::TF2Error::error( - uint8_t _error) -{ - m_error = _error; -} - -/*! - * @brief This function returns the value of member error - * @return Value of member error - */ -uint8_t tf2_msgs::msg::TF2Error::error() const -{ - return m_error; -} - -/*! - * @brief This function returns a reference to member error - * @return Reference to member error - */ -uint8_t& tf2_msgs::msg::TF2Error::error() -{ - return m_error; -} - -/*! - * @brief This function copies the value in member error_string - * @param _error_string New value to be copied in member error_string - */ -void tf2_msgs::msg::TF2Error::error_string( - const std::string& _error_string) -{ - m_error_string = _error_string; -} - -/*! - * @brief This function moves the value in member error_string - * @param _error_string New value to be moved in member error_string - */ -void tf2_msgs::msg::TF2Error::error_string( - std::string&& _error_string) -{ - m_error_string = std::move(_error_string); -} - -/*! - * @brief This function returns a constant reference to member error_string - * @return Constant reference to member error_string - */ -const std::string& tf2_msgs::msg::TF2Error::error_string() const -{ - return m_error_string; -} - -/*! - * @brief This function returns a reference to member error_string - * @return Reference to member error_string - */ -std::string& tf2_msgs::msg::TF2Error::error_string() -{ - return m_error_string; -} - - -size_t tf2_msgs::msg::TF2Error::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return tf2_msgs_msg_TF2Error_max_key_cdr_typesize; -} - -bool tf2_msgs::msg::TF2Error::isKeyDefined() -{ - return false; -} - -void tf2_msgs::msg::TF2Error::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.h b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.h deleted file mode 100644 index ca688329403..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2Error.h +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TF2Error.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ -#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ - -#include - -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TF2Error_SOURCE) -#define TF2Error_DllAPI __declspec(dllexport) -#else -#define TF2Error_DllAPI __declspec(dllimport) -#endif // TF2Error_SOURCE -#else -#define TF2Error_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TF2Error_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace tf2_msgs { -namespace msg { -const uint8_t TF2Error__NO_ERROR = 0; -const uint8_t TF2Error__LOOKUP_ERROR = 1; -const uint8_t TF2Error__CONNECTIVITY_ERROR = 2; -const uint8_t TF2Error__EXTRAPOLATION_ERROR = 3; -const uint8_t TF2Error__INVALID_ARGUMENT_ERROR = 4; -const uint8_t TF2Error__TIMEOUT_ERROR = 5; -const uint8_t TF2Error__TRANSFORM_ERROR = 6; -/*! - * @brief This class represents the structure TF2Error defined by the user in the IDL file. - * @ingroup TF2ERROR - */ -class TF2Error { -public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TF2Error(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TF2Error(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. - */ - eProsima_user_DllExport TF2Error(const TF2Error& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. - */ - eProsima_user_DllExport TF2Error(TF2Error&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. - */ - eProsima_user_DllExport TF2Error& operator=(const TF2Error& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object tf2_msgs::msg::TF2Error that will be copied. - */ - eProsima_user_DllExport TF2Error& operator=(TF2Error&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x tf2_msgs::msg::TF2Error object to compare. - */ - eProsima_user_DllExport bool operator==(const TF2Error& x) const; - - /*! - * @brief Comparison operator. - * @param x tf2_msgs::msg::TF2Error object to compare. - */ - eProsima_user_DllExport bool operator!=(const TF2Error& x) const; - - /*! - * @brief This function sets a value in member error - * @param _error New value for member error - */ - eProsima_user_DllExport void error(uint8_t _error); - - /*! - * @brief This function returns the value of member error - * @return Value of member error - */ - eProsima_user_DllExport uint8_t error() const; - - /*! - * @brief This function returns a reference to member error - * @return Reference to member error - */ - eProsima_user_DllExport uint8_t& error(); - - /*! - * @brief This function copies the value in member error_string - * @param _error_string New value to be copied in member error_string - */ - eProsima_user_DllExport void error_string(const std::string& _error_string); - - /*! - * @brief This function moves the value in member error_string - * @param _error_string New value to be moved in member error_string - */ - eProsima_user_DllExport void error_string(std::string&& _error_string); - - /*! - * @brief This function returns a constant reference to member error_string - * @return Constant reference to member error_string - */ - eProsima_user_DllExport const std::string& error_string() const; - - /*! - * @brief This function returns a reference to member error_string - * @return Reference to member error_string - */ - eProsima_user_DllExport std::string& error_string(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const tf2_msgs::msg::TF2Error& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; - -private: - uint8_t m_error; - std::string m_error_string; -}; -} // namespace msg -} // namespace tf2_msgs - -#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.cxx deleted file mode 100644 index d49b2c534ee..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.cxx +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TF2ErrorPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#include -#include - -#include "TF2ErrorPubSubTypes.h" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; - -namespace tf2_msgs { - namespace msg { - TF2ErrorPubSubType::TF2ErrorPubSubType() - { - setName("tf2_msgs::msg::dds_::TF2Error_"); - auto type_size = TF2Error::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = TF2Error::isKeyDefined(); - size_t keyLength = TF2Error::getKeyMaxCdrSerializedSize() > 16 ? - TF2Error::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TF2ErrorPubSubType::~TF2ErrorPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TF2ErrorPubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - TF2Error* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TF2ErrorPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - TF2Error* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TF2ErrorPubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TF2ErrorPubSubType::createData() - { - return reinterpret_cast(new TF2Error()); - } - - void TF2ErrorPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TF2ErrorPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - TF2Error* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - TF2Error::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || TF2Error::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg -} //End of namespace tf2_msgs diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.h deleted file mode 100644 index c63c7bd3fc9..00000000000 --- a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TF2ErrorPubSubTypes.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TF2ErrorPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastcdrgen. - */ - -#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ - -#include -#include - -#include "TF2Error.h" - -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated TF2Error is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -namespace tf2_msgs { -namespace msg { -/*! - * @brief This class represents the TopicDataType of the type TF2Error defined by the user in the IDL file. - * @ingroup TF2ERROR - */ -class TF2ErrorPubSubType : public eprosima::fastdds::dds::TopicDataType { -public: - typedef TF2Error type; - - eProsima_user_DllExport TF2ErrorPubSubType(); - - eProsima_user_DllExport virtual ~TF2ErrorPubSubType() override; - - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; - - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; - - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport virtual void* createData() override; - - eProsima_user_DllExport virtual void deleteData(void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; -}; -} // namespace msg -} // namespace tf2_msgs - -#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TF2ERROR_PUBSUBTYPES_H_ diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.cxx b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.cxx index 86824a99acf..af688a9d630 100644 --- a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.cxx +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.cxx @@ -14,9 +14,9 @@ /*! * @file TFMessage.cpp - * This source file contains the definition of the described types in the IDL file. + * This source file contains the implementation of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifdef _WIN32 @@ -27,115 +27,77 @@ char dummy; #endif // _WIN32 #include "TFMessage.h" + #include + #include using namespace eprosima::fastcdr::exception; #include -#define geometry_msgs_msg_Vector3_max_cdr_typesize 24ULL; -#define geometry_msgs_msg_Transform_max_cdr_typesize 56ULL; -#define tf2_msgs_msg_TFMessage_max_cdr_typesize 58408ULL; -#define std_msgs_msg_Time_max_cdr_typesize 8ULL; -#define geometry_msgs_msg_TransformStamped_max_cdr_typesize 584ULL; -#define geometry_msgs_msg_Quaternion_max_cdr_typesize 32ULL; -#define std_msgs_msg_Header_max_cdr_typesize 268ULL; -#define geometry_msgs_msg_Vector3_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Transform_max_key_cdr_typesize 0ULL; -#define tf2_msgs_msg_TFMessage_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Time_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_TransformStamped_max_key_cdr_typesize 0ULL; -#define geometry_msgs_msg_Quaternion_max_key_cdr_typesize 0ULL; -#define std_msgs_msg_Header_max_key_cdr_typesize 0ULL; - -tf2_msgs::msg::TFMessage::TFMessage() + +namespace tf2_msgs { + +namespace msg { + + + + + +TFMessage::TFMessage() { } -tf2_msgs::msg::TFMessage::~TFMessage() +TFMessage::~TFMessage() { } -tf2_msgs::msg::TFMessage::TFMessage( +TFMessage::TFMessage( const TFMessage& x) { m_transforms = x.m_transforms; } -tf2_msgs::msg::TFMessage::TFMessage( +TFMessage::TFMessage( TFMessage&& x) noexcept { m_transforms = std::move(x.m_transforms); } -tf2_msgs::msg::TFMessage& tf2_msgs::msg::TFMessage::operator =( +TFMessage& TFMessage::operator =( const TFMessage& x) { - m_transforms = x.m_transforms; + m_transforms = x.m_transforms; return *this; } -tf2_msgs::msg::TFMessage& tf2_msgs::msg::TFMessage::operator =( +TFMessage& TFMessage::operator =( TFMessage&& x) noexcept { - m_transforms = std::move(x.m_transforms); + m_transforms = std::move(x.m_transforms); return *this; } -bool tf2_msgs::msg::TFMessage::operator ==( +bool TFMessage::operator ==( const TFMessage& x) const { return (m_transforms == x.m_transforms); } -bool tf2_msgs::msg::TFMessage::operator !=( +bool TFMessage::operator !=( const TFMessage& x) const { return !(*this == x); } -size_t tf2_msgs::msg::TFMessage::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return tf2_msgs_msg_TFMessage_max_cdr_typesize; -} - -size_t tf2_msgs::msg::TFMessage::getCdrSerializedSize( - const tf2_msgs::msg::TFMessage& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(size_t a = 0; a < data.transforms().size(); ++a) - { - current_alignment += geometry_msgs::msg::TransformStamped::getCdrSerializedSize(data.transforms().at(a), current_alignment); - } - - return current_alignment - initial_alignment; -} - -void tf2_msgs::msg::TFMessage::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_transforms; -} - -void tf2_msgs::msg::TFMessage::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_transforms; -} - /*! * @brief This function copies the value in member transforms * @param _transforms New value to be copied in member transforms */ -void tf2_msgs::msg::TFMessage::transforms( +void TFMessage::transforms( const std::vector& _transforms) { m_transforms = _transforms; @@ -145,7 +107,7 @@ void tf2_msgs::msg::TFMessage::transforms( * @brief This function moves the value in member transforms * @param _transforms New value to be moved in member transforms */ -void tf2_msgs::msg::TFMessage::transforms( +void TFMessage::transforms( std::vector&& _transforms) { m_transforms = std::move(_transforms); @@ -155,7 +117,7 @@ void tf2_msgs::msg::TFMessage::transforms( * @brief This function returns a constant reference to member transforms * @return Constant reference to member transforms */ -const std::vector& tf2_msgs::msg::TFMessage::transforms() const +const std::vector& TFMessage::transforms() const { return m_transforms; } @@ -164,25 +126,18 @@ const std::vector& tf2_msgs::msg::TFMessag * @brief This function returns a reference to member transforms * @return Reference to member transforms */ -std::vector& tf2_msgs::msg::TFMessage::transforms() +std::vector& TFMessage::transforms() { return m_transforms; } -size_t tf2_msgs::msg::TFMessage::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return tf2_msgs_msg_TFMessage_max_key_cdr_typesize; -} -bool tf2_msgs::msg::TFMessage::isKeyDefined() -{ - return false; -} -void tf2_msgs::msg::TFMessage::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} + +} // namespace msg + + +} // namespace tf2_msgs +// Include auxiliary functions like for serializing/deserializing. +#include "TFMessageCdrAux.ipp" + diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.h b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.h index f10efd2114e..b0164a0c720 100644 --- a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.h +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessage.h @@ -16,26 +16,29 @@ * @file TFMessage.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ #ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ #define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ -#include "geometry_msgs/msg/TransformStamped.h" - -#include - -#include #include #include +#include #include #include #include +#include +#include +#include + +#include "geometry_msgs/msg/TransformStamped.h" + + #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec(dllexport) +#define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport #endif // EPROSIMA_USER_DLL_EXPORT @@ -45,154 +48,132 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TFMessage_SOURCE) -#define TFMessage_DllAPI __declspec(dllexport) +#if defined(TFMESSAGE_SOURCE) +#define TFMESSAGE_DllAPI __declspec( dllexport ) #else -#define TFMessage_DllAPI __declspec(dllimport) -#endif // TFMessage_SOURCE +#define TFMESSAGE_DllAPI __declspec( dllimport ) +#endif // TFMESSAGE_SOURCE #else -#define TFMessage_DllAPI +#define TFMESSAGE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TFMessage_DllAPI -#endif // _WIN32 +#define TFMESSAGE_DllAPI +#endif // _WIN32 namespace eprosima { namespace fastcdr { class Cdr; -} // namespace fastcdr -} // namespace eprosima +class CdrSizeCalculator; +} // namespace fastcdr +} // namespace eprosima + + namespace tf2_msgs { + namespace msg { + + + + + /*! * @brief This class represents the structure TFMessage defined by the user in the IDL file. - * @ingroup TFMESSAGE + * @ingroup TFMessage */ -class TFMessage { +class TFMessage +{ public: - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TFMessage(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TFMessage(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. - */ - eProsima_user_DllExport TFMessage(const TFMessage& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. - */ - eProsima_user_DllExport TFMessage(TFMessage&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. - */ - eProsima_user_DllExport TFMessage& operator=(const TFMessage& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. - */ - eProsima_user_DllExport TFMessage& operator=(TFMessage&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x tf2_msgs::msg::TFMessage object to compare. - */ - eProsima_user_DllExport bool operator==(const TFMessage& x) const; - - /*! - * @brief Comparison operator. - * @param x tf2_msgs::msg::TFMessage object to compare. - */ - eProsima_user_DllExport bool operator!=(const TFMessage& x) const; - - /*! - * @brief This function copies the value in member transforms - * @param _transforms New value to be copied in member transforms - */ - eProsima_user_DllExport void transforms(const std::vector& _transforms); - - /*! - * @brief This function moves the value in member transforms - * @param _transforms New value to be moved in member transforms - */ - eProsima_user_DllExport void transforms(std::vector&& _transforms); - - /*! - * @brief This function returns a constant reference to member transforms - * @return Constant reference to member transforms - */ - eProsima_user_DllExport const std::vector& transforms() const; - - /*! - * @brief This function returns a reference to member transforms - * @return Reference to member transforms - */ - eProsima_user_DllExport std::vector& transforms(); - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize(const tf2_msgs::msg::TFMessage& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TFMessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TFMessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + */ + eProsima_user_DllExport TFMessage( + const TFMessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + */ + eProsima_user_DllExport TFMessage( + TFMessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + */ + eProsima_user_DllExport TFMessage& operator =( + const TFMessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object tf2_msgs::msg::TFMessage that will be copied. + */ + eProsima_user_DllExport TFMessage& operator =( + TFMessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x tf2_msgs::msg::TFMessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TFMessage& x) const; + + /*! + * @brief Comparison operator. + * @param x tf2_msgs::msg::TFMessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TFMessage& x) const; + + /*! + * @brief This function copies the value in member transforms + * @param _transforms New value to be copied in member transforms + */ + eProsima_user_DllExport void transforms( + const std::vector& _transforms); + + /*! + * @brief This function moves the value in member transforms + * @param _transforms New value to be moved in member transforms + */ + eProsima_user_DllExport void transforms( + std::vector&& _transforms); + + /*! + * @brief This function returns a constant reference to member transforms + * @return Constant reference to member transforms + */ + eProsima_user_DllExport const std::vector& transforms() const; + + /*! + * @brief This function returns a reference to member transforms + * @return Reference to member transforms + */ + eProsima_user_DllExport std::vector& transforms(); private: - std::vector m_transforms; + + std::vector m_transforms; + }; -} // namespace msg -} // namespace tf2_msgs -#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ +} // namespace msg + +} // namespace tf2_msgs + +#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_H_ + + + diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessageCdrAux.hpp b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessageCdrAux.hpp new file mode 100644 index 00000000000..37cb626dc86 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessageCdrAux.hpp @@ -0,0 +1,55 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TFMessageCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGECDRAUX_HPP_ +#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGECDRAUX_HPP_ + +#include "TFMessage.h" + +constexpr uint32_t tf2_msgs_msg_TFMessage_max_cdr_typesize {61608UL}; +constexpr uint32_t tf2_msgs_msg_TFMessage_max_key_cdr_typesize {0UL}; + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const tf2_msgs::msg::TFMessage& data); + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGECDRAUX_HPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessageCdrAux.ipp b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessageCdrAux.ipp new file mode 100644 index 00000000000..ee7632e2957 --- /dev/null +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessageCdrAux.ipp @@ -0,0 +1,132 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TFMessageCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen (version: 3.3.2). + */ + +#ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGECDRAUX_IPP_ +#define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGECDRAUX_IPP_ + +#include "TFMessageCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const tf2_msgs::msg::TFMessage& data, + size_t& current_alignment) +{ + using namespace tf2_msgs::msg; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.transforms(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const tf2_msgs::msg::TFMessage& data) +{ + using namespace tf2_msgs::msg; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.transforms() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + tf2_msgs::msg::TFMessage& data) +{ + using namespace tf2_msgs::msg; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.transforms(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const tf2_msgs::msg::TFMessage& data) +{ + using namespace tf2_msgs::msg; + + static_cast(scdr); + static_cast(data); +} + + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGECDRAUX_IPP_ + diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.cxx b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.cxx index 526d0356d44..b0f08b3f429 100644 --- a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.cxx +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.cxx @@ -16,157 +16,185 @@ * @file TFMessagePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ -#include -#include + +#include +#include + +#include #include "TFMessagePubSubTypes.h" +#include "TFMessageCdrAux.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace tf2_msgs { - namespace msg { - TFMessagePubSubType::TFMessagePubSubType() - { - setName("tf2_msgs::msg::dds_::TFMessage_"); - auto type_size = TFMessage::getMaxCdrSerializedSize(); - type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ - m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ - m_isGetKeyDefined = TFMessage::isKeyDefined(); - size_t keyLength = TFMessage::getKeyMaxCdrSerializedSize() > 16 ? - TFMessage::getKeyMaxCdrSerializedSize() : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - TFMessagePubSubType::~TFMessagePubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool TFMessagePubSubType::serialize( - void* data, - SerializedPayload_t* payload) - { - TFMessage* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); - - try - { - // Serialize the object. - p_type->serialize(ser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - // Get the serialized length - payload->length = static_cast(ser.getSerializedDataLength()); - return true; - } - - bool TFMessagePubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - //Convert DATA to pointer of your type - TFMessage* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - p_type->deserialize(deser); - } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) - { - return false; - } - - return true; - } - - std::function TFMessagePubSubType::getSerializedSizeProvider( - void* data) - { - return [data]() -> uint32_t - { - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; - }; - } - - void* TFMessagePubSubType::createData() - { - return reinterpret_cast(new TFMessage()); - } - - void TFMessagePubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool TFMessagePubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - TFMessage* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - TFMessage::getKeyMaxCdrSerializedSize()); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); - p_type->serializeKey(ser); - if (force_md5 || TFMessage::getKeyMaxCdrSerializedSize() > 16) - { - m_md5.init(); - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; - } - } //End of namespace msg +namespace msg { + + + + +TFMessagePubSubType::TFMessagePubSubType() +{ + setName("tf2_msgs::msg::dds_::TFMessage_"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TFMessage::getMaxCdrSerializedSize()); +#else + tf2_msgs_msg_TFMessage_max_cdr_typesize; +#endif + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + m_typeSize = type_size + 4; /*encapsulation*/ + m_isGetKeyDefined = false; +} + +TFMessagePubSubType::~TFMessagePubSubType() +{ +} + +bool TFMessagePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TFMessage* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0, 0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else + payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; +} + +bool TFMessagePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TFMessage* p_type = + static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); + + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); + + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + return true; +} + +std::function TFMessagePubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + return [data, data_representation]() -> uint32_t + { +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 + }; +} + +void* TFMessagePubSubType::createData() +{ + return reinterpret_cast(new TFMessage()); +} + +void TFMessagePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TFMessagePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + static_cast(data); + static_cast(handle); + static_cast(force_md5); + + return false; +} + + + +} //End of namespace msg + + } //End of namespace tf2_msgs + diff --git a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.h b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.h index 8d1749ce5df..b956035b2b2 100644 --- a/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.h +++ b/LibCarla/source/carla/ros2/fastdds/tf2_msgs/msg/TFMessagePubSubTypes.h @@ -16,78 +16,123 @@ * @file TFMessagePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 3.3.2). */ + #ifndef _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ #define _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ -#include +#include + +#include #include +#include +#include +#include #include "TFMessage.h" #include "geometry_msgs/msg/TransformStampedPubSubTypes.h" -#if !defined(GEN_API_VER) || (GEN_API_VER != 1) -#error Generated TFMessage is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated TFMessage is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace tf2_msgs { namespace msg { + + + + /*! * @brief This class represents the TopicDataType of the type TFMessage defined by the user in the IDL file. - * @ingroup TFMESSAGE + * @ingroup TFMessage */ -class TFMessagePubSubType : public eprosima::fastdds::dds::TopicDataType { +class TFMessagePubSubType : public eprosima::fastdds::dds::TopicDataType +{ public: - typedef TFMessage type; - eProsima_user_DllExport TFMessagePubSubType(); + typedef TFMessage type; + + eProsima_user_DllExport TFMessagePubSubType(); + + eProsima_user_DllExport ~TFMessagePubSubType() override; - eProsima_user_DllExport virtual ~TFMessagePubSubType() override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool serialize(void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; - eProsima_user_DllExport virtual std::function getSerializedSizeProvider(void* data) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } - eProsima_user_DllExport virtual bool getKey(void* data, eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport virtual void* createData() override; + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport virtual void deleteData(void* data) override; + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override { - return false; - } + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override { - return false; - } + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample(void* memory) const override { - (void)memory; - return false; - } + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - MD5 m_md5; - unsigned char* m_keyBuffer; + }; } // namespace msg } // namespace tf2_msgs -#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ +#endif // _FAST_DDS_GENERATED_TF2_MSGS_MSG_TFMESSAGE_PUBSUBTYPES_H_ + diff --git a/LibCarla/source/carla/ros2/publishers/ClockPublisher.h b/LibCarla/source/carla/ros2/publishers/ClockPublisher.h index 75ba52e5246..f4bd80567eb 100644 --- a/LibCarla/source/carla/ros2/publishers/ClockPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/ClockPublisher.h @@ -10,7 +10,7 @@ namespace carla { namespace ros2 { -using ClockPublisherImpl = DdsPublisherImpl; +using ClockPublisherImpl = DdsPublisherImpl; class ClockPublisher : public PublisherBase { public: diff --git a/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.cpp index b088fa6c83f..fd65a66815c 100644 --- a/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.cpp @@ -40,7 +40,7 @@ void UeDVSCameraPublisher::UpdateSensorData( auto header_view = this->header_view(buffer_view); auto data_vector_view = this->vector_view(buffer_view); - const sensor_msgs::msg::CameraInfo camera_info(header_view->height, header_view->width, header_view->fov_angle); + auto const camera_info = CreateCameraInfo(header_view->height, header_view->width, header_view->fov_angle); auto const stamp = GetTime(sensor_header); UpdateCameraInfo(stamp, camera_info); UpdateImageHeader(stamp, camera_info); @@ -66,23 +66,23 @@ void UeDVSCameraPublisher::SetPointCloudData(std::vector UeLidarPublisher::GetPointFields() con sensor_msgs::msg::PointField descriptor1; descriptor1.name("x"); descriptor1.offset(0); - descriptor1.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor1.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor1.count(1); sensor_msgs::msg::PointField descriptor2; descriptor2.name("y"); descriptor2.offset(4); - descriptor2.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor2.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor2.count(1); sensor_msgs::msg::PointField descriptor3; descriptor3.name("z"); descriptor3.offset(8); - descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor3.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor3.count(1); sensor_msgs::msg::PointField descriptor4; descriptor4.name("intensity"); descriptor4.offset(12); - descriptor4.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor4.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor4.count(1); return {descriptor1, descriptor2, descriptor3, descriptor4}; diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc index 20352343a9b..75e150b1b92 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc @@ -36,16 +36,41 @@ bool UePublisherBaseCamera::SubscribersConnected() const { return _image->SubscribersConnected() || _camera_info->SubscribersConnected(); } +template +sensor_msgs::msg::CameraInfo UePublisherBaseCamera::CreateCameraInfo(uint32_t height, uint32_t width, double fov) +{ + sensor_msgs::msg::CameraInfo camera_info; + camera_info.height(height); + camera_info.width(width); + camera_info.distortion_model("plumb_bob"); + + const double cx = static_cast(width) / 2.0; + const double cy = static_cast(height) / 2.0; + const double fx = static_cast(width) / (2.0 * std::tan(fov) * M_PI / 360.0); + const double fy = fx; + + camera_info.d({ 0.0, 0.0, 0.0, 0.0, 0.0 }); + camera_info.k({fx, 0.0, cx, 0.0, fy, cy, 0.0, 0.0, 1.0}); + camera_info.r({ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 }); + camera_info.p({fx, 0.0, cx, 0.0, 0.0, fy, cy, 0.0, 0.0, 0.0, 1.0, 0.0}); + + camera_info.binning_x(0); + camera_info.binning_y(0); + + camera_info.roi().x_offset(0); // up-to-data: constantly 0 + camera_info.roi().y_offset(0); // up-to-data: constantly 0 + camera_info.roi().height(camera_info.height()); + camera_info.roi().width(camera_info.width()); + camera_info.roi().do_rectify(true); // up-to-data: constantly true + + return camera_info; +} + template void UePublisherBaseCamera::UpdateCameraInfo(const builtin_interfaces::msg::Time &stamp, sensor_msgs::msg::CameraInfo const &camera_info) { _camera_info->Message() = camera_info; _camera_info->SetMessageHeader(stamp, frame_id()); - _camera_info->Message().roi().x_offset(0); // up-to-data: constantly 0 - _camera_info->Message().roi().y_offset(0); // up-to-data: constantly 0 - _camera_info->Message().roi().height(camera_info.height()); - _camera_info->Message().roi().width(camera_info.width()); - _camera_info->Message().roi().do_rectify(true); // up-to-data: constantly true _camera_info_initialized = true; } @@ -70,7 +95,7 @@ void UePublisherBaseCamera::UpdateSensorData( return; } - const sensor_msgs::msg::CameraInfo camera_info(header_view->height, header_view->width, header_view->fov_angle); + const auto camera_info = CreateCameraInfo(header_view->height, header_view->width, header_view->fov_angle); auto const stamp = GetTime(sensor_header); UpdateCameraInfo(stamp, camera_info); UpdateImageHeader(stamp, _camera_info->Message()); diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h index aa4de97e840..7466b39014f 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h @@ -61,6 +61,8 @@ class UePublisherBaseCamera : public UePublisherBaseSensor { const carla::SharedBufferView buffer_view) override; protected: + sensor_msgs::msg::CameraInfo CreateCameraInfo(uint32_t height, uint32_t width, double fov); + void UpdateCameraInfo(const builtin_interfaces::msg::Time &stamp, sensor_msgs::msg::CameraInfo const &camera_info); void UpdateImageHeader(const builtin_interfaces::msg::Time &stamp, sensor_msgs::msg::CameraInfo const &camera_info); diff --git a/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.cpp index 1697fe09785..076a8dbda45 100644 --- a/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeRadarPublisher.cpp @@ -27,37 +27,37 @@ std::vector UeRadarPublisher::GetPointFields() con sensor_msgs::msg::PointField descriptor1; descriptor1.name("x"); descriptor1.offset(0); - descriptor1.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor1.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor1.count(1); sensor_msgs::msg::PointField descriptor2; descriptor2.name("y"); descriptor2.offset(4); - descriptor2.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor2.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor2.count(1); sensor_msgs::msg::PointField descriptor3; descriptor3.name("z"); descriptor3.offset(8); - descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor3.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor3.count(1); sensor_msgs::msg::PointField descriptor4; descriptor4.name("velocity"); descriptor4.offset(12); - descriptor4.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor4.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor4.count(1); sensor_msgs::msg::PointField descriptor5; descriptor5.name("azimuth"); descriptor5.offset(16); - descriptor5.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor5.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor5.count(1); sensor_msgs::msg::PointField descriptor6; descriptor6.name("altitude"); descriptor6.offset(20); - descriptor6.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor6.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor6.count(1); sensor_msgs::msg::PointField descriptor7; descriptor7.name("depth"); descriptor7.offset(24); - descriptor7.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor7.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor7.count(1); return {descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6, descriptor7}; } diff --git a/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.cpp index f017ed2d5d4..982ab48d0aa 100644 --- a/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeSemanticLidarPublisher.cpp @@ -19,32 +19,32 @@ std::vector UeSemanticLidarPublisher::GetPointFiel sensor_msgs::msg::PointField descriptor1; descriptor1.name("x"); descriptor1.offset(0); - descriptor1.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor1.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor1.count(1); sensor_msgs::msg::PointField descriptor2; descriptor2.name("y"); descriptor2.offset(4); - descriptor2.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor2.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor2.count(1); sensor_msgs::msg::PointField descriptor3; descriptor3.name("z"); descriptor3.offset(8); - descriptor3.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor3.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor3.count(1); sensor_msgs::msg::PointField descriptor4; descriptor4.name("cos_inc_angle"); descriptor4.offset(12); - descriptor4.datatype(sensor_msgs::msg::PointField__FLOAT32); + descriptor4.datatype(sensor_msgs::msg::PointField_Constants::FLOAT32); descriptor4.count(1); sensor_msgs::msg::PointField descriptor5; descriptor5.name("object_idx"); descriptor5.offset(16); - descriptor5.datatype(sensor_msgs::msg::PointField__UINT32); + descriptor5.datatype(sensor_msgs::msg::PointField_Constants::UINT32); descriptor5.count(1); sensor_msgs::msg::PointField descriptor6; descriptor6.name("object_tag"); descriptor6.offset(20); - descriptor6.datatype(sensor_msgs::msg::PointField__UINT32); + descriptor6.datatype(sensor_msgs::msg::PointField_Constants::UINT32); descriptor6.count(1); return {descriptor1, descriptor2, descriptor3, descriptor4, descriptor5, descriptor6}; diff --git a/Util/BuildTools/Setup.sh b/Util/BuildTools/Setup.sh index 52906963c8f..5feb3f32ec6 100755 --- a/Util/BuildTools/Setup.sh +++ b/Util/BuildTools/Setup.sh @@ -950,8 +950,8 @@ if ${USE_ROS2} ; then FAST_DDS_LIB_BASENAME=fast-dds-lib FAST_DDS_LIB_SOURCE_DIR=${PWD}/${FAST_DDS_LIB_BASENAME}-source FAST_DDS_LIB_REPO="https://github.com/eProsima/Fast-DDS.git" - FAST_DDS_LIB_BRANCH=v2.11.2 - + FAST_DDS_LIB_BRANCH=v2.14.6 + git clone --recurse-submodules --depth 1 --branch ${FAST_DDS_LIB_BRANCH} ${FAST_DDS_LIB_REPO} ${FAST_DDS_LIB_SOURCE_DIR} # copy OpenSSL from UE4 From 9795e02ded0b87496295cbf176a37f822d6a1a35 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 4 Mar 2026 19:24:04 +0100 Subject: [PATCH 28/39] Improve ROS2 publishing order Especially publish first TF, then clock followed by the rest. Ensure some publisher write in synchronous mode to prevent from publishing delays because of buffering. Ensure all TF data is published, before the sensor data. --- LibCarla/source/carla/ros2/ROS2QoS.h | 7 ++ .../ros2/fastdds/carla/ros2/impl/DdsQoS.h | 9 ++- .../publishers/CarlaActorListPublisher.cpp | 1 + .../ros2/publishers/CarlaStatusPublisher.cpp | 1 + .../carla/ros2/publishers/ClockPublisher.cpp | 2 +- .../ros2/publishers/TransformPublisher.cpp | 6 +- .../ros2/publishers/UePublisherBaseSensor.h | 21 ++++- .../ros2/publishers/UeWorldPublisher.cpp | 81 ++++++++++++++----- .../ros2/publishers/WorldInfoPublisher.cpp | 5 +- 9 files changed, 104 insertions(+), 29 deletions(-) diff --git a/LibCarla/source/carla/ros2/ROS2QoS.h b/LibCarla/source/carla/ros2/ROS2QoS.h index 4f05590fa14..84be01b63bc 100644 --- a/LibCarla/source/carla/ros2/ROS2QoS.h +++ b/LibCarla/source/carla/ros2/ROS2QoS.h @@ -44,6 +44,11 @@ struct ROS2QoS { return *this; } + ROS2QoS &force_synchronous_writer(bool force_synchronous_writer = true) { + _force_synchronous_writer = force_synchronous_writer; + return *this; + } + enum class Reliability { SYSTEM_DEFAULT, BEST_EFFORT, RELIABLE } _reliability; enum class Durability { SYSTEM_DEFAULT, TRANSIENT_LOCAL, VOLATILE } _durability; @@ -51,6 +56,8 @@ struct ROS2QoS { enum class History { SYSTEM_DEFAULT, KEEP_LAST, KEEP_ALL } _history; int32_t _history_depth; + + bool _force_synchronous_writer = false; }; /** diff --git a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h index 1bcbd92bee4..5d55c181aa3 100644 --- a/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h +++ b/LibCarla/source/carla/ros2/fastdds/carla/ros2/impl/DdsQoS.h @@ -35,14 +35,19 @@ FAST_DDS_QOS_TYPE FastDdsQos(ROS2QoS const &qos) { fast_dds_qos.history().depth = qos._history_depth; } else if (qos._history == ROS2QoS::History::KEEP_ALL) { fast_dds_qos.history().kind = eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_ALL_HISTORY_QOS; - fast_dds_qos.resource_limits().max_samples = 1000; // Or some high value + fast_dds_qos.resource_limits().max_samples = 1000; fast_dds_qos.resource_limits().allocated_samples = qos._history_depth; } return fast_dds_qos; } inline eprosima::fastdds::dds::DataWriterQos DataWriterQos(ROS2QoS const &qos) { - return FastDdsQos(qos); + auto writer_qos = FastDdsQos(qos); + + if ( qos._force_synchronous_writer ) { + writer_qos.publish_mode().kind = eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE; + } + return writer_qos; } inline eprosima::fastdds::dds::DataReaderQos DataReaderQos(ROS2QoS const &qos) { diff --git a/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp index d1a9a5a761f..81bedcc3169 100644 --- a/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp @@ -16,6 +16,7 @@ CarlaActorListPublisher::CarlaActorListPublisher(std::string const &role_name) bool CarlaActorListPublisher::Init(std::shared_ptr domain_participant) { auto topic_qos = get_topic_qos(); topic_qos.transient_local(); + topic_qos.force_synchronous_writer(); return _impl->Init(domain_participant, get_topic_name(), topic_qos); } diff --git a/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp index 612221d2417..2935a69f704 100644 --- a/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp @@ -18,6 +18,7 @@ bool CarlaStatusPublisher::Init(std::shared_ptr domain // then the last published state is still available and one is able to detect for what CARLA is waiting auto topic_qos = get_topic_qos(); topic_qos.transient_local(); + topic_qos.force_synchronous_writer(); return _impl->Init(domain_participant, get_topic_name(), topic_qos); } diff --git a/LibCarla/source/carla/ros2/publishers/ClockPublisher.cpp b/LibCarla/source/carla/ros2/publishers/ClockPublisher.cpp index 53f696abaff..32126763b0a 100644 --- a/LibCarla/source/carla/ros2/publishers/ClockPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/ClockPublisher.cpp @@ -14,7 +14,7 @@ ClockPublisher::ClockPublisher() _impl(std::make_shared()) {} bool ClockPublisher::Init(std::shared_ptr domain_participant) { - return _impl->Init(domain_participant, "rt/clock", get_topic_qos()); + return _impl->Init(domain_participant, "rt/clock", get_topic_qos().force_synchronous_writer()); } bool ClockPublisher::Publish() { diff --git a/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp index 6a376da11e4..e80aa7856a3 100644 --- a/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TransformPublisher.cpp @@ -18,8 +18,10 @@ TransformPublisher::TransformPublisher() _impl_tf_static(std::make_shared()) {} bool TransformPublisher::Init(std::shared_ptr domain_participant) { - return _impl_tf->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, "rt/tf", get_topic_qos()) - && _impl_tf_static->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, "rt/tf_static", get_topic_qos()); + auto topic_qos = get_topic_qos(); + topic_qos.force_synchronous_writer(); + return _impl_tf->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, "rt/tf", topic_qos) + && _impl_tf_static->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, "rt/tf_static", topic_qos); } bool TransformPublisher::Publish() { diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h b/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h index e7581e9e384..5cbfa7442a4 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h @@ -4,9 +4,12 @@ #pragma once +#include + #include "carla/ros2/publishers/PublisherBaseTransform.h" #include "carla/rpc/ActorId.h" + namespace carla { namespace ros2 { @@ -37,7 +40,19 @@ class UePublisherBaseSensor : public PublisherBaseTransform { /** * Implement actions after sensor data updates */ - virtual void UpdateSensorDataPostAction() {}; + virtual void UpdateSensorDataPostAction() {} + + /** + * calling UpdateSensorDataPostAction but store frame_id for later use + */ + void UpdateSensorDataPostAction(uint64_t frame_id) { + sensor_data_post_action_frame_id = frame_id; + UpdateSensorDataPostAction(); + } + + uint64_t GetSensorDataPostActionFrameId() const { + return sensor_data_post_action_frame_id; + } builtin_interfaces::msg::Time GetTime( std::shared_ptr sensor_header) const { @@ -47,6 +62,10 @@ class UePublisherBaseSensor : public PublisherBaseTransform { std::shared_ptr GetSensorActorDefinition() const { return std::static_pointer_cast(_actor_name_definition); } + +private: + std::atomic sensor_data_post_action_frame_id{0u}; + }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index b267f3caabf..8aeb3f0b326 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -106,10 +106,9 @@ void UeWorldPublisher::Cleanup() { } bool UeWorldPublisher::Publish() { - if (!_initialized) { - return false; - } - return _clock_publisher->Publish() && _world_info_publisher->Publish() && _weather_publisher->Publish(); + // publishing is performed in an ordered manner in the UpdateSensorDataPostAction() + // this is to ensure that the clock and TF messages are published before the other messages, which might depend on them. + return true; } void UeWorldPublisher::ProcessMessages() { @@ -171,7 +170,6 @@ void UeWorldPublisher::UpdateSensorDataPreAction() { } } _sensor_actor_list_publisher->UpdateCarlaActorList(actor_list); - _sensor_actor_list_publisher->Publish(); } } @@ -199,7 +197,12 @@ void UeWorldPublisher::ProcessDataFromUeSensor(carla::streaming::detail::stream_ ue_sensor->second.publisher->UpdateTransform(sensor_header); } ue_sensor->second.publisher->UpdateSensorData(sensor_header, *data_view_iter); - ue_sensor->second.publisher->Publish(); + if ( ue_sensor->second.publisher->GetSensorDataPostActionFrameId() >= CurrentFrame() ) { + // camera sensors push their data streams within the rendering thread + // therefore, the UpdateSensorDataPostAction() of the world publisher might have already been called for the current frame, + // which is used to trigger the publish of the sensor data. In this case, we need to force a publish here to make sure the data gets published in a timely manner. + ue_sensor->second.publisher->Publish(); + } } log_verbose("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", std::to_string(*sensor_actor_definition), " Processed."); @@ -224,16 +227,18 @@ void UeWorldPublisher::UpdateSensorDataPostAction() { return; } - for (auto &ue_sensor : _ue_sensors) { - if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) ) { - ue_sensor.second.publisher->UpdateSensorDataPostAction(); - } - } - - UpdateAndPublishStatus(); - + // the actual publishing of data is triggered here for most of the data + // first the data is collected by the sensor updates and then published here in an ordered manner. + // This is to ensure that the clock and TF messages are published before the other messages, which might depend on them. + // Most of the ROS2 applications might not have an issue with slightly later published clock and TF messages, + // but some applications (e.g. rviz) might require the clock and TF messages to be published before the other messages. _transform_publisher->Publish(); + _clock_publisher->Publish(); + UpdateAndPublishStatus(); + _world_info_publisher->Publish(); + _weather_publisher->Publish(); _actor_list_publisher->Publish(); + _sensor_actor_list_publisher->Publish(); _objects_publisher->Publish(); _objects_with_covariance_publisher->Publish(); _traffic_lights_publisher->Publish(); @@ -241,6 +246,39 @@ void UeWorldPublisher::UpdateSensorDataPostAction() { _traffic_light_objects_publisher->Publish(); _traffic_sign_actor_list_publisher->Publish(); _traffic_sign_objects_publisher->Publish(); + + for (auto& vehicle : _vehicles) { + auto publisher = vehicle.second._vehicle_publisher; + if (publisher != nullptr) { + publisher->Publish(); + } + } + for (auto& walker : _walkers) { + auto publisher = walker.second._walker_publisher; + if (publisher != nullptr) { + publisher->Publish(); + } + } + for (auto& traffic_light : _traffic_lights) { + auto publisher = traffic_light.second._traffic_light_publisher; + if (publisher != nullptr) { + publisher->Publish(); + } + } + for (auto& traffic_sign : _traffic_signs) { + auto publisher = traffic_sign.second._traffic_sign_publisher; + if (publisher != nullptr) { + publisher->Publish(); + } + } + + for (auto &ue_sensor : _ue_sensors) { + if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) ) { + ue_sensor.second.publisher->UpdateSensorDataPostAction(CurrentFrame()); + ue_sensor.second.publisher->Publish(); + } + } + } void UeWorldPublisher::CreateSensorUePublisher(UeSensor &sensor) { @@ -586,7 +624,6 @@ void UeWorldPublisher::UpdateAndPublishStatus() { status.game_running(synchronization_target_game_time_min > _timestamp.Stamp()); _status_publisher->UpdateCarlaStatus(status); - _status_publisher->Publish(); } } @@ -630,7 +667,6 @@ void UeWorldPublisher::UpdateSensorData( publisher->UpdateTransform(_timestamp, transform); } publisher->UpdateVehicle(object, actor_dynamic_state); - publisher->Publish(); } } @@ -645,7 +681,6 @@ void UeWorldPublisher::UpdateSensorData( publisher->UpdateTransform(_timestamp, transform); } publisher->UpdateWalker(object, actor_dynamic_state); - publisher->Publish(); } } } @@ -658,7 +693,6 @@ void UeWorldPublisher::UpdateSensorData( auto publisher = ue_traffic_sign._traffic_sign_publisher; if ( publisher->is_enabled_for_ros() ) { publisher->UpdateTrafficSign(object, actor_dynamic_state); - publisher->Publish(); } } } @@ -671,7 +705,6 @@ void UeWorldPublisher::UpdateSensorData( auto publisher = ue_traffic_light._traffic_light_publisher; if ( publisher->is_enabled_for_ros() ) { publisher->UpdateTrafficLight(object, actor_dynamic_state); - publisher->Publish(); } } } @@ -691,9 +724,13 @@ void UeWorldPublisher::UpdateSensorData( if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) && (ue_sensor.second.publisher->is_enabled_for_ros()) && - (ue_sensor.second.publisher->do_publish_tf()) && - (!ue_sensor.second.publisher->SubscribersConnected())) { - // update sensor transform of sensors not subscribed, as their data stream is not deployed + (ue_sensor.second.publisher->do_publish_tf())) { + // update sensor transform of sensors: + // - have to cover not subscribed sensors, as their data stream is not deployed + // - have to cover PixelCamera sensors, as they are publishing their data stream within the rendering thread + // and therefore might update their Transform possibly after the UpdateSensorDataPostAction() of the world publisher is called. + // In this case, we need to make sure the transform is updated before the data gets published. + // Since the UE sensor transform is published as static tf, calling the UpdateTransform() twice doesn't duplicate the TF messages. auto const parent_actor_id = ue_sensor.second.publisher->get_parent_actor_id(); auto const parent_transform = get_transform(parent_actor_id); auto const relative_transform = ue_sensor.second.transform.GetRelativeTransform(parent_transform); diff --git a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp index 68ba9d1f2bb..a0eed5b727f 100644 --- a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp @@ -16,7 +16,10 @@ WorldInfoPublisher::WorldInfoPublisher(carla::rpc::RpcServerInterface &carla_ser _carla_server(carla_server) {} bool WorldInfoPublisher::Init(std::shared_ptr domain_participant) { - return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos().keep_last(1)); + auto topic_qos = get_topic_qos(); + topic_qos.keep_last(1); + topic_qos.force_synchronous_writer(); + return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), topic_qos); } bool WorldInfoPublisher::Publish() { From aa12aaf35f7a33aa6ee2e565fe24f1e2cfbd4ac9 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Fri, 6 Mar 2026 17:50:39 +0100 Subject: [PATCH 29/39] Fix ros2 speed output --- .../source/carla/ros2/publishers/CarlaActorListPublisher.cpp | 1 + LibCarla/source/carla/ros2/types/Speed.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp index 81bedcc3169..ef77af628b6 100644 --- a/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/CarlaActorListPublisher.cpp @@ -16,6 +16,7 @@ CarlaActorListPublisher::CarlaActorListPublisher(std::string const &role_name) bool CarlaActorListPublisher::Init(std::shared_ptr domain_participant) { auto topic_qos = get_topic_qos(); topic_qos.transient_local(); + topic_qos.keep_last(1); topic_qos.force_synchronous_writer(); return _impl->Init(domain_participant, get_topic_name(), topic_qos); } diff --git a/LibCarla/source/carla/ros2/types/Speed.h b/LibCarla/source/carla/ros2/types/Speed.h index 23d42ffa425..88b15cb6126 100644 --- a/LibCarla/source/carla/ros2/types/Speed.h +++ b/LibCarla/source/carla/ros2/types/Speed.h @@ -29,7 +29,7 @@ class Speed { _linear_velocity_ros.x = carla_linear_velocity.x; _linear_velocity_ros.y = -carla_linear_velocity.y; _linear_velocity_ros.z = carla_linear_velocity.z; - _ros_speed.data(_linear_velocity_ros.Speed(carla_quat)); + _ros_speed.data(carla_linear_velocity.Speed(carla_quat)); } #ifdef LIBCARLA_INCLUDED_FROM_UE4 Speed(const FVector &carla_linear_velocity, const FQuat &carla_quat) From 8b1c70a3088f917299c30b5d8febd7d069f5b69b Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 11 Mar 2026 11:12:11 +0100 Subject: [PATCH 30/39] Fix vehicle_telemetry publisher Add missing speed component to the message. --- LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp index 5cf391dea6f..bbff575c1b9 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -107,6 +107,7 @@ bool VehiclePublisher::ProcessMessages() { } else { auto const telemetry_data = telemetry_data_response.Get(); + _vehicle_telemetry_publisher->Message().speed(telemetry_data.speed); _vehicle_telemetry_publisher->Message().throttle(telemetry_data.throttle); _vehicle_telemetry_publisher->Message().steer(telemetry_data.steer); _vehicle_telemetry_publisher->Message().brake(telemetry_data.brake); From 3c7d87b1161d6d77e216bed12d01afc03aa7f597 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 11 Mar 2026 20:11:24 +0100 Subject: [PATCH 31/39] Fix Vehicle and Walker publisher Vehicle and Walker publisher publish their odometry-twist in local coordinate frame and cannot just reuse the data from object publisher. Furthermore, the IMU angular velocity is in radians while the actor dynamic state provide it in degrees. Therefore, the ROS2 type support considers such now: - Postpone conversion to ROS values on output side to allow correct rotations within CARLA coordinate frame for realtive values - Explicitly differentiate between absolute and relative ROS values - Explicitly differentiate degree and radian input - Merge Speed/Twist into AcceleratedMovement interface Make vehicle info wheel positions relative, as it's published only once at the startup. Due to the relative nature of this it is good to keep the frame_id to the vehicle-frame (carla_ros_bridge had this set to "map"). Also the acceleration then makes sense to select the relative one (carla_ros_bridge had that one in map-frame). As an exception to this, the orientation is still in respect to the map, otherwise pretty useless being zero. --- .../carla/ros2/publishers/UeIMUPublisher.cpp | 6 +- .../ros2/publishers/UeWorldPublisher.cpp | 1 - .../ros2/publishers/VehiclePublisher.cpp | 92 ++++++----- .../carla/ros2/publishers/WalkerPublisher.cpp | 3 +- .../carla/ros2/types/AcceleratedMovement.h | 155 ++++++++++++------ .../source/carla/ros2/types/Acceleration.h | 43 ++++- .../source/carla/ros2/types/AngularVelocity.h | 50 ++++-- .../ros2/types/CoordinateSystemTransform.h | 15 +- LibCarla/source/carla/ros2/types/Object.h | 41 +++-- LibCarla/source/carla/ros2/types/Speed.h | 65 -------- LibCarla/source/carla/ros2/types/Twist.h | 62 ------- 11 files changed, 260 insertions(+), 273 deletions(-) delete mode 100644 LibCarla/source/carla/ros2/types/Speed.h delete mode 100644 LibCarla/source/carla/ros2/types/Twist.h diff --git a/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp index 2d7e69fe50c..c0b80b7bc0e 100644 --- a/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp @@ -35,8 +35,10 @@ void UeIMUPublisher::UpdateSensorData( carla::SharedBufferView buffer_view) { auto imu_data = data(buffer_view); _impl->SetMessageHeader(GetTime(sensor_header), frame_id()); - _impl->Message().angular_velocity(carla::ros2::types::AngularVelocity(imu_data.gyroscope).angular_velocity()); - _impl->Message().linear_acceleration(carla::ros2::types::Acceleration(imu_data.accelerometer).accel().linear()); + // the IMU message contains angular velocity in radians + _impl->Message().angular_velocity(carla::ros2::types::AngularVelocity(imu_data.gyroscope, + carla::ros2::types::AngularVelocity::AngularVelocityMode::RADIAN).angular_velocity()); + _impl->Message().linear_acceleration(carla::ros2::types::Acceleration(imu_data.accelerometer).linear_acceleration()); /* TODO: original ROS bridge had taken the transform to provide a correct 3D orientation diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index 8aeb3f0b326..621ecb6e73a 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -31,7 +31,6 @@ #include "carla/ros2/types/Acceleration.h" #include "carla/ros2/types/AngularVelocity.h" #include "carla/ros2/types/Quaternion.h" -#include "carla/ros2/types/Speed.h" #include "carla/ros2/types/VehicleAckermannControl.h" #include "carla/ros2/types/VehicleControl.h" diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp index bbff575c1b9..2661f685ffa 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -5,7 +5,6 @@ #include "VehiclePublisher.h" #include "carla/ros2/impl/DdsPublisherImpl.h" -#include "carla/ros2/types/Speed.h" #include "carla/ros2/types/VehicleAckermannControl.h" #include "carla/ros2/types/VehicleControl.h" @@ -27,42 +26,6 @@ VehiclePublisher::VehiclePublisher(std::shared_ptr()), _vehicle_object_publisher(std::make_shared(*this, objects_publisher)), _vehicle_object_with_covariance_publisher(std::make_shared(*this, objects_with_covariance_publisher)) { - // prefill some vehicle info data - _vehicle_info_publisher->Message().id(vehicle_actor_definition->id); - _vehicle_info_publisher->Message().type(vehicle_actor_definition->type_id); - _vehicle_info_publisher->Message().rolename(vehicle_actor_definition->role_name); - for (auto wheel : vehicle_actor_definition->vehicle_physics_control.GetWheels()) { - auto wheel_info = carla_msgs::msg::CarlaEgoVehicleInfoWheel(); - wheel_info.tire_friction(wheel.tire_friction); - wheel_info.damping_rate(wheel.damping_rate); - wheel_info.max_steer_angle(carla::geom::Math::ToRadians(wheel.max_steer_angle)); - wheel_info.radius(wheel.radius); - wheel_info.max_brake_torque(wheel.max_brake_torque); - wheel_info.max_handbrake_torque(wheel.max_handbrake_torque); - - auto wheel_position = wheel.position; - // TODO: do we have to divide here by 100? (such was in ros brigde, but to my undertanding and search in the source - // code, it might be already correct. If not, then better to switch type of wheel_position from Vector3D to Location - // to have automatic cm -> m conversion object->Transform().GetTransform().InverseTransformPoint(wheel_position); - wheel_info.position(CoordinateSystemTransform::TransformLocationToVector3Msg(wheel_position)); - _vehicle_info_publisher->Message().wheels().push_back(wheel_info); - } - _vehicle_info_publisher->Message().max_rpm(vehicle_actor_definition->vehicle_physics_control.max_rpm); - _vehicle_info_publisher->Message().moi(vehicle_actor_definition->vehicle_physics_control.moi); - _vehicle_info_publisher->Message().damping_rate_full_throttle( - vehicle_actor_definition->vehicle_physics_control.damping_rate_full_throttle); - _vehicle_info_publisher->Message().damping_rate_zero_throttle_clutch_engaged( - vehicle_actor_definition->vehicle_physics_control.damping_rate_zero_throttle_clutch_engaged); - _vehicle_info_publisher->Message().damping_rate_zero_throttle_clutch_disengaged( - vehicle_actor_definition->vehicle_physics_control.damping_rate_zero_throttle_clutch_disengaged); - _vehicle_info_publisher->Message().use_gear_autobox(vehicle_actor_definition->vehicle_physics_control.use_gear_autobox); - _vehicle_info_publisher->Message().gear_switch_time(vehicle_actor_definition->vehicle_physics_control.gear_switch_time); - _vehicle_info_publisher->Message().clutch_strength(vehicle_actor_definition->vehicle_physics_control.clutch_strength); - _vehicle_info_publisher->Message().mass(vehicle_actor_definition->vehicle_physics_control.mass); - _vehicle_info_publisher->Message().drag_coefficient(vehicle_actor_definition->vehicle_physics_control.drag_coefficient); - _vehicle_info_publisher->Message().center_of_mass(CoordinateSystemTransform::TransformLocationToVector3Msg( - vehicle_actor_definition->vehicle_physics_control.center_of_mass)); - _vehicle_info_publisher->SetMessageUpdated(); } bool VehiclePublisher::Init(std::shared_ptr domain_participant) { @@ -152,17 +115,18 @@ void VehiclePublisher::UpdateVehicle(std::shared_ptrSetMessageHeader(object->Timestamp().time(), "map"); _vehicle_odometry_publisher->Message().child_frame_id(frame_id()); _vehicle_odometry_publisher->Message().pose(object->Transform().pose_with_covariance()); - _vehicle_odometry_publisher->Message().twist(object->AcceleratedMovement().twist_with_covariance()); - - _vehicle_speed_publisher->Message().data(object->Speed().speed().data()); + _vehicle_odometry_publisher->Message().twist(object->AcceleratedMovement().relative_twist_with_covariance()); + + auto const speed = object->speed().data(); + _vehicle_speed_publisher->Message().data() = speed; _vehicle_speed_publisher->SetMessageUpdated(); // add the timestamp and frame_id to telemetry data _vehicle_telemetry_publisher->SetMessageHeader(object->Timestamp().time(), "map"); _vehicle_status_publisher->SetMessageHeader(object->Timestamp().time(), frame_id()); - _vehicle_status_publisher->Message().velocity(object->Speed().speed().data()); - _vehicle_status_publisher->Message().acceleration(object->AcceleratedMovement().accel()); + _vehicle_status_publisher->Message().velocity() = speed; + _vehicle_status_publisher->Message().acceleration(object->AcceleratedMovement().relative_accel()); _vehicle_status_publisher->Message().orientation(object->Transform().pose().orientation()); _vehicle_status_publisher->Message().active_control_type(carla::ros2::types::GetVehicleControlType(actor_dynamic_state)); _vehicle_status_publisher->Message().last_applied_vehicle_control( @@ -174,6 +138,50 @@ void VehiclePublisher::UpdateVehicle(std::shared_ptrUpdateObject(object); _vehicle_object_with_covariance_publisher->UpdateObject(object); + + if ( _vehicle_info_publisher->Message().id() != _actor_name_definition->id ) { + // only update the vehicle info message once, as it contains only static information about the vehicle + auto vehicle_actor_definition = std::static_pointer_cast(_actor_name_definition); + _vehicle_info_publisher->Message().id(vehicle_actor_definition->id); + _vehicle_info_publisher->Message().type(vehicle_actor_definition->type_id); + _vehicle_info_publisher->Message().rolename(vehicle_actor_definition->role_name); + + for (auto wheel : vehicle_actor_definition->vehicle_physics_control.GetWheels()) { + auto wheel_info = carla_msgs::msg::CarlaEgoVehicleInfoWheel(); + wheel_info.tire_friction(wheel.tire_friction); + wheel_info.damping_rate(wheel.damping_rate); + wheel_info.max_steer_angle(carla::geom::Math::ToRadians(wheel.max_steer_angle)); + wheel_info.radius(wheel.radius); + wheel_info.max_brake_torque(wheel.max_brake_torque); + wheel_info.max_handbrake_torque(wheel.max_handbrake_torque); + + // convert from cm to m + // TODO: maybe we should change the type of wheel_position from Vector3D to Location in the WheelPhysicsControl, + // as it semantically represents a location, and then we would not have to do this conversion here. + auto wheel_position = carla::geom::Vector3D(wheel.position.x * 1e-2f, wheel.position.y * 1e-2f, wheel.position.z * 1e-2f); + // then make wheel position relative to the vehicle center + object->Transform().GetTransform().InverseTransformPoint(wheel_position); + // then transform it from UE4's left-handed coordinate system to ROS's right-handed coordinate system + wheel_info.position(CoordinateSystemTransform::TransformLinearAxisMsg(wheel_position)); + _vehicle_info_publisher->Message().wheels().push_back(wheel_info); + } + _vehicle_info_publisher->Message().max_rpm(vehicle_actor_definition->vehicle_physics_control.max_rpm); + _vehicle_info_publisher->Message().moi(vehicle_actor_definition->vehicle_physics_control.moi); + _vehicle_info_publisher->Message().damping_rate_full_throttle( + vehicle_actor_definition->vehicle_physics_control.damping_rate_full_throttle); + _vehicle_info_publisher->Message().damping_rate_zero_throttle_clutch_engaged( + vehicle_actor_definition->vehicle_physics_control.damping_rate_zero_throttle_clutch_engaged); + _vehicle_info_publisher->Message().damping_rate_zero_throttle_clutch_disengaged( + vehicle_actor_definition->vehicle_physics_control.damping_rate_zero_throttle_clutch_disengaged); + _vehicle_info_publisher->Message().use_gear_autobox(vehicle_actor_definition->vehicle_physics_control.use_gear_autobox); + _vehicle_info_publisher->Message().gear_switch_time(vehicle_actor_definition->vehicle_physics_control.gear_switch_time); + _vehicle_info_publisher->Message().clutch_strength(vehicle_actor_definition->vehicle_physics_control.clutch_strength); + _vehicle_info_publisher->Message().mass(vehicle_actor_definition->vehicle_physics_control.mass); + _vehicle_info_publisher->Message().drag_coefficient(vehicle_actor_definition->vehicle_physics_control.drag_coefficient); + _vehicle_info_publisher->Message().center_of_mass(CoordinateSystemTransform::TransformLinearAxisMsg( + vehicle_actor_definition->vehicle_physics_control.center_of_mass)); + _vehicle_info_publisher->SetMessageUpdated(); + } } } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp index 2773cf3caaf..6c02e4191c2 100644 --- a/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/WalkerPublisher.cpp @@ -5,7 +5,6 @@ #include "WalkerPublisher.h" #include "carla/ros2/impl/DdsPublisherImpl.h" -#include "carla/ros2/types/Speed.h" #include "carla/ros2/types/WalkerControl.h" namespace carla { @@ -45,7 +44,7 @@ void WalkerPublisher::UpdateWalker(std::shared_ptrSetMessageHeader(object->Timestamp().time(), "map"); _walker_odometry_publisher->Message().child_frame_id(frame_id()); _walker_odometry_publisher->Message().pose(object->Transform().pose_with_covariance()); - _walker_odometry_publisher->Message().twist(object->AcceleratedMovement().twist_with_covariance()); + _walker_odometry_publisher->Message().twist(object->AcceleratedMovement().relative_twist_with_covariance()); _walker_object_publisher->UpdateObject(object); _walker_object_with_covariance_publisher->UpdateObject(object); diff --git a/LibCarla/source/carla/ros2/types/AcceleratedMovement.h b/LibCarla/source/carla/ros2/types/AcceleratedMovement.h index 8d832697968..c4ba8202084 100644 --- a/LibCarla/source/carla/ros2/types/AcceleratedMovement.h +++ b/LibCarla/source/carla/ros2/types/AcceleratedMovement.h @@ -5,19 +5,23 @@ #pragma once #include "carla/Debug.h" -#include "carla/geom/Acceleration.h" +#include "carla/ros2/types/Acceleration.h" #include "carla/ros2/types/AngularVelocity.h" -#include "carla/ros2/types/Speed.h" #include "carla/ros2/types/Timestamp.h" -#include "carla/ros2/types/Twist.h" +#include "carla/geom/Velocity.h" +#include "carla/geom/AngularVelocity.h" +#include "carla/geom/Quaternion.h" +#include "carla/ros2/types/CoordinateSystemTransform.h" #include "geometry_msgs/msg/AccelWithCovariance.h" +#include "geometry_msgs/msg/TwistWithCovariance.h" namespace carla { namespace ros2 { namespace types { /** - Track accelerations based on Speed upates + Track the movement state including the angular acceleration based on speed upates + Allow access for absolute and relative acceleration, velocity and twist in ROS coordinate system Considers the conversion from left-handed system (unreal) to right-handed system (ROS) @@ -31,78 +35,121 @@ class AcceleratedMovement { AcceleratedMovement(AcceleratedMovement&&) = default; AcceleratedMovement& operator=(AcceleratedMovement&&) = default; - void UpdateSpeed(Speed const& speed, AngularVelocity const& angular_velocity, Timestamp const& timestamp) { - float delta_seconds = static_cast(timestamp.Stamp() - _last_timestamp.Stamp()); + void Update( + carla::geom::Velocity const& linear_velocity, + carla::ros2::types::AngularVelocity const& angular_velocity, + carla::geom::Acceleration const& linear_acceleration, + carla::geom::Quaternion const& quaternion, + Timestamp const& timestamp) { + + _acceleration._carla_linear_acceleration = linear_acceleration; + float delta_seconds = static_cast(timestamp.Stamp() - _timestamp.Stamp()); if (delta_seconds > 1e-9) { - auto last_linear_velocity_ros = _last_speed.LinearVelocityROS(); - auto current_linear_velocity_ros = speed.LinearVelocityROS(); - auto current_linear_acceleration_ros = (current_linear_velocity_ros - last_linear_velocity_ros) / delta_seconds; - _ros_accel.linear().x(current_linear_acceleration_ros.x); - _ros_accel.linear().y(current_linear_acceleration_ros.y); - _ros_accel.linear().z(current_linear_acceleration_ros.z); - - auto last_angular_velocity_ros = _last_angular_velocity.AngularVelocityROS(); - auto current_angular_velocity_ros = angular_velocity.AngularVelocityROS(); - auto current_angular_acceleration_ros = - (current_angular_velocity_ros - last_angular_velocity_ros) / delta_seconds; - _ros_accel.angular().x(current_angular_acceleration_ros.x); - _ros_accel.angular().y(current_angular_acceleration_ros.y); - _ros_accel.angular().z(current_angular_acceleration_ros.z); + _acceleration._carla_angular_acceleration_rad = (angular_velocity.GetAngularVelocityRad() - _angular_velocity.GetAngularVelocityRad()) / delta_seconds; } - _last_speed = speed; - _last_angular_velocity = angular_velocity; - _last_timestamp = timestamp; + + _linear_velocity = linear_velocity; + _angular_velocity = angular_velocity; + _quaternion = quaternion; + _timestamp = timestamp; + } + + Acceleration const & GetAcceleration() const { + return _acceleration; + } + + Acceleration GetRelativeAcceleration() const { + return _acceleration.GetRelative(_quaternion); + } + + geometry_msgs::msg::Accel absolute_accel() const { + return GetAcceleration().accel(); } - /** - * The resulting ROS geometry_msgs::msg::Accel - */ - geometry_msgs::msg::Accel accel() const { - return _ros_accel; + geometry_msgs::msg::AccelWithCovariance absolute_accel_with_covariance() const { + geometry_msgs::msg::AccelWithCovariance _ros_accel_with_covariance; + _ros_accel_with_covariance.accel(absolute_accel()); + return _ros_accel_with_covariance; } - /** - * The resulting ROS geometry_msgs::msg::AccelWithCovariance - */ - geometry_msgs::msg::AccelWithCovariance accel_with_covariance() const { + geometry_msgs::msg::Accel relative_accel() const { + return GetRelativeAcceleration().accel(); + } + + geometry_msgs::msg::AccelWithCovariance relative_accel_with_covariance() const { geometry_msgs::msg::AccelWithCovariance _ros_accel_with_covariance; - _ros_accel_with_covariance.accel(_ros_accel); + _ros_accel_with_covariance.accel(relative_accel()); return _ros_accel_with_covariance; } - /** - * The resulting ROS geometry_msgs::msg::Twist - */ - geometry_msgs::msg::Twist twist() const { - carla::ros2::types::Twist ros_twist(_last_speed, _last_angular_velocity); - return ros_twist.twist(); + carla::geom::Velocity const& LinearVelocity() const { + return _linear_velocity; + } + + geometry_msgs::msg::Vector3 absolute_linear_velocity() const { + return CoordinateSystemTransform::TransformLinearAxisMsg(_linear_velocity);; + } + + carla::geom::Velocity RelativeLinearVelocity() const { + return _quaternion.InverseRotatedVector(_linear_velocity); + } + + geometry_msgs::msg::Vector3 relative_linear_velocity() const { + return CoordinateSystemTransform::TransformLinearAxisMsg(RelativeLinearVelocity());; + } + + carla::ros2::types::AngularVelocity AngularVelocity() const { + return _angular_velocity; + } + + geometry_msgs::msg::Vector3 absolute_angular_velocity() const { + return AngularVelocity().angular_velocity(); + } + + carla::ros2::types::AngularVelocity RelativeAngularVelocity() const { + return AngularVelocity().GetRelative(_quaternion); + } + + geometry_msgs::msg::Vector3 relative_angular_velocity() const { + return RelativeAngularVelocity().angular_velocity(); + } + + geometry_msgs::msg::Twist absolute_twist() const { + geometry_msgs::msg::Twist ros_twist; + ros_twist.linear() = absolute_linear_velocity(); + ros_twist.angular() = absolute_angular_velocity(); + return ros_twist; } - /** - * The resulting ROS geometry_msgs::msg::TwistWithCovariance - */ - geometry_msgs::msg::TwistWithCovariance twist_with_covariance() const { - carla::ros2::types::Twist ros_twist(_last_speed, _last_angular_velocity); - return ros_twist.twist_with_covariance(); + geometry_msgs::msg::TwistWithCovariance absolute_twist_with_covariance() const { + geometry_msgs::msg::TwistWithCovariance _ros_twist_with_covariance; + _ros_twist_with_covariance.twist(absolute_twist()); + return _ros_twist_with_covariance; } - carla::ros2::types::Speed const& Speed() const { - return _last_speed; + geometry_msgs::msg::Twist relative_twist() const { + geometry_msgs::msg::Twist ros_twist; + ros_twist.linear() = relative_linear_velocity(); + ros_twist.angular() = relative_angular_velocity(); + return ros_twist; } - carla::ros2::types::AngularVelocity const& AngularVelocity() const { - return _last_angular_velocity; + geometry_msgs::msg::TwistWithCovariance relative_twist_with_covariance() const { + geometry_msgs::msg::TwistWithCovariance _ros_twist_with_covariance; + _ros_twist_with_covariance.twist(relative_twist()); + return _ros_twist_with_covariance; } carla::ros2::types::Timestamp const& Timestamp() const { - return _last_timestamp; + return _timestamp; } private: - carla::ros2::types::Speed _last_speed{carla::geom::Vector3D(), carla::geom::Quaternion()}; - carla::ros2::types::AngularVelocity _last_angular_velocity{carla::geom::AngularVelocity()}; - carla::ros2::types::Timestamp _last_timestamp; - geometry_msgs::msg::Accel _ros_accel; + carla::geom::Velocity _linear_velocity; + carla::ros2::types::AngularVelocity _angular_velocity; + carla::geom::Quaternion _quaternion; + carla::ros2::types::Timestamp _timestamp; + carla::ros2::types::Acceleration _acceleration; }; } // namespace types } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/types/Acceleration.h b/LibCarla/source/carla/ros2/types/Acceleration.h index 3820f5ea46d..00aedab2484 100644 --- a/LibCarla/source/carla/ros2/types/Acceleration.h +++ b/LibCarla/source/carla/ros2/types/Acceleration.h @@ -7,11 +7,14 @@ #include "carla/geom/Acceleration.h" #include "carla/ros2/types/CoordinateSystemTransform.h" #include "geometry_msgs/msg/Accel.h" +#include "carla/geom/Quaternion.h" namespace carla { namespace ros2 { namespace types { +class AcceleratedMovement; + /** Convert a carla (linear) acceleration to a ROS accel (linear part) @@ -21,11 +24,11 @@ namespace types { class Acceleration { public: /** - * carla_acceleration: the carla linear acceleration; this is not provided by UE4 + * carla_linear_acceleration: the carla linear acceleration; this is not provided by UE4 * therefore has to be deduced from the Velocity */ Acceleration(carla::geom::Acceleration const& carla_linear_acceleration = carla::geom::Acceleration()) { - _ros_accel.linear() = CoordinateSystemTransform::TransformLinearAxisMsg(carla_linear_acceleration); + _carla_linear_acceleration = carla_linear_acceleration; } ~Acceleration() = default; Acceleration(const Acceleration&) = default; @@ -33,15 +36,47 @@ class Acceleration { Acceleration(Acceleration&&) = default; Acceleration& operator=(Acceleration&&) = default; + + geometry_msgs::msg::Vector3 linear_acceleration() const { + return CoordinateSystemTransform::TransformLinearAxisMsg(_carla_linear_acceleration); + } + + /** + * The resulting ROS angular acceleration as geometry_msgs::msg::Vector3 in ROS coordinates + */ + geometry_msgs::msg::Vector3 angular_acceleration() const { + geometry_msgs::msg::Vector3 angular_acceleration_ros; + angular_acceleration_ros.x() = -_carla_angular_acceleration_rad.x; // -(forward = forward) + angular_acceleration_ros.y() = _carla_angular_acceleration_rad.y; // -( right = -left ) + angular_acceleration_ros.z() = -_carla_angular_acceleration_rad.z; // -( up = up ) + return angular_acceleration_ros; + } + /** * The resulting ROS geometry_msgs::msg::Accel */ geometry_msgs::msg::Accel accel() const { - return _ros_accel; + geometry_msgs::msg::Accel ros_accel; + ros_accel.linear() = linear_acceleration(); + ros_accel.angular() = angular_acceleration(); + return ros_accel; + } + + /** + * Get the relative acceleration in the reference frame of the provided transform + */ + Acceleration GetRelative(carla::geom::Quaternion const& quat) const { + Acceleration relative_acceleration; + relative_acceleration._carla_linear_acceleration = quat.InverseRotatedVector(_carla_linear_acceleration); + relative_acceleration._carla_angular_acceleration_rad = quat.InverseRotatedVector(_carla_angular_acceleration_rad); + return relative_acceleration; } private: - geometry_msgs::msg::Accel _ros_accel; + friend class AcceleratedMovement; + + carla::geom::Acceleration _carla_linear_acceleration; + carla::geom::Acceleration _carla_angular_acceleration_rad; }; } // namespace types } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/types/AngularVelocity.h b/LibCarla/source/carla/ros2/types/AngularVelocity.h index e92efbc02ff..b5d980955db 100644 --- a/LibCarla/source/carla/ros2/types/AngularVelocity.h +++ b/LibCarla/source/carla/ros2/types/AngularVelocity.h @@ -6,7 +6,7 @@ #include "carla/geom/AngularVelocity.h" #include "carla/geom/Math.h" -#include "geometry_msgs/msg/Accel.h" +#include "geometry_msgs/msg/Vector3.h" namespace carla { namespace ros2 { @@ -28,16 +28,24 @@ class AngularVelocity { AngularVelocity(AngularVelocity&&) = default; AngularVelocity& operator=(AngularVelocity&&) = default; + enum class AngularVelocityMode { + DEGREE, + RADIAN + }; + /** * carla_AngularVelocity: the carla linear AngularVelocity */ - explicit AngularVelocity(const carla::geom::AngularVelocity& carla_angular_velocity) { - _angular_velocity_ros.x = -carla::geom::Math::ToRadians(carla_angular_velocity.x); // -(forward = forward) - _angular_velocity.x(_angular_velocity_ros.x); - _angular_velocity_ros.y = carla::geom::Math::ToRadians(carla_angular_velocity.y); // -( right = -left ) - _angular_velocity.y(_angular_velocity_ros.y); - _angular_velocity_ros.z = -carla::geom::Math::ToRadians(carla_angular_velocity.z); // -( up = up ) - _angular_velocity.z(_angular_velocity_ros.z); + AngularVelocity(const carla::geom::AngularVelocity& carla_angular_velocity, AngularVelocityMode mode) { + if ( mode == AngularVelocityMode::RADIAN) { + _carla_angular_velocity_rad.x = carla_angular_velocity.x; + _carla_angular_velocity_rad.y = carla_angular_velocity.y; + _carla_angular_velocity_rad.z = carla_angular_velocity.z; + } else { + _carla_angular_velocity_rad.x = carla::geom::Math::ToRadians(carla_angular_velocity.x); + _carla_angular_velocity_rad.y = carla::geom::Math::ToRadians(carla_angular_velocity.y); + _carla_angular_velocity_rad.z = carla::geom::Math::ToRadians(carla_angular_velocity.z); + } } #ifdef LIBCARLA_INCLUDED_FROM_UE4 AngularVelocity(const FVector& carla_angular_velocity) @@ -46,22 +54,34 @@ class AngularVelocity { #endif // LIBCARLA_INCLUDED_FROM_UE4 /** - * The resulting ROS geometry_msgs::msg::Vector3 + * The resulting ROS geometry_msgs::msg::Vector3 in ROS coordinates */ geometry_msgs::msg::Vector3 angular_velocity() const { - return _angular_velocity; + geometry_msgs::msg::Vector3 angular_velocity_ros; + angular_velocity_ros.x() = -_carla_angular_velocity_rad.x; // -(forward = forward) + angular_velocity_ros.y() = _carla_angular_velocity_rad.y; // -( right = -left ) + angular_velocity_ros.z() = -_carla_angular_velocity_rad.z; // -( up = up ) + return angular_velocity_ros; + } + + /** + * The angular velocity in the carla coordinate system in radians per second + */ + carla::geom::AngularVelocity const & GetAngularVelocityRad() const { + return _carla_angular_velocity_rad; } /** - * The angular velocity as carla::geom::Vector3D but in ROS coordinates + * Get the relative angular velocity in the reference frame of the provided transform */ - carla::geom::AngularVelocity AngularVelocityROS() const { - return _angular_velocity_ros; + AngularVelocity GetRelative(carla::geom::Quaternion const& quat) const { + AngularVelocity relative_angular_velocity; + relative_angular_velocity._carla_angular_velocity_rad = quat.InverseRotatedVector(_carla_angular_velocity_rad); + return relative_angular_velocity; } private: - carla::geom::AngularVelocity _angular_velocity_ros; - geometry_msgs::msg::Vector3 _angular_velocity; + carla::geom::AngularVelocity _carla_angular_velocity_rad; }; } // namespace types } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/types/CoordinateSystemTransform.h b/LibCarla/source/carla/ros2/types/CoordinateSystemTransform.h index 562c2d3f904..d3853a809f8 100644 --- a/LibCarla/source/carla/ros2/types/CoordinateSystemTransform.h +++ b/LibCarla/source/carla/ros2/types/CoordinateSystemTransform.h @@ -24,7 +24,7 @@ class CoordinateSystemTransform { * @param \in carla_linear_values: the carla linear values provided provided by UE4 coordinate system * @returns values in ROS coordinate system (x:forward = forward, y: right = -left, z; up = up) */ - static geometry_msgs::msg::Vector3 TransformLinearAxisMsg(carla::geom::Location const &carla_linear_values) { + static geometry_msgs::msg::Vector3 TransformLinearAxisMsg(carla::geom::Vector3D const &carla_linear_values) { geometry_msgs::msg::Vector3 result; result.x(carla_linear_values.x); result.y(-carla_linear_values.y); @@ -32,7 +32,7 @@ class CoordinateSystemTransform { return result; } - static geometry_msgs::msg::Point32 TransformLocationToPoint32Msg(carla::geom::Location const &carla_location) { + static geometry_msgs::msg::Point32 TransformLocationToPoint32Msg(carla::geom::Vector3D const &carla_location) { geometry_msgs::msg::Point32 result; result.x(carla_location.x); result.y(-carla_location.y); @@ -40,16 +40,9 @@ class CoordinateSystemTransform { return result; } - static geometry_msgs::msg::Vector3 TransformLocationToVector3Msg(carla::geom::Location const &carla_location) { - geometry_msgs::msg::Vector3 result; - result.x(carla_location.x); - result.y(-carla_location.y); - result.z(carla_location.z); - return result; - } - static carla::geom::Location TransformLinearAxixVector3D(carla::geom::Location const &carla_linear_values) { - carla::geom::Location result(carla_linear_values); + static carla::geom::Vector3D TransformLinearAxixVector3D(carla::geom::Vector3D const &carla_linear_values) { + carla::geom::Vector3D result(carla_linear_values); result.y = -result.y; return result; } diff --git a/LibCarla/source/carla/ros2/types/Object.h b/LibCarla/source/carla/ros2/types/Object.h index df6b7cd378c..aeb0e50858c 100644 --- a/LibCarla/source/carla/ros2/types/Object.h +++ b/LibCarla/source/carla/ros2/types/Object.h @@ -8,6 +8,7 @@ #include "carla/geom/BoundingBox.h" #include "carla/ros2/types/AcceleratedMovement.h" +#include "carla/ros2/types/AngularVelocity.h" #include "carla/ros2/types/Polygon.h" #include "carla/ros2/types/Timestamp.h" #include "carla/ros2/types/TrafficLightActorDefinition.h" @@ -20,6 +21,7 @@ #include "carla/sensor/data/ActorDynamicState.h" #include "derived_object_msgs/msg/Object.h" #include "derived_object_msgs/msg/ObjectWithCovariance.h" +#include "std_msgs/msg/Float32.h" namespace carla { @@ -188,9 +190,11 @@ class Object { _bounding_box.location = actor_dynamic_state.transform.location; _bounding_box.rotation = actor_dynamic_state.transform.rotation; _transform = carla::ros2::types::Transform(actor_dynamic_state.transform, actor_dynamic_state.quaternion); - _accelerated_movement.UpdateSpeed( - carla::ros2::types::Speed(carla::geom::Velocity(actor_dynamic_state.velocity), actor_dynamic_state.quaternion), - carla::ros2::types::AngularVelocity(carla::geom::AngularVelocity(actor_dynamic_state.angular_velocity)), + _accelerated_movement.Update( + carla::geom::Velocity(actor_dynamic_state.velocity), + AngularVelocity(actor_dynamic_state.angular_velocity, AngularVelocity::AngularVelocityMode::DEGREE), + carla::geom::Acceleration(actor_dynamic_state.acceleration), + actor_dynamic_state.quaternion, timestamp); } @@ -202,8 +206,8 @@ class Object { object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); object.object_classified(true); object.pose(_transform.pose()); - object.twist(_accelerated_movement.twist()); - object.accel(_accelerated_movement.accel()); + object.twist(_accelerated_movement.absolute_twist()); + object.accel(_accelerated_movement.absolute_accel()); object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); auto const ros_extent = _bounding_box.extent * 2.f; object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); @@ -222,8 +226,8 @@ class Object { object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); object.object_classified(true); object.pose(_transform.pose_with_covariance()); - object.twist(_accelerated_movement.twist_with_covariance()); - object.accel(_accelerated_movement.accel_with_covariance()); + object.twist(_accelerated_movement.absolute_twist_with_covariance()); + object.accel(_accelerated_movement.absolute_accel_with_covariance()); object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); auto const ros_extent = _bounding_box.extent * 2.f; object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); @@ -239,22 +243,29 @@ class Object { bool has_dynamic_data_changed(derived_object_msgs::msg::Object const &other) const { return (other.id()!=_actor_definition->id) || (other.pose() != _transform.pose()) - || (other.twist() != _accelerated_movement.twist()) - || (other.accel() != _accelerated_movement.accel()); + || (other.twist() != _accelerated_movement.absolute_twist()) + || (other.accel() != _accelerated_movement.absolute_accel()); } + + /** + * The resulting ROS std_msgs::msg::Float32 + */ + std_msgs::msg::Float32 speed() const { + std_msgs::msg::Float32 ros_speed; + ros_speed.data(_accelerated_movement.LinearVelocity().Speed(_transform.GetQuaternion())); + return ros_speed; + } + + carla::ros2::types::Timestamp const& Timestamp() const { return _accelerated_movement.Timestamp(); } + carla::ros2::types::Transform const& Transform() const { return _transform; } - carla::ros2::types::Speed const& Speed() const { - return _accelerated_movement.Speed(); - } - carla::ros2::types::AngularVelocity const& AngularVelocity() const { - return _accelerated_movement.AngularVelocity(); - } + carla::ros2::types::AcceleratedMovement const& AcceleratedMovement() const { return _accelerated_movement; } diff --git a/LibCarla/source/carla/ros2/types/Speed.h b/LibCarla/source/carla/ros2/types/Speed.h deleted file mode 100644 index 88b15cb6126..00000000000 --- a/LibCarla/source/carla/ros2/types/Speed.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/geom/Math.h" -#include "carla/geom/Quaternion.h" -#include "carla/geom/Velocity.h" -#include "std_msgs/msg/Float32.h" - -namespace carla { -namespace ros2 { -namespace types { - -/** - Convert a carla linear Speed to a ROS accel - - Considers the conversion from left-handed system (unreal) to right-handed - system (ROS) - -*/ -class Speed { -public: - /** - * carla_speed: the carla linear Speed - */ - Speed(carla::geom::Velocity const &carla_linear_velocity, carla::geom::Quaternion const &carla_quat) { - _linear_velocity_ros.x = carla_linear_velocity.x; - _linear_velocity_ros.y = -carla_linear_velocity.y; - _linear_velocity_ros.z = carla_linear_velocity.z; - _ros_speed.data(carla_linear_velocity.Speed(carla_quat)); - } -#ifdef LIBCARLA_INCLUDED_FROM_UE4 - Speed(const FVector &carla_linear_velocity, const FQuat &carla_quat) - : Speed(carla::geom::Velocity(carla_linear_velocity), carla::geom::Quaternion(carla_quat)) {} -#endif // LIBCARLA_INCLUDED_FROM_UE4 - Speed() = default; - ~Speed() = default; - Speed(const Speed &) = default; - Speed &operator=(const Speed &) = default; - Speed(Speed &&) = default; - Speed &operator=(Speed &&) = default; - - /** - * The resulting ROS std_msgs::msg::Float32 - */ - std_msgs::msg::Float32 speed() const { - return _ros_speed; - } - - /** - * The linear velocity as carla::geom::Vector3D but in ROS coordinates - */ - carla::geom::Velocity LinearVelocityROS() const { - return _linear_velocity_ros; - } - -private: - carla::geom::Velocity _linear_velocity_ros; - std_msgs::msg::Float32 _ros_speed; -}; -} // namespace types -} // namespace ros2 -} // namespace carla \ No newline at end of file diff --git a/LibCarla/source/carla/ros2/types/Twist.h b/LibCarla/source/carla/ros2/types/Twist.h deleted file mode 100644 index 92146515149..00000000000 --- a/LibCarla/source/carla/ros2/types/Twist.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/geom/Vector3D.h" -#include "carla/ros2/types/AngularVelocity.h" -#include "carla/ros2/types/Speed.h" -#include "geometry_msgs/msg/TwistWithCovariance.h" - -namespace carla { -namespace ros2 { -namespace types { - -/** - Convert carla velocities to a ROS twist - - Considers the conversion from left-handed system (unreal) to right-handed - system (ROS). -*/ -class Twist { -public: - /** - * carla_Twist: the carla Twist - */ - Twist(Speed const& speed, AngularVelocity const& angular_velocity) { - _ros_twist.linear().x(speed.LinearVelocityROS().x); - _ros_twist.linear().y(speed.LinearVelocityROS().y); - _ros_twist.linear().z(speed.LinearVelocityROS().z); - _ros_twist.angular().x(angular_velocity.AngularVelocityROS().x); - _ros_twist.angular().y(angular_velocity.AngularVelocityROS().y); - _ros_twist.angular().z(angular_velocity.AngularVelocityROS().z); - } - ~Twist() = default; - Twist(const Twist&) = default; - Twist& operator=(const Twist&) = default; - Twist(Twist&&) = default; - Twist& operator=(Twist&&) = default; - - /** - * The resulting ROS geometry_msgs::msg::twist - */ - geometry_msgs::msg::Twist twist() const { - return _ros_twist; - } - - /** - * The resulting ROS geometry_msgs::msg::twist - */ - geometry_msgs::msg::TwistWithCovariance twist_with_covariance() const { - geometry_msgs::msg::TwistWithCovariance _ros_twist_with_covariance; - _ros_twist_with_covariance.twist(_ros_twist); - return _ros_twist_with_covariance; - } - -private: - geometry_msgs::msg::Twist _ros_twist; -}; -} // namespace types -} // namespace ros2 -} // namespace carla \ No newline at end of file From 605eb85235402d88af5c709e8f624258c8c2746d Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Thu, 12 Mar 2026 17:16:35 +0100 Subject: [PATCH 32/39] Run publisher server requests at UpdateSensorDataPreAction If the server-queries on additional sensor data is perfomred within the ProcessMessages() step, the simulation did not yet tick, therefore the states from the last frame are quieried. Moving these to the UpdateSensorDataPreAction() step accesses the data after the current physics step was performed. --- LibCarla/source/carla/ros2/ROS2.h | 2 +- .../ros2/publishers/CarlaStatusPublisher.cpp | 2 +- .../ros2/publishers/CarlaStatusPublisher.h | 4 +- .../ros2/publishers/ObjectsPublisher.cpp | 2 +- .../carla/ros2/publishers/ObjectsPublisher.h | 4 +- .../ObjectsWithCovariancePublisher.cpp | 2 +- .../ObjectsWithCovariancePublisher.h | 4 +- .../carla/ros2/publishers/PublisherBase.h | 15 +++++ .../ros2/publishers/PublisherBaseSensor.h | 24 ------- .../ros2/publishers/PublisherBaseTransform.h | 6 +- .../ros2/publishers/TrafficLightPublisher.cpp | 2 +- .../ros2/publishers/TrafficLightPublisher.h | 4 +- .../publishers/TrafficLightsPublisher.cpp | 2 +- .../ros2/publishers/TrafficLightsPublisher.h | 4 +- .../ros2/publishers/UeCollisionPublisher.cpp | 2 +- .../ros2/publishers/UeCollisionPublisher.h | 6 +- .../ros2/publishers/UeDVSCameraPublisher.h | 2 +- .../carla/ros2/publishers/UeGNSSPublisher.cpp | 2 +- .../carla/ros2/publishers/UeGNSSPublisher.h | 6 +- .../carla/ros2/publishers/UeIMUPublisher.cpp | 2 +- .../carla/ros2/publishers/UeIMUPublisher.h | 6 +- ...ublisherBaseSensor.h => UePublisherBase.h} | 17 ++--- .../ros2/publishers/UePublisherBaseCamera.cc | 2 +- .../ros2/publishers/UePublisherBaseCamera.h | 8 +-- .../publishers/UePublisherBasePointCloud.cc | 2 +- .../publishers/UePublisherBasePointCloud.h | 8 +-- .../ros2/publishers/UeRGBCameraPublisher.cpp | 2 +- .../ros2/publishers/UeRGBCameraPublisher.h | 4 +- .../ros2/publishers/UeV2XCustomPublisher.cpp | 4 +- .../ros2/publishers/UeV2XCustomPublisher.h | 10 +-- .../carla/ros2/publishers/UeV2XPublisher.cpp | 2 +- .../carla/ros2/publishers/UeV2XPublisher.h | 6 +- .../ros2/publishers/UeWorldPublisher.cpp | 67 +++++++++++++------ .../carla/ros2/publishers/UeWorldPublisher.h | 14 ++-- .../ros2/publishers/VehiclePublisher.cpp | 7 +- .../carla/ros2/publishers/VehiclePublisher.h | 4 +- .../ros2/publishers/WeatherPublisher.cpp | 3 +- .../carla/ros2/publishers/WeatherPublisher.h | 4 +- .../ros2/publishers/WorldInfoPublisher.cpp | 3 +- .../ros2/publishers/WorldInfoPublisher.h | 4 +- 40 files changed, 140 insertions(+), 134 deletions(-) delete mode 100644 LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h rename LibCarla/source/carla/ros2/publishers/{UePublisherBaseSensor.h => UePublisherBase.h} (81%) diff --git a/LibCarla/source/carla/ros2/ROS2.h b/LibCarla/source/carla/ros2/ROS2.h index 1feaf37f68c..d3c3a561f7e 100644 --- a/LibCarla/source/carla/ros2/ROS2.h +++ b/LibCarla/source/carla/ros2/ROS2.h @@ -25,7 +25,7 @@ namespace carla { namespace ros2 { class DdsDomainParticipantImpl; -class UePublisherBaseSensor; +class UePublisherBase; class TransformPublisher; class CarlaActorListPublisher; class UeWorldPublisher; diff --git a/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp index 2935a69f704..2d0902f6797 100644 --- a/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.cpp @@ -10,7 +10,7 @@ namespace carla { namespace ros2 { CarlaStatusPublisher::CarlaStatusPublisher() - : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("status")), + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("status")), _impl(std::make_shared()) {} bool CarlaStatusPublisher::Init(std::shared_ptr domain_participant) { diff --git a/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.h b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.h index 505eb7524fa..260d5ee323d 100644 --- a/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/CarlaStatusPublisher.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/publishers/PublisherBase.h" #include "carla_msgs/msg/CarlaStatusPubSubTypes.h" namespace carla { @@ -12,7 +12,7 @@ namespace ros2 { using CarlaStatusPublisherImpl = DdsPublisherImpl; -class CarlaStatusPublisher : public PublisherBaseSensor { +class CarlaStatusPublisher : public PublisherBase { public: CarlaStatusPublisher(); virtual ~CarlaStatusPublisher() = default; diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp index 01be3fbbefb..41f514643a8 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.cpp @@ -11,7 +11,7 @@ namespace carla { namespace ros2 { ObjectsPublisher::ObjectsPublisher(ObjectsPublisher::ObjectMode const update_mode, std::string role_name) - : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName(role_name)) + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName(role_name)) , _impl(std::make_shared()) , _update_mode(update_mode) { diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h index d392ff5a693..9f13846897e 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/ObjectsPublisher.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/publishers/PublisherBase.h" #include "carla/ros2/types/Object.h" #include "derived_object_msgs/msg/ObjectArrayPubSubTypes.h" @@ -14,7 +14,7 @@ namespace ros2 { using ObjectsPublisherImpl = DdsPublisherImpl; -class ObjectsPublisher : public PublisherBaseSensor { +class ObjectsPublisher : public PublisherBase { public: enum class ObjectMode { DYNAMIC_PUBLISH_ALWAYS, diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp index e7c21c63c79..364b458c9b6 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.cpp @@ -10,7 +10,7 @@ namespace carla { namespace ros2 { ObjectsWithCovariancePublisher::ObjectsWithCovariancePublisher() - : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("objects_with_covariance")), + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("objects_with_covariance")), _impl(std::make_shared()) {} bool ObjectsWithCovariancePublisher::Init(std::shared_ptr domain_participant) { diff --git a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h index 066b74fb481..111cfdd8ad1 100644 --- a/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h +++ b/LibCarla/source/carla/ros2/publishers/ObjectsWithCovariancePublisher.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/publishers/PublisherBase.h" #include "carla/ros2/types/Object.h" #include "derived_object_msgs/msg/ObjectWithCovarianceArrayPubSubTypes.h" @@ -14,7 +14,7 @@ namespace ros2 { using ObjectsWithCovariancePublisherImpl = DdsPublisherImpl; -class ObjectsWithCovariancePublisher : public PublisherBaseSensor { +class ObjectsWithCovariancePublisher : public PublisherBase { public: ObjectsWithCovariancePublisher(); virtual ~ObjectsWithCovariancePublisher() = default; diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBase.h b/LibCarla/source/carla/ros2/publishers/PublisherBase.h index ab40360e33b..e13de2bb456 100644 --- a/LibCarla/source/carla/ros2/publishers/PublisherBase.h +++ b/LibCarla/source/carla/ros2/publishers/PublisherBase.h @@ -84,6 +84,21 @@ class PublisherBase : public PublisherInterface, public ROS2NameRecord { return _actor_name_definition->carla_actor_info(name_registry); } + /** + * Implement Message Processing in case the publisher has to do so. + */ + virtual void ProcessMessages() {}; + + /** + * Implement actions before sensor data updates + */ + virtual void UpdateSensorDataPreAction() {}; + + /** + * Implement actions after sensor data updates + */ + virtual void UpdateSensorDataPostAction() {} + }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h b/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h deleted file mode 100644 index c7069d5060a..00000000000 --- a/LibCarla/source/carla/ros2/publishers/PublisherBaseSensor.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2025 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "carla/ros2/publishers/PublisherBase.h" -#include "carla/ros2/types/SensorActorDefinition.h" - -namespace carla { -namespace ros2 { - -/** - A Publisher base class for publisher that provide data similiar or equal to sensors. - Extends PublisherBase by specialized sensor get_topic_qos(). -*/ -class PublisherBaseSensor : public PublisherBase { -public: - PublisherBaseSensor(std::shared_ptr actor_name_definition) - : PublisherBase(actor_name_definition) {} - virtual ~PublisherBaseSensor() = default; -}; -} // namespace ros2 -} // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h b/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h index 2014a1d0adf..4ded84f6ad4 100644 --- a/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h +++ b/LibCarla/source/carla/ros2/publishers/PublisherBaseTransform.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/publishers/PublisherBase.h" #include "carla/ros2/publishers/TransformPublisher.h" #include "carla/ros2/types/CoordinateSystemTransform.h" @@ -19,14 +19,14 @@ namespace ros2 { A Publisher base class that is extended to store an internal Transform. Use this class for publisher that need a transform conversion for the TF tree in addition. */ -class PublisherBaseTransform : public PublisherBaseSensor { +class PublisherBaseTransform : public PublisherBase { public: using CoordinateSystemTransform = carla::ros2::types::CoordinateSystemTransform; PublisherBaseTransform(std::shared_ptr actor_name_definition, std::shared_ptr transform_publisher, TransformPublisher::TransformPublisherMode const mode) - : PublisherBaseSensor(actor_name_definition), _transform_publisher(transform_publisher), _mode(mode) {} + : PublisherBase(actor_name_definition), _transform_publisher(transform_publisher), _mode(mode) {} virtual ~PublisherBaseTransform() { // remove the transform from the TF tree when the publisher is destroyed diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp index b0a026a252d..ce0a1c88a44 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.cpp @@ -13,7 +13,7 @@ TrafficLightPublisher::TrafficLightPublisher( std::shared_ptr traffic_light_actor_definition, std::shared_ptr objects_publisher, std::shared_ptr traffic_lights_publisher) - : PublisherBaseSensor( + : PublisherBase( std::static_pointer_cast(traffic_light_actor_definition)) #if PUBLISH_INDIVIDUAL_TRAFFIC_LIGHT_DATA , _traffic_light_info_publisher(std::make_shared()) diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h index 098b2cbc4eb..783a7d6af14 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightPublisher.h @@ -5,7 +5,7 @@ #pragma once #include "carla/ros2/publishers/ObjectPublisher.h" -#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/publishers/PublisherBase.h" #include "carla/ros2/publishers/TrafficLightsPublisher.h" #include "carla/ros2/types/Object.h" #include "carla/ros2/types/TrafficLightActorDefinition.h" @@ -23,7 +23,7 @@ using TrafficLightInfoPublisherImpl = using TrafficLightStatusPublisherImpl = DdsPublisherImpl; -class TrafficLightPublisher : public PublisherBaseSensor { +class TrafficLightPublisher : public PublisherBase { public: TrafficLightPublisher(std::shared_ptr traffic_light_actor_definition, std::shared_ptr objects_publisher, diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp index 67d825acb6c..054ebc78869 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.cpp @@ -11,7 +11,7 @@ namespace carla { namespace ros2 { TrafficLightsPublisher::TrafficLightsPublisher() - : PublisherBaseSensor(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("traffic_lights")), + : PublisherBase(carla::ros2::types::ActorNameDefinition::CreateFromRoleName("traffic_lights")), _traffic_light_info(std::make_shared()), _traffic_light_status(std::make_shared()) {} diff --git a/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.h b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.h index caf0df7e8bc..02e9560c382 100644 --- a/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/TrafficLightsPublisher.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/PublisherBaseSensor.h" +#include "carla/ros2/publishers/PublisherBase.h" #include "carla/rpc/ActorId.h" #include "carla_msgs/msg/CarlaTrafficLightInfoListPubSubTypes.h" #include "carla_msgs/msg/CarlaTrafficLightStatusListPubSubTypes.h" @@ -17,7 +17,7 @@ using TrafficLightsInfoPublisherImpl = using TrafficLightsStatusPublisherImpl = DdsPublisherImpl; -class TrafficLightsPublisher : public PublisherBaseSensor { +class TrafficLightsPublisher : public PublisherBase { public: TrafficLightsPublisher(); virtual ~TrafficLightsPublisher() = default; diff --git a/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.cpp index bc4030d02e3..2e8039fda61 100644 --- a/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.cpp @@ -14,7 +14,7 @@ namespace ros2 { UeCollisionPublisher::UeCollisionPublisher( std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) - : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + : UePublisherBase(sensor_actor_definition, transform_publisher), _impl(std::make_shared()) {} bool UeCollisionPublisher::Init(std::shared_ptr domain_participant) { diff --git a/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.h b/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.h index 5a92d9f1ed6..d793d16f531 100644 --- a/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeCollisionPublisher.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/UePublisherBase.h" #include "carla/sensor/s11n/CollisionEventSerializer.h" #include "carla_msgs/msg/CarlaCollisionEventPubSubTypes.h" @@ -14,7 +14,7 @@ namespace ros2 { using UeCollisionPublisherImpl = DdsPublisherImpl; -class UeCollisionPublisher : public UePublisherBaseSensor { +class UeCollisionPublisher : public UePublisherBase { public: UeCollisionPublisher(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher); @@ -35,7 +35,7 @@ class UeCollisionPublisher : public UePublisherBaseSensor { bool SubscribersConnected() const override; /** - * Implements UePublisherBaseSensor::UpdateSensorData() interface + * Implements UePublisherBase::UpdateSensorData() interface */ void UpdateSensorData(std::shared_ptr sensor_header, carla::SharedBufferView buffer_view) override; diff --git a/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.h index 08257856c21..a7c40e06243 100644 --- a/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeDVSCameraPublisher.h @@ -35,7 +35,7 @@ class UeDVSCameraPublisher : public UePublisherBaseCamera sensor_header, const carla::SharedBufferView buffer_view) override; diff --git a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp index 24da9afd913..8aa09293dcd 100644 --- a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp @@ -11,7 +11,7 @@ namespace ros2 { UeGNSSPublisher::UeGNSSPublisher(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) - : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + : UePublisherBase(sensor_actor_definition, transform_publisher), _impl(std::make_shared()) {} bool UeGNSSPublisher::Init(std::shared_ptr domain_participant) { diff --git a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h index b86d0c03a9c..4c4936c0ac6 100644 --- a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h @@ -6,7 +6,7 @@ #include -#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/UePublisherBase.h" #include "carla/sensor/s11n/GnssSerializer.h" #include "sensor_msgs/msg/NavSatFixPubSubTypes.h" @@ -15,7 +15,7 @@ namespace ros2 { using UeGNSSPublisherImpl = DdsPublisherImpl; -class UeGNSSPublisher : public UePublisherBaseSensor { +class UeGNSSPublisher : public UePublisherBase { public: UeGNSSPublisher(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher); @@ -36,7 +36,7 @@ class UeGNSSPublisher : public UePublisherBaseSensor { bool SubscribersConnected() const override; /** - * Implements UePublisherBaseSensor::UpdateSensorData() interface + * Implements UePublisherBase::UpdateSensorData() interface */ void UpdateSensorData(std::shared_ptr sensor_header, const carla::SharedBufferView buffer_view) override; diff --git a/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp index c0b80b7bc0e..831fc333c9f 100644 --- a/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.cpp @@ -16,7 +16,7 @@ namespace ros2 { UeIMUPublisher::UeIMUPublisher(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) - : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + : UePublisherBase(sensor_actor_definition, transform_publisher), _impl(std::make_shared()) {} bool UeIMUPublisher::Init(std::shared_ptr domain_participant) { diff --git a/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.h b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.h index bc1618d5d82..f7fc49d95c0 100644 --- a/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeIMUPublisher.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/UePublisherBase.h" #include "carla/sensor/s11n/IMUSerializer.h" #include "geometry_msgs/msg/Accel.h" #include "sensor_msgs/msg/ImuPubSubTypes.h" @@ -14,7 +14,7 @@ namespace ros2 { using UeIMUPublisherImpl = DdsPublisherImpl; -class UeIMUPublisher : public UePublisherBaseSensor { +class UeIMUPublisher : public UePublisherBase { public: UeIMUPublisher(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher); @@ -35,7 +35,7 @@ class UeIMUPublisher : public UePublisherBaseSensor { bool SubscribersConnected() const override; /** - * Implements UePublisherBaseSensor::UpdateSensorData() interface + * Implements UePublisherBase::UpdateSensorData() interface */ void UpdateSensorData(std::shared_ptr sensor_header, const carla::SharedBufferView buffer_view) override; diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h b/LibCarla/source/carla/ros2/publishers/UePublisherBase.h similarity index 81% rename from LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h rename to LibCarla/source/carla/ros2/publishers/UePublisherBase.h index 5cbfa7442a4..f4db6ca5f6c 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseSensor.h +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBase.h @@ -7,6 +7,7 @@ #include #include "carla/ros2/publishers/PublisherBaseTransform.h" +#include "carla/ros2/types/SensorActorDefinition.h" #include "carla/rpc/ActorId.h" @@ -18,36 +19,28 @@ namespace ros2 { Extends PublisherBaseTransform by UpdateSensorData() function. Usually sensors are not moving in respect to their parent in the TF tree, so the transform is published as static and only updated if the sensor's position relatively to the parent changes. */ -class UePublisherBaseSensor : public PublisherBaseTransform { +class UePublisherBase : public PublisherBaseTransform { public: - UePublisherBaseSensor(std::shared_ptr sensor_actor_definition, + UePublisherBase(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) : PublisherBaseTransform(sensor_actor_definition, transform_publisher, TransformPublisher::TransformPublisherMode::MODE_STATIC) {} - virtual ~UePublisherBaseSensor() = default; + virtual ~UePublisherBase() = default; - /** - * Implement actions before sensor data updates - */ - virtual void UpdateSensorDataPreAction() {}; /** * Function to update the data for this sensor */ virtual void UpdateSensorData( std::shared_ptr sensor_header, carla::SharedBufferView buffer_view) = 0; - /** - * Implement actions after sensor data updates - */ - virtual void UpdateSensorDataPostAction() {} /** * calling UpdateSensorDataPostAction but store frame_id for later use */ void UpdateSensorDataPostAction(uint64_t frame_id) { sensor_data_post_action_frame_id = frame_id; - UpdateSensorDataPostAction(); + PublisherBase::UpdateSensorDataPostAction(); } uint64_t GetSensorDataPostActionFrameId() const { diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc index 75e150b1b92..76e4f528bc0 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc @@ -14,7 +14,7 @@ template UePublisherBaseCamera::UePublisherBaseCamera( std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) - : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + : UePublisherBase(sensor_actor_definition, transform_publisher), _image(std::make_shared >()), _camera_info(std::make_shared()) {} diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h index 7466b39014f..d268a382f96 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.h @@ -5,7 +5,7 @@ #pragma once #include "carla/Exception.h" -#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/UePublisherBase.h" #include "carla/sensor/s11n/ImageSerializer.h" #include "sensor_msgs/msg/CameraInfoPubSubTypes.h" #include "sensor_msgs/msg/ImagePubSubTypes.h" @@ -21,11 +21,11 @@ using UeCameraInfoPublisherImpl = /** A Publisher base class for camera sensors. -Extends UePublisherBaseSensor by an image and camera_info publisher providing default implemenations for sending the +Extends UePublisherBase by an image and camera_info publisher providing default implemenations for sending the camera data from the rendering buffer copyless via DDS */ template -class UePublisherBaseCamera : public UePublisherBaseSensor { +class UePublisherBaseCamera : public UePublisherBase { public: using allocator_type = ALLOCATOR; @@ -55,7 +55,7 @@ class UePublisherBaseCamera : public UePublisherBaseSensor { bool SubscribersConnected() const override; /** - * Implements UePublisherBaseSensor::UpdateSensorData() interface + * Implements UePublisherBase::UpdateSensorData() interface */ void UpdateSensorData(std::shared_ptr sensor_header, const carla::SharedBufferView buffer_view) override; diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.cc b/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.cc index 9661b21b899..87dab48d9c6 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.cc +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.cc @@ -12,7 +12,7 @@ template UePublisherBasePointCloud::UePublisherBasePointCloud( std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) - : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + : UePublisherBase(sensor_actor_definition, transform_publisher), _point_cloud(std::make_shared()) {} template diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.h b/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.h index 7195e16e39d..a4252766207 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.h +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBasePointCloud.h @@ -4,7 +4,7 @@ #pragma once -#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/UePublisherBase.h" #include "sensor_msgs/msg/PointCloud2PubSubTypes.h" namespace carla { @@ -15,10 +15,10 @@ using UePublisherPointCloudImpl = /** A Publisher base class for point cloud publisher sensors. - Extends UePublisherBaseSensor by an point cloud publisher. + Extends UePublisherBase by an point cloud publisher. */ template -class UePublisherBasePointCloud : public UePublisherBaseSensor { +class UePublisherBasePointCloud : public UePublisherBase { public: UePublisherBasePointCloud(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher); @@ -39,7 +39,7 @@ class UePublisherBasePointCloud : public UePublisherBaseSensor { bool SubscribersConnected() const override; /** - * Implements UePublisherBaseSensor::UpdateSensorData() interface + * Implements UePublisherBase::UpdateSensorData() interface */ void UpdateSensorData(std::shared_ptr sensor_header, const carla::SharedBufferView buffer_view) override; diff --git a/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.cpp index da61449a45d..18f771a0af3 100644 --- a/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.cpp @@ -24,7 +24,7 @@ bool UeRGBCameraPublisher::Init(std::shared_ptr domain return _initialized; } -void UeRGBCameraPublisher::UpdateSensorDataPreAction() { +void UeRGBCameraPublisher::ProcessMessages() { if (!_initialized) { return; } diff --git a/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.h b/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.h index 079785b7b8e..7e6a4f8471c 100644 --- a/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeRGBCameraPublisher.h @@ -26,9 +26,9 @@ class UeRGBCameraPublisher : public UePublisherBaseCamera domain_participant) override; /** - * Implement UePublisherBaseSensor::UpdateSensorDataPreAction() + * Process incoming messages. */ - void UpdateSensorDataPreAction() override; + void ProcessMessages() override; private: std::shared_ptr actor_set_transform_subscriber; diff --git a/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.cpp index b25f8ea1d76..b8bd3a85946 100644 --- a/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.cpp @@ -12,7 +12,7 @@ namespace ros2 { UeV2XCustomPublisher::UeV2XCustomPublisher(std::shared_ptr sensor_actor_definition, carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback, std::shared_ptr transform_publisher) - : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + : UePublisherBase(sensor_actor_definition, transform_publisher), _subscriber(std::make_shared(*this, v2x_custom_send_callback)), _impl(std::make_shared()) {} @@ -31,7 +31,7 @@ bool UeV2XCustomPublisher::SubscribersConnected() const { return _impl->SubscribersConnected(); } -void UeV2XCustomPublisher::UpdateSensorDataPreAction() +void UeV2XCustomPublisher::ProcessMessages() { if (!_initialized) { return; diff --git a/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.h b/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.h index 71679588ddb..0a392629888 100644 --- a/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeV2XCustomPublisher.h @@ -6,7 +6,7 @@ #include -#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/UePublisherBase.h" #include "carla/ros2/subscribers/UeV2XCustomSubscriber.h" #include "carla/sensor/data/V2XEvent.h" #include "carla_msgs/msg/CarlaV2XCustomDataListPubSubTypes.h" @@ -16,7 +16,7 @@ namespace ros2 { using UeV2XCustomPublisherImpl = DdsPublisherImpl; -class UeV2XCustomPublisher : public UePublisherBaseSensor { +class UeV2XCustomPublisher : public UePublisherBase { public: UeV2XCustomPublisher(std::shared_ptr sensor_actor_definition, carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback, @@ -38,11 +38,11 @@ class UeV2XCustomPublisher : public UePublisherBaseSensor { bool SubscribersConnected() const override; /** - * Implement UePublisherBaseSensor::UpdateSensorDataPreAction() + * Implement PublisherBase::ProcessMessages() */ - void UpdateSensorDataPreAction() override; + void ProcessMessages() override; /** - * Implements UePublisherBaseSensor::UpdateSensorData() interface + * Implements UePublisherBase::UpdateSensorData() interface */ void UpdateSensorData(std::shared_ptr sensor_header, const carla::SharedBufferView buffer_view) override; diff --git a/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.cpp index 8888edb2583..cd1dbab79fd 100644 --- a/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.cpp @@ -11,7 +11,7 @@ namespace ros2 { UeV2XPublisher::UeV2XPublisher(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) - : UePublisherBaseSensor(sensor_actor_definition, transform_publisher), + : UePublisherBase(sensor_actor_definition, transform_publisher), _impl(std::make_shared()) {} bool UeV2XPublisher::Init(std::shared_ptr domain_participant) { diff --git a/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.h b/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.h index de511c3a4b3..3efc3b3e56d 100644 --- a/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeV2XPublisher.h @@ -6,7 +6,7 @@ #include -#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/UePublisherBase.h" #include "carla/sensor/data/V2XEvent.h" #include "carla_msgs/msg/CarlaV2XDataListPubSubTypes.h" @@ -15,7 +15,7 @@ namespace ros2 { using UeV2XPublisherImpl = DdsPublisherImpl; -class UeV2XPublisher : public UePublisherBaseSensor { +class UeV2XPublisher : public UePublisherBase { public: UeV2XPublisher(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher); @@ -36,7 +36,7 @@ class UeV2XPublisher : public UePublisherBaseSensor { bool SubscribersConnected() const override; /** - * Implements UePublisherBaseSensor::UpdateSensorData() interface + * Implements UePublisherBase::UpdateSensorData() interface */ void UpdateSensorData(std::shared_ptr sensor_header, const carla::SharedBufferView buffer_view) override; diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index 621ecb6e73a..157fa7e0aec 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -41,7 +41,7 @@ namespace ros2 { UeWorldPublisher::UeWorldPublisher(carla::rpc::RpcServerInterface& carla_server, std::shared_ptr name_registry, std::shared_ptr sensor_actor_definition) - : UePublisherBaseSensor(sensor_actor_definition, std::make_shared()), + : UePublisherBase(sensor_actor_definition, std::make_shared()), _carla_server(carla_server), _name_registry(name_registry), _clock_publisher(std::make_shared()), @@ -69,7 +69,7 @@ UeWorldPublisher::UeWorldPublisher(carla::rpc::RpcServerInterface& carla_server, bool UeWorldPublisher::Init(std::shared_ptr domain_participant) { // add this to the list of sensors first auto sensor_ue = AddSensorUeInternal(GetSensorActorDefinition()); - sensor_ue->publisher=std::static_pointer_cast(shared_from_this()); + sensor_ue->publisher=std::static_pointer_cast(shared_from_this()); _domain_participant_impl = domain_participant; _initialized = @@ -117,18 +117,20 @@ void UeWorldPublisher::ProcessMessages() { _carla_control_subscriber->ProcessMessages(); _sync_subscriber->ProcessMessages(); - _weather_publisher->ProcessMessages(); - _world_info_publisher->ProcessMessages(); _weather_control_subscriber->ProcessMessages(); for (auto& vehicle : _vehicles) { vehicle.second._vehicle_controller->ProcessMessages(); vehicle.second._vehicle_ackermann_controller->ProcessMessages(); vehicle.second._actor_set_transform_subscriber->ProcessMessages(); - vehicle.second._vehicle_publisher->ProcessMessages(); } for (auto& walker : _walkers) { walker.second._walker_controller->ProcessMessages(); } + for (auto &ue_sensor : _ue_sensors) { + if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) ) { + ue_sensor.second.publisher->ProcessMessages(); + } + } UpdateAndPublishEnvironmentObjects(); UpdateAndPublishStatus(); @@ -154,11 +156,32 @@ void UeWorldPublisher::UpdateSensorDataPreAction() { } } + _world_info_publisher->UpdateSensorDataPreAction(); + for (auto &ue_sensor : _ue_sensors) { if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) ) { ue_sensor.second.publisher->UpdateSensorDataPreAction(); } } + for (auto& vehicle : _vehicles) { + auto publisher = vehicle.second._vehicle_publisher; + if (publisher != nullptr) { + publisher->UpdateSensorDataPreAction(); + } + } + for (auto& walker : _walkers) { + auto publisher = walker.second._walker_publisher; + if (publisher != nullptr) { + publisher->UpdateSensorDataPreAction(); + } + } + for (auto& traffic_light : _traffic_lights) { + auto publisher = traffic_light.second._traffic_light_publisher; + if (publisher != nullptr) { + publisher->UpdateSensorDataPreAction(); + } + } + if (_sensors_changed) { _sensors_changed = false; @@ -231,6 +254,7 @@ void UeWorldPublisher::UpdateSensorDataPostAction() { // This is to ensure that the clock and TF messages are published before the other messages, which might depend on them. // Most of the ROS2 applications might not have an issue with slightly later published clock and TF messages, // but some applications (e.g. rviz) might require the clock and TF messages to be published before the other messages. + _transform_publisher->Publish(); _clock_publisher->Publish(); UpdateAndPublishStatus(); @@ -249,18 +273,21 @@ void UeWorldPublisher::UpdateSensorDataPostAction() { for (auto& vehicle : _vehicles) { auto publisher = vehicle.second._vehicle_publisher; if (publisher != nullptr) { + publisher->UpdateSensorDataPostAction(); publisher->Publish(); } } for (auto& walker : _walkers) { auto publisher = walker.second._walker_publisher; if (publisher != nullptr) { + publisher->UpdateSensorDataPostAction(); publisher->Publish(); } } for (auto& traffic_light : _traffic_lights) { auto publisher = traffic_light.second._traffic_light_publisher; if (publisher != nullptr) { + publisher->UpdateSensorDataPostAction(); publisher->Publish(); } } @@ -285,78 +312,78 @@ void UeWorldPublisher::CreateSensorUePublisher(UeSensor &sensor) { switch (sensor.sensor_actor_definition()->sensor_type) { case types::PublisherSensorType::CollisionSensor: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::DepthCamera: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::NormalsCamera: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::DVSCamera: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::GnssSensor: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::InertialMeasurementUnit: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::OpticalFlowCamera: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::Radar: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::RayCastSemanticLidar: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::RayCastLidar: case types::PublisherSensorType::HSSLidar: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::SceneCaptureCamera: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher, sensor.actor_set_transform_callback)); } break; case types::PublisherSensorType::SemanticSegmentationCamera: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::InstanceSegmentationCamera: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::V2X: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), _transform_publisher)); } break; case types::PublisherSensorType::V2XCustom: { - sensor.publisher = std::static_pointer_cast( + sensor.publisher = std::static_pointer_cast( std::make_shared(sensor.sensor_actor_definition(), sensor.v2x_custom_send_callback, _transform_publisher)); } break; case types::PublisherSensorType::WorldObserver: diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h index eeca8f3504b..e875da2fe61 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.h @@ -15,7 +15,7 @@ #include "carla/ros2/publishers/TrafficLightPublisher.h" #include "carla/ros2/publishers/TrafficLightsPublisher.h" #include "carla/ros2/publishers/TrafficSignPublisher.h" -#include "carla/ros2/publishers/UePublisherBaseSensor.h" +#include "carla/ros2/publishers/UePublisherBase.h" #include "carla/ros2/publishers/VehiclePublisher.h" #include "carla/ros2/publishers/WalkerPublisher.h" #include "carla/ros2/publishers/WeatherPublisher.h" @@ -48,7 +48,7 @@ namespace ros2 { * -... * */ -class UeWorldPublisher : public UePublisherBaseSensor, public std::enable_shared_from_this { +class UeWorldPublisher : public UePublisherBase, public std::enable_shared_from_this { public: UeWorldPublisher(carla::rpc::RpcServerInterface &carla_server, std::shared_ptr name_registry, std::shared_ptr sensor_actor_definition); @@ -76,7 +76,7 @@ class UeWorldPublisher : public UePublisherBaseSensor, public std::enable_shared /** * Process incoming messages */ - void ProcessMessages(); + void ProcessMessages() override; /** * Implement actions on actors removed @@ -84,17 +84,17 @@ class UeWorldPublisher : public UePublisherBaseSensor, public std::enable_shared void RemoveActor(ActorId actor); /** - * Implement UePublisherBaseSensor::UpdateSensorDataPreAction() + * Implement UePublisherBase::UpdateSensorDataPreAction() */ void UpdateSensorDataPreAction() override; /** - * Implement UePublisherBaseSensor::UpdateSensorData() + * Implement UePublisherBase::UpdateSensorData() */ void UpdateSensorData(std::shared_ptr sensor_header, carla::SharedBufferView buffer_view) override; /** - * Implement UePublisherBaseSensor::UpdateSensorDataPostAction() + * Implement UePublisherBase::UpdateSensorDataPostAction() */ void UpdateSensorDataPostAction() override; @@ -221,7 +221,7 @@ class UeWorldPublisher : public UePublisherBaseSensor, public std::enable_shared std::shared_ptr sensor_actor_record; carla::ros2::types::V2XCustomSendCallback v2x_custom_send_callback{nullptr}; bool publisher_expected{true}; - std::shared_ptr publisher; + std::shared_ptr publisher; std::shared_ptr session; carla::ros2::types::ActorSetTransformCallback actor_set_transform_callback{nullptr}; carla::ros2::types::Transform transform; diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp index 2661f685ffa..9017d284cec 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.cpp @@ -57,11 +57,9 @@ bool VehiclePublisher::SubscribersConnected() const { _vehicle_object_with_covariance_publisher->SubscribersConnected(); } -bool VehiclePublisher::ProcessMessages() { +void VehiclePublisher::UpdateSensorDataPreAction() { // the telemetry data is not transferred by the sensor data stream, - // it has to be requested separately from the server, - // This should happen within the message processing step, when also other calls are expected - // to ensure the simulation internal data is actually locked and its safe to acceess it. + // it has to be requested separately before the sensor data is processed to be able to include it in the sensor data callback processing if (_vehicle_telemetry_publisher->SubscribersConnected()) { auto telemetry_data_response = _carla_server.call_get_telemetry_data(_actor_name_definition->id); if (telemetry_data_response.HasError()) { @@ -107,7 +105,6 @@ bool VehiclePublisher::ProcessMessages() { _vehicle_telemetry_publisher->SetMessageUpdated(); } } - return true; } void VehiclePublisher::UpdateVehicle(std::shared_ptr &object, diff --git a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h index c2463097e9c..f6b7367d732 100644 --- a/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h +++ b/LibCarla/source/carla/ros2/publishers/VehiclePublisher.h @@ -58,9 +58,9 @@ class VehiclePublisher : public PublisherBaseTransform { bool SubscribersConnected() const override; /** - * Perform message processing. + * Query the not streamed data from the server before processing the sensor data. */ - bool ProcessMessages(); + void UpdateSensorDataPreAction() override; void UpdateVehicle(std::shared_ptr &object, carla::sensor::data::ActorDynamicState const &actor_dynamic_state); diff --git a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp index 737ecccd771..9237959d241 100644 --- a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.cpp @@ -28,7 +28,7 @@ bool WeatherPublisher::SubscribersConnected() const { return _impl->SubscribersConnected(); } -bool WeatherPublisher::ProcessMessages() { +void WeatherPublisher::UpdateSensorDataPreAction() { // the weather data is not transferred by the sensor data stream, // it has to be requested separately from the server, // This should happen within the message processing step, when also other calls are expected @@ -50,7 +50,6 @@ bool WeatherPublisher::ProcessMessages() { } } } - return true; } } // namespace ros2 diff --git a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h index 374428aa6f2..afed6bbc384 100644 --- a/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/WeatherPublisher.h @@ -34,9 +34,9 @@ class WeatherPublisher : public PublisherBase { bool SubscribersConnected() const override; /** - * Perform message processing. + * Query the not streamed data from the server before processing the sensor data. */ - bool ProcessMessages(); + void UpdateSensorDataPreAction() override; private: std::shared_ptr _impl; diff --git a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp index a0eed5b727f..0f701b1564c 100644 --- a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.cpp @@ -30,7 +30,7 @@ bool WorldInfoPublisher::SubscribersConnected() const { return _impl->SubscribersConnected(); } -bool WorldInfoPublisher::ProcessMessages() { +void WorldInfoPublisher::UpdateSensorDataPreAction() { if ( _map_updated ) { _impl->Message().carla_version(carla::version()); @@ -39,7 +39,6 @@ bool WorldInfoPublisher::ProcessMessages() { _impl->SetMessageUpdated(); _map_updated = false; } - return true; } } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.h b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.h index 5b0dbf704e9..a6d0160f102 100644 --- a/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/WorldInfoPublisher.h @@ -35,9 +35,9 @@ class WorldInfoPublisher : public PublisherBase { bool SubscribersConnected() const override; /** - * Perform message processing. + * Query the not streamed data from the server before processing the sensor data. */ - bool ProcessMessages(); + void UpdateSensorDataPreAction() override; /** * Indicate that the map has updated and the server should be quieried for map updates. From 57e8890f593da294d2c75d65ae00ea143cc0a411 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Mon, 16 Mar 2026 18:33:09 +0100 Subject: [PATCH 33/39] Ensure proper synchonization on Publish() Synchonize the publishing of UePublisher::Publish() calls to ensure that the data was properly updated before at UpdateSensorDataPostAction() and check after sensor data update if late publishing has to be performed. --- .../carla/ros2/publishers/UePublisherBase.h | 41 +++++++++++++++---- .../ros2/publishers/UeWorldPublisher.cpp | 11 +---- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBase.h b/LibCarla/source/carla/ros2/publishers/UePublisherBase.h index f4db6ca5f6c..2130ac085f1 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBase.h +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBase.h @@ -35,16 +35,41 @@ class UePublisherBase : public PublisherBaseTransform { std::shared_ptr sensor_header, carla::SharedBufferView buffer_view) = 0; + void UpdateSensorDataAndCheckPublish(uint64_t frame_id, + std::shared_ptr sensor_header, + carla::SharedBufferView buffer_view) { + + UpdateSensorData(sensor_header, buffer_view); + sensor_data_update_frame_id.store(frame_id); + if ( sensor_data_post_action_frame_id.load() >= frame_id ) { + // camera sensors trigger their data streams from the rendering thread + // therefore, the UpdateSensorDataPostAction() of the world publisher (running in the game thread) + // might have already been called for the current frame, which usually triggers the publishing of the sensor data. + // In this case, we need to force a publish here to make sure the data gets published in a timely manner. + log_verbose("Sensor Data to ROS data: frame.(", frame_id, ") stream.", + std::to_string(*std::static_pointer_cast(_actor_name_definition)), + " Late publishing in CheckPublishAfterDataUpdate()."); + Publish(); + } + } + /** * calling UpdateSensorDataPostAction but store frame_id for later use */ - void UpdateSensorDataPostAction(uint64_t frame_id) { - sensor_data_post_action_frame_id = frame_id; - PublisherBase::UpdateSensorDataPostAction(); - } - - uint64_t GetSensorDataPostActionFrameId() const { - return sensor_data_post_action_frame_id; + void UpdateSensorDataPostActionAndCheckPublish(uint64_t frame_id) { + sensor_data_post_action_frame_id.store(frame_id); + UpdateSensorDataPostAction(); + if (sensor_data_update_frame_id.load() >= frame_id) { + // If the sensor data stream already updated the data for this frame, we publish in here + // which is the standard for all UePublisher + // If not, then either that UePublisher has nothing to publish this frame, or its stream + // didn't yet update it's data. In both cases we don't need to publish now. + // In the later case publishing will be triggered in UpdateSensorDataAndCheckPublish() at a later point in time. + log_verbose("Sensor Data to ROS data: frame.(", frame_id, ") stream.", + std::to_string(*std::static_pointer_cast(_actor_name_definition)), + " Standard publishing in UpdateSensorDataPostActionAndCheckPublish()."); + Publish(); + } } builtin_interfaces::msg::Time GetTime( @@ -58,7 +83,7 @@ class UePublisherBase : public PublisherBaseTransform { private: std::atomic sensor_data_post_action_frame_id{0u}; - + std::atomic sensor_data_update_frame_id{0u}; }; } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index 157fa7e0aec..79332ed8a6b 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -218,13 +218,7 @@ void UeWorldPublisher::ProcessDataFromUeSensor(carla::streaming::detail::stream_ if (ue_sensor->second.publisher->do_publish_tf() ) { ue_sensor->second.publisher->UpdateTransform(sensor_header); } - ue_sensor->second.publisher->UpdateSensorData(sensor_header, *data_view_iter); - if ( ue_sensor->second.publisher->GetSensorDataPostActionFrameId() >= CurrentFrame() ) { - // camera sensors push their data streams within the rendering thread - // therefore, the UpdateSensorDataPostAction() of the world publisher might have already been called for the current frame, - // which is used to trigger the publish of the sensor data. In this case, we need to force a publish here to make sure the data gets published in a timely manner. - ue_sensor->second.publisher->Publish(); - } + ue_sensor->second.publisher->UpdateSensorDataAndCheckPublish(CurrentFrame(), sensor_header, *data_view_iter); } log_verbose("Sensor Data to ROS data: frame.(", CurrentFrame(), ") stream.", std::to_string(*sensor_actor_definition), " Processed."); @@ -300,8 +294,7 @@ void UeWorldPublisher::UpdateSensorDataPostAction() { for (auto &ue_sensor : _ue_sensors) { if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) ) { - ue_sensor.second.publisher->UpdateSensorDataPostAction(CurrentFrame()); - ue_sensor.second.publisher->Publish(); + ue_sensor.second.publisher->UpdateSensorDataPostActionAndCheckPublish(CurrentFrame()); } } From db3ac15c2cdab029c437ca8eb0ec723e6f189c91 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Thu, 12 Mar 2026 20:36:54 +0100 Subject: [PATCH 34/39] Add GNSS Noise --- .../carla/ros2/publishers/UeGNSSPublisher.cpp | 19 ++++++++++++++++++- .../carla/ros2/publishers/UeGNSSPublisher.h | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp index 8aa09293dcd..d7f2e1290ed 100644 --- a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.cpp @@ -12,7 +12,22 @@ namespace ros2 { UeGNSSPublisher::UeGNSSPublisher(std::shared_ptr sensor_actor_definition, std::shared_ptr transform_publisher) : UePublisherBase(sensor_actor_definition, transform_publisher), - _impl(std::make_shared()) {} + _impl(std::make_shared()) + { + + if ( sensor_actor_definition->attributes.find("noise_lat_stddev") != sensor_actor_definition->attributes.end() ) { + _noise_lat_covar = std::stod(sensor_actor_definition->attributes["noise_lat_stddev"]); + _noise_lat_covar = _noise_lat_covar * _noise_lat_covar; // covariance = stddev^2 + } + if ( sensor_actor_definition->attributes.find("noise_lon_stddev") != sensor_actor_definition->attributes.end() ) { + _noise_lon_covar = std::stod(sensor_actor_definition->attributes["noise_lon_stddev"]); + _noise_lon_covar = _noise_lon_covar * _noise_lon_covar; // covariance = stddev^2 + } + if ( sensor_actor_definition->attributes.find("noise_alt_stddev") != sensor_actor_definition->attributes.end() ) { + _noise_alt_covar = std::stod(sensor_actor_definition->attributes["noise_alt_stddev"]); + _noise_alt_covar = _noise_alt_covar * _noise_alt_covar; // covariance = stddev^2 + } + } bool UeGNSSPublisher::Init(std::shared_ptr domain_participant) { return _impl->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(), get_topic_qos()); @@ -34,6 +49,8 @@ void UeGNSSPublisher::UpdateSensorData( _impl->Message().latitude(gnss_data.latitude); _impl->Message().longitude(gnss_data.longitude); _impl->Message().altitude(gnss_data.altitude); + _impl->Message().position_covariance_type(sensor_msgs::msg::NavSatFix_Constants::COVARIANCE_TYPE_DIAGONAL_KNOWN); + _impl->Message().position_covariance({ _noise_lat_covar, 0.0, 0.0, 0.0, _noise_lon_covar, 0.0, 0.0, 0.0, _noise_alt_covar }); } } // namespace ros2 } // namespace carla diff --git a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h index 4c4936c0ac6..fbca3491a6c 100644 --- a/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h +++ b/LibCarla/source/carla/ros2/publishers/UeGNSSPublisher.h @@ -48,6 +48,10 @@ class UeGNSSPublisher : public UePublisherBase { } std::shared_ptr _impl; + + double _noise_lat_covar{0.}; + double _noise_lon_covar{0.}; + double _noise_alt_covar{0.}; }; } // namespace ros2 } // namespace carla From b696ab626aa867bb5987652d02cb4fac67eb6a68 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Fri, 13 Mar 2026 15:04:43 +0100 Subject: [PATCH 35/39] Move Pixel Streams out from RenderingThread Reduce the time CARLA is blocking the rendering thread and locking Unreal resources by moving the calls for streaming the data into a background thread. --- .../Carla/Source/Carla/Sensor/PixelReader.h | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/PixelReader.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/PixelReader.h index 7d645154a5c..148d27d346e 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/PixelReader.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/PixelReader.h @@ -136,9 +136,6 @@ void FPixelReader::SendPixelsInRenderThread(TSensor &Sensor, bool use16BitFormat } auto Stream = Sensor.GetDataStream(Sensor); - Stream.SetFrameNumber(Frame); - Stream.SetTimestamp(Timestamp); - Stream.SetTransform(Transform); auto Buffer = Stream.PopBufferFromPool(); uint32 CurrentRowBytes = ExpectedRowBytes; @@ -179,14 +176,25 @@ void FPixelReader::SendPixelsInRenderThread(TSensor &Sensor, bool use16BitFormat TRACE_CPUPROFILER_EVENT_SCOPE_STR("Sending buffer"); if(Buffer.data()) { - // serialize data - carla::Buffer BufferReady(std::move(carla::sensor::SensorRegistry::Serialize(Sensor, std::move(Buffer)))); - carla::SharedBufferView BufView = carla::BufferView::CreateFrom(std::move(BufferReady)); - - // network - SCOPE_CYCLE_COUNTER(STAT_CarlaSensorStreamSend); - TRACE_CPUPROFILER_EVENT_SCOPE_STR("Stream Send"); - Stream.Send(Sensor, BufView); + // Move the buffer and necessary context into a background task + // We want to exit the rendering thread as soon as possible to ensure the locks on the + // hardware buffers are released + AsyncTask(ENamedThreads::AnyBackgroundHiPriTask, [Buffer = std::move(Buffer), &Sensor, Frame, Timestamp, Transform]() mutable + { + TRACE_CPUPROFILER_EVENT_SCOPE_STR("Async Network Send"); + + // since we are again in another thread, re-check for sensor destruction + if (Sensor.IsPendingKill()) return; + + carla::Buffer BufferReady(std::move(carla::sensor::SensorRegistry::Serialize(Sensor, std::move(Buffer)))); + carla::SharedBufferView BufView = carla::BufferView::CreateFrom(std::move(BufferReady)); + + auto Stream = Sensor.GetDataStream(Sensor); + Stream.SetFrameNumber(Frame); + Stream.SetTimestamp(Timestamp); + Stream.SetTransform(Transform); + Stream.Send(Sensor, BufView); + }); } } }; From c8c6cc35494b09e01ef4d7c1f81df2a801afe4f3 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Tue, 24 Mar 2026 10:13:48 +0100 Subject: [PATCH 36/39] Harmonize derived_object_msgs Object center points The pose of Objects has been the Carla reference position: which is for pedestrians the center of the bounding box and for vehicles center but on ground level. Therefore, the bounding-box center offset of the actors has been considered to move the pose for all Objects into the bounding box center. This makes it easier for processing on downstream applications, even tough this differs from old carla_ros_bridge behavior. --- LibCarla/source/carla/ros2/types/Object.h | 86 ++++++++++++-------- LibCarla/source/carla/ros2/types/Transform.h | 4 +- 2 files changed, 56 insertions(+), 34 deletions(-) diff --git a/LibCarla/source/carla/ros2/types/Object.h b/LibCarla/source/carla/ros2/types/Object.h index aeb0e50858c..81387bc25a8 100644 --- a/LibCarla/source/carla/ros2/types/Object.h +++ b/LibCarla/source/carla/ros2/types/Object.h @@ -9,6 +9,7 @@ #include "carla/geom/BoundingBox.h" #include "carla/ros2/types/AcceleratedMovement.h" #include "carla/ros2/types/AngularVelocity.h" +#include "carla/ros2/types/CoordinateSystemTransform.h" #include "carla/ros2/types/Polygon.h" #include "carla/ros2/types/Timestamp.h" #include "carla/ros2/types/TrafficLightActorDefinition.h" @@ -47,14 +48,14 @@ class Object { std::static_pointer_cast(vehicle_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_OTHER_VEHICLE; - if (_actor_definition->base_type == "Bus" || _actor_definition->base_type == "Truck" - || _actor_definition->base_type == "bus" || _actor_definition->base_type == "truck") { + if (actor_definition().base_type == "Bus" || actor_definition().base_type == "Truck" + || actor_definition().base_type == "bus" || actor_definition().base_type == "truck") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_TRUCK; - } else if (_actor_definition->base_type == "car" || _actor_definition->base_type == "van") { + } else if (actor_definition().base_type == "car" || actor_definition().base_type == "van") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_CAR; - } else if (_actor_definition->base_type == "motorcycle") { + } else if (actor_definition().base_type == "motorcycle") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_MOTORCYCLE; - } else if (_actor_definition->base_type == "bicycle") { + } else if (actor_definition().base_type == "bicycle") { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BIKE; } else { // as long as we don't have the concrete information within a blueprint ... @@ -74,8 +75,8 @@ class Object { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_BIKE; } carla::log_warning( - "Unknown Vehicle Object[", _actor_definition->type_id, "] id: ", _actor_definition->id, - " object_type: ", _actor_definition->object_type, " base_type: ", _actor_definition->base_type, + "Unknown Vehicle Object[", actor_definition().type_id, "] id: ", actor_definition().id, + " object_type: ", actor_definition().object_type, " base_type: ", actor_definition().base_type, " mass: ", vehicle_actor_definition->vehicle_physics_control.mass, " estimated ROS-class based on mass: ", classification_string()); } } @@ -88,9 +89,9 @@ class Object { : _actor_definition( std::static_pointer_cast(walker_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_PEDESTRIAN; - carla::log_verbose("Creating Walker Object[", _actor_definition->type_id, "] id: ", _actor_definition->id, - " object_type: ", _actor_definition->object_type, - " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); + carla::log_verbose("Creating Walker Object[", actor_definition().type_id, "] id: ", actor_definition().id, + " object_type: ", actor_definition().object_type, + " base_type: ", actor_definition().base_type, " ROS-class: ", classification_string()); } /** * The representation of an object in the sense of derived_object_msgs::msg::Object. @@ -101,9 +102,9 @@ class Object { : _actor_definition( std::static_pointer_cast(traffic_light_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; - carla::log_verbose("Creating Traffic Light Object[", _actor_definition->type_id, - "] id: ", _actor_definition->id, " object_type: ", _actor_definition->object_type, - " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); + carla::log_verbose("Creating Traffic Light Object[", actor_definition().type_id, + "] id: ", actor_definition().id, " object_type: ", actor_definition().object_type, + " base_type: ", actor_definition().base_type, " ROS-class: ", classification_string()); } /** * The representation of an object in the sense of derived_object_msgs::msg::Object. @@ -114,9 +115,9 @@ class Object { : _actor_definition( std::static_pointer_cast(traffic_sign_actor_definition)) { _classification = derived_object_msgs::msg::Object_Constants::CLASSIFICATION_SIGN; - carla::log_verbose("Creating Traffic Sign Object[", _actor_definition->type_id, - "] id: ", _actor_definition->id, " object_type: ", _actor_definition->object_type, - " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); + carla::log_verbose("Creating Traffic Sign Object[", actor_definition().type_id, + "] id: ", actor_definition().id, " object_type: ", actor_definition().object_type, + " base_type: ", actor_definition().base_type, " ROS-class: ", classification_string()); } explicit Object(carla::rpc::EnvironmentObject environment_object, bool enable_for_ros) @@ -167,15 +168,18 @@ class Object { // environment objects have a 64 bit unreal id, but Object.msg only supports uint32, // so we put the upper 32 bit of the actor id into the classification age, // so that we can correlate the object in the object list with the 64-bit id in the CarlaActorInfo list for environment objects - _classification_age = static_cast((_actor_definition->id>>32) & 0xFFFFFFFF); + _classification_age = static_cast((actor_definition().id>>32) & 0xFFFFFFFF); _actor_definition->attributes["Object.id"] = std::to_string(actor_id()); _actor_definition->attributes["Object.classification_age"] = std::to_string(_classification_age); actor_dynamic_state.transform = environment_object.transform; actor_dynamic_state.quaternion = carla::geom::Quaternion(environment_object.transform.rotation); + // make the bounding box location relative to the object transform + _actor_definition->bounding_box.location = actor_definition().bounding_box.location - environment_object.transform.location; + _actor_definition->bounding_box.rotation = carla::geom::Rotation(); UpdateObject(carla::ros2::types::Timestamp(), actor_dynamic_state); - carla::log_verbose("Creating Environment Object[", _actor_definition->type_id, - "] id: ", actor_id(), " object_type: ", _actor_definition->object_type, - " base_type: ", _actor_definition->base_type, " ROS-class: ", classification_string()); + carla::log_verbose("Creating Environment Object[", actor_definition().type_id, + "] id: ", actor_id(), " object_type: ", actor_definition().object_type, + " base_type: ", actor_definition().base_type, " ROS-class: ", classification_string(), " Bounding Box Location ", _actor_definition->bounding_box.location); } ~Object() = default; @@ -186,9 +190,6 @@ class Object { void UpdateObject(carla::ros2::types::Timestamp const& timestamp, carla::sensor::data::ActorDynamicState const& actor_dynamic_state) { - _bounding_box.extent = _actor_definition->bounding_box.extent; - _bounding_box.location = actor_dynamic_state.transform.location; - _bounding_box.rotation = actor_dynamic_state.transform.rotation; _transform = carla::ros2::types::Transform(actor_dynamic_state.transform, actor_dynamic_state.quaternion); _accelerated_movement.Update( carla::geom::Velocity(actor_dynamic_state.velocity), @@ -205,13 +206,15 @@ class Object { object.id(actor_id()); object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); object.object_classified(true); - object.pose(_transform.pose()); + object.pose(get_center_pose()); object.twist(_accelerated_movement.absolute_twist()); object.accel(_accelerated_movement.absolute_accel()); object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); - auto const ros_extent = _bounding_box.extent * 2.f; + auto const ros_extent = actor_definition().bounding_box.extent * 2.f; object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); - object.shape().polygon().points(*Polygon(_bounding_box.GetLocalVertices()).polygon()); + auto bounding_box_relative_to_pose = actor_definition().bounding_box; + bounding_box_relative_to_pose.location = carla::geom::Location(); + object.shape().polygon().points(*Polygon(bounding_box_relative_to_pose.GetLocalVertices()).polygon()); object.classification(_classification); object.classification_certainty(255u); object.classification_age(_classification_age); @@ -225,11 +228,11 @@ class Object { object.id(actor_id()); object.detection_level(derived_object_msgs::msg::Object_Constants::OBJECT_TRACKED); object.object_classified(true); - object.pose(_transform.pose_with_covariance()); + object.pose(get_center_pose_with_covariance()); object.twist(_accelerated_movement.absolute_twist_with_covariance()); object.accel(_accelerated_movement.absolute_accel_with_covariance()); object.shape().type(shape_msgs::msg::SolidPrimitive_Constants::BOX); - auto const ros_extent = _bounding_box.extent * 2.f; + auto const ros_extent = actor_definition().bounding_box.extent * 2.f; object.shape().dimensions({ros_extent.x, ros_extent.y, ros_extent.z}); object.classification(_classification); object.classification_certainty(255u); @@ -237,11 +240,31 @@ class Object { return object; } + geometry_msgs::msg::Pose get_center_pose() const { + auto ros_pose=_transform.pose(); + // the pose is the transform of the object reference point, the center of the bounding box + // might be shifted (usually half the height upwards) + auto center_offset = CoordinateSystemTransform::TransformLinearAxisMsg(actor_definition().bounding_box.location); + ros_pose.position().x(ros_pose.position().x() + center_offset.x()); + ros_pose.position().y(ros_pose.position().y() + center_offset.y()); + ros_pose.position().z(ros_pose.position().z() + center_offset.z()); + return ros_pose; + } + + geometry_msgs::msg::PoseWithCovariance get_center_pose_with_covariance() const { + geometry_msgs::msg::PoseWithCovariance ros_pose_with_covariance; + ros_pose_with_covariance.pose(get_center_pose()); + return ros_pose_with_covariance; + } + + + + /** * @brief check if dynamic content has changed (ignoring timestamp) */ bool has_dynamic_data_changed(derived_object_msgs::msg::Object const &other) const { - return (other.id()!=_actor_definition->id) + return (other.id()!=actor_definition().id) || (other.pose() != _transform.pose()) || (other.twist() != _accelerated_movement.absolute_twist()) || (other.accel() != _accelerated_movement.absolute_accel()); @@ -306,11 +329,11 @@ class Object { } carla_msgs::msg::CarlaActorInfo carla_actor_info(std::shared_ptr name_registry = nullptr) const { - return _actor_definition->carla_actor_info(name_registry); + return actor_definition().carla_actor_info(name_registry); } carla::streaming::detail::actor_id_type actor_id() const { - return static_cast(_actor_definition->id & 0xFFFFFFFF); } + return static_cast(actor_definition().id & 0xFFFFFFFF); } const carla::ros2::types::ActorDefinition& actor_definition()const { return *_actor_definition; } @@ -319,7 +342,6 @@ class Object { private: std::shared_ptr _actor_definition; uint8_t _classification{derived_object_msgs::msg::Object_Constants::CLASSIFICATION_UNKNOWN}; - carla::geom::BoundingBox _bounding_box; carla::ros2::types::Transform _transform; carla::ros2::types::AcceleratedMovement _accelerated_movement; uint32_t _classification_age{std::numeric_limits::max()}; diff --git a/LibCarla/source/carla/ros2/types/Transform.h b/LibCarla/source/carla/ros2/types/Transform.h index 2c682b3a52e..171cb00300e 100644 --- a/LibCarla/source/carla/ros2/types/Transform.h +++ b/LibCarla/source/carla/ros2/types/Transform.h @@ -85,7 +85,7 @@ class Transform { * * Uses ROS naming convention */ - const geometry_msgs::msg::Pose pose() const { + geometry_msgs::msg::Pose pose() const { geometry_msgs::msg::Pose ros_pose; ros_pose.position().x(_ros_transform.translation().x()); ros_pose.position().y(_ros_transform.translation().y()); @@ -99,7 +99,7 @@ class Transform { * * Uses ROS naming convention */ - const geometry_msgs::msg::PoseWithCovariance pose_with_covariance() const { + geometry_msgs::msg::PoseWithCovariance pose_with_covariance() const { geometry_msgs::msg::PoseWithCovariance ros_pose_with_covariance; ros_pose_with_covariance.pose(pose()); return ros_pose_with_covariance; From 83eb9e0e42cc88bbaa26ce1c617767067be129be Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 25 Mar 2026 11:49:46 +0100 Subject: [PATCH 37/39] ROS2 PublisherSensorType Add missing HSSLidar on conversion to string --- LibCarla/source/carla/ros2/types/PublisherSensorType.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LibCarla/source/carla/ros2/types/PublisherSensorType.h b/LibCarla/source/carla/ros2/types/PublisherSensorType.h index 89e41b52f74..13b9d665c3d 100644 --- a/LibCarla/source/carla/ros2/types/PublisherSensorType.h +++ b/LibCarla/source/carla/ros2/types/PublisherSensorType.h @@ -82,6 +82,8 @@ inline std::string to_string(carla::ros2::types::PublisherSensorType sensor_type return "V2X"; case carla::ros2::types::PublisherSensorType::V2XCustom: return "V2XCustom"; + case carla::ros2::types::PublisherSensorType::HSSLidar: + return "HSSLidar"; default: return "Unknown"; } From cb5e422e80ad3dc6486fa9b34ff15032a1a54928 Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Wed, 1 Apr 2026 17:51:29 +0200 Subject: [PATCH 38/39] ROS2: Fix weather publisher --- LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp index 79332ed8a6b..1bb9bacd9a9 100644 --- a/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp +++ b/LibCarla/source/carla/ros2/publishers/UeWorldPublisher.cpp @@ -157,6 +157,7 @@ void UeWorldPublisher::UpdateSensorDataPreAction() { } _world_info_publisher->UpdateSensorDataPreAction(); + _weather_publisher->UpdateSensorDataPreAction(); for (auto &ue_sensor : _ue_sensors) { if ( (ue_sensor.second.publisher != nullptr) && (ue_sensor.first != GetSensorActorDefinition()->stream_id) ) { From 1557bbe04a20d40eaa6160c47bdeea28eeaac50a Mon Sep 17 00:00:00 2001 From: berndgassmann Date: Mon, 18 May 2026 11:48:45 +0200 Subject: [PATCH 39/39] Allow configuration of absolute ros2 topic names And fix usage of ros_frame parameter --- .../source/carla/ros2/ROS2NameRegistry.cpp | 76 +++++++++++-------- .../ros2/publishers/UePublisherBaseCamera.cc | 7 +- .../carla/ros2/types/ActorNameDefinition.cpp | 14 +++- .../carla/ros2/types/ActorNameDefinition.h | 10 +++ .../Actor/ActorBlueprintFunctionLibrary.cpp | 6 ++ 5 files changed, 76 insertions(+), 37 deletions(-) diff --git a/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp b/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp index 5b629c4f23d..d139771df73 100644 --- a/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp +++ b/LibCarla/source/carla/ros2/ROS2NameRegistry.cpp @@ -220,7 +220,7 @@ ROS2NameRegistry::CreateTopicAndFrameLocked(ROS2NameRegistry::KeyType const& key ROS2NameRegistry::TopicAndFrame topic_and_frame("rt/carla"); // first bring in the parent hierarchy if present if (!parent_topic_and_frame._topic_name.empty()) { - if (parent_topic_and_frame._topic_name.find("rt/carla") == 0) { + if (parent_topic_and_frame._topic_name.find("rt") == 0) { topic_and_frame._topic_name = parent_topic_and_frame._topic_name; } else { topic_and_frame._topic_name += "/" + parent_topic_and_frame._topic_name; @@ -261,38 +261,48 @@ ROS2NameRegistry::CreateTopicAndFrameLocked(ROS2NameRegistry::KeyType const& key std::string individual_name; if (sensor_actor_definition != nullptr) { // on sensors we use the sensor name as additions type prefix - auto pos = actor_definition->ros_name.find_last_of('.'); - if (pos != std::string::npos) { - topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name.substr(pos + 1u), actor_definition->frame_id); - } else { + if ( actor_definition->ros_name_is_absolute ) { + // user wants to configure the full absolute names + topic_and_frame._topic_name = "rt"; + topic_and_frame._frame_id = ""; topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name, actor_definition->frame_id); } - // and use stream id as individualization - auto const stream_id_string = "/stream_" + number_to_three_letter_string(sensor_actor_definition->stream_id); - if (IsTopicNameAvailable(topic_and_frame, stream_id_string)) { - individual_name = stream_id_string; + else { + auto pos = actor_definition->ros_name.find_last_of('.'); + if (pos != std::string::npos) { + topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name.substr(pos + 1u), actor_definition->frame_id); + } else { + topic_and_frame = ExpandTopicName(topic_and_frame, actor_definition->ros_name, actor_definition->frame_id); + } + // and use stream id as individualization + auto const stream_id_string = "/stream_" + number_to_three_letter_string(sensor_actor_definition->stream_id); + if (IsTopicNameAvailable(topic_and_frame, stream_id_string)) { + individual_name = stream_id_string; + } } } - // the role name overrules other individualization - if (!actor_definition->role_name.empty()) { - if (IsTopicNameAvailable(topic_and_frame, actor_definition->role_name)) { - individual_name = actor_definition->role_name; + if ( (!actor_definition->ros_name_is_absolute) || !IsTopicNameAvailable(topic_and_frame, "")) { + // the role name overrules other individualization + if (!actor_definition->role_name.empty()) { + if (IsTopicNameAvailable(topic_and_frame, actor_definition->role_name)) { + individual_name = actor_definition->role_name; + } } - } - // no valid individualization yet, use actor id - if (individual_name.empty()) { - auto const actor_id_string = "actor_" + number_to_three_letter_string(actor_definition->id); - if (IsTopicNameAvailable(topic_and_frame, actor_id_string)) { - individual_name = actor_id_string; + // no valid individualization yet, use actor id + if (individual_name.empty()) { + auto const actor_id_string = "actor_" + number_to_three_letter_string(actor_definition->id); + if (IsTopicNameAvailable(topic_and_frame, actor_id_string)) { + individual_name = actor_id_string; + } } + // if also this doesn't help, we try with a random number using the actor_id as initialization + if (individual_name.empty()) { + std::srand(actor_definition->id); + individual_name = "randomid_" + number_to_three_letter_string(uint32_t(std::rand())); + } + topic_and_frame = ExpandTopicName(topic_and_frame, individual_name); } - // if also this doesn't help, we try with a random number using the actor_id as initialization - if (individual_name.empty()) { - std::srand(actor_definition->id); - individual_name = "randomid_" + number_to_three_letter_string(uint32_t(std::rand())); - } - topic_and_frame = ExpandTopicName(topic_and_frame, individual_name); auto insert_result = topic_and_frame_map.insert({key, topic_and_frame}); if (!insert_result.second) { @@ -309,8 +319,8 @@ ROS2NameRegistry::TopicAndFrame ROS2NameRegistry::ExpandTopicName(TopicAndFrame while (postfix_topic_adapted.front() == '/') { postfix_topic_adapted.erase(postfix_topic_adapted.begin()); } - std::string postfix_frame_adapted; - if ( postfix_frame.empty()) { + std::string postfix_frame_adapted = postfix_frame; + if ( postfix_frame_adapted.empty()) { postfix_frame_adapted = postfix_topic_adapted; } else { @@ -320,11 +330,13 @@ ROS2NameRegistry::TopicAndFrame ROS2NameRegistry::ExpandTopicName(TopicAndFrame } TopicAndFrame expanded_topic_and_frame = topic_and_frame; if ( !postfix_frame_adapted.empty() ) { - if (expanded_topic_and_frame._frame_id.back() != '/') { - expanded_topic_and_frame._frame_id.push_back('/'); - } - if (expanded_topic_and_frame._frame_id.front() == '/') { - expanded_topic_and_frame._frame_id.erase(0u, 1u); + if ( !expanded_topic_and_frame._frame_id.empty() ) { + if (expanded_topic_and_frame._frame_id.back() != '/') { + expanded_topic_and_frame._frame_id.push_back('/'); + } + if (expanded_topic_and_frame._frame_id.front() == '/') { + expanded_topic_and_frame._frame_id.erase(0u, 1u); + } } expanded_topic_and_frame._frame_id += postfix_frame_adapted; } diff --git a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc index 76e4f528bc0..4ff5ad17952 100644 --- a/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc +++ b/LibCarla/source/carla/ros2/publishers/UePublisherBaseCamera.cc @@ -20,7 +20,12 @@ UePublisherBaseCamera::UePublisherBaseCamera( template bool UePublisherBaseCamera::Init(std::shared_ptr domain_participant) { - return _image->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name("image"), + std::string image_topic_name = "image"; + if ( GetSensorActorDefinition()->ros_name_is_absolute ) { + // user wants exact topic name for image + image_topic_name = ""; + } + return _image->InitHistoryPreallocatedWithReallocMemoryMode(domain_participant, get_topic_name(image_topic_name), get_topic_qos()) && // camera info uses standard publisher qos _camera_info->Init(domain_participant, get_topic_name("camera_info"), PublisherBase::get_topic_qos()); diff --git a/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp b/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp index 9297eb0dc18..ed103314855 100644 --- a/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp +++ b/LibCarla/source/carla/ros2/types/ActorNameDefinition.cpp @@ -21,10 +21,16 @@ carla_msgs::msg::CarlaActorInfo ActorNameDefinition::carla_actor_info(std::share actor_info.base_type(base_type); if ( name_registry != nullptr ) { actor_info.parent_id(name_registry->ParentActorId(id)); - auto topic_prefix = name_registry->TopicPrefix(id); - if ( topic_prefix.length() >= 3 ) { - // remove "rt/" prefix - topic_prefix = topic_prefix.substr(3); + std::string topic_prefix; + if ( ros_name_is_absolute ) { + topic_prefix = ros_name; + } + else { + topic_prefix = name_registry->TopicPrefix(id); + if ( topic_prefix.length() >= 3 ) { + // remove "rt/" prefix + topic_prefix = topic_prefix.substr(3); + } } if ( topic_prefix.front() == '/') { // remove any leading "/" diff --git a/LibCarla/source/carla/ros2/types/ActorNameDefinition.h b/LibCarla/source/carla/ros2/types/ActorNameDefinition.h index 2d8d6c9ddaa..22b1bf33608 100644 --- a/LibCarla/source/carla/ros2/types/ActorNameDefinition.h +++ b/LibCarla/source/carla/ros2/types/ActorNameDefinition.h @@ -33,6 +33,7 @@ struct ActorNameDefinition { base_type(other.base_type), enabled_for_ros(other.enabled_for_ros), publish_tf(other.publish_tf), + ros_name_is_absolute(other.ros_name_is_absolute), frame_id(other.frame_id), city_object_label(city_object_label_), attributes(other.attributes) { @@ -64,6 +65,13 @@ struct ActorNameDefinition { else { publish_tf = Description.GetAttribute("ros_publish_tf").Value.ToBool(); } + std::string ros_name_absolute_string = TCHAR_TO_UTF8(*Description.GetAttribute("ros_name_is_absolute").Value); + if ( ros_name_absolute_string == "") { + ros_name_is_absolute = false; + } + else { + ros_name_is_absolute = Description.GetAttribute("ros_name_is_absolute").Value.ToBool(); + } for (auto const &ActorVariation: Description.Variations) { std::string key = TCHAR_TO_UTF8(*ActorVariation.Key); @@ -100,6 +108,7 @@ struct ActorNameDefinition { std::string base_type; bool enabled_for_ros{false}; bool publish_tf{true}; + bool ros_name_is_absolute{false}; std::string frame_id; carla::rpc::CityObjectLabel city_object_label{carla::rpc::CityObjectLabel::None}; std::map attributes; @@ -121,6 +130,7 @@ inline std::string to_string(carla::ros2::types::ActorNameDefinition const &acto << " base_type=" << actor_definition.base_type << " enabled_for_ros=" << std::to_string(actor_definition.enabled_for_ros) << " publish_tf=" << std::to_string(actor_definition.publish_tf) + << " ros_name_is_absolute" << std::to_string(actor_definition.ros_name_is_absolute) << " frame_id=" << actor_definition.frame_id; for (auto const &attribute: actor_definition.attributes) { str << " " << attribute.first << "=" << attribute.second; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp index 177da2fa10d..e364c5e29f4 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp @@ -235,6 +235,12 @@ static void FillIdAndTags(FActorDefinition &Def, TStrs && ... Strings) RosPublishTf.Type = EActorAttributeType::Bool; RosPublishTf.RecommendedValues = { TEXT("true")}; // true by default Def.Variations.Emplace(RosPublishTf); + + FActorVariation RosTopicNameAbsolute; + RosTopicNameAbsolute.Id = TEXT("ros_name_is_absolute"); + RosTopicNameAbsolute.Type = EActorAttributeType::Bool; + RosTopicNameAbsolute.RecommendedValues = { TEXT("false")}; // false by default + Def.Variations.Emplace(RosTopicNameAbsolute); } static void AddRecommendedValuesForActorRoleName(